@learncard/core 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
package/dist/core.esm.js CHANGED
@@ -29487,489 +29487,6 @@ var require_tslib = __commonJS({
29487
29487
  }
29488
29488
  });
29489
29489
 
29490
- // ../../node_modules/.pnpm/cross-fetch@3.1.5/node_modules/cross-fetch/dist/browser-ponyfill.js
29491
- var require_browser_ponyfill = __commonJS({
29492
- "../../node_modules/.pnpm/cross-fetch@3.1.5/node_modules/cross-fetch/dist/browser-ponyfill.js"(exports, module) {
29493
- var global2 = typeof self !== "undefined" ? self : exports;
29494
- var __self__ = function() {
29495
- function F() {
29496
- this.fetch = false;
29497
- this.DOMException = global2.DOMException;
29498
- }
29499
- __name(F, "F");
29500
- F.prototype = global2;
29501
- return new F();
29502
- }();
29503
- (function(self2) {
29504
- var irrelevant = function(exports2) {
29505
- var support = {
29506
- searchParams: "URLSearchParams" in self2,
29507
- iterable: "Symbol" in self2 && "iterator" in Symbol,
29508
- blob: "FileReader" in self2 && "Blob" in self2 && function() {
29509
- try {
29510
- new Blob();
29511
- return true;
29512
- } catch (e) {
29513
- return false;
29514
- }
29515
- }(),
29516
- formData: "FormData" in self2,
29517
- arrayBuffer: "ArrayBuffer" in self2
29518
- };
29519
- function isDataView(obj) {
29520
- return obj && DataView.prototype.isPrototypeOf(obj);
29521
- }
29522
- __name(isDataView, "isDataView");
29523
- if (support.arrayBuffer) {
29524
- var viewClasses = [
29525
- "[object Int8Array]",
29526
- "[object Uint8Array]",
29527
- "[object Uint8ClampedArray]",
29528
- "[object Int16Array]",
29529
- "[object Uint16Array]",
29530
- "[object Int32Array]",
29531
- "[object Uint32Array]",
29532
- "[object Float32Array]",
29533
- "[object Float64Array]"
29534
- ];
29535
- var isArrayBufferView = ArrayBuffer.isView || function(obj) {
29536
- return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1;
29537
- };
29538
- }
29539
- function normalizeName(name5) {
29540
- if (typeof name5 !== "string") {
29541
- name5 = String(name5);
29542
- }
29543
- if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name5)) {
29544
- throw new TypeError("Invalid character in header field name");
29545
- }
29546
- return name5.toLowerCase();
29547
- }
29548
- __name(normalizeName, "normalizeName");
29549
- function normalizeValue(value) {
29550
- if (typeof value !== "string") {
29551
- value = String(value);
29552
- }
29553
- return value;
29554
- }
29555
- __name(normalizeValue, "normalizeValue");
29556
- function iteratorFor(items) {
29557
- var iterator2 = {
29558
- next: function() {
29559
- var value = items.shift();
29560
- return { done: value === void 0, value };
29561
- }
29562
- };
29563
- if (support.iterable) {
29564
- iterator2[Symbol.iterator] = function() {
29565
- return iterator2;
29566
- };
29567
- }
29568
- return iterator2;
29569
- }
29570
- __name(iteratorFor, "iteratorFor");
29571
- function Headers2(headers) {
29572
- this.map = {};
29573
- if (headers instanceof Headers2) {
29574
- headers.forEach(function(value, name5) {
29575
- this.append(name5, value);
29576
- }, this);
29577
- } else if (Array.isArray(headers)) {
29578
- headers.forEach(function(header) {
29579
- this.append(header[0], header[1]);
29580
- }, this);
29581
- } else if (headers) {
29582
- Object.getOwnPropertyNames(headers).forEach(function(name5) {
29583
- this.append(name5, headers[name5]);
29584
- }, this);
29585
- }
29586
- }
29587
- __name(Headers2, "Headers");
29588
- Headers2.prototype.append = function(name5, value) {
29589
- name5 = normalizeName(name5);
29590
- value = normalizeValue(value);
29591
- var oldValue = this.map[name5];
29592
- this.map[name5] = oldValue ? oldValue + ", " + value : value;
29593
- };
29594
- Headers2.prototype["delete"] = function(name5) {
29595
- delete this.map[normalizeName(name5)];
29596
- };
29597
- Headers2.prototype.get = function(name5) {
29598
- name5 = normalizeName(name5);
29599
- return this.has(name5) ? this.map[name5] : null;
29600
- };
29601
- Headers2.prototype.has = function(name5) {
29602
- return this.map.hasOwnProperty(normalizeName(name5));
29603
- };
29604
- Headers2.prototype.set = function(name5, value) {
29605
- this.map[normalizeName(name5)] = normalizeValue(value);
29606
- };
29607
- Headers2.prototype.forEach = function(callback, thisArg) {
29608
- for (var name5 in this.map) {
29609
- if (this.map.hasOwnProperty(name5)) {
29610
- callback.call(thisArg, this.map[name5], name5, this);
29611
- }
29612
- }
29613
- };
29614
- Headers2.prototype.keys = function() {
29615
- var items = [];
29616
- this.forEach(function(value, name5) {
29617
- items.push(name5);
29618
- });
29619
- return iteratorFor(items);
29620
- };
29621
- Headers2.prototype.values = function() {
29622
- var items = [];
29623
- this.forEach(function(value) {
29624
- items.push(value);
29625
- });
29626
- return iteratorFor(items);
29627
- };
29628
- Headers2.prototype.entries = function() {
29629
- var items = [];
29630
- this.forEach(function(value, name5) {
29631
- items.push([name5, value]);
29632
- });
29633
- return iteratorFor(items);
29634
- };
29635
- if (support.iterable) {
29636
- Headers2.prototype[Symbol.iterator] = Headers2.prototype.entries;
29637
- }
29638
- function consumed(body) {
29639
- if (body.bodyUsed) {
29640
- return Promise.reject(new TypeError("Already read"));
29641
- }
29642
- body.bodyUsed = true;
29643
- }
29644
- __name(consumed, "consumed");
29645
- function fileReaderReady(reader) {
29646
- return new Promise(function(resolve, reject) {
29647
- reader.onload = function() {
29648
- resolve(reader.result);
29649
- };
29650
- reader.onerror = function() {
29651
- reject(reader.error);
29652
- };
29653
- });
29654
- }
29655
- __name(fileReaderReady, "fileReaderReady");
29656
- function readBlobAsArrayBuffer(blob) {
29657
- var reader = new FileReader();
29658
- var promise = fileReaderReady(reader);
29659
- reader.readAsArrayBuffer(blob);
29660
- return promise;
29661
- }
29662
- __name(readBlobAsArrayBuffer, "readBlobAsArrayBuffer");
29663
- function readBlobAsText(blob) {
29664
- var reader = new FileReader();
29665
- var promise = fileReaderReady(reader);
29666
- reader.readAsText(blob);
29667
- return promise;
29668
- }
29669
- __name(readBlobAsText, "readBlobAsText");
29670
- function readArrayBufferAsText(buf2) {
29671
- var view = new Uint8Array(buf2);
29672
- var chars = new Array(view.length);
29673
- for (var i = 0; i < view.length; i++) {
29674
- chars[i] = String.fromCharCode(view[i]);
29675
- }
29676
- return chars.join("");
29677
- }
29678
- __name(readArrayBufferAsText, "readArrayBufferAsText");
29679
- function bufferClone(buf2) {
29680
- if (buf2.slice) {
29681
- return buf2.slice(0);
29682
- } else {
29683
- var view = new Uint8Array(buf2.byteLength);
29684
- view.set(new Uint8Array(buf2));
29685
- return view.buffer;
29686
- }
29687
- }
29688
- __name(bufferClone, "bufferClone");
29689
- function Body() {
29690
- this.bodyUsed = false;
29691
- this._initBody = function(body) {
29692
- this._bodyInit = body;
29693
- if (!body) {
29694
- this._bodyText = "";
29695
- } else if (typeof body === "string") {
29696
- this._bodyText = body;
29697
- } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
29698
- this._bodyBlob = body;
29699
- } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
29700
- this._bodyFormData = body;
29701
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
29702
- this._bodyText = body.toString();
29703
- } else if (support.arrayBuffer && support.blob && isDataView(body)) {
29704
- this._bodyArrayBuffer = bufferClone(body.buffer);
29705
- this._bodyInit = new Blob([this._bodyArrayBuffer]);
29706
- } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
29707
- this._bodyArrayBuffer = bufferClone(body);
29708
- } else {
29709
- this._bodyText = body = Object.prototype.toString.call(body);
29710
- }
29711
- if (!this.headers.get("content-type")) {
29712
- if (typeof body === "string") {
29713
- this.headers.set("content-type", "text/plain;charset=UTF-8");
29714
- } else if (this._bodyBlob && this._bodyBlob.type) {
29715
- this.headers.set("content-type", this._bodyBlob.type);
29716
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
29717
- this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8");
29718
- }
29719
- }
29720
- };
29721
- if (support.blob) {
29722
- this.blob = function() {
29723
- var rejected = consumed(this);
29724
- if (rejected) {
29725
- return rejected;
29726
- }
29727
- if (this._bodyBlob) {
29728
- return Promise.resolve(this._bodyBlob);
29729
- } else if (this._bodyArrayBuffer) {
29730
- return Promise.resolve(new Blob([this._bodyArrayBuffer]));
29731
- } else if (this._bodyFormData) {
29732
- throw new Error("could not read FormData body as blob");
29733
- } else {
29734
- return Promise.resolve(new Blob([this._bodyText]));
29735
- }
29736
- };
29737
- this.arrayBuffer = function() {
29738
- if (this._bodyArrayBuffer) {
29739
- return consumed(this) || Promise.resolve(this._bodyArrayBuffer);
29740
- } else {
29741
- return this.blob().then(readBlobAsArrayBuffer);
29742
- }
29743
- };
29744
- }
29745
- this.text = function() {
29746
- var rejected = consumed(this);
29747
- if (rejected) {
29748
- return rejected;
29749
- }
29750
- if (this._bodyBlob) {
29751
- return readBlobAsText(this._bodyBlob);
29752
- } else if (this._bodyArrayBuffer) {
29753
- return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));
29754
- } else if (this._bodyFormData) {
29755
- throw new Error("could not read FormData body as text");
29756
- } else {
29757
- return Promise.resolve(this._bodyText);
29758
- }
29759
- };
29760
- if (support.formData) {
29761
- this.formData = function() {
29762
- return this.text().then(decode12);
29763
- };
29764
- }
29765
- this.json = function() {
29766
- return this.text().then(JSON.parse);
29767
- };
29768
- return this;
29769
- }
29770
- __name(Body, "Body");
29771
- var methods = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
29772
- function normalizeMethod(method) {
29773
- var upcased = method.toUpperCase();
29774
- return methods.indexOf(upcased) > -1 ? upcased : method;
29775
- }
29776
- __name(normalizeMethod, "normalizeMethod");
29777
- function Request2(input, options) {
29778
- options = options || {};
29779
- var body = options.body;
29780
- if (input instanceof Request2) {
29781
- if (input.bodyUsed) {
29782
- throw new TypeError("Already read");
29783
- }
29784
- this.url = input.url;
29785
- this.credentials = input.credentials;
29786
- if (!options.headers) {
29787
- this.headers = new Headers2(input.headers);
29788
- }
29789
- this.method = input.method;
29790
- this.mode = input.mode;
29791
- this.signal = input.signal;
29792
- if (!body && input._bodyInit != null) {
29793
- body = input._bodyInit;
29794
- input.bodyUsed = true;
29795
- }
29796
- } else {
29797
- this.url = String(input);
29798
- }
29799
- this.credentials = options.credentials || this.credentials || "same-origin";
29800
- if (options.headers || !this.headers) {
29801
- this.headers = new Headers2(options.headers);
29802
- }
29803
- this.method = normalizeMethod(options.method || this.method || "GET");
29804
- this.mode = options.mode || this.mode || null;
29805
- this.signal = options.signal || this.signal;
29806
- this.referrer = null;
29807
- if ((this.method === "GET" || this.method === "HEAD") && body) {
29808
- throw new TypeError("Body not allowed for GET or HEAD requests");
29809
- }
29810
- this._initBody(body);
29811
- }
29812
- __name(Request2, "Request");
29813
- Request2.prototype.clone = function() {
29814
- return new Request2(this, { body: this._bodyInit });
29815
- };
29816
- function decode12(body) {
29817
- var form = new FormData();
29818
- body.trim().split("&").forEach(function(bytes) {
29819
- if (bytes) {
29820
- var split = bytes.split("=");
29821
- var name5 = split.shift().replace(/\+/g, " ");
29822
- var value = split.join("=").replace(/\+/g, " ");
29823
- form.append(decodeURIComponent(name5), decodeURIComponent(value));
29824
- }
29825
- });
29826
- return form;
29827
- }
29828
- __name(decode12, "decode");
29829
- function parseHeaders(rawHeaders) {
29830
- var headers = new Headers2();
29831
- var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, " ");
29832
- preProcessedHeaders.split(/\r?\n/).forEach(function(line) {
29833
- var parts = line.split(":");
29834
- var key2 = parts.shift().trim();
29835
- if (key2) {
29836
- var value = parts.join(":").trim();
29837
- headers.append(key2, value);
29838
- }
29839
- });
29840
- return headers;
29841
- }
29842
- __name(parseHeaders, "parseHeaders");
29843
- Body.call(Request2.prototype);
29844
- function Response2(bodyInit, options) {
29845
- if (!options) {
29846
- options = {};
29847
- }
29848
- this.type = "default";
29849
- this.status = options.status === void 0 ? 200 : options.status;
29850
- this.ok = this.status >= 200 && this.status < 300;
29851
- this.statusText = "statusText" in options ? options.statusText : "OK";
29852
- this.headers = new Headers2(options.headers);
29853
- this.url = options.url || "";
29854
- this._initBody(bodyInit);
29855
- }
29856
- __name(Response2, "Response");
29857
- Body.call(Response2.prototype);
29858
- Response2.prototype.clone = function() {
29859
- return new Response2(this._bodyInit, {
29860
- status: this.status,
29861
- statusText: this.statusText,
29862
- headers: new Headers2(this.headers),
29863
- url: this.url
29864
- });
29865
- };
29866
- Response2.error = function() {
29867
- var response = new Response2(null, { status: 0, statusText: "" });
29868
- response.type = "error";
29869
- return response;
29870
- };
29871
- var redirectStatuses = [301, 302, 303, 307, 308];
29872
- Response2.redirect = function(url, status) {
29873
- if (redirectStatuses.indexOf(status) === -1) {
29874
- throw new RangeError("Invalid status code");
29875
- }
29876
- return new Response2(null, { status, headers: { location: url } });
29877
- };
29878
- exports2.DOMException = self2.DOMException;
29879
- try {
29880
- new exports2.DOMException();
29881
- } catch (err) {
29882
- exports2.DOMException = function(message, name5) {
29883
- this.message = message;
29884
- this.name = name5;
29885
- var error = Error(message);
29886
- this.stack = error.stack;
29887
- };
29888
- exports2.DOMException.prototype = Object.create(Error.prototype);
29889
- exports2.DOMException.prototype.constructor = exports2.DOMException;
29890
- }
29891
- function fetch3(input, init4) {
29892
- return new Promise(function(resolve, reject) {
29893
- var request = new Request2(input, init4);
29894
- if (request.signal && request.signal.aborted) {
29895
- return reject(new exports2.DOMException("Aborted", "AbortError"));
29896
- }
29897
- var xhr = new XMLHttpRequest();
29898
- function abortXhr() {
29899
- xhr.abort();
29900
- }
29901
- __name(abortXhr, "abortXhr");
29902
- xhr.onload = function() {
29903
- var options = {
29904
- status: xhr.status,
29905
- statusText: xhr.statusText,
29906
- headers: parseHeaders(xhr.getAllResponseHeaders() || "")
29907
- };
29908
- options.url = "responseURL" in xhr ? xhr.responseURL : options.headers.get("X-Request-URL");
29909
- var body = "response" in xhr ? xhr.response : xhr.responseText;
29910
- resolve(new Response2(body, options));
29911
- };
29912
- xhr.onerror = function() {
29913
- reject(new TypeError("Network request failed"));
29914
- };
29915
- xhr.ontimeout = function() {
29916
- reject(new TypeError("Network request failed"));
29917
- };
29918
- xhr.onabort = function() {
29919
- reject(new exports2.DOMException("Aborted", "AbortError"));
29920
- };
29921
- xhr.open(request.method, request.url, true);
29922
- if (request.credentials === "include") {
29923
- xhr.withCredentials = true;
29924
- } else if (request.credentials === "omit") {
29925
- xhr.withCredentials = false;
29926
- }
29927
- if ("responseType" in xhr && support.blob) {
29928
- xhr.responseType = "blob";
29929
- }
29930
- request.headers.forEach(function(value, name5) {
29931
- xhr.setRequestHeader(name5, value);
29932
- });
29933
- if (request.signal) {
29934
- request.signal.addEventListener("abort", abortXhr);
29935
- xhr.onreadystatechange = function() {
29936
- if (xhr.readyState === 4) {
29937
- request.signal.removeEventListener("abort", abortXhr);
29938
- }
29939
- };
29940
- }
29941
- xhr.send(typeof request._bodyInit === "undefined" ? null : request._bodyInit);
29942
- });
29943
- }
29944
- __name(fetch3, "fetch");
29945
- fetch3.polyfill = true;
29946
- if (!self2.fetch) {
29947
- self2.fetch = fetch3;
29948
- self2.Headers = Headers2;
29949
- self2.Request = Request2;
29950
- self2.Response = Response2;
29951
- }
29952
- exports2.Headers = Headers2;
29953
- exports2.Request = Request2;
29954
- exports2.Response = Response2;
29955
- exports2.fetch = fetch3;
29956
- Object.defineProperty(exports2, "__esModule", { value: true });
29957
- return exports2;
29958
- }({});
29959
- })(__self__);
29960
- __self__.fetch.ponyfill = true;
29961
- delete __self__.fetch.polyfill;
29962
- var ctx = __self__;
29963
- exports = ctx.fetch;
29964
- exports.default = ctx.fetch;
29965
- exports.fetch = ctx.fetch;
29966
- exports.Headers = ctx.Headers;
29967
- exports.Request = ctx.Request;
29968
- exports.Response = ctx.Response;
29969
- module.exports = exports;
29970
- }
29971
- });
29972
-
29973
29490
  // ../../node_modules/.pnpm/dataloader@2.1.0/node_modules/dataloader/index.js
