@learncard/init 2.4.11 → 2.4.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/init.esm.js CHANGED
@@ -85,9 +85,8 @@ var IANA_HASH_ALGORITHMS = [
85
85
  ];
86
86
 
87
87
  // ../../node_modules/js-base64/base64.mjs
88
- var version = "3.8.0";
88
+ var version = "3.9.3";
89
89
  var VERSION = version;
90
- var _hasBuffer = typeof Buffer === "function";
91
90
  var _TD = typeof TextDecoder === "function" ? new TextDecoder("utf-8", { ignoreBOM: true }) : void 0;
92
91
  var _TE = typeof TextEncoder === "function" ? new TextEncoder() : void 0;
93
92
  var b64ch = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
@@ -113,8 +112,8 @@ var btoaPolyfill = /* @__PURE__ */ __name((bin) => {
113
112
  }
114
113
  return pad ? asc.slice(0, pad - 3) + "===".substring(pad) : asc;
115
114
  }, "btoaPolyfill");
116
- var _btoa = typeof btoa === "function" ? (bin) => btoa(bin) : _hasBuffer ? (bin) => Buffer.from(bin, "binary").toString("base64") : btoaPolyfill;
117
- var _fromUint8Array = _hasBuffer ? (u8a) => Buffer.from(u8a).toString("base64") : (u8a) => {
115
+ var _btoa = typeof btoa === "function" ? (bin) => btoa(bin) : btoaPolyfill;
116
+ var _fromUint8Array = typeof Uint8Array.prototype.toBase64 === "function" ? (u8a) => u8a.toBase64() : (u8a) => {
118
117
  const maxargs = 4096;
119
118
  let strs = [];
120
119
  for (let i = 0, l = u8a.length; i < l; i += maxargs) {
@@ -132,9 +131,9 @@ var cb_utob = /* @__PURE__ */ __name((c) => {
132
131
  return _fromCC(240 | cc >>> 18 & 7) + _fromCC(128 | cc >>> 12 & 63) + _fromCC(128 | cc >>> 6 & 63) + _fromCC(128 | cc & 63);
133
132
  }
134
133
  }, "cb_utob");
135
- var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
134
+ var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\x00-\x7F]/g;
136
135
  var utob = /* @__PURE__ */ __name((u) => u.replace(re_utob, cb_utob), "utob");
137
- var _encode = _hasBuffer ? (s) => Buffer.from(s, "utf8").toString("base64") : _TE ? (s) => _fromUint8Array(_TE.encode(s)) : (s) => _btoa(utob(s));
136
+ var _encode = _TE ? (s) => _fromUint8Array(_TE.encode(s)) : (s) => _btoa(utob(s));
138
137
  var encode = /* @__PURE__ */ __name((src, urlsafe = false) => urlsafe ? _mkUriSafe(_encode(src)) : _encode(src), "encode");
139
138
  var encodeURI = /* @__PURE__ */ __name((src) => encode(src, true), "encodeURI");
140
139
  var re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
@@ -169,10 +168,10 @@ var atobPolyfill = /* @__PURE__ */ __name((asc) => {
169
168
  }
170
169
  return binArray.join("");
171
170
  }, "atobPolyfill");
172
- var _atob = typeof atob === "function" ? (asc) => atob(_tidyB64(asc)) : _hasBuffer ? (asc) => Buffer.from(asc, "base64").toString("binary") : atobPolyfill;
173
- var _toUint8Array = _hasBuffer ? (a) => _U8Afrom(Buffer.from(a, "base64")) : (a) => _U8Afrom(_atob(a).split("").map((c) => c.charCodeAt(0)));
171
+ var _atob = typeof atob === "function" ? (asc) => atob(_tidyB64(asc)) : atobPolyfill;
172
+ var _toUint8Array = typeof Uint8Array.fromBase64 === "function" ? (a) => Uint8Array.fromBase64(a) : (a) => _U8Afrom(_atob(a).split("").map((c) => c.charCodeAt(0)));
174
173
  var toUint8Array = /* @__PURE__ */ __name((a) => _toUint8Array(_unURI(a)), "toUint8Array");
175
- var _decode = _hasBuffer ? (a) => Buffer.from(a, "base64").toString("utf8") : _TD ? (a) => _TD.decode(_toUint8Array(a)) : (a) => btou(_atob(a));
174
+ var _decode = _TD ? (a) => _TD.decode(_toUint8Array(a)) : (a) => btou(_atob(a));
176
175
  var _unURI = /* @__PURE__ */ __name((a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == "-" ? "+" : "/")), "_unURI");
177
176
  var decode = /* @__PURE__ */ __name((src) => _decode(_unURI(src)), "decode");
178
177
  var isValid = /* @__PURE__ */ __name((src) => {