@peculiar/certificates-viewer 2.0.1 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/cjs/_commonjsHelpers-cb1f949a.js +23 -0
- package/dist/cjs/{download-cd98aa01.js → certification_request-96951e7b.js} +2880 -3313
- package/dist/cjs/{dom-760f300f.js → dom-f57e260e.js} +4 -1
- package/dist/cjs/download-5e7d5455.js +438 -0
- package/dist/cjs/{index-2973f90a.js → index-064e95c7.js} +287 -634
- package/dist/cjs/index.cjs.js +12 -0
- package/dist/cjs/{l10n-e971a5ac.js → l10n-2e7def18.js} +72 -90
- package/dist/cjs/loader.cjs.js +12 -3
- package/dist/cjs/peculiar-attribute-certificate-viewer_9.cjs.entry.js +1426 -1391
- package/dist/cjs/peculiar-certificate-summary_3.cjs.entry.js +66 -62
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +222 -217
- package/dist/cjs/peculiar.cjs.js +70 -3
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js +220 -205
- package/dist/collection/components/attribute-certificate-viewer/holder.js +27 -24
- package/dist/collection/components/attribute-certificate-viewer/issuer.js +11 -8
- package/dist/collection/components/button/button.css +2 -7
- package/dist/collection/components/button/button.js +125 -122
- package/dist/collection/components/button-split/button-split.js +103 -100
- package/dist/collection/components/certificate-decoder/certificate-decoder.css +1 -3
- package/dist/collection/components/certificate-decoder/certificate-decoder.js +158 -155
- package/dist/collection/components/certificate-summary/certificate-summary.js +75 -72
- package/dist/collection/components/certificate-viewer/attributes/activity_description_attribute.js +11 -8
- package/dist/collection/components/certificate-viewer/attributes/as_string_attribute.js +6 -3
- package/dist/collection/components/certificate-viewer/attributes/basic_attribute.js +11 -8
- package/dist/collection/components/certificate-viewer/attributes/challenge_password_attribute.js +6 -3
- package/dist/collection/components/certificate-viewer/attributes/index.js +45 -42
- package/dist/collection/components/certificate-viewer/attributes/insurance_value_attribute.js +7 -4
- package/dist/collection/components/certificate-viewer/attributes/name_attribute.js +6 -3
- package/dist/collection/components/certificate-viewer/attributes/name_part.js +8 -5
- package/dist/collection/components/certificate-viewer/attributes/type_relationship_attribute.js +5 -2
- package/dist/collection/components/certificate-viewer/attributes/unstructured_name_attribute.js +6 -3
- package/dist/collection/components/certificate-viewer/attributes/valuation_ranking_attribute.js +18 -15
- package/dist/collection/components/certificate-viewer/attributes/web_gdpr_attribute.js +13 -10
- package/dist/collection/components/certificate-viewer/basic_information.js +13 -10
- package/dist/collection/components/certificate-viewer/certificate-viewer.js +255 -240
- package/dist/collection/components/certificate-viewer/extensions/archive_rev_info_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/as_string_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/attribute_value.js +4 -1
- package/dist/collection/components/certificate-viewer/extensions/authority_key_identifier_extension.js +18 -15
- package/dist/collection/components/certificate-viewer/extensions/basic_constraints_extension.js +7 -4
- package/dist/collection/components/certificate-viewer/extensions/basic_extension.js +12 -9
- package/dist/collection/components/certificate-viewer/extensions/biometric_syntax_extension.js +12 -9
- package/dist/collection/components/certificate-viewer/extensions/ca_version_extension.js +8 -5
- package/dist/collection/components/certificate-viewer/extensions/certificate_policies_extension.js +28 -25
- package/dist/collection/components/certificate-viewer/extensions/certificate_template_extension.js +8 -5
- package/dist/collection/components/certificate-viewer/extensions/certificate_transparency_extension.js +13 -10
- package/dist/collection/components/certificate-viewer/extensions/crl_distribution_points_extension.js +11 -8
- package/dist/collection/components/certificate-viewer/extensions/crl_reason_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/enroll_cert_type_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/entrust_version_info_extension.js +7 -4
- package/dist/collection/components/certificate-viewer/extensions/extended_key_usage_extension.js +5 -2
- package/dist/collection/components/certificate-viewer/extensions/general_name_part.js +55 -52
- package/dist/collection/components/certificate-viewer/extensions/index.js +112 -109
- package/dist/collection/components/certificate-viewer/extensions/info_access_syntax_extension.js +9 -6
- package/dist/collection/components/certificate-viewer/extensions/key_usage_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/lei_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/lei_role_extennsion.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/logotype_extension.js +49 -46
- package/dist/collection/components/certificate-viewer/extensions/name_constraints_extension.js +8 -5
- package/dist/collection/components/certificate-viewer/extensions/netscape_cert_type_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/netscape_comment_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/policy_constraints_extension.js +7 -4
- package/dist/collection/components/certificate-viewer/extensions/policy_mappings_extension.js +9 -6
- package/dist/collection/components/certificate-viewer/extensions/private_key_usage_period_extension.js +7 -4
- package/dist/collection/components/certificate-viewer/extensions/qc_statements_extension.js +9 -6
- package/dist/collection/components/certificate-viewer/extensions/subject_alternative_name_extension.js +5 -2
- package/dist/collection/components/certificate-viewer/extensions/subject_directory_attributes_extension.js +9 -6
- package/dist/collection/components/certificate-viewer/extensions/subject_key_identifier_extension.js +18 -15
- package/dist/collection/components/certificate-viewer/extensions/timestamp_extension.js +8 -5
- package/dist/collection/components/certificate-viewer/extensions/tn_auth_list_extension.js +10 -7
- package/dist/collection/components/certificate-viewer/get_string_by_oid.js +8 -5
- package/dist/collection/components/certificate-viewer/issuer_name.js +9 -6
- package/dist/collection/components/certificate-viewer/miscellaneous.js +29 -26
- package/dist/collection/components/certificate-viewer/public_key.js +31 -28
- package/dist/collection/components/certificate-viewer/row.js +35 -32
- package/dist/collection/components/certificate-viewer/signature.js +12 -9
- package/dist/collection/components/certificate-viewer/subject_name.js +8 -5
- package/dist/collection/components/certificate-viewer/thumbprints.js +15 -12
- package/dist/collection/components/certificates-viewer/certificates-viewer.css +1 -19
- package/dist/collection/components/certificates-viewer/certificates-viewer.js +384 -381
- package/dist/collection/components/circular-progress/circular-progress.css +2 -24
- package/dist/collection/components/circular-progress/circular-progress.js +73 -70
- package/dist/collection/components/csr-viewer/csr-viewer.js +197 -188
- package/dist/collection/components/highlight-words/highlight-words.js +56 -53
- package/dist/collection/components/link/link.css +1 -3
- package/dist/collection/components/link/link.js +60 -57
- package/dist/collection/components/text-hider/text-hider.js +75 -72
- package/dist/collection/components/typography/typography.css +1 -3
- package/dist/collection/components/typography/typography.js +126 -123
- package/dist/collection/constants/logs.js +79 -76
- package/dist/collection/constants/oids.js +2301 -2298
- package/dist/collection/crypto/asn_data.js +33 -32
- package/dist/collection/crypto/attribute.js +52 -49
- package/dist/collection/crypto/csr.js +64 -61
- package/dist/collection/crypto/extension.js +126 -123
- package/dist/collection/crypto/index.js +3 -0
- package/dist/collection/crypto/name.js +33 -32
- package/dist/collection/crypto/provider.js +28 -25
- package/dist/collection/crypto/utils.js +24 -21
- package/dist/collection/crypto/x509_attribute_certificate.js +61 -58
- package/dist/collection/crypto/x509_certificate.js +107 -104
- package/dist/collection/index.js +5 -1
- package/dist/collection/utils/date_formatter.js +19 -16
- package/dist/collection/utils/download.js +18 -15
- package/dist/collection/utils/download_from_buffer.js +30 -25
- package/dist/collection/utils/history.js +5 -2
- package/dist/collection/utils/index.js +3 -0
- package/dist/collection/utils/is_link.js +4 -1
- package/dist/collection/utils/l10n.js +28 -25
- package/dist/collection/utils/parse_hash.js +16 -13
- package/dist/collection/utils/query_stringify.js +12 -9
- package/dist/collection/utils/read_file.js +43 -40
- package/dist/collection/utils/third_party_links.js +3 -0
- package/dist/collection/utils/validator.js +15 -12
- package/dist/esm/_commonjsHelpers-bfbd2ad8.js +20 -0
- package/dist/esm/{download-1ff0a3be.js → certification_request-48e8b956.js} +2898 -3328
- package/dist/esm/{dom-91ed8d21.js → dom-f1b08a97.js} +4 -1
- package/dist/esm/download-cf68ac2c.js +434 -0
- package/dist/esm/{index-5ef692cc.js → index-bbd484d9.js} +278 -624
- package/dist/esm/index.js +5 -0
- package/dist/esm/{l10n-c8cf6930.js → l10n-ead9928b.js} +71 -86
- package/dist/esm/{loader.mjs → loader.js} +11 -2
- package/dist/esm/peculiar-attribute-certificate-viewer_9.entry.js +1425 -1390
- package/dist/esm/peculiar-certificate-summary_3.entry.js +66 -62
- package/dist/esm/peculiar-certificates-viewer.entry.js +222 -217
- package/dist/esm/peculiar.js +73 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/polyfills/index.js +2 -2
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -1
- package/dist/peculiar/index.esm.js +4 -0
- package/dist/peculiar/p-452d69af.entry.js +113 -0
- package/dist/peculiar/p-886e9c53.js +87 -0
- package/dist/peculiar/p-9ae6b1f8.entry.js +4 -0
- package/dist/peculiar/{p-3d1015c2.js → p-9f4ee110.js} +5 -2
- package/dist/peculiar/p-c774ec0b.js +18 -0
- package/dist/peculiar/p-d09b762f.js +33 -0
- package/dist/peculiar/p-d0b55fbb.js +4 -0
- package/dist/peculiar/p-e5f99586.entry.js +4 -0
- package/dist/peculiar/p-f7683ba5.js +5 -0
- package/dist/peculiar/peculiar.esm.js +4 -1
- package/dist/types/components/attribute-certificate-viewer/attribute-certificate-viewer.d.ts +56 -56
- package/dist/types/components/attribute-certificate-viewer/holder.d.ts +1 -1
- package/dist/types/components/attribute-certificate-viewer/issuer.d.ts +1 -1
- package/dist/types/components/button/button.d.ts +17 -17
- package/dist/types/components/button-split/button-split.d.ts +10 -10
- package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +16 -16
- package/dist/types/components/certificate-summary/certificate-summary.d.ts +4 -4
- package/dist/types/components/certificate-viewer/attributes/activity_description_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/as_string_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/basic_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/challenge_password_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/index.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/insurance_value_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/name_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/name_part.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/type_relationship_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/unstructured_name_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/valuation_ranking_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/web_gdpr_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/basic_information.d.ts +6 -6
- package/dist/types/components/certificate-viewer/certificate-viewer.d.ts +66 -66
- package/dist/types/components/certificate-viewer/extensions/archive_rev_info_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/as_string_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/authority_key_identifier_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/basic_constraints_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/basic_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/biometric_syntax_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/ca_version_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/certificate_policies_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/certificate_template_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/certificate_transparency_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/crl_distribution_points_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/crl_reason_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/enroll_cert_type_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/entrust_version_info_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/extended_key_usage_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/general_name_part.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/index.d.ts +2 -2
- package/dist/types/components/certificate-viewer/extensions/info_access_syntax_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/key_usage_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/lei_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/lei_role_extennsion.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/logotype_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/name_constraints_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/netscape_cert_type_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/netscape_comment_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/policy_constraints_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/policy_mappings_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/private_key_usage_period_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/qc_statements_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/subject_alternative_name_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/subject_directory_attributes_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/subject_key_identifier_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/timestamp_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/tn_auth_list_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/issuer_name.d.ts +2 -2
- package/dist/types/components/certificate-viewer/miscellaneous.d.ts +1 -1
- package/dist/types/components/certificate-viewer/public_key.d.ts +1 -1
- package/dist/types/components/certificate-viewer/row.d.ts +7 -7
- package/dist/types/components/certificate-viewer/signature.d.ts +1 -1
- package/dist/types/components/certificate-viewer/subject_name.d.ts +1 -1
- package/dist/types/components/certificate-viewer/thumbprints.d.ts +1 -1
- package/dist/types/components/certificate-viewer/types.d.ts +26 -0
- package/dist/types/components/certificates-viewer/certificates-viewer.d.ts +64 -64
- package/dist/types/components/circular-progress/circular-progress.d.ts +10 -10
- package/dist/types/components/csr-viewer/csr-viewer.d.ts +45 -45
- package/dist/types/components/highlight-words/highlight-words.d.ts +8 -8
- package/dist/types/components/link/link.d.ts +6 -6
- package/dist/types/components/text-hider/text-hider.d.ts +4 -4
- package/dist/types/components/typography/typography.d.ts +18 -18
- package/dist/types/components.d.ts +11 -3
- package/dist/types/constants/logs.d.ts +76 -76
- package/dist/types/constants/oids.d.ts +2293 -2293
- package/dist/types/crypto/asn_data.d.ts +6 -6
- package/dist/types/crypto/attribute.d.ts +3 -3
- package/dist/types/crypto/csr.d.ts +19 -19
- package/dist/types/crypto/extension.d.ts +3 -3
- package/dist/types/crypto/name.d.ts +7 -7
- package/dist/types/crypto/provider.d.ts +15 -15
- package/dist/types/crypto/x509_attribute_certificate.d.ts +22 -22
- package/dist/types/crypto/x509_certificate.d.ts +28 -28
- package/dist/types/index.d.ts +2 -1
- package/dist/types/interface.d.ts +3 -0
- package/dist/types/stencil-public-runtime.d.ts +230 -217
- package/dist/types/utils/download.d.ts +8 -8
- package/dist/types/utils/download_from_buffer.d.ts +3 -3
- package/dist/types/utils/l10n.d.ts +43 -43
- package/dist/types/utils/read_file.d.ts +7 -7
- package/loader/cdn.js +3 -1
- package/loader/index.cjs.js +3 -1
- package/loader/index.d.ts +0 -1
- package/loader/index.es2017.js +5 -0
- package/loader/{index.mjs → index.js} +4 -2
- package/loader/package.json +4 -5
- package/package.json +14 -15
- package/dist/cjs/css-shim-1b988199.js +0 -6
- package/dist/cjs/patch-15ea31af.js +0 -112
- package/dist/cjs/shadow-css-376763e9.js +0 -385
- package/dist/esm/css-shim-5ce2b5c4.js +0 -4
- package/dist/esm/index.mjs +0 -1
- package/dist/esm/patch-f8a17185.js +0 -109
- package/dist/esm/peculiar.mjs +0 -6
- package/dist/esm/shadow-css-95922619.js +0 -383
- package/dist/esm-es5/css-shim-5ce2b5c4.js +0 -122
- package/dist/esm-es5/dom-91ed8d21.js +0 -468
- package/dist/esm-es5/download-1ff0a3be.js +0 -12692
- package/dist/esm-es5/index-5ef692cc.js +0 -1839
- package/dist/esm-es5/index.mjs +0 -0
- package/dist/esm-es5/l10n-c8cf6930.js +0 -758
- package/dist/esm-es5/loader.mjs +0 -10
- package/dist/esm-es5/patch-f8a17185.js +0 -106
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_9.entry.js +0 -2168
- package/dist/esm-es5/peculiar-certificate-summary_3.entry.js +0 -83
- package/dist/esm-es5/peculiar-certificates-viewer.entry.js +0 -290
- package/dist/esm-es5/peculiar.mjs +0 -5
- package/dist/esm-es5/shadow-css-95922619.js +0 -408
- package/dist/index.mjs +0 -1
- package/dist/peculiar/p-0ad0b6e8.js +0 -1
- package/dist/peculiar/p-198d9121.js +0 -1
- package/dist/peculiar/p-294c4ef9.entry.js +0 -1
- package/dist/peculiar/p-3d339152.system.entry.js +0 -1
- package/dist/peculiar/p-4b7cd42f.js +0 -12
- package/dist/peculiar/p-50ea2036.system.js +0 -1
- package/dist/peculiar/p-557d912f.system.js +0 -1
- package/dist/peculiar/p-75076c56.system.js +0 -21
- package/dist/peculiar/p-84e8326d.entry.js +0 -110
- package/dist/peculiar/p-94f96303.system.js +0 -100
- package/dist/peculiar/p-983b5210.system.entry.js +0 -1
- package/dist/peculiar/p-9f815f76.system.js +0 -1
- package/dist/peculiar/p-aa0a9b36.system.js +0 -1
- package/dist/peculiar/p-bd1f9066.system.js +0 -36
- package/dist/peculiar/p-bd949790.js +0 -1
- package/dist/peculiar/p-cf1841f8.js +0 -30
- package/dist/peculiar/p-dbdd61e7.entry.js +0 -1
- package/dist/peculiar/p-dc6b70b2.js +0 -100
- package/dist/peculiar/p-fb53799e.system.js +0 -1
- package/dist/peculiar/p-fc92385a.system.entry.js +0 -457
- package/dist/peculiar/p-fdad110e.system.js +0 -13
- package/dist/peculiar/peculiar.js +0 -132
- package/dist/peculiar.js +0 -30
- package/loader/index.es2017.mjs +0 -3
- package/loader/node-main.js +0 -3
|
@@ -1,758 +0,0 @@
|
|
|
1
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
2
|
-
function unwrapExports(x) {
|
|
3
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
4
|
-
}
|
|
5
|
-
function createCommonjsModule(fn, basedir, module) {
|
|
6
|
-
return module = {
|
|
7
|
-
path: basedir,
|
|
8
|
-
exports: {},
|
|
9
|
-
require: function (path, base) {
|
|
10
|
-
return commonjsRequire();
|
|
11
|
-
}
|
|
12
|
-
}, fn(module, module.exports), module.exports;
|
|
13
|
-
}
|
|
14
|
-
function commonjsRequire() {
|
|
15
|
-
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
16
|
-
}
|
|
17
|
-
function _extends() {
|
|
18
|
-
_extends = Object.assign || function (target) {
|
|
19
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
20
|
-
var source = arguments[i];
|
|
21
|
-
for (var key in source) {
|
|
22
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
23
|
-
target[key] = source[key];
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return target;
|
|
28
|
-
};
|
|
29
|
-
return _extends.apply(this, arguments);
|
|
30
|
-
}
|
|
31
|
-
function isAbsolute(pathname) {
|
|
32
|
-
return pathname.charAt(0) === '/';
|
|
33
|
-
}
|
|
34
|
-
// About 1.5x faster than the two-arg version of Array#splice()
|
|
35
|
-
function spliceOne(list, index) {
|
|
36
|
-
for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
|
|
37
|
-
list[i] = list[k];
|
|
38
|
-
}
|
|
39
|
-
list.pop();
|
|
40
|
-
}
|
|
41
|
-
// This implementation is based heavily on node's url.parse
|
|
42
|
-
function resolvePathname(to, from) {
|
|
43
|
-
if (from === undefined)
|
|
44
|
-
from = '';
|
|
45
|
-
var toParts = (to && to.split('/')) || [];
|
|
46
|
-
var fromParts = (from && from.split('/')) || [];
|
|
47
|
-
var isToAbs = to && isAbsolute(to);
|
|
48
|
-
var isFromAbs = from && isAbsolute(from);
|
|
49
|
-
var mustEndAbs = isToAbs || isFromAbs;
|
|
50
|
-
if (to && isAbsolute(to)) {
|
|
51
|
-
// to is absolute
|
|
52
|
-
fromParts = toParts;
|
|
53
|
-
}
|
|
54
|
-
else if (toParts.length) {
|
|
55
|
-
// to is relative, drop the filename
|
|
56
|
-
fromParts.pop();
|
|
57
|
-
fromParts = fromParts.concat(toParts);
|
|
58
|
-
}
|
|
59
|
-
if (!fromParts.length)
|
|
60
|
-
return '/';
|
|
61
|
-
var hasTrailingSlash;
|
|
62
|
-
if (fromParts.length) {
|
|
63
|
-
var last = fromParts[fromParts.length - 1];
|
|
64
|
-
hasTrailingSlash = last === '.' || last === '..' || last === '';
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
hasTrailingSlash = false;
|
|
68
|
-
}
|
|
69
|
-
var up = 0;
|
|
70
|
-
for (var i = fromParts.length; i >= 0; i--) {
|
|
71
|
-
var part = fromParts[i];
|
|
72
|
-
if (part === '.') {
|
|
73
|
-
spliceOne(fromParts, i);
|
|
74
|
-
}
|
|
75
|
-
else if (part === '..') {
|
|
76
|
-
spliceOne(fromParts, i);
|
|
77
|
-
up++;
|
|
78
|
-
}
|
|
79
|
-
else if (up) {
|
|
80
|
-
spliceOne(fromParts, i);
|
|
81
|
-
up--;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
if (!mustEndAbs)
|
|
85
|
-
for (; up--; up)
|
|
86
|
-
fromParts.unshift('..');
|
|
87
|
-
if (mustEndAbs &&
|
|
88
|
-
fromParts[0] !== '' &&
|
|
89
|
-
(!fromParts[0] || !isAbsolute(fromParts[0])))
|
|
90
|
-
fromParts.unshift('');
|
|
91
|
-
var result = fromParts.join('/');
|
|
92
|
-
if (hasTrailingSlash && result.substr(-1) !== '/')
|
|
93
|
-
result += '/';
|
|
94
|
-
return result;
|
|
95
|
-
}
|
|
96
|
-
var prefix = 'Invariant failed';
|
|
97
|
-
function invariant(condition, message) {
|
|
98
|
-
if (condition) {
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
{
|
|
102
|
-
throw new Error(prefix);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
function addLeadingSlash(path) {
|
|
106
|
-
return path.charAt(0) === '/' ? path : '/' + path;
|
|
107
|
-
}
|
|
108
|
-
function hasBasename(path, prefix) {
|
|
109
|
-
return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;
|
|
110
|
-
}
|
|
111
|
-
function stripBasename(path, prefix) {
|
|
112
|
-
return hasBasename(path, prefix) ? path.substr(prefix.length) : path;
|
|
113
|
-
}
|
|
114
|
-
function stripTrailingSlash(path) {
|
|
115
|
-
return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
|
|
116
|
-
}
|
|
117
|
-
function parsePath(path) {
|
|
118
|
-
var pathname = path || '/';
|
|
119
|
-
var search = '';
|
|
120
|
-
var hash = '';
|
|
121
|
-
var hashIndex = pathname.indexOf('#');
|
|
122
|
-
if (hashIndex !== -1) {
|
|
123
|
-
hash = pathname.substr(hashIndex);
|
|
124
|
-
pathname = pathname.substr(0, hashIndex);
|
|
125
|
-
}
|
|
126
|
-
var searchIndex = pathname.indexOf('?');
|
|
127
|
-
if (searchIndex !== -1) {
|
|
128
|
-
search = pathname.substr(searchIndex);
|
|
129
|
-
pathname = pathname.substr(0, searchIndex);
|
|
130
|
-
}
|
|
131
|
-
return {
|
|
132
|
-
pathname: pathname,
|
|
133
|
-
search: search === '?' ? '' : search,
|
|
134
|
-
hash: hash === '#' ? '' : hash
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
function createPath(location) {
|
|
138
|
-
var pathname = location.pathname, search = location.search, hash = location.hash;
|
|
139
|
-
var path = pathname || '/';
|
|
140
|
-
if (search && search !== '?')
|
|
141
|
-
path += search.charAt(0) === '?' ? search : "?" + search;
|
|
142
|
-
if (hash && hash !== '#')
|
|
143
|
-
path += hash.charAt(0) === '#' ? hash : "#" + hash;
|
|
144
|
-
return path;
|
|
145
|
-
}
|
|
146
|
-
function createLocation(path, state, key, currentLocation) {
|
|
147
|
-
var location;
|
|
148
|
-
if (typeof path === 'string') {
|
|
149
|
-
// Two-arg form: push(path, state)
|
|
150
|
-
location = parsePath(path);
|
|
151
|
-
location.state = state;
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
// One-arg form: push(location)
|
|
155
|
-
location = _extends({}, path);
|
|
156
|
-
if (location.pathname === undefined)
|
|
157
|
-
location.pathname = '';
|
|
158
|
-
if (location.search) {
|
|
159
|
-
if (location.search.charAt(0) !== '?')
|
|
160
|
-
location.search = '?' + location.search;
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
location.search = '';
|
|
164
|
-
}
|
|
165
|
-
if (location.hash) {
|
|
166
|
-
if (location.hash.charAt(0) !== '#')
|
|
167
|
-
location.hash = '#' + location.hash;
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
location.hash = '';
|
|
171
|
-
}
|
|
172
|
-
if (state !== undefined && location.state === undefined)
|
|
173
|
-
location.state = state;
|
|
174
|
-
}
|
|
175
|
-
try {
|
|
176
|
-
location.pathname = decodeURI(location.pathname);
|
|
177
|
-
}
|
|
178
|
-
catch (e) {
|
|
179
|
-
if (e instanceof URIError) {
|
|
180
|
-
throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
|
|
181
|
-
}
|
|
182
|
-
else {
|
|
183
|
-
throw e;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
if (key)
|
|
187
|
-
location.key = key;
|
|
188
|
-
if (currentLocation) {
|
|
189
|
-
// Resolve incomplete/relative pathname relative to current location.
|
|
190
|
-
if (!location.pathname) {
|
|
191
|
-
location.pathname = currentLocation.pathname;
|
|
192
|
-
}
|
|
193
|
-
else if (location.pathname.charAt(0) !== '/') {
|
|
194
|
-
location.pathname = resolvePathname(location.pathname, currentLocation.pathname);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
// When there is no prior location and pathname is empty, set it to /
|
|
199
|
-
if (!location.pathname) {
|
|
200
|
-
location.pathname = '/';
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
return location;
|
|
204
|
-
}
|
|
205
|
-
function createTransitionManager() {
|
|
206
|
-
var prompt = null;
|
|
207
|
-
function setPrompt(nextPrompt) {
|
|
208
|
-
prompt = nextPrompt;
|
|
209
|
-
return function () {
|
|
210
|
-
if (prompt === nextPrompt)
|
|
211
|
-
prompt = null;
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
function confirmTransitionTo(location, action, getUserConfirmation, callback) {
|
|
215
|
-
// TODO: If another transition starts while we're still confirming
|
|
216
|
-
// the previous one, we may end up in a weird state. Figure out the
|
|
217
|
-
// best way to handle this.
|
|
218
|
-
if (prompt != null) {
|
|
219
|
-
var result = typeof prompt === 'function' ? prompt(location, action) : prompt;
|
|
220
|
-
if (typeof result === 'string') {
|
|
221
|
-
if (typeof getUserConfirmation === 'function') {
|
|
222
|
-
getUserConfirmation(result, callback);
|
|
223
|
-
}
|
|
224
|
-
else {
|
|
225
|
-
callback(true);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
else {
|
|
229
|
-
// Return false from a transition hook to cancel the transition.
|
|
230
|
-
callback(result !== false);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
else {
|
|
234
|
-
callback(true);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
var listeners = [];
|
|
238
|
-
function appendListener(fn) {
|
|
239
|
-
var isActive = true;
|
|
240
|
-
function listener() {
|
|
241
|
-
if (isActive)
|
|
242
|
-
fn.apply(void 0, arguments);
|
|
243
|
-
}
|
|
244
|
-
listeners.push(listener);
|
|
245
|
-
return function () {
|
|
246
|
-
isActive = false;
|
|
247
|
-
listeners = listeners.filter(function (item) {
|
|
248
|
-
return item !== listener;
|
|
249
|
-
});
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
function notifyListeners() {
|
|
253
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
254
|
-
args[_key] = arguments[_key];
|
|
255
|
-
}
|
|
256
|
-
listeners.forEach(function (listener) {
|
|
257
|
-
return listener.apply(void 0, args);
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
return {
|
|
261
|
-
setPrompt: setPrompt,
|
|
262
|
-
confirmTransitionTo: confirmTransitionTo,
|
|
263
|
-
appendListener: appendListener,
|
|
264
|
-
notifyListeners: notifyListeners
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
268
|
-
function getConfirmation(message, callback) {
|
|
269
|
-
callback(window.confirm(message)); // eslint-disable-line no-alert
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
* Returns true if the HTML5 history API is supported. Taken from Modernizr.
|
|
273
|
-
*
|
|
274
|
-
* https://github.com/Modernizr/Modernizr/blob/master/LICENSE
|
|
275
|
-
* https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
|
|
276
|
-
* changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
|
|
277
|
-
*/
|
|
278
|
-
function supportsHistory() {
|
|
279
|
-
var ua = window.navigator.userAgent;
|
|
280
|
-
if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1)
|
|
281
|
-
return false;
|
|
282
|
-
return window.history && 'pushState' in window.history;
|
|
283
|
-
}
|
|
284
|
-
/**
|
|
285
|
-
* Returns true if browser fires popstate on hash change.
|
|
286
|
-
* IE10 and IE11 do not.
|
|
287
|
-
*/
|
|
288
|
-
function supportsPopStateOnHashChange() {
|
|
289
|
-
return window.navigator.userAgent.indexOf('Trident') === -1;
|
|
290
|
-
}
|
|
291
|
-
/**
|
|
292
|
-
* Returns true if a given popstate event is an extraneous WebKit event.
|
|
293
|
-
* Accounts for the fact that Chrome on iOS fires real popstate events
|
|
294
|
-
* containing undefined state when pressing the back button.
|
|
295
|
-
*/
|
|
296
|
-
function isExtraneousPopstateEvent(event) {
|
|
297
|
-
return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
|
|
298
|
-
}
|
|
299
|
-
var PopStateEvent = 'popstate';
|
|
300
|
-
var HashChangeEvent = 'hashchange';
|
|
301
|
-
function getHistoryState() {
|
|
302
|
-
try {
|
|
303
|
-
return window.history.state || {};
|
|
304
|
-
}
|
|
305
|
-
catch (e) {
|
|
306
|
-
// IE 11 sometimes throws when accessing window.history.state
|
|
307
|
-
// See https://github.com/ReactTraining/history/pull/289
|
|
308
|
-
return {};
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
/**
|
|
312
|
-
* Creates a history object that uses the HTML5 history API including
|
|
313
|
-
* pushState, replaceState, and the popstate event.
|
|
314
|
-
*/
|
|
315
|
-
function createBrowserHistory(props) {
|
|
316
|
-
if (props === void 0) {
|
|
317
|
-
props = {};
|
|
318
|
-
}
|
|
319
|
-
!canUseDOM ? invariant(false) : void 0;
|
|
320
|
-
var globalHistory = window.history;
|
|
321
|
-
var canUseHistory = supportsHistory();
|
|
322
|
-
var needsHashChangeListener = !supportsPopStateOnHashChange();
|
|
323
|
-
var _props = props, _props$forceRefresh = _props.forceRefresh, forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh, _props$getUserConfirm = _props.getUserConfirmation, getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm, _props$keyLength = _props.keyLength, keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
|
|
324
|
-
var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
|
|
325
|
-
function getDOMLocation(historyState) {
|
|
326
|
-
var _ref = historyState || {}, key = _ref.key, state = _ref.state;
|
|
327
|
-
var _window$location = window.location, pathname = _window$location.pathname, search = _window$location.search, hash = _window$location.hash;
|
|
328
|
-
var path = pathname + search + hash;
|
|
329
|
-
if (basename)
|
|
330
|
-
path = stripBasename(path, basename);
|
|
331
|
-
return createLocation(path, state, key);
|
|
332
|
-
}
|
|
333
|
-
function createKey() {
|
|
334
|
-
return Math.random().toString(36).substr(2, keyLength);
|
|
335
|
-
}
|
|
336
|
-
var transitionManager = createTransitionManager();
|
|
337
|
-
function setState(nextState) {
|
|
338
|
-
_extends(history, nextState);
|
|
339
|
-
history.length = globalHistory.length;
|
|
340
|
-
transitionManager.notifyListeners(history.location, history.action);
|
|
341
|
-
}
|
|
342
|
-
function handlePopState(event) {
|
|
343
|
-
// Ignore extraneous popstate events in WebKit.
|
|
344
|
-
if (isExtraneousPopstateEvent(event))
|
|
345
|
-
return;
|
|
346
|
-
handlePop(getDOMLocation(event.state));
|
|
347
|
-
}
|
|
348
|
-
function handleHashChange() {
|
|
349
|
-
handlePop(getDOMLocation(getHistoryState()));
|
|
350
|
-
}
|
|
351
|
-
var forceNextPop = false;
|
|
352
|
-
function handlePop(location) {
|
|
353
|
-
if (forceNextPop) {
|
|
354
|
-
forceNextPop = false;
|
|
355
|
-
setState();
|
|
356
|
-
}
|
|
357
|
-
else {
|
|
358
|
-
var action = 'POP';
|
|
359
|
-
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
|
360
|
-
if (ok) {
|
|
361
|
-
setState({
|
|
362
|
-
action: action,
|
|
363
|
-
location: location
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
else {
|
|
367
|
-
revertPop(location);
|
|
368
|
-
}
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
function revertPop(fromLocation) {
|
|
373
|
-
var toLocation = history.location; // TODO: We could probably make this more reliable by
|
|
374
|
-
// keeping a list of keys we've seen in sessionStorage.
|
|
375
|
-
// Instead, we just default to 0 for keys we don't know.
|
|
376
|
-
var toIndex = allKeys.indexOf(toLocation.key);
|
|
377
|
-
if (toIndex === -1)
|
|
378
|
-
toIndex = 0;
|
|
379
|
-
var fromIndex = allKeys.indexOf(fromLocation.key);
|
|
380
|
-
if (fromIndex === -1)
|
|
381
|
-
fromIndex = 0;
|
|
382
|
-
var delta = toIndex - fromIndex;
|
|
383
|
-
if (delta) {
|
|
384
|
-
forceNextPop = true;
|
|
385
|
-
go(delta);
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
var initialLocation = getDOMLocation(getHistoryState());
|
|
389
|
-
var allKeys = [initialLocation.key]; // Public interface
|
|
390
|
-
function createHref(location) {
|
|
391
|
-
return basename + createPath(location);
|
|
392
|
-
}
|
|
393
|
-
function push(path, state) {
|
|
394
|
-
var action = 'PUSH';
|
|
395
|
-
var location = createLocation(path, state, createKey(), history.location);
|
|
396
|
-
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
|
397
|
-
if (!ok)
|
|
398
|
-
return;
|
|
399
|
-
var href = createHref(location);
|
|
400
|
-
var key = location.key, state = location.state;
|
|
401
|
-
if (canUseHistory) {
|
|
402
|
-
globalHistory.pushState({
|
|
403
|
-
key: key,
|
|
404
|
-
state: state
|
|
405
|
-
}, null, href);
|
|
406
|
-
if (forceRefresh) {
|
|
407
|
-
window.location.href = href;
|
|
408
|
-
}
|
|
409
|
-
else {
|
|
410
|
-
var prevIndex = allKeys.indexOf(history.location.key);
|
|
411
|
-
var nextKeys = allKeys.slice(0, prevIndex + 1);
|
|
412
|
-
nextKeys.push(location.key);
|
|
413
|
-
allKeys = nextKeys;
|
|
414
|
-
setState({
|
|
415
|
-
action: action,
|
|
416
|
-
location: location
|
|
417
|
-
});
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
else {
|
|
421
|
-
window.location.href = href;
|
|
422
|
-
}
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
function replace(path, state) {
|
|
426
|
-
var action = 'REPLACE';
|
|
427
|
-
var location = createLocation(path, state, createKey(), history.location);
|
|
428
|
-
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
|
429
|
-
if (!ok)
|
|
430
|
-
return;
|
|
431
|
-
var href = createHref(location);
|
|
432
|
-
var key = location.key, state = location.state;
|
|
433
|
-
if (canUseHistory) {
|
|
434
|
-
globalHistory.replaceState({
|
|
435
|
-
key: key,
|
|
436
|
-
state: state
|
|
437
|
-
}, null, href);
|
|
438
|
-
if (forceRefresh) {
|
|
439
|
-
window.location.replace(href);
|
|
440
|
-
}
|
|
441
|
-
else {
|
|
442
|
-
var prevIndex = allKeys.indexOf(history.location.key);
|
|
443
|
-
if (prevIndex !== -1)
|
|
444
|
-
allKeys[prevIndex] = location.key;
|
|
445
|
-
setState({
|
|
446
|
-
action: action,
|
|
447
|
-
location: location
|
|
448
|
-
});
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
else {
|
|
452
|
-
window.location.replace(href);
|
|
453
|
-
}
|
|
454
|
-
});
|
|
455
|
-
}
|
|
456
|
-
function go(n) {
|
|
457
|
-
globalHistory.go(n);
|
|
458
|
-
}
|
|
459
|
-
function goBack() {
|
|
460
|
-
go(-1);
|
|
461
|
-
}
|
|
462
|
-
function goForward() {
|
|
463
|
-
go(1);
|
|
464
|
-
}
|
|
465
|
-
var listenerCount = 0;
|
|
466
|
-
function checkDOMListeners(delta) {
|
|
467
|
-
listenerCount += delta;
|
|
468
|
-
if (listenerCount === 1 && delta === 1) {
|
|
469
|
-
window.addEventListener(PopStateEvent, handlePopState);
|
|
470
|
-
if (needsHashChangeListener)
|
|
471
|
-
window.addEventListener(HashChangeEvent, handleHashChange);
|
|
472
|
-
}
|
|
473
|
-
else if (listenerCount === 0) {
|
|
474
|
-
window.removeEventListener(PopStateEvent, handlePopState);
|
|
475
|
-
if (needsHashChangeListener)
|
|
476
|
-
window.removeEventListener(HashChangeEvent, handleHashChange);
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
var isBlocked = false;
|
|
480
|
-
function block(prompt) {
|
|
481
|
-
if (prompt === void 0) {
|
|
482
|
-
prompt = false;
|
|
483
|
-
}
|
|
484
|
-
var unblock = transitionManager.setPrompt(prompt);
|
|
485
|
-
if (!isBlocked) {
|
|
486
|
-
checkDOMListeners(1);
|
|
487
|
-
isBlocked = true;
|
|
488
|
-
}
|
|
489
|
-
return function () {
|
|
490
|
-
if (isBlocked) {
|
|
491
|
-
isBlocked = false;
|
|
492
|
-
checkDOMListeners(-1);
|
|
493
|
-
}
|
|
494
|
-
return unblock();
|
|
495
|
-
};
|
|
496
|
-
}
|
|
497
|
-
function listen(listener) {
|
|
498
|
-
var unlisten = transitionManager.appendListener(listener);
|
|
499
|
-
checkDOMListeners(1);
|
|
500
|
-
return function () {
|
|
501
|
-
checkDOMListeners(-1);
|
|
502
|
-
unlisten();
|
|
503
|
-
};
|
|
504
|
-
}
|
|
505
|
-
var history = {
|
|
506
|
-
length: globalHistory.length,
|
|
507
|
-
action: 'POP',
|
|
508
|
-
location: initialLocation,
|
|
509
|
-
createHref: createHref,
|
|
510
|
-
push: push,
|
|
511
|
-
replace: replace,
|
|
512
|
-
go: go,
|
|
513
|
-
goBack: goBack,
|
|
514
|
-
goForward: goForward,
|
|
515
|
-
block: block,
|
|
516
|
-
listen: listen
|
|
517
|
-
};
|
|
518
|
-
return history;
|
|
519
|
-
}
|
|
520
|
-
/**
|
|
521
|
-
* @license
|
|
522
|
-
* Copyright (c) Peculiar Ventures, LLC.
|
|
523
|
-
*
|
|
524
|
-
* This source code is licensed under the MIT license found in the
|
|
525
|
-
* LICENSE file in the root directory of this source tree.
|
|
526
|
-
*/
|
|
527
|
-
function parseHash(hash) {
|
|
528
|
-
if (hash === void 0) { hash = window.location.hash; }
|
|
529
|
-
if (!hash.length) {
|
|
530
|
-
return {};
|
|
531
|
-
}
|
|
532
|
-
var pairs = hash.replace(/^(#|\?)?\/?/, '').split('&');
|
|
533
|
-
var result = {};
|
|
534
|
-
for (var i = 0; i < pairs.length; i += 1) {
|
|
535
|
-
var pair = pairs[i].split('=');
|
|
536
|
-
try {
|
|
537
|
-
result[pair[0]] = pair[1] && decodeURIComponent(pair[1]);
|
|
538
|
-
}
|
|
539
|
-
catch (error) {
|
|
540
|
-
console.warn(error);
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
return result;
|
|
544
|
-
}
|
|
545
|
-
/**
|
|
546
|
-
* @license
|
|
547
|
-
* Copyright (c) Peculiar Ventures, LLC.
|
|
548
|
-
*
|
|
549
|
-
* This source code is licensed under the MIT license found in the
|
|
550
|
-
* LICENSE file in the root directory of this source tree.
|
|
551
|
-
*/
|
|
552
|
-
function queryStringify(options) {
|
|
553
|
-
var parameters = [];
|
|
554
|
-
Object.keys(options).forEach(function (o) {
|
|
555
|
-
if (typeof options[o] === 'string'
|
|
556
|
-
|| typeof options[o] === 'boolean'
|
|
557
|
-
|| typeof options[o] === 'number') {
|
|
558
|
-
parameters.push(o + "=" + encodeURIComponent(options[o]));
|
|
559
|
-
}
|
|
560
|
-
});
|
|
561
|
-
return parameters.join('&');
|
|
562
|
-
}
|
|
563
|
-
/**
|
|
564
|
-
* @license
|
|
565
|
-
* Copyright (c) Peculiar Ventures, LLC.
|
|
566
|
-
*
|
|
567
|
-
* This source code is licensed under the MIT license found in the
|
|
568
|
-
* LICENSE file in the root directory of this source tree.
|
|
569
|
-
*/
|
|
570
|
-
var browserHistory = createBrowserHistory();
|
|
571
|
-
var history = Object.assign(browserHistory, {
|
|
572
|
-
parseHash: parseHash,
|
|
573
|
-
queryStringify: queryStringify,
|
|
574
|
-
});
|
|
575
|
-
var dayjs_min = createCommonjsModule(function (module, exports) {
|
|
576
|
-
!function (t, e) { module.exports = e(); }(commonjsGlobal, (function () { var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", f = "month", h = "quarter", c = "year", d = "date", $ = "Invalid Date", l = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_") }, m = function (t, e, n) { var r = String(t); return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t; }, g = { s: m, z: function (t) { var e = -t.utcOffset(), n = Math.abs(e), r = Math.floor(n / 60), i = n % 60; return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0"); }, m: function t(e, n) { if (e.date() < n.date())
|
|
577
|
-
return -t(n, e); var r = 12 * (n.year() - e.year()) + (n.month() - e.month()), i = e.clone().add(r, f), s = n - i < 0, u = e.clone().add(r + (s ? -1 : 1), f); return +(-(r + (n - i) / (s ? i - u : u - i)) || 0); }, a: function (t) { return t < 0 ? Math.ceil(t) || 0 : Math.floor(t); }, p: function (t) { return { M: f, y: c, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: h }[t] || String(t || "").toLowerCase().replace(/s$/, ""); }, u: function (t) { return void 0 === t; } }, v = "en", D = {}; D[v] = M; var p = function (t) { return t instanceof _; }, S = function t(e, n, r) { var i; if (!e)
|
|
578
|
-
return v; if ("string" == typeof e) {
|
|
579
|
-
var s = e.toLowerCase();
|
|
580
|
-
D[s] && (i = s), n && (D[s] = n, i = s);
|
|
581
|
-
var u = e.split("-");
|
|
582
|
-
if (!i && u.length > 1)
|
|
583
|
-
return t(u[0]);
|
|
584
|
-
}
|
|
585
|
-
else {
|
|
586
|
-
var a = e.name;
|
|
587
|
-
D[a] = e, i = a;
|
|
588
|
-
} return !r && i && (v = i), i || !r && v; }, w = function (t, e) { if (p(t))
|
|
589
|
-
return t.clone(); var n = "object" == typeof e ? e : {}; return n.date = t, n.args = arguments, new _(n); }, O = g; O.l = S, O.i = p, O.w = function (t, e) { return w(t, { locale: e.$L, utc: e.$u, x: e.$x, $offset: e.$offset }); }; var _ = function () { function M(t) { this.$L = S(t.locale, null, !0), this.parse(t); } var m = M.prototype; return m.parse = function (t) { this.$d = function (t) { var e = t.date, n = t.utc; if (null === e)
|
|
590
|
-
return new Date(NaN); if (O.u(e))
|
|
591
|
-
return new Date; if (e instanceof Date)
|
|
592
|
-
return new Date(e); if ("string" == typeof e && !/Z$/i.test(e)) {
|
|
593
|
-
var r = e.match(l);
|
|
594
|
-
if (r) {
|
|
595
|
-
var i = r[2] - 1 || 0, s = (r[7] || "0").substring(0, 3);
|
|
596
|
-
return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s);
|
|
597
|
-
}
|
|
598
|
-
} return new Date(e); }(t), this.$x = t.x || {}, this.init(); }, m.init = function () { var t = this.$d; this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds(); }, m.$utils = function () { return O; }, m.isValid = function () { return !(this.$d.toString() === $); }, m.isSame = function (t, e) { var n = w(t); return this.startOf(e) <= n && n <= this.endOf(e); }, m.isAfter = function (t, e) { return w(t) < this.startOf(e); }, m.isBefore = function (t, e) { return this.endOf(e) < w(t); }, m.$g = function (t, e, n) { return O.u(t) ? this[e] : this.set(n, t); }, m.unix = function () { return Math.floor(this.valueOf() / 1e3); }, m.valueOf = function () { return this.$d.getTime(); }, m.startOf = function (t, e) { var n = this, r = !!O.u(e) || e, h = O.p(t), $ = function (t, e) { var i = O.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n); return r ? i : i.endOf(a); }, l = function (t, e) { return O.w(n.toDate()[t].apply(n.toDate("s"), (r ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), n); }, y = this.$W, M = this.$M, m = this.$D, g = "set" + (this.$u ? "UTC" : ""); switch (h) {
|
|
599
|
-
case c: return r ? $(1, 0) : $(31, 11);
|
|
600
|
-
case f: return r ? $(1, M) : $(0, M + 1);
|
|
601
|
-
case o:
|
|
602
|
-
var v = this.$locale().weekStart || 0, D = (y < v ? y + 7 : y) - v;
|
|
603
|
-
return $(r ? m - D : m + (6 - D), M);
|
|
604
|
-
case a:
|
|
605
|
-
case d: return l(g + "Hours", 0);
|
|
606
|
-
case u: return l(g + "Minutes", 1);
|
|
607
|
-
case s: return l(g + "Seconds", 2);
|
|
608
|
-
case i: return l(g + "Milliseconds", 3);
|
|
609
|
-
default: return this.clone();
|
|
610
|
-
} }, m.endOf = function (t) { return this.startOf(t, !1); }, m.$set = function (t, e) { var n, o = O.p(t), h = "set" + (this.$u ? "UTC" : ""), $ = (n = {}, n[a] = h + "Date", n[d] = h + "Date", n[f] = h + "Month", n[c] = h + "FullYear", n[u] = h + "Hours", n[s] = h + "Minutes", n[i] = h + "Seconds", n[r] = h + "Milliseconds", n)[o], l = o === a ? this.$D + (e - this.$W) : e; if (o === f || o === c) {
|
|
611
|
-
var y = this.clone().set(d, 1);
|
|
612
|
-
y.$d[$](l), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d;
|
|
613
|
-
}
|
|
614
|
-
else
|
|
615
|
-
$ && this.$d[$](l); return this.init(), this; }, m.set = function (t, e) { return this.clone().$set(t, e); }, m.get = function (t) { return this[O.p(t)](); }, m.add = function (r, h) { var d, $ = this; r = Number(r); var l = O.p(h), y = function (t) { var e = w($); return O.w(e.date(e.date() + Math.round(t * r)), $); }; if (l === f)
|
|
616
|
-
return this.set(f, this.$M + r); if (l === c)
|
|
617
|
-
return this.set(c, this.$y + r); if (l === a)
|
|
618
|
-
return y(1); if (l === o)
|
|
619
|
-
return y(7); var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[l] || 1, m = this.$d.getTime() + r * M; return O.w(m, this); }, m.subtract = function (t, e) { return this.add(-1 * t, e); }, m.format = function (t) { var e = this, n = this.$locale(); if (!this.isValid())
|
|
620
|
-
return n.invalidDate || $; var r = t || "YYYY-MM-DDTHH:mm:ssZ", i = O.z(this), s = this.$H, u = this.$m, a = this.$M, o = n.weekdays, f = n.months, h = function (t, n, i, s) { return t && (t[n] || t(e, r)) || i[n].slice(0, s); }, c = function (t) { return O.s(s % 12 || 12, t, "0"); }, d = n.meridiem || function (t, e, n) { var r = t < 12 ? "AM" : "PM"; return n ? r.toLowerCase() : r; }, l = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: a + 1, MM: O.s(a + 1, 2, "0"), MMM: h(n.monthsShort, a, f, 3), MMMM: h(f, a), D: this.$D, DD: O.s(this.$D, 2, "0"), d: String(this.$W), dd: h(n.weekdaysMin, this.$W, o, 2), ddd: h(n.weekdaysShort, this.$W, o, 3), dddd: o[this.$W], H: String(s), HH: O.s(s, 2, "0"), h: c(1), hh: c(2), a: d(s, u, !0), A: d(s, u, !1), m: String(u), mm: O.s(u, 2, "0"), s: String(this.$s), ss: O.s(this.$s, 2, "0"), SSS: O.s(this.$ms, 3, "0"), Z: i }; return r.replace(y, (function (t, e) { return e || l[t] || i.replace(":", ""); })); }, m.utcOffset = function () { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); }, m.diff = function (r, d, $) { var l, y = O.p(d), M = w(r), m = (M.utcOffset() - this.utcOffset()) * e, g = this - M, v = O.m(this, M); return v = (l = {}, l[c] = v / 12, l[f] = v, l[h] = v / 3, l[o] = (g - m) / 6048e5, l[a] = (g - m) / 864e5, l[u] = g / n, l[s] = g / e, l[i] = g / t, l)[y] || g, $ ? v : O.a(v); }, m.daysInMonth = function () { return this.endOf(f).$D; }, m.$locale = function () { return D[this.$L]; }, m.locale = function (t, e) { if (!t)
|
|
621
|
-
return this.$L; var n = this.clone(), r = S(t, e, !0); return r && (n.$L = r), n; }, m.clone = function () { return O.w(this.$d, this); }, m.toDate = function () { return new Date(this.valueOf()); }, m.toJSON = function () { return this.isValid() ? this.toISOString() : null; }, m.toISOString = function () { return this.$d.toISOString(); }, m.toString = function () { return this.$d.toUTCString(); }, M; }(), T = _.prototype; return w.prototype = T, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach((function (t) { T[t[1]] = function (e) { return this.$g(e, t[0], t[1]); }; })), w.extend = function (t, e) { return t.$i || (t(e, _, w), t.$i = !0), w; }, w.locale = S, w.isDayjs = p, w.unix = function (t) { return w(1e3 * t); }, w.en = D[v], w.Ls = D, w.p = {}, w; }));
|
|
622
|
-
});
|
|
623
|
-
/**
|
|
624
|
-
* @license
|
|
625
|
-
* Copyright (c) Peculiar Ventures, LLC.
|
|
626
|
-
*
|
|
627
|
-
* This source code is licensed under the MIT license found in the
|
|
628
|
-
* LICENSE file in the root directory of this source tree.
|
|
629
|
-
*/
|
|
630
|
-
var dateShort = function (date) { return (new Date(date).toUTCString()); };
|
|
631
|
-
var dateDiff = function (dateStart, dateEnd) {
|
|
632
|
-
if (!dateStart || !dateEnd) {
|
|
633
|
-
return '';
|
|
634
|
-
}
|
|
635
|
-
var start = dayjs_min(dateStart);
|
|
636
|
-
var end = dayjs_min(dateEnd);
|
|
637
|
-
var ending = function (value) { return (value === 1 ? '' : 's'); };
|
|
638
|
-
var diffYears = end.diff(start, 'year', true);
|
|
639
|
-
if (Number.isInteger(diffYears)) {
|
|
640
|
-
return diffYears + " year" + ending(diffYears);
|
|
641
|
-
}
|
|
642
|
-
var diffMonth = end.diff(start, 'month', true);
|
|
643
|
-
if (Number.isInteger(diffMonth)) {
|
|
644
|
-
return diffMonth + " month" + ending(diffMonth);
|
|
645
|
-
}
|
|
646
|
-
var diffDays = end.diff(start, 'day');
|
|
647
|
-
return diffDays + " day" + ending(diffDays);
|
|
648
|
-
};
|
|
649
|
-
var basicInformation = "Basic Information";
|
|
650
|
-
var subjectName = "Subject Name";
|
|
651
|
-
var issuerName = "Issuer Name";
|
|
652
|
-
var publicKeyInfo = "Public Key Info";
|
|
653
|
-
var signature = "Signature";
|
|
654
|
-
var extensions = "Extensions";
|
|
655
|
-
var miscellaneous = "Miscellaneous";
|
|
656
|
-
var download = "Download";
|
|
657
|
-
var serialNumber = "Serial Number";
|
|
658
|
-
var version = "Version";
|
|
659
|
-
var validity = "Validity";
|
|
660
|
-
var issued = "Issued";
|
|
661
|
-
var expired = "Expired";
|
|
662
|
-
var algorithm = "Algorithm";
|
|
663
|
-
var namedCurve = "Named Curve";
|
|
664
|
-
var exponent = "Exponent";
|
|
665
|
-
var modulus = "Modulus";
|
|
666
|
-
var value = "Value";
|
|
667
|
-
var valid = "Valid";
|
|
668
|
-
var revoked = "Revoked";
|
|
669
|
-
var issuer = "Issuer";
|
|
670
|
-
var name = "Name";
|
|
671
|
-
var publicKey = "Public Key";
|
|
672
|
-
var fingerprint = "Fingerprint";
|
|
673
|
-
var fingerprints = "Fingerprints";
|
|
674
|
-
var actions = "Actions";
|
|
675
|
-
var details = "Details";
|
|
676
|
-
var testURLs = "Test URLs";
|
|
677
|
-
var certificateDetails = "Certificate Details";
|
|
678
|
-
var holder = "Holder";
|
|
679
|
-
var digestInfo = "Digest Info";
|
|
680
|
-
var type = "Type";
|
|
681
|
-
var en = {
|
|
682
|
-
basicInformation: basicInformation,
|
|
683
|
-
subjectName: subjectName,
|
|
684
|
-
issuerName: issuerName,
|
|
685
|
-
publicKeyInfo: publicKeyInfo,
|
|
686
|
-
signature: signature,
|
|
687
|
-
extensions: extensions,
|
|
688
|
-
miscellaneous: miscellaneous,
|
|
689
|
-
download: download,
|
|
690
|
-
"download.pem": "Download PEM",
|
|
691
|
-
"download.der": "Download DER",
|
|
692
|
-
serialNumber: serialNumber,
|
|
693
|
-
version: version,
|
|
694
|
-
validity: validity,
|
|
695
|
-
issued: issued,
|
|
696
|
-
expired: expired,
|
|
697
|
-
algorithm: algorithm,
|
|
698
|
-
namedCurve: namedCurve,
|
|
699
|
-
exponent: exponent,
|
|
700
|
-
modulus: modulus,
|
|
701
|
-
value: value,
|
|
702
|
-
valid: valid,
|
|
703
|
-
revoked: revoked,
|
|
704
|
-
issuer: issuer,
|
|
705
|
-
name: name,
|
|
706
|
-
publicKey: publicKey,
|
|
707
|
-
fingerprint: fingerprint,
|
|
708
|
-
fingerprints: fingerprints,
|
|
709
|
-
actions: actions,
|
|
710
|
-
details: details,
|
|
711
|
-
testURLs: testURLs,
|
|
712
|
-
certificateDetails: certificateDetails,
|
|
713
|
-
holder: holder,
|
|
714
|
-
digestInfo: digestInfo,
|
|
715
|
-
type: type
|
|
716
|
-
};
|
|
717
|
-
/**
|
|
718
|
-
* @license
|
|
719
|
-
* Copyright (c) Peculiar Ventures, LLC.
|
|
720
|
-
*
|
|
721
|
-
* This source code is licensed under the MIT license found in the
|
|
722
|
-
* LICENSE file in the root directory of this source tree.
|
|
723
|
-
*/
|
|
724
|
-
var MESSAGES_ALL = {
|
|
725
|
-
en: en,
|
|
726
|
-
};
|
|
727
|
-
var Localization = /** @class */ (function () {
|
|
728
|
-
function Localization() {
|
|
729
|
-
var _this = this;
|
|
730
|
-
this.setLocale = function (locale) {
|
|
731
|
-
_this.locale = locale && MESSAGES_ALL[locale] ? locale : 'en';
|
|
732
|
-
};
|
|
733
|
-
this.getLocale = function () { return _this.locale; };
|
|
734
|
-
var language = window.navigator.language.slice(0, 2).toLowerCase();
|
|
735
|
-
this.setLocale(language);
|
|
736
|
-
}
|
|
737
|
-
Localization.prototype.getString = function (id, replacer) {
|
|
738
|
-
var value = MESSAGES_ALL[this.locale][id];
|
|
739
|
-
if (!value) {
|
|
740
|
-
return '';
|
|
741
|
-
}
|
|
742
|
-
if (!replacer) {
|
|
743
|
-
return value;
|
|
744
|
-
}
|
|
745
|
-
var splitted = value.split(replacer.pattern);
|
|
746
|
-
if (splitted.length > 1) {
|
|
747
|
-
return [
|
|
748
|
-
splitted[0],
|
|
749
|
-
replacer.replacer,
|
|
750
|
-
splitted[1],
|
|
751
|
-
];
|
|
752
|
-
}
|
|
753
|
-
return value;
|
|
754
|
-
};
|
|
755
|
-
return Localization;
|
|
756
|
-
}());
|
|
757
|
-
var l10n = new Localization();
|
|
758
|
-
export { dateShort as a, commonjsGlobal as b, createCommonjsModule as c, dateDiff as d, history as h, l10n as l, unwrapExports as u };
|