@learncard/react 2.7.9 → 2.7.11

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.
Files changed (229) hide show
  1. package/dist/cjs/{AchievementCard-27fc10b5.js → AchievementCard-2ad4cb64.js} +5 -5
  2. package/dist/cjs/{AchievementCard-27fc10b5.js.map → AchievementCard-2ad4cb64.js.map} +1 -1
  3. package/dist/cjs/{BoostGenericCard-c7b6a8ac.js → BoostGenericCard-e540e459.js} +8 -6
  4. package/dist/cjs/{BoostGenericCard-c7b6a8ac.js.map → BoostGenericCard-e540e459.js.map} +1 -1
  5. package/dist/cjs/{BoostSmallCard-2a588dc6.js → BoostSmallCard-9dc75a95.js} +4 -4
  6. package/dist/cjs/{BoostSmallCard-2a588dc6.js.map → BoostSmallCard-9dc75a95.js.map} +1 -1
  7. package/dist/cjs/CertificateDisplayCard-96545851.js +824 -0
  8. package/dist/cjs/CertificateDisplayCard-96545851.js.map +1 -0
  9. package/dist/cjs/{CircleCheckButton-abff235d.js → CircleCheckButton-82d47ee2.js} +2 -2
  10. package/dist/cjs/{CircleCheckButton-abff235d.js.map → CircleCheckButton-82d47ee2.js.map} +1 -1
  11. package/dist/cjs/{CircleIcon-3d6a536a.js → CircleIcon-617c38fa.js} +3 -3
  12. package/dist/cjs/{CircleIcon-3d6a536a.js.map → CircleIcon-617c38fa.js.map} +1 -1
  13. package/dist/cjs/{CourseVerticalCard-2958d043.js → CourseVerticalCard-5a73ab74.js} +4 -4
  14. package/dist/cjs/{CourseVerticalCard-2958d043.js.map → CourseVerticalCard-5a73ab74.js.map} +1 -1
  15. package/dist/cjs/{GenericCard-6ac2620f.js → GenericCard-46248807.js} +4 -4
  16. package/dist/cjs/{GenericCard-6ac2620f.js.map → GenericCard-46248807.js.map} +1 -1
  17. package/dist/cjs/{JobListCard-cdb1aa2f.js → JobListCard-458c8585.js} +3 -3
  18. package/dist/cjs/{JobListCard-cdb1aa2f.js.map → JobListCard-458c8585.js.map} +1 -1
  19. package/dist/cjs/{LearnPill-64fbabc8.js → LearnPill-21b47475.js} +3 -3
  20. package/dist/cjs/{LearnPill-64fbabc8.js.map → LearnPill-21b47475.js.map} +1 -1
  21. package/dist/cjs/MeritBadgeDisplayCard-d153be39.js +826 -0
  22. package/dist/cjs/MeritBadgeDisplayCard-d153be39.js.map +1 -0
  23. package/dist/cjs/MeritBadgeSkillsCount-bfd5681a.js +34 -0
  24. package/dist/cjs/MeritBadgeSkillsCount-bfd5681a.js.map +1 -0
  25. package/dist/cjs/{RoundedPill-4bce9068.js → RoundedPill-bda7c067.js} +2 -2
  26. package/dist/cjs/{RoundedPill-4bce9068.js.map → RoundedPill-bda7c067.js.map} +1 -1
  27. package/dist/cjs/{SkillTabCard-2be1570e.js → SkillTabCard-d8f3f5d4.js} +4 -4
  28. package/dist/cjs/{SkillTabCard-2be1570e.js.map → SkillTabCard-d8f3f5d4.js.map} +1 -1
  29. package/dist/cjs/{VCCard-a4aca9ab.js → VCCard-85e20a61.js} +3 -3
  30. package/dist/cjs/{VCCard-a4aca9ab.js.map → VCCard-85e20a61.js.map} +1 -1
  31. package/dist/cjs/{VCDisplayBackFace-dc2d4cd8.js → VCDisplayBackFace-bf564112.js} +2 -2
  32. package/dist/cjs/{VCDisplayBackFace-dc2d4cd8.js.map → VCDisplayBackFace-bf564112.js.map} +1 -1
  33. package/dist/cjs/{VCDisplayCard-738d9e74.js → VCDisplayCard-a2dbebac.js} +3 -3
  34. package/dist/cjs/{VCDisplayCard-738d9e74.js.map → VCDisplayCard-a2dbebac.js.map} +1 -1
  35. package/dist/cjs/{VCDisplayCard2-0960b02d.js → VCDisplayCard2-e779aa25.js} +57 -30
  36. package/dist/cjs/VCDisplayCard2-e779aa25.js.map +1 -0
  37. package/dist/cjs/{CertificateDisplayCard-538033fd.js → VerifierStateBadgeAndText-fd0bd814.js} +10 -818
  38. package/dist/cjs/VerifierStateBadgeAndText-fd0bd814.js.map +1 -0
  39. package/dist/cjs/{constants-20986f04.js → constants-737d10f6.js} +7 -6
  40. package/dist/cjs/constants-737d10f6.js.map +1 -0
  41. package/dist/cjs/{credential.helpers-07221424.js → credential.helpers-c1f43597.js} +31 -2
  42. package/dist/cjs/credential.helpers-c1f43597.js.map +1 -0
  43. package/dist/cjs/{icons-9878f84c.js → icons-0404f605.js} +2 -2
  44. package/dist/cjs/{icons-9878f84c.js.map → icons-0404f605.js.map} +1 -1
  45. package/dist/cjs/{index-7d94d5ac.js → index-5488badc.js} +2 -1
  46. package/dist/cjs/index-5488badc.js.map +1 -0
  47. package/dist/cjs/{index-503d0d98.js → index-7cd11826.js} +2 -2
  48. package/dist/cjs/{index-503d0d98.js.map → index-7cd11826.js.map} +1 -1
  49. package/dist/cjs/index.js +30 -23
  50. package/dist/cjs/index.js.map +1 -1
  51. package/dist/cjs/index10.js +5 -5
  52. package/dist/cjs/index12.js +6 -6
  53. package/dist/cjs/index13.js +30 -23
  54. package/dist/cjs/index13.js.map +1 -1
  55. package/dist/cjs/index15.js +3 -3
  56. package/dist/cjs/index18.js +3 -3
  57. package/dist/cjs/index2.js +6 -6
  58. package/dist/cjs/index21.js +26 -3
  59. package/dist/cjs/index21.js.map +1 -1
  60. package/dist/cjs/index22.js +3 -10
  61. package/dist/cjs/index22.js.map +1 -1
  62. package/dist/cjs/index23.js +5 -7
  63. package/dist/cjs/index23.js.map +1 -1
  64. package/dist/cjs/index24.js +9 -3
  65. package/dist/cjs/index24.js.map +1 -1
  66. package/dist/cjs/index25.js +3 -5
  67. package/dist/cjs/index25.js.map +1 -1
  68. package/dist/cjs/index26.js +8 -3
  69. package/dist/cjs/index26.js.map +1 -1
  70. package/dist/cjs/index27.js +3 -28
  71. package/dist/cjs/index27.js.map +1 -1
  72. package/dist/cjs/index28.js +5 -31
  73. package/dist/cjs/index28.js.map +1 -1
  74. package/dist/cjs/index29.js +54 -3
  75. package/dist/cjs/index29.js.map +1 -1
  76. package/dist/cjs/index3.js +6 -6
  77. package/dist/cjs/index30.js +3 -3
  78. package/dist/cjs/index31.js +3 -3
  79. package/dist/cjs/index32.js +3 -29
  80. package/dist/cjs/index32.js.map +1 -1
  81. package/dist/cjs/index33.js +29 -3
  82. package/dist/cjs/index33.js.map +1 -1
  83. package/dist/cjs/index34.js +3 -3
  84. package/dist/cjs/index35.js +3 -19
  85. package/dist/cjs/index35.js.map +1 -1
  86. package/dist/cjs/index36.js +19 -40
  87. package/dist/cjs/index36.js.map +1 -1
  88. package/dist/cjs/index37.js +34 -8
  89. package/dist/cjs/index37.js.map +1 -1
  90. package/dist/cjs/index38.js +8 -12
  91. package/dist/cjs/index38.js.map +1 -1
  92. package/dist/cjs/index39.js +15 -27
  93. package/dist/cjs/index39.js.map +1 -1
  94. package/dist/cjs/index4.js +6 -6
  95. package/dist/cjs/index40.js +36 -2
  96. package/dist/cjs/index40.js.map +1 -1
  97. package/dist/cjs/index41.js +3 -7
  98. package/dist/cjs/index41.js.map +1 -1
  99. package/dist/cjs/index42.js +4 -6
  100. package/dist/cjs/index42.js.map +1 -1
  101. package/dist/cjs/index43.js +6 -6
  102. package/dist/cjs/index44.js +15 -0
  103. package/dist/cjs/index44.js.map +1 -0
  104. package/dist/cjs/index6.js +6 -5
  105. package/dist/cjs/index6.js.map +1 -1
  106. package/dist/cjs/index7.js +4 -4
  107. package/dist/cjs/index8.js +3 -3
  108. package/dist/esm/{AchievementCard-36de6ca1.js → AchievementCard-1d5d1b61.js} +5 -5
  109. package/dist/esm/{AchievementCard-36de6ca1.js.map → AchievementCard-1d5d1b61.js.map} +1 -1
  110. package/dist/esm/{BoostGenericCard-563c1b3e.js → BoostGenericCard-de8e2a84.js} +8 -6
  111. package/dist/esm/{BoostGenericCard-563c1b3e.js.map → BoostGenericCard-de8e2a84.js.map} +1 -1
  112. package/dist/esm/{BoostSmallCard-675c85e8.js → BoostSmallCard-902844fc.js} +4 -4
  113. package/dist/esm/{BoostSmallCard-675c85e8.js.map → BoostSmallCard-902844fc.js.map} +1 -1
  114. package/dist/esm/CertificateDisplayCard-0db06790.js +812 -0
  115. package/dist/esm/CertificateDisplayCard-0db06790.js.map +1 -0
  116. package/dist/esm/{CircleCheckButton-aba0f804.js → CircleCheckButton-5a97f071.js} +2 -2
  117. package/dist/esm/{CircleCheckButton-aba0f804.js.map → CircleCheckButton-5a97f071.js.map} +1 -1
  118. package/dist/esm/{CircleIcon-b0eb81d2.js → CircleIcon-4200733b.js} +3 -3
  119. package/dist/esm/{CircleIcon-b0eb81d2.js.map → CircleIcon-4200733b.js.map} +1 -1
  120. package/dist/esm/{CourseVerticalCard-da219627.js → CourseVerticalCard-6b11b2a1.js} +4 -4
  121. package/dist/esm/{CourseVerticalCard-da219627.js.map → CourseVerticalCard-6b11b2a1.js.map} +1 -1
  122. package/dist/esm/{GenericCard-9b48aec8.js → GenericCard-7b21d3e2.js} +4 -4
  123. package/dist/esm/{GenericCard-9b48aec8.js.map → GenericCard-7b21d3e2.js.map} +1 -1
  124. package/dist/esm/{JobListCard-afc060d7.js → JobListCard-1299ff04.js} +3 -3
  125. package/dist/esm/{JobListCard-afc060d7.js.map → JobListCard-1299ff04.js.map} +1 -1
  126. package/dist/esm/{LearnPill-ebb251f6.js → LearnPill-b8885ed1.js} +3 -3
  127. package/dist/esm/{LearnPill-ebb251f6.js.map → LearnPill-b8885ed1.js.map} +1 -1
  128. package/dist/esm/MeritBadgeDisplayCard-3ac56267.js +816 -0
  129. package/dist/esm/MeritBadgeDisplayCard-3ac56267.js.map +1 -0
  130. package/dist/esm/MeritBadgeSkillsCount-f2b1ab14.js +28 -0
  131. package/dist/esm/MeritBadgeSkillsCount-f2b1ab14.js.map +1 -0
  132. package/dist/esm/{RoundedPill-3f27d4ac.js → RoundedPill-6a6e8aaf.js} +2 -2
  133. package/dist/esm/{RoundedPill-3f27d4ac.js.map → RoundedPill-6a6e8aaf.js.map} +1 -1
  134. package/dist/esm/{SkillTabCard-3670457e.js → SkillTabCard-8177895b.js} +4 -4
  135. package/dist/esm/{SkillTabCard-3670457e.js.map → SkillTabCard-8177895b.js.map} +1 -1
  136. package/dist/esm/{VCCard-717446a2.js → VCCard-1ae6ae1b.js} +3 -3
  137. package/dist/esm/{VCCard-717446a2.js.map → VCCard-1ae6ae1b.js.map} +1 -1
  138. package/dist/esm/{VCDisplayBackFace-d7597ab2.js → VCDisplayBackFace-f05a047b.js} +2 -2
  139. package/dist/esm/{VCDisplayBackFace-d7597ab2.js.map → VCDisplayBackFace-f05a047b.js.map} +1 -1
  140. package/dist/esm/{VCDisplayCard-0593b168.js → VCDisplayCard-3e11b093.js} +3 -3
  141. package/dist/esm/{VCDisplayCard-0593b168.js.map → VCDisplayCard-3e11b093.js.map} +1 -1
  142. package/dist/esm/{VCDisplayCard2-efbf2972.js → VCDisplayCard2-e8a1f9f5.js} +31 -4
  143. package/dist/esm/{VCDisplayCard2-efbf2972.js.map → VCDisplayCard2-e8a1f9f5.js.map} +1 -1
  144. package/dist/esm/{CertificateDisplayCard-c1c15c0d.js → VerifierStateBadgeAndText-86214479.js} +7 -813
  145. package/dist/esm/VerifierStateBadgeAndText-86214479.js.map +1 -0
  146. package/dist/esm/{constants-e1c856cf.js → constants-a7601fa8.js} +7 -6
  147. package/dist/esm/constants-a7601fa8.js.map +1 -0
  148. package/dist/esm/{credential.helpers-e8fe0001.js → credential.helpers-3d9244b6.js} +31 -2
  149. package/dist/esm/credential.helpers-3d9244b6.js.map +1 -0
  150. package/dist/esm/{icons-6ed3416f.js → icons-03afd795.js} +2 -2
  151. package/dist/esm/{icons-6ed3416f.js.map → icons-03afd795.js.map} +1 -1
  152. package/dist/esm/{index-43f63ea7.js → index-28917993.js} +2 -1
  153. package/dist/esm/index-28917993.js.map +1 -0
  154. package/dist/esm/{index-09573aa0.js → index-5d5219f7.js} +2 -2
  155. package/dist/esm/{index-09573aa0.js.map → index-5d5219f7.js.map} +1 -1
  156. package/dist/esm/index.js +24 -21
  157. package/dist/esm/index.js.map +1 -1
  158. package/dist/esm/index10.js +5 -5
  159. package/dist/esm/index12.js +6 -6
  160. package/dist/esm/index13.js +24 -21
  161. package/dist/esm/index13.js.map +1 -1
  162. package/dist/esm/index15.js +3 -3
  163. package/dist/esm/index18.js +3 -3
  164. package/dist/esm/index2.js +6 -6
  165. package/dist/esm/index21.js +22 -2
  166. package/dist/esm/index21.js.map +1 -1
  167. package/dist/esm/index22.js +2 -8
  168. package/dist/esm/index22.js.map +1 -1
  169. package/dist/esm/index23.js +3 -6
  170. package/dist/esm/index23.js.map +1 -1
  171. package/dist/esm/index24.js +8 -2
  172. package/dist/esm/index24.js.map +1 -1
  173. package/dist/esm/index25.js +2 -3
  174. package/dist/esm/index25.js.map +1 -1
  175. package/dist/esm/index26.js +6 -2
  176. package/dist/esm/index26.js.map +1 -1
  177. package/dist/esm/index27.js +2 -26
  178. package/dist/esm/index27.js.map +1 -1
  179. package/dist/esm/index28.js +3 -26
  180. package/dist/esm/index28.js.map +1 -1
  181. package/dist/esm/index29.js +49 -2
  182. package/dist/esm/index29.js.map +1 -1
  183. package/dist/esm/index3.js +6 -6
  184. package/dist/esm/index30.js +2 -1
  185. package/dist/esm/index30.js.map +1 -1
  186. package/dist/esm/index31.js +1 -2
  187. package/dist/esm/index31.js.map +1 -1
  188. package/dist/esm/index32.js +2 -28
  189. package/dist/esm/index32.js.map +1 -1
  190. package/dist/esm/index33.js +28 -2
  191. package/dist/esm/index33.js.map +1 -1
  192. package/dist/esm/index34.js +2 -2
  193. package/dist/esm/index35.js +2 -7
  194. package/dist/esm/index35.js.map +1 -1
  195. package/dist/esm/index36.js +7 -39
  196. package/dist/esm/index36.js.map +1 -1
  197. package/dist/esm/index37.js +33 -7
  198. package/dist/esm/index37.js.map +1 -1
  199. package/dist/esm/index38.js +7 -11
  200. package/dist/esm/index38.js.map +1 -1
  201. package/dist/esm/index39.js +14 -23
  202. package/dist/esm/index39.js.map +1 -1
  203. package/dist/esm/index4.js +6 -6
  204. package/dist/esm/index40.js +28 -2
  205. package/dist/esm/index40.js.map +1 -1
  206. package/dist/esm/index41.js +3 -2
  207. package/dist/esm/index41.js.map +1 -1
  208. package/dist/esm/index42.js +3 -3
  209. package/dist/esm/index43.js +3 -5
  210. package/dist/esm/index43.js.map +1 -1
  211. package/dist/esm/index44.js +7 -0
  212. package/dist/esm/index44.js.map +1 -0
  213. package/dist/esm/index6.js +5 -4
  214. package/dist/esm/index6.js.map +1 -1
  215. package/dist/esm/index7.js +4 -4
  216. package/dist/esm/index8.js +3 -3
  217. package/dist/index.d.ts +70 -2
  218. package/dist/main.css +1 -1
  219. package/dist/main.js +1 -1
  220. package/package.json +2 -2
  221. package/dist/cjs/CertificateDisplayCard-538033fd.js.map +0 -1
  222. package/dist/cjs/VCDisplayCard2-0960b02d.js.map +0 -1
  223. package/dist/cjs/constants-20986f04.js.map +0 -1
  224. package/dist/cjs/credential.helpers-07221424.js.map +0 -1
  225. package/dist/cjs/index-7d94d5ac.js.map +0 -1
  226. package/dist/esm/CertificateDisplayCard-c1c15c0d.js.map +0 -1
  227. package/dist/esm/constants-e1c856cf.js.map +0 -1
  228. package/dist/esm/credential.helpers-e8fe0001.js.map +0 -1
  229. package/dist/esm/index-43f63ea7.js.map +0 -1
