@peculiar/certificates-viewer 3.7.0 → 3.9.0
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/dist/cjs/{certification_request-00bbfbc5.js → certification_request-b9ac73f2.js} +443 -431
- package/dist/cjs/{crl-de4e196b.js → crl-57727a07.js} +6 -6
- package/dist/cjs/{download-a97f4cb2.js → download-93f7b773.js} +9 -5
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{l10n-17c96aba.js → l10n-ddc7cff9.js} +1 -1
- package/dist/cjs/{miscellaneous-30c4aded.js → miscellaneous-07184a47.js} +210 -67
- package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js +7 -5
- package/dist/cjs/peculiar-button-split_4.cjs.entry.js +2 -2
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +5 -5
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +5 -5
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +4 -4
- package/dist/cjs/{x509_certificate-2af9b990.js → x509_certificate-da0fc87d.js} +4 -4
- package/dist/collection/components/certificate-details-parts/extensions/biometric_syntax_extension.js +10 -9
- package/dist/collection/components/certificate-details-parts/extensions/certificate_policies_extension.js +24 -24
- package/dist/collection/components/certificate-details-parts/extensions/certificate_transparency_extension.js +11 -10
- package/dist/collection/components/certificate-details-parts/extensions/extended_key_usage_extension.js +6 -2
- package/dist/collection/components/certificate-details-parts/extensions/info_access_syntax_extension.js +7 -6
- package/dist/collection/components/certificate-details-parts/extensions/qc_statements_extension.js +37 -6
- package/dist/collection/components/certificate-details-parts/extensions/subject_directory_attributes_extension.js +7 -6
- package/dist/collection/components/certificate-details-parts/public_key.js +5 -8
- package/dist/collection/components/csr-viewer/csr-viewer.js +2 -0
- package/dist/collection/constants/oids.js +15 -13
- package/dist/collection/crypto/crl.js +1 -1
- package/dist/collection/crypto/csr.js +1 -1
- package/dist/collection/crypto/provider.js +2 -1
- package/dist/collection/crypto/x509_attribute_certificate.js +1 -1
- package/dist/collection/crypto/x509_certificate.js +1 -1
- package/dist/collection/utils/download_from_buffer.js +9 -5
- package/dist/esm/{certification_request-8cc9d070.js → certification_request-db83dd19.js} +23 -17
- package/dist/esm/{crl-f43a95b7.js → crl-34288843.js} +6 -6
- package/dist/esm/{download-67ac9120.js → download-91511aeb.js} +9 -5
- package/dist/esm/index.js +1 -1
- package/dist/esm/{l10n-a68d5748.js → l10n-d48f35ff.js} +1 -1
- package/dist/esm/{miscellaneous-b74d9eae.js → miscellaneous-ee8e1994.js} +210 -67
- package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js +7 -5
- package/dist/esm/peculiar-button-split_4.entry.js +2 -2
- package/dist/esm/peculiar-certificate-decoder.entry.js +5 -5
- package/dist/esm/peculiar-certificate-viewer.entry.js +5 -5
- package/dist/esm/peculiar-certificates-viewer.entry.js +4 -4
- package/dist/esm/{x509_certificate-0fdd28aa.js → x509_certificate-1acb3564.js} +4 -4
- package/dist/peculiar/index.esm.js +1 -1
- package/dist/peculiar/p-08aba71b.js +69 -0
- package/dist/peculiar/p-0f7868b1.js +11 -0
- package/dist/peculiar/{p-167fd2db.entry.js → p-2f213160.entry.js} +2 -2
- package/dist/peculiar/{p-c72f8e8f.js → p-3c4e4245.js} +6 -6
- package/dist/peculiar/{p-ea9a6317.js → p-48a620ff.js} +5 -5
- package/dist/peculiar/p-711b4e1e.js +18 -0
- package/dist/peculiar/{p-0868020d.entry.js → p-81ae1305.entry.js} +1 -1
- package/dist/peculiar/{p-4e9318fb.entry.js → p-81d33fb4.entry.js} +1 -1
- package/dist/peculiar/{p-05337212.entry.js → p-9bfd4f58.entry.js} +1 -1
- package/dist/peculiar/{p-893659f4.entry.js → p-df53fbcc.entry.js} +1 -1
- package/dist/peculiar/{p-fec9d812.js → p-ec250cc4.js} +1 -1
- package/dist/peculiar/peculiar.esm.js +1 -1
- package/dist/types/constants/oids.d.ts +2 -0
- package/dist/types/crypto/crl.d.ts +1 -1
- package/dist/types/crypto/csr.d.ts +1 -1
- package/dist/types/crypto/x509_attribute_certificate.d.ts +1 -1
- package/dist/types/crypto/x509_certificate.d.ts +1 -1
- package/dist/types/interface.d.ts +1 -0
- package/package.json +3 -2
- package/dist/peculiar/p-45336b4f.js +0 -69
- package/dist/peculiar/p-cff9655c.js +0 -18
- package/dist/peculiar/p-ec8787ed.js +0 -11
|
@@ -12,32 +12,32 @@ import { h } from '@stencil/core';
|
|
|
12
12
|
import { UserNotice, DisplayText } from '@peculiar/asn1-x509';
|
|
13
13
|
import { AsnParser } from '@peculiar/asn1-schema';
|
|
14
14
|
import { getStringByOID } from '../../../utils';
|
|
15
|
-
import { RowValue } from '../row';
|
|
15
|
+
import { RowValue, TableRowTable } from '../row';
|
|
16
16
|
import { BasicExtension } from './basic_extension';
|
|
17
17
|
export const CertificatePoliciesExtension = (props) => {
|
|
18
18
|
const { extension } = props;
|
|
19
|
-
return (h(BasicExtension, { extension: extension }, extension.value.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
h(RowValue, { name:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
if (qualifierInfo.policyQualifierId === '1.3.6.1.5.5.7.2.2') {
|
|
34
|
-
const value = AsnParser.parse(qualifierInfo.qualifier, UserNotice);
|
|
35
|
-
if (value.explicitText) {
|
|
36
|
-
data.push(h(RowValue, { name: "Value", value: value.explicitText.toString() }));
|
|
19
|
+
return (h(BasicExtension, { extension: extension }, Boolean(extension.value.length) && ([
|
|
20
|
+
h(RowValue, { name: "Policies:", value: "" }),
|
|
21
|
+
extension.value.map((policy) => (h(TableRowTable, null,
|
|
22
|
+
h(RowValue, { name: "Policy ID", value: getStringByOID(policy.policyIdentifier) }),
|
|
23
|
+
policy.policyQualifiers && Boolean(policy.policyQualifiers.length) && ([
|
|
24
|
+
h(RowValue, { name: "Qualifiers:", value: "" }),
|
|
25
|
+
policy.policyQualifiers.map((qualifierInfo) => {
|
|
26
|
+
const data = [
|
|
27
|
+
h(RowValue, { name: "Qualifier ID", value: getStringByOID(qualifierInfo.policyQualifierId) }),
|
|
28
|
+
];
|
|
29
|
+
if (qualifierInfo.policyQualifierId === '1.3.6.1.5.5.7.2.1') {
|
|
30
|
+
const value = AsnParser.parse(qualifierInfo.qualifier, DisplayText);
|
|
31
|
+
data.push(h(RowValue, { name: "Value", value: value.toString() }));
|
|
37
32
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
if (qualifierInfo.policyQualifierId === '1.3.6.1.5.5.7.2.2') {
|
|
34
|
+
const value = AsnParser.parse(qualifierInfo.qualifier, UserNotice);
|
|
35
|
+
if (value.explicitText) {
|
|
36
|
+
data.push(h(RowValue, { name: "Value", value: value.explicitText.toString() }));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return (h(TableRowTable, null, data));
|
|
40
|
+
}),
|
|
41
|
+
])))),
|
|
42
|
+
])));
|
|
43
43
|
};
|
|
@@ -9,19 +9,20 @@
|
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
10
|
*/
|
|
11
11
|
import { h } from '@stencil/core';
|
|
12
|
-
import { RowValue } from '../row';
|
|
13
12
|
import logs from '../../../constants/logs';
|
|
14
13
|
import { dateShort } from '../../../utils';
|
|
14
|
+
import { RowValue, TableRowTable } from '../row';
|
|
15
15
|
import { BasicExtension } from './basic_extension';
|
|
16
16
|
export const CertificateTransparencyExtension = (props) => {
|
|
17
17
|
const { extension } = props;
|
|
18
|
-
return (h(BasicExtension, { extension: extension }, extension.value.
|
|
19
|
-
h(RowValue, { name:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
return (h(BasicExtension, { extension: extension }, Boolean(extension.value.items.length) && ([
|
|
19
|
+
h(RowValue, { name: "Signed Certificate Timestamps:", value: "" }),
|
|
20
|
+
extension.value.toJSON().map((signedCertificateTimestamp) => (h(TableRowTable, null,
|
|
21
|
+
h(RowValue, { name: "Version", value: signedCertificateTimestamp.version + 1 }),
|
|
22
|
+
h(RowValue, { name: "Log Operator", value: logs[signedCertificateTimestamp.logId] || signedCertificateTimestamp.logId }),
|
|
23
|
+
h(RowValue, { name: "Log Key ID", value: signedCertificateTimestamp.logId, monospace: true }),
|
|
24
|
+
h(RowValue, { name: "Timestamp", value: dateShort(signedCertificateTimestamp.timestamp) }),
|
|
25
|
+
h(RowValue, { name: "Signature Algorithm", value: `${signedCertificateTimestamp.hashAlgorithm} ${signedCertificateTimestamp.signatureAlgorithm}`.toUpperCase() }),
|
|
26
|
+
h(RowValue, { name: "Signature", value: signedCertificateTimestamp.signature, monospace: true })))),
|
|
27
|
+
])));
|
|
27
28
|
};
|
|
@@ -10,9 +10,13 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { h } from '@stencil/core';
|
|
12
12
|
import { getStringByOID } from '../../../utils';
|
|
13
|
-
import { RowValue } from '../row';
|
|
13
|
+
import { RowValue, TableRowTable } from '../row';
|
|
14
14
|
import { BasicExtension } from './basic_extension';
|
|
15
15
|
export const ExtendedKeyUsageExtension = (props) => {
|
|
16
16
|
const { extension } = props;
|
|
17
|
-
return (h(BasicExtension, { extension: extension }, extension.value.
|
|
17
|
+
return (h(BasicExtension, { extension: extension }, Boolean(extension.value.length) && ([
|
|
18
|
+
h(RowValue, { name: "Purposes:", value: "" }),
|
|
19
|
+
extension.value.map((usage) => (h(TableRowTable, null,
|
|
20
|
+
h(RowValue, { name: "Purpose", value: getStringByOID(usage) })))),
|
|
21
|
+
])));
|
|
18
22
|
};
|
|
@@ -10,14 +10,15 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { h } from '@stencil/core';
|
|
12
12
|
import { getStringByOID } from '../../../utils';
|
|
13
|
-
import { RowValue } from '../row';
|
|
13
|
+
import { RowValue, TableRowTable } from '../row';
|
|
14
14
|
import { BasicExtension } from './basic_extension';
|
|
15
15
|
import { GeneralNamePart } from './general_name_part';
|
|
16
16
|
export const InfoAccessSyntaxExtension = (props) => {
|
|
17
17
|
const { extension } = props;
|
|
18
|
-
return (h(BasicExtension, { extension: extension }, extension.value.
|
|
19
|
-
h(RowValue, { name:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
return (h(BasicExtension, { extension: extension }, Boolean(extension.value.length) && ([
|
|
19
|
+
h(RowValue, { name: "Descriptions:", value: "" }),
|
|
20
|
+
extension.value.map((description) => (h(TableRowTable, null,
|
|
21
|
+
h(RowValue, { name: "Method", value: getStringByOID(description.accessMethod) }),
|
|
22
|
+
h(GeneralNamePart, Object.assign({ generalName: description.accessLocation }, props))))),
|
|
23
|
+
])));
|
|
23
24
|
};
|
package/dist/collection/components/certificate-details-parts/extensions/qc_statements_extension.js
CHANGED
|
@@ -9,15 +9,46 @@
|
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
10
|
*/
|
|
11
11
|
import { h } from '@stencil/core';
|
|
12
|
+
import { id_qcs_pkixQCSyntax_v2, SemanticsInformation, } from '@peculiar/asn1-x509-qualified';
|
|
13
|
+
import { id_etsi_qcs_qcType, QcType, id_etsi_qcs_qcPDS, PdsLocations, id_etsi_qcs_qcRetentionPeriod, QcEuRetentionPeriod, } from '@peculiar/asn1-x509-qualified-etsi';
|
|
14
|
+
import { AsnParser } from '@peculiar/asn1-schema';
|
|
12
15
|
import { Convert } from 'pvtsutils';
|
|
13
16
|
import { getStringByOID } from '../../../utils';
|
|
14
|
-
import { RowValue } from '../row';
|
|
17
|
+
import { RowValue, TableRowTable } from '../row';
|
|
15
18
|
import { BasicExtension } from './basic_extension';
|
|
16
19
|
export const QCStatementsExtension = (props) => {
|
|
17
20
|
const { extension } = props;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
function renderStatementInfo(statementId, statementInfo) {
|
|
22
|
+
if (!statementInfo.byteLength) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
if (statementId === id_qcs_pkixQCSyntax_v2) {
|
|
26
|
+
const semanticsInformation = AsnParser.parse(statementInfo, SemanticsInformation);
|
|
27
|
+
return (h(RowValue, { name: "Semantics Identifier", value: getStringByOID(semanticsInformation.semanticsIdentifier) }));
|
|
28
|
+
}
|
|
29
|
+
if (statementId === id_etsi_qcs_qcType) {
|
|
30
|
+
const qcTypes = AsnParser.parse(statementInfo, QcType);
|
|
31
|
+
return (h(RowValue, { name: "QC Types", value: qcTypes.map((type) => getStringByOID(type)).join(', ') }));
|
|
32
|
+
}
|
|
33
|
+
if (statementId === id_etsi_qcs_qcRetentionPeriod) {
|
|
34
|
+
const retentionPeriod = AsnParser.parse(statementInfo, QcEuRetentionPeriod);
|
|
35
|
+
return (h(RowValue, { name: "Retention Period", value: `${retentionPeriod.value} years` }));
|
|
36
|
+
}
|
|
37
|
+
if (statementId === id_etsi_qcs_qcPDS) {
|
|
38
|
+
const pdsLocations = AsnParser.parse(statementInfo, PdsLocations);
|
|
39
|
+
return ([
|
|
40
|
+
h(RowValue, { name: "PDS Locations:", value: "" }),
|
|
41
|
+
pdsLocations.map((location) => (h(TableRowTable, null,
|
|
42
|
+
h(RowValue, { name: "URL", value: location.url }),
|
|
43
|
+
h(RowValue, { name: "Language", value: location.language })))),
|
|
44
|
+
]);
|
|
45
|
+
}
|
|
46
|
+
return (h(RowValue, { name: "Info", value: Convert.ToHex(statementInfo), monospace: true }));
|
|
47
|
+
}
|
|
48
|
+
return (h(BasicExtension, { extension: extension }, Boolean(extension.value.length) && ([
|
|
49
|
+
h(RowValue, { name: "Statements:", value: "" }),
|
|
50
|
+
extension.value.map((statement) => (h(TableRowTable, null,
|
|
51
|
+
h(RowValue, { name: "Statement ID", value: getStringByOID(statement.statementId) }),
|
|
52
|
+
renderStatementInfo(statement.statementId, statement.statementInfo)))),
|
|
53
|
+
])));
|
|
23
54
|
};
|
|
@@ -10,14 +10,15 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { h } from '@stencil/core';
|
|
12
12
|
import { getStringByOID } from '../../../utils';
|
|
13
|
-
import { RowValue } from '../row';
|
|
13
|
+
import { RowValue, TableRowTable } from '../row';
|
|
14
14
|
import { BasicExtension } from './basic_extension';
|
|
15
15
|
import { getAttributeValue } from './attribute_value';
|
|
16
16
|
export const SubjectDirectoryAttributesExtension = (props) => {
|
|
17
17
|
const { extension } = props;
|
|
18
|
-
return (h(BasicExtension, { extension: extension }, extension.value.
|
|
19
|
-
h(RowValue, { name:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
return (h(BasicExtension, { extension: extension }, Boolean(extension.value.length) && ([
|
|
19
|
+
h(RowValue, { name: "Attributes:", value: "" }),
|
|
20
|
+
extension.value.map((attribute) => (h(TableRowTable, null,
|
|
21
|
+
h(RowValue, { name: "Type", value: getStringByOID(attribute.type) }),
|
|
22
|
+
h(RowValue, { name: "Value", value: getAttributeValue(attribute) })))),
|
|
23
|
+
])));
|
|
23
24
|
};
|
|
@@ -13,9 +13,8 @@ import { Convert } from 'pvtsutils';
|
|
|
13
13
|
import { l10n, getStringByOID } from '../../utils';
|
|
14
14
|
import { RowTitle, RowValue, TableRowTable } from './row';
|
|
15
15
|
function getPublicKeyModulus(publicKey) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
let length = publicKey.params['modulus'].byteLength;
|
|
16
|
+
if ('modulus' in publicKey.params) {
|
|
17
|
+
let length = publicKey.params.modulus.byteLength;
|
|
19
18
|
if (length % 2) {
|
|
20
19
|
length -= 1;
|
|
21
20
|
}
|
|
@@ -24,9 +23,8 @@ function getPublicKeyModulus(publicKey) {
|
|
|
24
23
|
return null;
|
|
25
24
|
}
|
|
26
25
|
function getPublicKeyExponent(publicKey) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return publicKey.params['publicExponent'].byteLength === 3
|
|
26
|
+
if ('publicExponent' in publicKey.params) {
|
|
27
|
+
return publicKey.params.publicExponent.byteLength === 3
|
|
30
28
|
? 65537
|
|
31
29
|
: 3;
|
|
32
30
|
}
|
|
@@ -38,10 +36,9 @@ export const PublicKey = (props) => {
|
|
|
38
36
|
return null;
|
|
39
37
|
}
|
|
40
38
|
function renderKeyDetails(key) {
|
|
41
|
-
var _a;
|
|
42
39
|
return [
|
|
43
40
|
h(RowValue, { name: l10n.getString('algorithm'), value: getStringByOID(key.algorithm) }),
|
|
44
|
-
h(RowValue, { name: l10n.getString('namedCurve'), value: getStringByOID(
|
|
41
|
+
h(RowValue, { name: l10n.getString('namedCurve'), value: getStringByOID('namedCurve' in key.params ? key.params.namedCurve : undefined) }),
|
|
45
42
|
h(RowValue, { name: l10n.getString('exponent'), value: getPublicKeyExponent(key) }),
|
|
46
43
|
h(RowValue, { name: l10n.getString('modulus'), value: getPublicKeyModulus(key) }),
|
|
47
44
|
h(RowValue, { name: l10n.getString('value'), value: Convert.ToHex(key.value), monospace: true, collapse: true }),
|
|
@@ -15,7 +15,9 @@ import { BasicInformation, SubjectName, Signature, Thumbprints, Extensions, Misc
|
|
|
15
15
|
export class CsrViewer {
|
|
16
16
|
constructor() {
|
|
17
17
|
this.isDecodeInProcess = true;
|
|
18
|
+
// eslint-disable-next-line class-methods-use-this
|
|
18
19
|
this.getAuthKeyIdParentLink = (value) => value;
|
|
20
|
+
// eslint-disable-next-line class-methods-use-this
|
|
19
21
|
this.getAuthKeyIdSiblingsLink = (value) => value;
|
|
20
22
|
this.getSubjectKeyIdChildrenLink = (value) => {
|
|
21
23
|
var _a;
|
|
@@ -309,17 +309,18 @@ export const OIDs = {
|
|
|
309
309
|
'0.4.0.127.0.7.3.1.6': 'Bsi List Content Description',
|
|
310
310
|
'0.4.0.127.0.7.3.2.1': 'Bsi Security Object',
|
|
311
311
|
'0.4.0.127.0.7.3.2.2': 'Bsi Black List',
|
|
312
|
-
'0.4.0.1862': '
|
|
313
|
-
'0.4.0.1862.1': '
|
|
314
|
-
'0.4.0.1862.1.1': '
|
|
315
|
-
'0.4.0.1862.1.2': '
|
|
316
|
-
'0.4.0.1862.1.3': '
|
|
317
|
-
'0.4.0.1862.1.4': '
|
|
318
|
-
'0.4.0.1862.1.5': '
|
|
319
|
-
'0.4.0.1862.1.6': '
|
|
320
|
-
'0.4.0.1862.1.6.1': '
|
|
321
|
-
'0.4.0.1862.1.6.2': '
|
|
322
|
-
'0.4.0.1862.1.6.3': '
|
|
312
|
+
'0.4.0.1862': 'ETSI QCS Profile',
|
|
313
|
+
'0.4.0.1862.1': 'ETSI QCS',
|
|
314
|
+
'0.4.0.1862.1.1': 'ETSI QCS Compliance',
|
|
315
|
+
'0.4.0.1862.1.2': 'ETSI QCS Limit Value',
|
|
316
|
+
'0.4.0.1862.1.3': 'ETSI QCS Retention Period',
|
|
317
|
+
'0.4.0.1862.1.4': 'ETSI QCS SSCD',
|
|
318
|
+
'0.4.0.1862.1.5': 'ETSI QCS PDS',
|
|
319
|
+
'0.4.0.1862.1.6': 'ETSI QC Type',
|
|
320
|
+
'0.4.0.1862.1.6.1': 'ETSI QC Type eSign',
|
|
321
|
+
'0.4.0.1862.1.6.2': 'ETSI QC Type eSeal',
|
|
322
|
+
'0.4.0.1862.1.6.3': 'ETSI QC Type Web',
|
|
323
|
+
'0.4.0.194121.1.2': 'ETSI QCS Semantics ID Legal',
|
|
323
324
|
'0.4.0.194112.1.0': 'QCP Natural Person',
|
|
324
325
|
'0.4.0.194112.1.1': 'QCP Legal Person',
|
|
325
326
|
'0.4.0.194112.1.2': 'QCP Natural QSCD',
|
|
@@ -1282,6 +1283,7 @@ export const OIDs = {
|
|
|
1282
1283
|
'1.3.6.1.5.5.7.3.13': 'Eap Over PPP',
|
|
1283
1284
|
'1.3.6.1.5.5.7.3.14': 'Eap Over LAN',
|
|
1284
1285
|
'1.3.6.1.5.5.7.3.31': 'Brand Indicator for Message Identification',
|
|
1286
|
+
'1.3.6.1.5.5.7.3.46': 'Document Signing',
|
|
1285
1287
|
'1.3.6.1.5.5.7.4': 'Cmp Information Types',
|
|
1286
1288
|
'1.3.6.1.5.5.7.4.1': 'Ca Prot Enc Cert',
|
|
1287
1289
|
'1.3.6.1.5.5.7.4.2': 'Sign Key Pair Types',
|
|
@@ -1335,8 +1337,8 @@ export const OIDs = {
|
|
|
1335
1337
|
'1.3.6.1.5.5.7.10.5': 'Role',
|
|
1336
1338
|
'1.3.6.1.5.5.7.10.6': 'Wlan SSID',
|
|
1337
1339
|
'1.3.6.1.5.5.7.11': 'Personal Data',
|
|
1338
|
-
'1.3.6.1.5.5.7.11.1': '
|
|
1339
|
-
'1.3.6.1.5.5.7.11.2': '
|
|
1340
|
+
'1.3.6.1.5.5.7.11.1': 'PKIX QC Syntax V1',
|
|
1341
|
+
'1.3.6.1.5.5.7.11.2': 'PKIX QC Syntax V2',
|
|
1340
1342
|
'1.3.6.1.5.5.7.14.2': 'Resource Certificate Policy',
|
|
1341
1343
|
'1.3.6.1.5.5.7.20': 'Logo',
|
|
1342
1344
|
'1.3.6.1.5.5.7.20.1': 'Logo Loyalty',
|
|
@@ -40,7 +40,7 @@ export class CRL extends AsnData {
|
|
|
40
40
|
try {
|
|
41
41
|
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
42
42
|
if (thumbprint) {
|
|
43
|
-
this.thumbprints[algorithm
|
|
43
|
+
this.thumbprints[algorithm] = Convert.ToHex(thumbprint);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
catch (error) {
|
|
@@ -66,7 +66,7 @@ export class CSR extends AsnData {
|
|
|
66
66
|
try {
|
|
67
67
|
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
68
68
|
if (thumbprint) {
|
|
69
|
-
this.thumbprints[algorithm
|
|
69
|
+
this.thumbprints[algorithm] = Convert.ToHex(thumbprint);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
catch (error) {
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
export class CryptoProvider {
|
|
12
12
|
constructor() {
|
|
13
13
|
this.providers = new Map();
|
|
14
|
-
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
const crypto = window.crypto || window.msCrypto;
|
|
15
16
|
if (typeof crypto !== 'undefined') {
|
|
16
17
|
this.set(CryptoProvider.DEFAULT, crypto);
|
|
17
18
|
}
|
|
@@ -64,7 +64,7 @@ export class X509AttributeCertificate extends AsnData {
|
|
|
64
64
|
try {
|
|
65
65
|
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
66
66
|
if (thumbprint) {
|
|
67
|
-
this.thumbprints[algorithm
|
|
67
|
+
this.thumbprints[algorithm] = Convert.ToHex(thumbprint);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
catch (error) {
|
|
@@ -100,7 +100,7 @@ export class X509Certificate extends AsnData {
|
|
|
100
100
|
try {
|
|
101
101
|
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
102
102
|
if (thumbprint) {
|
|
103
|
-
this.thumbprints[algorithm
|
|
103
|
+
this.thumbprints[algorithm] = Convert.ToHex(thumbprint);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
catch (error) {
|
|
@@ -24,7 +24,9 @@ export function downloadFromBuffer(value, name, extension, mime = 'application/o
|
|
|
24
24
|
if (navigator.msSaveBlob) { // IE10+ : (has Blob, but not a[download] or URL)
|
|
25
25
|
// @ts-ignore
|
|
26
26
|
navigator.msSaveBlob(blob, `${name}.${extension}`);
|
|
27
|
-
return new Promise((
|
|
27
|
+
return new Promise((resolve) => {
|
|
28
|
+
setTimeout(resolve, 100);
|
|
29
|
+
});
|
|
28
30
|
}
|
|
29
31
|
const blobURL = window.URL.createObjectURL(blob);
|
|
30
32
|
const link = document.createElement('a');
|
|
@@ -39,8 +41,10 @@ export function downloadFromBuffer(value, name, extension, mime = 'application/o
|
|
|
39
41
|
document.body.appendChild(link);
|
|
40
42
|
link.dispatchEvent(new MouseEvent('click'));
|
|
41
43
|
document.body.removeChild(link);
|
|
42
|
-
return new Promise((
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
return new Promise((resolve) => {
|
|
45
|
+
setTimeout(() => {
|
|
46
|
+
document.body.removeChild(frame);
|
|
47
|
+
resolve();
|
|
48
|
+
}, 100);
|
|
49
|
+
});
|
|
46
50
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import { b as build, c as createCommonjsModule, a as commonjsGlobal } from './download-
|
|
5
|
-
import './l10n-
|
|
4
|
+
import { b as build, c as createCommonjsModule, a as commonjsGlobal } from './download-91511aeb.js';
|
|
5
|
+
import './l10n-d48f35ff.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
@@ -342,17 +342,18 @@ const OIDs = {
|
|
|
342
342
|
'0.4.0.127.0.7.3.1.6': 'Bsi List Content Description',
|
|
343
343
|
'0.4.0.127.0.7.3.2.1': 'Bsi Security Object',
|
|
344
344
|
'0.4.0.127.0.7.3.2.2': 'Bsi Black List',
|
|
345
|
-
'0.4.0.1862': '
|
|
346
|
-
'0.4.0.1862.1': '
|
|
347
|
-
'0.4.0.1862.1.1': '
|
|
348
|
-
'0.4.0.1862.1.2': '
|
|
349
|
-
'0.4.0.1862.1.3': '
|
|
350
|
-
'0.4.0.1862.1.4': '
|
|
351
|
-
'0.4.0.1862.1.5': '
|
|
352
|
-
'0.4.0.1862.1.6': '
|
|
353
|
-
'0.4.0.1862.1.6.1': '
|
|
354
|
-
'0.4.0.1862.1.6.2': '
|
|
355
|
-
'0.4.0.1862.1.6.3': '
|
|
345
|
+
'0.4.0.1862': 'ETSI QCS Profile',
|
|
346
|
+
'0.4.0.1862.1': 'ETSI QCS',
|
|
347
|
+
'0.4.0.1862.1.1': 'ETSI QCS Compliance',
|
|
348
|
+
'0.4.0.1862.1.2': 'ETSI QCS Limit Value',
|
|
349
|
+
'0.4.0.1862.1.3': 'ETSI QCS Retention Period',
|
|
350
|
+
'0.4.0.1862.1.4': 'ETSI QCS SSCD',
|
|
351
|
+
'0.4.0.1862.1.5': 'ETSI QCS PDS',
|
|
352
|
+
'0.4.0.1862.1.6': 'ETSI QC Type',
|
|
353
|
+
'0.4.0.1862.1.6.1': 'ETSI QC Type eSign',
|
|
354
|
+
'0.4.0.1862.1.6.2': 'ETSI QC Type eSeal',
|
|
355
|
+
'0.4.0.1862.1.6.3': 'ETSI QC Type Web',
|
|
356
|
+
'0.4.0.194121.1.2': 'ETSI QCS Semantics ID Legal',
|
|
356
357
|
'0.4.0.194112.1.0': 'QCP Natural Person',
|
|
357
358
|
'0.4.0.194112.1.1': 'QCP Legal Person',
|
|
358
359
|
'0.4.0.194112.1.2': 'QCP Natural QSCD',
|
|
@@ -1315,6 +1316,7 @@ const OIDs = {
|
|
|
1315
1316
|
'1.3.6.1.5.5.7.3.13': 'Eap Over PPP',
|
|
1316
1317
|
'1.3.6.1.5.5.7.3.14': 'Eap Over LAN',
|
|
1317
1318
|
'1.3.6.1.5.5.7.3.31': 'Brand Indicator for Message Identification',
|
|
1319
|
+
'1.3.6.1.5.5.7.3.46': 'Document Signing',
|
|
1318
1320
|
'1.3.6.1.5.5.7.4': 'Cmp Information Types',
|
|
1319
1321
|
'1.3.6.1.5.5.7.4.1': 'Ca Prot Enc Cert',
|
|
1320
1322
|
'1.3.6.1.5.5.7.4.2': 'Sign Key Pair Types',
|
|
@@ -1368,8 +1370,8 @@ const OIDs = {
|
|
|
1368
1370
|
'1.3.6.1.5.5.7.10.5': 'Role',
|
|
1369
1371
|
'1.3.6.1.5.5.7.10.6': 'Wlan SSID',
|
|
1370
1372
|
'1.3.6.1.5.5.7.11': 'Personal Data',
|
|
1371
|
-
'1.3.6.1.5.5.7.11.1': '
|
|
1372
|
-
'1.3.6.1.5.5.7.11.2': '
|
|
1373
|
+
'1.3.6.1.5.5.7.11.1': 'PKIX QC Syntax V1',
|
|
1374
|
+
'1.3.6.1.5.5.7.11.2': 'PKIX QC Syntax V2',
|
|
1373
1375
|
'1.3.6.1.5.5.7.14.2': 'Resource Certificate Policy',
|
|
1374
1376
|
'1.3.6.1.5.5.7.20': 'Logo',
|
|
1375
1377
|
'1.3.6.1.5.5.7.20.1': 'Logo Loyalty',
|
|
@@ -9141,6 +9143,8 @@ BiometricSyntax = BiometricSyntax_1 = __decorate([
|
|
|
9141
9143
|
AsnType({ type: AsnTypeTypes.Sequence, itemType: BiometricData })
|
|
9142
9144
|
], BiometricSyntax);
|
|
9143
9145
|
|
|
9146
|
+
const id_qcs = `${id_pkix$1}.11`;
|
|
9147
|
+
|
|
9144
9148
|
var NameRegistrationAuthorities_1, QCStatements_1;
|
|
9145
9149
|
const id_pe_qcStatements = `${id_pe$1}.3`;
|
|
9146
9150
|
class QCStatement {
|
|
@@ -9155,6 +9159,7 @@ __decorate([
|
|
|
9155
9159
|
__decorate([
|
|
9156
9160
|
AsnProp({ type: AsnPropTypes.Any, optional: true })
|
|
9157
9161
|
], QCStatement.prototype, "statementInfo", void 0);
|
|
9162
|
+
const id_qcs_pkixQCSyntax_v2 = `${id_qcs}.2`;
|
|
9158
9163
|
let NameRegistrationAuthorities = NameRegistrationAuthorities_1 = class NameRegistrationAuthorities extends AsnArray {
|
|
9159
9164
|
constructor(items) {
|
|
9160
9165
|
super(items);
|
|
@@ -10372,7 +10377,8 @@ class Extension extends AsnData {
|
|
|
10372
10377
|
class CryptoProvider {
|
|
10373
10378
|
constructor() {
|
|
10374
10379
|
this.providers = new Map();
|
|
10375
|
-
|
|
10380
|
+
// @ts-ignore
|
|
10381
|
+
const crypto = window.crypto || window.msCrypto;
|
|
10376
10382
|
if (typeof crypto !== 'undefined') {
|
|
10377
10383
|
this.set(CryptoProvider.DEFAULT, crypto);
|
|
10378
10384
|
}
|
|
@@ -12019,4 +12025,4 @@ __decorate([
|
|
|
12019
12025
|
AsnProp({ type: AsnPropTypes.BitString })
|
|
12020
12026
|
], CertificationRequest.prototype, "signature", void 0);
|
|
12021
12027
|
|
|
12022
|
-
export { Name$1 as $, AsnData as A, id_InsuranceValue as B, Certificate as C, id_WebGDPR as D, Extension as E, id_ActivityDescription as F, ActivityDescription as G, id_TypeRelationship as H, InsuranceValue as I, id_DomainNameTechnicalOperator as J, DomainNameTechnicalOperator as K, id_DomainNameOwner as L, DomainNameOwner as M, Name as N, id_DomainNameLegalRepresentative as O, DomainNameLegalRepresentative as P, id_DomainNameBeneficiary as Q, RSAPublicKey as R, DomainNameBeneficiary as S, TypeRelationship as T, UnstructuredName as U, ValuationRanking as V, WebGDPR as W, AttributeCertificate as X, CertificationRequest as Y, CertificateList as Z, OIDs as _, isX509Pem as a, CRLReason as a0, InvalidityDate as a1, CertificateIssuer as a2, OtherName as a3, DisplayText as a4, UserNotice as a5, EDIPartyName as a6,
|
|
12028
|
+
export { Name$1 as $, AsnData as A, id_InsuranceValue as B, Certificate as C, id_WebGDPR as D, Extension as E, id_ActivityDescription as F, ActivityDescription as G, id_TypeRelationship as H, InsuranceValue as I, id_DomainNameTechnicalOperator as J, DomainNameTechnicalOperator as K, id_DomainNameOwner as L, DomainNameOwner as M, Name as N, id_DomainNameLegalRepresentative as O, DomainNameLegalRepresentative as P, id_DomainNameBeneficiary as Q, RSAPublicKey as R, DomainNameBeneficiary as S, TypeRelationship as T, UnstructuredName as U, ValuationRanking as V, WebGDPR as W, AttributeCertificate as X, CertificationRequest as Y, CertificateList as Z, OIDs as _, isX509Pem as a, CRLReason as a0, InvalidityDate as a1, CertificateIssuer as a2, OtherName as a3, DisplayText as a4, UserNotice as a5, EDIPartyName as a6, __decorate as a7, AsnProp as a8, AsnPropTypes as a9, Timestamp as aA, ArchiveRevInfo as aB, SubjectDirectoryAttributes as aC, PrivateKeyUsagePeriod as aD, EntrustVersionInfo as aE, BiometricSyntax as aF, LogotypeExtn as aG, TNAuthorizationList as aH, PolicyConstraints as aI, PolicyMappings as aJ, CRLNumber as aK, IssuingDistributionPoint as aL, AsnType as aa, AsnTypeTypes as ab, AsnArray as ac, id_qcs_pkixQCSyntax_v2 as ad, SemanticsInformation as ae, AsnIntegerArrayBufferConverter as af, KeyUsage as ag, BasicConstraints as ah, ExtendedKeyUsage as ai, SubjectKeyIdentifier as aj, AuthorityKeyIdentifier as ak, CRLDistributionPoints as al, AuthorityInfoAccessSyntax as am, SubjectInfoAccessSyntax as an, SubjectAlternativeName as ao, CertificatePolicies as ap, CertificateTransparency as aq, NameConstraints as ar, CertificateTemplate as as, EnrollCertTypeChoice as at, CaVersion as au, QCStatements as av, NetscapeComment as aw, NetscapeCertType as ax, LeiRole as ay, LeiChoice as az, isPkcs10Pem as b, isX509AttributePem as c, isX509CRLPem as d, certificateRawToBuffer as e, AsnConvert as f, id_ecPublicKey as g, ECParameters as h, isPem as i, id_rsaEncryption as j, id_composite_key as k, CompositePublicKey as l, id_alg_composite as m, CompositeSignatureValue as n, CompositeParams as o, hexFormat as p, base64Format as q, getCertificateThumbprint as r, Attribute$1 as s, id_pkcs9_at_extensionRequest as t, AsnParser as u, ExtensionRequest as v, id_pkcs9_at_unstructuredName as w, id_pkcs9_at_challengePassword as x, ChallengePassword as y, id_ValuationRanking as z };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import { A as AsnData, s as Attribute$1, t as id_pkcs9_at_extensionRequest, u as AsnParser, v as ExtensionRequest, E as Extension, f as AsnConvert, w as id_pkcs9_at_unstructuredName, U as UnstructuredName, x as id_pkcs9_at_challengePassword, y as ChallengePassword, z as id_ValuationRanking, V as ValuationRanking, B as id_InsuranceValue, I as InsuranceValue, D as id_WebGDPR, W as WebGDPR, F as id_ActivityDescription, G as ActivityDescription, H as id_TypeRelationship, T as TypeRelationship, J as id_DomainNameTechnicalOperator, K as DomainNameTechnicalOperator, L as id_DomainNameOwner, M as DomainNameOwner, O as id_DomainNameLegalRepresentative, P as DomainNameLegalRepresentative, Q as id_DomainNameBeneficiary, S as DomainNameBeneficiary, e as certificateRawToBuffer, X as AttributeCertificate, r as getCertificateThumbprint, p as hexFormat, q as base64Format, Y as CertificationRequest, N as Name, g as id_ecPublicKey, h as ECParameters, j as id_rsaEncryption, R as RSAPublicKey, Z as CertificateList } from './certification_request-
|
|
5
|
-
import { b as build, D as Download } from './download-
|
|
6
|
-
import { d as dateDiff } from './l10n-
|
|
4
|
+
import { A as AsnData, s as Attribute$1, t as id_pkcs9_at_extensionRequest, u as AsnParser, v as ExtensionRequest, E as Extension, f as AsnConvert, w as id_pkcs9_at_unstructuredName, U as UnstructuredName, x as id_pkcs9_at_challengePassword, y as ChallengePassword, z as id_ValuationRanking, V as ValuationRanking, B as id_InsuranceValue, I as InsuranceValue, D as id_WebGDPR, W as WebGDPR, F as id_ActivityDescription, G as ActivityDescription, H as id_TypeRelationship, T as TypeRelationship, J as id_DomainNameTechnicalOperator, K as DomainNameTechnicalOperator, L as id_DomainNameOwner, M as DomainNameOwner, O as id_DomainNameLegalRepresentative, P as DomainNameLegalRepresentative, Q as id_DomainNameBeneficiary, S as DomainNameBeneficiary, e as certificateRawToBuffer, X as AttributeCertificate, r as getCertificateThumbprint, p as hexFormat, q as base64Format, Y as CertificationRequest, N as Name, g as id_ecPublicKey, h as ECParameters, j as id_rsaEncryption, R as RSAPublicKey, Z as CertificateList } from './certification_request-db83dd19.js';
|
|
5
|
+
import { b as build, D as Download } from './download-91511aeb.js';
|
|
6
|
+
import { d as dateDiff } from './l10n-d48f35ff.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @license
|
|
@@ -120,7 +120,7 @@ class X509AttributeCertificate extends AsnData {
|
|
|
120
120
|
try {
|
|
121
121
|
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
122
122
|
if (thumbprint) {
|
|
123
|
-
this.thumbprints[algorithm
|
|
123
|
+
this.thumbprints[algorithm] = build.Convert.ToHex(thumbprint);
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
catch (error) {
|
|
@@ -202,7 +202,7 @@ class CSR extends AsnData {
|
|
|
202
202
|
try {
|
|
203
203
|
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
204
204
|
if (thumbprint) {
|
|
205
|
-
this.thumbprints[algorithm
|
|
205
|
+
this.thumbprints[algorithm] = build.Convert.ToHex(thumbprint);
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
catch (error) {
|
|
@@ -264,7 +264,7 @@ class CRL extends AsnData {
|
|
|
264
264
|
try {
|
|
265
265
|
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
266
266
|
if (thumbprint) {
|
|
267
|
-
this.thumbprints[algorithm
|
|
267
|
+
this.thumbprints[algorithm] = build.Convert.ToHex(thumbprint);
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
catch (error) {
|
|
@@ -24,7 +24,9 @@ function downloadFromBuffer(value, name, extension, mime = 'application/octet-st
|
|
|
24
24
|
if (navigator.msSaveBlob) { // IE10+ : (has Blob, but not a[download] or URL)
|
|
25
25
|
// @ts-ignore
|
|
26
26
|
navigator.msSaveBlob(blob, `${name}.${extension}`);
|
|
27
|
-
return new Promise((
|
|
27
|
+
return new Promise((resolve) => {
|
|
28
|
+
setTimeout(resolve, 100);
|
|
29
|
+
});
|
|
28
30
|
}
|
|
29
31
|
const blobURL = window.URL.createObjectURL(blob);
|
|
30
32
|
const link = document.createElement('a');
|
|
@@ -39,10 +41,12 @@ function downloadFromBuffer(value, name, extension, mime = 'application/octet-st
|
|
|
39
41
|
document.body.appendChild(link);
|
|
40
42
|
link.dispatchEvent(new MouseEvent('click'));
|
|
41
43
|
document.body.removeChild(link);
|
|
42
|
-
return new Promise((
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
return new Promise((resolve) => {
|
|
45
|
+
setTimeout(() => {
|
|
46
|
+
document.body.removeChild(frame);
|
|
47
|
+
resolve();
|
|
48
|
+
}, 100);
|
|
49
|
+
});
|
|
46
50
|
}
|
|
47
51
|
|
|
48
52
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import { c as createCommonjsModule, a as commonjsGlobal } from './download-
|
|
4
|
+
import { c as createCommonjsModule, a as commonjsGlobal } from './download-91511aeb.js';
|
|
5
5
|
|
|
6
6
|
var dayjs_min = createCommonjsModule(function (module, exports) {
|
|
7
7
|
!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",l="Invalid Date",$=/^(\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("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={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())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}},g="en",D={};D[g]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=v;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)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);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)}}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()===l)},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),l=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)},$=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,v="set"+(this.$u?"UTC":"");switch(h){case c:return r?l(1,0):l(31,11);case f:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},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":""),l=(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],$=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&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,l=this;r=Number(r);var $=O.p(h),y=function(t){var e=w(l);return O.w(e.date(e.date()+Math.round(t*r)),l)};if($===f)return this.set(f,this.$M+r);if($===c)return this.set(c,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||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())return n.invalidDate||l;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},$={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||$[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,v=this-M,g=O.m(this,M);return g=($={},$[c]=g/12,$[f]=g,$[h]=g/3,$[o]=(v-m)/6048e5,$[a]=(v-m)/864e5,$[u]=v/n,$[s]=v/e,$[i]=v/t,$)[y]||v,l?g:O.a(g)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)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[g],w.Ls=D,w.p={},w}));
|