@learncard/learn-card-plugin 1.2.26 → 1.2.27

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.
@@ -1,2 +1,2 @@
1
- "use strict";var H=Object.defineProperty;var Ne=Object.getOwnPropertyDescriptor;var Ve=Object.getOwnPropertyNames;var Ae=Object.prototype.hasOwnProperty;var n=(e,r)=>H(e,"name",{value:r,configurable:!0});var He=(e,r)=>{for(var t in r)H(e,t,{get:r[t],enumerable:!0})},$e=(e,r,t,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Ve(r))!Ae.call(e,o)&&o!==t&&H(e,o,{get:()=>r[o],enumerable:!(a=Ne(r,o))||a.enumerable});return e};var Re=e=>$e(H({},"__esModule",{value:!0}),e);var Jt={};He(Jt,{getLearnCardPlugin:()=>zt,prettifyVerificationItem:()=>Ye,prettifyVerificationItems:()=>Gt});module.exports=Re(Jt);var $=require("@learncard/types");function I(e){"@babel/helpers - typeof";return I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},I(e)}n(I,"_typeof");function x(e){if(e===null||e===!0||e===!1)return NaN;var r=Number(e);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}n(x,"toInteger");function d(e,r){if(r.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+r.length+" present")}n(d,"requiredArgs");function m(e){d(1,arguments);var r=Object.prototype.toString.call(e);return e instanceof Date||I(e)==="object"&&r==="[object Date]"?new Date(e.getTime()):typeof e=="number"||r==="[object Number]"?new Date(e):((typeof e=="string"||r==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}n(m,"toDate");function G(e,r){d(2,arguments);var t=m(e).getTime(),a=x(r);return new Date(t+a)}n(G,"addMilliseconds");var Qe={};function k(){return Qe}n(k,"getDefaultOptions");function z(e){var r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),e.getTime()-r.getTime()}n(z,"getTimezoneOffsetInMilliseconds");function J(e){return d(1,arguments),e instanceof Date||I(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}n(J,"isDate");function K(e){if(d(1,arguments),!J(e)&&typeof e!="number")return!1;var r=m(e);return!isNaN(Number(r))}n(K,"isValid");function Z(e,r){d(2,arguments);var t=x(r);return G(e,-t)}n(Z,"subMilliseconds");var Be=864e5;function ee(e){d(1,arguments);var r=m(e),t=r.getTime();r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0);var a=r.getTime(),o=t-a;return Math.floor(o/Be)+1}n(ee,"getUTCDayOfYear");function T(e){d(1,arguments);var r=1,t=m(e),a=t.getUTCDay(),o=(a<r?7:0)+a-r;return t.setUTCDate(t.getUTCDate()-o),t.setUTCHours(0,0,0,0),t}n(T,"startOfUTCISOWeek");function F(e){d(1,arguments);var r=m(e),t=r.getUTCFullYear(),a=new Date(0);a.setUTCFullYear(t+1,0,4),a.setUTCHours(0,0,0,0);var o=T(a),i=new Date(0);i.setUTCFullYear(t,0,4),i.setUTCHours(0,0,0,0);var s=T(i);return r.getTime()>=o.getTime()?t+1:r.getTime()>=s.getTime()?t:t-1}n(F,"getUTCISOWeekYear");function te(e){d(1,arguments);var r=F(e),t=new Date(0);t.setUTCFullYear(r,0,4),t.setUTCHours(0,0,0,0);var a=T(t);return a}n(te,"startOfUTCISOWeekYear");var Xe=6048e5;function re(e){d(1,arguments);var r=m(e),t=T(r).getTime()-te(r).getTime();return Math.round(t/Xe)+1}n(re,"getUTCISOWeek");function S(e,r){var t,a,o,i,s,u,c,l;d(1,arguments);var h=k(),p=x((t=(a=(o=(i=r?.weekStartsOn)!==null&&i!==void 0?i:r==null||(s=r.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&o!==void 0?o:h.weekStartsOn)!==null&&a!==void 0?a:(c=h.locale)===null||c===void 0||(l=c.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&t!==void 0?t:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var v=m(e),g=v.getUTCDay(),w=(g<p?7:0)+g-p;return v.setUTCDate(v.getUTCDate()-w),v.setUTCHours(0,0,0,0),v}n(S,"startOfUTCWeek");function L(e,r){var t,a,o,i,s,u,c,l;d(1,arguments);var h=m(e),p=h.getUTCFullYear(),v=k(),g=x((t=(a=(o=(i=r?.firstWeekContainsDate)!==null&&i!==void 0?i:r==null||(s=r.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:v.firstWeekContainsDate)!==null&&a!==void 0?a:(c=v.locale)===null||c===void 0||(l=c.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(g>=1&&g<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var w=new Date(0);w.setUTCFullYear(p+1,0,g),w.setUTCHours(0,0,0,0);var P=S(w,r),C=new Date(0);C.setUTCFullYear(p,0,g),C.setUTCHours(0,0,0,0);var Y=S(C,r);return h.getTime()>=P.getTime()?p+1:h.getTime()>=Y.getTime()?p:p-1}n(L,"getUTCWeekYear");function ae(e,r){var t,a,o,i,s,u,c,l;d(1,arguments);var h=k(),p=x((t=(a=(o=(i=r?.firstWeekContainsDate)!==null&&i!==void 0?i:r==null||(s=r.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:h.firstWeekContainsDate)!==null&&a!==void 0?a:(c=h.locale)===null||c===void 0||(l=c.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&t!==void 0?t:1),v=L(e,r),g=new Date(0);g.setUTCFullYear(v,0,p),g.setUTCHours(0,0,0,0);var w=S(g,r);return w}n(ae,"startOfUTCWeekYear");var je=6048e5;function oe(e,r){d(1,arguments);var t=m(e),a=S(t,r).getTime()-ae(t,r).getTime();return Math.round(a/je)+1}n(oe,"getUTCWeek");function f(e,r){for(var t=e<0?"-":"",a=Math.abs(e).toString();a.length<r;)a="0"+a;return t+a}n(f,"addLeadingZeros");var Ge={y:n(function(r,t){var a=r.getUTCFullYear(),o=a>0?a:1-a;return f(t==="yy"?o%100:o,t.length)},"y"),M:n(function(r,t){var a=r.getUTCMonth();return t==="M"?String(a+1):f(a+1,2)},"M"),d:n(function(r,t){return f(r.getUTCDate(),t.length)},"d"),a:n(function(r,t){var a=r.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];default:return a==="am"?"a.m.":"p.m."}},"a"),h:n(function(r,t){return f(r.getUTCHours()%12||12,t.length)},"h"),H:n(function(r,t){return f(r.getUTCHours(),t.length)},"H"),m:n(function(r,t){return f(r.getUTCMinutes(),t.length)},"m"),s:n(function(r,t){return f(r.getUTCSeconds(),t.length)},"s"),S:n(function(r,t){var a=t.length,o=r.getUTCMilliseconds(),i=Math.floor(o*Math.pow(10,a-3));return f(i,t.length)},"S")},b=Ge;var _={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ze={G:n(function(r,t,a){var o=r.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return a.era(o,{width:"abbreviated"});case"GGGGG":return a.era(o,{width:"narrow"});default:return a.era(o,{width:"wide"})}},"G"),y:n(function(r,t,a){if(t==="yo"){var o=r.getUTCFullYear(),i=o>0?o:1-o;return a.ordinalNumber(i,{unit:"year"})}return b.y(r,t)},"y"),Y:n(function(r,t,a,o){var i=L(r,o),s=i>0?i:1-i;if(t==="YY"){var u=s%100;return f(u,2)}return t==="Yo"?a.ordinalNumber(s,{unit:"year"}):f(s,t.length)},"Y"),R:n(function(r,t){var a=F(r);return f(a,t.length)},"R"),u:n(function(r,t){var a=r.getUTCFullYear();return f(a,t.length)},"u"),Q:n(function(r,t,a){var o=Math.ceil((r.getUTCMonth()+1)/3);switch(t){case"Q":return String(o);case"QQ":return f(o,2);case"Qo":return a.ordinalNumber(o,{unit:"quarter"});case"QQQ":return a.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return a.quarter(o,{width:"narrow",context:"formatting"});default:return a.quarter(o,{width:"wide",context:"formatting"})}},"Q"),q:n(function(r,t,a){var o=Math.ceil((r.getUTCMonth()+1)/3);switch(t){case"q":return String(o);case"qq":return f(o,2);case"qo":return a.ordinalNumber(o,{unit:"quarter"});case"qqq":return a.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return a.quarter(o,{width:"narrow",context:"standalone"});default:return a.quarter(o,{width:"wide",context:"standalone"})}},"q"),M:n(function(r,t,a){var o=r.getUTCMonth();switch(t){case"M":case"MM":return b.M(r,t);case"Mo":return a.ordinalNumber(o+1,{unit:"month"});case"MMM":return a.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return a.month(o,{width:"narrow",context:"formatting"});default:return a.month(o,{width:"wide",context:"formatting"})}},"M"),L:n(function(r,t,a){var o=r.getUTCMonth();switch(t){case"L":return String(o+1);case"LL":return f(o+1,2);case"Lo":return a.ordinalNumber(o+1,{unit:"month"});case"LLL":return a.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return a.month(o,{width:"narrow",context:"standalone"});default:return a.month(o,{width:"wide",context:"standalone"})}},"L"),w:n(function(r,t,a,o){var i=oe(r,o);return t==="wo"?a.ordinalNumber(i,{unit:"week"}):f(i,t.length)},"w"),I:n(function(r,t,a){var o=re(r);return t==="Io"?a.ordinalNumber(o,{unit:"week"}):f(o,t.length)},"I"),d:n(function(r,t,a){return t==="do"?a.ordinalNumber(r.getUTCDate(),{unit:"date"}):b.d(r,t)},"d"),D:n(function(r,t,a){var o=ee(r);return t==="Do"?a.ordinalNumber(o,{unit:"dayOfYear"}):f(o,t.length)},"D"),E:n(function(r,t,a){var o=r.getUTCDay();switch(t){case"E":case"EE":case"EEE":return a.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return a.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(o,{width:"short",context:"formatting"});default:return a.day(o,{width:"wide",context:"formatting"})}},"E"),e:n(function(r,t,a,o){var i=r.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return f(s,2);case"eo":return a.ordinalNumber(s,{unit:"day"});case"eee":return a.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(i,{width:"short",context:"formatting"});default:return a.day(i,{width:"wide",context:"formatting"})}},"e"),c:n(function(r,t,a,o){var i=r.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return f(s,t.length);case"co":return a.ordinalNumber(s,{unit:"day"});case"ccc":return a.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(i,{width:"narrow",context:"standalone"});case"cccccc":return a.day(i,{width:"short",context:"standalone"});default:return a.day(i,{width:"wide",context:"standalone"})}},"c"),i:n(function(r,t,a){var o=r.getUTCDay(),i=o===0?7:o;switch(t){case"i":return String(i);case"ii":return f(i,t.length);case"io":return a.ordinalNumber(i,{unit:"day"});case"iii":return a.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return a.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return a.day(o,{width:"short",context:"formatting"});default:return a.day(o,{width:"wide",context:"formatting"})}},"i"),a:n(function(r,t,a){var o=r.getUTCHours(),i=o/12>=1?"pm":"am";switch(t){case"a":case"aa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return a.dayPeriod(i,{width:"narrow",context:"formatting"});default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},"a"),b:n(function(r,t,a){var o=r.getUTCHours(),i;switch(o===12?i=_.noon:o===0?i=_.midnight:i=o/12>=1?"pm":"am",t){case"b":case"bb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return a.dayPeriod(i,{width:"narrow",context:"formatting"});default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},"b"),B:n(function(r,t,a){var o=r.getUTCHours(),i;switch(o>=17?i=_.evening:o>=12?i=_.afternoon:o>=4?i=_.morning:i=_.night,t){case"B":case"BB":case"BBB":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(i,{width:"narrow",context:"formatting"});default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},"B"),h:n(function(r,t,a){if(t==="ho"){var o=r.getUTCHours()%12;return o===0&&(o=12),a.ordinalNumber(o,{unit:"hour"})}return b.h(r,t)},"h"),H:n(function(r,t,a){return t==="Ho"?a.ordinalNumber(r.getUTCHours(),{unit:"hour"}):b.H(r,t)},"H"),K:n(function(r,t,a){var o=r.getUTCHours()%12;return t==="Ko"?a.ordinalNumber(o,{unit:"hour"}):f(o,t.length)},"K"),k:n(function(r,t,a){var o=r.getUTCHours();return o===0&&(o=24),t==="ko"?a.ordinalNumber(o,{unit:"hour"}):f(o,t.length)},"k"),m:n(function(r,t,a){return t==="mo"?a.ordinalNumber(r.getUTCMinutes(),{unit:"minute"}):b.m(r,t)},"m"),s:n(function(r,t,a){return t==="so"?a.ordinalNumber(r.getUTCSeconds(),{unit:"second"}):b.s(r,t)},"s"),S:n(function(r,t){return b.S(r,t)},"S"),X:n(function(r,t,a,o){var i=o._originalDate||r,s=i.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return fe(s);case"XXXX":case"XX":return D(s);default:return D(s,":")}},"X"),x:n(function(r,t,a,o){var i=o._originalDate||r,s=i.getTimezoneOffset();switch(t){case"x":return fe(s);case"xxxx":case"xx":return D(s);default:return D(s,":")}},"x"),O:n(function(r,t,a,o){var i=o._originalDate||r,s=i.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ue(s,":");default:return"GMT"+D(s,":")}},"O"),z:n(function(r,t,a,o){var i=o._originalDate||r,s=i.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ue(s,":");default:return"GMT"+D(s,":")}},"z"),t:n(function(r,t,a,o){var i=o._originalDate||r,s=Math.floor(i.getTime()/1e3);return f(s,t.length)},"t"),T:n(function(r,t,a,o){var i=o._originalDate||r,s=i.getTime();return f(s,t.length)},"T")};function ue(e,r){var t=e>0?"-":"+",a=Math.abs(e),o=Math.floor(a/60),i=a%60;if(i===0)return t+String(o);var s=r||"";return t+String(o)+s+f(i,2)}n(ue,"formatTimezoneShort");function fe(e,r){if(e%60===0){var t=e>0?"-":"+";return t+f(Math.abs(e)/60,2)}return D(e,r)}n(fe,"formatTimezoneWithOptionalMinutes");function D(e,r){var t=r||"",a=e>0?"-":"+",o=Math.abs(e),i=f(Math.floor(o/60),2),s=f(o%60,2);return a+i+t+s}n(D,"formatTimezone");var de=ze;var le=n(function(r,t){switch(r){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},"dateLongFormatter"),me=n(function(r,t){switch(r){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},"timeLongFormatter"),Je=n(function(r,t){var a=r.match(/(P+)(p+)?/)||[],o=a[1],i=a[2];if(!i)return le(r,t);var s;switch(o){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",le(o,t)).replace("{{time}}",me(i,t))},"dateTimeLongFormatter"),Ke={p:me,P:Je},ce=Ke;var Ze=["D","DD"],et=["YY","YYYY"];function pe(e){return Ze.indexOf(e)!==-1}n(pe,"isProtectedDayOfYearToken");function he(e){return et.indexOf(e)!==-1}n(he,"isProtectedWeekYearToken");function ne(e,r,t){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(r,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(r,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(r,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(r,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}n(ne,"throwProtectedError");var tt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},rt=n(function(r,t,a){var o,i=tt[r];return typeof i=="string"?o=i:t===1?o=i.one:o=i.other.replace("{{count}}",t.toString()),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"in "+o:o+" ago":o},"formatDistance"),ge=rt;function q(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=r.width?String(r.width):e.defaultWidth,a=e.formats[t]||e.formats[e.defaultWidth];return a}}n(q,"buildFormatLongFn");var at={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ot={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},nt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},it={date:q({formats:at,defaultWidth:"full"}),time:q({formats:ot,defaultWidth:"full"}),dateTime:q({formats:nt,defaultWidth:"full"})},ve=it;var st={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ut=n(function(r,t,a,o){return st[r]},"formatRelative"),xe=ut;function M(e){return function(r,t){var a=t!=null&&t.context?String(t.context):"standalone",o;if(a==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,s=t!=null&&t.width?String(t.width):i;o=e.formattingValues[s]||e.formattingValues[i]}else{var u=e.defaultWidth,c=t!=null&&t.width?String(t.width):e.defaultWidth;o=e.values[c]||e.values[u]}var l=e.argumentCallback?e.argumentCallback(r):r;return o[l]}}n(M,"buildLocalizeFn");var ft={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},dt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},lt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},mt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ct={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},pt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ht=n(function(r,t){var a=Number(r),o=a%100;if(o>20||o<10)switch(o%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},"ordinalNumber"),gt={ordinalNumber:ht,era:M({values:ft,defaultWidth:"wide"}),quarter:M({values:dt,defaultWidth:"wide",argumentCallback:n(function(r){return r-1},"argumentCallback")}),month:M({values:lt,defaultWidth:"wide"}),day:M({values:mt,defaultWidth:"wide"}),dayPeriod:M({values:ct,defaultWidth:"wide",formattingValues:pt,defaultFormattingWidth:"wide"})},ye=gt;function W(e){return function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=t.width,o=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],i=r.match(o);if(!i)return null;var s=i[0],u=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(u)?xt(u,function(p){return p.test(s)}):vt(u,function(p){return p.test(s)}),l;l=e.valueCallback?e.valueCallback(c):c,l=t.valueCallback?t.valueCallback(l):l;var h=r.slice(s.length);return{value:l,rest:h}}}n(W,"buildMatchFn");function vt(e,r){for(var t in e)if(e.hasOwnProperty(t)&&r(e[t]))return t}n(vt,"findKey");function xt(e,r){for(var t=0;t<e.length;t++)if(r(e[t]))return t}n(xt,"findIndex");function ie(e){return function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.match(e.matchPattern);if(!a)return null;var o=a[0],i=r.match(e.parsePattern);if(!i)return null;var s=e.valueCallback?e.valueCallback(i[0]):i[0];s=t.valueCallback?t.valueCallback(s):s;var u=r.slice(o.length);return{value:s,rest:u}}}n(ie,"buildMatchPatternFn");var yt=/^(\d+)(th|st|nd|rd)?/i,wt=/\d+/i,bt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ot={any:[/^b/i,/^(a|c)/i]},kt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Tt={any:[/1/i,/2/i,/3/i,/4/i]},St={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ct={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Dt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Mt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Wt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},It={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_t={ordinalNumber:ie({matchPattern:yt,parsePattern:wt,valueCallback:n(function(r){return parseInt(r,10)},"valueCallback")}),era:W({matchPatterns:bt,defaultMatchWidth:"wide",parsePatterns:Ot,defaultParseWidth:"any"}),quarter:W({matchPatterns:kt,defaultMatchWidth:"wide",parsePatterns:Tt,defaultParseWidth:"any",valueCallback:n(function(r){return r+1},"valueCallback")}),month:W({matchPatterns:St,defaultMatchWidth:"wide",parsePatterns:Ct,defaultParseWidth:"any"}),day:W({matchPatterns:Dt,defaultMatchWidth:"wide",parsePatterns:Mt,defaultParseWidth:"any"}),dayPeriod:W({matchPatterns:Wt,defaultMatchWidth:"any",parsePatterns:It,defaultParseWidth:"any"})},we=_t;var Pt={code:"en-US",formatDistance:ge,formatLong:ve,formatRelative:xe,localize:ye,match:we,options:{weekStartsOn:0,firstWeekContainsDate:1}},be=Pt;var Oe=be;var Yt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ut=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Et=/^'([^]*?)'?$/,Ft=/''/g,Lt=/[a-zA-Z]/;function N(e,r,t){var a,o,i,s,u,c,l,h,p,v,g,w,P,C,Y,R,Q,B;d(2,arguments);var Ue=String(r),U=k(),E=(a=(o=t?.locale)!==null&&o!==void 0?o:U.locale)!==null&&a!==void 0?a:Oe,X=x((i=(s=(u=(c=t?.firstWeekContainsDate)!==null&&c!==void 0?c:t==null||(l=t.locale)===null||l===void 0||(h=l.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&u!==void 0?u:U.firstWeekContainsDate)!==null&&s!==void 0?s:(p=U.locale)===null||p===void 0||(v=p.options)===null||v===void 0?void 0:v.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(X>=1&&X<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var j=x((g=(w=(P=(C=t?.weekStartsOn)!==null&&C!==void 0?C:t==null||(Y=t.locale)===null||Y===void 0||(R=Y.options)===null||R===void 0?void 0:R.weekStartsOn)!==null&&P!==void 0?P:U.weekStartsOn)!==null&&w!==void 0?w:(Q=U.locale)===null||Q===void 0||(B=Q.options)===null||B===void 0?void 0:B.weekStartsOn)!==null&&g!==void 0?g:0);if(!(j>=0&&j<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!E.localize)throw new RangeError("locale must contain localize property");if(!E.formatLong)throw new RangeError("locale must contain formatLong property");var V=m(e);if(!K(V))throw new RangeError("Invalid time value");var Ee=z(V),Fe=Z(V,Ee),Le={firstWeekContainsDate:X,weekStartsOn:j,locale:E,_originalDate:V},qe=Ue.match(Ut).map(function(y){var O=y[0];if(O==="p"||O==="P"){var A=ce[O];return A(y,E.formatLong)}return y}).join("").match(Yt).map(function(y){if(y==="''")return"'";var O=y[0];if(O==="'")return qt(y);var A=de[O];if(A)return!(t!=null&&t.useAdditionalWeekYearTokens)&&he(y)&&ne(y,r,String(e)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&pe(y)&&ne(y,r,String(e)),A(Fe,y,E.localize,Le);if(O.match(Lt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+O+"`");return y}).join("");return qe}n(N,"format");function qt(e){var r=e.match(Et);return r?r[1].replace(Ft,"'"):e}n(qt,"cleanEscapedString");var Nt=new Set(["status","credentialStatus"]),Te=n(e=>Nt.has(e),"isStatusCheck"),Se=n(e=>{switch(e){case"revocation":return"Revocation";case"suspension":return"Suspension";default:return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,r=>r.toUpperCase())}},"getStatusPurposeLabel"),Vt=n(e=>{switch(e){case"revocation":return"Not Revoked";case"suspension":return"Not Suspended";default:return`${Se(e)} Clear`}},"getClearStatusMessage"),Ce=n(e=>{switch(e){case"revocation":return"Revoked";case"suspension":return"Suspended";default:return`${Se(e)} Set`}},"getSetStatusMessage"),ke=n(e=>[...new Set(e.map(r=>r.statusPurpose))],"getUniqueStatusPurposes"),De=n((e=[])=>{let r=e.filter(a=>a.isSet);if(r.length>0)return ke(r).map(Ce).join(", ");let t=ke(e);return t.length===1?Vt(t[0]):"Active"},"transformStatusCheckMessage"),Me=n((e,r)=>{if(/credential is revoked/i.test(e))return"Status: Revoked";if(/credential is suspended/i.test(e))return"Status: Suspended";let t=e.match(/credential status is set for purpose:\s*([^.]+)/i)?.[1];if(t)return`Status: ${Ce(t.trim())}`;if(!/status/i.test(e))return;let a=r?.status?.filter(o=>o.isSet)??[];if(a.length>0)return`Status: ${De(a)}`},"getStatusErrorMessage"),At=n((e,r,t)=>Me(e,t)?"status":e.split(" error")[0]||e,"transformErrorCheck"),Ht=n((e,r,t)=>{let a=Me(e,t);return a||(e.startsWith("expiration")?r.expirationDate?`Expired ${N(new Date(r.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Expired":e)},"transformErrorMessage"),$t=n((e,r)=>e.includes("Boost Authenticity")?"Boost Authenticity":e.split(" warning")[0]||e,"transformWarningCheck"),Rt=n((e,r,t)=>Te(e)?De(t.status):{proof:"Valid",expiration:r.expirationDate?`Expires ${N(new Date(r.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Does Not Expire"}[e]||e,"transformCheckMessage"),We=n(e=>async(r,t,a,o=!1)=>{let i=await e.invoke.verifyCredential(t,a);if(!o)return i;let s=[];return i.errors.forEach(u=>{s.push({status:$.VerificationStatusEnum.Failed,check:At(u,t,i),details:Ht(u,t,i)})}),i.warnings.forEach(u=>{s.push({status:$.VerificationStatusEnum.Error,check:$t(u,t),message:u})}),i.checks.forEach(u=>{s.push({status:$.VerificationStatusEnum.Success,check:Te(u)?"status":u,message:Rt(u,t,i)})}),s},"verifyCredential");var _e=require("@learncard/types");var Qt={parse:{check:"Format",message:"Valid"},disclosure_hash_integrity:{check:"Selective Disclosure",message:"Claims verified"},issuer_resolved:{check:"Issuer",message:"Identified"},issuer_signature:{check:"Signature",message:"Valid"},expiration:{check:"Expiration",message:"Does Not Expire"},vct:{check:"Credential Type",message:"Verified"},proof:{check:"Proof",message:"Valid"},credentialStatus:{check:"Status",message:"Active"},status:{check:"Status",message:"Active"},credentialSchema:{check:"Schema",message:"Valid"}},Pe={invalid_compact_form:{check:"Format",message:"Invalid"},invalid_jwt:{check:"Format",message:"Invalid"},invalid_typ:{check:"Format",message:"Invalid type"},missing_iss:{check:"Issuer",message:"Missing"},missing_vct:{check:"Credential Type",message:"Missing"},missing_alg:{check:"Signature",message:"Algorithm missing"},unsupported_alg:{check:"Signature",message:"Unsupported algorithm"},unsupported_sd_alg:{check:"Selective Disclosure",message:"Unsupported algorithm"},invalid_disclosure:{check:"Selective Disclosure",message:"Invalid"},disclosure_hash_mismatch:{check:"Selective Disclosure",message:"Tampered"},issuer_resolution_failed:{check:"Issuer",message:"Could not be found"},verification_method_not_found:{check:"Issuer",message:"Key not found"},verification_method_not_authorized:{check:"Issuer",message:"Key not authorized"},signature_invalid:{check:"Signature",message:"Invalid"},expired:{check:"Expiration",message:"Expired"},not_yet_valid:{check:"Expiration",message:"Not yet valid"},vct_mismatch:{check:"Credential Type",message:"Mismatch"},status_check_failed:{check:"Status",message:"Revoked or suspended"},kb_jwt_invalid:{check:"Key Binding",message:"Invalid"},presentation_verification_failed:{check:"Presentation",message:"Invalid"},key_binding_mismatch:{check:"Holder Key",message:"Mismatch"},unsupported_cnf_confirmation_type:{check:"Holder Key",message:"Unsupported type"},internal_error:{check:"Verification",message:"Something went wrong"}},Bt=n(e=>e?/^[A-Z]/.test(e)||/\s/.test(e):!0,"isAlreadyPrettified"),Ie=n(e=>e?e.match(/^([a-z][a-z0-9_]*):/)?.[1]:void 0,"extractErrorCode"),Xt=n(e=>{if(!e)return;let r=e.split(/[:\s]/)[0];return/^[a-z][a-z0-9_]*$/.test(r)?r:void 0},"codeFromCheck"),jt=n(e=>[Ie(e.message),Ie(e.details),Xt(e.check)].find(t=>t!==void 0&&t in Pe),"resolveErrorCode"),se=n((e,r)=>!!(!e||e===r||/^[a-z][a-z0-9_]*$/.test(e)||e.startsWith(`${r}:`)),"isMessageRaw"),Ye=n(e=>{if(e.status===_e.VerificationStatusEnum.Failed){let a=jt(e);if(!a)return e;let o=Pe[a],i=!!e.details&&!se(e.details,e.check),s=!!e.message&&!se(e.message,e.check),u;return s?u=e.message:i?u=void 0:u=o.message,{...e,check:o.check,message:u}}if(Bt(e.check))return e;let t=Qt[e.check];return t?{...e,check:t.check,message:se(e.message,e.check)?t.message:e.message}:e},"prettifyVerificationItem"),Gt=n(e=>e.map(Ye),"prettifyVerificationItems");var zt=n(e=>({name:"LearnCard",displayName:"LearnCard",description:"Adds opinionated logic to a LearnCard",methods:{verifyCredential:We(e)}}),"getLearnCardPlugin");
1
+ "use strict";var H=Object.defineProperty;var qe=Object.getOwnPropertyDescriptor;var Ve=Object.getOwnPropertyNames;var Ae=Object.prototype.hasOwnProperty;var n=(e,r)=>H(e,"name",{value:r,configurable:!0});var He=(e,r)=>{for(var t in r)H(e,t,{get:r[t],enumerable:!0})},Re=(e,r,t,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Ve(r))!Ae.call(e,o)&&o!==t&&H(e,o,{get:()=>r[o],enumerable:!(a=qe(r,o))||a.enumerable});return e};var $e=e=>Re(H({},"__esModule",{value:!0}),e);var Zt={};He(Zt,{getLearnCardPlugin:()=>Kt,prettifyVerificationItem:()=>Ye,prettifyVerificationItems:()=>Jt});module.exports=$e(Zt);var R=require("@learncard/types");function I(e){"@babel/helpers - typeof";return I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},I(e)}n(I,"_typeof");function x(e){if(e===null||e===!0||e===!1)return NaN;var r=Number(e);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}n(x,"toInteger");function d(e,r){if(r.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+r.length+" present")}n(d,"requiredArgs");function c(e){d(1,arguments);var r=Object.prototype.toString.call(e);return e instanceof Date||I(e)==="object"&&r==="[object Date]"?new Date(e.getTime()):typeof e=="number"||r==="[object Number]"?new Date(e):((typeof e=="string"||r==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}n(c,"toDate");function G(e,r){d(2,arguments);var t=c(e).getTime(),a=x(r);return new Date(t+a)}n(G,"addMilliseconds");var Qe={};function O(){return Qe}n(O,"getDefaultOptions");function z(e){var r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),e.getTime()-r.getTime()}n(z,"getTimezoneOffsetInMilliseconds");function J(e){return d(1,arguments),e instanceof Date||I(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}n(J,"isDate");function K(e){if(d(1,arguments),!J(e)&&typeof e!="number")return!1;var r=c(e);return!isNaN(Number(r))}n(K,"isValid");function Z(e,r){d(2,arguments);var t=x(r);return G(e,-t)}n(Z,"subMilliseconds");var Be=864e5;function ee(e){d(1,arguments);var r=c(e),t=r.getTime();r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0);var a=r.getTime(),o=t-a;return Math.floor(o/Be)+1}n(ee,"getUTCDayOfYear");function T(e){d(1,arguments);var r=1,t=c(e),a=t.getUTCDay(),o=(a<r?7:0)+a-r;return t.setUTCDate(t.getUTCDate()-o),t.setUTCHours(0,0,0,0),t}n(T,"startOfUTCISOWeek");function F(e){d(1,arguments);var r=c(e),t=r.getUTCFullYear(),a=new Date(0);a.setUTCFullYear(t+1,0,4),a.setUTCHours(0,0,0,0);var o=T(a),i=new Date(0);i.setUTCFullYear(t,0,4),i.setUTCHours(0,0,0,0);var s=T(i);return r.getTime()>=o.getTime()?t+1:r.getTime()>=s.getTime()?t:t-1}n(F,"getUTCISOWeekYear");function te(e){d(1,arguments);var r=F(e),t=new Date(0);t.setUTCFullYear(r,0,4),t.setUTCHours(0,0,0,0);var a=T(t);return a}n(te,"startOfUTCISOWeekYear");var je=6048e5;function re(e){d(1,arguments);var r=c(e),t=T(r).getTime()-te(r).getTime();return Math.round(t/je)+1}n(re,"getUTCISOWeek");function S(e,r){var t,a,o,i,s,u,l,m;d(1,arguments);var h=O(),p=x((t=(a=(o=(i=r?.weekStartsOn)!==null&&i!==void 0?i:r==null||(s=r.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&o!==void 0?o:h.weekStartsOn)!==null&&a!==void 0?a:(l=h.locale)===null||l===void 0||(m=l.options)===null||m===void 0?void 0:m.weekStartsOn)!==null&&t!==void 0?t:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var v=c(e),g=v.getUTCDay(),w=(g<p?7:0)+g-p;return v.setUTCDate(v.getUTCDate()-w),v.setUTCHours(0,0,0,0),v}n(S,"startOfUTCWeek");function L(e,r){var t,a,o,i,s,u,l,m;d(1,arguments);var h=c(e),p=h.getUTCFullYear(),v=O(),g=x((t=(a=(o=(i=r?.firstWeekContainsDate)!==null&&i!==void 0?i:r==null||(s=r.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:v.firstWeekContainsDate)!==null&&a!==void 0?a:(l=v.locale)===null||l===void 0||(m=l.options)===null||m===void 0?void 0:m.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(g>=1&&g<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var w=new Date(0);w.setUTCFullYear(p+1,0,g),w.setUTCHours(0,0,0,0);var P=S(w,r),C=new Date(0);C.setUTCFullYear(p,0,g),C.setUTCHours(0,0,0,0);var Y=S(C,r);return h.getTime()>=P.getTime()?p+1:h.getTime()>=Y.getTime()?p:p-1}n(L,"getUTCWeekYear");function ae(e,r){var t,a,o,i,s,u,l,m;d(1,arguments);var h=O(),p=x((t=(a=(o=(i=r?.firstWeekContainsDate)!==null&&i!==void 0?i:r==null||(s=r.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:h.firstWeekContainsDate)!==null&&a!==void 0?a:(l=h.locale)===null||l===void 0||(m=l.options)===null||m===void 0?void 0:m.firstWeekContainsDate)!==null&&t!==void 0?t:1),v=L(e,r),g=new Date(0);g.setUTCFullYear(v,0,p),g.setUTCHours(0,0,0,0);var w=S(g,r);return w}n(ae,"startOfUTCWeekYear");var Xe=6048e5;function oe(e,r){d(1,arguments);var t=c(e),a=S(t,r).getTime()-ae(t,r).getTime();return Math.round(a/Xe)+1}n(oe,"getUTCWeek");function f(e,r){for(var t=e<0?"-":"",a=Math.abs(e).toString();a.length<r;)a="0"+a;return t+a}n(f,"addLeadingZeros");var Ge={y:n(function(r,t){var a=r.getUTCFullYear(),o=a>0?a:1-a;return f(t==="yy"?o%100:o,t.length)},"y"),M:n(function(r,t){var a=r.getUTCMonth();return t==="M"?String(a+1):f(a+1,2)},"M"),d:n(function(r,t){return f(r.getUTCDate(),t.length)},"d"),a:n(function(r,t){var a=r.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];default:return a==="am"?"a.m.":"p.m."}},"a"),h:n(function(r,t){return f(r.getUTCHours()%12||12,t.length)},"h"),H:n(function(r,t){return f(r.getUTCHours(),t.length)},"H"),m:n(function(r,t){return f(r.getUTCMinutes(),t.length)},"m"),s:n(function(r,t){return f(r.getUTCSeconds(),t.length)},"s"),S:n(function(r,t){var a=t.length,o=r.getUTCMilliseconds(),i=Math.floor(o*Math.pow(10,a-3));return f(i,t.length)},"S")},b=Ge;var _={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ze={G:n(function(r,t,a){var o=r.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return a.era(o,{width:"abbreviated"});case"GGGGG":return a.era(o,{width:"narrow"});default:return a.era(o,{width:"wide"})}},"G"),y:n(function(r,t,a){if(t==="yo"){var o=r.getUTCFullYear(),i=o>0?o:1-o;return a.ordinalNumber(i,{unit:"year"})}return b.y(r,t)},"y"),Y:n(function(r,t,a,o){var i=L(r,o),s=i>0?i:1-i;if(t==="YY"){var u=s%100;return f(u,2)}return t==="Yo"?a.ordinalNumber(s,{unit:"year"}):f(s,t.length)},"Y"),R:n(function(r,t){var a=F(r);return f(a,t.length)},"R"),u:n(function(r,t){var a=r.getUTCFullYear();return f(a,t.length)},"u"),Q:n(function(r,t,a){var o=Math.ceil((r.getUTCMonth()+1)/3);switch(t){case"Q":return String(o);case"QQ":return f(o,2);case"Qo":return a.ordinalNumber(o,{unit:"quarter"});case"QQQ":return a.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return a.quarter(o,{width:"narrow",context:"formatting"});default:return a.quarter(o,{width:"wide",context:"formatting"})}},"Q"),q:n(function(r,t,a){var o=Math.ceil((r.getUTCMonth()+1)/3);switch(t){case"q":return String(o);case"qq":return f(o,2);case"qo":return a.ordinalNumber(o,{unit:"quarter"});case"qqq":return a.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return a.quarter(o,{width:"narrow",context:"standalone"});default:return a.quarter(o,{width:"wide",context:"standalone"})}},"q"),M:n(function(r,t,a){var o=r.getUTCMonth();switch(t){case"M":case"MM":return b.M(r,t);case"Mo":return a.ordinalNumber(o+1,{unit:"month"});case"MMM":return a.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return a.month(o,{width:"narrow",context:"formatting"});default:return a.month(o,{width:"wide",context:"formatting"})}},"M"),L:n(function(r,t,a){var o=r.getUTCMonth();switch(t){case"L":return String(o+1);case"LL":return f(o+1,2);case"Lo":return a.ordinalNumber(o+1,{unit:"month"});case"LLL":return a.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return a.month(o,{width:"narrow",context:"standalone"});default:return a.month(o,{width:"wide",context:"standalone"})}},"L"),w:n(function(r,t,a,o){var i=oe(r,o);return t==="wo"?a.ordinalNumber(i,{unit:"week"}):f(i,t.length)},"w"),I:n(function(r,t,a){var o=re(r);return t==="Io"?a.ordinalNumber(o,{unit:"week"}):f(o,t.length)},"I"),d:n(function(r,t,a){return t==="do"?a.ordinalNumber(r.getUTCDate(),{unit:"date"}):b.d(r,t)},"d"),D:n(function(r,t,a){var o=ee(r);return t==="Do"?a.ordinalNumber(o,{unit:"dayOfYear"}):f(o,t.length)},"D"),E:n(function(r,t,a){var o=r.getUTCDay();switch(t){case"E":case"EE":case"EEE":return a.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return a.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(o,{width:"short",context:"formatting"});default:return a.day(o,{width:"wide",context:"formatting"})}},"E"),e:n(function(r,t,a,o){var i=r.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return f(s,2);case"eo":return a.ordinalNumber(s,{unit:"day"});case"eee":return a.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(i,{width:"short",context:"formatting"});default:return a.day(i,{width:"wide",context:"formatting"})}},"e"),c:n(function(r,t,a,o){var i=r.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return f(s,t.length);case"co":return a.ordinalNumber(s,{unit:"day"});case"ccc":return a.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(i,{width:"narrow",context:"standalone"});case"cccccc":return a.day(i,{width:"short",context:"standalone"});default:return a.day(i,{width:"wide",context:"standalone"})}},"c"),i:n(function(r,t,a){var o=r.getUTCDay(),i=o===0?7:o;switch(t){case"i":return String(i);case"ii":return f(i,t.length);case"io":return a.ordinalNumber(i,{unit:"day"});case"iii":return a.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return a.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return a.day(o,{width:"short",context:"formatting"});default:return a.day(o,{width:"wide",context:"formatting"})}},"i"),a:n(function(r,t,a){var o=r.getUTCHours(),i=o/12>=1?"pm":"am";switch(t){case"a":case"aa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return a.dayPeriod(i,{width:"narrow",context:"formatting"});default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},"a"),b:n(function(r,t,a){var o=r.getUTCHours(),i;switch(o===12?i=_.noon:o===0?i=_.midnight:i=o/12>=1?"pm":"am",t){case"b":case"bb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return a.dayPeriod(i,{width:"narrow",context:"formatting"});default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},"b"),B:n(function(r,t,a){var o=r.getUTCHours(),i;switch(o>=17?i=_.evening:o>=12?i=_.afternoon:o>=4?i=_.morning:i=_.night,t){case"B":case"BB":case"BBB":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(i,{width:"narrow",context:"formatting"});default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},"B"),h:n(function(r,t,a){if(t==="ho"){var o=r.getUTCHours()%12;return o===0&&(o=12),a.ordinalNumber(o,{unit:"hour"})}return b.h(r,t)},"h"),H:n(function(r,t,a){return t==="Ho"?a.ordinalNumber(r.getUTCHours(),{unit:"hour"}):b.H(r,t)},"H"),K:n(function(r,t,a){var o=r.getUTCHours()%12;return t==="Ko"?a.ordinalNumber(o,{unit:"hour"}):f(o,t.length)},"K"),k:n(function(r,t,a){var o=r.getUTCHours();return o===0&&(o=24),t==="ko"?a.ordinalNumber(o,{unit:"hour"}):f(o,t.length)},"k"),m:n(function(r,t,a){return t==="mo"?a.ordinalNumber(r.getUTCMinutes(),{unit:"minute"}):b.m(r,t)},"m"),s:n(function(r,t,a){return t==="so"?a.ordinalNumber(r.getUTCSeconds(),{unit:"second"}):b.s(r,t)},"s"),S:n(function(r,t){return b.S(r,t)},"S"),X:n(function(r,t,a,o){var i=o._originalDate||r,s=i.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return fe(s);case"XXXX":case"XX":return D(s);default:return D(s,":")}},"X"),x:n(function(r,t,a,o){var i=o._originalDate||r,s=i.getTimezoneOffset();switch(t){case"x":return fe(s);case"xxxx":case"xx":return D(s);default:return D(s,":")}},"x"),O:n(function(r,t,a,o){var i=o._originalDate||r,s=i.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ue(s,":");default:return"GMT"+D(s,":")}},"O"),z:n(function(r,t,a,o){var i=o._originalDate||r,s=i.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ue(s,":");default:return"GMT"+D(s,":")}},"z"),t:n(function(r,t,a,o){var i=o._originalDate||r,s=Math.floor(i.getTime()/1e3);return f(s,t.length)},"t"),T:n(function(r,t,a,o){var i=o._originalDate||r,s=i.getTime();return f(s,t.length)},"T")};function ue(e,r){var t=e>0?"-":"+",a=Math.abs(e),o=Math.floor(a/60),i=a%60;if(i===0)return t+String(o);var s=r||"";return t+String(o)+s+f(i,2)}n(ue,"formatTimezoneShort");function fe(e,r){if(e%60===0){var t=e>0?"-":"+";return t+f(Math.abs(e)/60,2)}return D(e,r)}n(fe,"formatTimezoneWithOptionalMinutes");function D(e,r){var t=r||"",a=e>0?"-":"+",o=Math.abs(e),i=f(Math.floor(o/60),2),s=f(o%60,2);return a+i+t+s}n(D,"formatTimezone");var de=ze;var le=n(function(r,t){switch(r){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},"dateLongFormatter"),me=n(function(r,t){switch(r){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},"timeLongFormatter"),Je=n(function(r,t){var a=r.match(/(P+)(p+)?/)||[],o=a[1],i=a[2];if(!i)return le(r,t);var s;switch(o){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",le(o,t)).replace("{{time}}",me(i,t))},"dateTimeLongFormatter"),Ke={p:me,P:Je},ce=Ke;var Ze=["D","DD"],et=["YY","YYYY"];function pe(e){return Ze.indexOf(e)!==-1}n(pe,"isProtectedDayOfYearToken");function he(e){return et.indexOf(e)!==-1}n(he,"isProtectedWeekYearToken");function ne(e,r,t){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(r,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(r,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(r,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(r,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}n(ne,"throwProtectedError");var tt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},rt=n(function(r,t,a){var o,i=tt[r];return typeof i=="string"?o=i:t===1?o=i.one:o=i.other.replace("{{count}}",t.toString()),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"in "+o:o+" ago":o},"formatDistance"),ge=rt;function N(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=r.width?String(r.width):e.defaultWidth,a=e.formats[t]||e.formats[e.defaultWidth];return a}}n(N,"buildFormatLongFn");var at={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ot={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},nt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},it={date:N({formats:at,defaultWidth:"full"}),time:N({formats:ot,defaultWidth:"full"}),dateTime:N({formats:nt,defaultWidth:"full"})},ve=it;var st={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ut=n(function(r,t,a,o){return st[r]},"formatRelative"),xe=ut;function M(e){return function(r,t){var a=t!=null&&t.context?String(t.context):"standalone",o;if(a==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,s=t!=null&&t.width?String(t.width):i;o=e.formattingValues[s]||e.formattingValues[i]}else{var u=e.defaultWidth,l=t!=null&&t.width?String(t.width):e.defaultWidth;o=e.values[l]||e.values[u]}var m=e.argumentCallback?e.argumentCallback(r):r;return o[m]}}n(M,"buildLocalizeFn");var ft={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},dt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},lt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},mt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ct={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},pt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ht=n(function(r,t){var a=Number(r),o=a%100;if(o>20||o<10)switch(o%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},"ordinalNumber"),gt={ordinalNumber:ht,era:M({values:ft,defaultWidth:"wide"}),quarter:M({values:dt,defaultWidth:"wide",argumentCallback:n(function(r){return r-1},"argumentCallback")}),month:M({values:lt,defaultWidth:"wide"}),day:M({values:mt,defaultWidth:"wide"}),dayPeriod:M({values:ct,defaultWidth:"wide",formattingValues:pt,defaultFormattingWidth:"wide"})},ye=gt;function W(e){return function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=t.width,o=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],i=r.match(o);if(!i)return null;var s=i[0],u=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(u)?xt(u,function(p){return p.test(s)}):vt(u,function(p){return p.test(s)}),m;m=e.valueCallback?e.valueCallback(l):l,m=t.valueCallback?t.valueCallback(m):m;var h=r.slice(s.length);return{value:m,rest:h}}}n(W,"buildMatchFn");function vt(e,r){for(var t in e)if(e.hasOwnProperty(t)&&r(e[t]))return t}n(vt,"findKey");function xt(e,r){for(var t=0;t<e.length;t++)if(r(e[t]))return t}n(xt,"findIndex");function ie(e){return function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.match(e.matchPattern);if(!a)return null;var o=a[0],i=r.match(e.parsePattern);if(!i)return null;var s=e.valueCallback?e.valueCallback(i[0]):i[0];s=t.valueCallback?t.valueCallback(s):s;var u=r.slice(o.length);return{value:s,rest:u}}}n(ie,"buildMatchPatternFn");var yt=/^(\d+)(th|st|nd|rd)?/i,wt=/\d+/i,bt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},kt={any:[/^b/i,/^(a|c)/i]},Ot={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Tt={any:[/1/i,/2/i,/3/i,/4/i]},St={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ct={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Dt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Mt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Wt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},It={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_t={ordinalNumber:ie({matchPattern:yt,parsePattern:wt,valueCallback:n(function(r){return parseInt(r,10)},"valueCallback")}),era:W({matchPatterns:bt,defaultMatchWidth:"wide",parsePatterns:kt,defaultParseWidth:"any"}),quarter:W({matchPatterns:Ot,defaultMatchWidth:"wide",parsePatterns:Tt,defaultParseWidth:"any",valueCallback:n(function(r){return r+1},"valueCallback")}),month:W({matchPatterns:St,defaultMatchWidth:"wide",parsePatterns:Ct,defaultParseWidth:"any"}),day:W({matchPatterns:Dt,defaultMatchWidth:"wide",parsePatterns:Mt,defaultParseWidth:"any"}),dayPeriod:W({matchPatterns:Wt,defaultMatchWidth:"any",parsePatterns:It,defaultParseWidth:"any"})},we=_t;var Pt={code:"en-US",formatDistance:ge,formatLong:ve,formatRelative:xe,localize:ye,match:we,options:{weekStartsOn:0,firstWeekContainsDate:1}},be=Pt;var ke=be;var Yt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ut=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Et=/^'([^]*?)'?$/,Ft=/''/g,Lt=/[a-zA-Z]/;function q(e,r,t){var a,o,i,s,u,l,m,h,p,v,g,w,P,C,Y,$,Q,B;d(2,arguments);var Ue=String(r),U=O(),E=(a=(o=t?.locale)!==null&&o!==void 0?o:U.locale)!==null&&a!==void 0?a:ke,j=x((i=(s=(u=(l=t?.firstWeekContainsDate)!==null&&l!==void 0?l:t==null||(m=t.locale)===null||m===void 0||(h=m.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&u!==void 0?u:U.firstWeekContainsDate)!==null&&s!==void 0?s:(p=U.locale)===null||p===void 0||(v=p.options)===null||v===void 0?void 0:v.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(j>=1&&j<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var X=x((g=(w=(P=(C=t?.weekStartsOn)!==null&&C!==void 0?C:t==null||(Y=t.locale)===null||Y===void 0||($=Y.options)===null||$===void 0?void 0:$.weekStartsOn)!==null&&P!==void 0?P:U.weekStartsOn)!==null&&w!==void 0?w:(Q=U.locale)===null||Q===void 0||(B=Q.options)===null||B===void 0?void 0:B.weekStartsOn)!==null&&g!==void 0?g:0);if(!(X>=0&&X<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!E.localize)throw new RangeError("locale must contain localize property");if(!E.formatLong)throw new RangeError("locale must contain formatLong property");var V=c(e);if(!K(V))throw new RangeError("Invalid time value");var Ee=z(V),Fe=Z(V,Ee),Le={firstWeekContainsDate:j,weekStartsOn:X,locale:E,_originalDate:V},Ne=Ue.match(Ut).map(function(y){var k=y[0];if(k==="p"||k==="P"){var A=ce[k];return A(y,E.formatLong)}return y}).join("").match(Yt).map(function(y){if(y==="''")return"'";var k=y[0];if(k==="'")return Nt(y);var A=de[k];if(A)return!(t!=null&&t.useAdditionalWeekYearTokens)&&he(y)&&ne(y,r,String(e)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&pe(y)&&ne(y,r,String(e)),A(Fe,y,E.localize,Le);if(k.match(Lt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return y}).join("");return Ne}n(q,"format");function Nt(e){var r=e.match(Et);return r?r[1].replace(Ft,"'"):e}n(Nt,"cleanEscapedString");var qt=new Set(["status","credentialStatus"]),Te=n(e=>qt.has(e),"isStatusCheck"),Se=n(e=>{switch(e){case"revocation":return"Revocation";case"suspension":return"Suspension";default:return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,r=>r.toUpperCase())}},"getStatusPurposeLabel"),Vt=n(e=>{switch(e){case"revocation":return"Not Revoked";case"suspension":return"Not Suspended";default:return`${Se(e)} Clear`}},"getClearStatusMessage"),Ce=n(e=>{switch(e){case"revocation":return"Revoked";case"suspension":return"Suspended";default:return`${Se(e)} Set`}},"getSetStatusMessage"),Oe=n(e=>[...new Set(e.map(r=>r.statusPurpose))],"getUniqueStatusPurposes"),De=n((e=[])=>{let r=e.filter(a=>a.isSet);if(r.length>0)return Oe(r).map(Ce).join(", ");let t=Oe(e);return t.length===1?Vt(t[0]):"Active"},"transformStatusCheckMessage"),Me=n((e,r)=>{if(/credential is revoked/i.test(e))return"Status: Revoked";if(/credential is suspended/i.test(e))return"Status: Suspended";let t=e.match(/credential status is set for purpose:\s*([^.]+)/i)?.[1];if(t)return`Status: ${Ce(t.trim())}`;if(!/status/i.test(e))return;let a=r?.status?.filter(o=>o.isSet)??[];if(a.length>0)return`Status: ${De(a)}`},"getStatusErrorMessage"),At=n((e,r,t)=>Me(e,t)?"status":e.split(" error")[0]||e,"transformErrorCheck"),Ht=n((e,r,t)=>{let a=Me(e,t);return a||(e.startsWith("expiration")?r.expirationDate?`Expired ${q(new Date(r.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Expired":e)},"transformErrorMessage"),Rt=n((e,r)=>e.includes("Boost Authenticity")?"Boost Authenticity":e.split(" warning")[0]||e,"transformWarningCheck"),$t=n((e,r,t)=>Te(e)?De(t.status):{proof:"Valid",expiration:r.expirationDate?`Expires ${q(new Date(r.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Does Not Expire"}[e]||e,"transformCheckMessage"),We=n(e=>async(r,t,a,o=!1)=>{let i=await e.invoke.verifyCredential(t,a);if(!o)return i;let s=[];return i.errors.forEach(u=>{s.push({status:R.VerificationStatusEnum.Failed,check:At(u,t,i),details:Ht(u,t,i)})}),i.warnings.forEach(u=>{s.push({status:R.VerificationStatusEnum.Error,check:Rt(u,t),message:u})}),i.checks.forEach(u=>{s.push({status:R.VerificationStatusEnum.Success,check:Te(u)?"status":u,message:$t(u,t,i)})}),s},"verifyCredential");var _e=require("@learncard/types");var Qt={parse:{check:"Format",message:"Valid"},disclosure_hash_integrity:{check:"Selective Disclosure",message:"Claims verified"},issuer_resolved:{check:"Issuer",message:"Identified"},issuer_signature:{check:"Signature",message:"Valid"},expiration:{check:"Expiration",message:"Does Not Expire"},vct:{check:"Credential Type",message:"Verified"},proof:{check:"Proof",message:"Valid"},credentialStatus:{check:"Status",message:"Active"},status:{check:"Status",message:"Active"},credentialSchema:{check:"Schema",message:"Valid"}},Pe={invalid_compact_form:{check:"Format",message:"Invalid"},invalid_jwt:{check:"Format",message:"Invalid"},invalid_typ:{check:"Format",message:"Invalid type"},missing_iss:{check:"Issuer",message:"Missing"},missing_vct:{check:"Credential Type",message:"Missing"},missing_alg:{check:"Signature",message:"Algorithm missing"},unsupported_alg:{check:"Signature",message:"Unsupported algorithm"},unsupported_sd_alg:{check:"Selective Disclosure",message:"Unsupported algorithm"},invalid_disclosure:{check:"Selective Disclosure",message:"Invalid"},disclosure_hash_mismatch:{check:"Selective Disclosure",message:"Tampered"},issuer_resolution_failed:{check:"Issuer",message:"Could not be found"},verification_method_not_found:{check:"Issuer",message:"Key not found"},verification_method_not_authorized:{check:"Issuer",message:"Key not authorized"},signature_invalid:{check:"Signature",message:"Invalid"},expired:{check:"Expiration",message:"Expired"},not_yet_valid:{check:"Expiration",message:"Not yet valid"},vct_mismatch:{check:"Credential Type",message:"Mismatch"},status_check_failed:{check:"Status",message:"Revoked or suspended"},kb_jwt_invalid:{check:"Key Binding",message:"Invalid"},presentation_verification_failed:{check:"Presentation",message:"Invalid"},key_binding_mismatch:{check:"Holder Key",message:"Mismatch"},unsupported_cnf_confirmation_type:{check:"Holder Key",message:"Unsupported type"},internal_error:{check:"Verification",message:"Something went wrong"}},Bt=/unable to resolve|error sending (?:an? )?(?:http )?request|failed to fetch|well-known\/did\.json|dereferenc|network ?error/i,jt=/wasm-function|\bat https?:\/\/|\.js:\d+|\bJsValue\(|\bTypeError\b/i,Xt=n(e=>e?/^[A-Z]/.test(e)||/\s/.test(e):!0,"isAlreadyPrettified"),Ie=n(e=>e?e.match(/^([a-z][a-z0-9_]*):/)?.[1]:void 0,"extractErrorCode"),Gt=n(e=>{if(!e)return;let r=e.split(/[:\s]/)[0];return/^[a-z][a-z0-9_]*$/.test(r)?r:void 0},"codeFromCheck"),zt=n(e=>[Ie(e.message),Ie(e.details),Gt(e.check)].find(t=>t!==void 0&&t in Pe),"resolveErrorCode"),se=n((e,r)=>!!(!e||e===r||/^[a-z][a-z0-9_]*$/.test(e)||e.startsWith(`${r}:`)),"isMessageRaw"),Ye=n(e=>{if(e.status===_e.VerificationStatusEnum.Failed){let a=zt(e);if(!a){let l=[e.message,e.details,e.check].filter(Boolean).join(" ");return Bt.test(l)?{...e,check:"Issuer",message:"Could not be reached",details:void 0}:jt.test(l)?{...e,check:"Verification",message:"Could not be verified",details:void 0}:e}let o=Pe[a],i=!!e.details&&!se(e.details,e.check),s=!!e.message&&!se(e.message,e.check),u;return s?u=e.message:i?u=void 0:u=o.message,{...e,check:o.check,message:u}}if(Xt(e.check))return e;let t=Qt[e.check];return t?{...e,check:t.check,message:se(e.message,e.check)?t.message:e.message}:e},"prettifyVerificationItem"),Jt=n(e=>e.map(Ye),"prettifyVerificationItems");var Kt=n(e=>({name:"LearnCard",displayName:"LearnCard",description:"Adds opinionated logic to a LearnCard",methods:{verifyCredential:We(e)}}),"getLearnCardPlugin");
2
2
  //# sourceMappingURL=learn-card-plugin.cjs.production.min.cjs.map