@learncard/react 2.6.79 → 2.7.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/dist/cjs/{BoostGenericCard-924e41e7.js → BoostGenericCard-a5ca50df.js} +8 -5
- package/dist/cjs/BoostGenericCard-a5ca50df.js.map +1 -0
- package/dist/cjs/{CertificateDisplayCard-2283f3de.js → CertificateDisplayCard-811ef7cf.js} +91 -61
- package/dist/cjs/CertificateDisplayCard-811ef7cf.js.map +1 -0
- package/dist/{esm/numeral-804ed0c4.js → cjs/CircleIcon-5587a585.js} +97 -2
- package/dist/cjs/CircleIcon-5587a585.js.map +1 -0
- package/dist/cjs/{User-dde46685.js → Coins-acd63f46.js} +1 -85
- package/dist/cjs/Coins-acd63f46.js.map +1 -0
- package/dist/cjs/{Notification-0bc2680c.js → Notification-d212fa7b.js} +2 -2
- package/dist/cjs/{Notification-0bc2680c.js.map → Notification-d212fa7b.js.map} +1 -1
- package/dist/cjs/{NotificationBoostCard-194ae55a.js → NotificationBoostCard-70dfa17e.js} +2 -2
- package/dist/cjs/{NotificationBoostCard-194ae55a.js.map → NotificationBoostCard-70dfa17e.js.map} +1 -1
- package/dist/cjs/PuzzlePiece-937c216a.js +31 -0
- package/dist/cjs/PuzzlePiece-937c216a.js.map +1 -0
- package/dist/cjs/{react-barcode-1a2c5694.js → SchoolIDCard-c7b4153a.js} +61 -1185
- package/dist/cjs/SchoolIDCard-c7b4153a.js.map +1 -0
- package/dist/cjs/User-301088ac.js +93 -0
- package/dist/cjs/User-301088ac.js.map +1 -0
- package/dist/cjs/{VCCard-55f7738e.js → VCCard-2d4bfd86.js} +4 -31
- package/dist/{esm/VCCard-caeb4bbd.js.map → cjs/VCCard-2d4bfd86.js.map} +1 -1
- package/dist/cjs/{VCDisplayBackFace-42f41d3f.js → VCDisplayBackFace-a3cd6ad2.js} +3 -3
- package/dist/cjs/{VCDisplayBackFace-42f41d3f.js.map → VCDisplayBackFace-a3cd6ad2.js.map} +1 -1
- package/dist/cjs/{VCDisplayCard-3c50142e.js → VCDisplayCard-f0783ca4.js} +3 -3
- package/dist/cjs/{VCDisplayCard-3c50142e.js.map → VCDisplayCard-f0783ca4.js.map} +1 -1
- package/dist/cjs/{VCDisplayCard2-de2f603c.js → VCDisplayCard2-2fbad5c7.js} +298 -42
- package/dist/cjs/VCDisplayCard2-2fbad5c7.js.map +1 -0
- package/dist/cjs/VCVerificationPill-43201cac.js +75 -0
- package/dist/cjs/VCVerificationPill-43201cac.js.map +1 -0
- package/dist/cjs/{constants-93a826a5.js → constants-3359aea1.js} +52 -2
- package/dist/cjs/constants-3359aea1.js.map +1 -0
- package/dist/cjs/{credential.helpers-adf7af7c.js → credential.helpers-ccf9ea86.js} +8 -48
- package/dist/cjs/{credential.helpers-adf7af7c.js.map → credential.helpers-ccf9ea86.js.map} +1 -1
- package/dist/cjs/index-7d94d5ac.js.map +1 -1
- package/dist/cjs/index-838fa72c.js +1186 -0
- package/dist/cjs/index-838fa72c.js.map +1 -0
- package/dist/cjs/index.js +37 -35
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index13.js +37 -35
- package/dist/cjs/index13.js.map +1 -1
- package/dist/cjs/index22.js +5 -3
- package/dist/cjs/index22.js.map +1 -1
- package/dist/cjs/index23.js +5 -3
- package/dist/cjs/index23.js.map +1 -1
- package/dist/cjs/index28.js +3 -5
- package/dist/cjs/index28.js.map +1 -1
- package/dist/cjs/index29.js +2 -2
- package/dist/cjs/index3.js +1 -1
- package/dist/cjs/index35.js +3 -2
- package/dist/cjs/index35.js.map +1 -1
- package/dist/cjs/index36.js +17 -79
- package/dist/cjs/index36.js.map +1 -1
- package/dist/cjs/index37.js +6 -85
- package/dist/cjs/index37.js.map +1 -1
- package/dist/cjs/index38.js +9 -86
- package/dist/cjs/index38.js.map +1 -1
- package/dist/cjs/index39.js +10 -79
- package/dist/cjs/index39.js.map +1 -1
- package/dist/cjs/index40.js +1 -87
- package/dist/cjs/index40.js.map +1 -1
- package/dist/cjs/index43.js +2 -1
- package/dist/cjs/index43.js.map +1 -1
- package/dist/cjs/index6.js +11 -82
- package/dist/cjs/index6.js.map +1 -1
- package/dist/cjs/index8.js +1 -2
- package/dist/cjs/index8.js.map +1 -1
- package/dist/cjs/{types-7f6324ea.js → types-8eab1382.js} +6 -26
- package/dist/cjs/types-8eab1382.js.map +1 -0
- package/dist/{esm/VCVerificationPill-2c48beee.js → cjs/types.esm-2ec4fa7e.js} +3 -63
- package/dist/cjs/types.esm-2ec4fa7e.js.map +1 -0
- package/dist/esm/{BoostGenericCard-09f3bd8a.js → BoostGenericCard-a82dec36.js} +8 -5
- package/dist/esm/BoostGenericCard-a82dec36.js.map +1 -0
- package/dist/esm/{CertificateDisplayCard-711f2e93.js → CertificateDisplayCard-5fc4318c.js} +83 -55
- package/dist/esm/CertificateDisplayCard-5fc4318c.js.map +1 -0
- package/dist/{cjs/numeral-d057158c.js → esm/CircleIcon-b527bf95.js} +89 -3
- package/dist/esm/CircleIcon-b527bf95.js.map +1 -0
- package/dist/esm/{User-9f253521.js → Coins-ed119ec6.js} +2 -83
- package/dist/esm/Coins-ed119ec6.js.map +1 -0
- package/dist/esm/{Notification-78a215ff.js → Notification-95d159d2.js} +2 -2
- package/dist/esm/{Notification-78a215ff.js.map → Notification-95d159d2.js.map} +1 -1
- package/dist/esm/{NotificationBoostCard-9e7197eb.js → NotificationBoostCard-e614c341.js} +2 -2
- package/dist/esm/{NotificationBoostCard-9e7197eb.js.map → NotificationBoostCard-e614c341.js.map} +1 -1
- package/dist/esm/PuzzlePiece-1fb12c2e.js +25 -0
- package/dist/esm/PuzzlePiece-1fb12c2e.js.map +1 -0
- package/dist/esm/{react-barcode-150610c2.js → SchoolIDCard-01422d53.js} +60 -1184
- package/dist/esm/SchoolIDCard-01422d53.js.map +1 -0
- package/dist/esm/User-161c7f37.js +85 -0
- package/dist/esm/User-161c7f37.js.map +1 -0
- package/dist/esm/{VCCard-caeb4bbd.js → VCCard-9f020c00.js} +4 -31
- package/dist/{cjs/VCCard-55f7738e.js.map → esm/VCCard-9f020c00.js.map} +1 -1
- package/dist/esm/{VCDisplayBackFace-e13869e2.js → VCDisplayBackFace-1a581f1c.js} +3 -3
- package/dist/esm/{VCDisplayBackFace-e13869e2.js.map → VCDisplayBackFace-1a581f1c.js.map} +1 -1
- package/dist/esm/{VCDisplayCard-04dcc183.js → VCDisplayCard-ac914ce3.js} +3 -3
- package/dist/esm/{VCDisplayCard-04dcc183.js.map → VCDisplayCard-ac914ce3.js.map} +1 -1
- package/dist/esm/{VCDisplayCard2-e2e1d9f1.js → VCDisplayCard2-0b6b741f.js} +277 -22
- package/dist/esm/VCDisplayCard2-0b6b741f.js.map +1 -0
- package/dist/esm/VCVerificationPill-3e38a718.js +65 -0
- package/dist/esm/VCVerificationPill-3e38a718.js.map +1 -0
- package/dist/esm/constants-f2a32f0c.js +107 -0
- package/dist/esm/constants-f2a32f0c.js.map +1 -0
- package/dist/esm/{credential.helpers-20680b00.js → credential.helpers-c06a1aa8.js} +5 -45
- package/dist/esm/{credential.helpers-20680b00.js.map → credential.helpers-c06a1aa8.js.map} +1 -1
- package/dist/esm/index-43f63ea7.js.map +1 -1
- package/dist/esm/index-4fa491c1.js +1184 -0
- package/dist/esm/index-4fa491c1.js.map +1 -0
- package/dist/esm/index.js +27 -27
- package/dist/esm/index13.js +27 -27
- package/dist/esm/index22.js +5 -3
- package/dist/esm/index22.js.map +1 -1
- package/dist/esm/index23.js +5 -3
- package/dist/esm/index23.js.map +1 -1
- package/dist/esm/index28.js +2 -4
- package/dist/esm/index28.js.map +1 -1
- package/dist/esm/index29.js +2 -2
- package/dist/esm/index3.js +1 -1
- package/dist/esm/index35.js +2 -1
- package/dist/esm/index35.js.map +1 -1
- package/dist/esm/index36.js +17 -79
- package/dist/esm/index36.js.map +1 -1
- package/dist/esm/index37.js +6 -85
- package/dist/esm/index37.js.map +1 -1
- package/dist/esm/index38.js +9 -86
- package/dist/esm/index38.js.map +1 -1
- package/dist/esm/index39.js +9 -78
- package/dist/esm/index39.js.map +1 -1
- package/dist/esm/index40.js +1 -87
- package/dist/esm/index40.js.map +1 -1
- package/dist/esm/index43.js +2 -1
- package/dist/esm/index43.js.map +1 -1
- package/dist/esm/index6.js +9 -82
- package/dist/esm/index6.js.map +1 -1
- package/dist/esm/index8.js +1 -2
- package/dist/esm/index8.js.map +1 -1
- package/dist/esm/{types-c31e4bae.js → types-cfde3c2b.js} +5 -24
- package/dist/esm/types-cfde3c2b.js.map +1 -0
- package/dist/{cjs/VCVerificationPill-b4b96a9f.js → esm/types.esm-8f6a5623.js} +2 -75
- package/dist/esm/types.esm-8f6a5623.js.map +1 -0
- package/dist/index.d.ts +19 -1
- package/dist/main.css +1 -1
- package/dist/main.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/BoostGenericCard-924e41e7.js.map +0 -1
- package/dist/cjs/CertificateDisplayCard-2283f3de.js.map +0 -1
- package/dist/cjs/CircleIcon-dace003c.js +0 -98
- package/dist/cjs/CircleIcon-dace003c.js.map +0 -1
- package/dist/cjs/RoundedSquare-fc16f13f.js +0 -58
- package/dist/cjs/RoundedSquare-fc16f13f.js.map +0 -1
- package/dist/cjs/SchoolIDCard-44ef96bd.js +0 -68
- package/dist/cjs/SchoolIDCard-44ef96bd.js.map +0 -1
- package/dist/cjs/User-dde46685.js.map +0 -1
- package/dist/cjs/VCDisplayCard2-de2f603c.js.map +0 -1
- package/dist/cjs/VCVerificationPill-b4b96a9f.js.map +0 -1
- package/dist/cjs/constants-93a826a5.js.map +0 -1
- package/dist/cjs/index.es-05e5f438.js +0 -194
- package/dist/cjs/index.es-05e5f438.js.map +0 -1
- package/dist/cjs/numeral-d057158c.js.map +0 -1
- package/dist/cjs/react-barcode-1a2c5694.js.map +0 -1
- package/dist/cjs/types-7f6324ea.js.map +0 -1
- package/dist/esm/BoostGenericCard-09f3bd8a.js.map +0 -1
- package/dist/esm/CertificateDisplayCard-711f2e93.js.map +0 -1
- package/dist/esm/CircleIcon-b45511e1.js +0 -91
- package/dist/esm/CircleIcon-b45511e1.js.map +0 -1
- package/dist/esm/RoundedSquare-0d25f9ef.js +0 -52
- package/dist/esm/RoundedSquare-0d25f9ef.js.map +0 -1
- package/dist/esm/SchoolIDCard-91bade9a.js +0 -62
- package/dist/esm/SchoolIDCard-91bade9a.js.map +0 -1
- package/dist/esm/User-9f253521.js.map +0 -1
- package/dist/esm/VCDisplayCard2-e2e1d9f1.js.map +0 -1
- package/dist/esm/VCVerificationPill-2c48beee.js.map +0 -1
- package/dist/esm/constants-ee2b8bc3.js +0 -59
- package/dist/esm/constants-ee2b8bc3.js.map +0 -1
- package/dist/esm/index.es-0cc0c240.js +0 -187
- package/dist/esm/index.es-0cc0c240.js.map +0 -1
- package/dist/esm/numeral-804ed0c4.js.map +0 -1
- package/dist/esm/react-barcode-150610c2.js.map +0 -1
- package/dist/esm/types-c31e4bae.js.map +0 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import React, { useRef, useEffect, useState, useLayoutEffect } from 'react';
|
|
2
|
-
import
|
|
1
|
+
import React, { useRef, useEffect, useState, createContext, Component, Children, cloneElement, useLayoutEffect } from 'react';
|
|
2
|
+
import './index-4fa491c1.js';
|
|
3
3
|
import { a as VCVerificationCheckWithSpinner } from './VCVerificationCheck-80249524.js';
|
|
4
4
|
import DefaultFace from './default-face.jpeg';
|
|
5
|
-
import {
|
|
6
|
-
import { g as getBaseUrl,
|
|
5
|
+
import { a as getColorForVerificationStatus, j as format$1, h as getNameFromProfile, b as getInfoFromCredential, i as getImageFromProfile, k as getCategoryColor, g as getTotalCountOfSkills, c as categorizeSkills } from './credential.helpers-c06a1aa8.js';
|
|
6
|
+
import { g as getBaseUrl, d as VideoIcon, e as Camera, G as GenericDocumentIcon, L as LinkIcon, p as prettyBytes, f as capitalize, X, E as ExclamationPoint, A as AcuteCheckmark, I as InfoIcon, h as LeftArrow, i as SkillsBox, j as AlignmentsBox, t as truncateWithEllipsis, V as VERIFIER_STATES$1, k as VerifierStateBadgeAndText, P as PersonBadge, l as VerifiedBadge, U as UnknownVerifierBadge, R as RedFlag, b as CertificateDisplayCard } from './CertificateDisplayCard-5fc4318c.js';
|
|
7
7
|
import { L as Lightbox } from './Lightbox-a1aab9ea.js';
|
|
8
|
-
import {
|
|
8
|
+
import { V as VerificationStatusEnum } from './types.esm-8f6a5623.js';
|
|
9
9
|
import { I as IDIcon, Q as QRCodeIcon, A as AwardRibbon } from './QRCodeIcon-e9569804.js';
|
|
10
10
|
import { a as LCCategoryEnum } from './index-43f63ea7.js';
|
|
11
|
+
import { P as PuzzlePiece } from './PuzzlePiece-1fb12c2e.js';
|
|
11
12
|
import IDSleeve from './id-sleeve.png';
|
|
12
13
|
import './CaretRightFilled.svg';
|
|
13
14
|
import 'react-dom';
|
|
@@ -103,7 +104,10 @@ const InfoBox = ({ text, handleClose, backgroundColor = "#6366F1" }) => {
|
|
|
103
104
|
className: "info-box p-[10px] rounded-[10px] w-full font-poppins text-[12px] leading[18px]",
|
|
104
105
|
style: { backgroundColor: bgColorWithOpacity }
|
|
105
106
|
}, text, " ", /* @__PURE__ */ React.createElement("button", {
|
|
106
|
-
onClick:
|
|
107
|
+
onClick: (e) => {
|
|
108
|
+
e.stopPropagation();
|
|
109
|
+
handleClose();
|
|
110
|
+
},
|
|
107
111
|
className: "text-indigo-500 font-[700] select-none"
|
|
108
112
|
}, "Close"));
|
|
109
113
|
};
|
|
@@ -291,7 +295,10 @@ const MediaAttachmentsBox = ({
|
|
|
291
295
|
return /* @__PURE__ */ React.createElement("button", {
|
|
292
296
|
key: index,
|
|
293
297
|
className,
|
|
294
|
-
onClick: () =>
|
|
298
|
+
onClick: (e) => {
|
|
299
|
+
e.stopPropagation();
|
|
300
|
+
handleMediaAttachmentClick(media.url, media.type);
|
|
301
|
+
}
|
|
295
302
|
}, innerContent);
|
|
296
303
|
}
|
|
297
304
|
return /* @__PURE__ */ React.createElement("div", {
|
|
@@ -322,21 +329,26 @@ const MediaAttachmentsBox = ({
|
|
|
322
329
|
href: docOrLink.url,
|
|
323
330
|
target: "_blank",
|
|
324
331
|
rel: "noreferrer",
|
|
325
|
-
className: "text-grayscale-600 font-[600] px-[5px] hover:underline"
|
|
332
|
+
className: "text-grayscale-600 font-[600] px-[5px] hover:underline",
|
|
333
|
+
onClick: (e) => e.stopPropagation()
|
|
326
334
|
}, fileExtension && /* @__PURE__ */ React.createElement("span", {
|
|
327
335
|
className: "uppercase"
|
|
328
336
|
}, fileExtension), fileExtension && (numberOfPages || sizeInBytes) && " \u2022 ", numberOfPages && /* @__PURE__ */ React.createElement("span", null, numberOfPages, " page", numberOfPages === 1 ? "" : "s"), numberOfPages && sizeInBytes && " \u2022 ", sizeInBytes && /* @__PURE__ */ React.createElement("span", null, prettyBytes(sizeInBytes))), docOrLink.type === "link" && /* @__PURE__ */ React.createElement("a", {
|
|
329
337
|
href: docOrLink.url,
|
|
330
338
|
target: "_blank",
|
|
331
339
|
rel: "noreferrer",
|
|
332
|
-
className: "text-indigo-500 font-[600] px-[5px] hover:underline"
|
|
340
|
+
className: "text-indigo-500 font-[600] px-[5px] hover:underline",
|
|
341
|
+
onClick: (e) => e.stopPropagation()
|
|
333
342
|
}, baseUrl));
|
|
334
343
|
const className = `row-attachment ${docOrLink.type} bg-grayscale-100 rounded-[15px] p-[10px] w-full font-poppins text-[12px] leading-[18px] tracking-[-0.33px] text-left`;
|
|
335
344
|
if (onMediaAttachmentClick) {
|
|
336
345
|
return /* @__PURE__ */ React.createElement("button", {
|
|
337
346
|
key: index,
|
|
338
347
|
className,
|
|
339
|
-
onClick: () =>
|
|
348
|
+
onClick: (e) => {
|
|
349
|
+
e.stopPropagation();
|
|
350
|
+
handleMediaAttachmentClick(docOrLink.url, docOrLink.type);
|
|
351
|
+
}
|
|
340
352
|
}, innerContent);
|
|
341
353
|
}
|
|
342
354
|
return /* @__PURE__ */ React.createElement("div", {
|
|
@@ -428,10 +440,16 @@ const TruncateTextBox = ({
|
|
|
428
440
|
className: `text-[12px] text-grayscale-700 leading-[18px] font-poppins font-[400] mb-0 ${textClassName}`
|
|
429
441
|
}, displayText, truncated && /* @__PURE__ */ React.createElement(React.Fragment, null, "...", " ", /* @__PURE__ */ React.createElement("button", {
|
|
430
442
|
className: "text-indigo-500 font-[700]",
|
|
431
|
-
onClick: () =>
|
|
443
|
+
onClick: (e) => {
|
|
444
|
+
e.stopPropagation();
|
|
445
|
+
setShowFullText(true);
|
|
446
|
+
}
|
|
432
447
|
}, "More")), needsTruncate && showFullText && /* @__PURE__ */ React.createElement(React.Fragment, null, " ", /* @__PURE__ */ React.createElement("button", {
|
|
433
448
|
className: "text-indigo-500 font-[700]",
|
|
434
|
-
onClick: () =>
|
|
449
|
+
onClick: (e) => {
|
|
450
|
+
e.stopPropagation();
|
|
451
|
+
setShowFullText(false);
|
|
452
|
+
}
|
|
435
453
|
}, "Close"))), children);
|
|
436
454
|
};
|
|
437
455
|
|
|
@@ -477,7 +495,10 @@ const VerificationsBox = ({ verificationItems }) => {
|
|
|
477
495
|
className: "text-[20px] leading-[20px] text-grayscale-900"
|
|
478
496
|
}, "Credential Verifications"), /* @__PURE__ */ React.createElement("button", {
|
|
479
497
|
className: "absolute top-[17px] right-[17px]",
|
|
480
|
-
onClick: () =>
|
|
498
|
+
onClick: (e) => {
|
|
499
|
+
e.stopPropagation();
|
|
500
|
+
setShowInfo(!showInfo);
|
|
501
|
+
}
|
|
481
502
|
}, /* @__PURE__ */ React.createElement(InfoIcon, {
|
|
482
503
|
color: showInfo ? "#6366F1" : void 0
|
|
483
504
|
})), showInfo && /* @__PURE__ */ React.createElement(InfoBox, {
|
|
@@ -505,7 +526,7 @@ const VC2BackFace = ({
|
|
|
505
526
|
enableLightbox
|
|
506
527
|
}) => {
|
|
507
528
|
var _a, _b, _c, _d;
|
|
508
|
-
const expiration = credential.expirationDate ? format(new Date(credential.expirationDate), "MMM dd, yyyy") : void 0;
|
|
529
|
+
const expiration = credential.expirationDate ? format$1(new Date(credential.expirationDate), "MMM dd, yyyy") : void 0;
|
|
509
530
|
const isExpired = credential.expirationDate && Number(new Date(credential.expirationDate)) < Number(new Date());
|
|
510
531
|
const achievement = "achievement" in credential.credentialSubject ? credential.credentialSubject.achievement : void 0;
|
|
511
532
|
const criteria = (_a = achievement == null ? void 0 : achievement.criteria) == null ? void 0 : _a.narrative;
|
|
@@ -559,6 +580,7 @@ const VC2BackFace = ({
|
|
|
559
580
|
};
|
|
560
581
|
|
|
561
582
|
const VC2FrontFaceInfo = ({
|
|
583
|
+
credential,
|
|
562
584
|
issuee,
|
|
563
585
|
issuer,
|
|
564
586
|
subjectDID,
|
|
@@ -567,12 +589,16 @@ const VC2FrontFaceInfo = ({
|
|
|
567
589
|
customBodyCardComponent,
|
|
568
590
|
createdAt,
|
|
569
591
|
imageUrl,
|
|
570
|
-
customThumbComponent
|
|
592
|
+
customThumbComponent,
|
|
593
|
+
trustedAppRegistry
|
|
571
594
|
}) => {
|
|
572
595
|
const issuerName = truncateWithEllipsis(getNameFromProfile(issuer != null ? issuer : ""), 25);
|
|
573
596
|
const issueeName = truncateWithEllipsis(getNameFromProfile(issuee != null ? issuee : ""), 25);
|
|
574
597
|
const issuerImage = getImageFromProfile(issuer != null ? issuer : "");
|
|
575
598
|
const issueeImage = getImageFromProfile(issuee != null ? issuee : "");
|
|
599
|
+
const { credentialSubject } = getInfoFromCredential(credential, "MMM dd, yyyy", {
|
|
600
|
+
uppercaseDate: false
|
|
601
|
+
});
|
|
576
602
|
const getImageElement = (imageUrl2, alt, overrideComponent) => {
|
|
577
603
|
if (overrideComponent)
|
|
578
604
|
return overrideComponent;
|
|
@@ -584,6 +610,18 @@ const VC2FrontFaceInfo = ({
|
|
|
584
610
|
};
|
|
585
611
|
const issueeImageEl = getImageElement(issueeImage, "Issuee image", subjectImageComponent);
|
|
586
612
|
const issuerImageEl = getImageElement(issuerImage, "Issuer image", issuerImageComponent);
|
|
613
|
+
const issuerDid = typeof credential.issuer === "string" ? credential.issuer : credential.issuer.id;
|
|
614
|
+
let verifierState;
|
|
615
|
+
if ((credentialSubject == null ? void 0 : credentialSubject.id) === issuerDid && issuerDid && issuerDid !== "did:example:123") {
|
|
616
|
+
verifierState = VERIFIER_STATES$1.selfVerified;
|
|
617
|
+
} else {
|
|
618
|
+
const appRegistryEntry = trustedAppRegistry == null ? void 0 : trustedAppRegistry.find((registryEntry) => registryEntry.did === issuerDid);
|
|
619
|
+
if (appRegistryEntry) {
|
|
620
|
+
verifierState = appRegistryEntry.isTrusted ? VERIFIER_STATES$1.trustedVerifier : VERIFIER_STATES$1.untrustedVerifier;
|
|
621
|
+
} else {
|
|
622
|
+
verifierState = VERIFIER_STATES$1.unknownVerifier;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
587
625
|
return /* @__PURE__ */ React.createElement("section", {
|
|
588
626
|
className: "vc-front-face w-full px-[15px] flex flex-col items-center gap-[15px]"
|
|
589
627
|
}, imageUrl && !customThumbComponent && /* @__PURE__ */ React.createElement("img", {
|
|
@@ -602,6 +640,8 @@ const VC2FrontFaceInfo = ({
|
|
|
602
640
|
}, issueeImageEl), /* @__PURE__ */ React.createElement("div", {
|
|
603
641
|
className: "vc-issuer-image h-[30px] w-[30px] rounded-full overflow-hidden absolute bottom-[-12px] right-[-12px]"
|
|
604
642
|
}, issuerImageEl)), /* @__PURE__ */ React.createElement("div", {
|
|
643
|
+
className: "flex flex-col gap-[13px]"
|
|
644
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
605
645
|
className: "vc-issue-details mt-[10px] flex flex-col items-center font-montserrat text-[14px] leading-[20px]"
|
|
606
646
|
}, /* @__PURE__ */ React.createElement("span", {
|
|
607
647
|
className: "created-at text-grayscale-700"
|
|
@@ -609,9 +649,193 @@ const VC2FrontFaceInfo = ({
|
|
|
609
649
|
className: "issued-by text-grayscale-900 font-[500]"
|
|
610
650
|
}, "by ", /* @__PURE__ */ React.createElement("strong", {
|
|
611
651
|
className: "font-[700]"
|
|
612
|
-
}, issuerName)))
|
|
652
|
+
}, issuerName))), /* @__PURE__ */ React.createElement(VerifierStateBadgeAndText, {
|
|
653
|
+
verifierState
|
|
654
|
+
})))));
|
|
613
655
|
};
|
|
614
656
|
|
|
657
|
+
/*! @license Rematrix v0.2.2
|
|
658
|
+
|
|
659
|
+
Copyright 2018 Fisssion LLC.
|
|
660
|
+
|
|
661
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
662
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
663
|
+
in the Software without restriction, including without limitation the rights
|
|
664
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
665
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
666
|
+
furnished to do so, subject to the following conditions:
|
|
667
|
+
|
|
668
|
+
The above copyright notice and this permission notice shall be included in
|
|
669
|
+
all copies or substantial portions of the Software.
|
|
670
|
+
|
|
671
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
672
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
673
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
674
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
675
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
676
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
677
|
+
THE SOFTWARE.
|
|
678
|
+
*/
|
|
679
|
+
/**
|
|
680
|
+
* @module Rematrix
|
|
681
|
+
*/
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* Transformation matrices in the browser come in two flavors:
|
|
685
|
+
*
|
|
686
|
+
* - `matrix` using 6 values (short)
|
|
687
|
+
* - `matrix3d` using 16 values (long)
|
|
688
|
+
*
|
|
689
|
+
* This utility follows this [conversion guide](https://goo.gl/EJlUQ1)
|
|
690
|
+
* to expand short form matrices to their equivalent long form.
|
|
691
|
+
*
|
|
692
|
+
* @param {array} source - Accepts both short and long form matrices.
|
|
693
|
+
* @return {array}
|
|
694
|
+
*/
|
|
695
|
+
function format(source) {
|
|
696
|
+
if (source.constructor !== Array) {
|
|
697
|
+
throw new TypeError('Expected array.')
|
|
698
|
+
}
|
|
699
|
+
if (source.length === 16) {
|
|
700
|
+
return source
|
|
701
|
+
}
|
|
702
|
+
if (source.length === 6) {
|
|
703
|
+
var matrix = identity();
|
|
704
|
+
matrix[0] = source[0];
|
|
705
|
+
matrix[1] = source[1];
|
|
706
|
+
matrix[4] = source[2];
|
|
707
|
+
matrix[5] = source[3];
|
|
708
|
+
matrix[12] = source[4];
|
|
709
|
+
matrix[13] = source[5];
|
|
710
|
+
return matrix
|
|
711
|
+
}
|
|
712
|
+
throw new RangeError('Expected array with either 6 or 16 values.')
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* Returns a matrix representing no transformation. The product of any matrix
|
|
717
|
+
* multiplied by the identity matrix will be the original matrix.
|
|
718
|
+
*
|
|
719
|
+
* > **Tip:** Similar to how `5 * 1 === 5`, where `1` is the identity.
|
|
720
|
+
*
|
|
721
|
+
* @return {array}
|
|
722
|
+
*/
|
|
723
|
+
function identity() {
|
|
724
|
+
var matrix = [];
|
|
725
|
+
for (var i = 0; i < 16; i++) {
|
|
726
|
+
i % 5 == 0 ? matrix.push(1) : matrix.push(0);
|
|
727
|
+
}
|
|
728
|
+
return matrix
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* Returns a 4x4 matrix describing the combined transformations
|
|
733
|
+
* of both arguments.
|
|
734
|
+
*
|
|
735
|
+
* > **Note:** Order is very important. For example, rotating 45°
|
|
736
|
+
* along the Z-axis, followed by translating 500 pixels along the
|
|
737
|
+
* Y-axis... is not the same as translating 500 pixels along the
|
|
738
|
+
* Y-axis, followed by rotating 45° along on the Z-axis.
|
|
739
|
+
*
|
|
740
|
+
* @param {array} m - Accepts both short and long form matrices.
|
|
741
|
+
* @param {array} x - Accepts both short and long form matrices.
|
|
742
|
+
* @return {array}
|
|
743
|
+
*/
|
|
744
|
+
function multiply(m, x) {
|
|
745
|
+
var fm = format(m);
|
|
746
|
+
var fx = format(x);
|
|
747
|
+
var product = [];
|
|
748
|
+
|
|
749
|
+
for (var i = 0; i < 4; i++) {
|
|
750
|
+
var row = [fm[i], fm[i + 4], fm[i + 8], fm[i + 12]];
|
|
751
|
+
for (var j = 0; j < 4; j++) {
|
|
752
|
+
var k = j * 4;
|
|
753
|
+
var col = [fx[k], fx[k + 1], fx[k + 2], fx[k + 3]];
|
|
754
|
+
var result =
|
|
755
|
+
row[0] * col[0] + row[1] * col[1] + row[2] * col[2] + row[3] * col[3];
|
|
756
|
+
|
|
757
|
+
product[i + k] = result;
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
return product
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* Attempts to return a 4x4 matrix describing the CSS transform
|
|
766
|
+
* matrix passed in, but will return the identity matrix as a
|
|
767
|
+
* fallback.
|
|
768
|
+
*
|
|
769
|
+
* **Tip:** In virtually all cases, this method is used to convert
|
|
770
|
+
* a CSS matrix (retrieved as a `string` from computed styles) to
|
|
771
|
+
* its equivalent array format.
|
|
772
|
+
*
|
|
773
|
+
* @param {string} source - String containing a valid CSS `matrix` or `matrix3d` property.
|
|
774
|
+
* @return {array}
|
|
775
|
+
*/
|
|
776
|
+
function parse(source) {
|
|
777
|
+
if (typeof source === 'string') {
|
|
778
|
+
var match = source.match(/matrix(3d)?\(([^)]+)\)/);
|
|
779
|
+
if (match) {
|
|
780
|
+
var raw = match[2].split(', ').map(parseFloat);
|
|
781
|
+
return format(raw)
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
return identity()
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* Returns a 4x4 matrix describing X-axis scaling.
|
|
789
|
+
*
|
|
790
|
+
* @param {number} scalar - Decimal multiplier.
|
|
791
|
+
* @return {array}
|
|
792
|
+
*/
|
|
793
|
+
function scaleX(scalar) {
|
|
794
|
+
var matrix = identity();
|
|
795
|
+
matrix[0] = scalar;
|
|
796
|
+
return matrix
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* Returns a 4x4 matrix describing Y-axis scaling.
|
|
801
|
+
*
|
|
802
|
+
* @param {number} scalar - Decimal multiplier.
|
|
803
|
+
* @return {array}
|
|
804
|
+
*/
|
|
805
|
+
function scaleY(scalar) {
|
|
806
|
+
var matrix = identity();
|
|
807
|
+
matrix[5] = scalar;
|
|
808
|
+
return matrix
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* Returns a 4x4 matrix describing X-axis translation.
|
|
813
|
+
*
|
|
814
|
+
* @param {number} distance - Measured in pixels.
|
|
815
|
+
* @return {array}
|
|
816
|
+
*/
|
|
817
|
+
function translateX(distance) {
|
|
818
|
+
var matrix = identity();
|
|
819
|
+
matrix[12] = distance;
|
|
820
|
+
return matrix
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
/**
|
|
824
|
+
* Returns a 4x4 matrix describing Y-axis translation.
|
|
825
|
+
*
|
|
826
|
+
* @param {number} distance - Measured in pixels.
|
|
827
|
+
* @return {array}
|
|
828
|
+
*/
|
|
829
|
+
function translateY(distance) {
|
|
830
|
+
var matrix = identity();
|
|
831
|
+
matrix[13] = distance;
|
|
832
|
+
return matrix
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
var e=function(t){return "number"==typeof t},i=function(t){return "function"==typeof t},n=function(t){return "[object Object]"===Object.prototype.toString.call(t)},r=function(t){return Array.prototype.slice.apply(t)},s$1=function(t){var e=t.reduce(function(t,e){return t[e]=(t[e]||0)+1,t},{});return Object.keys(e).filter(function(t){return e[t]>1})};function a(t){return [].slice.call(arguments,1).forEach(function(e){if(e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);}),t}var o,l=function(t,e,i){return t+(e-t)*i},p={__proto__:null,isNumber:e,isFunction:i,isObject:n,toArray:r,getDuplicateValsAsStrings:s$1,assign:a,tweenProp:l},c$1="data-flip-id",u$1="data-inverse-flip-id",d$1="data-portal-key",f$1="data-exit-container",h$1={__proto__:null,DATA_FLIP_ID:c$1,DATA_INVERSE_FLIP_ID:u$1,DATA_FLIP_COMPONENT_ID:"data-flip-component-id",DATA_FLIP_CONFIG:"data-flip-config",DATA_PORTAL_KEY:d$1,DATA_EXIT_CONTAINER:f$1},g$1={noWobble:{stiffness:200,damping:26},gentle:{stiffness:120,damping:14},veryGentle:{stiffness:130,damping:17},wobbly:{stiffness:180,damping:12},stiff:{stiffness:260,damping:26}},m$1=function(t){return n(t)?t:Object.keys(g$1).indexOf(t)>-1?g$1[t]:{}};"undefined"!=typeof window&&(o=window.requestAnimationFrame);var v$1=o=o||function(t){window.setTimeout(t,1e3/60);},y$1=Date.now(),_="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()-y$1};function S(t,e){var i=t.indexOf(e);-1!==i&&t.splice(i,1);}var E=/*#__PURE__*/function(){function t(){}return t.prototype.run=function(){var t=this;v$1(function(){t.springSystem.loop(_());});},t}(),A=function(){this.position=0,this.velocity=0;},C=0,b=.001,I=/*#__PURE__*/function(){function t(t){this._id="s"+C++,this._springSystem=t,this.listeners=[],this._startValue=0,this._currentState=new A,this._displacementFromRestThreshold=.001,this._endValue=0,this._overshootClampingEnabled=!1,this._previousState=new A,this._restSpeedThreshold=.001,this._tempState=new A,this._timeAccumulator=0,this._wasAtRest=!0,this._cachedSpringConfig={};}var e=t.prototype;return e.getId=function(){return this._id},e.destroy=function(){this.listeners=[],this._springSystem.deregisterSpring(this);},e.setSpringConfig=function(t){return this._springConfig=t,this},e.getCurrentValue=function(){return this._currentState.position},e.getDisplacementDistanceForState=function(t){return Math.abs(this._endValue-t.position)},e.setEndValue=function(t){if(t===this._endValue)return this;if(this.prevEndValue=t,this._endValue===t&&this.isAtRest())return this;this._startValue=this.getCurrentValue(),this._endValue=t,this._springSystem.activateSpring(this.getId());for(var e=0,i=this.listeners.length;e<i;e++){var n=this.listeners[e].onSpringEndStateChange;n&&n(this);}return this},e.setVelocity=function(t){return t===this._currentState.velocity||(this._currentState.velocity=t,this._springSystem.activateSpring(this.getId())),this},e.setCurrentValue=function(t){this._startValue=t,this._currentState.position=t;for(var e=0,i=this.listeners.length;e<i;e++){var n=this.listeners[e];n.onSpringUpdate&&n.onSpringUpdate(this);}return this},e.setAtRest=function(){return this._endValue=this._currentState.position,this._tempState.position=this._currentState.position,this._currentState.velocity=0,this},e.setOvershootClampingEnabled=function(t){return this._overshootClampingEnabled=t,this},e.isOvershooting=function(){var t=this._startValue,e=this._endValue;return this._springConfig.tension>0&&(t<e&&this.getCurrentValue()>e||t>e&&this.getCurrentValue()<e)},e.advance=function(t,e){var i=this.isAtRest();if(!i||!this._wasAtRest){var n=e;e>.064&&(n=.064),this._timeAccumulator+=n;for(var r,s,a,o,l,p,c=this._springConfig.tension,u=this._springConfig.friction,d=this._currentState.position,f=this._currentState.velocity,h=this._tempState.position,g=this._tempState.velocity;this._timeAccumulator>=b;)this._timeAccumulator-=b,this._timeAccumulator<b&&(this._previousState.position=d,this._previousState.velocity=f),s=c*(this._endValue-h)-u*f,o=c*(this._endValue-(h=d+(r=f)*b*.5))-u*(g=f+s*b*.5),p=c*(this._endValue-(h=d+(a=g)*b*.5))-u*(g=f+o*b*.5),h=d+(l=g)*b,d+=1/6*(r+2*(a+l)+(g=f+p*b))*b,f+=1/6*(s+2*(o+p)+(c*(this._endValue-h)-u*g))*b;this._tempState.position=h,this._tempState.velocity=g,this._currentState.position=d,this._currentState.velocity=f,this._timeAccumulator>0&&this._interpolate(this._timeAccumulator/b),(this.isAtRest()||this._overshootClampingEnabled&&this.isOvershooting())&&(this._springConfig.tension>0?(this._startValue=this._endValue,this._currentState.position=this._endValue):(this._endValue=this._currentState.position,this._startValue=this._endValue),this.setVelocity(0),i=!0);var m=!1;this._wasAtRest&&(this._wasAtRest=!1,m=!0);var v=!1;i&&(this._wasAtRest=!0,v=!0),this.notifyPositionUpdated(m,v);}},e.notifyPositionUpdated=function(t,e){var i=this;this.listeners.filter(Boolean).forEach(function(n){t&&n.onSpringActivate&&!i._onActivateCalled&&(n.onSpringActivate(i),i._onActivateCalled=!0),n.onSpringUpdate&&n.onSpringUpdate(i),e&&n.onSpringAtRest&&n.onSpringAtRest(i);});},e.systemShouldAdvance=function(){return !this.isAtRest()||!this.wasAtRest()},e.wasAtRest=function(){return this._wasAtRest},e.isAtRest=function(){return Math.abs(this._currentState.velocity)<this._restSpeedThreshold&&(this.getDisplacementDistanceForState(this._currentState)<=this._displacementFromRestThreshold||0===this._springConfig.tension)},e._interpolate=function(t){this._currentState.position=this._currentState.position*t+this._previousState.position*(1-t),this._currentState.velocity=this._currentState.velocity*t+this._previousState.velocity*(1-t);},e.addListener=function(t){return this.listeners.push(t),this},e.addOneTimeListener=function(t){var e=this;return Object.keys(t).forEach(function(i){var n;t[i]=(n=t[i],function(){n.apply(void 0,[].slice.call(arguments)),e.removeListener(t);});}),this.listeners.push(t),this},e.removeListener=function(t){return S(this.listeners,t),this},t}(),w=/*#__PURE__*/function(){function t(t){this.looper=t||new E,this.looper.springSystem=this,this.listeners=[],this._activeSprings=[],this._idleSpringIndices=[],this._isIdle=!0,this._lastTimeMillis=-1,this._springRegistry={};}var e=t.prototype;return e.createSpring=function(t,e){return this.createSpringWithConfig({tension:t,friction:e})},e.createSpringWithConfig=function(t){var e=new I(this);return this.registerSpring(e),e.setSpringConfig(t),e},e.getIsIdle=function(){return this._isIdle},e.registerSpring=function(t){this._springRegistry[t.getId()]=t;},e.deregisterSpring=function(t){S(this._activeSprings,t),delete this._springRegistry[t.getId()];},e.advance=function(t,e){for(var i=this;this._idleSpringIndices.length>0;)this._idleSpringIndices.pop();for(this._activeSprings.filter(Boolean).forEach(function(n){n.systemShouldAdvance()?n.advance(t/1e3,e/1e3):i._idleSpringIndices.push(i._activeSprings.indexOf(n));});this._idleSpringIndices.length>0;){var n=this._idleSpringIndices.pop();n>=0&&this._activeSprings.splice(n,1);}},e.loop=function(t){var e;-1===this._lastTimeMillis&&(this._lastTimeMillis=t-1);var i=t-this._lastTimeMillis;this._lastTimeMillis=t;var n=0,r=this.listeners.length;for(n=0;n<r;n++)(e=this.listeners[n]).onBeforeIntegrate&&e.onBeforeIntegrate(this);for(this.advance(t,i),0===this._activeSprings.length&&(this._isIdle=!0,this._lastTimeMillis=-1),n=0;n<r;n++)(e=this.listeners[n]).onAfterIntegrate&&e.onAfterIntegrate(this);this._isIdle||this.looper.run();},e.activateSpring=function(t){var e=this._springRegistry[t];-1===this._activeSprings.indexOf(e)&&this._activeSprings.push(e),this.getIsIdle()&&(this._isIdle=!1,this.looper.run());},t}(),O=new w,x=function(t){var e=t.springConfig,i=e.overshootClamping,n=t.getOnUpdateFunc,r=t.onAnimationEnd,s=t.onSpringActivate,a=O.createSpring(e.stiffness,e.damping);a.setOvershootClampingEnabled(!!i);var o={onSpringActivate:s,onSpringAtRest:function(){a.destroy(),r();},onSpringUpdate:n({spring:a,onAnimationEnd:r})};return a.addListener(o),a},U=function(t){var e=x(t);return e.setEndValue(1),e},V=function(t,e){if(void 0===e&&(e={}),t&&t.length){e.reverse&&t.reverse();var i,n="number"!=typeof(i=e.speed)?1.1:1+Math.min(Math.max(5*i,0),5),r=1/Math.max(Math.min(t.length,100),10),s=t.map(function(t,e){var i=t.getOnUpdateFunc;return t.getOnUpdateFunc=function(t){var a=i(t);return function(t){var i=t.getCurrentValue();(i=i<.01?0:i>.99?1:i)>=r&&s[e+1]&&s[e+1](Math.max(Math.min(i*n,1),0)),a(t);}},t}).map(function(t){var e=x(t);if(e)return e.setEndValue.bind(e)}).filter(Boolean);s[0]&&s[0](1);}},F=function(t){return [0,1,4,5,12,13].map(function(e){return t[e]})},P=function(t){return t.top<window.innerHeight&&t.bottom>0&&t.left<window.innerWidth&&t.right>0};function D(t){return JSON.parse(t.dataset.flipConfig||"{}")}var R=function(t,e){var i;return a(t,((i={})[e[0]]=e[1],i))},T=function(t,e){return r(e?document.querySelectorAll("["+d$1+'="'+e+'"]'):t.querySelectorAll("["+c$1+"]"))},M=function(t){return t.map(function(t){return [t,t.getBoundingClientRect()]})},L=function(n){var o=n.cachedOrderedFlipIds,p=void 0===o?[]:o,f=n.inProgressAnimations,h=void 0===f?{}:f,v=n.flippedElementPositionsBeforeUpdate,y=void 0===v?{}:v,_=n.flipCallbacks,S=void 0===_?{}:_,E=n.containerEl,A=n.applyTransformOrigin,C=n.spring,b=n.debug,I=n.portalKey,w=n.staggerConfig,O=void 0===w?{}:w,x=n.decisionData,j=void 0===x?{}:x,B=n.handleEnterUpdateDelete,N=n.onComplete,L=n.onStart;if(!window.matchMedia("(prefers-reduced-motion: reduce)").matches){var q,X=M(T((q={element:E,portalKey:I}).element,q.portalKey)).map(function(t){var e=t[0],i=t[1],n=window.getComputedStyle(e);return [e.dataset.flipId,{element:e,rect:i,opacity:parseFloat(n.opacity),transform:n.transform}]}).reduce(R,{}),Y=function(t){var e=t.containerEl,i=t.portalKey;return i?function(t){return function(e){return r(document.querySelectorAll("["+d$1+'="'+t+'"]'+e))}}(i):e?function(t){var e=Math.random().toFixed(5);return t.dataset.flipperId=e,function(i){return r(t.querySelectorAll('[data-flipper-id="'+e+'"] '+i))}}(e):function(){return []}}({containerEl:E,portalKey:I}),W=function(t){return function(e){return t("["+c$1+'="'+e+'"]')[0]}}(Y),K=function(t){return y[t]&&X[t]},H=Object.keys(y).concat(Object.keys(X)).filter(function(t){return !K(t)}),J={flipCallbacks:S,getElement:W,flippedElementPositionsBeforeUpdate:y,flippedElementPositionsAfterUpdate:X,inProgressAnimations:h,decisionData:j},z=function(t){var e,i=t.unflippedIds,n=t.flipCallbacks,r=t.getElement,s=t.flippedElementPositionsBeforeUpdate,a=t.flippedElementPositionsAfterUpdate,o=t.inProgressAnimations,l=t.decisionData,p=i.filter(function(t){return a[t]}).filter(function(t){return n[t]&&n[t].onAppear}),c=i.filter(function(t){return s[t]&&n[t]&&n[t].onExit}),u=new Promise(function(t){e=t;}),d=[],f=0,h=c.map(function(t,i){var r=s[t].domDataForExitAnimations,a=r.element,p=r.parent,c=r.childPosition,u=c.top,h=c.left,g=c.width,m=c.height;"static"===getComputedStyle(p).position&&(p.style.position="relative"),a.style.transform="matrix(1, 0, 0, 1, 0, 0)",a.style.position="absolute",a.style.top=u+"px",a.style.left=h+"px",a.style.height=m+"px",a.style.width=g+"px";var v=d.filter(function(t){return t[0]===p})[0];v||(v=[p,document.createDocumentFragment()],d.push(v)),v[1].appendChild(a),f+=1;var y=function(){try{p.removeChild(a);}catch(t){}finally{0==(f-=1)&&e();}};return o[t]={stop:y},function(){return n[t].onExit(a,i,y,l)}});return d.forEach(function(t){t[0].appendChild(t[1]);}),h.length||e(),{hideEnteringElements:function(){p.forEach(function(t){var e=r(t);e&&(e.style.opacity="0");});},animateEnteringElements:function(){p.forEach(function(t,e){var i=r(t);i&&n[t].onAppear(i,e,l);});},animateExitingElements:function(){return h.forEach(function(t){return t()}),u}}}(a({},J,{unflippedIds:H})),G=z.hideEnteringElements,Q=z.animateEnteringElements,Z=z.animateExitingElements,$=a({},J,{containerEl:E,flippedIds:p.filter(K),applyTransformOrigin:A,spring:C,debug:b,staggerConfig:O,scopedSelector:Y,onComplete:N});L&&L(E,j);var tt=function(n){var o,p=n.flippedIds,c=n.flipCallbacks,d=n.inProgressAnimations,f=n.flippedElementPositionsBeforeUpdate,h=n.flippedElementPositionsAfterUpdate,v=n.applyTransformOrigin,y=n.spring,_=n.getElement,S=n.debug,E=n.staggerConfig,A=void 0===E?{}:E,C=n.decisionData,b=void 0===C?{}:C,I=n.onComplete,w=n.containerEl,O=new Promise(function(t){o=t;});if(I&&O.then(function(){return I(w,b)}),!p.length)return function(){return o([]),O};var x=[],R=_(p[0]),T=R?R.ownerDocument.querySelector("body"):document.querySelector("body");s$1(p);var M=p.map(function(n){var s=f[n].rect,p=h[n].rect,_=f[n].opacity,S=h[n].opacity,E=p.width<1||p.height<1,A=h[n].element;if(!P(s)&&!P(p))return !1;if(!A)return !1;var C,I,w,O=D(A),U=(w=(I=void 0===(C={flipperSpring:y,flippedSpring:O.spring})?{}:C).flippedSpring,a({},g$1.noWobble,m$1(I.flipperSpring),m$1(w))),V=!0===O.stagger?"default":O.stagger,R={element:A,id:n,stagger:V,springConfig:U};if(c[n]&&c[n].shouldFlip&&!c[n].shouldFlip(b.previous,b.current))return !1;var k=Math.abs(s.left-p.left)+Math.abs(s.top-p.top),j=Math.abs(s.width-p.width)+Math.abs(s.height-p.height),B=Math.abs(S-_);if(0===s.height&&0===p.height||0===s.width&&0===p.width||k<.5&&j<.5&&B<.01)return !1;var N=parse(h[n].transform),L={matrix:N},q={matrix:[]},X=[N];O.translate&&(X.push(translateX(s.left-p.left)),X.push(translateY(s.top-p.top))),O.scale&&(X.push(scaleX(Math.max(s.width,1)/Math.max(p.width,1))),X.push(scaleY(Math.max(s.height,1)/Math.max(p.height,1)))),O.opacity&&(q.opacity=_,L.opacity=S);var Y=[];if(!c[n]||!c[n].shouldInvert||c[n].shouldInvert(b.previous,b.current)){var W=function(t,e){return r(t.querySelectorAll("["+u$1+'="'+e+'"]'))}(A,n);Y=W.map(function(t){return [t,D(t)]});}q.matrix=F(X.reduce(multiply)),L.matrix=F(L.matrix);var K,H=function(t){var i=t.element,n=t.invertedChildren,r=t.body;return function(t){var s=t.matrix,a=t.opacity,o=t.forceMinVals;if(e(a)&&(i.style.opacity=a+""),o&&(i.style.minHeight="1px",i.style.minWidth="1px"),s){var l=function(t){return "matrix("+t.join(", ")+")"}(s);i.style.transform=l,n&&function(t){var e=t.matrix,i=t.body;t.invertedChildren.forEach(function(t){var n=t[0],r=t[1];if(i.contains(n)){var s=e[0],a=e[3],o=e[5],l={translateX:0,translateY:0,scaleX:1,scaleY:1},p="";r.translate&&(l.translateX=-e[4]/s,l.translateY=-o/a,p+="translate("+l.translateX+"px, "+l.translateY+"px)"),r.scale&&(l.scaleX=1/s,l.scaleY=1/a,p+=" scale("+l.scaleX+", "+l.scaleY+")"),n.style.transform=p;}});}({invertedChildren:n,matrix:s,body:r});}}}({element:A,invertedChildren:Y,body:T});if(c[n]&&c[n].onComplete){var J=c[n].onComplete;K=function(){return J(A,b)};}var z=e(q.opacity)&&e(L.opacity)&&q.opacity!==L.opacity,G=!1;return a({},R,{stagger:V,springConfig:U,getOnUpdateFunc:function(t){var e=t.spring,i=t.onAnimationEnd;return d[n]={destroy:e.destroy.bind(e),onAnimationEnd:i},function(t){c[n]&&c[n].onSpringUpdate&&c[n].onSpringUpdate(t.getCurrentValue()),G||(G=!0,c[n]&&c[n].onStart&&c[n].onStart(A,b));var e=t.getCurrentValue();if(T.contains(A)){var i={matrix:[]};i.matrix=q.matrix.map(function(t,i){return l(t,L.matrix[i],e)}),z&&(i.opacity=l(q.opacity,L.opacity,e)),H(i);}else t.destroy();}},initializeFlip:function(){H({matrix:q.matrix,opacity:z?q.opacity:void 0,forceMinVals:E}),c[n]&&c[n].onStartImmediate&&c[n].onStartImmediate(A,b),O.transformOrigin?A.style.transformOrigin=O.transformOrigin:v&&(A.style.transformOrigin="0 0"),Y.forEach(function(t){var e=t[0],i=t[1];i.transformOrigin?e.style.transformOrigin=i.transformOrigin:v&&(e.style.transformOrigin="0 0");});},onAnimationEnd:function(t){delete d[n],i(K)&&K(),A.style.transform="",Y.forEach(function(t){t[0].style.transform="";}),E&&A&&(A.style.minHeight="",A.style.minWidth=""),t||(x.push(n),x.length>=M.length&&o(x));},delayUntil:O.delayUntil})}).filter(Boolean);if(M.forEach(function(t){return (0, t.initializeFlip)()}),S)return function(){};var k=M.filter(function(t){return t.delayUntil&&(e=t.delayUntil,M.filter(function(t){return t.id===e}).length);var e;}),j={},B={},N={};k.forEach(function(t){t.stagger?(N[t.stagger]=!0,B[t.delayUntil]?B[t.delayUntil].push(t.stagger):B[t.delayUntil]=[t.stagger]):j[t.delayUntil]?j[t.delayUntil].push(t):j[t.delayUntil]=[t];});var L=M.filter(function(t){return t.stagger}).reduce(function(t,e){return t[e.stagger]?t[e.stagger].push(e):t[e.stagger]=[e],t},{}),q=M.filter(function(t){return -1===k.indexOf(t)});return q.forEach(function(t){t.onSpringActivate=function(){j[t.id]&&j[t.id].forEach(U),B[t.id]&&Object.keys(B[t.id].reduce(function(t,e){var i;return a(t,((i={})[e]=!0,i))},{})).forEach(function(t){V(L[t],A[t]);});};}),function(){return M.length||o([]),q.filter(function(t){return !t.stagger}).forEach(U),Object.keys(L).forEach(function(t){N[t]||V(L[t],A[t]);}),O}}($);B?B({hideEnteringElements:G,animateEnteringElements:Q,animateExitingElements:Z,animateFlippedElements:tt}):(G(),Z().then(Q),tt());}},q=function(t){var e=t.element,i=t.flipCallbacks,n=void 0===i?{}:i,s=t.inProgressAnimations,o=void 0===s?{}:s,l=T(e,t.portalKey),p=r(e.querySelectorAll("["+u$1+"]")),c={},d=[],h={};l.filter(function(t){return n&&n[t.dataset.flipId]&&n[t.dataset.flipId].onExit}).forEach(function(t){var e=t.parentNode;if(t.closest){var i=t.closest("["+f$1+"]");i&&(e=i);}var n=d.findIndex(function(t){return t[0]===e});-1===n&&(d.push([e,e.getBoundingClientRect()]),n=d.length-1),c[t.dataset.flipId]=d[n][1],h[t.dataset.flipId]=e;});var g=M(l),m=g.map(function(t){var e=t[0],i=t[1],r={};if(n&&n[e.dataset.flipId]&&n[e.dataset.flipId].onExit){var s=c[e.dataset.flipId];a(r,{element:e,parent:h[e.dataset.flipId],childPosition:{top:i.top-s.top,left:i.left-s.left,width:i.width,height:i.height}});}return [e.dataset.flipId,{rect:i,opacity:parseFloat(window.getComputedStyle(e).opacity||"1"),domDataForExitAnimations:r}]}).reduce(R,{});return function(t,e){Object.keys(t).forEach(function(e){t[e].destroy&&t[e].destroy(),t[e].onAnimationEnd&&t[e].onAnimationEnd(!0),delete t[e];}),e.forEach(function(t){t.style.transform="",t.style.opacity="";});}(o,l.concat(p)),{flippedElementPositions:m,cachedOrderedFlipIds:g.map(function(t){return t[0].dataset.flipId})}};new w;
|
|
836
|
+
|
|
837
|
+
function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);}return e},s.apply(this,arguments)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function d(e,t){if(null==e)return {};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(i[r]=e[r]);return i}var f=/*#__PURE__*/createContext({}),u=/*#__PURE__*/createContext("portal"),h=/*#__PURE__*/function(r){var n,o;function p(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return (e=r.call.apply(r,[this].concat(n))||this).inProgressAnimations={},e.flipCallbacks={},e.el=void 0,e}o=r,(n=p).prototype=Object.create(o.prototype),n.prototype.constructor=n,c(n,o);var l=p.prototype;return l.getSnapshotBeforeUpdate=function(t){return t.flipKey!==this.props.flipKey&&this.el?q({element:this.el,flipCallbacks:this.flipCallbacks,inProgressAnimations:this.inProgressAnimations,portalKey:this.props.portalKey}):null},l.componentDidUpdate=function(e,r,n){this.props.flipKey!==e.flipKey&&this.el&&L({flippedElementPositionsBeforeUpdate:n.flippedElementPositions,cachedOrderedFlipIds:n.cachedOrderedFlipIds,containerEl:this.el,inProgressAnimations:this.inProgressAnimations,flipCallbacks:this.flipCallbacks,applyTransformOrigin:this.props.applyTransformOrigin,spring:this.props.spring,debug:this.props.debug,portalKey:this.props.portalKey,staggerConfig:this.props.staggerConfig,handleEnterUpdateDelete:this.props.handleEnterUpdateDelete,decisionData:{previous:e.decisionData,current:this.props.decisionData},onComplete:this.props.onComplete,onStart:this.props.onStart});},l.render=function(){var e=this,t=this.props,r=t.portalKey,n=/*#__PURE__*/React.createElement(f.Provider,{value:this.flipCallbacks},/*#__PURE__*/React.createElement(t.element,{className:t.className,ref:function(t){return e.el=t}},this.props.children));return r&&(n=/*#__PURE__*/React.createElement(u.Provider,{value:r},n)),n},p}(Component);h.defaultProps={applyTransformOrigin:!0,element:"div"};var m=["children","flipId","inverseFlipId","portalKey"],y=["children","flipId","shouldFlip","shouldInvert","onAppear","onStart","onStartImmediate","onComplete","onExit","onSpringUpdate"],g=function(e){var t,i=e.children,o=e.flipId,p$1=e.inverseFlipId,s=e.portalKey,c=d(e,m),f=i,u=function(e){return "function"==typeof e}(f);if(!u)try{f=Children.only(i);}catch(e){throw new Error("Each Flipped component must wrap a single child")}c.scale||c.translate||c.opacity||p.assign(c,{translate:!0,scale:!0,opacity:!0});var h=((t={})[h$1.DATA_FLIP_CONFIG]=JSON.stringify(c),t);return void 0!==o?h[h$1.DATA_FLIP_ID]=String(o):p$1&&(h[h$1.DATA_INVERSE_FLIP_ID]=String(p$1)),void 0!==s&&(h[h$1.DATA_PORTAL_KEY]=s),u?f(h):/*#__PURE__*/cloneElement(f,h)},v=function(e){var t=e.children,n=e.flipId,o=e.shouldFlip,p$1=e.shouldInvert,l=e.onAppear,a=e.onStart,c=e.onStartImmediate,h=e.onComplete,m=e.onExit,v=e.onSpringUpdate,I=d(e,y);return t?I.inverseFlipId?/*#__PURE__*/React.createElement(g,s({},I),t):/*#__PURE__*/React.createElement(u.Consumer,null,function(e){return React.createElement(f.Consumer,null,function(d){return p.isObject(d)&&n&&(d[n]={shouldFlip:o,shouldInvert:p$1,onAppear:l,onStart:a,onStartImmediate:c,onComplete:h,onExit:m,onSpringUpdate:v}),/*#__PURE__*/React.createElement(g,s({flipId:n},I,{portalKey:e}),t)})}):null};v.displayName="Flipped";
|
|
838
|
+
|
|
615
839
|
const VCDisplayCardCategoryType = ({
|
|
616
840
|
categoryType = LCCategoryEnum.achievement
|
|
617
841
|
}) => {
|
|
@@ -621,6 +845,28 @@ const VCDisplayCardCategoryType = ({
|
|
|
621
845
|
}, categoryType);
|
|
622
846
|
};
|
|
623
847
|
|
|
848
|
+
const VCDisplayCardSkillsCount = ({ skills, onClick }) => {
|
|
849
|
+
const skillsCount = getTotalCountOfSkills(skills);
|
|
850
|
+
if (skillsCount === 0)
|
|
851
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null);
|
|
852
|
+
const skillsMap = categorizeSkills(skills);
|
|
853
|
+
const totalSkills = Object.values(skillsMap).reduce((total2, category) => total2 + (category == null ? void 0 : category.length), 0);
|
|
854
|
+
const totalSubskills = Object.values(skillsMap).reduce((total2, category) => total2 + ((category == null ? void 0 : category.totalSubskillsCount) || 0), 0);
|
|
855
|
+
const total = totalSkills + totalSubskills;
|
|
856
|
+
const text = skillsCount === 1 ? "Skill" : "Skills";
|
|
857
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
858
|
+
className: "flex items-center justify-center mt-8 cursor-pointer px-4 py-2 bg-white rounded-[20px] shadow-bottom",
|
|
859
|
+
onClick
|
|
860
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
861
|
+
className: "text-violet-500 text-xl flex items-center justify-center tracking-[0.75px] font-poppins font-semibold"
|
|
862
|
+
}, "+", total, " ", text, " ", /* @__PURE__ */ React.createElement("div", {
|
|
863
|
+
className: "bg-violet-500 rounded-full flex items-center justify-center ml-2 h-[30px] w-[30px] p-1"
|
|
864
|
+
}, /* @__PURE__ */ React.createElement(PuzzlePiece, {
|
|
865
|
+
className: "text-white",
|
|
866
|
+
fill: "#fff"
|
|
867
|
+
}))));
|
|
868
|
+
};
|
|
869
|
+
|
|
624
870
|
const VERIFIER_STATES = {
|
|
625
871
|
selfVerified: "Self Verified",
|
|
626
872
|
trustedVerifier: "Trusted Verifier",
|
|
@@ -666,7 +912,10 @@ const VCIDDisplayFrontFace = ({
|
|
|
666
912
|
}), " ID"), /* @__PURE__ */ React.createElement("div", {
|
|
667
913
|
className: "w-full relative"
|
|
668
914
|
}, !hideQRCode && /* @__PURE__ */ React.createElement("button", {
|
|
669
|
-
onClick: () =>
|
|
915
|
+
onClick: (e) => {
|
|
916
|
+
e.stopPropagation();
|
|
917
|
+
qrCodeOnClick == null ? void 0 : qrCodeOnClick();
|
|
918
|
+
},
|
|
670
919
|
className: "text-grayscale-900 bg-white rounded-full p-[10px] absolute top-[-10px] right-[45%]"
|
|
671
920
|
}, /* @__PURE__ */ React.createElement(QRCodeIcon, {
|
|
672
921
|
className: "text-grayscale-900 "
|
|
@@ -754,7 +1003,9 @@ const VCIDDisplayCard = ({
|
|
|
754
1003
|
className: `vc-display-card font-mouse flex flex-col items-center border-solid border-white rounded-[30px] z-10 max-w-[400px] relative bg-white shadow-3xl ${isFront ? "" : "min-h-[800px]"}`
|
|
755
1004
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
756
1005
|
className: "relative vc-card-content-container flex flex-col items-center grow min-h-0 w-full rounded-t-[30px] rounded-b-[30px] overflow-hidden",
|
|
757
|
-
style: backgroundStyle
|
|
1006
|
+
style: backgroundStyle,
|
|
1007
|
+
role: "button",
|
|
1008
|
+
onClick: () => setIsFront(!isFront)
|
|
758
1009
|
}, /* @__PURE__ */ React.createElement(v, {
|
|
759
1010
|
flipId: "scroll-container"
|
|
760
1011
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
@@ -928,7 +1179,9 @@ const VCDisplayCard2 = ({
|
|
|
928
1179
|
}, /* @__PURE__ */ React.createElement(v, {
|
|
929
1180
|
flipId: "card"
|
|
930
1181
|
}, /* @__PURE__ */ React.createElement("section", {
|
|
931
|
-
className: "vc-display-card font-mouse flex flex-col items-center border-solid border-[5px] border-white rounded-[30px] z-10 min-h-[800px] max-w-[400px] relative bg-white shadow-3xl"
|
|
1182
|
+
className: "vc-display-card font-mouse flex flex-col items-center border-solid border-[5px] border-white rounded-[30px] z-10 min-h-[800px] max-w-[400px] relative bg-white shadow-3xl",
|
|
1183
|
+
role: "button",
|
|
1184
|
+
onClick: () => setIsFront(!isFront)
|
|
932
1185
|
}, /* @__PURE__ */ React.createElement(RibbonEnd, {
|
|
933
1186
|
side: "left",
|
|
934
1187
|
className: "absolute left-[-30px] top-[50px] z-0",
|
|
@@ -962,6 +1215,7 @@ const VCDisplayCard2 = ({
|
|
|
962
1215
|
}, isFront && /* @__PURE__ */ React.createElement(v, {
|
|
963
1216
|
flipId: "face"
|
|
964
1217
|
}, /* @__PURE__ */ React.createElement(VC2FrontFaceInfo, {
|
|
1218
|
+
credential,
|
|
965
1219
|
issuee,
|
|
966
1220
|
subjectDID,
|
|
967
1221
|
issuer,
|
|
@@ -971,7 +1225,8 @@ const VCDisplayCard2 = ({
|
|
|
971
1225
|
customBodyCardComponent,
|
|
972
1226
|
customThumbComponent,
|
|
973
1227
|
createdAt: createdAt != null ? createdAt : "",
|
|
974
|
-
imageUrl
|
|
1228
|
+
imageUrl,
|
|
1229
|
+
trustedAppRegistry
|
|
975
1230
|
})), !isFront && /* @__PURE__ */ React.createElement(v, {
|
|
976
1231
|
flipId: "face"
|
|
977
1232
|
}, /* @__PURE__ */ React.createElement(VC2BackFace, {
|
|
@@ -1027,5 +1282,5 @@ const VCDisplayCard2 = ({
|
|
|
1027
1282
|
}, (_g = bottomRightIcon == null ? void 0 : bottomRightIcon.image) != null ? _g : /* @__PURE__ */ React.createElement(AwardRibbon, null)))))));
|
|
1028
1283
|
};
|
|
1029
1284
|
|
|
1030
|
-
export { VCDisplayCard2 as V,
|
|
1031
|
-
//# sourceMappingURL=VCDisplayCard2-
|
|
1285
|
+
export { VCDisplayCard2 as V, VCDisplayCardSkillsCount as a, VCIDDisplayCard as b };
|
|
1286
|
+
//# sourceMappingURL=VCDisplayCard2-0b6b741f.js.map
|