@learncard/learn-card-plugin 1.2.20 → 1.2.21

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,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  if (process.env.NODE_ENV === 'production') {
4
- module.exports = require('./learn-card-plugin.cjs.production.min.js');
4
+ module.exports = require('./learn-card-plugin.cjs.production.min.cjs');
5
5
  } else {
6
- module.exports = require('./learn-card-plugin.cjs.development.js');
6
+ module.exports = require('./learn-card-plugin.cjs.development.cjs');
7
7
  }
@@ -0,0 +1,8 @@
1
+ import { LearnCard } from '@learncard/core';
2
+ import { LearnCardPluginDependentMethods, LearnCardPlugin } from './types';
3
+ export * from './types';
4
+ /**
5
+ * @group Plugins
6
+ */
7
+ export declare const getLearnCardPlugin: (learnCard: LearnCard<any, any, LearnCardPluginDependentMethods>) => LearnCardPlugin;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -1837,4 +1837,4 @@ var getLearnCardPlugin = /* @__PURE__ */ __name((learnCard) => ({
1837
1837
  verifyCredential: verifyCredential(learnCard)
1838
1838
  }
1839
1839
  }), "getLearnCardPlugin");
1840
- //# sourceMappingURL=learn-card-plugin.cjs.development.js.map
1840
+ //# sourceMappingURL=learn-card-plugin.cjs.development.cjs.map
@@ -1,2 +1,2 @@
1
1
  "use strict";var $=Object.defineProperty;var Ee=Object.getOwnPropertyDescriptor;var _e=Object.getOwnPropertyNames;var Fe=Object.prototype.hasOwnProperty;var n=(r,t)=>$(r,"name",{value:t,configurable:!0});var qe=(r,t)=>{for(var e in t)$(r,e,{get:t[e],enumerable:!0})},Le=(r,t,e,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of _e(t))!Fe.call(r,o)&&o!==e&&$(r,o,{get:()=>t[o],enumerable:!(a=Ee(t,o))||a.enumerable});return r};var Ne=r=>Le($({},"__esModule",{value:!0}),r);var Ht={};qe(Ht,{getLearnCardPlugin:()=>At});module.exports=Ne(Ht);var Q=require("@learncard/types");function P(r){"@babel/helpers - typeof";return P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(r)}n(P,"_typeof");function x(r){if(r===null||r===!0||r===!1)return NaN;var t=Number(r);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}n(x,"toInteger");function d(r,t){if(t.length<r)throw new TypeError(r+" argument"+(r>1?"s":"")+" required, but only "+t.length+" present")}n(d,"requiredArgs");function m(r){d(1,arguments);var t=Object.prototype.toString.call(r);return r instanceof Date||P(r)==="object"&&t==="[object Date]"?new Date(r.getTime()):typeof r=="number"||t==="[object Number]"?new Date(r):((typeof r=="string"||t==="[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(r,t){d(2,arguments);var e=m(r).getTime(),a=x(t);return new Date(e+a)}n(G,"addMilliseconds");var Ae={};function T(){return Ae}n(T,"getDefaultOptions");function J(r){var t=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return t.setUTCFullYear(r.getFullYear()),r.getTime()-t.getTime()}n(J,"getTimezoneOffsetInMilliseconds");function z(r){return d(1,arguments),r instanceof Date||P(r)==="object"&&Object.prototype.toString.call(r)==="[object Date]"}n(z,"isDate");function K(r){if(d(1,arguments),!z(r)&&typeof r!="number")return!1;var t=m(r);return!isNaN(Number(t))}n(K,"isValid");function Z(r,t){d(2,arguments);var e=x(t);return G(r,-e)}n(Z,"subMilliseconds");var He=864e5;function ee(r){d(1,arguments);var t=m(r),e=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var a=t.getTime(),o=e-a;return Math.floor(o/He)+1}n(ee,"getUTCDayOfYear");function C(r){d(1,arguments);var t=1,e=m(r),a=e.getUTCDay(),o=(a<t?7:0)+a-t;return e.setUTCDate(e.getUTCDate()-o),e.setUTCHours(0,0,0,0),e}n(C,"startOfUTCISOWeek");function F(r){d(1,arguments);var t=m(r),e=t.getUTCFullYear(),a=new Date(0);a.setUTCFullYear(e+1,0,4),a.setUTCHours(0,0,0,0);var o=C(a),i=new Date(0);i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0);var s=C(i);return t.getTime()>=o.getTime()?e+1:t.getTime()>=s.getTime()?e:e-1}n(F,"getUTCISOWeekYear");function te(r){d(1,arguments);var t=F(r),e=new Date(0);e.setUTCFullYear(t,0,4),e.setUTCHours(0,0,0,0);var a=C(e);return a}n(te,"startOfUTCISOWeekYear");var $e=6048e5;function re(r){d(1,arguments);var t=m(r),e=C(t).getTime()-te(t).getTime();return Math.round(e/$e)+1}n(re,"getUTCISOWeek");function D(r,t){var e,a,o,i,s,f,c,l;d(1,arguments);var h=T(),p=x((e=(a=(o=(i=t?.weekStartsOn)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(f=s.options)===null||f===void 0?void 0:f.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&&e!==void 0?e:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=m(r),v=g.getUTCDay(),w=(v<p?7:0)+v-p;return g.setUTCDate(g.getUTCDate()-w),g.setUTCHours(0,0,0,0),g}n(D,"startOfUTCWeek");function q(r,t){var e,a,o,i,s,f,c,l;d(1,arguments);var h=m(r),p=h.getUTCFullYear(),g=T(),v=x((e=(a=(o=(i=t?.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(f=s.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&o!==void 0?o:g.firstWeekContainsDate)!==null&&a!==void 0?a:(c=g.locale)===null||c===void 0||(l=c.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&e!==void 0?e:1);if(!(v>=1&&v<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var w=new Date(0);w.setUTCFullYear(p+1,0,v),w.setUTCHours(0,0,0,0);var I=D(w,t),S=new Date(0);S.setUTCFullYear(p,0,v),S.setUTCHours(0,0,0,0);var U=D(S,t);return h.getTime()>=I.getTime()?p+1:h.getTime()>=U.getTime()?p:p-1}n(q,"getUTCWeekYear");function ae(r,t){var e,a,o,i,s,f,c,l;d(1,arguments);var h=T(),p=x((e=(a=(o=(i=t?.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(f=s.options)===null||f===void 0?void 0:f.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&&e!==void 0?e:1),g=q(r,t),v=new Date(0);v.setUTCFullYear(g,0,p),v.setUTCHours(0,0,0,0);var w=D(v,t);return w}n(ae,"startOfUTCWeekYear");var Qe=6048e5;function oe(r,t){d(1,arguments);var e=m(r),a=D(e,t).getTime()-ae(e,t).getTime();return Math.round(a/Qe)+1}n(oe,"getUTCWeek");function u(r,t){for(var e=r<0?"-":"",a=Math.abs(r).toString();a.length<t;)a="0"+a;return e+a}n(u,"addLeadingZeros");var Ve={y:n(function(t,e){var a=t.getUTCFullYear(),o=a>0?a:1-a;return u(e==="yy"?o%100:o,e.length)},"y"),M:n(function(t,e){var a=t.getUTCMonth();return e==="M"?String(a+1):u(a+1,2)},"M"),d:n(function(t,e){return u(t.getUTCDate(),e.length)},"d"),a:n(function(t,e){var a=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];case"aaaa":default:return a==="am"?"a.m.":"p.m."}},"a"),h:n(function(t,e){return u(t.getUTCHours()%12||12,e.length)},"h"),H:n(function(t,e){return u(t.getUTCHours(),e.length)},"H"),m:n(function(t,e){return u(t.getUTCMinutes(),e.length)},"m"),s:n(function(t,e){return u(t.getUTCSeconds(),e.length)},"s"),S:n(function(t,e){var a=e.length,o=t.getUTCMilliseconds(),i=Math.floor(o*Math.pow(10,a-3));return u(i,e.length)},"S")},O=Ve;var Y={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Re={G:n(function(t,e,a){var o=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return a.era(o,{width:"abbreviated"});case"GGGGG":return a.era(o,{width:"narrow"});case"GGGG":default:return a.era(o,{width:"wide"})}},"G"),y:n(function(t,e,a){if(e==="yo"){var o=t.getUTCFullYear(),i=o>0?o:1-o;return a.ordinalNumber(i,{unit:"year"})}return O.y(t,e)},"y"),Y:n(function(t,e,a,o){var i=q(t,o),s=i>0?i:1-i;if(e==="YY"){var f=s%100;return u(f,2)}return e==="Yo"?a.ordinalNumber(s,{unit:"year"}):u(s,e.length)},"Y"),R:n(function(t,e){var a=F(t);return u(a,e.length)},"R"),u:n(function(t,e){var a=t.getUTCFullYear();return u(a,e.length)},"u"),Q:n(function(t,e,a){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(o);case"QQ":return u(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"});case"QQQQ":default:return a.quarter(o,{width:"wide",context:"formatting"})}},"Q"),q:n(function(t,e,a){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(o);case"qq":return u(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"});case"qqqq":default:return a.quarter(o,{width:"wide",context:"standalone"})}},"q"),M:n(function(t,e,a){var o=t.getUTCMonth();switch(e){case"M":case"MM":return O.M(t,e);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"});case"MMMM":default:return a.month(o,{width:"wide",context:"formatting"})}},"M"),L:n(function(t,e,a){var o=t.getUTCMonth();switch(e){case"L":return String(o+1);case"LL":return u(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"});case"LLLL":default:return a.month(o,{width:"wide",context:"standalone"})}},"L"),w:n(function(t,e,a,o){var i=oe(t,o);return e==="wo"?a.ordinalNumber(i,{unit:"week"}):u(i,e.length)},"w"),I:n(function(t,e,a){var o=re(t);return e==="Io"?a.ordinalNumber(o,{unit:"week"}):u(o,e.length)},"I"),d:n(function(t,e,a){return e==="do"?a.ordinalNumber(t.getUTCDate(),{unit:"date"}):O.d(t,e)},"d"),D:n(function(t,e,a){var o=ee(t);return e==="Do"?a.ordinalNumber(o,{unit:"dayOfYear"}):u(o,e.length)},"D"),E:n(function(t,e,a){var o=t.getUTCDay();switch(e){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"});case"EEEE":default:return a.day(o,{width:"wide",context:"formatting"})}},"E"),e:n(function(t,e,a,o){var i=t.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return u(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"});case"eeee":default:return a.day(i,{width:"wide",context:"formatting"})}},"e"),c:n(function(t,e,a,o){var i=t.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return u(s,e.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"});case"cccc":default:return a.day(i,{width:"wide",context:"standalone"})}},"c"),i:n(function(t,e,a){var o=t.getUTCDay(),i=o===0?7:o;switch(e){case"i":return String(i);case"ii":return u(i,e.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"});case"iiii":default:return a.day(o,{width:"wide",context:"formatting"})}},"i"),a:n(function(t,e,a){var o=t.getUTCHours(),i=o/12>=1?"pm":"am";switch(e){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"});case"aaaa":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},"a"),b:n(function(t,e,a){var o=t.getUTCHours(),i;switch(o===12?i=Y.noon:o===0?i=Y.midnight:i=o/12>=1?"pm":"am",e){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"});case"bbbb":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},"b"),B:n(function(t,e,a){var o=t.getUTCHours(),i;switch(o>=17?i=Y.evening:o>=12?i=Y.afternoon:o>=4?i=Y.morning:i=Y.night,e){case"B":case"BB":case"BBB":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},"B"),h:n(function(t,e,a){if(e==="ho"){var o=t.getUTCHours()%12;return o===0&&(o=12),a.ordinalNumber(o,{unit:"hour"})}return O.h(t,e)},"h"),H:n(function(t,e,a){return e==="Ho"?a.ordinalNumber(t.getUTCHours(),{unit:"hour"}):O.H(t,e)},"H"),K:n(function(t,e,a){var o=t.getUTCHours()%12;return e==="Ko"?a.ordinalNumber(o,{unit:"hour"}):u(o,e.length)},"K"),k:n(function(t,e,a){var o=t.getUTCHours();return o===0&&(o=24),e==="ko"?a.ordinalNumber(o,{unit:"hour"}):u(o,e.length)},"k"),m:n(function(t,e,a){return e==="mo"?a.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):O.m(t,e)},"m"),s:n(function(t,e,a){return e==="so"?a.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):O.s(t,e)},"s"),S:n(function(t,e){return O.S(t,e)},"S"),X:n(function(t,e,a,o){var i=o._originalDate||t,s=i.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return fe(s);case"XXXX":case"XX":return k(s);case"XXXXX":case"XXX":default:return k(s,":")}},"X"),x:n(function(t,e,a,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(e){case"x":return fe(s);case"xxxx":case"xx":return k(s);case"xxxxx":case"xxx":default:return k(s,":")}},"x"),O:n(function(t,e,a,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+se(s,":");case"OOOO":default:return"GMT"+k(s,":")}},"O"),z:n(function(t,e,a,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+se(s,":");case"zzzz":default:return"GMT"+k(s,":")}},"z"),t:n(function(t,e,a,o){var i=o._originalDate||t,s=Math.floor(i.getTime()/1e3);return u(s,e.length)},"t"),T:n(function(t,e,a,o){var i=o._originalDate||t,s=i.getTime();return u(s,e.length)},"T")};function se(r,t){var e=r>0?"-":"+",a=Math.abs(r),o=Math.floor(a/60),i=a%60;if(i===0)return e+String(o);var s=t||"";return e+String(o)+s+u(i,2)}n(se,"formatTimezoneShort");function fe(r,t){if(r%60===0){var e=r>0?"-":"+";return e+u(Math.abs(r)/60,2)}return k(r,t)}n(fe,"formatTimezoneWithOptionalMinutes");function k(r,t){var e=t||"",a=r>0?"-":"+",o=Math.abs(r),i=u(Math.floor(o/60),2),s=u(o%60,2);return a+i+e+s}n(k,"formatTimezone");var ue=Re;var de=n(function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},"dateLongFormatter"),le=n(function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},"timeLongFormatter"),Be=n(function(t,e){var a=t.match(/(P+)(p+)?/)||[],o=a[1],i=a[2];if(!i)return de(t,e);var s;switch(o){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",de(o,e)).replace("{{time}}",le(i,e))},"dateTimeLongFormatter"),Xe={p:le,P:Be},me=Xe;var je=["D","DD"],Ge=["YY","YYYY"];function ce(r){return je.indexOf(r)!==-1}n(ce,"isProtectedDayOfYearToken");function pe(r){return Ge.indexOf(r)!==-1}n(pe,"isProtectedWeekYearToken");function ne(r,t,e){if(r==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(r==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(r==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(r==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}n(ne,"throwProtectedError");var Je={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"}},ze=n(function(t,e,a){var o,i=Je[t];return typeof i=="string"?o=i:e===1?o=i.one:o=i.other.replace("{{count}}",e.toString()),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"in "+o:o+" ago":o},"formatDistance"),he=ze;function L(r){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.width?String(t.width):r.defaultWidth,a=r.formats[e]||r.formats[r.defaultWidth];return a}}n(L,"buildFormatLongFn");var Ke={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ze={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},et={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},tt={date:L({formats:Ke,defaultWidth:"full"}),time:L({formats:Ze,defaultWidth:"full"}),dateTime:L({formats:et,defaultWidth:"full"})},ve=tt;var rt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},at=n(function(t,e,a,o){return rt[t]},"formatRelative"),ge=at;function M(r){return function(t,e){var a=e!=null&&e.context?String(e.context):"standalone",o;if(a==="formatting"&&r.formattingValues){var i=r.defaultFormattingWidth||r.defaultWidth,s=e!=null&&e.width?String(e.width):i;o=r.formattingValues[s]||r.formattingValues[i]}else{var f=r.defaultWidth,c=e!=null&&e.width?String(e.width):r.defaultWidth;o=r.values[c]||r.values[f]}var l=r.argumentCallback?r.argumentCallback(t):t;return o[l]}}n(M,"buildLocalizeFn");var ot={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},nt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},it={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"]},st={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"]},ft={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"}},ut={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"}},dt=n(function(t,e){var a=Number(t),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"),lt={ordinalNumber:dt,era:M({values:ot,defaultWidth:"wide"}),quarter:M({values:nt,defaultWidth:"wide",argumentCallback:n(function(t){return t-1},"argumentCallback")}),month:M({values:it,defaultWidth:"wide"}),day:M({values:st,defaultWidth:"wide"}),dayPeriod:M({values:ft,defaultWidth:"wide",formattingValues:ut,defaultFormattingWidth:"wide"})},xe=lt;function W(r){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=e.width,o=a&&r.matchPatterns[a]||r.matchPatterns[r.defaultMatchWidth],i=t.match(o);if(!i)return null;var s=i[0],f=a&&r.parsePatterns[a]||r.parsePatterns[r.defaultParseWidth],c=Array.isArray(f)?ct(f,function(p){return p.test(s)}):mt(f,function(p){return p.test(s)}),l;l=r.valueCallback?r.valueCallback(c):c,l=e.valueCallback?e.valueCallback(l):l;var h=t.slice(s.length);return{value:l,rest:h}}}n(W,"buildMatchFn");function mt(r,t){for(var e in r)if(r.hasOwnProperty(e)&&t(r[e]))return e}n(mt,"findKey");function ct(r,t){for(var e=0;e<r.length;e++)if(t(r[e]))return e}n(ct,"findIndex");function ie(r){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=t.match(r.matchPattern);if(!a)return null;var o=a[0],i=t.match(r.parsePattern);if(!i)return null;var s=r.valueCallback?r.valueCallback(i[0]):i[0];s=e.valueCallback?e.valueCallback(s):s;var f=t.slice(o.length);return{value:s,rest:f}}}n(ie,"buildMatchPatternFn");var pt=/^(\d+)(th|st|nd|rd)?/i,ht=/\d+/i,vt={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},gt={any:[/^b/i,/^(a|c)/i]},xt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},yt={any:[/1/i,/2/i,/3/i,/4/i]},wt={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},Ot={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]},bt={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},Tt={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]},Ct={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},Dt={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}},St={ordinalNumber:ie({matchPattern:pt,parsePattern:ht,valueCallback:n(function(t){return parseInt(t,10)},"valueCallback")}),era:W({matchPatterns:vt,defaultMatchWidth:"wide",parsePatterns:gt,defaultParseWidth:"any"}),quarter:W({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:yt,defaultParseWidth:"any",valueCallback:n(function(t){return t+1},"valueCallback")}),month:W({matchPatterns:wt,defaultMatchWidth:"wide",parsePatterns:Ot,defaultParseWidth:"any"}),day:W({matchPatterns:bt,defaultMatchWidth:"wide",parsePatterns:Tt,defaultParseWidth:"any"}),dayPeriod:W({matchPatterns:Ct,defaultMatchWidth:"any",parsePatterns:Dt,defaultParseWidth:"any"})},ye=St;var kt={code:"en-US",formatDistance:he,formatLong:ve,formatRelative:ge,localize:xe,match:ye,options:{weekStartsOn:0,firstWeekContainsDate:1}},we=kt;var Oe=we;var Mt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Wt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Pt=/^'([^]*?)'?$/,Yt=/''/g,It=/[a-zA-Z]/;function N(r,t,e){var a,o,i,s,f,c,l,h,p,g,v,w,I,S,U,V,R,B;d(2,arguments);var We=String(t),E=T(),_=(a=(o=e?.locale)!==null&&o!==void 0?o:E.locale)!==null&&a!==void 0?a:Oe,X=x((i=(s=(f=(c=e?.firstWeekContainsDate)!==null&&c!==void 0?c:e==null||(l=e.locale)===null||l===void 0||(h=l.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&f!==void 0?f:E.firstWeekContainsDate)!==null&&s!==void 0?s:(p=E.locale)===null||p===void 0||(g=p.options)===null||g===void 0?void 0:g.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((v=(w=(I=(S=e?.weekStartsOn)!==null&&S!==void 0?S:e==null||(U=e.locale)===null||U===void 0||(V=U.options)===null||V===void 0?void 0:V.weekStartsOn)!==null&&I!==void 0?I:E.weekStartsOn)!==null&&w!==void 0?w:(R=E.locale)===null||R===void 0||(B=R.options)===null||B===void 0?void 0:B.weekStartsOn)!==null&&v!==void 0?v:0);if(!(j>=0&&j<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!_.localize)throw new RangeError("locale must contain localize property");if(!_.formatLong)throw new RangeError("locale must contain formatLong property");var A=m(r);if(!K(A))throw new RangeError("Invalid time value");var Pe=J(A),Ye=Z(A,Pe),Ie={firstWeekContainsDate:X,weekStartsOn:j,locale:_,_originalDate:A},Ue=We.match(Wt).map(function(y){var b=y[0];if(b==="p"||b==="P"){var H=me[b];return H(y,_.formatLong)}return y}).join("").match(Mt).map(function(y){if(y==="''")return"'";var b=y[0];if(b==="'")return Ut(y);var H=ue[b];if(H)return!(e!=null&&e.useAdditionalWeekYearTokens)&&pe(y)&&ne(y,t,String(r)),!(e!=null&&e.useAdditionalDayOfYearTokens)&&ce(y)&&ne(y,t,String(r)),H(Ye,y,_.localize,Ie);if(b.match(It))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return y}).join("");return Ue}n(N,"format");function Ut(r){var t=r.match(Pt);return t?t[1].replace(Yt,"'"):r}n(Ut,"cleanEscapedString");var Et=new Set(["status","credentialStatus"]),Te=n(r=>Et.has(r),"isStatusCheck"),Ce=n(r=>{switch(r){case"revocation":return"Revocation";case"suspension":return"Suspension";default:return r.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase())}},"getStatusPurposeLabel"),_t=n(r=>{switch(r){case"revocation":return"Not Revoked";case"suspension":return"Not Suspended";default:return`${Ce(r)} Clear`}},"getClearStatusMessage"),De=n(r=>{switch(r){case"revocation":return"Revoked";case"suspension":return"Suspended";default:return`${Ce(r)} Set`}},"getSetStatusMessage"),be=n(r=>[...new Set(r.map(t=>t.statusPurpose))],"getUniqueStatusPurposes"),Se=n((r=[])=>{let t=r.filter(a=>a.isSet);if(t.length>0)return be(t).map(De).join(", ");let e=be(r);return e.length===1?_t(e[0]):"Active"},"transformStatusCheckMessage"),ke=n((r,t)=>{if(/credential is revoked/i.test(r))return"Status: Revoked";if(/credential is suspended/i.test(r))return"Status: Suspended";let e=r.match(/credential status is set for purpose:\s*([^.]+)/i)?.[1];if(e)return`Status: ${De(e.trim())}`;if(!/status/i.test(r))return;let a=t?.status?.filter(o=>o.isSet)??[];if(a.length>0)return`Status: ${Se(a)}`},"getStatusErrorMessage"),Ft=n((r,t,e)=>ke(r,e)?"status":r.split(" error")[0]||r,"transformErrorCheck"),qt=n((r,t,e)=>{let a=ke(r,e);return a||(r.startsWith("expiration")?t.expirationDate?`Expired ${N(new Date(t.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Expired":r)},"transformErrorMessage"),Lt=n((r,t)=>r.includes("Boost Authenticity")?"Boost Authenticity":r.split(" warning")[0]||r,"transformWarningCheck"),Nt=n((r,t,e)=>Te(r)?Se(e.status):{proof:"Valid",expiration:t.expirationDate?`Expires ${N(new Date(t.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Does Not Expire"}[r]||r,"transformCheckMessage"),Me=n(r=>async(t,e,a,o=!1)=>{let i=await r.invoke.verifyCredential(e,a);if(!o)return i;let s=[];return i.errors.forEach(f=>{s.push({status:Q.VerificationStatusEnum.Failed,check:Ft(f,e,i),details:qt(f,e,i)})}),i.warnings.forEach(f=>{s.push({status:Q.VerificationStatusEnum.Error,check:Lt(f,e),message:f})}),i.checks.forEach(f=>{s.push({status:Q.VerificationStatusEnum.Success,check:Te(f)?"status":f,message:Nt(f,e,i)})}),s},"verifyCredential");var At=n(r=>({name:"LearnCard",displayName:"LearnCard",description:"Adds opinionated logic to a LearnCard",methods:{verifyCredential:Me(r)}}),"getLearnCardPlugin");
2
- //# sourceMappingURL=learn-card-plugin.cjs.production.min.js.map
2
+ //# sourceMappingURL=learn-card-plugin.cjs.production.min.cjs.map
package/package.json CHANGED
@@ -1,9 +1,22 @@
1
1
  {
2
2
  "name": "@learncard/learn-card-plugin",
3
- "version": "1.2.20",
3
+ "version": "1.2.21",
4
4
  "description": "",
5
- "main": "./dist/index.js",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
6
7
  "module": "./dist/learn-card-plugin.esm.js",
8
+ "exports": {
9
+ ".": {
10
+ "import": {
11
+ "types": "./dist/index.d.ts",
12
+ "default": "./dist/learn-card-plugin.esm.js"
13
+ },
14
+ "require": {
15
+ "types": "./dist/index.d.cts",
16
+ "default": "./dist/index.cjs"
17
+ }
18
+ }
19
+ },
7
20
  "files": [
8
21
  "dist"
9
22
  ],
@@ -31,13 +44,13 @@
31
44
  "types": "./dist/index.d.ts",
32
45
  "dependencies": {
33
46
  "date-fns": "^2.28.0",
34
- "@learncard/core": "9.4.20",
35
- "@learncard/types": "5.17.0",
36
- "@learncard/didkit-plugin": "^1.9.0"
47
+ "@learncard/core": "9.4.21",
48
+ "@learncard/types": "5.17.1",
49
+ "@learncard/didkit-plugin": "^1.9.1"
37
50
  },
38
51
  "sideEffects": false,
39
52
  "scripts": {
40
- "build": "node ./scripts/build.mjs && shx cp ./scripts/mixedEntypoint.js ./dist/index.js && tsc --p tsconfig.json",
53
+ "build": "node ./scripts/build.mjs && shx cp ./scripts/mixedEntypoint.js ./dist/index.cjs && tsc --p tsconfig.json && shx cp ./dist/index.d.ts ./dist/index.d.cts",
41
54
  "test": "jest --passWithNoTests",
42
55
  "test:watch": "jest --watch",
43
56
  "test:coverage": "jest --silent --ci --coverage --coverageReporters=\"text\" --coverageReporters=\"text-summary\""