diff --git a/PKG-INFO b/PKG-INFO index 6b2bef80..50b34dc3 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,202 +1,202 @@ Metadata-Version: 2.1 Name: swh.web -Version: 0.0.394 +Version: 0.0.395 Summary: Software Heritage Web UI Home-page: https://forge.softwareheritage.org/diffusion/DWUI/ Author: Software Heritage developers Author-email: swh-devel@inria.fr Project-URL: Bug Reports, https://forge.softwareheritage.org/maniphest Project-URL: Funding, https://www.softwareheritage.org/donate Project-URL: Source, https://forge.softwareheritage.org/source/swh-web Project-URL: Documentation, https://docs.softwareheritage.org/devel/swh-web/ Classifier: Programming Language :: Python :: 3 Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+) Classifier: Operating System :: OS Independent Classifier: Development Status :: 5 - Production/Stable Classifier: Framework :: Django Requires-Python: >=3.7 Description-Content-Type: text/markdown Provides-Extra: testing License-File: LICENSE License-File: AUTHORS # swh-web This repository holds the development of Software Heritage web applications: * swh-web API (https://archive.softwareheritage.org/api): enables to query the content of the archive through HTTP requests and get responses in JSON or YAML. * swh-web browse (https://archive.softwareheritage.org/browse): graphical interface that eases the navigation in the archive. Documentation about how to use these components but also the details of their URI schemes can be found in the docs folder. The produced HTML documentation can be read and browsed at https://docs.softwareheritage.org/devel/swh-web/index.html. ## Technical details Those applications are powered by: * [Django Web Framework](https://www.djangoproject.com/) on the backend side with the following extensions enabled: * [django-rest-framework](http://www.django-rest-framework.org/) * [django-webpack-loader](https://github.com/owais/django-webpack-loader) * [django-js-reverse](http://django-js-reverse.readthedocs.io/en/latest/) * [webpack](https://webpack.js.org/) on the frontend side for better static assets management, including: * assets dependencies management and retrieval through [yarn](https://yarnpkg.com/en/) * linting of custom javascript code (through [eslint](https://eslint.org/)) and stylesheets (through [stylelint](https://stylelint.io/)) * use of [es6](http://es6-features.org) syntax and advanced javascript feature like [async/await](https://javascript.info/async-await) or [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) thanks to [babel](https://babeljs.io/) (es6 to es5 transpiler and polyfills provider) * assets minification (using [terser](https://github.com/terser-js/terser) and [cssnano](http://cssnano.co/)) but also dead code elimination for production use ## How to build, run and test ### Backend requirements First you will need [Python 3](https://www.python.org) and a complete [swh development environment](https://forge.softwareheritage.org/source/swh-environment/) installed. To run the backend, you need to have the following [Python 3 modules](requirements.txt) installed. To run the backend tests, the following [Python 3 modules](requirements-test.txt) are also required to be installed. One easy way to install them is to use the `pip` tool: ``` $ pip install -r requirements.txt -r requirements-test.txt ``` ### Frontend requirements To compile the frontend assets, you need to have [nodejs](https://nodejs.org/en/) >= 14.0.0 and [yarn](https://yarnpkg.com/en/) installed. If you are on Debian, you can easily install an up to date nodejs from the [nodesource](https://github.com/nodesource/distributions/blob/master/README.md) repository. Packages for yarn can be installed by following [these instructions](https://yarnpkg.com/en/docs/install#debian-stable). Alternatively, you can install yarn with `npm install yarn`, and add `YARN=node_modules/yarn/bin/yarn` as argument whenever you run `make`. Please note that the static assets bundles generated by webpack are not stored in the git repository. Follow the instructions below in order to generate them in order to be able to run the frontend part of the web applications. ### Make targets to execute the applications Below is the list of available make targets that can be executed from the root directory of swh-web in order to build and/or execute the web applications under various configurations: * **run-django-webpack-devserver**: Compile and serve not optimized (without mignification and dead code elimination) frontend static assets using [webpack-dev-server](https://github.com/webpack/webpack-dev-server) and run django server with development settings. This is the recommended target to use when developing swh-web as it enables automatic reloading of backend and frontend part of the applications when modifying source files (*.py, *.js, *.css, *.html). * **run-django-webpack-dev**: Compile not optimized (no minification, no dead code elimination) frontend static assets using webpack and run django server with development settings. This is the recommended target when one only wants to develop the backend side of the application. * **run-django-webpack-prod**: Compile optimized (with minification and dead code elimination) frontend static assets using webpack and run django server with production settings. This is useful to test the applications in production mode (with the difference that static assets are served by django). Production settings notably enable advanced django caching and you will need to have [memcached](https://memcached.org/) installed for that feature to work. * **run-django-server-dev**: Run the django server with development settings but without compiling frontend static assets through webpack. * **run-django-server-prod**: Run the django server with production settings but without compiling frontend static assets through webpack. * **run-gunicorn-server**: Run the web applications with production settings in a [gunicorn](http://gunicorn.org/) worker as they will be in real production environment. Once one of these targets executed, the web applications can be executed by pointing your browser to http://localhost:5004. ### Make targets to test the applications Some make targets are also available to easily execute the backend and frontend tests of the Software Heritage web applications. The backend tests are powered by the [pytest](https://docs.pytest.org/en/latest/) and [hypothesis](https://hypothesis.readthedocs.io/en/latest/) frameworks while the frontend ones rely on the use of the [cypress](https://www.cypress.io/) tool. Below is the exhaustive list of those targets: * **test**: execute the backend tests using a fast hypothesis profile (only one input example will be provided for each test) * **test-full**: execute the backend tests using a slower hypothesis profile (one hundred of input examples will be provided for each test which helps spotting possible bugs) * **test-frontend**: execute the frontend tests using cypress in headless mode but with some slow test suites disabled * **test-frontend-full**: execute the frontend tests using cypress in headless mode with all test suites enabled * **test-frontend-ui**: execute the frontend tests using the cypress GUI but with some slow test suites disabled * **test-frontend-full-ui**: execute the frontend tests using the cypress GUI with all test suites enabled ### Yarn targets Below is a list of available yarn targets in order to only execute the frontend static assets compilation (no web server will be executed): * **build-dev**: compile not optimized (without mignification and dead code elimination) frontend static assets and store the results in the `swh/web/static` folder. * **build**: compile optimized (with mignification and dead code elimination) frontend static assets and store the results in the `swh/web/static` folder. **The build target must be executed prior performing the Debian packaging of swh-web** in order for the package to contain the optimized assets dedicated to production environment. To execute these targets, issue the following command: ``` $ yarn ``` diff --git a/assets/src/bundles/webapp/readme-rendering.js b/assets/src/bundles/webapp/readme-rendering.js index 3cb56fae..3d7b9934 100644 --- a/assets/src/bundles/webapp/readme-rendering.js +++ b/assets/src/bundles/webapp/readme-rendering.js @@ -1,118 +1,127 @@ /** * Copyright (C) 2018-2021 The Software Heritage developers * See the AUTHORS file at the top-level directory of this distribution * License: GNU Affero General Public License version 3, or any later version * See top-level LICENSE file for more information */ import {handleFetchError} from 'utils/functions'; import {decode} from 'html-encoder-decoder'; export async function renderMarkdown(domElt, markdownDocUrl) { const showdown = await import(/* webpackChunkName: "showdown" */ 'utils/showdown'); await import(/* webpackChunkName: "highlightjs" */ 'utils/highlightjs'); // Adapted from https://github.com/Bloggify/showdown-highlight // Copyright (c) 2016-19 Bloggify (https://bloggify.org) function showdownHighlight() { return [{ type: 'output', filter: function(text, converter, options) { const left = '
]*>';
         const right = '
'; const flags = 'g'; const classAttr = 'class="'; const replacement = (wholeMatch, match, left, right) => { match = decode(match); const lang = (left.match(/class="([^ "]+)/) || [])[1]; if (left.includes(classAttr)) { const attrIndex = left.indexOf(classAttr) + classAttr.length; left = left.slice(0, attrIndex) + 'hljs ' + left.slice(attrIndex); } else { left = left.slice(0, -1) + ' class="hljs">'; } if (lang && hljs.getLanguage(lang)) { return left + hljs.highlight(match, {language: lang}).value + right; } else { return left + match + right; } }; return showdown.helper.replaceRecursiveRegExp(text, replacement, left, right, flags); } }]; } $(document).ready(async() => { const converter = new showdown.Converter({ tables: true, extensions: [showdownHighlight] }); + const url = new URL(window.location.href); + if (url.searchParams.has('origin_url')) { + try { + const originUrl = new URL(url.searchParams.get('origin_url')); + if (originUrl.hostname === 'github.com') { + converter.setFlavor('github'); + } + } catch (TypeError) {} + } try { const response = await fetch(markdownDocUrl); handleFetchError(response); const data = await response.text(); $(domElt).addClass('swh-showdown'); $(domElt).html(swh.webapp.filterXSS(converter.makeHtml(data))); } catch (_) { $(domElt).text('Readme bytes are not available'); } }); } export async function renderOrgData(domElt, orgDocData) { const org = await import(/* webpackChunkName: "org" */ 'utils/org'); const parser = new org.Parser(); const orgDocument = parser.parse(orgDocData, {toc: false}); const orgHTMLDocument = orgDocument.convert(org.ConverterHTML, {}); $(domElt).addClass('swh-org'); $(domElt).html(swh.webapp.filterXSS(orgHTMLDocument.toString())); // remove toc and section numbers to get consistent // with other readme renderings $('.swh-org ul').first().remove(); $('.section-number').remove(); } export function renderOrg(domElt, orgDocUrl) { $(document).ready(async() => { try { const response = await fetch(orgDocUrl); handleFetchError(response); const data = await response.text(); renderOrgData(domElt, data); } catch (_) { $(domElt).text('Readme bytes are not available'); } }); } export function renderTxt(domElt, txtDocUrl) { $(document).ready(async() => { try { const response = await fetch(txtDocUrl); handleFetchError(response); const data = await response.text(); const orgMode = '-*- mode: org -*-'; if (data.indexOf(orgMode) !== -1) { renderOrgData(domElt, data.replace(orgMode, '')); } else { $(domElt).addClass('swh-readme-txt'); $(domElt) .html('') .append($('
').text(data));
       }
     } catch (_) {
       $(domElt).text('Readme bytes are not available');
     }
   });
 }
diff --git a/cypress/e2e/add-forge-now-request-create.cy.js b/cypress/e2e/add-forge-now-request-create.cy.js
index e1414ff7..763e463f 100644
--- a/cypress/e2e/add-forge-now-request-create.cy.js
+++ b/cypress/e2e/add-forge-now-request-create.cy.js
@@ -1,258 +1,258 @@
 /**
  * Copyright (C) 2022  The Software Heritage developers
  * See the AUTHORS file at the top-level directory of this distribution
  * License: GNU Affero General Public License version 3, or any later version
  * See top-level LICENSE file for more information
  */
 
 function populateForm(type, url, contact, email, consent, comment) {
   cy.get('#swh-input-forge-type').select(type);
-  cy.get('#swh-input-forge-url').clear().type(url, {delay: 0, force: true});
-  cy.get('#swh-input-forge-contact-name').clear().type(contact, {delay: 0, force: true});
-  cy.get('#swh-input-forge-contact-email').clear().type(email, {delay: 0, force: true});
+  cy.get('#swh-input-forge-url').clear().type(url);
+  cy.get('#swh-input-forge-contact-name').clear().type(contact);
+  cy.get('#swh-input-forge-contact-email').clear().type(email);
   if (comment) {
-    cy.get('#swh-input-forge-comment').clear().type(comment, {delay: 0, force: true});
+    cy.get('#swh-input-forge-comment').clear().type(comment);
   }
   cy.get('#swh-input-consent-check').click({force: consent === 'on'});
 }
 
 describe('Browse requests list tests', function() {
   beforeEach(function() {
     this.addForgeNowUrl = this.Urls.forge_add_create();
     this.listAddForgeRequestsUrl = this.Urls.add_forge_request_list_datatables();
   });
 
   it('should not show user requests filter checkbox for anonymous users', function() {
     cy.visit(this.addForgeNowUrl);
     cy.get('#swh-add-forge-requests-list-tab').click();
     cy.get('#swh-add-forge-user-filter').should('not.exist');
   });
 
   it('should show user requests filter checkbox for authenticated users', function() {
     cy.userLogin();
     cy.visit(this.addForgeNowUrl);
     cy.get('#swh-add-forge-requests-list-tab').click();
     cy.get('#swh-add-forge-user-filter').should('exist').should('be.checked');
   });
 
   it('should only display user requests when filter is activated', function() {
     // Clean up previous state
     cy.task('db:add_forge_now:delete');
     // 'user2' logs in and create requests
     cy.user2Login();
     cy.visit(this.addForgeNowUrl);
 
     // create requests for the user 'user'
     populateForm('gitlab', 'gitlab.org', 'admin', 'admin@example.org', 'on', '');
     cy.get('#requestCreateForm').submit();
 
     // user requests filter checkbox should be in the DOM
     cy.get('#swh-add-forge-requests-list-tab').click();
     cy.get('#swh-add-forge-user-filter').should('exist').should('be.checked');
 
     // check unfiltered user requests
     cy.get('tbody tr').then(rows => {
       expect(rows.length).to.eq(1);
     });
 
     // user1 logout
     cy.contains('a', 'logout').click();
 
     // user logs in
     cy.userLogin();
     cy.visit(this.addForgeNowUrl);
 
     populateForm('gitea', 'gitea.org', 'admin', 'admin@example.org', 'on', '');
     cy.get('#requestCreateForm').submit();
     populateForm('cgit', 'cgit.org', 'admin', 'admin@example.org', 'on', '');
     cy.get('#requestCreateForm').submit();
 
     // user requests filter checkbox should be in the DOM
     cy.get('#swh-add-forge-requests-list-tab').click();
     cy.get('#swh-add-forge-user-filter').should('exist').should('be.checked');
 
     // check unfiltered user requests
     cy.get('tbody tr').then(rows => {
       expect(rows.length).to.eq(2);
     });
 
     cy.get('#swh-add-forge-user-filter')
       .uncheck({force: true});
 
     // Users now sees everything
     cy.get('tbody tr').then(rows => {
       expect(rows.length).to.eq(2 + 1);
     });
   });
 });
 
 describe('Test add-forge-request creation', function() {
   beforeEach(function() {
     this.addForgeNowUrl = this.Urls.forge_add_create();
   });
 
   it('should show all the tabs for every user', function() {
     cy.visit(this.addForgeNowUrl);
 
     cy.get('#swh-add-forge-tab')
       .should('have.class', 'nav-link');
 
     cy.get('#swh-add-forge-requests-list-tab')
       .should('have.class', 'nav-link');
 
     cy.get('#swh-add-forge-requests-help-tab')
       .should('have.class', 'nav-link');
   });
 
   it('should show create forge tab by default', function() {
     cy.visit(this.addForgeNowUrl);
 
     cy.get('#swh-add-forge-tab')
       .should('have.class', 'active');
 
     cy.get('#swh-add-forge-requests-list-tab')
       .should('not.have.class', 'active');
   });
 
   it('should show login link for anonymous user', function() {
     cy.visit(this.addForgeNowUrl);
 
     cy.get('#loginLink')
       .should('be.visible')
       .should('contain', 'log in');
   });
 
   it('should bring back after login', function() {
     cy.visit(this.addForgeNowUrl);
 
     cy.get('#loginLink')
       .should('have.attr', 'href')
       .and('include', `${this.Urls.login()}?next=${this.Urls.forge_add_create()}`);
   });
 
   it('should change tabs on click', function() {
     cy.visit(this.addForgeNowUrl);
 
     cy.get('#swh-add-forge-requests-list-tab').click();
     cy.get('#swh-add-forge-tab')
       .should('not.have.class', 'active');
     cy.get('#swh-add-forge-requests-list-tab')
       .should('have.class', 'active');
     cy.get('#swh-add-forge-requests-help-tab')
       .should('not.have.class', 'active');
     cy.url()
       .should('include', `${this.Urls.forge_add_list()}`);
 
     cy.get('#swh-add-forge-requests-help-tab').click();
     cy.get('#swh-add-forge-tab')
       .should('not.have.class', 'active');
     cy.get('#swh-add-forge-requests-list-tab')
       .should('not.have.class', 'active');
     cy.get('#swh-add-forge-requests-help-tab')
       .should('have.class', 'active');
     cy.url()
       .should('include', `${this.Urls.forge_add_help()}`);
 
     cy.get('#swh-add-forge-tab').click();
     cy.get('#swh-add-forge-tab')
       .should('have.class', 'active');
     cy.get('#swh-add-forge-requests-list-tab')
       .should('not.have.class', 'active');
     cy.get('#swh-add-forge-requests-help-tab')
       .should('not.have.class', 'active');
     cy.url()
       .should('include', `${this.Urls.forge_add_create()}`);
   });
 
   it('should show create form elements to authenticated user', function() {
     cy.userLogin();
     cy.visit(this.addForgeNowUrl);
 
     cy.get('#swh-input-forge-type')
       .should('be.visible');
 
     cy.get('#swh-input-forge-url')
       .should('be.visible');
 
     cy.get('#swh-input-forge-contact-name')
       .should('be.visible');
 
     cy.get('#swh-input-consent-check')
       .should('be.visible');
 
     cy.get('#swh-input-forge-comment')
       .should('be.visible');
 
     cy.get('#swh-input-form-submit')
       .should('be.visible');
   });
 
   it('should show browse requests table for every user', function() {
     // testing only for anonymous
     cy.visit(this.addForgeNowUrl);
 
     cy.get('#swh-add-forge-requests-list-tab').click();
     cy.get('#add-forge-request-browse')
       .should('be.visible');
 
     cy.get('#loginLink')
       .should('not.exist');
   });
 
   it('should update browse list on successful submission', function() {
     cy.userLogin();
     cy.visit(this.addForgeNowUrl);
     populateForm('bitbucket', 'gitlab.com', 'test', 'test@example.com', 'on', 'test comment');
     cy.get('#requestCreateForm').submit();
 
     cy.visit(this.addForgeNowUrl);
     cy.get('#swh-add-forge-requests-list-tab').click();
     cy.get('#add-forge-request-browse')
       .should('be.visible')
       .should('contain', 'gitlab.com');
 
     cy.get('#add-forge-request-browse')
       .should('be.visible')
       .should('contain', 'Pending');
   });
 
   it('should show error message on conflict', function() {
     cy.userLogin();
     cy.visit(this.addForgeNowUrl);
     populateForm('bitbucket', 'gitlab.com', 'test', 'test@example.com', 'on', 'test comment');
     cy.get('#requestCreateForm').submit();
 
     cy.get('#requestCreateForm').submit(); // Submitting the same data again
 
     cy.get('#userMessage')
       .should('have.class', 'badge-danger')
       .should('contain', 'already exists');
   });
 
   it('should show error message', function() {
     cy.userLogin();
 
     cy.intercept('POST', `${this.Urls.api_1_add_forge_request_create()}**`,
                  {
                    body: {
                      'exception': 'BadInputExc',
                      'reason': '{"add-forge-comment": ["This field is required"]}'
                    },
                    statusCode: 400
                  }).as('errorRequest');
 
     cy.visit(this.addForgeNowUrl);
 
     populateForm(
       'bitbucket', 'gitlab.com', 'test', 'test@example.com', 'off', 'comment'
     );
     cy.get('#requestCreateForm').submit();
 
     cy.wait('@errorRequest').then((xhr) => {
       cy.get('#userMessage')
         .should('have.class', 'badge-danger')
         .should('contain', 'field is required');
     });
   });
 
 });