29974
29491
  var require_dataloader = __commonJS({
29975
29492
  "../../node_modules/.pnpm/dataloader@2.1.0/node_modules/dataloader/index.js"(exports, module) {
@@ -45493,7 +45010,7 @@ function StreamStatic() {
45493
45010
  __name(StreamStatic, "StreamStatic");
45494
45011
 
45495
45012
  // ../../node_modules/.pnpm/@ceramicnetwork+common@2.3.0/node_modules/@ceramicnetwork/common/lib/utils/http-utils.js
45496
- var import_cross_fetch = __toESM(require_browser_ponyfill(), 1);
45013
+ import fetch2 from "cross-fetch";
45497
45014
 
45498
45015
  // ../../node_modules/.pnpm/@ceramicnetwork+common@2.3.0/node_modules/@ceramicnetwork/common/lib/utils/abort-signal-utils.js
45499
45016
  function mergeAbortSignals(signals) {
@@ -45559,7 +45076,7 @@ function fetchJson(_0) {
45559
45076
  const timedAbortSignal = new TimedAbortSignal(timeoutLength);
45560
45077
  const signal = opts.signal ? mergeAbortSignals([opts.signal, timedAbortSignal.signal]) : timedAbortSignal.signal;
45561
45078
  const res = yield abortable2(signal, (abortSignal) => {
45562
- return (0, import_cross_fetch.default)(String(url), __spreadProps(__spreadValues({}, opts), { signal: abortSignal }));
45079
+ return fetch2(String(url), __spreadProps(__spreadValues({}, opts), { signal: abortSignal }));
45563
45080
  }).finally(() => timedAbortSignal.clear());
45564
45081
  if (!res.ok) {
45565
45082
  const text = yield res.text();