@@ -0,0 +1,816 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import { I as InfoIcon, g as getBaseUrl, a as VideoIcon, C as Camera, G as GenericDocumentIcon, L as LinkIcon, p as prettyBytes, c as capitalize, X, E as ExclamationPoint, A as AcuteCheckmark, b as LeftArrow, d as SkillsBox, R as RoundedCorner, e as IssuerSeal, V as VERIFIER_STATES, h as Line, f as Smiley, i as VerifierStateBadgeAndText, F as FatArrow } from './VerifierStateBadgeAndText-86214479.js';
3
+ import { a as getColorForVerificationStatus, b as getInfoFromCredential, d as getCategoryDarkColor, e as getCategoryLightColor, f as getCategoryIcon, h as getNameFromProfile, i as getImageFromProfile } from './credential.helpers-3d9244b6.js';
4
+ import { a as LCCategoryEnum } from './index-28917993.js';
5
+ import { V as VerificationStatusEnum } from './types.esm-099d2f24.js';
6
+ import CaretRightFilled from './CaretRightFilled.svg';
7
+ import { L as Lightbox } from './Lightbox-a1aab9ea.js';
8
+ import ThreeDots from './DotsThreeOutline.svg';
9
+
10
+ const AlignmentRow = ({
11
+ url,
12
+ name,
13
+ framework
14
+ }) => {
15
+ return /* @__PURE__ */ React.createElement("div", {
16
+ className: "flex flex-col gap-[5px] font-poppins text-[12px] bg-[#DBEAFE] rounded-[15px] border-b-[1px] border-grayscale-200 border-solid w-full p-[10px] last:border-0"
17
+ }, /* @__PURE__ */ React.createElement("h1", {
18
+ className: "text-blue-800 font-semibold uppercase"
19
+ }, framework), /* @__PURE__ */ React.createElement("button", {
20
+ className: "flex",
21
+ onClick: () => window.open(url)
22
+ }, /* @__PURE__ */ React.createElement("span", {
23
+ className: "text-left"
24
+ }, name), /* @__PURE__ */ React.createElement("img", {
25
+ className: "w-[20px] self-end",
26
+ src: CaretRightFilled,
27
+ alt: "right-caret"
28
+ })));
29
+ };
30
+
31
+ const InfoBox = ({ text, handleClose, backgroundColor = "#6366F1" }) => {
32
+ const bgColorWithOpacity = `${backgroundColor}1F`;
33
+ return /* @__PURE__ */ React.createElement("div", {
34
+ className: "info-box p-[10px] rounded-[10px] w-full font-poppins text-[12px] leading[18px]",
35
+ style: { backgroundColor: bgColorWithOpacity }
36
+ }, text, " ", /* @__PURE__ */ React.createElement("button", {
37
+ onClick: (e) => {
38
+ e.stopPropagation();
39
+ handleClose();
40
+ },
41
+ className: "text-indigo-500 font-[700] select-none"
42
+ }, "Close"));
43
+ };
44
+
45
+ const AlignmentsBox = ({ alignment, style }) => {
46
+ const [showInfo, setShowInfo] = useState(false);
47
+ const alignmentText = `
48
+ Alignments in your Open Badge credential link your achievement to established frameworks, standards, or competencies.
49
+ Each alignment shows how your boost directly relates to skills, knowledge areas, and professional standards that are recognized in your field.
50
+ `;
51
+ const alignments = Array.isArray(alignment) ? alignment.map((object, index) => /* @__PURE__ */ React.createElement(AlignmentRow, {
52
+ key: index,
53
+ url: object.targetUrl,
54
+ name: object.targetName,
55
+ framework: object.targetFramework
56
+ })) : alignment && /* @__PURE__ */ React.createElement(AlignmentRow, {
57
+ url: alignment.targetUrl,
58
+ name: alignment.targetName,
59
+ framework: alignment.targetFramework
60
+ });
61
+ return /* @__PURE__ */ React.createElement("div", {
62
+ className: "bg-white flex flex-col items-start gap-[10px] rounded-[20px] shadow-bottom p-[15px] w-full"
63
+ }, /* @__PURE__ */ React.createElement("div", {
64
+ className: "flex w-full items-center"
65
+ }, /* @__PURE__ */ React.createElement("h3", {
66
+ className: style === "MeritBadge" ? "text-[17px] text-grayscale-900 font-poppins" : "text-[22px] font-mouse"
67
+ }, "Alignments"), /* @__PURE__ */ React.createElement("button", {
68
+ className: "ml-auto",
69
+ onClick: () => setShowInfo(!showInfo)
70
+ }, /* @__PURE__ */ React.createElement(InfoIcon, {
71
+ color: showInfo ? "#6366F1" : void 0
72
+ }))), showInfo && /* @__PURE__ */ React.createElement(InfoBox, {
73
+ text: alignmentText,
74
+ handleClose: () => setShowInfo(false)
75
+ }), alignments);
76
+ };
77
+
78
+ var __async = (__this, __arguments, generator) => {
79
+ return new Promise((resolve, reject) => {
80
+ var fulfilled = (value) => {
81
+ try {
82
+ step(generator.next(value));
83
+ } catch (e) {
84
+ reject(e);
85
+ }
86
+ };
87
+ var rejected = (value) => {
88
+ try {
89
+ step(generator.throw(value));
90
+ } catch (e) {
91
+ reject(e);
92
+ }
93
+ };
94
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
95
+ step((generator = generator.apply(__this, __arguments)).next());
96
+ });
97
+ };
98
+ const defaultGetFileMetadata = (url) => __async(undefined, null, function* () {
99
+ var _a;
100
+ console.log({ url });
101
+ const isFilestack = url.includes("filestack");
102
+ if (!isFilestack)
103
+ return;
104
+ const urlParams = (_a = url.split(".com/")[1]) == null ? void 0 : _a.split("/");
105
+ if (!urlParams)
106
+ return;
107
+ const handle = urlParams[urlParams.length - 1];
108
+ let fetchFailed = false;
109
+ const data = yield fetch(`https://cdn.filestackcontent.com/${handle}/metadata`).then((res) => res.json()).catch(() => fetchFailed = true);
110
+ if (fetchFailed)
111
+ return;
112
+ const fileExtension = data.filename.split(".")[1];
113
+ return {
114
+ fileExtension,
115
+ sizeInBytes: data.size,
116
+ numberOfPages: void 0
117
+ };
118
+ });
119
+ const isYoutubeUrl = (url) => {
120
+ const youtubeUrl = new URL(url);
121
+ return youtubeUrl.hostname === "www.youtube.com";
122
+ };
123
+ const getYoutubeVideoId = (url) => {
124
+ const regex = /(?:\?v=|\.com\/embed\/)([^&]+)/;
125
+ const match = url.match(regex);
126
+ return match ? match[1] : "";
127
+ };
128
+ const getCoverImageUrl = (youtubeWatchUrl) => {
129
+ if (!isYoutubeUrl(youtubeWatchUrl)) {
130
+ return "";
131
+ }
132
+ const videoId = getYoutubeVideoId(youtubeWatchUrl);
133
+ return videoId ? `https://img.youtube.com/vi/${videoId}/maxresdefault.jpg` : "";
134
+ };
135
+ const defaultGetVideoMetadata = (url) => __async(undefined, null, function* () {
136
+ const isYoutube = isYoutubeUrl(url);
137
+ if (!isYoutube)
138
+ return;
139
+ const metadataUrl = `http://youtube.com/oembed?url=${url}&format=json`;
140
+ let fetchFailed = false;
141
+ const metadata = yield fetch(metadataUrl).then((res) => res.json()).catch(() => fetchFailed = true);
142
+ const coverImageUrl = getCoverImageUrl(url);
143
+ if (fetchFailed)
144
+ return { imageUrl: coverImageUrl };
145
+ return {
146
+ title: metadata.title,
147
+ imageUrl: coverImageUrl,
148
+ videoLength: ""
149
+ };
150
+ });
151
+ const MediaAttachmentsBox = ({
152
+ attachments,
153
+ getFileMetadata = defaultGetFileMetadata,
154
+ getVideoMetadata = defaultGetVideoMetadata,
155
+ onMediaAttachmentClick,
156
+ enableLightbox = false
157
+ }) => {
158
+ const [documentMetadata, setDocumentMetadata] = useState({});
159
+ const [videoMetadata, setVideoMetadata] = useState({});
160
+ const mediaAttachments = [];
161
+ const documentsAndLinks = [];
162
+ attachments.forEach((a) => {
163
+ switch (a.type) {
164
+ case "document":
165
+ case "link":
166
+ documentsAndLinks.push(a);
167
+ break;
168
+ case "photo":
169
+ case "video":
170
+ mediaAttachments.push(a);
171
+ break;
172
+ }
173
+ });
174
+ useEffect(() => {
175
+ const getMetadata = (attachments2) => __async(undefined, null, function* () {
176
+ const docMetadata = {};
177
+ const videoMetadata2 = {};
178
+ yield Promise.all(attachments2.map((attachment) => __async(this, null, function* () {
179
+ if (attachment.type === "document") {
180
+ docMetadata[attachment.url] = yield getFileMetadata(attachment.url);
181
+ } else if (attachment.type === "video") {
182
+ videoMetadata2[attachment.url] = yield getVideoMetadata(attachment.url);
183
+ }
184
+ })));
185
+ setVideoMetadata(videoMetadata2);
186
+ setDocumentMetadata(docMetadata);
187
+ });
188
+ const videos = attachments.filter((a) => a.type === "video");
189
+ getMetadata([...documentsAndLinks, ...videos]);
190
+ }, []);
191
+ const [currentLightboxUrl, setCurrentLightboxUrl] = useState(void 0);
192
+ const lightboxItems = mediaAttachments.filter((a) => a.type === "photo" || a.type === "video");
193
+ const handleMediaAttachmentClick = (url, type) => {
194
+ if (type === "photo" || type === "video") {
195
+ setCurrentLightboxUrl(url);
196
+ }
197
+ onMediaAttachmentClick == null ? void 0 : onMediaAttachmentClick(url, type);
198
+ };
199
+ return /* @__PURE__ */ React.createElement("div", {
200
+ className: "bg-white flex flex-col items-start gap-[10px] rounded-[20px] shadow-bottom px-[15px] py-[20px] w-full"
201
+ }, /* @__PURE__ */ React.createElement("h3", {
202
+ className: "text-[17px] text-grayscale-900 font-poppins"
203
+ }, "Attachments"), mediaAttachments.length > 0 && /* @__PURE__ */ React.createElement("div", {
204
+ className: "flex gap-[5px] justify-between flex-wrap w-full"
205
+ }, enableLightbox && /* @__PURE__ */ React.createElement(Lightbox, {
206
+ items: lightboxItems,
207
+ currentUrl: currentLightboxUrl,
208
+ setCurrentUrl: setCurrentLightboxUrl
209
+ }), mediaAttachments.map((media, index) => {
210
+ var _a, _b;
211
+ let innerContent;
212
+ let title = media.title;
213
+ if (media.type === "video") {
214
+ const metadata = videoMetadata[media.url];
215
+ title = (_a = title || (metadata == null ? void 0 : metadata.title)) != null ? _a : "";
216
+ getBaseUrl(media.url);
217
+ innerContent = /* @__PURE__ */ React.createElement("div", {
218
+ className: "bg-cover bg-no-repeat bg-center relative font-poppins text-white text-[12px] font-[400] leading-[17px] flex flex-col justify-end items-start p-[10px] text-left bg-rose-600 rounded-[15px] h-full",
219
+ style: {
220
+ backgroundImage: (metadata == null ? void 0 : metadata.imageUrl) ? `linear-gradient(180deg, rgba(0, 0, 0, 0) 44.20%, rgba(0, 0, 0, 0.6) 69%), url(${(_b = metadata == null ? void 0 : metadata.imageUrl) != null ? _b : ""})` : void 0
221
+ }
222
+ }, !(metadata == null ? void 0 : metadata.imageUrl) && /* @__PURE__ */ React.createElement(VideoIcon, {
223
+ size: "60",
224
+ className: "m-auto"
225
+ }), /* @__PURE__ */ React.createElement("div", {
226
+ className: "absolute bottom-[10px] left-[10px] z-10 flex items-center gap-[5px]"
227
+ }, (metadata == null ? void 0 : metadata.imageUrl) && /* @__PURE__ */ React.createElement(VideoIcon, null), (metadata == null ? void 0 : metadata.videoLength) && /* @__PURE__ */ React.createElement("span", {
228
+ className: "leading-[23px]"
229
+ }, metadata.videoLength)));
230
+ } else {
231
+ innerContent = /* @__PURE__ */ React.createElement("div", {
232
+ className: "h-full w-full flex items-center justify-center"
233
+ }, /* @__PURE__ */ React.createElement("img", {
234
+ className: "object-cover h-full w-full",
235
+ src: media.url
236
+ }), /* @__PURE__ */ React.createElement(Camera, {
237
+ className: "absolute bottom-[10px] left-[10px] z-10"
238
+ }));
239
+ }
240
+ const className = `media-attachment ${media.type} w-[49%] pt-[49%] overflow-hidden relative`;
241
+ if (onMediaAttachmentClick || enableLightbox) {
242
+ return /* @__PURE__ */ React.createElement("div", {
243
+ key: index,
244
+ className: "flex bg-grayscale-100 items-center rounded-[15px] w-full"
245
+ }, /* @__PURE__ */ React.createElement("button", {
246
+ className: "h-[80px] w-[80px] rounded-[15px] overflow-hidden flex-shrink-0",
247
+ onClick: (e) => {
248
+ e.stopPropagation();
249
+ handleMediaAttachmentClick(media.url, media.type);
250
+ }
251
+ }, innerContent), title && /* @__PURE__ */ React.createElement("div", {
252
+ className: "text-[12px] text-grayscale-900 font-poppins px-[10px] line-clamp-3"
253
+ }, title));
254
+ }
255
+ return /* @__PURE__ */ React.createElement("div", {
256
+ key: index,
257
+ className
258
+ }, innerContent);
259
+ })), documentsAndLinks.length > 0 && /* @__PURE__ */ React.createElement("div", {
260
+ className: "w-full flex flex-col gap-[5px]"
261
+ }, documentsAndLinks.map((docOrLink, index) => {
262
+ var _a;
263
+ const metadata = docOrLink.type === "document" ? documentMetadata[docOrLink.url] : void 0;
264
+ const { fileExtension, sizeInBytes, numberOfPages } = metadata != null ? metadata : {};
265
+ let baseUrl = "";
266
+ if (docOrLink.type === "link") {
267
+ baseUrl = getBaseUrl(docOrLink.url);
268
+ }
269
+ const innerContent = /* @__PURE__ */ React.createElement("div", {
270
+ className: "flex flex-col gap-[5px]"
271
+ }, /* @__PURE__ */ React.createElement("div", {
272
+ className: "flex gap-[5px] items-center"
273
+ }, docOrLink.type === "document" && /* @__PURE__ */ React.createElement(GenericDocumentIcon, {
274
+ className: "shrink-0"
275
+ }), docOrLink.type === "link" && /* @__PURE__ */ React.createElement(LinkIcon, {
276
+ className: "shrink-0"
277
+ }), /* @__PURE__ */ React.createElement("div", {
278
+ className: "flex flex-col"
279
+ }, /* @__PURE__ */ React.createElement("span", {
280
+ className: "text-grayscale-900 font-[400]"
281
+ }, (_a = docOrLink.title) != null ? _a : "No title"), docOrLink.type === "document" && metadata && /* @__PURE__ */ React.createElement("a", {
282
+ href: docOrLink.url,
283
+ target: "_blank",
284
+ rel: "noreferrer",
285
+ className: "text-grayscale-700 font-[500] text-[12px] font-poppins hover:underline",
286
+ onClick: (e) => e.stopPropagation()
287
+ }, fileExtension && /* @__PURE__ */ React.createElement("span", {
288
+ className: "uppercase"
289
+ }, 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", {
290
+ href: docOrLink.url,
291
+ target: "_blank",
292
+ rel: "noreferrer",
293
+ className: "text-indigo-500 font-[500] text-[12px] font-poppins hover:underline",
294
+ onClick: (e) => e.stopPropagation()
295
+ }, baseUrl))));
296
+ 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`;
297
+ if (onMediaAttachmentClick) {
298
+ return /* @__PURE__ */ React.createElement("button", {
299
+ key: index,
300
+ className,
301
+ onClick: (e) => {
302
+ e.stopPropagation();
303
+ handleMediaAttachmentClick(docOrLink.url, docOrLink.type);
304
+ }
305
+ }, innerContent);
306
+ }
307
+ return /* @__PURE__ */ React.createElement("div", {
308
+ key: index,
309
+ className
310
+ }, innerContent);
311
+ })));
312
+ };
313
+
314
+ const VerificationRow = ({ verification }) => {
315
+ var _a, _b;
316
+ const [showInfo, setShowInfo] = useState(false);
317
+ const statusColor = getColorForVerificationStatus(verification.status);
318
+ const getIcon = () => {
319
+ switch (verification.status) {
320
+ case VerificationStatusEnum.Success:
321
+ return /* @__PURE__ */ React.createElement(AcuteCheckmark, null);
322
+ case VerificationStatusEnum.Error:
323
+ return /* @__PURE__ */ React.createElement(ExclamationPoint, null);
324
+ case VerificationStatusEnum.Failed:
325
+ return /* @__PURE__ */ React.createElement(X, null);
326
+ }
327
+ };
328
+ let primaryText = verification.check ? `${verification.check}: ${verification.message}` : verification.message;
329
+ if (verification.status === VerificationStatusEnum.Failed) {
330
+ primaryText = (_b = (_a = verification.message) != null ? _a : verification.details) != null ? _b : "";
331
+ }
332
+ primaryText = capitalize(primaryText);
333
+ const infoText = "";
334
+ return /* @__PURE__ */ React.createElement("div", {
335
+ className: "verification-row flex flex-col gap-[5px] font-poppins border-b-[1px] border-grayscale-200 border-solid w-full py-[10px] last:border-0 last:pb-0"
336
+ }, /* @__PURE__ */ React.createElement("span", {
337
+ className: "font-[700] text-[11px] uppercase flex items-center gap-[3px] select-none",
338
+ style: { color: statusColor }
339
+ }, getIcon(), verification.status, infoText ), showInfo && infoText && /* @__PURE__ */ React.createElement(InfoBox, {
340
+ text: infoText,
341
+ handleClose: () => setShowInfo(false),
342
+ backgroundColor: statusColor
343
+ }), /* @__PURE__ */ React.createElement("span", {
344
+ className: "text-[14px] text-grayscale-900 font-poppins"
345
+ }, primaryText));
346
+ };
347
+
348
+ const VerificationsBox = ({ verificationItems }) => {
349
+ const [showInfo, setShowInfo] = useState(false);
350
+ return /* @__PURE__ */ React.createElement("div", {
351
+ className: "bg-white flex flex-col items-start gap-[10px] rounded-[20px] shadow-bottom p-[15px] w-full"
352
+ }, /* @__PURE__ */ React.createElement("div", {
353
+ className: "flex w-full items-center"
354
+ }, /* @__PURE__ */ React.createElement("h3", {
355
+ className: "text-[17px] text-grayscale-900 font-poppins"
356
+ }, "Verifications"), /* @__PURE__ */ React.createElement("button", {
357
+ className: "ml-auto",
358
+ onClick: (e) => {
359
+ e.stopPropagation();
360
+ setShowInfo(!showInfo);
361
+ }
362
+ }, /* @__PURE__ */ React.createElement(InfoIcon, {
363
+ color: showInfo ? "#6366F1" : void 0
364
+ }))), showInfo && /* @__PURE__ */ React.createElement(InfoBox, {
365
+ text: "Credential verifications check the cryptographic proof of digital credentials to ensure their authenticity and accuracy.",
366
+ handleClose: () => setShowInfo(false)
367
+ }), verificationItems.map((verification, index) => /* @__PURE__ */ React.createElement(VerificationRow, {
368
+ key: index,
369
+ verification
370
+ })));
371
+ };
372
+
373
+ const TruncateTextBox = ({
374
+ headerText,
375
+ headerClassName = "",
376
+ text,
377
+ truncateThreshold = 132,
378
+ children,
379
+ className = "truncate-text-box"
380
+ }) => {
381
+ const needsTruncate = (text == null ? void 0 : text.length) > truncateThreshold;
382
+ const [showFullText, setShowFullText] = useState(false);
383
+ const truncated = needsTruncate && !showFullText;
384
+ const displayText = truncated ? text.substring(0, truncateThreshold) : text;
385
+ return /* @__PURE__ */ React.createElement("div", {
386
+ className: `${className} w-full bg-white flex flex-col items-start gap-[10px] rounded-[20px] shadow-bottom p-[15px]`
387
+ }, /* @__PURE__ */ React.createElement("h3", {
388
+ className: `${headerClassName} text-[17px] text-grayscale-900 font-poppins`
389
+ }, headerText), /* @__PURE__ */ React.createElement("p", {
390
+ className: "text-[12px] text-grayscale-700 font-poppins mb-0 flex flex-col items-start"
391
+ }, displayText, truncated && /* @__PURE__ */ React.createElement(React.Fragment, null, "...", /* @__PURE__ */ React.createElement("button", {
392
+ className: "text-indigo-500 text-[12px]",
393
+ onClick: (e) => {
394
+ e.stopPropagation();
395
+ setShowFullText(true);
396
+ }
397
+ }, "Show more")), needsTruncate && showFullText && /* @__PURE__ */ React.createElement("button", {
398
+ className: "text-indigo-500 text-[12px]",
399
+ onClick: (e) => {
400
+ e.stopPropagation();
401
+ setShowFullText(false);
402
+ }
403
+ }, "Show less")), children);
404
+ };
405
+
406
+ const MeritBadgeBackFace = ({
407
+ credential,
408
+ categoryType,
409
+ verificationItems,
410
+ customSkillsComponent,
411
+ getFileMetadata,
412
+ getVideoMetadata,
413
+ onMediaAttachmentClick,
414
+ enableLightbox,
415
+ showBackButton,
416
+ handleViewFrontFace
417
+ }) => {
418
+ var _a, _b, _c, _d, _e, _f, _g;
419
+ const { createdAt, credentialSubject } = getInfoFromCredential(credential, "MMM dd, yyyy", {
420
+ uppercaseDate: false
421
+ });
422
+ const { description } = (_a = credentialSubject == null ? void 0 : credentialSubject.achievement) != null ? _a : {};
423
+ const criteria = (_c = (_b = credentialSubject == null ? void 0 : credentialSubject.achievement) == null ? void 0 : _b.criteria) == null ? void 0 : _c.narrative;
424
+ const alignment = (_d = credentialSubject == null ? void 0 : credentialSubject.achievement) == null ? void 0 : _d.alignment;
425
+ const credentialDarkColor = getCategoryDarkColor(categoryType);
426
+ let bgColor = `bg-${credentialDarkColor}`;
427
+ if (categoryType === LCCategoryEnum.accommodations) {
428
+ bgColor = "bg-amber-700";
429
+ } else if (categoryType === LCCategoryEnum.accomplishments) {
430
+ bgColor = "bg-lime-700";
431
+ }
432
+ return /* @__PURE__ */ React.createElement("div", {
433
+ role: "button",
434
+ onClick: () => handleViewFrontFace == null ? void 0 : handleViewFrontFace(),
435
+ className: `flex flex-col gap-[15px] items-center border-[5px] border-solid border-grayscale-200 py-[30px] px-[20px] rounded-[25px] max-w-[400px] ${bgColor}`
436
+ }, showBackButton ? /* @__PURE__ */ React.createElement("div", {
437
+ className: "w-full"
438
+ }, /* @__PURE__ */ React.createElement("button", {
439
+ className: "vc-card-back-button rounded-full h-[50px] px-[15px] flex items-center justify-center gap-[5px] z-50 text-[30px] text-white select-none",
440
+ onClick: () => handleViewFrontFace == null ? void 0 : handleViewFrontFace()
441
+ }, /* @__PURE__ */ React.createElement(LeftArrow, {
442
+ className: "text-white",
443
+ size: "25"
444
+ }), "Details")) : /* @__PURE__ */ React.createElement("h1", {
445
+ className: "text-white text-center text-[22px] font-jacques"
446
+ }, "Details"), /* @__PURE__ */ React.createElement(TruncateTextBox, {
447
+ headerText: "About",
448
+ text: description
449
+ }, /* @__PURE__ */ React.createElement("span", {
450
+ className: `text-grayscale-600 font-poppins text-[12px] font-[600] w-full ${description ? "pt-[10px] border-t-[1px] border-solid border-grayscale-200" : ""}`
451
+ }, "Awarded on ", createdAt)), criteria && /* @__PURE__ */ React.createElement(TruncateTextBox, {
452
+ headerText: "Criteria",
453
+ text: criteria
454
+ }), ((_f = (_e = credential.skills) == null ? void 0 : _e.length) != null ? _f : 0) > 0 && (customSkillsComponent ? customSkillsComponent : /* @__PURE__ */ React.createElement(SkillsBox, {
455
+ skills: (_g = credential.skills) != null ? _g : []
456
+ })), credential.attachments && credential.attachments.length > 0 && /* @__PURE__ */ React.createElement(MediaAttachmentsBox, {
457
+ attachments: credential.attachments,
458
+ getFileMetadata,
459
+ getVideoMetadata,
460
+ onMediaAttachmentClick,
461
+ enableLightbox
462
+ }), alignment && /* @__PURE__ */ React.createElement(AlignmentsBox, {
463
+ alignment,
464
+ style: "MeritBadge"
465
+ }), verificationItems && verificationItems.length > 0 && /* @__PURE__ */ React.createElement(VerificationsBox, {
466
+ verificationItems
467
+ }), /* @__PURE__ */ React.createElement("span", {
468
+ className: "hidden bg-amber-700 bg-spice-700 bg-rose-700 bg-yellow-700 bg-teal-700"
469
+ }));
470
+ };
471
+
472
+ const MeritBadgeCornerIcon = ({ categoryType, position }) => {
473
+ const credentialPrimaryColor = getCategoryLightColor(categoryType);
474
+ const credentialIcon = getCategoryIcon(categoryType);
475
+ let iconPositionClassName, cornerPositionClassName;
476
+ switch (position) {
477
+ case "top-left":
478
+ iconPositionClassName = "top-[3px] left-[3px] pb-[10px] pr-[10px] pl-[4px] pt-[4px]";
479
+ cornerPositionClassName = "bottom-[-1px] right-0";
480
+ break;
481
+ case "top-right":
482
+ iconPositionClassName = "top-[3px] right-[3px] pl-[10px] pb-[10px] pr-[4px] pt-[4px]";
483
+ cornerPositionClassName = "bottom-[-1px] left-0 rotate-90";
484
+ break;
485
+ case "bottom-left":
486
+ iconPositionClassName = "bottom-[3px] left-[3px] pr-[10px] pt-[10px] pl-[4px] pb-[4px]";
487
+ cornerPositionClassName = "top-0 right-0 rotate-[270deg]";
488
+ break;
489
+ case "bottom-right":
490
+ iconPositionClassName = "bottom-[3px] right-[3px] pl-[10px] pt-[10px] pr-[4px] pb-[4px]";
491
+ cornerPositionClassName = "top-[-1px] left-0 rotate-180";
492
+ break;
493
+ }
494
+ return /* @__PURE__ */ React.createElement("div", {
495
+ className: `text-${credentialPrimaryColor} rounded-full bg-white absolute ${iconPositionClassName}`
496
+ }, credentialIcon, /* @__PURE__ */ React.createElement(RoundedCorner, {
497
+ className: `absolute ${cornerPositionClassName}`
498
+ }));
499
+ };
500
+
501
+ const MeritBadgeRibbon = ({ className = "" }) => {
502
+ return /* @__PURE__ */ React.createElement("svg", {
503
+ width: "167",
504
+ height: "131",
505
+ viewBox: "0 0 167 131",
506
+ fill: "none",
507
+ xmlns: "http://www.w3.org/2000/svg",
508
+ className
509
+ }, /* @__PURE__ */ React.createElement("circle", {
510
+ cx: "83.1426",
511
+ cy: "65.5",
512
+ r: "64",
513
+ fill: "white",
514
+ stroke: "white",
515
+ strokeWidth: "3"
516
+ }), /* @__PURE__ */ React.createElement("path", {
517
+ d: "M29.3926 3.70096C28.9354 3.437 28.3731 3.43281 27.912 3.68993C27.4509 3.94705 27.159 4.42762 27.1432 4.95531L26.3214 32.5274L2.85421 47.0252C2.40508 47.3026 2.13488 47.7958 2.14274 48.3236C2.15061 48.8515 2.43538 49.3363 2.89258 49.6003L137.608 127.378C138.065 127.642 138.627 127.646 139.088 127.389C139.549 127.132 139.841 126.651 139.857 126.124L140.679 98.5517L164.146 84.0539C164.595 83.7764 164.865 83.2833 164.857 82.7554C164.85 82.2276 164.565 81.7427 164.108 81.4787L29.3926 3.70096Z",
518
+ fill: "#622599",
519
+ stroke: "white",
520
+ strokeWidth: "3",
521
+ strokeLinejoin: "round"
522
+ }), /* @__PURE__ */ React.createElement("rect", {
523
+ x: "22.1426",
524
+ y: "4.5",
525
+ width: "123",
526
+ height: "123",
527
+ rx: "61.5",
528
+ fill: "white"
529
+ }), /* @__PURE__ */ React.createElement("rect", {
530
+ x: "22.1426",
531
+ y: "4.5",
532
+ width: "123",
533
+ height: "123",
534
+ rx: "61.5",
535
+ stroke: "#622599",
536
+ strokeWidth: "3"
537
+ }), /* @__PURE__ */ React.createElement("rect", {
538
+ x: "28.6426",
539
+ y: "11",
540
+ width: "110",
541
+ height: "110",
542
+ rx: "55",
543
+ stroke: "#622599",
544
+ strokeWidth: "2",
545
+ strokeLinecap: "round",
546
+ strokeDasharray: "5 5"
547
+ }), /* @__PURE__ */ React.createElement("rect", {
548
+ x: "33.6426",
549
+ y: "16",
550
+ width: "100",
551
+ height: "100",
552
+ fill: "url(#pattern0_10101_43072)"
553
+ }), /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("pattern", {
554
+ id: "pattern0_10101_43072",
555
+ patternContentUnits: "objectBoundingBox",
556
+ width: "1",
557
+ height: "1"
558
+ }, /* @__PURE__ */ React.createElement("use", {
559
+ xlinkHref: "#image0_10101_43072",
560
+ transform: "scale(0.00416667)"
561
+ }))));
562
+ };
563
+
564
+ const MeritBadgeImageDisplay = ({
565
+ imageUrl,
566
+ className = ""
567
+ }) => {
568
+ return /* @__PURE__ */ React.createElement("div", {
569
+ className: `flex items-center justify-center w-[120px] h-[120px] rounded-full bg-white z-50 ${className}`
570
+ }, /* @__PURE__ */ React.createElement("div", {
571
+ className: "relative left-[1px] top-[1px] w-full h-full p-[10px] flex items-center justify-center rounded-full overflow-hidden object-contain z-[2]"
572
+ }, /* @__PURE__ */ React.createElement("img", {
573
+ src: imageUrl,
574
+ alt: "merit badge thumbnail"
575
+ })), /* @__PURE__ */ React.createElement(MeritBadgeRibbon, {
576
+ className: "absolute z-[1]"
577
+ }));
578
+ };
579
+
580
+ const MeritBadgeProfileImageDisplay = ({
581
+ imageUrl,
582
+ showSeal = false,
583
+ className = "",
584
+ imageComponent,
585
+ size = "big"
586
+ }) => {
587
+ const imageClassName = `${size === "big" ? "h-[60px] w-[60px]" : "h-[39px] w-[39px]"} rounded-full overflow-hidden ${showSeal ? "absolute border-[2px] border-solid border-grayscale-200" : ""}`;
588
+ return /* @__PURE__ */ React.createElement("div", {
589
+ className
590
+ }, showSeal && /* @__PURE__ */ React.createElement("div", {
591
+ className: "bg-white rounded-full p-[5px]"
592
+ }, /* @__PURE__ */ React.createElement(IssuerSeal, {
593
+ size: "58"
594
+ })), imageComponent && /* @__PURE__ */ React.createElement("div", {
595
+ className: imageClassName
596
+ }, imageComponent), !imageComponent && /* @__PURE__ */ React.createElement("img", {
597
+ className: imageClassName,
598
+ src: imageUrl
599
+ }));
600
+ };
601
+
602
+ const MeritBadgeFrontFace = ({
603
+ isFront,
604
+ credential,
605
+ categoryType,
606
+ issuerOverride,
607
+ issueeOverride,
608
+ trustedAppRegistry,
609
+ subjectImageComponent,
610
+ issuerImageComponent,
611
+ customBodyCardComponent,
612
+ hideIssueDate,
613
+ handleViewBackFace,
614
+ showDetailsBtn = false
615
+ }) => {
616
+ var _a;
617
+ const {
618
+ title = "",
619
+ createdAt,
620
+ issuer: _issuer = "",
621
+ issuee: _issuee = "",
622
+ credentialSubject,
623
+ imageUrl
624
+ } = getInfoFromCredential(credential, "MMM dd, yyyy", { uppercaseDate: false });
625
+ const issuee = issueeOverride || _issuee;
626
+ const issuer = issuerOverride || _issuer;
627
+ (_a = credentialSubject == null ? void 0 : credentialSubject.achievement) != null ? _a : {};
628
+ const credentialLightColor = getCategoryLightColor(categoryType);
629
+ const credentialDarkColor = getCategoryDarkColor(categoryType);
630
+ let categoryTitle = categoryType;
631
+ let textLightColor = `text-${credentialLightColor}`;
632
+ let textDarkColor = `text-${credentialDarkColor}`;
633
+ let borderColor = `border-${credentialLightColor}`;
634
+ if (categoryType === LCCategoryEnum.accommodations) {
635
+ textLightColor = "text-amber-500";
636
+ textDarkColor = "text-amber-700";
637
+ borderColor = "border-amber-500";
638
+ } else if (categoryType === LCCategoryEnum.accomplishments) {
639
+ textLightColor = "text-lime-500";
640
+ textDarkColor = "text-lime-700";
641
+ borderColor = "border-lime-500";
642
+ } else if (categoryType === LCCategoryEnum.learningHistory) {
643
+ categoryTitle = "Course";
644
+ } else if (categoryType === LCCategoryEnum.workHistory) {
645
+ categoryTitle = "Experiences";
646
+ textLightColor = "text-blue-500";
647
+ textDarkColor = "text-blue-700";
648
+ borderColor = "border-blue-500";
649
+ }
650
+ const issuerName = getNameFromProfile(issuer != null ? issuer : "");
651
+ const issueeName = getNameFromProfile(issuee != null ? issuee : "");
652
+ const issuerImage = getImageFromProfile(issuer != null ? issuer : "");
653
+ const issueeImage = getImageFromProfile(issuee != null ? issuee : "");
654
+ const issuerDid = typeof credential.issuer === "string" ? credential.issuer : credential.issuer.id;
655
+ let verifierState;
656
+ if ((credentialSubject == null ? void 0 : credentialSubject.id) === issuerDid && issuerDid && issuerDid !== "did:example:123") {
657
+ verifierState = VERIFIER_STATES.selfVerified;
658
+ } else {
659
+ const appRegistryEntry = trustedAppRegistry == null ? void 0 : trustedAppRegistry.find((registryEntry) => registryEntry.did === issuerDid);
660
+ if (appRegistryEntry) {
661
+ verifierState = appRegistryEntry.isTrusted ? VERIFIER_STATES.trustedVerifier : VERIFIER_STATES.untrustedVerifier;
662
+ } else {
663
+ verifierState = VERIFIER_STATES.unknownVerifier;
664
+ }
665
+ }
666
+ verifierState === VERIFIER_STATES.selfVerified;
667
+ const issueeImageExists = issueeImage || subjectImageComponent;
668
+ return /* @__PURE__ */ React.createElement("section", {
669
+ role: "button",
670
+ onClick: () => handleViewBackFace == null ? void 0 : handleViewBackFace(),
671
+ className: "relative p-[13px] mt-[25px] bg-white border-[5px] rounded-[30px] border-soid border-grayscale-200 max-w-[300px]"
672
+ }, /* @__PURE__ */ React.createElement("div", {
673
+ className: "w-[calc(100%-26px)] absolute top-[-19px]"
674
+ }, /* @__PURE__ */ React.createElement(MeritBadgeImageDisplay, {
675
+ imageUrl: imageUrl != null ? imageUrl : "",
676
+ className: "mx-auto"
677
+ })), /* @__PURE__ */ React.createElement("div", {
678
+ className: `flex flex-col gap-[15px] items-center px-[20px] pt-[92px] pb-[50px] border-solid border-[4px] ${borderColor} rounded-[30px]`
679
+ }, /* @__PURE__ */ React.createElement("div", {
680
+ className: "flex flex-col gap-[5px]"
681
+ }, /* @__PURE__ */ React.createElement("div", {
682
+ className: "flex flex-col items-center text-grayscale-900"
683
+ }, /* @__PURE__ */ React.createElement("span", {
684
+ className: "text-[16px] leading-[150%] font-jacques"
685
+ }, issueeName || /* @__PURE__ */ React.createElement(Line, {
686
+ width: "60"
687
+ })), /* @__PURE__ */ React.createElement("span", {
688
+ className: "text-[14px] leading-[150%] font-jacques"
689
+ }, "has met the requirements for")), /* @__PURE__ */ React.createElement("div", {
690
+ className: "flex flex-col items-center"
691
+ }, /* @__PURE__ */ React.createElement("h1", {
692
+ className: "text-grayscale-900 text-center text-[20px] font-jacques"
693
+ }, title), /* @__PURE__ */ React.createElement("div", {
694
+ className: `${textLightColor} uppercase text-[14px] font-poppins`
695
+ }, categoryTitle))), customBodyCardComponent, issueeImageExists && !customBodyCardComponent && /* @__PURE__ */ React.createElement(MeritBadgeProfileImageDisplay, {
696
+ imageUrl: issueeImage,
697
+ imageComponent: subjectImageComponent,
698
+ className: `flex justify-center items-center ${textDarkColor}`
699
+ }), !issueeImageExists && !customBodyCardComponent && /* @__PURE__ */ React.createElement("div", {
700
+ className: "h-[50px] w-[50px] rounded-full bg-grayscale-500 flex items-center justify-center"
701
+ }, /* @__PURE__ */ React.createElement(Smiley, null)), /* @__PURE__ */ React.createElement("div", {
702
+ className: "border-t-[2px] border-solid border-sp-purple-base flex flex-col py-[20px] w-full"
703
+ }, /* @__PURE__ */ React.createElement("div", {
704
+ className: "text-[14px] text-grayscale-900 flex flex-col items-center w-full mb-[10px]"
705
+ }, /* @__PURE__ */ React.createElement("span", {
706
+ className: "font-jacques flex gap-[5px] items-center w-full overflow-ellipsis whitespace-nowrap overflow-hidden justify-center"
707
+ }, issueeName === "0 person" ? "Not yet awarded" : /* @__PURE__ */ React.createElement(React.Fragment, null, "Awarded on ", createdAt, " by"))), /* @__PURE__ */ React.createElement("div", {
708
+ className: "flex flex-col gap-[5px] items-center w-full"
709
+ }, /* @__PURE__ */ React.createElement("span", {
710
+ className: "mb-[3px] pt-[3px] text-grayscale-900 text-[25px] leading-[90%] font-sacramento border-b-[1px] border-solid border-grayscale-200 w-full text-center overflow-ellipsis whitespace-normal scrollbar-hide"
711
+ }, issuerName), /* @__PURE__ */ React.createElement(VerifierStateBadgeAndText, {
712
+ verifierState
713
+ })))), categoryType && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(MeritBadgeCornerIcon, {
714
+ categoryType,
715
+ position: "top-left"
716
+ }), /* @__PURE__ */ React.createElement(MeritBadgeCornerIcon, {
717
+ categoryType,
718
+ position: "top-right"
719
+ }), /* @__PURE__ */ React.createElement(MeritBadgeCornerIcon, {
720
+ categoryType,
721
+ position: "bottom-left"
722
+ }), /* @__PURE__ */ React.createElement(MeritBadgeCornerIcon, {
723
+ categoryType,
724
+ position: "bottom-right"
725
+ })), /* @__PURE__ */ React.createElement(MeritBadgeProfileImageDisplay, {
726
+ imageUrl: issuerImage,
727
+ imageComponent: issuerImageComponent,
728
+ className: "w-[calc(100%-26px)] absolute bottom-0 flex justify-center items-center text-sp-purple-base",
729
+ size: "small",
730
+ showSeal: true
731
+ }), /* @__PURE__ */ React.createElement("span", {
732
+ className: "hidden border-rose-500 text-spice-500 border-spice-500 border-cyan-500 text-cyan-500 border-indigo-500 border-sp-purple-base"
733
+ }));
734
+ };
735
+
736
+ const MeritBadgeDisplayCard = ({
737
+ credential,
738
+ categoryType,
739
+ verificationItems,
740
+ issuerOverride,
741
+ issueeOverride,
742
+ subjectImageComponent,
743
+ issuerImageComponent,
744
+ customBodyCardComponent,
745
+ trustedAppRegistry,
746
+ hideIssueDate,
747
+ customSkillsComponent,
748
+ getFileMetadata,
749
+ getVideoMetadata,
750
+ onMediaAttachmentClick,
751
+ enableLightbox,
752
+ handleXClick,
753
+ onDotsClick,
754
+ isFrontOverride,
755
+ setIsFrontOverride,
756
+ hideNavButtons,
757
+ showBackButton = false,
758
+ showDetailsBtn = false
759
+ }) => {
760
+ const [_isFront, _setIsFront] = useState(isFrontOverride != null ? isFrontOverride : true);
761
+ const isFront = isFrontOverride != null ? isFrontOverride : _isFront;
762
+ const setIsFront = setIsFrontOverride != null ? setIsFrontOverride : _setIsFront;
763
+ return /* @__PURE__ */ React.createElement("section", {
764
+ className: "w-full flex flex-col gap-[15px] justify-center relative min-w-[220px]"
765
+ }, /* @__PURE__ */ React.createElement("section", {
766
+ className: "mx-auto"
767
+ }, isFront && /* @__PURE__ */ React.createElement(MeritBadgeFrontFace, {
768
+ credential,
769
+ categoryType,
770
+ issuerOverride,
771
+ issueeOverride,
772
+ trustedAppRegistry,
773
+ subjectImageComponent,
774
+ issuerImageComponent,
775
+ customBodyCardComponent,
776
+ hideIssueDate,
777
+ handleViewBackFace: () => setIsFront(!isFront),
778
+ isFront,
779
+ showDetailsBtn
780
+ }), !isFront && /* @__PURE__ */ React.createElement(MeritBadgeBackFace, {
781
+ credential,
782
+ categoryType,
783
+ verificationItems,
784
+ getFileMetadata,
785
+ getVideoMetadata,
786
+ onMediaAttachmentClick,
787
+ enableLightbox,
788
+ showBackButton: showBackButton && !hideNavButtons || showDetailsBtn,
789
+ handleViewFrontFace: () => setIsFront(!isFront)
790
+ }), onDotsClick && /* @__PURE__ */ React.createElement("button", {
791
+ className: "absolute right-[-20px] top-[-52px] bg-white rounded-full p-[10px] shadow-bottom",
792
+ onClick: onDotsClick
793
+ }, /* @__PURE__ */ React.createElement("img", {
794
+ alt: "Menu dropdown icon",
795
+ className: "h-[20px] w-[20px]",
796
+ src: ThreeDots
797
+ }))), !hideNavButtons && /* @__PURE__ */ React.createElement("div", {
798
+ className: "flex gap-[10px] font-mouse text-[30px] leading-[28px] tracking-[0.75px] relative top-[-10px] left-0 w-full"
799
+ }, !isFront && /* @__PURE__ */ React.createElement("button", {
800
+ className: "bg-grayscale-900 text-white py-[15px] px-[20px] rounded-[20px] flex mx-auto justify-center items-center gap-[5px] border-[3px] border-solid border-white",
801
+ onClick: () => setIsFront(!isFront)
802
+ }, /* @__PURE__ */ React.createElement(FatArrow, {
803
+ direction: "left"
804
+ }), " Back"), handleXClick && /* @__PURE__ */ React.createElement("button", {
805
+ onClick: handleXClick,
806
+ className: "bg-white text-grayscale-900 rounded-[20px] py-[15px] px-[20px] grow"
807
+ }, "Close"), isFront && /* @__PURE__ */ React.createElement("button", {
808
+ className: "bg-grayscale-900 text-white py-[15px] px-[20px] rounded-[20px] mx-auto flex justify-center items-center gap-[5px] border-[3px] border-solid border-white",
809
+ onClick: () => setIsFront(!isFront)
810
+ }, "Details ", /* @__PURE__ */ React.createElement(FatArrow, {
811
+ direction: "right"
812
+ }))));
813
+ };
814
+
815
+ export { MeritBadgeBackFace as M, MeritBadgeDisplayCard as a, MeritBadgeFrontFace as b };
816
+ //# sourceMappingURL=MeritBadgeDisplayCard-3ac56267.js.map