diff --git a/cypress/e2e/deposit-admin.cy.js b/cypress/e2e/deposit-admin.cy.js
index a79daa4e..5b4c6890 100644
--- a/cypress/e2e/deposit-admin.cy.js
+++ b/cypress/e2e/deposit-admin.cy.js
@@ -1,239 +1,239 @@
 /**
  * Copyright (C) 2020-2022  The Software Heritage developers
  * See the AUTHORS file at the top-level directory of this distribution
  * License: GNU Affero General Public License version 3, or any later version
  * See top-level LICENSE file for more information
  */
 
 // data to use as request query response
 let responseDeposits;
 let expectedOrigins;
 let depositModerationUrl;
 let depositListUrl;
 
 const $ = Cypress.$;
 
 describe('Test moderation deposit Login/logout', function() {
   before(function() {
     depositModerationUrl = this.Urls.admin_deposit();
   });
 
   it('should not display deposit moderation link in sidebar when anonymous', function() {
     cy.visit(depositModerationUrl);
     cy.get(`.sidebar a[href="${depositModerationUrl}"]`)
       .should('not.exist');
   });
 
   it('should not display deposit moderation link when connected as unprivileged user', function() {
     cy.userLogin();
     cy.visit(depositModerationUrl);
 
     cy.get(`.sidebar a[href="${depositModerationUrl}"]`)
       .should('not.exist');
 
   });
 
   it('should display deposit moderation link in sidebar when connected as privileged user', function() {
     cy.depositLogin();
     cy.visit(depositModerationUrl);
 
     cy.get(`.sidebar a[href="${depositModerationUrl}"]`)
       .should('exist');
   });
 
   it('should display deposit moderation link in sidebar when connected as staff member', function() {
     cy.adminLogin();
     cy.visit(depositModerationUrl);
 
     cy.get(`.sidebar a[href="${depositModerationUrl}"]`)
       .should('exist');
   });
 
 });
 
 describe('Test admin deposit page', function() {
   before(function() {
     depositModerationUrl = this.Urls.admin_deposit();
     depositListUrl = this.Urls.admin_deposit_list();
   });
 
   beforeEach(() => {
     responseDeposits = [
       {
         'id': 614,
         'type': 'code',
         'external_id': 'ch-de-1',
         'reception_date': '2020-05-18T13:48:27Z',
         'status': 'done',
         'status_detail': null,
         'swhid': 'swh:1:dir:ef04a768',
         'swhid_context': 'swh:1:dir:ef04a768;origin=https://w.s.o/c-d-1;visit=swh:1:snp:b234be1e;anchor=swh:1:rev:d24a75c9;path=/',
         'raw_metadata': 'bar',
         'uri': 'https://w.s.o/c-d-1'
       },
       {
         'id': 613,
         'type': 'code',
         'external_id': 'ch-de-2',
         'reception_date': '2020-05-18T11:20:16Z',
         'status': 'done',
         'status_detail': null,
         'swhid': 'swh:1:dir:181417fb',
         'swhid_context': 'swh:1:dir:181417fb;origin=https://w.s.o/c-d-2;visit=swh:1:snp:8c32a2ef;anchor=swh:1:rev:3d1eba04;path=/',
         'raw_metadata': null,
         'uri': 'https://w.s.o/c-d-2'
       },
       {
         'id': 612,
         'type': 'code',
         'external_id': 'ch-de-3',
         'reception_date': '2020-05-18T11:20:16Z',
         'status': 'rejected',
         'status_detail': 'incomplete deposit!',
         'swhid': null,
         'swhid_context': null,
         'raw_metadata': null,
         'uri': null
       }
     ];
     // those are computed from the
     expectedOrigins = {
       614: 'https://w.s.o/c-d-1',
       613: 'https://w.s.o/c-d-2',
       612: ''
     };
 
   });
 
   it('Should properly display entries', function() {
     cy.adminLogin();
 
     const testDeposits = responseDeposits;
     cy.intercept(`${depositListUrl}**`, {
       body: {
         'draw': 10,
         'recordsTotal': testDeposits.length,
         'recordsFiltered': testDeposits.length,
         'data': testDeposits
       }
     }).as('listDeposits');
 
     cy.visit(depositModerationUrl);
 
     cy.location('pathname')
       .should('be.equal', depositModerationUrl);
 
     cy.get('#swh-admin-deposit-list')
       .should('exist');
 
     cy.wait('@listDeposits').then((xhr) => {
       cy.log('response:', xhr.response);
       cy.log(xhr.response.body);
       const deposits = xhr.response.body.data;
       cy.log('Deposits: ', deposits);
       expect(deposits.length).to.equal(testDeposits.length);
 
       cy.get('#swh-admin-deposit-list').find('tbody > tr').as('rows');
 
       // only 2 entries
       cy.get('@rows').each((row, idx, collection) => {
         const cells = row[0].cells;
         const deposit = deposits[idx];
         const responseDeposit = testDeposits[idx];
         assert.isNotNull(deposit);
         assert.isNotNull(responseDeposit);
         expect(deposit.id).to.be.equal(responseDeposit['id']);
         expect(deposit.uri).to.be.equal(responseDeposit['uri']);
         expect(deposit.type).to.be.equal(responseDeposit['type']);
         expect(deposit.external_id).to.be.equal(responseDeposit['external_id']);
         expect(deposit.status).to.be.equal(responseDeposit['status']);
         expect(deposit.status_detail).to.be.equal(responseDeposit['status_detail']);
         expect(deposit.swhid).to.be.equal(responseDeposit['swhid']);
         expect(deposit.swhid_context).to.be.equal(responseDeposit['swhid_context']);
 
         const expectedOrigin = expectedOrigins[deposit.id];
         // ensure it's in the dom
         cy.contains(deposit.id).should('be.visible');
         if (deposit.status !== 'rejected') {
           expect(row).to.not.contain(deposit.external_id);
           cy.contains(expectedOrigin).should('be.visible');
         }
 
         if (deposit.uri && deposit.swhid_context) {
           let html = `${deposit.uri}`;
           html += ` `;
           html += '';
           expect($(cells[2]).html()).to.contain(html);
         } else if (!deposit.uri) {
           expect($(cells[2]).text().trim()).to.equal('');
         }
 
         cy.contains(deposit.status).should('be.visible');
         // those are hidden by default, so now visible
         if (deposit.status_detail !== null) {
           cy.contains(deposit.status_detail).should('not.exist');
         }
 
         // those are hidden by default
         if (deposit.swhid !== null) {
           cy.contains(deposit.swhid).should('not.exist');
           cy.contains(deposit.swhid_context).should('not.exist');
         }
 
         if (deposit.raw_metadata !== null) {
           cy.get('button.metadata', {withinSubject: row})
             .should('exist')
             .should('have.text', 'display')
             .click({force: true});
           cy.get('#swh-web-modal-html code.xml').should('be.visible');
 
           // Dismiss the modal
-          cy.get('body').wait(500).type('{esc}');
+          cy.wait(500).get('#swh-web-modal-html .close').click();
           cy.get('#swh-web-modal-html code.xml').should('not.be.visible');
         } else {
           cy.get('button.metadata', {withinSubject: row}).should('not.exist');
           cy.get('#swh-web-modal-html code.xml').should('not.be.visible');
         }
 
       });
 
       // toggling all links and ensure, the previous checks are inverted
       cy.get('a.toggle-col').click({'multiple': true}).then(() => {
         cy.get('#swh-admin-deposit-list').find('tbody > tr').as('rows');
 
         cy.get('@rows').each((row, idx, collection) => {
           const deposit = deposits[idx];
           const expectedOrigin = expectedOrigins[deposit.id];
 
           // ensure it's in the dom
           expect(row).to.not.contain(deposit.id);
           if (deposit.status !== 'rejected') {
             expect(row).to.not.contain(deposit.external_id);
             expect(row).to.contain(expectedOrigin);
           }
 
           expect(row).to.not.contain(deposit.status);
           // those are hidden by default, so now visible
           if (deposit.status_detail !== null) {
             cy.contains(deposit.status_detail).should('be.visible');
           }
 
           // those are hidden by default, so now they should be visible
           if (deposit.swhid !== null) {
             cy.contains(deposit.swhid).should('be.visible');
             cy.contains(deposit.swhid_context).should('be.visible');
             // check SWHID link text formatting
             cy.contains(deposit.swhid_context).then(elt => {
               expect(elt[0].innerHTML).to.equal(deposit.swhid_context.replace(/;/g, ';
')); }); } }); }); cy.get('#swh-admin-deposit-list-error') .should('not.contain', 'An error occurred while retrieving the list of deposits'); }); }); }); diff --git a/cypress/e2e/mailmap.cy.js b/cypress/e2e/mailmap.cy.js index d9ee1fde..10c350ab 100644 --- a/cypress/e2e/mailmap.cy.js +++ b/cypress/e2e/mailmap.cy.js @@ -1,226 +1,226 @@ /** * Copyright (C) 2022 The Software Heritage developers * See the AUTHORS file at the top-level directory of this distribution * License: GNU Affero General Public License version 3, or any later version * See top-level LICENSE file for more information */ const $ = Cypress.$; function fillFormAndSubmitMailmap(fromEmail, displayName, activated) { if (fromEmail) { cy.get('#swh-mailmap-from-email') .clear() - .type(fromEmail, {delay: 0, force: true}); + .type(fromEmail); } if (displayName) { cy.get('#swh-mailmap-display-name') .clear() - .type(displayName, {delay: 0, force: true}); + .type(displayName); } if (activated) { cy.get('#swh-mailmap-display-name-activated') .check({force: true}); } else { cy.get('#swh-mailmap-display-name-activated') .uncheck({force: true}); } cy.get('#swh-mailmap-form-submit') .click(); } function addNewMailmap(fromEmail, displayName, activated) { cy.get('#swh-add-new-mailmap') .click(); fillFormAndSubmitMailmap(fromEmail, displayName, activated); } function updateMailmap(fromEmail, displayName, activated) { cy.contains('Edit') .click(); fillFormAndSubmitMailmap(fromEmail, displayName, activated); } function checkMailmapRow(fromEmail, displayName, activated, processed = false, row = 1, nbRows = 1) { cy.get('tbody tr').then(rows => { assert.equal(rows.length, 1); const cells = rows[0].cells; assert.equal($(cells[0]).text(), fromEmail); assert.include($(cells[1]).html(), 'mdi-check-bold'); assert.equal($(cells[2]).text(), displayName); assert.include($(cells[3]).html(), activated ? 'mdi-check-bold' : 'mdi-close-thick'); assert.notEqual($(cells[4]).text(), ''); assert.include($(cells[5]).html(), processed ? 'mdi-check-bold' : 'mdi-close-thick'); }); } describe('Test mailmap administration', function() { before(function() { this.url = this.Urls.admin_mailmap(); }); beforeEach(function() { cy.task('db:user_mailmap:delete'); cy.intercept('POST', this.Urls.profile_mailmap_add()) .as('mailmapAdd'); cy.intercept('POST', this.Urls.profile_mailmap_update()) .as('mailmapUpdate'); cy.intercept(`${this.Urls.profile_mailmap_list_datatables()}**`) .as('mailmapList'); }); it('should not display mailmap admin link in sidebar when anonymous', function() { cy.visit(this.url); cy.get('.swh-mailmap-admin-item') .should('not.exist'); }); it('should not display mailmap admin link when connected as unprivileged user', function() { cy.userLogin(); cy.visit(this.url); cy.get('.swh-mailmap-admin-item') .should('not.exist'); }); it('should display mailmap admin link in sidebar when connected as privileged user', function() { cy.mailmapAdminLogin(); cy.visit(this.url); cy.get('.swh-mailmap-admin-item') .should('exist'); }); it('should not create a new mailmap when input data are empty', function() { cy.mailmapAdminLogin(); cy.visit(this.url); addNewMailmap('', '', true); cy.get('#swh-mailmap-form :invalid').should('exist'); cy.get('#swh-mailmap-form') .should('be.visible'); }); it('should not create a new mailmap when from email is invalid', function() { cy.mailmapAdminLogin(); cy.visit(this.url); addNewMailmap('invalid_email', 'display name', true); cy.get('#swh-mailmap-form :invalid').should('exist'); cy.get('#swh-mailmap-form') .should('be.visible'); }); it('should create a new mailmap when input data are valid', function() { cy.mailmapAdminLogin(); cy.visit(this.url); const fromEmail = 'user@example.org'; const displayName = 'New user display name'; addNewMailmap(fromEmail, displayName, true); cy.wait('@mailmapAdd'); cy.get('#swh-mailmap-form :invalid').should('not.exist'); // ensure table redraw before next check cy.contains(fromEmail); cy.get('#swh-mailmap-form') .should('not.be.visible'); checkMailmapRow(fromEmail, displayName, true); }); it('should not create a new mailmap for an email already mapped', function() { cy.mailmapAdminLogin(); cy.visit(this.url); const fromEmail = 'user@example.org'; const displayName = 'New user display name'; addNewMailmap(fromEmail, displayName, true); cy.wait('@mailmapAdd'); addNewMailmap(fromEmail, displayName, true); cy.wait('@mailmapAdd'); cy.get('#swh-mailmap-form') .should('not.be.visible'); cy.contains('Error') .should('be.visible'); checkMailmapRow(fromEmail, displayName, true); }); it('should update a mailmap', function() { cy.mailmapAdminLogin(); cy.visit(this.url); const fromEmail = 'user@example.org'; const displayName = 'New display name'; addNewMailmap(fromEmail, displayName, false); cy.wait('@mailmapAdd'); cy.get('#swh-mailmap-form :invalid').should('not.exist'); // ensure table redraw before next check cy.contains(fromEmail); cy.get('#swh-mailmap-form') .should('not.be.visible'); checkMailmapRow(fromEmail, displayName, false); const newDisplayName = 'Updated display name'; updateMailmap('', newDisplayName, true); cy.wait('@mailmapUpdate'); cy.get('#swh-mailmap-form :invalid').should('not.exist'); // ensure table redraw before next check cy.contains(fromEmail); cy.get('#swh-mailmap-form') .should('not.be.visible'); checkMailmapRow(fromEmail, newDisplayName, true); }); it('should indicate when a mailmap has been processed', function() { cy.mailmapAdminLogin(); cy.visit(this.url); const fromEmail = 'user@example.org'; const displayName = 'New user display name'; addNewMailmap(fromEmail, displayName, true); cy.wait('@mailmapAdd'); // ensure table redraw before next check cy.contains(fromEmail); checkMailmapRow(fromEmail, displayName, true, false); cy.task('db:user_mailmap:mark_processed'); cy.visit(this.url); checkMailmapRow(fromEmail, displayName, true, true); }); }); diff --git a/cypress/e2e/origin-search.cy.js b/cypress/e2e/origin-search.cy.js index 3e56ca82..d9934c96 100644 --- a/cypress/e2e/origin-search.cy.js +++ b/cypress/e2e/origin-search.cy.js @@ -1,653 +1,653 @@ /** * Copyright (C) 2019-2021 The Software Heritage developers * See the AUTHORS file at the top-level directory of this distribution * License: GNU Affero General Public License version 3, or any later version * See top-level LICENSE file for more information */ const nonExistentText = 'NoMatchExists'; let origin; let url; function doSearch(searchText, searchInputElt = '#swh-origins-url-patterns') { if (searchText.startsWith('swh:')) { cy.intercept('**/api/1/resolve/**') .as('swhidResolve'); } cy.get(searchInputElt) // to avoid sending too much SWHID validation requests // as cypress insert character one by one when using type .invoke('val', searchText.slice(0, -1)) .type(searchText.slice(-1)) .get('.swh-search-icon') .click({force: true}); if (searchText.startsWith('swh:')) { cy.wait('@swhidResolve'); } } function searchShouldRedirect(searchText, redirectUrl) { doSearch(searchText); cy.location('pathname') .should('equal', redirectUrl); } function searchShouldShowNotFound(searchText, msg) { doSearch(searchText); if (searchText.startsWith('swh:')) { cy.get('.invalid-feedback') .should('be.visible') .and('contain', msg); } } function stubOriginVisitLatestRequests(status = 200, response = {type: 'tar'}, aliasSuffix = '') { cy.intercept({url: '**/visit/latest/**'}, { body: response, statusCode: status }).as(`originVisitLatest${aliasSuffix}`); } describe('Test origin-search', function() { before(function() { origin = this.origin[0]; url = this.Urls.browse_search(); }); beforeEach(function() { cy.visit(url); }); it('should have focus on search form after page load', function() { cy.get('#swh-origins-url-patterns') .should('have.attr', 'autofocus'); // for some reason, autofocus is not honored when running cypress tests // while it is in non controlled browsers // .should('have.focus'); }); it('should redirect to browse when archived URL is searched', function() { cy.get('#swh-origins-url-patterns') .type(origin.url); cy.get('.swh-search-icon') .click(); cy.location('pathname') .should('eq', this.Urls.browse_origin_directory()); cy.location('search') .should('eq', `?origin_url=${origin.url}`); }); it('should not redirect for non valid URL', function() { cy.get('#swh-origins-url-patterns') .type('www.example'); // Invalid URL cy.get('.swh-search-icon') .click(); cy.location('pathname') .should('eq', this.Urls.browse_search()); // Stay in the current page }); it('should not redirect for valid non archived URL', function() { cy.get('#swh-origins-url-patterns') .type('http://eaxmple.com/test/'); // Valid URL, but not archived cy.get('.swh-search-icon') .click(); cy.location('pathname') .should('eq', this.Urls.browse_search()); // Stay in the current page }); it('should remove origin URL with no archived content', function() { stubOriginVisitLatestRequests(404); // Using a non full origin URL here // This is because T3354 redirects to the origin in case of a valid, archived URL cy.get('#swh-origins-url-patterns') .type(origin.url.slice(0, -1)); cy.get('.swh-search-icon') .click(); cy.wait('@originVisitLatest'); cy.get('#origin-search-results') .should('be.visible') .find('tbody tr').should('have.length', 0); stubOriginVisitLatestRequests(200, {}, '2'); cy.get('.swh-search-icon') .click(); cy.wait('@originVisitLatest2'); cy.get('#origin-search-results') .should('be.visible') .find('tbody tr').should('have.length', 0); }); it('should filter origins by visit type', function() { cy.intercept('**/visit/latest/**').as('checkOriginVisits'); cy.get('#swh-origins-url-patterns') .type('http'); for (const visitType of ['git', 'tar']) { cy.get('#swh-search-visit-type') .select(visitType); cy.get('.swh-search-icon') .click(); cy.wait('@checkOriginVisits'); cy.get('#origin-search-results') .should('be.visible'); cy.get('tbody tr td.swh-origin-visit-type').then(elts => { for (const elt of elts) { cy.get(elt).should('have.text', visitType); } }); } }); it('should show not found message when no repo matches', function() { searchShouldShowNotFound(nonExistentText, 'No origins matching the search criteria were found.'); }); it('should add appropriate URL parameters', function() { // Check all three checkboxes and check if // correct url params are added cy.get('#swh-search-origins-with-visit') .check({force: true}) .get('#swh-filter-empty-visits') .check({force: true}) .get('#swh-search-origin-metadata') .check({force: true}) .then(() => { const searchText = origin.url.slice(0, -1); doSearch(searchText); cy.location('search').then(locationSearch => { const urlParams = new URLSearchParams(locationSearch); const query = urlParams.get('q'); const withVisit = urlParams.has('with_visit'); const withContent = urlParams.has('with_content'); const searchMetadata = urlParams.has('search_metadata'); assert.strictEqual(query, searchText); assert.strictEqual(withVisit, true); assert.strictEqual(withContent, true); assert.strictEqual(searchMetadata, true); }); }); }); it('should search in origin intrinsic metadata', function() { cy.intercept('GET', '**/origin/metadata-search/**').as( 'originMetadataSearch' ); cy.get('#swh-search-origins-with-visit') .check({force: true}) .get('#swh-filter-empty-visits') .check({force: true}) .get('#swh-search-origin-metadata') .check({force: true}) .then(() => { const searchText = 'plugin'; doSearch(searchText); cy.wait('@originMetadataSearch').then((req) => { expect(req.response.body[0].metadata.metadata.description).to.equal( 'Line numbering plugin for Highlight.js' // metadata is defined in _TEST_ORIGINS variable in swh/web/tests/data.py ); }); }); }); it('should not send request to the resolve endpoint', function() { cy.intercept(`${this.Urls.api_1_resolve_swhid('').slice(0, -1)}**`) .as('resolveSWHID'); cy.intercept(`${this.Urls.api_1_origin_search(origin.url.slice(0, -1))}**`) .as('searchOrigin'); cy.get('#swh-origins-url-patterns') - .type(origin.url.slice(0, -1), {delay: 0, force: true}); + .type(origin.url.slice(0, -1)); cy.get('.swh-search-icon') .click(); cy.wait('@searchOrigin'); cy.xhrShouldBeCalled('resolveSWHID', 0); cy.xhrShouldBeCalled('searchOrigin', 1); }); it('should add query language support for staff users', function() { cy.get('#swh-search-use-ql') .should('not.exist'); cy.adminLogin(); cy.visit(url); cy.get('#swh-search-use-ql') .should('exist'); }); it('should show error messages when using the query language', function() { cy.adminLogin(); cy.visit(url); cy.intercept('GET', `${this.Urls.api_1_origin_search('**')}**`, { body: { 'exception': 'BadInputExc', 'reason': 'Syntax error in search query: Invalid query' }, statusCode: 400 }) .as('searchOrigin'); cy.get('#swh-search-use-ql') .should('exist') .click({force: true}); // Covered by label cy.get('#swh-origins-url-patterns') .type('this is not a valid query') .type('{enter}'); cy.wait('@searchOrigin').then((xhr) => { cy.get('#swh-no-result') .should('contain', 'Syntax error in search query'); }); }); function checkSearchHasResults() { cy.get('.swh-search-icon') .click(); cy.wait('@checkOriginVisits'); cy.get('#origin-search-results') .should('be.visible'); cy.get('tbody tr td.swh-origin-visit-type') .should('exist'); } it('should search all origins when no pattern is provided', function() { cy.intercept('**/visit/latest/**').as('checkOriginVisits'); // with default filters checkSearchHasResults(); // remove filters cy.get('#swh-search-origins-with-visit') .uncheck({force: true}) .get('#swh-filter-empty-visits') .uncheck({force: true}); checkSearchHasResults(); }); it('should search all origins for a visit type', function() { cy.intercept('**/visit/latest/**').as('checkOriginVisits'); for (const visitType of ['git', 'tar']) { cy.get('#swh-search-visit-type') .select(visitType); checkSearchHasResults(); cy.get('tbody tr td.swh-origin-visit-type').then(elts => { for (const elt of elts) { cy.get(elt).should('have.text', visitType); } }); } }); context('Test pagination', function() { it('should not paginate if there are not many results', function() { // Setup search cy.get('#swh-search-origins-with-visit') .uncheck({force: true}) .get('#swh-filter-empty-visits') .uncheck({force: true}) .then(() => { const searchText = 'libtess'; // Get first page of results doSearch(searchText); cy.get('.swh-search-result-entry') .should('have.length', 1); cy.get('.swh-search-result-entry#origin-0 td a') .should('have.text', 'https://github.com/memononen/libtess2'); cy.get('#origins-prev-results-button') .should('have.class', 'disabled'); cy.get('#origins-next-results-button') .should('have.class', 'disabled'); }); }); it('should paginate forward when there are many results', function() { stubOriginVisitLatestRequests(); // Setup search cy.get('#swh-search-origins-with-visit') .uncheck({force: true}) .get('#swh-filter-empty-visits') .uncheck({force: true}) .then(() => { const searchText = 'many.origins'; // Get first page of results doSearch(searchText); cy.wait('@originVisitLatest'); cy.get('.swh-search-result-entry') .should('have.length', 100); cy.get('.swh-search-result-entry#origin-0 td a') .should('have.text', 'https://many.origins/1'); cy.get('.swh-search-result-entry#origin-99 td a') .should('have.text', 'https://many.origins/100'); cy.get('#origins-prev-results-button') .should('have.class', 'disabled'); cy.get('#origins-next-results-button') .should('not.have.class', 'disabled'); // Get second page of results cy.get('#origins-next-results-button a') .click(); cy.wait('@originVisitLatest'); cy.get('.swh-search-result-entry') .should('have.length', 100); cy.get('.swh-search-result-entry#origin-0 td a') .should('have.text', 'https://many.origins/101'); cy.get('.swh-search-result-entry#origin-99 td a') .should('have.text', 'https://many.origins/200'); cy.get('#origins-prev-results-button') .should('not.have.class', 'disabled'); cy.get('#origins-next-results-button') .should('not.have.class', 'disabled'); // Get third (and last) page of results cy.get('#origins-next-results-button a') .click(); cy.wait('@originVisitLatest'); cy.get('.swh-search-result-entry') .should('have.length', 50); cy.get('.swh-search-result-entry#origin-0 td a') .should('have.text', 'https://many.origins/201'); cy.get('.swh-search-result-entry#origin-49 td a') .should('have.text', 'https://many.origins/250'); cy.get('#origins-prev-results-button') .should('not.have.class', 'disabled'); cy.get('#origins-next-results-button') .should('have.class', 'disabled'); }); }); it('should paginate backward from a middle page', function() { stubOriginVisitLatestRequests(); // Setup search cy.get('#swh-search-origins-with-visit') .uncheck({force: true}) .get('#swh-filter-empty-visits') .uncheck({force: true}) .then(() => { const searchText = 'many.origins'; // Get first page of results doSearch(searchText); cy.wait('@originVisitLatest'); cy.get('#origins-prev-results-button') .should('have.class', 'disabled'); cy.get('#origins-next-results-button') .should('not.have.class', 'disabled'); // Get second page of results cy.get('#origins-next-results-button a') .click(); cy.wait('@originVisitLatest'); cy.get('#origins-prev-results-button') .should('not.have.class', 'disabled'); cy.get('#origins-next-results-button') .should('not.have.class', 'disabled'); // Get first page of results again cy.get('#origins-prev-results-button a') .click(); cy.wait('@originVisitLatest'); cy.get('.swh-search-result-entry') .should('have.length', 100); cy.get('.swh-search-result-entry#origin-0 td a') .should('have.text', 'https://many.origins/1'); cy.get('.swh-search-result-entry#origin-99 td a') .should('have.text', 'https://many.origins/100'); cy.get('#origins-prev-results-button') .should('have.class', 'disabled'); cy.get('#origins-next-results-button') .should('not.have.class', 'disabled'); }); }); it('should paginate backward from the last page', function() { stubOriginVisitLatestRequests(); // Setup search cy.get('#swh-search-origins-with-visit') .uncheck({force: true}) .get('#swh-filter-empty-visits') .uncheck({force: true}) .then(() => { const searchText = 'many.origins'; // Get first page of results doSearch(searchText); cy.wait('@originVisitLatest'); cy.get('#origins-prev-results-button') .should('have.class', 'disabled'); cy.get('#origins-next-results-button') .should('not.have.class', 'disabled'); // Get second page of results cy.get('#origins-next-results-button a') .click(); cy.wait('@originVisitLatest'); cy.get('#origins-prev-results-button') .should('not.have.class', 'disabled'); cy.get('#origins-next-results-button') .should('not.have.class', 'disabled'); // Get third (and last) page of results cy.get('#origins-next-results-button a') .click(); cy.get('#origins-prev-results-button') .should('not.have.class', 'disabled'); cy.get('#origins-next-results-button') .should('have.class', 'disabled'); // Get second page of results again cy.get('#origins-prev-results-button a') .click(); cy.wait('@originVisitLatest'); cy.get('.swh-search-result-entry') .should('have.length', 100); cy.get('.swh-search-result-entry#origin-0 td a') .should('have.text', 'https://many.origins/101'); cy.get('.swh-search-result-entry#origin-99 td a') .should('have.text', 'https://many.origins/200'); cy.get('#origins-prev-results-button') .should('not.have.class', 'disabled'); cy.get('#origins-next-results-button') .should('not.have.class', 'disabled'); // Get first page of results again cy.get('#origins-prev-results-button a') .click(); cy.wait('@originVisitLatest'); cy.get('.swh-search-result-entry') .should('have.length', 100); cy.get('.swh-search-result-entry#origin-0 td a') .should('have.text', 'https://many.origins/1'); cy.get('.swh-search-result-entry#origin-99 td a') .should('have.text', 'https://many.origins/100'); cy.get('#origins-prev-results-button') .should('have.class', 'disabled'); cy.get('#origins-next-results-button') .should('not.have.class', 'disabled'); }); }); }); context('Test valid SWHIDs', function() { it('should resolve directory', function() { const redirectUrl = this.Urls.browse_directory(origin.content[0].directory); const swhid = `swh:1:dir:${origin.content[0].directory}`; searchShouldRedirect(swhid, redirectUrl); }); it('should resolve revision', function() { const redirectUrl = this.Urls.browse_revision(origin.revisions[0]); const swhid = `swh:1:rev:${origin.revisions[0]}`; searchShouldRedirect(swhid, redirectUrl); }); it('should resolve snapshot', function() { const redirectUrl = this.Urls.browse_snapshot_directory(origin.snapshot); const swhid = `swh:1:snp:${origin.snapshot}`; searchShouldRedirect(swhid, redirectUrl); }); it('should resolve content', function() { const redirectUrl = this.Urls.browse_content(`sha1_git:${origin.content[0].sha1git}`); const swhid = `swh:1:cnt:${origin.content[0].sha1git}`; searchShouldRedirect(swhid, redirectUrl); }); it('should not send request to the search endpoint', function() { const swhid = `swh:1:rev:${origin.revisions[0]}`; cy.intercept(this.Urls.api_1_resolve_swhid(swhid)) .as('resolveSWHID'); cy.intercept(`${this.Urls.api_1_origin_search('').slice(0, -1)}**`) .as('searchOrigin'); cy.get('#swh-origins-url-patterns') - .type(swhid, {delay: 0, force: true}); + .type(swhid); cy.get('.swh-search-icon') .click(); cy.wait('@resolveSWHID'); cy.xhrShouldBeCalled('resolveSWHID', 1); cy.xhrShouldBeCalled('searchOrigin', 0); }); }); context('Test invalid SWHIDs', function() { it('should show not found for directory', function() { const swhid = `swh:1:dir:${this.unarchivedRepo.rootDirectory}`; const msg = `Directory with sha1_git ${this.unarchivedRepo.rootDirectory} not found`; searchShouldShowNotFound(swhid, msg); }); it('should show not found for snapshot', function() { const swhid = `swh:1:snp:${this.unarchivedRepo.snapshot}`; const msg = `Snapshot with id ${this.unarchivedRepo.snapshot} not found!`; searchShouldShowNotFound(swhid, msg); }); it('should show not found for revision', function() { const swhid = `swh:1:rev:${this.unarchivedRepo.revision}`; const msg = `Revision with sha1_git ${this.unarchivedRepo.revision} not found.`; searchShouldShowNotFound(swhid, msg); }); it('should show not found for content', function() { const swhid = `swh:1:cnt:${this.unarchivedRepo.content[0].sha1git}`; const msg = `Content with sha1_git checksum equals to ${this.unarchivedRepo.content[0].sha1git} not found!`; searchShouldShowNotFound(swhid, msg); }); function checkInvalidSWHIDReport(url, searchInputElt, swhidInput, validationMessagePattern = '') { cy.visit(url); doSearch(swhidInput, searchInputElt); cy.get(searchInputElt) .then($el => $el[0].checkValidity()).should('be.false'); cy.get(searchInputElt) .invoke('prop', 'validationMessage') .should('not.equal', '') .should('contain', validationMessagePattern); } it('should report invalid SWHID in search page input', function() { const swhidInput = `swh:1:cnt:${this.unarchivedRepo.content[0].sha1git};lines=45-60/`; checkInvalidSWHIDReport(this.Urls.browse_search(), '#swh-origins-url-patterns', swhidInput); cy.get('.invalid-feedback') .should('be.visible'); }); it('should report invalid SWHID in top right search input', function() { const swhidInput = `swh:1:cnt:${this.unarchivedRepo.content[0].sha1git};lines=45-60/`; checkInvalidSWHIDReport(this.Urls.browse_help(), '#swh-origins-search-top-input', swhidInput); }); it('should report SWHID with uppercase chars in search page input', function() { const swhidInput = `swh:1:cnt:${this.unarchivedRepo.content[0].sha1git}`.toUpperCase(); checkInvalidSWHIDReport(this.Urls.browse_search(), '#swh-origins-url-patterns', swhidInput, swhidInput.toLowerCase()); cy.get('.invalid-feedback') .should('be.visible'); }); it('should report SWHID with uppercase chars in top right search input', function() { let swhidInput = `swh:1:cnt:${this.unarchivedRepo.content[0].sha1git}`.toUpperCase(); swhidInput += ';lines=45-60/'; checkInvalidSWHIDReport(this.Urls.browse_help(), '#swh-origins-search-top-input', swhidInput.toLowerCase()); }); }); }); diff --git a/cypress/e2e/persistent-identifiers.cy.js b/cypress/e2e/persistent-identifiers.cy.js index 7a2ec1f7..6d8dd337 100644 --- a/cypress/e2e/persistent-identifiers.cy.js +++ b/cypress/e2e/persistent-identifiers.cy.js @@ -1,228 +1,231 @@ /** * Copyright (C) 2019-2020 The Software Heritage developers * See the AUTHORS file at the top-level directory of this distribution * License: GNU Affero General Public License version 3, or any later version * See top-level LICENSE file for more information */ let origin, originBadgeUrl, originBrowseUrl; let url, urlPrefix; let cntSWHID, cntSWHIDWithContext; let dirSWHID, dirSWHIDWithContext; let relSWHID, relSWHIDWithContext; let revSWHID, revSWHIDWithContext; let snpSWHID, snpSWHIDWithContext; let testsData; const firstSelLine = 6; const lastSelLine = 12; describe('Persistent Identifiers Tests', function() { before(function() { origin = this.origin[1]; url = `${this.Urls.browse_origin_content()}?origin_url=${origin.url}&path=${origin.content[0].path}`; url = `${url}&release=${origin.release.name}#L${firstSelLine}-L${lastSelLine}`; originBadgeUrl = this.Urls.swh_badge('origin', origin.url); originBrowseUrl = `${this.Urls.browse_origin()}?origin_url=${origin.url}`; cy.visit(url).window().then(win => { urlPrefix = `${win.location.protocol}//${win.location.hostname}`; if (win.location.port) { urlPrefix += `:${win.location.port}`; } + // for some reasons, cypress hangs when visiting that URL in beforeEach callback + // due to HTTP redirection, so get the redirected URL here to workaround that issue. + url = win.location.href; const swhids = win.swh.webapp.getSwhIdsContext(); cntSWHID = swhids.content.swhid; cntSWHIDWithContext = swhids.content.swhid_with_context; cntSWHIDWithContext += `;lines=${firstSelLine}-${lastSelLine}`; dirSWHID = swhids.directory.swhid; dirSWHIDWithContext = swhids.directory.swhid_with_context; revSWHID = swhids.revision.swhid; revSWHIDWithContext = swhids.revision.swhid_with_context; relSWHID = swhids.release.swhid; relSWHIDWithContext = swhids.release.swhid_with_context; snpSWHID = swhids.snapshot.swhid; snpSWHIDWithContext = swhids.snapshot.swhid_with_context; testsData = [ { 'objectType': 'content', 'objectSWHIDs': [cntSWHIDWithContext, cntSWHID], 'badgeUrl': this.Urls.swh_badge('content', swhids.content.object_id), 'badgeSWHIDUrl': this.Urls.swh_badge_swhid(cntSWHID), 'browseUrl': this.Urls.browse_swhid(cntSWHIDWithContext) }, { 'objectType': 'directory', 'objectSWHIDs': [dirSWHIDWithContext, dirSWHID], 'badgeUrl': this.Urls.swh_badge('directory', swhids.directory.object_id), 'badgeSWHIDUrl': this.Urls.swh_badge_swhid(dirSWHID), 'browseUrl': this.Urls.browse_swhid(dirSWHIDWithContext) }, { 'objectType': 'release', 'objectSWHIDs': [relSWHIDWithContext, relSWHID], 'badgeUrl': this.Urls.swh_badge('release', swhids.release.object_id), 'badgeSWHIDUrl': this.Urls.swh_badge_swhid(relSWHID), 'browseUrl': this.Urls.browse_swhid(relSWHIDWithContext) }, { 'objectType': 'revision', 'objectSWHIDs': [revSWHIDWithContext, revSWHID], 'badgeUrl': this.Urls.swh_badge('revision', swhids.revision.object_id), 'badgeSWHIDUrl': this.Urls.swh_badge_swhid(revSWHID), 'browseUrl': this.Urls.browse_swhid(revSWHIDWithContext) }, { 'objectType': 'snapshot', 'objectSWHIDs': [snpSWHIDWithContext, snpSWHID], 'badgeUrl': this.Urls.swh_badge('snapshot', swhids.snapshot.object_id), 'badgeSWHIDUrl': this.Urls.swh_badge_swhid(snpSWHID), 'browseUrl': this.Urls.browse_swhid(snpSWHIDWithContext) } ]; }); }); beforeEach(function() { cy.visit(url); }); it('should open and close identifiers tab when clicking on handle', function() { cy.get('#swh-identifiers') .should('have.class', 'ui-slideouttab-ready'); cy.get('.ui-slideouttab-handle') .click(); cy.get('#swh-identifiers') .should('have.class', 'ui-slideouttab-open'); cy.get('.ui-slideouttab-handle') .click(); cy.get('#swh-identifiers') .should('not.have.class', 'ui-slideouttab-open'); }); it('should display identifiers with permalinks for browsed objects', function() { cy.get('.ui-slideouttab-handle') .click(); for (const td of testsData) { cy.get(`a[href="#swhid-tab-${td.objectType}"]`) .click(); cy.get(`#swhid-tab-${td.objectType}`) .should('be.visible'); cy.get(`#swhid-tab-${td.objectType} .swhid`) .should('have.text', td.objectSWHIDs[0].replace(/;/g, ';\n')) .should('have.attr', 'href', this.Urls.browse_swhid(td.objectSWHIDs[0])); } }); it('should update other object identifiers contextual info when toggling context checkbox', function() { cy.get('.ui-slideouttab-handle') .click(); for (const td of testsData) { cy.get(`a[href="#swhid-tab-${td.objectType}"]`) .click(); cy.get(`#swhid-tab-${td.objectType} .swhid`) .should('have.text', td.objectSWHIDs[0].replace(/;/g, ';\n')) .should('have.attr', 'href', this.Urls.browse_swhid(td.objectSWHIDs[0])); cy.get(`#swhid-tab-${td.objectType} .swhid-option`) .click(); cy.get(`#swhid-tab-${td.objectType} .swhid`) .contains(td.objectSWHIDs[1]) .should('have.attr', 'href', this.Urls.browse_swhid(td.objectSWHIDs[1])); cy.get(`#swhid-tab-${td.objectType} .swhid-option`) .click(); cy.get(`#swhid-tab-${td.objectType} .swhid`) .should('have.text', td.objectSWHIDs[0].replace(/;/g, ';\n')) .should('have.attr', 'href', this.Urls.browse_swhid(td.objectSWHIDs[0])); } }); it('should display swh badges in identifiers tab for browsed objects', function() { cy.get('.ui-slideouttab-handle') .click(); const originBadgeUrl = this.Urls.swh_badge('origin', origin.url); for (const td of testsData) { cy.get(`a[href="#swhid-tab-${td.objectType}"]`) .click(); cy.get(`#swhid-tab-${td.objectType} .swh-badge-origin`) .should('have.attr', 'src', originBadgeUrl); cy.get(`#swhid-tab-${td.objectType} .swh-badge-${td.objectType}`) .should('have.attr', 'src', td.badgeUrl); } }); it('should display badge integration info when clicking on it', function() { cy.get('.ui-slideouttab-handle') .click(); for (const td of testsData) { cy.get(`a[href="#swhid-tab-${td.objectType}"]`) .click(); cy.get(`#swhid-tab-${td.objectType} .swh-badge-origin`) .click() .wait(500); for (const badgeType of ['html', 'md', 'rst']) { cy.get(`.modal .swh-badge-${badgeType}`) .should('contain.text', `${urlPrefix}${originBrowseUrl}`) .should('contain.text', `${urlPrefix}${originBadgeUrl}`); } cy.get('.modal.show .close') .click() .wait(500); cy.get(`#swhid-tab-${td.objectType} .swh-badge-${td.objectType}`) .click() .wait(500); for (const badgeType of ['html', 'md', 'rst']) { cy.get(`.modal .swh-badge-${badgeType}`) .should('contain.text', `${urlPrefix}${td.browseUrl}`) .should('contain.text', `${urlPrefix}${td.badgeSWHIDUrl}`); } cy.get('.modal.show .close') .click() .wait(500); } }); it('should be possible to retrieve SWHIDs context from JavaScript', function() { cy.window().then(win => { const swhIdsContext = win.swh.webapp.getSwhIdsContext(); for (const testData of testsData) { assert.isTrue(swhIdsContext.hasOwnProperty(testData.objectType)); assert.equal(swhIdsContext[testData.objectType].swhid, testData.objectSWHIDs.slice(-1)[0]); } }); }); }); diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js index e703ec17..e6d417f8 100644 --- a/cypress/support/e2e.js +++ b/cypress/support/e2e.js @@ -1,110 +1,116 @@ /** * Copyright (C) 2019-2022 The Software Heritage developers * See the AUTHORS file at the top-level directory of this distribution * License: GNU Affero General Public License version 3, or any later version * See top-level LICENSE file for more information */ import 'cypress-hmr-restarter'; import '@cypress/code-coverage/support'; Cypress.Screenshot.defaults({ screenshotOnRunFailure: false }); Cypress.Commands.add('xhrShouldBeCalled', (alias, timesCalled) => { const testRoutes = cy.state('routes'); const aliasRoute = Cypress._.find(testRoutes, {alias}); expect(Object.keys(aliasRoute.requests || {})).to.have.length(timesCalled); }); function loginUser(username, password) { const url = '/admin/login/'; return cy.request({ url: url, method: 'GET' }).then(() => { cy.getCookie('sessionid').should('not.exist'); cy.getCookie('csrftoken').its('value').then((token) => { cy.request({ url: url, method: 'POST', form: true, followRedirect: false, body: { username: username, password: password, csrfmiddlewaretoken: token } }).then(() => { cy.getCookie('sessionid').should('exist'); return cy.getCookie('csrftoken').its('value'); }); }); }); } Cypress.Commands.add('adminLogin', () => { return loginUser('admin', 'admin'); }); Cypress.Commands.add('userLogin', () => { return loginUser('user', 'user'); }); Cypress.Commands.add('user2Login', () => { return loginUser('user2', 'user2'); }); Cypress.Commands.add('ambassadorLogin', () => { return loginUser('ambassador', 'ambassador'); }); Cypress.Commands.add('depositLogin', () => { return loginUser('deposit', 'deposit'); }); Cypress.Commands.add('addForgeModeratorLogin', () => { return loginUser('add-forge-moderator', 'add-forge-moderator'); }); function mockCostlyRequests() { cy.intercept('https://status.softwareheritage.org/**', { body: { 'result': { 'status': [ { 'id': '5f7c4c567f50b304c1e7bd5f', 'name': 'Save Code Now', 'updated': '2020-11-30T13:51:21.151Z', 'status': 'Operational', 'status_code': 100 } ] } }}).as('swhPlatformStatus'); cy.intercept('/coverage', { body: '' }).as('swhCoverageWidget'); } Cypress.Commands.add('mailmapAdminLogin', () => { return loginUser('mailmap-admin', 'mailmap-admin'); }); before(function() { mockCostlyRequests(); cy.task('getSwhTestsData').then(testsData => { Object.assign(this, testsData); }); cy.visit('/').window().then(async win => { this.Urls = win.Urls; }); }); beforeEach(function() { mockCostlyRequests(); }); + +Cypress.Commands.overwrite('type', (originalFn, subject, text, options = {}) => { + options.delay = options.delay || 0; + options.force = options.force || true; + return originalFn(subject, text, options); +}); diff --git a/static/js/webapp.4e4310cfc39e0dfe8406.js b/static/js/webapp.4e4310cfc39e0dfe8406.js new file mode 100644 index 00000000..11fe1d0b --- /dev/null +++ b/static/js/webapp.4e4310cfc39e0dfe8406.js @@ -0,0 +1,3 @@ +/*! For license information please see webapp.4e4310cfc39e0dfe8406.js.LICENSE.txt */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.swh=t():(e.swh=e.swh||{},e.swh.webapp=t())}(self,(function(){return function(){var e,t,r,n,i,o,a={87757:function(e,t,r){e.exports=r(35666)},49680:function(e,t,r){"use strict";r.d(t,{R:function(){return b}});var n=r(44219),i=r(40105),o=r(38641),a=r(1984),s=r(82991),c=r(62844),u=r(12343),l=r(47165),p=r(30292),d=r(58725),f=r(84773),h=r(90564),g=r(77050),m=(0,s.R)();class b extends n.W{constructor(e){e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:i.J}],version:i.J},super(e),e.sendClientReports&&m.document&&m.document.addEventListener("visibilitychange",(()=>{"hidden"===m.document.visibilityState&&this._flushOutcomes()}))}eventFromException(e,t){return(0,f.dr)(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",r){return(0,f.aB)(this._options.stackParser,e,t,r,this._options.attachStacktrace)}sendEvent(e,t){var r=this.getIntegrationById(h.p);r&&r.options&&r.options.sentry&&(0,o.Gd)().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:(0,c.jH)(e)},{event:e}),super.sendEvent(e,t)}_prepareEvent(e,t,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,r)}_flushOutcomes(){var e=this._clearOutcomes();if(0!==e.length)if(this._dsn){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&u.kg.log("Sending outcomes:",e);var t=(0,a.U)(this._dsn,this._options.tunnel),r=(0,l.y)(e,this._options.tunnel&&(0,p.RA)(this._dsn));try{(0,g.z)(t,(0,d.V$)(r))}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&u.kg.error(e)}}else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&u.kg.log("No dsn provided, will not send outcomes");else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&u.kg.log("No outcomes to send")}}},84773:function(e,t,r){"use strict";r.d(t,{GJ:function(){return c},ME:function(){return g},aB:function(){return h},dr:function(){return f}});var n=r(67597),i=r(20535),o=r(90322),a=r(62844),s=r(96893);function c(e,t){var r=l(e,t),n={type:t&&t.name,value:d(t)};return r.length&&(n.stacktrace={frames:r}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function u(e,t){return{exception:{values:[c(e,t)]}}}function l(e,t){var r=t.stacktrace||t.stack||"",n=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(p.test(e.message))return 1}return 0}(t);try{return e(r,n)}catch(e){}return[]}var p=/Minified React error #\d+;/i;function d(e){var t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function f(e,t,r,n){var i=g(e,t,r&&r.syntheticException||void 0,n);return(0,a.EG)(i),i.level="error",r&&r.event_id&&(i.event_id=r.event_id),(0,s.WD)(i)}function h(e,t,r="info",n,i){var o=m(e,t,n&&n.syntheticException||void 0,i);return o.level=r,n&&n.event_id&&(o.event_id=n.event_id),(0,s.WD)(o)}function g(e,t,r,s,c){let p;if((0,n.VW)(t)&&t.error)return u(e,t.error);if((0,n.TX)(t)||(0,n.fm)(t)){var d=t;if("stack"in t)p=u(e,t);else{var f=d.name||((0,n.TX)(d)?"DOMError":"DOMException"),h=d.message?`${f}: ${d.message}`:f;p=m(e,h,r,s),(0,a.Db)(p,h)}return"code"in d&&(p.tags={...p.tags,"DOMException.code":`${d.code}`}),p}return(0,n.VZ)(t)?u(e,t):(0,n.PO)(t)||(0,n.cO)(t)?(p=function(e,t,r,a){var s={exception:{values:[{type:(0,n.cO)(t)?t.constructor.name:a?"UnhandledRejection":"Error",value:`Non-Error ${a?"promise rejection":"exception"} captured with keys: ${(0,i.zf)(t)}`}]},extra:{__serialized__:(0,o.Qy)(t)}};if(r){var c=l(e,r);c.length&&(s.exception.values[0].stacktrace={frames:c})}return s}(e,t,r,c),(0,a.EG)(p,{synthetic:!0}),p):(p=m(e,t,r,s),(0,a.Db)(p,`${t}`,void 0),(0,a.EG)(p,{synthetic:!0}),p)}function m(e,t,r,n){var i={message:t};if(n&&r){var o=l(e,r);o.length&&(i.exception={values:[{value:t,stacktrace:{frames:o}}]})}return i}},86891:function(e,t,r){"use strict";r.d(t,{Wz:function(){return s},re:function(){return u}});var n=r(92876),i=r(20535),o=r(62844);let a=0;function s(){return a>0}function c(){a+=1,setTimeout((()=>{a-=1}))}function u(e,t={},r){if("function"!=typeof e)return e;try{var a=e.__sentry_wrapped__;if(a)return a;if((0,i.HK)(e))return e}catch(t){return e}var s=function(){var i=Array.prototype.slice.call(arguments);try{r&&"function"==typeof r&&r.apply(this,arguments);var a=i.map((e=>u(e,t)));return e.apply(this,a)}catch(e){throw c(),(0,n.$e)((r=>{r.addEventProcessor((e=>(t.mechanism&&((0,o.Db)(e,void 0,void 0),(0,o.EG)(e,t.mechanism)),e.extra={...e.extra,arguments:i},e))),(0,n.Tb)(e)})),e}};try{for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&(s[l]=e[l])}catch(e){}(0,i.$Q)(s,e),(0,i.xp)(e,"__sentry_wrapped__",s);try{Object.getOwnPropertyDescriptor(s,"name").configurable&&Object.defineProperty(s,"name",{get:()=>e.name})}catch(e){}return s}},90564:function(e,t,r){"use strict";r.d(t,{O:function(){return p},p:function(){return l}});var n=r(38641),i=r(9732),o=r(58464),a=r(16547),s=r(57321),c=r(82991),u=r(62844),l="Breadcrumbs";class p{static __initStatic(){this.id=l}__init(){this.name=p.id}constructor(e){p.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){this.options.console&&(0,i.o)("console",d),this.options.dom&&(0,i.o)("dom",function(e){function t(t){let r,i="object"==typeof e?e.serializeAttribute:void 0;"string"==typeof i&&(i=[i]);try{r=t.event.target?(0,o.R)(t.event.target,i):(0,o.R)(t.event,i)}catch(e){r=""}0!==r.length&&(0,n.Gd)().addBreadcrumb({category:`ui.${t.name}`,message:r},{event:t.event,name:t.name,global:t.global})}return t}(this.options.dom)),this.options.xhr&&(0,i.o)("xhr",f),this.options.fetch&&(0,i.o)("fetch",h),this.options.history&&(0,i.o)("history",g)}}function d(e){var t={category:"console",data:{arguments:e.args,logger:"console"},level:(0,a.VT)(e.level),message:(0,s.nK)(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;t.message=`Assertion failed: ${(0,s.nK)(e.args.slice(1)," ")||"console.assert"}`,t.data.arguments=e.args.slice(1)}(0,n.Gd)().addBreadcrumb(t,{input:e.args,level:e.level})}function f(e){if(e.endTimestamp){if(e.xhr.__sentry_own_request__)return;const{method:t,url:r,status_code:i,body:o}=e.xhr.__sentry_xhr__||{};(0,n.Gd)().addBreadcrumb({category:"xhr",data:{method:t,url:r,status_code:i},type:"http"},{xhr:e.xhr,input:o})}else;}function h(e){e.endTimestamp&&(e.fetchData.url.match(/sentry_key/)&&"POST"===e.fetchData.method||(e.error?(0,n.Gd)().addBreadcrumb({category:"fetch",data:e.fetchData,level:"error",type:"http"},{data:e.error,input:e.args}):(0,n.Gd)().addBreadcrumb({category:"fetch",data:{...e.fetchData,status_code:e.response.status},type:"http"},{input:e.args,response:e.response})))}function g(e){var t=(0,c.R)();let r=e.from,i=e.to;var o=(0,u.en)(t.location.href);let a=(0,u.en)(r);var s=(0,u.en)(i);a.path||(a=o),o.protocol===s.protocol&&o.host===s.host&&(i=s.relative),o.protocol===a.protocol&&o.host===a.host&&(r=a.relative),(0,n.Gd)().addBreadcrumb({category:"navigation",data:{from:r,to:i}})}p.__initStatic()},69730:function(e,t,r){"use strict";r.d(t,{I:function(){return i}});var n=r(12343);class i{constructor(){i.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=i.id}setupOnce(e,t){var r=e=>{var r=t().getIntegration(i);if(r){try{if(function(e,t){if(!t)return!1;if(function(e,t){var r=e.message,n=t.message;if(!r&&!n)return!1;if(r&&!n||!r&&n)return!1;if(r!==n)return!1;if(!a(e,t))return!1;if(!o(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){var r=s(t),n=s(e);if(!r||!n)return!1;if(r.type!==n.type||r.value!==n.value)return!1;if(!a(e,t))return!1;if(!o(e,t))return!1;return!0}(e,t))return!0;return!1}(e,r._previousEvent))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&n.kg.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(t){return r._previousEvent=e}return r._previousEvent=e}return e};r.id=this.name,e(r)}}function o(e,t){let r=c(e),n=c(t);if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;if(r=r,n=n,n.length!==r.length)return!1;for(let e=0;e{const[t,r,n]=m();if(!t.getIntegration(p))return;const{msg:i,url:a,line:s,column:c,error:d}=e;if(!((0,l.Wz)()||d&&d.__sentry_own_request__)){var f=void 0===d&&(0,o.HD)(i)?function(e,t,r,n){var i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let a=(0,o.VW)(e)?e.message:e,s="Error";var c=a.match(i);c&&(s=c[1],a=c[2]);return h({exception:{values:[{type:s,value:a}]}},t,r,n)}(i,a,s,c):h((0,u.ME)(r,d||i,void 0,n,!1),a,s,c);f.level="error",g(t,d,f,"onerror")}}))}function f(){(0,i.o)("unhandledrejection",(e=>{const[t,r,n]=m();if(!t.getIntegration(p))return;let i=e;try{"reason"in e?i=e.reason:"detail"in e&&"reason"in e.detail&&(i=e.detail.reason)}catch(e){}if((0,l.Wz)()||i&&i.__sentry_own_request__)return!0;var a=(0,o.pt)(i)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`}]}}:(0,u.ME)(r,i,void 0,n,!0);a.level="error",g(t,i,a,"onunhandledrejection")}))}function h(e,t,r,n){var i=e.exception=e.exception||{},s=i.values=i.values||[],c=s[0]=s[0]||{},u=c.stacktrace=c.stacktrace||{},l=u.frames=u.frames||[],p=isNaN(parseInt(n,10))?void 0:n,d=isNaN(parseInt(r,10))?void 0:r,f=(0,o.HD)(t)&&t.length>0?t:(0,a.l)();return 0===l.length&&l.push({colno:p,filename:f,function:"?",in_app:!0,lineno:d}),e}function g(e,t,r,n){(0,c.EG)(r,{handled:!1,type:n}),e.captureEvent(r,{originalException:t})}function m(){var e=(0,n.Gd)(),t=e.getClient(),r=t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[e,r.stackParser,r.attachStacktrace]}p.__initStatic()},61945:function(e,t,r){"use strict";r.d(t,{q:function(){return a}});var n=r(46769),i=r(38641),o=(0,r(82991).R)();class a{constructor(){a.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=a.id}setupOnce(){(0,n.c)((e=>{if((0,i.Gd)().getIntegration(a)){if(!o.navigator&&!o.location&&!o.document)return e;var t=e.request&&e.request.url||o.location&&o.location.href;const{referrer:n}=o.document||{},{userAgent:i}=o.navigator||{};var r={...t&&{url:t},headers:{...e.request&&e.request.headers,...n&&{Referer:n},...i&&{"User-Agent":i}}};return{...e,request:r}}return e}))}}a.__initStatic()},61634:function(e,t,r){"use strict";r.d(t,{iP:function(){return s}});var n=r(38641),i=r(46769),o=r(67597),a=r(84773);class s{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=s.id}constructor(e={}){s.prototype.__init.call(this),this._key=e.key||"cause",this._limit=e.limit||5}setupOnce(){var e=(0,n.Gd)().getClient();e&&(0,i.c)(((t,r)=>{var i=(0,n.Gd)().getIntegration(s);return i?function(e,t,r,n,i){if(!(n.exception&&n.exception.values&&i&&(0,o.V9)(i.originalException,Error)))return n;var a=c(e,r,i.originalException,t);return n.exception.values=[...a,...n.exception.values],n}(e.getOptions().stackParser,i._key,i._limit,t,r):t}))}}function c(e,t,r,n,i=[]){if(!(0,o.V9)(r[n],Error)||i.length+1>=t)return i;var s=(0,a.GJ)(e,r[n]);return c(e,t,r[n],n,[s,...i])}s.__initStatic()},53692:function(e,t,r){"use strict";r.d(t,{p:function(){return c}});var n=r(82991),i=r(20535),o=r(30360),a=r(86891),s=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class c{static __initStatic(){this.id="TryCatch"}__init(){this.name=c.id}constructor(e){c.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){var e=(0,n.R)();this._options.setTimeout&&(0,i.hl)(e,"setTimeout",u),this._options.setInterval&&(0,i.hl)(e,"setInterval",u),this._options.requestAnimationFrame&&(0,i.hl)(e,"requestAnimationFrame",l),this._options.XMLHttpRequest&&"XMLHttpRequest"in e&&(0,i.hl)(XMLHttpRequest.prototype,"send",p);var t=this._options.eventTarget;t&&(Array.isArray(t)?t:s).forEach(d)}}function u(e){return function(...t){var r=t[0];return t[0]=(0,a.re)(r,{mechanism:{data:{function:(0,o.$P)(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}}function l(e){return function(t){return e.apply(this,[(0,a.re)(t,{mechanism:{data:{function:"requestAnimationFrame",handler:(0,o.$P)(e)},handled:!0,type:"instrument"}})])}}function p(e){return function(...t){var r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((e=>{e in r&&"function"==typeof r[e]&&(0,i.hl)(r,e,(function(t){var r={mechanism:{data:{function:e,handler:(0,o.$P)(t)},handled:!0,type:"instrument"}},n=(0,i.HK)(t);return n&&(r.mechanism.data.handler=(0,o.$P)(n)),(0,a.re)(t,r)}))})),e.apply(this,t)}}function d(e){var t=(0,n.R)(),r=t[e]&&t[e].prototype;r&&r.hasOwnProperty&&r.hasOwnProperty("addEventListener")&&((0,i.hl)(r,"addEventListener",(function(t){return function(r,n,i){try{"function"==typeof n.handleEvent&&(n.handleEvent=(0,a.re)(n.handleEvent,{mechanism:{data:{function:"handleEvent",handler:(0,o.$P)(n),target:e},handled:!0,type:"instrument"}}))}catch(e){}return t.apply(this,[r,(0,a.re)(n,{mechanism:{data:{function:"addEventListener",handler:(0,o.$P)(n),target:e},handled:!0,type:"instrument"}}),i])}})),(0,i.hl)(r,"removeEventListener",(function(e){return function(t,r,n){var i=r;try{var o=i&&i.__sentry_wrapped__;o&&e.call(this,t,o,n)}catch(e){}return e.call(this,t,i,n)}})))}c.__initStatic()},19011:function(e,t,r){"use strict";r.d(t,{S1:function(){return k}});var n=r(42422),i=r(19116),o=r(22967),a=r(67966),s=r(38641),c=r(82991),u=r(30360),l=r(8823),p=r(12343),d=r(9732),f=r(49680),h=r(34469),g=r(53692),m=r(90564),b=r(52136),v=r(61634),y=r(69730),_=r(61945),w=r(68690),E=r(68131),x=[new n.QD,new i.c,new g.p,new m.O,new b.d,new v.iP,new y.I,new _.q];function k(e={}){if(void 0===e.defaultIntegrations&&(e.defaultIntegrations=x),void 0===e.release){var t=(0,c.R)();t.SENTRY_RELEASE&&t.SENTRY_RELEASE.id&&(e.release=t.SENTRY_RELEASE.id)}void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);var r={...e,stackParser:(0,u.Sq)(e.stackParser||h.Dt),integrations:(0,o.m8)(e),transport:e.transport||((0,l.Ak)()?w.f:E.K)};(0,a.M)(f.R,r),e.autoSessionTracking&&function(){if(void 0===(0,c.R)().document)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&p.kg.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));var e=(0,s.Gd)();if(!e.captureSession)return;S(e),(0,d.o)("history",(({from:e,to:t})=>{void 0!==e&&e!==t&&S((0,s.Gd)())}))}()}function S(e){e.startSession({ignoreDuration:!0}),e.captureSession()}},34469:function(e,t,r){"use strict";r.d(t,{Dt:function(){return d}});var n=r(30360),i="?";function o(e,t,r,n){var i={filename:e,function:t,in_app:!0};return void 0!==r&&(i.lineno=r),void 0!==n&&(i.colno=n),i}var a=/^\s*at (?:(.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack||[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,s=/\((\S*)(?::(\d+))(?::(\d+))\)/,c=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,u=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,l=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,p=[[30,e=>{var t=a.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){var r=s.exec(t[2]);r&&(t[2]=r[1],t[3]=r[2],t[4]=r[3])}const[e,n]=f(t[1]||i,t[2]);return o(n,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],[50,e=>{var t=c.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var r=u.exec(t[3]);r&&(t[1]=t[1]||"eval",t[3]=r[1],t[4]=r[2],t[5]="")}let e=t[3],n=t[1]||i;return[n,e]=f(n,e),o(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],[40,e=>{var t=l.exec(e);return t?o(t[2],t[1]||i,+t[3],t[4]?+t[4]:void 0):void 0}]],d=(0,n.pE)(...p),f=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),n=-1!==e.indexOf("safari-web-extension");return r||n?[-1!==e.indexOf("@")?e.split("@")[0]:i,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]}},68690:function(e,t,r){"use strict";r.d(t,{f:function(){return o}});var n=r(45431),i=r(77050);function o(e,t=(0,i.x)()){return(0,n.q)(e,(function(r){var n={body:r.body,method:"POST",referrerPolicy:"origin",headers:e.headers,...e.fetchOptions};return t(e.url,n).then((e=>({statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}})))}))}},77050:function(e,t,r){"use strict";r.d(t,{x:function(){return c},z:function(){return u}});var n=r(82991),i=r(8823),o=r(12343),a=(0,n.R)();let s;function c(){if(s)return s;if((0,i.Du)(a.fetch))return s=a.fetch.bind(a);var e=a.document;let t=a.fetch;if(e&&"function"==typeof e.createElement)try{var r=e.createElement("iframe");r.hidden=!0,e.head.appendChild(r);var n=r.contentWindow;n&&n.fetch&&(t=n.fetch),e.head.removeChild(r)}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&o.kg.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return s=t.bind(a)}function u(e,t){if("[object Navigator]"===Object.prototype.toString.call(a&&a.navigator)&&"function"==typeof a.navigator.sendBeacon)a.navigator.sendBeacon.bind(a.navigator)(e,t);else if((0,i.Ak)()){c()(e,{body:t,method:"POST",credentials:"omit",keepalive:!0}).then(null,(e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&o.kg.error(e)}))}}},68131:function(e,t,r){"use strict";r.d(t,{K:function(){return o}});var n=r(45431),i=r(96893);function o(e){return(0,n.q)(e,(function(t){return new i.cW(((r,n)=>{var i=new XMLHttpRequest;for(var o in i.onerror=n,i.onreadystatechange=()=>{4===i.readyState&&r({statusCode:i.status,headers:{"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")}})},i.open("POST",e.url),e.headers)Object.prototype.hasOwnProperty.call(e.headers,o)&&i.setRequestHeader(o,e.headers[o]);i.send(t.body)}))}))}},1984:function(e,t,r){"use strict";r.d(t,{U:function(){return o}});var n=r(20535);function i(e){var t=e.protocol?`${e.protocol}:`:"",r=e.port?`:${e.port}`:"";return`${t}//${e.host}${r}${e.path?`/${e.path}`:""}/api/`}function o(e,t){return t||`${function(e){return`${i(e)}${e.projectId}/envelope/`}(e)}?${function(e){return(0,n._j)({sentry_key:e.publicKey,sentry_version:"7"})}(e)}`}},44219:function(e,t,r){"use strict";r.d(t,{W:function(){return _}});var n=r(64307),i=r(95771),o=r(46769),a=r(30292),s=r(12343),c=r(62844),u=r(67597),l=r(96893),p=r(58725),d=r(21170),f=r(90322),h=r(57321),g=r(80409),m=r(1984),b=r(28656),v=r(22967),y="Not capturing exception because it's already been captured.";class _{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}constructor(e){if(_.prototype.__init.call(this),_.prototype.__init2.call(this),_.prototype.__init3.call(this),_.prototype.__init4.call(this),this._options=e,e.dsn){this._dsn=(0,a.vK)(e.dsn);var t=(0,m.U)(this._dsn,e.tunnel);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.warn("No DSN provided, client will not do anything.")}captureException(e,t,r){if((0,c.YO)(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log(y));let n=t&&t.event_id;return this._process(this.eventFromException(e,t).then((e=>this._captureEvent(e,t,r))).then((e=>{n=e}))),n}captureMessage(e,t,r,n){let i=r&&r.event_id;var o=(0,u.pt)(e)?this.eventFromMessage(String(e),t,r):this.eventFromException(e,r);return this._process(o.then((e=>this._captureEvent(e,r,n))).then((e=>{i=e}))),i}captureEvent(e,t,r){if(t&&t.originalException&&(0,c.YO)(t.originalException))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log(y));let n=t&&t.event_id;return this._process(this._captureEvent(e,t,r).then((e=>{n=e}))),n}captureSession(e){this._isEnabled()?"string"!=typeof e.release?("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),(0,i.CT)(e,{init:!1})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.warn("SDK not enabled, will not capture session.")}getDsn(){return this._dsn}getOptions(){return this._options}getTransport(){return this._transport}flush(e){var t=this._transport;return t?this._isClientDoneProcessing(e).then((r=>t.flush(e).then((e=>r&&e)))):(0,l.WD)(!0)}close(e){return this.flush(e).then((e=>(this.getOptions().enabled=!1,e)))}setupIntegrations(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=(0,v.q4)(this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}sendEvent(e,t={}){if(this._dsn){let i=(0,b.M)(e,this._dsn,this._options._metadata,this._options.tunnel);for(var r of t.attachments||[])i=(0,p.BO)(i,(0,p.zQ)(r,(0,n.x)([this,"access",e=>e._options,"access",e=>e.transportOptions,"optionalAccess",e=>e.textEncoder])));this._sendEnvelope(i)}}sendSession(e){if(this._dsn){var t=(0,b.Q)(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}}recordDroppedEvent(e,t){if(this._options.sendClientReports){var r=`${e}:${t}`;("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.log(`Adding outcome: "${r}"`),this._outcomes[r]=this._outcomes[r]+1||1}}_updateSessionFromEvent(e,t){let r=!1,n=!1;var o=t.exception&&t.exception.values;if(o)for(var a of(n=!0,o)){var s=a.mechanism;if(s&&!1===s.handled){r=!0;break}}var c="ok"===e.status;(c&&0===e.errors||c&&r)&&((0,i.CT)(e,{...r&&{status:"crashed"},errors:e.errors||Number(n||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new l.cW((t=>{let r=0;var n=setInterval((()=>{0==this._numProcessing?(clearInterval(n),t(!0)):(r+=1,e&&r>=e&&(clearInterval(n),t(!1)))}),1)}))}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._dsn}_prepareEvent(e,t,r){const{normalizeDepth:n=3,normalizeMaxBreadth:i=1e3}=this.getOptions();var a={...e,event_id:e.event_id||t.event_id||(0,c.DM)(),timestamp:e.timestamp||(0,d.yW)()};this._applyClientOptions(a),this._applyIntegrationsMetadata(a);let s=r;t.captureContext&&(s=o.s.clone(s).update(t.captureContext));let u=(0,l.WD)(a);if(s){var p=[...t.attachments||[],...s.getAttachments()];p.length&&(t.attachments=p),u=s.applyToEvent(a,t)}return u.then((e=>(e&&(e.sdkProcessingMetadata={...e.sdkProcessingMetadata,normalizeDepth:`${(0,f.Fv)(n)} (${typeof n})`}),"number"==typeof n&&n>0?this._normalizeEvent(e,n,i):e)))}_normalizeEvent(e,t,r){if(!e)return null;var n={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((e=>({...e,...e.data&&{data:(0,f.Fv)(e.data,t,r)}})))},...e.user&&{user:(0,f.Fv)(e.user,t,r)},...e.contexts&&{contexts:(0,f.Fv)(e.contexts,t,r)},...e.extra&&{extra:(0,f.Fv)(e.extra,t,r)}};return e.contexts&&e.contexts.trace&&(n.contexts={},n.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(n.contexts.trace.data=(0,f.Fv)(e.contexts.trace.data,t,r))),e.spans&&(n.spans=e.spans.map((e=>(e.data&&(e.data=(0,f.Fv)(e.data,t,r)),e)))),n.sdkProcessingMetadata={...n.sdkProcessingMetadata,baseClientNormalized:!0},n}_applyClientOptions(e){var t=this.getOptions();const{environment:r,release:n,dist:i,maxValueLength:o=250}=t;"environment"in e||(e.environment="environment"in t?r:"production"),void 0===e.release&&void 0!==n&&(e.release=n),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=(0,h.$G)(e.message,o));var a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=(0,h.$G)(a.value,o));var s=e.request;s&&s.url&&(s.url=(0,h.$G)(s.url,o))}_applyIntegrationsMetadata(e){var t=Object.keys(this._integrations);t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}_captureEvent(e,t={},r){return this._processEvent(e,t,r).then((e=>e.event_id),(e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.warn(e)}))}_processEvent(e,t,r){const{beforeSend:n,sampleRate:i}=this.getOptions();if(!this._isEnabled())return(0,l.$2)(new g.b("SDK not enabled, will not capture event."));var o="transaction"===e.type;return!o&&"number"==typeof i&&Math.random()>i?(this.recordDroppedEvent("sample_rate","error"),(0,l.$2)(new g.b(`Discarding event because it's not included in the random sample (sampling rate = ${i})`))):this._prepareEvent(e,t,r).then((r=>{if(null===r)throw this.recordDroppedEvent("event_processor",e.type||"error"),new g.b("An event processor returned null, will not send event.");return t.data&&!0===t.data.__sentry__||o||!n?r:function(e){var t="`beforeSend` method has to return `null` or a valid event.";if((0,u.J8)(e))return e.then((e=>{if(!(0,u.PO)(e)&&null!==e)throw new g.b(t);return e}),(e=>{throw new g.b(`beforeSend rejected with ${e}`)}));if(!(0,u.PO)(e)&&null!==e)throw new g.b(t);return e}(n(r,t))})).then((n=>{if(null===n)throw this.recordDroppedEvent("before_send",e.type||"error"),new g.b("`beforeSend` returned `null`, will not send event.");var i=r&&r.getSession();return!o&&i&&this._updateSessionFromEvent(i,n),this.sendEvent(n,t),n})).then(null,(e=>{if(e instanceof g.b)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new g.b(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)}))}_process(e){this._numProcessing+=1,e.then((e=>(this._numProcessing-=1,e)),(e=>(this._numProcessing-=1,e)))}_sendEnvelope(e){this._transport&&this._dsn?this._transport.send(e).then(null,(e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.error("Error while sending event:",e)})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.error("Transport disabled")}_clearOutcomes(){var e=this._outcomes;return this._outcomes={},Object.keys(e).map((t=>{const[r,n]=t.split(":");return{reason:r,category:n,quantity:e[t]}}))}}},28656:function(e,t,r){"use strict";r.d(t,{M:function(){return c},Q:function(){return s}});var n=r(30292),i=r(58725),o=r(20535);function a(e){if(!e||!e.sdk)return;const{name:t,version:r}=e.sdk;return{name:t,version:r}}function s(e,t,r,o){var s=a(r),c={sent_at:(new Date).toISOString(),...s&&{sdk:s},...!!o&&{dsn:(0,n.RA)(t)}},u="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e];return(0,i.Jd)(c,[u])}function c(e,t,r,s){var c=a(r),u=e.type||"event";const{transactionSampling:l}=e.sdkProcessingMetadata||{},{method:p,rate:d}=l||{};!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,r&&r.sdk),e.tags=e.tags||{},e.extra=e.extra||{},e.sdkProcessingMetadata&&e.sdkProcessingMetadata.baseClientNormalized||(e.tags.skippedNormalization=!0,e.extra.normalizeDepth=e.sdkProcessingMetadata?e.sdkProcessingMetadata.normalizeDepth:"unset"),delete e.sdkProcessingMetadata;var f=function(e,t,r,i){return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!r&&{dsn:(0,n.RA)(i)},..."transaction"===e.type&&e.contexts&&e.contexts.trace&&{trace:(0,o.Jr)({trace_id:e.contexts.trace.trace_id,environment:e.environment,release:e.release,transaction:e.transaction,user:e.user&&{id:e.user.id,segment:e.user.segment},public_key:i.publicKey})}}}(e,c,s,t),h=[{type:u,sample_rates:[{id:p,rate:d}]},e];return(0,i.Jd)(f,[h])}},22967:function(e,t,r){"use strict";r.d(t,{m8:function(){return c},q4:function(){return u}});var n=r(46769),i=r(38641),o=r(12343),a=[];function s(e){return e.reduce(((e,t)=>(e.every((e=>t.name!==e.name))&&e.push(t),e)),[])}function c(e){var t=e.defaultIntegrations&&[...e.defaultIntegrations]||[],r=e.integrations;let n=[...s(t)];Array.isArray(r)?n=[...n.filter((e=>r.every((t=>t.name!==e.name)))),...s(r)]:"function"==typeof r&&(n=r(n),n=Array.isArray(n)?n:[n]);var i=n.map((e=>e.name)),o="Debug";return-1!==i.indexOf(o)&&n.push(...n.splice(i.indexOf(o),1)),n}function u(e){var t={};return e.forEach((e=>{t[e.name]=e,-1===a.indexOf(e.name)&&(e.setupOnce(n.c,i.Gd),a.push(e.name),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&o.kg.log(`Integration installed: ${e.name}`))})),t}},19116:function(e,t,r){"use strict";r.d(t,{c:function(){return o}});var n=r(20535);let i;class o{constructor(){o.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=o.id}setupOnce(){i=Function.prototype.toString,Function.prototype.toString=function(...e){var t=(0,n.HK)(this)||this;return i.apply(t,e)}}}o.__initStatic()},42422:function(e,t,r){"use strict";r.d(t,{QD:function(){return s}});var n=r(12343),i=r(62844),o=r(57321),a=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/];class s{static __initStatic(){this.id="InboundFilters"}__init(){this.name=s.id}constructor(e={}){this._options=e,s.prototype.__init.call(this)}setupOnce(e,t){var r=e=>{var r=t();if(r){var u=r.getIntegration(s);if(u){var l=r.getClient(),p=l?l.getOptions():{};return function(e,t){if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(e))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&n.kg.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${(0,i.jH)(e)}`),!0;if(function(e,t){if(!t||!t.length)return!1;return function(e){if(e.message)return[e.message];if(e.exception)try{const{type:t="",value:r=""}=e.exception.values&&e.exception.values[0]||{};return[`${r}`,`${t}: ${r}`]}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&n.kg.error(`Cannot extract message for event ${(0,i.jH)(e)}`),[]}return[]}(e).some((e=>t.some((t=>(0,o.zC)(e,t)))))}(e,t.ignoreErrors))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&n.kg.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${(0,i.jH)(e)}`),!0;if(function(e,t){if(!t||!t.length)return!1;var r=c(e);return!!r&&t.some((e=>(0,o.zC)(r,e)))}(e,t.denyUrls))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&n.kg.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${(0,i.jH)(e)}.\nUrl: ${c(e)}`),!0;if(!function(e,t){if(!t||!t.length)return!0;var r=c(e);return!r||t.some((e=>(0,o.zC)(r,e)))}(e,t.allowUrls))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&n.kg.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${(0,i.jH)(e)}.\nUrl: ${c(e)}`),!0;return!1}(e,function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...a],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(u._options,p))?null:e}}return e};r.id=this.name,e(r)}}function c(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch(e){}return t?function(e=[]){for(let r=e.length-1;r>=0;r--){var t=e[r];if(t&&""!==t.filename&&"[native code]"!==t.filename)return t.filename||null}return null}(t):null}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&n.kg.error(`Cannot extract url for event ${(0,i.jH)(e)}`),null}}s.__initStatic()},67966:function(e,t,r){"use strict";r.d(t,{M:function(){return o}});var n=r(38641),i=r(12343);function o(e,t){!0===t.debug&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?i.kg.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));var r=(0,n.Gd)(),o=r.getScope();o&&o.update(t.initialScope);var a=new e(t);r.bindClient(a)}},45431:function(e,t,r){"use strict";r.d(t,{q:function(){return u}});var n=r(81227),i=r(58725),o=r(80228),a=r(96893),s=r(12343),c=r(80409);function u(e,t,r=(0,n.x)(e.bufferSize||30)){let u={};return{send:function(n){var l=[];if((0,i.gv)(n,((t,r)=>{var n=(0,i.mL)(r);(0,o.Q)(u,n)?e.recordDroppedEvent("ratelimit_backoff",n):l.push(t)})),0===l.length)return(0,a.WD)();var p=(0,i.Jd)(n[0],l),d=t=>{(0,i.gv)(p,((r,n)=>{e.recordDroppedEvent(t,(0,i.mL)(n))}))};return r.add((()=>t({body:(0,i.V$)(p,e.textEncoder)}).then((e=>{void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),u=(0,o.WG)(u,e)}),(e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.error("Failed while sending event:",e),d("network_error")})))).then((e=>e),(e=>{if(e instanceof c.b)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.kg.error("Skipped sending event due to full buffer"),d("queue_overflow"),(0,a.WD)();throw e}))},flush:e=>r.drain(e)}}},40105:function(e,t,r){"use strict";r.d(t,{J:function(){return n}});var n="7.1.1"},92876:function(e,t,r){"use strict";r.d(t,{$e:function(){return o},Tb:function(){return i}});var n=r(38641);function i(e,t){return(0,n.Gd)().captureException(e,{captureContext:t})}function o(e){(0,n.Gd)().withScope(e)}},38641:function(e,t,r){"use strict";r.d(t,{Gd:function(){return h}});var n=r(62844),i=r(21170),o=r(12343),a=r(82991),s=r(61422),c=r(46769),u=r(95771),l=100;class p{__init(){this._stack=[{}]}constructor(e,t=new c.s,r=4){this._version=r,p.prototype.__init.call(this),this.getStackTop().scope=t,e&&this.bindClient(e)}isOlderThan(e){return this._version{n.captureException(e,{originalException:e,syntheticException:i,...t,event_id:r},o)})),r}captureMessage(e,t,r){var i=this._lastEventId=r&&r.event_id?r.event_id:(0,n.DM)(),o=new Error(e);return this._withClient(((n,a)=>{n.captureMessage(e,t,{originalException:e,syntheticException:o,...r,event_id:i},a)})),i}captureEvent(e,t){var r=t&&t.event_id?t.event_id:(0,n.DM)();return"transaction"!==e.type&&(this._lastEventId=r),this._withClient(((n,i)=>{n.captureEvent(e,{...t,event_id:r},i)})),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:r,client:n}=this.getStackTop();if(!r||!n)return;const{beforeBreadcrumb:a=null,maxBreadcrumbs:s=l}=n.getOptions&&n.getOptions()||{};if(!(s<=0)){var c={timestamp:(0,i.yW)(),...e},u=a?(0,o.Cf)((()=>a(c,t))):c;null!==u&&r.addBreadcrumb(u,s)}}setUser(e){var t=this.getScope();t&&t.setUser(e)}setTags(e){var t=this.getScope();t&&t.setTags(e)}setExtras(e){var t=this.getScope();t&&t.setExtras(e)}setTag(e,t){var r=this.getScope();r&&r.setTag(e,t)}setExtra(e,t){var r=this.getScope();r&&r.setExtra(e,t)}setContext(e,t){var r=this.getScope();r&&r.setContext(e,t)}configureScope(e){const{scope:t,client:r}=this.getStackTop();t&&r&&e(t)}run(e){var t=f(this);try{e(this)}finally{f(t)}}getIntegration(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&o.kg.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){return this._callExtensionMethod("startTransaction",e,t)}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){var e=this.getStackTop(),t=e&&e.scope,r=t&&t.getSession();r&&(0,u.RJ)(r),this._sendSessionUpdate(),t&&t.setSession()}startSession(e){const{scope:t,client:r}=this.getStackTop(),{release:n,environment:i}=r&&r.getOptions()||{};var o=(0,a.R)();const{userAgent:s}=o.navigator||{};var c=(0,u.Hv)({release:n,environment:i,...t&&{user:t.getUser()},...s&&{userAgent:s},...e});if(t){var l=t.getSession&&t.getSession();l&&"ok"===l.status&&(0,u.CT)(l,{status:"exited"}),this.endSession(),t.setSession(c)}return c}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop();if(e){var r=e.getSession();r&&t&&t.captureSession&&t.captureSession(r)}}_withClient(e){const{scope:t,client:r}=this.getStackTop();r&&e(r,t)}_callExtensionMethod(e,...t){var r=d().__SENTRY__;if(r&&r.extensions&&"function"==typeof r.extensions[e])return r.extensions[e].apply(this,t);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&o.kg.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function d(){var e=(0,a.R)();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function f(e){var t=d(),r=m(t);return b(t,e),r}function h(){var e=d();return g(e)&&!m(e).isOlderThan(4)||b(e,new p),(0,s.KV)()?function(e){try{var t=d().__SENTRY__,r=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!r)return m(e);if(!g(r)||m(r).isOlderThan(4)){var n=m(e).getStackTop();b(r,new p(n.client,c.s.clone(n.scope)))}return m(r)}catch(t){return m(e)}}(e):m(e)}function g(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function m(e){return(0,a.Y)("hub",(()=>new p),e)}function b(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}},46769:function(e,t,r){"use strict";r.d(t,{c:function(){return p},s:function(){return u}});var n=r(67597),i=r(21170),o=r(96893),a=r(12343),s=r(82991),c=r(95771);class u{constructor(){u.prototype.__init.call(this),u.prototype.__init2.call(this),u.prototype.__init3.call(this),u.prototype.__init4.call(this),u.prototype.__init5.call(this),u.prototype.__init6.call(this),u.prototype.__init7.call(this),u.prototype.__init8.call(this),u.prototype.__init9.call(this),u.prototype.__init10.call(this)}__init(){this._notifyingListeners=!1}__init2(){this._scopeListeners=[]}__init3(){this._eventProcessors=[]}__init4(){this._breadcrumbs=[]}__init5(){this._user={}}__init6(){this._tags={}}__init7(){this._extra={}}__init8(){this._contexts={}}__init9(){this._attachments=[]}__init10(){this._sdkProcessingMetadata={}}static clone(e){var t=new u;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags={...e._tags},t._extra={...e._extra},t._contexts={...e._contexts},t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments]),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&(0,c.CT)(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts={...this._contexts,[e]:t},this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){var e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if("function"==typeof e){var t=e(this);return t instanceof u?t:this}return e instanceof u?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession)):(0,n.PO)(e)&&(e=e,this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this}addBreadcrumb(e,t){var r="number"==typeof t?Math.min(t,100):100;if(r<=0)return this;var n={timestamp:(0,i.yW)(),...e};return this._breadcrumbs=[...this._breadcrumbs,n].slice(-r),this._notifyScopeListeners(),this}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={}){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};var r=this._span.transaction&&this._span.transaction.name;r&&(e.tags={transaction:r,...e.tags})}return this._applyFingerprint(e),e.breadcrumbs=[...e.breadcrumbs||[],...this._breadcrumbs],e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata=this._sdkProcessingMetadata,this._notifyEventProcessors([...l(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}_notifyEventProcessors(e,t,r,i=0){return new o.cW(((o,s)=>{var c=e[i];if(null===t||"function"!=typeof c)o(t);else{var u=c({...t},r);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&c.id&&null===u&&a.kg.log(`Event processor "${c.id}" dropped event`),(0,n.J8)(u)?u.then((t=>this._notifyEventProcessors(e,t,r,i+1).then(o))).then(null,s):this._notifyEventProcessors(e,u,r,i+1).then(o).then(null,s)}}))}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function l(){return(0,s.Y)("globalEventProcessors",(()=>[]))}function p(e){l().push(e)}},95771:function(e,t,r){"use strict";r.d(t,{CT:function(){return s},Hv:function(){return a},RJ:function(){return c}});var n=r(21170),i=r(62844),o=r(20535);function a(e){var t=(0,n.ph)(),r={sid:(0,i.DM)(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return(0,o.Jr)({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(r)};return e&&s(r,e),r}function s(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||(0,n.ph)(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:(0,i.DM)()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{var r=e.timestamp-e.started;e.duration=r>=0?r:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function c(e,t){let r={};t?r={status:t}:"ok"===e.status&&(r={status:"exited"}),s(e,r)}},58464:function(e,t,r){"use strict";r.d(t,{R:function(){return o},l:function(){return s}});var n=r(82991),i=r(67597);function o(e,t){try{let i=e;var r=[];let o=0,s=0;var n=" > ".length;let c;for(;i&&o++<5&&(c=a(i,t),!("html"===c||o>1&&s+r.length*n+c.length>=80));)r.push(c),s+=c.length,i=i.parentNode;return r.reverse().join(" > ")}catch(e){return""}}function a(e,t){var r=e,n=[];let o,a,s,c,u;if(!r||!r.tagName)return"";n.push(r.tagName.toLowerCase());var l=t&&t.length?t.filter((e=>r.getAttribute(e))).map((e=>[e,r.getAttribute(e)])):null;if(l&&l.length)l.forEach((e=>{n.push(`[${e[0]}="${e[1]}"]`)}));else if(r.id&&n.push(`#${r.id}`),o=r.className,o&&(0,i.HD)(o))for(a=o.split(/\s+/),u=0;ur.call(t,...e))),t=void 0)}return r}r.d(t,{x:function(){return n}})},47165:function(e,t,r){"use strict";r.d(t,{y:function(){return o}});var n=r(58725),i=r(21170);function o(e,t,r){var o=[{type:"client_report"},{timestamp:r||(0,i.yW)(),discarded_events:e}];return(0,n.Jd)(t?{dsn:t}:{},[o])}},30292:function(e,t,r){"use strict";r.d(t,{RA:function(){return o},vK:function(){return c}});var n=r(80409),i=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/;function o(e,t=!1){const{host:r,path:n,pass:i,port:o,projectId:a,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&i?`:${i}`:""}@${r}${o?`:${o}`:""}/${n?`${n}/`:n}${a}`}function a(e){var t=i.exec(e);if(!t)throw new n.b(`Invalid Sentry Dsn: ${e}`);const[r,o,a="",c,u="",l]=t.slice(1);let p="",d=l;var f=d.split("/");if(f.length>1&&(p=f.slice(0,-1).join("/"),d=f.pop()),d){var h=d.match(/^\d+/);h&&(d=h[0])}return s({host:c,pass:a,path:p,projectId:d,port:u,protocol:r,publicKey:o})}function s(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function c(e){var t="string"==typeof e?a(e):s(e);return function(e){if("undefined"!=typeof __SENTRY_DEBUG__&&!__SENTRY_DEBUG__)return;const{port:t,projectId:r,protocol:i}=e;if(["protocol","publicKey","host","projectId"].forEach((t=>{if(!e[t])throw new n.b(`Invalid Sentry Dsn: ${t} missing`)})),!r.match(/^\d+$/))throw new n.b(`Invalid Sentry Dsn: Invalid projectId ${r}`);if(!function(e){return"http"===e||"https"===e}(i))throw new n.b(`Invalid Sentry Dsn: Invalid protocol ${i}`);if(t&&isNaN(parseInt(t,10)))throw new n.b(`Invalid Sentry Dsn: Invalid port ${t}`)}(t),t}},68518:function(e,t,r){"use strict";function n(){return"undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&!!__SENTRY_BROWSER_BUNDLE__}r.d(t,{n:function(){return n}})},58725:function(e,t,r){"use strict";r.d(t,{BO:function(){return o},Jd:function(){return i},V$:function(){return c},gv:function(){return a},mL:function(){return p},zQ:function(){return u}});var n=r(20535);function i(e,t=[]){return[e,t]}function o(e,t){const[r,n]=e;return[r,[...n,t]]}function a(e,t){e[1].forEach((e=>{var r=e[0].type;t(e,r)}))}function s(e,t){return(t||new TextEncoder).encode(e)}function c(e,t){const[r,n]=e;let i=JSON.stringify(r);function o(e){"string"==typeof i?i="string"==typeof e?i+e:[s(i,t),e]:i.push("string"==typeof e?s(e,t):e)}for(var a of n){const[e,t]=a;o(`\n${JSON.stringify(e)}\n`),o("string"==typeof t||t instanceof Uint8Array?t:JSON.stringify(t))}return"string"==typeof i?i:function(e){var t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);let n=0;for(var i of e)r.set(i,n),n+=i.length;return r}(i)}function u(e,t){var r="string"==typeof e.data?s(e.data,t):e.data;return[(0,n.Jr)({type:"attachment",length:r.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),r]}var l={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default"};function p(e){return l[e]}},80409:function(e,t,r){"use strict";r.d(t,{b:function(){return n}});class n extends Error{constructor(e){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype)}}},82991:function(e,t,r){"use strict";r.d(t,{R:function(){return o},Y:function(){return a}});var n=r(61422),i={};function o(){return(0,n.KV)()?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:i}function a(e,t,r){var n=r||o(),i=n.__SENTRY__=n.__SENTRY__||{};return i[e]||(i[e]=t())}},9732:function(e,t,r){"use strict";r.d(t,{o:function(){return f}});var n=r(82991),i=r(67597),o=r(12343),a=r(20535),s=r(30360),c=r(8823),u=(0,n.R)(),l={},p={};function d(e){if(!p[e])switch(p[e]=!0,e){case"console":!function(){if(!("console"in u))return;o.RU.forEach((function(e){e in u.console&&(0,a.hl)(u.console,e,(function(t){return function(...r){h("console",{args:r,level:e}),t&&t.apply(u.console,r)}}))}))}();break;case"dom":!function(){if(!("document"in u))return;var e=h.bind(null,"dom"),t=_(e,!0);u.document.addEventListener("click",t,!1),u.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((t=>{var r=u[t]&&u[t].prototype;r&&r.hasOwnProperty&&r.hasOwnProperty("addEventListener")&&((0,a.hl)(r,"addEventListener",(function(t){return function(r,n,i){if("click"===r||"keypress"==r)try{var o=this,a=o.__sentry_instrumentation_handlers__=o.__sentry_instrumentation_handlers__||{},s=a[r]=a[r]||{refCount:0};if(!s.handler){var c=_(e);s.handler=c,t.call(this,r,c,i)}s.refCount+=1}catch(e){}return t.call(this,r,n,i)}})),(0,a.hl)(r,"removeEventListener",(function(e){return function(t,r,n){if("click"===t||"keypress"==t)try{var i=this,o=i.__sentry_instrumentation_handlers__||{},a=o[t];a&&(a.refCount-=1,a.refCount<=0&&(e.call(this,t,a.handler,n),a.handler=void 0,delete o[t]),0===Object.keys(o).length&&delete i.__sentry_instrumentation_handlers__)}catch(e){}return e.call(this,t,r,n)}})))}))}();break;case"xhr":!function(){if(!("XMLHttpRequest"in u))return;var e=XMLHttpRequest.prototype;(0,a.hl)(e,"open",(function(e){return function(...t){var r=this,n=t[1],o=r.__sentry_xhr__={method:(0,i.HD)(t[0])?t[0].toUpperCase():t[0],url:t[1]};(0,i.HD)(n)&&"POST"===o.method&&n.match(/sentry_key/)&&(r.__sentry_own_request__=!0);var s=function(){if(4===r.readyState){try{o.status_code=r.status}catch(e){}h("xhr",{args:t,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:r})}};return"onreadystatechange"in r&&"function"==typeof r.onreadystatechange?(0,a.hl)(r,"onreadystatechange",(function(e){return function(...t){return s(),e.apply(r,t)}})):r.addEventListener("readystatechange",s),e.apply(r,t)}})),(0,a.hl)(e,"send",(function(e){return function(...t){return this.__sentry_xhr__&&void 0!==t[0]&&(this.__sentry_xhr__.body=t[0]),h("xhr",{args:t,startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}}))}();break;case"fetch":!function(){if(!(0,c.t$)())return;(0,a.hl)(u,"fetch",(function(e){return function(...t){var r={args:t,fetchData:{method:g(t),url:m(t)},startTimestamp:Date.now()};return h("fetch",{...r}),e.apply(u,t).then((e=>(h("fetch",{...r,endTimestamp:Date.now(),response:e}),e)),(e=>{throw h("fetch",{...r,endTimestamp:Date.now(),error:e}),e}))}}))}();break;case"history":!function(){if(!(0,c.Bf)())return;var e=u.onpopstate;function t(e){return function(...t){var r=t.length>2?t[2]:void 0;if(r){var n=b,i=String(r);b=i,h("history",{from:n,to:i})}return e.apply(this,t)}}u.onpopstate=function(...t){var r=u.location.href,n=b;if(b=r,h("history",{from:n,to:r}),e)try{return e.apply(this,t)}catch(e){}},(0,a.hl)(u.history,"pushState",t),(0,a.hl)(u.history,"replaceState",t)}();break;case"error":w=u.onerror,u.onerror=function(e,t,r,n,i){return h("error",{column:n,error:i,line:r,msg:e,url:t}),!!w&&w.apply(this,arguments)};break;case"unhandledrejection":E=u.onunhandledrejection,u.onunhandledrejection=function(e){return h("unhandledrejection",e),!E||E.apply(this,arguments)};break;default:return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&o.kg.warn("unknown instrumentation type:",e))}}function f(e,t){l[e]=l[e]||[],l[e].push(t),d(e)}function h(e,t){if(e&&l[e])for(var r of l[e]||[])try{r(t)}catch(t){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&o.kg.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${(0,s.$P)(r)}\nError:`,t)}}function g(e=[]){return"Request"in u&&(0,i.V9)(e[0],Request)&&e[0].method?String(e[0].method).toUpperCase():e[1]&&e[1].method?String(e[1].method).toUpperCase():"GET"}function m(e=[]){return"string"==typeof e[0]?e[0]:"Request"in u&&(0,i.V9)(e[0],Request)?e[0].url:String(e[0])}let b;let v,y;function _(e,t=!1){return r=>{if(r&&y!==r&&!function(e){if("keypress"!==e.type)return!1;try{var t=e.target;if(!t||!t.tagName)return!0;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)return!1}catch(e){}return!0}(r)){var n="keypress"===r.type?"input":r.type;(void 0===v||function(e,t){if(!e)return!0;if(e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch(e){}return!1}(y,r))&&(e({event:r,name:n,global:t}),y=r),clearTimeout(v),v=u.setTimeout((()=>{v=void 0}),1e3)}}}let w=null;let E=null},67597:function(e,t,r){"use strict";r.d(t,{Cy:function(){return m},HD:function(){return u},J8:function(){return g},Kj:function(){return h},PO:function(){return p},TX:function(){return s},V9:function(){return v},VW:function(){return a},VZ:function(){return i},cO:function(){return d},fm:function(){return c},i2:function(){return b},kK:function(){return f},pt:function(){return l}});var n=Object.prototype.toString;function i(e){switch(n.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return v(e,Error)}}function o(e,t){return n.call(e)===`[object ${t}]`}function a(e){return o(e,"ErrorEvent")}function s(e){return o(e,"DOMError")}function c(e){return o(e,"DOMException")}function u(e){return o(e,"String")}function l(e){return null===e||"object"!=typeof e&&"function"!=typeof e}function p(e){return o(e,"Object")}function d(e){return"undefined"!=typeof Event&&v(e,Event)}function f(e){return"undefined"!=typeof Element&&v(e,Element)}function h(e){return o(e,"RegExp")}function g(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function m(e){return p(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function b(e){return"number"==typeof e&&e!=e}function v(e,t){try{return e instanceof t}catch(e){return!1}}},12343:function(e,t,r){"use strict";r.d(t,{Cf:function(){return a},RU:function(){return o},kg:function(){return c}});var n=r(82991),i=(0,n.R)(),o=["debug","info","warn","error","log","assert"];function a(e){var t=(0,n.R)();if(!("console"in t))return e();var r=t.console,i={};o.forEach((e=>{var n=r[e]&&r[e].__sentry_original__;e in t.console&&n&&(i[e]=r[e],r[e]=n)}));try{return e()}finally{Object.keys(i).forEach((e=>{r[e]=i[e]}))}}function s(){let e=!1;var t={enable:()=>{e=!0},disable:()=>{e=!1}};return"undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?o.forEach((r=>{t[r]=(...t)=>{e&&a((()=>{i.console[r](`Sentry Logger [${r}]:`,...t)}))}})):o.forEach((e=>{t[e]=()=>{}})),t}let c;c="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?(0,n.Y)("logger",s):s()},32004:function(e,t,r){"use strict";function n(){var e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(r){if(e)return!!t.has(r)||(t.add(r),!1);for(let e=0;e{let t=e.toString(16);for(;t.length<4;)t=`0${t}`;return t};return i(r[0])+i(r[1])+i(r[2])+i(r[3])+i(r[4])+i(r[5])+i(r[6])+i(r[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(e=>{var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function a(e){if(!e)return{};var t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var r=t[6]||"",n=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+r+n}}function s(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function c(e){const{message:t,event_id:r}=e;if(t)return t;var n=s(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"":r||""}function u(e,t,r){var n=e.exception=e.exception||{},i=n.values=n.values||[],o=i[0]=i[0]||{};o.value||(o.value=t||""),o.type||(o.type=r||"Error")}function l(e,t){var r=s(e);if(r){var n=r.mechanism;if(r.mechanism={type:"generic",handled:!0,...n,...t},t&&"data"in t){var i={...n&&n.data,...t.data};r.mechanism.data=i}}}function p(e){if(e&&e.__sentry_captured__)return!0;try{(0,i.xp)(e,"__sentry_captured__",!0)}catch(e){}return!1}},61422:function(e,t,r){"use strict";r.d(t,{KV:function(){return i},l$:function(){return o}});var n=r(68518);function i(){return!(0,n.n)()&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}function o(e,t){return e.require(t)}e=r.hmd(e)},90322:function(e,t,r){"use strict";r.d(t,{Fv:function(){return s},Qy:function(){return c}});var n=r(67597),i=r(32004),o=r(20535),a=r(30360);function s(e,t=1/0,r=1/0){try{return u("",e,t,r)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function c(e,t=3,r=102400){var n,i=s(e,t);return n=i,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(n))>r?c(e,t-1,r):i}function u(e,t,s=1/0,c=1/0,l=(0,i.i)()){const[p,d]=l;var f=t;if(f&&"function"==typeof f.toJSON)try{return f.toJSON()}catch(e){}if(null===t||["number","boolean","string"].includes(typeof t)&&!(0,n.i2)(t))return t;var h=function(e,t){try{return"domain"===e&&t&&"object"==typeof t&&t._events?"[Domain]":"domainEmitter"===e?"[DomainEmitter]":void 0!==r.g&&t===r.g?"[Global]":"undefined"!=typeof window&&t===window?"[Window]":"undefined"!=typeof document&&t===document?"[Document]":(0,n.Cy)(t)?"[SyntheticEvent]":"number"==typeof t&&t!=t?"[NaN]":void 0===t?"[undefined]":"function"==typeof t?`[Function: ${(0,a.$P)(t)}]`:"symbol"==typeof t?`[${String(t)}]`:"bigint"==typeof t?`[BigInt: ${String(t)}]`:`[object ${Object.getPrototypeOf(t).constructor.name}]`}catch(e){return`**non-serializable** (${e})`}}(e,t);if(!h.startsWith("[object "))return h;if(t.__sentry_skip_normalization__)return t;if(0===s)return h.replace("object ","");if(p(t))return"[Circular ~]";var g=Array.isArray(t)?[]:{};let m=0;var b=(0,o.Sh)(t);for(var v in b)if(Object.prototype.hasOwnProperty.call(b,v)){if(m>=c){g[v]="[MaxProperties ~]";break}var y=b[v];g[v]=u(v,y,s-1,c,l),m+=1}return d(t),g}},20535:function(e,t,r){"use strict";r.d(t,{$Q:function(){return c},HK:function(){return u},Jr:function(){return g},Sh:function(){return p},_j:function(){return l},hl:function(){return a},xp:function(){return s},zf:function(){return h}});var n=r(58464),i=r(67597),o=r(57321);function a(e,t,r){if(t in e){var n=e[t],i=r(n);if("function"==typeof i)try{c(i,n)}catch(e){}e[t]=i}}function s(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}function c(e,t){var r=t.prototype||{};e.prototype=t.prototype=r,s(e,"__sentry_original__",t)}function u(e){return e.__sentry_original__}function l(e){return Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}function p(e){if((0,i.VZ)(e))return{message:e.message,name:e.name,stack:e.stack,...f(e)};if((0,i.cO)(e)){var t={type:e.type,target:d(e.target),currentTarget:d(e.currentTarget),...f(e)};return"undefined"!=typeof CustomEvent&&(0,i.V9)(e,CustomEvent)&&(t.detail=e.detail),t}return e}function d(e){try{return(0,i.kK)(e)?(0,n.R)(e):Object.prototype.toString.call(e)}catch(e){return""}}function f(e){if("object"==typeof e&&null!==e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}return{}}function h(e,t=40){var r=Object.keys(p(e));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=t)return(0,o.$G)(r[0],t);for(let e=r.length;e>0;e--){var n=r.slice(0,e).join(", ");if(!(n.length>t))return e===r.length?n:(0,o.$G)(n,t)}return""}function g(e){return m(e,new Map)}function m(e,t){if((0,i.PO)(e)){if(void 0!==(o=t.get(e)))return o;var r={};for(var n of(t.set(e,r),Object.keys(e)))void 0!==e[n]&&(r[n]=m(e[n],t));return r}if(Array.isArray(e)){var o;if(void 0!==(o=t.get(e)))return o;r=[];return t.set(e,r),e.forEach((e=>{r.push(m(e,t))})),r}return e}},81227:function(e,t,r){"use strict";r.d(t,{x:function(){return o}});var n=r(80409),i=r(96893);function o(e){var t=[];function r(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(o){if(!(void 0===e||t.lengthr(a))).then(null,(()=>r(a).then(null,(()=>{})))),a},drain:function(e){return new i.cW(((r,n)=>{let o=t.length;if(!o)return r(!0);var a=setTimeout((()=>{e&&e>0&&r(!1)}),e);t.forEach((e=>{(0,i.WD)(e).then((()=>{--o||(clearTimeout(a),r(!0))}),n)}))}))}}}},80228:function(e,t,r){"use strict";r.d(t,{Q:function(){return n},WG:function(){return i}});function n(e,t,r=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>r}function i(e,{statusCode:t,headers:r},n=Date.now()){var i={...e},o=r&&r["x-sentry-rate-limits"],a=r&&r["retry-after"];if(o)for(var s of o.trim().split(",")){const[e,t]=s.split(":",2);var c=parseInt(e,10),u=1e3*(isNaN(c)?60:c);if(t)for(var l of t.split(";"))i[l]=n+u;else i.all=n+u}else a?i.all=n+function(e,t=Date.now()){var r=parseInt(`${e}`,10);if(!isNaN(r))return 1e3*r;var n=Date.parse(`${e}`);return isNaN(n)?6e4:n-t}(a,n):429===t&&(i.all=n+6e4);return i}},16547:function(e,t,r){"use strict";r.d(t,{VT:function(){return i}});var n=["fatal","error","warning","log","info","debug"];function i(e){return"warn"===e?"warning":n.includes(e)?e:"log"}},30360:function(e,t,r){"use strict";r.d(t,{$P:function(){return a},Sq:function(){return i},pE:function(){return n}});function n(...e){var t=e.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return(e,r=0)=>{var n=[];for(var i of e.split("\n").slice(r))for(var o of t){var a=o(i);if(a){n.push(a);break}}return function(e){if(!e.length)return[];let t=e;var r=t[0].function||"",n=t[t.length-1].function||"";-1===r.indexOf("captureMessage")&&-1===r.indexOf("captureException")||(t=t.slice(1));-1!==n.indexOf("sentryWrapped")&&(t=t.slice(0,-1));return t.slice(0,50).map((e=>({...e,filename:e.filename||t[0].filename,function:e.function||"?"}))).reverse()}(n)}}function i(e){return Array.isArray(e)?n(...e):e}var o="";function a(e){try{return e&&"function"==typeof e&&e.name||o}catch(e){return o}}},57321:function(e,t,r){"use strict";r.d(t,{$G:function(){return i},nK:function(){return o},zC:function(){return a}});var n=r(67597);function i(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.substr(0,t)}...`}function o(e,t){if(!Array.isArray(e))return"";var r=[];for(let t=0;t{t(e)}))}function a(e){return new s(((t,r)=>{r(e)}))}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(n||(n={}));class s{__init(){this._state=n.PENDING}__init2(){this._handlers=[]}constructor(e){s.prototype.__init.call(this),s.prototype.__init2.call(this),s.prototype.__init3.call(this),s.prototype.__init4.call(this),s.prototype.__init5.call(this),s.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new s(((r,n)=>{this._handlers.push([!1,t=>{if(e)try{r(e(t))}catch(e){n(e)}else r(t)},e=>{if(t)try{r(t(e))}catch(e){n(e)}else n(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new s(((t,r)=>{let n,i;return this.then((t=>{i=!1,n=t,e&&e()}),(t=>{i=!0,n=t,e&&e()})).then((()=>{i?r(n):t(n)}))}))}__init3(){this._resolve=e=>{this._setResult(n.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(n.REJECTED,e)}}__init5(){this._setResult=(e,t)=>{this._state===n.PENDING&&((0,i.J8)(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state!==n.PENDING){var e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===n.RESOLVED&&e[1](this._value),this._state===n.REJECTED&&e[2](this._value),e[0]=!0)}))}}}}},21170:function(e,t,r){"use strict";r.d(t,{ph:function(){return u},yW:function(){return c}});var n=r(82991),i=r(61422);e=r.hmd(e);var o={nowSeconds:()=>Date.now()/1e3};var a=(0,i.KV)()?function(){try{return(0,i.l$)(e,"perf_hooks").performance}catch(e){return}}():function(){const{performance:e}=(0,n.R)();if(e&&e.now)return{now:()=>e.now(),timeOrigin:Date.now()-e.now()}}(),s=void 0===a?o:{nowSeconds:()=>(a.timeOrigin+a.now())/1e3},c=o.nowSeconds.bind(o),u=s.nowSeconds.bind(s);let l;(()=>{const{performance:e}=(0,n.R)();if(e&&e.now){var t=36e5,r=e.now(),i=Date.now(),o=e.timeOrigin?Math.abs(e.timeOrigin+r-i):t,a=o"']/gm,(function(e){return"&"===e?"&":"<"===e?"<":">"===e?">":'"'===e?""":"'"===e?"'":void 0}))},e.prototype.append_buffer=function(e){var t=this._buffer+e;this._buffer=t},e.prototype.get_next_packet=function(){var e={kind:t.EOS,text:"",url:""},n=this._buffer.length;if(0==n)return e;var a=this._buffer.indexOf("");if(-1==a)return e.kind=t.Text,e.text=this._buffer,this._buffer="",e;if(a>0)return e.kind=t.Text,e.text=this._buffer.slice(0,a),this._buffer=this._buffer.slice(a),e;if(0==a){if(1==n)return e.kind=t.Incomplete,e;var s=this._buffer.charAt(1);if("["!=s&&"]"!=s)return e.kind=t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;if("["==s){if(this._csi_regex||(this._csi_regex=i(r(["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n [ # CSI\n ([<-?]?) # private-mode char\n ([d;]*) # any digits or semicolons\n ([ -/]? # an intermediate modifier\n [@-~]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n [ # CSI\n [ -~]* # anything legal\n ([\0-:]) # anything illegal\n )\n "],["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n \\x1b\\[ # CSI\n ([\\x3c-\\x3f]?) # private-mode char\n ([\\d;]*) # any digits or semicolons\n ([\\x20-\\x2f]? # an intermediate modifier\n [\\x40-\\x7e]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n \\x1b\\[ # CSI\n [\\x20-\\x7e]* # anything legal\n ([\\x00-\\x1f:]) # anything illegal\n )\n "]))),null===(l=this._buffer.match(this._csi_regex)))return e.kind=t.Incomplete,e;if(l[4])return e.kind=t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;""!=l[1]||"m"!=l[3]?e.kind=t.Unknown:e.kind=t.SGR,e.text=l[2];var c=l[0].length;return this._buffer=this._buffer.slice(c),e}if("]"==s){if(n<4)return e.kind=t.Incomplete,e;if("8"!=this._buffer.charAt(2)||";"!=this._buffer.charAt(3))return e.kind=t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;this._osc_st||(this._osc_st=o(r(["\n (?: # legal sequence\n (\\) # ESC | # alternate\n () # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\0-] # anything illegal\n | # alternate\n [\b-] # anything illegal\n | # alternate\n [-] # anything illegal\n )\n "],["\n (?: # legal sequence\n (\\x1b\\\\) # ESC \\\n | # alternate\n (\\x07) # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\\x00-\\x06] # anything illegal\n | # alternate\n [\\x08-\\x1a] # anything illegal\n | # alternate\n [\\x1c-\\x1f] # anything illegal\n )\n "]))),this._osc_st.lastIndex=0;var u=this._osc_st.exec(this._buffer);if(null===u)return e.kind=t.Incomplete,e;if(u[3])return e.kind=t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;var l,p=this._osc_st.exec(this._buffer);return null===p?(e.kind=t.Incomplete,e):p[3]?(e.kind=t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e):(this._osc_regex||(this._osc_regex=i(r(["\n ^ # beginning of line\n #\n ]8; # OSC Hyperlink\n [ -:<-~]* # params (excluding ;)\n ; # end of params\n ([!-~]{0,512}) # URL capture\n (?: # ST\n (?:\\) # ESC | # alternate\n (?:) # BEL (what xterm did)\n )\n ([ -~]+) # TEXT capture\n ]8;; # OSC Hyperlink End\n (?: # ST\n (?:\\) # ESC | # alternate\n (?:) # BEL (what xterm did)\n )\n "],["\n ^ # beginning of line\n #\n \\x1b\\]8; # OSC Hyperlink\n [\\x20-\\x3a\\x3c-\\x7e]* # params (excluding ;)\n ; # end of params\n ([\\x21-\\x7e]{0,512}) # URL capture\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n ([\\x20-\\x7e]+) # TEXT capture\n \\x1b\\]8;; # OSC Hyperlink End\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n "]))),null===(l=this._buffer.match(this._osc_regex))?(e.kind=t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e):(e.kind=t.OSCURL,e.url=l[1],e.text=l[2],c=l[0].length,this._buffer=this._buffer.slice(c),e))}}},e.prototype.ansi_to_html=function(e){this.append_buffer(e);for(var r=[];;){var n=this.get_next_packet();if(n.kind==t.EOS||n.kind==t.Incomplete)break;n.kind!=t.ESC&&n.kind!=t.Unknown&&(n.kind==t.Text?r.push(this.transform_to_html(this.with_state(n))):n.kind==t.SGR?this.process_ansi(n):n.kind==t.OSCURL&&r.push(this.process_hyperlink(n)))}return r.join("")},e.prototype.with_state=function(e){return{bold:this.bold,italic:this.italic,underline:this.underline,fg:this.fg,bg:this.bg,text:e.text}},e.prototype.process_ansi=function(e){for(var t=e.text.split(";");t.length>0;){var r=t.shift(),n=parseInt(r,10);if(isNaN(n)||0===n)this.fg=this.bg=null,this.bold=!1,this.italic=!1,this.underline=!1;else if(1===n)this.bold=!0;else if(3===n)this.italic=!0;else if(4===n)this.underline=!0;else if(22===n)this.bold=!1;else if(23===n)this.italic=!1;else if(24===n)this.underline=!1;else if(39===n)this.fg=null;else if(49===n)this.bg=null;else if(n>=30&&n<38)this.fg=this.ansi_colors[0][n-30];else if(n>=40&&n<48)this.bg=this.ansi_colors[0][n-40];else if(n>=90&&n<98)this.fg=this.ansi_colors[1][n-90];else if(n>=100&&n<108)this.bg=this.ansi_colors[1][n-100];else if((38===n||48===n)&&t.length>0){var i=38===n,o=t.shift();if("5"===o&&t.length>0){var a=parseInt(t.shift(),10);a>=0&&a<=255&&(i?this.fg=this.palette_256[a]:this.bg=this.palette_256[a])}if("2"===o&&t.length>2){var s=parseInt(t.shift(),10),c=parseInt(t.shift(),10),u=parseInt(t.shift(),10);if(s>=0&&s<=255&&c>=0&&c<=255&&u>=0&&u<=255){var l={rgb:[s,c,u],class_name:"truecolor"};i?this.fg=l:this.bg=l}}}}},e.prototype.transform_to_html=function(e){var t=e.text;if(0===t.length)return t;if(t=this.escape_txt_for_html(t),!e.bold&&!e.italic&&!e.underline&&null===e.fg&&null===e.bg)return t;var r=[],n=[],i=e.fg,o=e.bg;e.bold&&r.push("font-weight:bold"),e.italic&&r.push("font-style:italic"),e.underline&&r.push("text-decoration:underline"),this._use_classes?(i&&("truecolor"!==i.class_name?n.push(i.class_name+"-fg"):r.push("color:rgb("+i.rgb.join(",")+")")),o&&("truecolor"!==o.class_name?n.push(o.class_name+"-bg"):r.push("background-color:rgb("+o.rgb.join(",")+")"))):(i&&r.push("color:rgb("+i.rgb.join(",")+")"),o&&r.push("background-color:rgb("+o.rgb+")"));var a="",s="";return n.length&&(a=' class="'+n.join(" ")+'"'),r.length&&(s=' style="'+r.join(";")+'"'),""+t+""},e.prototype.process_hyperlink=function(e){var t=e.url.split(":");return t.length<1?"":this._url_whitelist[t[0]]?''+this.escape_txt_for_html(e.text)+"":""},e}();function i(e){for(var t=[],r=1;r\n \n \n
\n \n
<a href="'+s+'">\n    <img src="'+a+'">\n</a>
\n
\n
\n \n
[![SWH]('+a+")]("+s+')
\n
\n
\n \n
.. image:: '+a+"\n    :target: "+s+"
\n
";swh.webapp.showModalHtml("Software Heritage badge integration",c),swh.webapp.highlightCode(!1,".swh-badge-html"),swh.webapp.highlightCode(!1,".swh-badge-md")}r.d(t,{h:function(){return n}})},57050:function(e,t,r){"use strict";r.d(t,{IG:function(){return p},KC:function(){return c},RI:function(){return u},Xm:function(){return l},xw:function(){return d}});var n=r(15861),i=r(87757),o=r.n(i),a=r(59537),s=null;function c(e,t){void 0===t&&(t=!1);var r=$('.hljs-ln-line[data-line-number="'+e+'"]');return r.css("background-color","rgb(193, 255, 193)"),t&&(s=e),r}function u(e,t){if(e){t||(t=e);for(var r=e;r<=t;++r)c(r)}}function l(){s=null,$(".hljs-ln-line[data-line-number]").css("background-color","inherit")}function p(e,t){void 0===t&&(t=70),$(e).closest(".swh-content").length>0&&$("html, body").animate({scrollTop:$(e).offset().top-t},500)}function d(e,t,r){return f.apply(this,arguments)}function f(){return(f=(0,n.Z)(o().mark((function e(t,n,i){var d;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d=function(){var e=[],t=new RegExp(/L(\d+)/g),r=t.exec(window.location.hash);if(null!==r){for(;r;)e.push(parseInt(r[1])),r=t.exec(window.location.hash);l(),1===e.length?(s=parseInt(e[0]),p(c(e[0]))):e[0]s){var r=s;l(),u(r,t),s=r,window.location.hash="#L"+r+"-L"+t}else l(),c(t),window.location.hash="#L"+t,p(e.target)}else $(e.target).closest(".hljs-ln").length&&(l(),(0,a.L3)())})),$(window).on("hashchange",(function(){return d()})),setTimeout((function(){d()})))}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},38395:function(e,t,r){"use strict";r.d(t,{q:function(){return a}});var n=r(15861),i=r(87757),o=r.n(i);function a(e,t){return s.apply(this,arguments)}function s(){return(s=(0,n.Z)(o().mark((function e(t,n){var i,a,s,c,u,l,p,d,f,h,g,m,b,v,y,_,w;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w=function(e){var t=h.invert(i.pointer(e)[0]),r=y(n,t,1);if(!(r>=n.length)){var o=n[r-1],a=n[r],s=t-o[0]>a[0]-t?a:o;_.attr("transform","translate("+h(s[0])+", "+g(s[1])+")");var c=b(s[0])+" "+v(s[1]);l.html(c).style("left",e.pageX+15+"px").style("top",e.pageY+"px")}},e.next=3,r.e(891).then(r.bind(r,40847));case 3:(i=e.sent).select(t).select("svg").remove(),i.select(t+"-tooltip").remove(),a=400,s=300,c={top:20,right:50,bottom:70,left:30},u=i.select(t).attr("style","padding-bottom: "+Math.ceil(100*s/a)+"%").append("svg").attr("viewBox","0 0 "+a+" "+s),l=i.select("body").append("div").attr("class","d3-tooltip").attr("id",t+"-tooltip").style("opacity",0),a=a-c.left-c.right,s=s-c.top-c.bottom,n.sort((function(e,t){return e[0]-t[0]!=0?e[0]-t[0]:e[1]-t[1]})),p=n[0],d=n[n.length-1],f=u.append("g").attr("transform","translate("+c.left+", "+c.top+")"),h=i.scaleTime().rangeRound([0,a]).domain([p[0],d[0]]).nice(),g=i.scaleLinear().range([s,0]).domain([p[1],d[1]]).nice(),m=i.line().x((function(e){return h(e[0])})).y((function(e){return g(e[1])})),b=i.timeFormat("%d %b %Y"),v=function(e){return i.format(".3s")(e).replace(/G/,"B")},y=i.bisector((function(e){return e[0]})).left,f.append("g").attr("class","axis").attr("transform","translate(0, "+s+")").call(i.axisBottom(h).ticks(10).tickFormat(b)).selectAll("text").style("text-anchor","end").attr("dx","-.8em").attr("dy",".15em").attr("transform","rotate(-65)"),f.append("g").attr("class","axis").attr("transform","translate("+a+", 0)").call(i.axisRight(g).ticks(10).tickFormat(v)),f.append("path").datum(n).attr("class","swh-history-counter-line").attr("d",m),(_=f.append("g").attr("class","swh-history-counter-focus").style("display","none")).append("circle").attr("r",8),f.append("rect").attr("class","swh-history-counter-overlay").attr("width",a).attr("height",s).on("mouseover",(function(e){_.style("display",null),w(e),l.transition().duration(200).style("opacity",1)})).on("mouseout",(function(){_.style("display","none"),l.transition().duration(200).style("opacity",0)})).on("mousemove",(function(e){w(e)}));case 29:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},3140:function(e,t,r){"use strict";function n(e,t){var r="\n

\n You can embed that "+e+' view in an external website\n through the use of an iframe. Use the following HTML code\n to do so.\n

\n
<iframe style="width: 100%; height: 500px; border: 1px solid rgba(0, 0, 0, 0.125);"\n        src="'+window.location.origin+Urls.swhid_iframe(t.replaceAll("\n",""))+'">\n</iframe>
\n ';swh.webapp.showModalHtml("Software Heritage "+e+" iframe",r,"1000px"),swh.webapp.highlightCode(!1,".swh-iframe-html")}r.d(t,{j:function(){return n}})},14132:function(e,t,r){"use strict";r.d(t,{d:function(){return s}});var n=r(15861),i=r(87757),o=r.n(i),a=r(59537);function s(){return c.apply(this,arguments)}function c(){return(c=(0,n.Z)(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return window.MathJax={chtml:{fontURL:(0,a.TT)("fonts/")},tex:{tags:"ams",useLabelIds:!0,inlineMath:[["$","$"],["\\(","\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],processEscapes:!0,processEnvironments:!0}},e.next=3,r.e(684).then(r.bind(r,7321));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},99400:function(e,t,r){"use strict";r.d(t,{Q:function(){return p}});var n=r(15861),i=r(87757),o=r.n(i),a=(r(37755),r(34431)),s=new(r.n(a)());function c(e){return e=(e=e.replace(//g,">")}function u(e){return e=(e=e.replace(/</g,"<")).replace(/>/g,">")}function l(e){for(var t,r,n,i=/\$\$([\s\S]+?)\$\$|\\\\\[([\s\S]+?)\\\\\]/gm,o=/\$(.+?)\$|\\\\\((.+?)\\\\\)/g,a=/\\begin\{([a-z]*\*?)\}([\s\S]+?)\\end\{\1\}/gm,s=[];null!==(t=i.exec(e));)s.push(t[1]);for(;null!==(r=o.exec(e));)s.push(r[1]);for(;null!==(n=a.exec(e));)s.push(n[1]);for(var u=0,l=s;u=i.numPages||(s++,g(s))},m=function(){s<=1||(s--,g(s))},g=function(e){c?u=e:f(e)},h=function(){return(h=(0,n.Z)(o().mark((function e(t){var r,n,a,s,h;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=!0,e.next=3,i.getPage(t);case 3:return r=e.sent,n=$(".swh-content").width(),a=Math.min(l,n/r.getViewport({scale:1}).width),s=r.getViewport({scale:a}),p.width=s.width,p.height=s.height,h={canvasContext:d,viewport:s},e.next=12,r.render(h);case 12:c=!1,null!==u&&(f(u),u=null),$("#pdf-page-num").text(t);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)},f=function(e){return h.apply(this,arguments)},i=null,s=1,c=!1,u=null,l=1.5,p=$("#pdf-canvas")[0],d=p.getContext("2d"),e.next=14,r.e(509).then(r.t.bind(r,85719,23));case 14:(v=e.sent).GlobalWorkerOptions.workerSrc=(0,a.TT)("js/pdf.worker.min.js"),$(document).ready((0,n.Z)(o().mark((function e(){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return $("#pdf-prev").click(m),$("#pdf-next").click(b),e.prev=2,e.next=5,v.getDocument(t).promise;case 5:r=e.sent,i=r,$("#pdf-page-count").text(i.numPages),f(s),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),console.error(e.t0);case 14:$(window).on("resize",(function(){g(s)}));case 15:case"end":return e.stop()}}),e,null,[[2,11]])}))));case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},6043:function(e,t,r){"use strict";r.d(t,{BV:function(){return f},EK:function(){return d},Le:function(){return l},ap:function(){return c}});var n=r(15861),i=r(87757),o=r.n(i),a=r(59537),s=r(19215);function c(e,t){return u.apply(this,arguments)}function u(){return(u=(0,n.Z)(o().mark((function e(t,i){var c,u;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=function(){return[{type:"output",filter:function(e,t,r){var n='class="';return c.helper.replaceRecursiveRegExp(e,(function(e,t,r,i){t=(0,s.decode)(t);var o=(r.match(/class="([^ "]+)/)||[])[1];if(r.includes(n)){var a=r.indexOf(n)+n.length;r=r.slice(0,a)+"hljs "+r.slice(a)}else r=r.slice(0,-1)+' class="hljs">';return o&&hljs.getLanguage(o)?r+hljs.highlight(t,{language:o}).value+i:r+t+i}),"
]*>","
","g")}}]},e.next=3,r.e(522).then(r.bind(r,83035));case 3:return c=e.sent,e.next=6,r.e(399).then(r.bind(r,68480));case 6:$(document).ready((0,n.Z)(o().mark((function e(){var r,n,s,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new c.Converter({tables:!0,extensions:[u]}),(n=new URL(window.location.href)).searchParams.has("origin_url"))try{"github.com"===new URL(n.searchParams.get("origin_url")).hostname&&r.setFlavor("github")}catch(e){}return e.prev=3,e.next=6,fetch(i);case 6:return s=e.sent,(0,a.ry)(s),e.next=10,s.text();case 10:l=e.sent,$(t).addClass("swh-showdown"),$(t).html(swh.webapp.filterXSS(r.makeHtml(l))),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(3),$(t).text("Readme bytes are not available");case 18:case"end":return e.stop()}}),e,null,[[3,15]])}))));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(e,t){return p.apply(this,arguments)}function p(){return(p=(0,n.Z)(o().mark((function e(t,n){var i,a,s,c;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.e(46).then(r.bind(r,49429));case 2:i=e.sent,a=new i.Parser,s=a.parse(n,{toc:!1}),c=s.convert(i.ConverterHTML,{}),$(t).addClass("swh-org"),$(t).html(swh.webapp.filterXSS(c.toString())),$(".swh-org ul").first().remove(),$(".section-number").remove();case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function d(e,t){$(document).ready((0,n.Z)(o().mark((function r(){var n,i;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,fetch(t);case 3:return n=r.sent,(0,a.ry)(n),r.next=7,n.text();case 7:i=r.sent,l(e,i),r.next=14;break;case 11:r.prev=11,r.t0=r.catch(0),$(e).text("Readme bytes are not available");case 14:case"end":return r.stop()}}),r,null,[[0,11]])}))))}function f(e,t){$(document).ready((0,n.Z)(o().mark((function r(){var n,i,s;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,fetch(t);case 3:return n=r.sent,(0,a.ry)(n),r.next=7,n.text();case 7:i=r.sent,s="-*- mode: org -*-",-1!==i.indexOf(s)?l(e,i.replace(s,"")):($(e).addClass("swh-readme-txt"),$(e).html("").append($("
").text(i))),r.next=15;break;case 12:r.prev=12,r.t0=r.catch(0),$(e).text("Readme bytes are not available");case 15:case"end":return r.stop()}}),r,null,[[0,12]])}))))}},72725:function(e,t,r){"use strict";r.d(t,{D:function(){return o},p:function(){return a}});var n=r(19011),i=r(92876);function o(e){void 0!==e&&n.S1({dsn:e})}function a(e){i.Tb(e)}},58017:function(e,t,r){"use strict";r.d(t,{N:function(){return u}});var n=r(15861),i=r(87757),o=r.n(i);function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r',i=1;i<=r.pages;++i){var o="";i===r.page+1&&(o="selected"),n+='"}n+=" / "+r.pages+"",$(t.target).popover({title:"Jump to page",content:n,html:!0,placement:"top",sanitizeFn:swh.webapp.filterXSS}),$(t.target).popover("show"),$(".jump-to-page").on("change",(function(){$(".paginate_button.disabled").popover("hide");var t=parseInt($(this).val())-1;e.page(t).draw("page")}))}))})),e.on("preXhr.dt",(function(){$(".paginate_button.disabled").popover("hide")}))}function E(e){d=e}function x(e){return d[e]}void 0!==h&&(f="sidebar-collapse"===h),$(document).on("DOMContentLoaded",(function(){if($(window).width()=u.GI&&$(".swh-words-logo-swh").css("visibility","visible")})),$(document).on("shown.lte.pushmenu",(function(e){$(".swh-words-logo-swh").css("visibility","hidden")})),$(document).ready((function(){$(".swh-browse-link").click((function(e){var t=sessionStorage.getItem("last-browse-page");t&&(e.preventDefault(),window.location=t)}));var e=$(".main-sidebar");function t(){var r=$("body");r.hasClass("sidebar-collapse")&&!e.hasClass("swh-sidebar-collapsed")?(e.removeClass("swh-sidebar-expanded"),e.addClass("swh-sidebar-collapsed"),$(".swh-words-logo-swh").css("visibility","visible")):r.hasClass("sidebar-collapse")||e.hasClass("swh-sidebar-expanded")||(e.removeClass("swh-sidebar-collapsed"),e.addClass("swh-sidebar-expanded"),$(".swh-words-logo-swh").css("visibility","hidden")),r.hasClass("hold-transition")&&setTimeout((function(){t()}))}e.on("transitionend",(function(e){t()})),t(),g(),$(window).resize((function(){g(),$("body").hasClass("sidebar-collapse")&&$("body").width()>=u.GI&&$(".swh-words-logo-swh").css("visibility","visible")})),s()(),$(".swh-browse-top-navigation").append($(".modal"));var r=null;function n(e){if(e.clientX&&e.clientY)for(var t,r=l(document.elementsFromPoint(e.clientX,e.clientY));!(t=r()).done;){var n=t.value;if("CODE"===n.nodeName||"PRE"===n.nodeName)return n}return null}function i(e,t){if(t){var r=$(t).find(".hljs-ln-code");r.length?(0,c.eO)(r[0],r[r.length-1]):(0,c.eO)(t.firstChild,t.lastChild),e.preventDefault()}}$(document).click((function(e){r=n(e)})),$(document).dblclick((function(e){(e.ctrlKey||e.metaKey)&&i(e,n(e))})),$(document).keydown((function(e){(e.ctrlKey||e.metaKey)&&"a"===e.key&&i(e,r)}));var o=0;o+=$(".swh-top-bar").height()||0,o+=$(".navbar").height()||0,$(window).scroll((function(){$(window).scrollTop()>o?$("#back-to-top").css("display","block"):$("#back-to-top").css("display","none")})),$("#swh-origins-search-top").submit((function(e){if(e.preventDefault(),e.target.checkValidity()){$(e.target).removeClass("was-validated");var t=$("#swh-origins-search-top-input").val().trim(),r=new URLSearchParams;r.append("q",t),r.append("with_visit",!0),r.append("with_content",!0),window.location=Urls.browse_search()+"?"+r.toString()}else $(e.target).addClass("was-validated")}))}));var k={};function S(e){k=e}function D(){return k}var T={};function A(e){T={};for(var t,r=l(e);!(t=r()).done;){var n=t.value;T[n.object_type]=n}}function q(){return T}function N(e){e?($("#swh-web-content").removeClass("container"),$("#swh-web-content").addClass("container-fluid")):($("#swh-web-content").removeClass("container-fluid"),$("#swh-web-content").addClass("container")),localStorage.setItem("swh-web-full-width",JSON.stringify(e)),$("#swh-full-width-switch").prop("checked",e)}function R(e){N($(e.target).prop("checked"))}function L(){var e=JSON.parse(localStorage.getItem("swh-web-full-width"));null!==e&&N(e)}function C(e){var t=e.indexOf(";"),r=e;return-1!==t&&(r=e.slice(0,t)),r.toLowerCase()===r}function O(e){return B.apply(this,arguments)}function B(){return(B=(0,n.Z)(o().mark((function e(t){var r,n,i,a,s,c,u;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.value.trim(),n="",!r.toLowerCase().startsWith("swh:")){e.next=16;break}if(!C(r)){e.next=14;break}return i=Urls.api_1_resolve_swhid(r),e.next=7,fetch(i);case 7:return a=e.sent,e.next=10,a.json();case 10:(s=e.sent).hasOwnProperty("exception")&&(n=s.reason),e.next=16;break;case 14:-1===(c=r.indexOf(";"))?(n="Invalid SWHID: all characters must be in lowercase. ",n+="Valid SWHID is "+r.toLowerCase()):(n="Invalid SWHID: the core part must be in lowercase. ",u=r.slice(0,c),n+="Valid SWHID is "+r.replace(u,u.toLowerCase()));case 16:t.setCustomValidity(n),$(t).siblings(".invalid-feedback").text(n);case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function U(){return JSON.parse($("#swh_user_logged_in").text())}},82690:function(e,t,r){"use strict";r.d(t,{U:function(){return o}});var n=r(27856),i=r.n(n);function o(e){return i().sanitize(e)}i().addHook("uponSanitizeAttribute",(function(e,t){if("IMG"===e.nodeName&&"src"===t.attrName){if(t.attrValue.startsWith("data:image")||t.attrValue.startsWith("http:")||t.attrValue.startsWith("https:"))return;var r,n=swh.webapp.getBrowsedSwhObjectMetadata();if(!n.hasOwnProperty("directory"))return;r="directory"===n.object_type?n.object_id:n.directory;var i=Urls.browse_directory_resolve_content_path(r),o=t.attrValue,a=o;a.startsWith("/")||(a="/"+a);var s=new URL(window.location.origin+a);s.search&&(o=o.replace(s.search,"")),i+="?path="+encodeURIComponent(o),t.attrValue=i}}))},86515:function(e,t,r){"use strict";r.d(t,{GI:function(){return i}});var n=r(59537),i=992;(0,n.TT)("img/swh-spinner.gif")},59537:function(e,t,r){"use strict";r.d(t,{L3:function(){return o},TT:function(){return i},eO:function(){return a},ry:function(){return n}});r(87757),r(31955);function n(e){if(!e.ok)throw e;return e}function i(e){return"/static/"+e}function o(){history.replaceState("",document.title,window.location.pathname+window.location.search)}function a(e,t){var r=window.getSelection();r.removeAllRanges();var n=document.createRange();n.setStart(e,0),"#text"!==t.nodeName?n.setEnd(t,t.childNodes.length):n.setEnd(t,t.textContent.length),r.addRange(n)}},27856:function(e){e.exports=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,r){return(t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,r)}function r(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function n(e,i,o){return(n=r()?Reflect.construct:function(e,r,n){var i=[null];i.push.apply(i,r);var o=new(Function.bind.apply(e,i));return n&&t(o,n.prototype),o}).apply(null,arguments)}function i(e){return o(e)||a(e)||s(e)||u()}function o(e){if(Array.isArray(e))return c(e)}function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function s(e,t){if(e){if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?r-1:0),i=1;i/gm),J=m(/^data-[\-\w.\u00B7-\uFFFF]/),K=m(/^aria-[\-\w]+$/),Z=m(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),X=m(/^(?:\w+script|data):/i),Q=m(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ee=m(/^html$/i),te=function(){return"undefined"==typeof window?null:window},re=function(t,r){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var n=null,i="data-tt-policy-suffix";r.currentScript&&r.currentScript.hasAttribute(i)&&(n=r.currentScript.getAttribute(i));var o="dompurify"+(n?"#"+n:"");try{return t.createPolicy(o,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function ne(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:te(),r=function(e){return ne(e)};if(r.version="2.3.8",r.removed=[],!t||!t.document||9!==t.document.nodeType)return r.isSupported=!1,r;var n=t.document,o=t.document,a=t.DocumentFragment,s=t.HTMLTemplateElement,c=t.Node,u=t.Element,l=t.NodeFilter,p=t.NamedNodeMap,d=void 0===p?t.NamedNodeMap||t.MozNamedAttrMap:p,f=t.HTMLFormElement,h=t.DOMParser,m=t.trustedTypes,b=u.prototype,v=B(b,"cloneNode"),y=B(b,"nextSibling"),_=B(b,"childNodes"),R=B(b,"parentNode");if("function"==typeof s){var L=o.createElement("template");L.content&&L.content.ownerDocument&&(o=L.content.ownerDocument)}var ie=re(m,n),oe=ie?ie.createHTML(""):"",ae=o,se=ae.implementation,ce=ae.createNodeIterator,ue=ae.createDocumentFragment,le=ae.getElementsByTagName,pe=n.importNode,de={};try{de=O(o).documentMode?o.documentMode:{}}catch(e){}var fe={};r.isSupported="function"==typeof R&&se&&void 0!==se.createHTMLDocument&&9!==de;var he,ge,me=Y,be=W,ve=J,ye=K,_e=X,we=Q,Ee=Z,xe=null,ke=C({},[].concat(i(U),i(I),i(j),i(G),i(P))),Se=null,De=C({},[].concat(i(H),i(M),i(V),i(z))),Te=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ae=null,qe=null,Ne=!0,Re=!0,Le=!1,Ce=!1,Oe=!1,Be=!1,Ue=!1,Ie=!1,je=!1,$e=!1,Ge=!0,Fe=!0,Pe=!1,He={},Me=null,Ve=C({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ze=null,Ye=C({},["audio","video","img","source","image","track"]),We=null,Je=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ke="http://www.w3.org/1998/Math/MathML",Ze="http://www.w3.org/2000/svg",Xe="http://www.w3.org/1999/xhtml",Qe=Xe,et=!1,tt=["application/xhtml+xml","text/html"],rt="text/html",nt=null,it=o.createElement("form"),ot=function(e){return e instanceof RegExp||e instanceof Function},at=function(t){nt&&nt===t||(t&&"object"===e(t)||(t={}),t=O(t),xe="ALLOWED_TAGS"in t?C({},t.ALLOWED_TAGS):ke,Se="ALLOWED_ATTR"in t?C({},t.ALLOWED_ATTR):De,We="ADD_URI_SAFE_ATTR"in t?C(O(Je),t.ADD_URI_SAFE_ATTR):Je,ze="ADD_DATA_URI_TAGS"in t?C(O(Ye),t.ADD_DATA_URI_TAGS):Ye,Me="FORBID_CONTENTS"in t?C({},t.FORBID_CONTENTS):Ve,Ae="FORBID_TAGS"in t?C({},t.FORBID_TAGS):{},qe="FORBID_ATTR"in t?C({},t.FORBID_ATTR):{},He="USE_PROFILES"in t&&t.USE_PROFILES,Ne=!1!==t.ALLOW_ARIA_ATTR,Re=!1!==t.ALLOW_DATA_ATTR,Le=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Ce=t.SAFE_FOR_TEMPLATES||!1,Oe=t.WHOLE_DOCUMENT||!1,Ie=t.RETURN_DOM||!1,je=t.RETURN_DOM_FRAGMENT||!1,$e=t.RETURN_TRUSTED_TYPE||!1,Ue=t.FORCE_BODY||!1,Ge=!1!==t.SANITIZE_DOM,Fe=!1!==t.KEEP_CONTENT,Pe=t.IN_PLACE||!1,Ee=t.ALLOWED_URI_REGEXP||Ee,Qe=t.NAMESPACE||Xe,t.CUSTOM_ELEMENT_HANDLING&&ot(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Te.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&ot(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Te.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Te.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),he=he=-1===tt.indexOf(t.PARSER_MEDIA_TYPE)?rt:t.PARSER_MEDIA_TYPE,ge="application/xhtml+xml"===he?function(e){return e}:k,Ce&&(Re=!1),je&&(Ie=!0),He&&(xe=C({},i(P)),Se=[],!0===He.html&&(C(xe,U),C(Se,H)),!0===He.svg&&(C(xe,I),C(Se,M),C(Se,z)),!0===He.svgFilters&&(C(xe,j),C(Se,M),C(Se,z)),!0===He.mathMl&&(C(xe,G),C(Se,V),C(Se,z))),t.ADD_TAGS&&(xe===ke&&(xe=O(xe)),C(xe,t.ADD_TAGS)),t.ADD_ATTR&&(Se===De&&(Se=O(Se)),C(Se,t.ADD_ATTR)),t.ADD_URI_SAFE_ATTR&&C(We,t.ADD_URI_SAFE_ATTR),t.FORBID_CONTENTS&&(Me===Ve&&(Me=O(Me)),C(Me,t.FORBID_CONTENTS)),Fe&&(xe["#text"]=!0),Oe&&C(xe,["html","head","body"]),xe.table&&(C(xe,["tbody"]),delete Ae.tbody),g&&g(t),nt=t)},st=C({},["mi","mo","mn","ms","mtext"]),ct=C({},["foreignobject","desc","title","annotation-xml"]),ut=C({},["title","style","font","a","script"]),lt=C({},I);C(lt,j),C(lt,$);var pt=C({},G);C(pt,F);var dt=function(e){var t=R(e);t&&t.tagName||(t={namespaceURI:Xe,tagName:"template"});var r=k(e.tagName),n=k(t.tagName);return e.namespaceURI===Ze?t.namespaceURI===Xe?"svg"===r:t.namespaceURI===Ke?"svg"===r&&("annotation-xml"===n||st[n]):Boolean(lt[r]):e.namespaceURI===Ke?t.namespaceURI===Xe?"math"===r:t.namespaceURI===Ze?"math"===r&&ct[n]:Boolean(pt[r]):e.namespaceURI===Xe&&!(t.namespaceURI===Ze&&!ct[n])&&!(t.namespaceURI===Ke&&!st[n])&&!pt[r]&&(ut[r]||!lt[r])},ft=function(e){x(r.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=oe}catch(t){e.remove()}}},ht=function(e,t){try{x(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){x(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Se[e])if(Ie||je)try{ft(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},gt=function(e){var t,r;if(Ue)e=""+e;else{var n=S(e,/^[\r\n\t ]+/);r=n&&n[0]}"application/xhtml+xml"===he&&(e=''+e+"");var i=ie?ie.createHTML(e):e;if(Qe===Xe)try{t=(new h).parseFromString(i,he)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(Qe,"template",null);try{t.documentElement.innerHTML=et?"":i}catch(e){}}var a=t.body||t.documentElement;return e&&r&&a.insertBefore(o.createTextNode(r),a.childNodes[0]||null),Qe===Xe?le.call(t,Oe?"html":"body")[0]:Oe?t.documentElement:a},mt=function(e){return ce.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,null,!1)},bt=function(e){return e instanceof f&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},vt=function(t){return"object"===e(c)?t instanceof c:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},yt=function(e,t,n){fe[e]&&w(fe[e],(function(e){e.call(r,t,n,nt)}))},_t=function(e){var t;if(yt("beforeSanitizeElements",e,null),bt(e))return ft(e),!0;if(q(/[\u0080-\uFFFF]/,e.nodeName))return ft(e),!0;var n=ge(e.nodeName);if(yt("uponSanitizeElement",e,{tagName:n,allowedTags:xe}),e.hasChildNodes()&&!vt(e.firstElementChild)&&(!vt(e.content)||!vt(e.content.firstElementChild))&&q(/<[/\w]/g,e.innerHTML)&&q(/<[/\w]/g,e.textContent))return ft(e),!0;if("select"===n&&q(/