@learncard/learn-cloud-plugin 2.0.4 → 2.0.5

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.
@@ -812,7 +812,7 @@ var require_lodash = __commonJS({
812
812
  }
813
813
  __name(object, "object");
814
814
  return function(proto) {
815
- if (!isObject2(proto)) {
815
+ if (!isObject3(proto)) {
816
816
  return {};
817
817
  }
818
818
  if (objectCreate) {
@@ -1220,7 +1220,7 @@ var require_lodash = __commonJS({
1220
1220
  if (result2 !== undefined2) {
1221
1221
  return result2;
1222
1222
  }
1223
- if (!isObject2(value)) {
1223
+ if (!isObject3(value)) {
1224
1224
  return value;
1225
1225
  }
1226
1226
  var isArr = isArray(value);
@@ -1597,7 +1597,7 @@ var require_lodash = __commonJS({
1597
1597
  }
1598
1598
  __name(baseIsMatch, "baseIsMatch");
1599
1599
  function baseIsNative(value) {
1600
- if (!isObject2(value) || isMasked(value)) {
1600
+ if (!isObject3(value) || isMasked(value)) {
1601
1601
  return false;
1602
1602
  }
1603
1603
  var pattern = isFunction2(value) ? reIsNative : reIsHostCtor;
@@ -1643,7 +1643,7 @@ var require_lodash = __commonJS({
1643
1643
  }
1644
1644
  __name(baseKeys, "baseKeys");
1645
1645
  function baseKeysIn(object) {
1646
- if (!isObject2(object)) {
1646
+ if (!isObject3(object)) {
1647
1647
  return nativeKeysIn(object);
1648
1648
  }
1649
1649
  var isProto = isPrototype(object), result2 = [];
@@ -1693,7 +1693,7 @@ var require_lodash = __commonJS({
1693
1693
  }
1694
1694
  baseFor(source, function(srcValue, key) {
1695
1695
  stack || (stack = new Stack());
1696
- if (isObject2(srcValue)) {
1696
+ if (isObject3(srcValue)) {
1697
1697
  baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
1698
1698
  } else {
1699
1699
  var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : undefined2;
@@ -1734,7 +1734,7 @@ var require_lodash = __commonJS({
1734
1734
  newValue = objValue;
1735
1735
  if (isArguments(objValue)) {
1736
1736
  newValue = toPlainObject(objValue);
1737
- } else if (!isObject2(objValue) || isFunction2(objValue)) {
1737
+ } else if (!isObject3(objValue) || isFunction2(objValue)) {
1738
1738
  newValue = initCloneObject(srcValue);
1739
1739
  }
1740
1740
  } else {
@@ -1887,7 +1887,7 @@ var require_lodash = __commonJS({
1887
1887
  }
1888
1888
  __name(baseSampleSize, "baseSampleSize");
1889
1889
  function baseSet(object, path, value, customizer) {
1890
- if (!isObject2(object)) {
1890
+ if (!isObject3(object)) {
1891
1891
  return object;
1892
1892
  }
1893
1893
  path = castPath(path, object);
@@ -1901,7 +1901,7 @@ var require_lodash = __commonJS({
1901
1901
  var objValue = nested[key];
1902
1902
  newValue = customizer ? customizer(objValue, key, nested) : undefined2;
1903
1903
  if (newValue === undefined2) {
1904
- newValue = isObject2(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
1904
+ newValue = isObject3(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
1905
1905
  }
1906
1906
  }
1907
1907
  assignValue(nested, key, newValue);
@@ -2393,7 +2393,7 @@ var require_lodash = __commonJS({
2393
2393
  return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
2394
2394
  }
2395
2395
  var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args);
2396
- return isObject2(result2) ? result2 : thisBinding;
2396
+ return isObject3(result2) ? result2 : thisBinding;
2397
2397
  };
2398
2398
  }
2399
2399
  __name(createCtor, "createCtor");
@@ -2727,7 +2727,7 @@ var require_lodash = __commonJS({
2727
2727
  }
2728
2728
  __name(customDefaultsAssignIn, "customDefaultsAssignIn");
2729
2729
  function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
2730
- if (isObject2(objValue) && isObject2(srcValue)) {
2730
+ if (isObject3(objValue) && isObject3(srcValue)) {
2731
2731
  stack.set(srcValue, objValue);
2732
2732
  baseMerge(objValue, srcValue, undefined2, customDefaultsMerge, stack);
2733
2733
  stack["delete"](srcValue);
@@ -3099,7 +3099,7 @@ var require_lodash = __commonJS({
3099
3099
  }
3100
3100
  __name(isIndex, "isIndex");
3101
3101
  function isIterateeCall(value, index, object) {
3102
- if (!isObject2(object)) {
3102
+ if (!isObject3(object)) {
3103
3103
  return false;
3104
3104
  }
3105
3105
  var type = typeof index;
@@ -3148,7 +3148,7 @@ var require_lodash = __commonJS({
3148
3148
  }
3149
3149
  __name(isPrototype, "isPrototype");
3150
3150
  function isStrictComparable(value) {
3151
- return value === value && !isObject2(value);
3151
+ return value === value && !isObject3(value);
3152
3152
  }
3153
3153
  __name(isStrictComparable, "isStrictComparable");
3154
3154
  function matchesStrictComparable(key, srcValue) {
@@ -4127,7 +4127,7 @@ var require_lodash = __commonJS({
4127
4127
  throw new TypeError2(FUNC_ERROR_TEXT);
4128
4128
  }
4129
4129
  wait = toNumber(wait) || 0;
4130
- if (isObject2(options)) {
4130
+ if (isObject3(options)) {
4131
4131
  leading = !!options.leading;
4132
4132
  maxing = "maxWait" in options;
4133
4133
  maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
@@ -4313,7 +4313,7 @@ var require_lodash = __commonJS({
4313
4313
  if (typeof func != "function") {
4314
4314
  throw new TypeError2(FUNC_ERROR_TEXT);
4315
4315
  }
4316
- if (isObject2(options)) {
4316
+ if (isObject3(options)) {
4317
4317
  leading = "leading" in options ? !!options.leading : leading;
4318
4318
  trailing = "trailing" in options ? !!options.trailing : trailing;
4319
4319
  }
@@ -4440,7 +4440,7 @@ var require_lodash = __commonJS({
4440
4440
  }
4441
4441
  __name(isFinite2, "isFinite");
4442
4442
  function isFunction2(value) {
4443
- if (!isObject2(value)) {
4443
+ if (!isObject3(value)) {
4444
4444
  return false;
4445
4445
  }
4446
4446
  var tag = baseGetTag(value);
@@ -4455,11 +4455,11 @@ var require_lodash = __commonJS({
4455
4455
  return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
4456
4456
  }
4457
4457
  __name(isLength, "isLength");
4458
- function isObject2(value) {
4458
+ function isObject3(value) {
4459
4459
  var type = typeof value;
4460
4460
  return value != null && (type == "object" || type == "function");
4461
4461
  }
4462
- __name(isObject2, "isObject");
4462
+ __name(isObject3, "isObject");
4463
4463
  function isObjectLike(value) {
4464
4464
  return value != null && typeof value == "object";
4465
4465
  }
@@ -4582,9 +4582,9 @@ var require_lodash = __commonJS({
4582
4582
  if (isSymbol(value)) {
4583
4583
  return NAN;
4584
4584
  }
4585
- if (isObject2(value)) {
4585
+ if (isObject3(value)) {
4586
4586
  var other = typeof value.valueOf == "function" ? value.valueOf() : value;
4587
- value = isObject2(other) ? other + "" : other;
4587
+ value = isObject3(other) ? other + "" : other;
4588
4588
  }
4589
4589
  if (typeof value != "string") {
4590
4590
  return value === 0 ? value : +value;
@@ -4704,7 +4704,7 @@ var require_lodash = __commonJS({
4704
4704
  return object != null && hasPath(object, path, baseHasIn);
4705
4705
  }
4706
4706
  __name(hasIn, "hasIn");
4707
- var invert = createInverter(function(result2, value, key) {
4707
+ var invert2 = createInverter(function(result2, value, key) {
4708
4708
  if (value != null && typeof value.toString != "function") {
4709
4709
  value = nativeObjectToString.call(value);
4710
4710
  }
@@ -4830,7 +4830,7 @@ var require_lodash = __commonJS({
4830
4830
  var Ctor = object && object.constructor;
4831
4831
  if (isArrLike) {
4832
4832
  accumulator = isArr ? new Ctor() : [];
4833
- } else if (isObject2(object)) {
4833
+ } else if (isObject3(object)) {
4834
4834
  accumulator = isFunction2(Ctor) ? baseCreate(getPrototype(object)) : {};
4835
4835
  } else {
4836
4836
  accumulator = {};
@@ -5140,7 +5140,7 @@ var require_lodash = __commonJS({
5140
5140
  __name(trimStart, "trimStart");
5141
5141
  function truncate(string, options) {
5142
5142
  var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
5143
- if (isObject2(options)) {
5143
+ if (isObject3(options)) {
5144
5144
  var separator = "separator" in options ? options.separator : separator;
5145
5145
  length = "length" in options ? toInteger(options.length) : length;
5146
5146
  omission = "omission" in options ? baseToString(options.omission) : omission;
@@ -5281,13 +5281,13 @@ var require_lodash = __commonJS({
5281
5281
  });
5282
5282
  function mixin(object, source, options) {
5283
5283
  var props = keys(source), methodNames = baseFunctions(source, props);
5284
- if (options == null && !(isObject2(source) && (methodNames.length || !props.length))) {
5284
+ if (options == null && !(isObject3(source) && (methodNames.length || !props.length))) {
5285
5285
  options = source;
5286
5286
  source = object;
5287
5287
  object = this;
5288
5288
  methodNames = baseFunctions(source, keys(source));
5289
5289
  }
5290
- var chain2 = !(isObject2(options) && "chain" in options) || !!options.chain, isFunc = isFunction2(object);
5290
+ var chain2 = !(isObject3(options) && "chain" in options) || !!options.chain, isFunc = isFunction2(object);
5291
5291
  arrayEach(methodNames, function(methodName) {
5292
5292
  var func = source[methodName];
5293
5293
  object[methodName] = func;
@@ -5487,7 +5487,7 @@ var require_lodash = __commonJS({
5487
5487
  lodash.intersection = intersection;
5488
5488
  lodash.intersectionBy = intersectionBy;
5489
5489
  lodash.intersectionWith = intersectionWith;
5490
- lodash.invert = invert;
5490
+ lodash.invert = invert2;
5491
5491
  lodash.invertBy = invertBy;
5492
5492
  lodash.invokeMap = invokeMap;
5493
5493
  lodash.iteratee = iteratee;
@@ -5655,7 +5655,7 @@ var require_lodash = __commonJS({
5655
5655
  lodash.isNil = isNil;
5656
5656
  lodash.isNull = isNull;
5657
5657
  lodash.isNumber = isNumber;
5658
- lodash.isObject = isObject2;
5658
+ lodash.isObject = isObject3;
5659
5659
  lodash.isObjectLike = isObjectLike;
5660
5660
  lodash.isPlainObject = isPlainObject;
5661
5661
  lodash.isRegExp = isRegExp;
@@ -5959,7 +5959,7 @@ var require_lib = __commonJS({
5959
5959
  var DEFAULTS = require_defaults();
5960
5960
  var isFunction2 = require_util().isFunction;
5961
5961
  var isBoolean = require_util().isBoolean;
5962
- var isObject2 = require_util().isObject;
5962
+ var isObject3 = require_util().isObject;
5963
5963
  var isArray = require_util().isArray;
5964
5964
  var isRegex = require_util().isRegex;
5965
5965
  var assign = require_util().assign;
@@ -5999,7 +5999,7 @@ var require_lib = __commonJS({
5999
5999
  node = replacer.call(parent, key, node);
6000
6000
  if (node === void 0)
6001
6001
  return;
6002
- if (!isObject2(node) || node === null)
6002
+ if (!isObject3(node) || node === null)
6003
6003
  return stringify2(node);
6004
6004
  if (isArray(node)) {
6005
6005
  const out = [];
@@ -6046,7 +6046,7 @@ module.exports = __toCommonJS(src_exports);
6046
6046
  // src/plugin.ts
6047
6047
  var import_lodash = __toESM(require_lodash());
6048
6048
 
6049
- // ../../../node_modules/.pnpm/@trpc+server@10.17.0/node_modules/@trpc/server/dist/observable-ade1bad8.mjs
6049
+ // ../../../node_modules/.pnpm/@trpc+server@10.45.2/node_modules/@trpc/server/dist/observable-ade1bad8.mjs
6050
6050
  function identity(x) {
6051
6051
  return x;
6052
6052
  }
@@ -6125,7 +6125,7 @@ function observable(subscribe) {
6125
6125
  }
6126
6126
  __name(observable, "observable");
6127
6127
 
6128
- // ../../../node_modules/.pnpm/@trpc+server@10.17.0/node_modules/@trpc/server/dist/observable/index.mjs
6128
+ // ../../../node_modules/.pnpm/@trpc+server@10.45.2/node_modules/@trpc/server/dist/observable/index.mjs
6129
6129
  function share(_opts) {
6130
6130
  return (originalObserver) => {
6131
6131
  let refCount = 0;
@@ -6228,85 +6228,7 @@ function observableToPromise(observable2) {
6228
6228
  }
6229
6229
  __name(observableToPromise, "observableToPromise");
6230
6230
 
6231
- // ../../../node_modules/.pnpm/@trpc+client@10.17.0_@trpc+server@10.17.0/node_modules/@trpc/client/dist/transformResult-6fb67924.mjs
6232
- var TRPCClientError = class extends Error {
6233
- static from(cause, opts = {}) {
6234
- if (!(cause instanceof Error)) {
6235
- return new TRPCClientError(cause.error.message ?? "", {
6236
- ...opts,
6237
- cause: void 0,
6238
- result: cause
6239
- });
6240
- }
6241
- if (cause.name === "TRPCClientError") {
6242
- return cause;
6243
- }
6244
- return new TRPCClientError(cause.message, {
6245
- ...opts,
6246
- cause,
6247
- result: null
6248
- });
6249
- }
6250
- constructor(message, opts) {
6251
- const cause = opts?.cause;
6252
- super(message, {
6253
- cause
6254
- });
6255
- this.meta = opts?.meta;
6256
- this.cause = cause;
6257
- this.shape = opts?.result?.error;
6258
- this.data = opts?.result?.error.data;
6259
- this.name = "TRPCClientError";
6260
- Object.setPrototypeOf(this, TRPCClientError.prototype);
6261
- }
6262
- };
6263
- __name(TRPCClientError, "TRPCClientError");
6264
- function transformResultInner(response, runtime) {
6265
- if ("error" in response) {
6266
- const error = runtime.transformer.deserialize(response.error);
6267
- return {
6268
- ok: false,
6269
- error: {
6270
- ...response,
6271
- error
6272
- }
6273
- };
6274
- }
6275
- const result = {
6276
- ...response.result,
6277
- ...(!response.result.type || response.result.type === "data") && {
6278
- type: "data",
6279
- data: runtime.transformer.deserialize(response.result.data)
6280
- }
6281
- };
6282
- return {
6283
- ok: true,
6284
- result
6285
- };
6286
- }
6287
- __name(transformResultInner, "transformResultInner");
6288
- function isObject(value) {
6289
- return !!value && !Array.isArray(value) && typeof value === "object";
6290
- }
6291
- __name(isObject, "isObject");
6292
- function transformResult(response, runtime) {
6293
- let result;
6294
- try {
6295
- result = transformResultInner(response, runtime);
6296
- } catch (err) {
6297
- throw new TRPCClientError("Unable to transform response from server");
6298
- }
6299
- if (!result.ok && (!isObject(result.error.error) || typeof result.error.error.code !== "number")) {
6300
- throw new TRPCClientError("Badly formatted response from server");
6301
- }
6302
- if (result.ok && !isObject(result.result)) {
6303
- throw new TRPCClientError("Badly formatted response from server");
6304
- }
6305
- return result;
6306
- }
6307
- __name(transformResult, "transformResult");
6308
-
6309
- // ../../../node_modules/.pnpm/@trpc+client@10.17.0_@trpc+server@10.17.0/node_modules/@trpc/client/dist/splitLink-4c75f7be.mjs
6231
+ // ../../../node_modules/.pnpm/@trpc+client@10.45.2_@trpc+server@10.45.2/node_modules/@trpc/client/dist/splitLink-4c75f7be.mjs
6310
6232
  function createChain(opts) {
6311
6233
  return observable((observer) => {
6312
6234
  function execute(index = 0, op = opts.op) {
@@ -6330,7 +6252,37 @@ function createChain(opts) {
6330
6252
  }
6331
6253
  __name(createChain, "createChain");
6332
6254
 
6333
- // ../../../node_modules/.pnpm/@trpc+server@10.17.0/node_modules/@trpc/server/dist/index-972002da.mjs
6255
+ // ../../../node_modules/.pnpm/@trpc+server@10.45.2/node_modules/@trpc/server/dist/codes-c924c3db.mjs
6256
+ function invert(obj) {
6257
+ const newObj = /* @__PURE__ */ Object.create(null);
6258
+ for (const key in obj) {
6259
+ const v = obj[key];
6260
+ newObj[v] = key;
6261
+ }
6262
+ return newObj;
6263
+ }
6264
+ __name(invert, "invert");
6265
+ var TRPC_ERROR_CODES_BY_KEY = {
6266
+ PARSE_ERROR: -32700,
6267
+ BAD_REQUEST: -32600,
6268
+ INTERNAL_SERVER_ERROR: -32603,
6269
+ NOT_IMPLEMENTED: -32603,
6270
+ UNAUTHORIZED: -32001,
6271
+ FORBIDDEN: -32003,
6272
+ NOT_FOUND: -32004,
6273
+ METHOD_NOT_SUPPORTED: -32005,
6274
+ TIMEOUT: -32008,
6275
+ CONFLICT: -32009,
6276
+ PRECONDITION_FAILED: -32012,
6277
+ PAYLOAD_TOO_LARGE: -32013,
6278
+ UNPROCESSABLE_CONTENT: -32022,
6279
+ TOO_MANY_REQUESTS: -32029,
6280
+ CLIENT_CLOSED_REQUEST: -32099
6281
+ };
6282
+ var TRPC_ERROR_CODES_BY_NUMBER = invert(TRPC_ERROR_CODES_BY_KEY);
6283
+
6284
+ // ../../../node_modules/.pnpm/@trpc+server@10.45.2/node_modules/@trpc/server/dist/index-f91d720c.mjs
6285
+ var TRPC_ERROR_CODES_BY_NUMBER2 = invert(TRPC_ERROR_CODES_BY_KEY);
6334
6286
  var noop = /* @__PURE__ */ __name(() => {
6335
6287
  }, "noop");
6336
6288
  function createInnerProxy(callback, path) {
@@ -6345,9 +6297,10 @@ function createInnerProxy(callback, path) {
6345
6297
  ]);
6346
6298
  },
6347
6299
  apply(_1, _2, args) {
6300
+ const isApply = path[path.length - 1] === "apply";
6348
6301
  return callback({
6349
- args,
6350
- path
6302
+ args: isApply ? args.length >= 2 ? args[1] : [] : args,
6303
+ path: isApply ? path.slice(0, -1) : path
6351
6304
  });
6352
6305
  }
6353
6306
  });
@@ -6366,21 +6319,152 @@ var createFlatProxy = /* @__PURE__ */ __name((callback) => {
6366
6319
  });
6367
6320
  }, "createFlatProxy");
6368
6321
 
6369
- // ../../../node_modules/.pnpm/@trpc+client@10.17.0_@trpc+server@10.17.0/node_modules/@trpc/client/dist/httpUtils-9b676ab4.mjs
6370
- var isFunction = /* @__PURE__ */ __name((fn) => typeof fn === "function", "isFunction");
6371
- function _bind(fn, thisArg) {
6372
- return isFunction(fn.bind) ? fn.bind(thisArg) : fn;
6322
+ // ../../../node_modules/.pnpm/@trpc+server@10.45.2/node_modules/@trpc/server/dist/getCauseFromUnknown-2d66414a.mjs
6323
+ function isObject(value) {
6324
+ return !!value && !Array.isArray(value) && typeof value === "object";
6373
6325
  }
6374
- __name(_bind, "_bind");
6326
+ __name(isObject, "isObject");
6327
+ var UnknownCauseError = class extends Error {
6328
+ };
6329
+ __name(UnknownCauseError, "UnknownCauseError");
6330
+ function getCauseFromUnknown(cause) {
6331
+ if (cause instanceof Error) {
6332
+ return cause;
6333
+ }
6334
+ const type = typeof cause;
6335
+ if (type === "undefined" || type === "function" || cause === null) {
6336
+ return void 0;
6337
+ }
6338
+ if (type !== "object") {
6339
+ return new Error(String(cause));
6340
+ }
6341
+ if (isObject(cause)) {
6342
+ const err = new UnknownCauseError();
6343
+ for (const key in cause) {
6344
+ err[key] = cause[key];
6345
+ }
6346
+ return err;
6347
+ }
6348
+ return void 0;
6349
+ }
6350
+ __name(getCauseFromUnknown, "getCauseFromUnknown");
6351
+
6352
+ // ../../../node_modules/.pnpm/@trpc+client@10.45.2_@trpc+server@10.45.2/node_modules/@trpc/client/dist/transformResult-ace864b8.mjs
6353
+ function isObject2(value) {
6354
+ return !!value && !Array.isArray(value) && typeof value === "object";
6355
+ }
6356
+ __name(isObject2, "isObject");
6357
+ function transformResultInner(response, runtime) {
6358
+ if ("error" in response) {
6359
+ const error = runtime.transformer.deserialize(response.error);
6360
+ return {
6361
+ ok: false,
6362
+ error: {
6363
+ ...response,
6364
+ error
6365
+ }
6366
+ };
6367
+ }
6368
+ const result = {
6369
+ ...response.result,
6370
+ ...(!response.result.type || response.result.type === "data") && {
6371
+ type: "data",
6372
+ data: runtime.transformer.deserialize(response.result.data)
6373
+ }
6374
+ };
6375
+ return {
6376
+ ok: true,
6377
+ result
6378
+ };
6379
+ }
6380
+ __name(transformResultInner, "transformResultInner");
6381
+ var TransformResultError = class extends Error {
6382
+ constructor() {
6383
+ super("Unable to transform response from server");
6384
+ }
6385
+ };
6386
+ __name(TransformResultError, "TransformResultError");
6387
+ function transformResult(response, runtime) {
6388
+ let result;
6389
+ try {
6390
+ result = transformResultInner(response, runtime);
6391
+ } catch (err) {
6392
+ throw new TransformResultError();
6393
+ }
6394
+ if (!result.ok && (!isObject2(result.error.error) || typeof result.error.error.code !== "number")) {
6395
+ throw new TransformResultError();
6396
+ }
6397
+ if (result.ok && !isObject2(result.result)) {
6398
+ throw new TransformResultError();
6399
+ }
6400
+ return result;
6401
+ }
6402
+ __name(transformResult, "transformResult");
6403
+
6404
+ // ../../../node_modules/.pnpm/@trpc+client@10.45.2_@trpc+server@10.45.2/node_modules/@trpc/client/dist/TRPCClientError-38f9a32a.mjs
6405
+ function isTRPCClientError(cause) {
6406
+ return cause instanceof TRPCClientError || cause instanceof Error && cause.name === "TRPCClientError";
6407
+ }
6408
+ __name(isTRPCClientError, "isTRPCClientError");
6409
+ function isTRPCErrorResponse(obj) {
6410
+ return isObject2(obj) && isObject2(obj.error) && typeof obj.error.code === "number" && typeof obj.error.message === "string";
6411
+ }
6412
+ __name(isTRPCErrorResponse, "isTRPCErrorResponse");
6413
+ var TRPCClientError = class extends Error {
6414
+ static from(_cause, opts = {}) {
6415
+ const cause = _cause;
6416
+ if (isTRPCClientError(cause)) {
6417
+ if (opts.meta) {
6418
+ cause.meta = {
6419
+ ...cause.meta,
6420
+ ...opts.meta
6421
+ };
6422
+ }
6423
+ return cause;
6424
+ }
6425
+ if (isTRPCErrorResponse(cause)) {
6426
+ return new TRPCClientError(cause.error.message, {
6427
+ ...opts,
6428
+ result: cause
6429
+ });
6430
+ }
6431
+ if (!(cause instanceof Error)) {
6432
+ return new TRPCClientError("Unknown error", {
6433
+ ...opts,
6434
+ cause
6435
+ });
6436
+ }
6437
+ return new TRPCClientError(cause.message, {
6438
+ ...opts,
6439
+ cause: getCauseFromUnknown(cause)
6440
+ });
6441
+ }
6442
+ constructor(message, opts) {
6443
+ const cause = opts?.cause;
6444
+ super(message, {
6445
+ cause
6446
+ });
6447
+ this.meta = opts?.meta;
6448
+ this.cause = cause;
6449
+ this.shape = opts?.result?.error;
6450
+ this.data = opts?.result?.error.data;
6451
+ this.name = "TRPCClientError";
6452
+ Object.setPrototypeOf(this, TRPCClientError.prototype);
6453
+ }
6454
+ };
6455
+ __name(TRPCClientError, "TRPCClientError");
6456
+
6457
+ // ../../../node_modules/.pnpm/@trpc+client@10.45.2_@trpc+server@10.45.2/node_modules/@trpc/client/dist/httpUtils-b9d0cb48.mjs
6458
+ var isFunction = /* @__PURE__ */ __name((fn) => typeof fn === "function", "isFunction");
6375
6459
  function getFetch(customFetchImpl) {
6376
6460
  if (customFetchImpl) {
6377
6461
  return customFetchImpl;
6378
6462
  }
6379
6463
  if (typeof window !== "undefined" && isFunction(window.fetch)) {
6380
- return _bind(window.fetch, window);
6464
+ return window.fetch;
6381
6465
  }
6382
6466
  if (typeof globalThis !== "undefined" && isFunction(globalThis.fetch)) {
6383
- return _bind(globalThis.fetch, globalThis);
6467
+ return globalThis.fetch;
6384
6468
  }
6385
6469
  throw new Error("No fetch implementation found");
6386
6470
  }
@@ -6399,12 +6483,10 @@ function getAbortController(customAbortControllerImpl) {
6399
6483
  }
6400
6484
  __name(getAbortController, "getAbortController");
6401
6485
  function resolveHTTPLinkOptions(opts) {
6402
- const headers = opts.headers || (() => ({}));
6403
6486
  return {
6404
- url: opts.url,
6405
- fetch: getFetch(opts.fetch),
6406
- AbortController: getAbortController(opts.AbortController),
6407
- headers: typeof headers === "function" ? headers : () => headers
6487
+ url: opts.url.toString().replace(/\/$/, ""),
6488
+ fetch: opts.fetch,
6489
+ AbortController: getAbortController(opts.AbortController)
6408
6490
  };
6409
6491
  }
6410
6492
  __name(resolveHTTPLinkOptions, "resolveHTTPLinkOptions");
@@ -6425,7 +6507,7 @@ function getInput(opts) {
6425
6507
  return "input" in opts ? opts.runtime.transformer.serialize(opts.input) : arrayToDict(opts.inputs.map((_input) => opts.runtime.transformer.serialize(_input)));
6426
6508
  }
6427
6509
  __name(getInput, "getInput");
6428
- function getUrl(opts) {
6510
+ var getUrl = /* @__PURE__ */ __name((opts) => {
6429
6511
  let url = opts.url + "/" + opts.path;
6430
6512
  const queryParts = [];
6431
6513
  if ("inputs" in opts) {
@@ -6441,48 +6523,73 @@ function getUrl(opts) {
6441
6523
  url += "?" + queryParts.join("&");
6442
6524
  }
6443
6525
  return url;
6444
- }
6445
- __name(getUrl, "getUrl");
6446
- function getBody(opts) {
6526
+ }, "getUrl");
6527
+ var getBody = /* @__PURE__ */ __name((opts) => {
6447
6528
  if (opts.type === "query") {
6448
6529
  return void 0;
6449
6530
  }
6450
6531
  const input = getInput(opts);
6451
6532
  return input !== void 0 ? JSON.stringify(input) : void 0;
6533
+ }, "getBody");
6534
+ var jsonHttpRequester = /* @__PURE__ */ __name((opts) => {
6535
+ return httpRequest({
6536
+ ...opts,
6537
+ contentTypeHeader: "application/json",
6538
+ getUrl,
6539
+ getBody
6540
+ });
6541
+ }, "jsonHttpRequester");
6542
+ async function fetchHTTPResponse(opts, ac) {
6543
+ const url = opts.getUrl(opts);
6544
+ const body = opts.getBody(opts);
6545
+ const { type } = opts;
6546
+ const resolvedHeaders = await opts.headers();
6547
+ if (type === "subscription") {
6548
+ throw new Error("Subscriptions should use wsLink");
6549
+ }
6550
+ const headers = {
6551
+ ...opts.contentTypeHeader ? {
6552
+ "content-type": opts.contentTypeHeader
6553
+ } : {},
6554
+ ...opts.batchModeHeader ? {
6555
+ "trpc-batch-mode": opts.batchModeHeader
6556
+ } : {},
6557
+ ...resolvedHeaders
6558
+ };
6559
+ return getFetch(opts.fetch)(url, {
6560
+ method: METHOD[type],
6561
+ signal: ac?.signal,
6562
+ body,
6563
+ headers
6564
+ });
6452
6565
  }
6453
- __name(getBody, "getBody");
6566
+ __name(fetchHTTPResponse, "fetchHTTPResponse");
6454
6567
  function httpRequest(opts) {
6455
- const { type } = opts;
6456
6568
  const ac = opts.AbortController ? new opts.AbortController() : null;
6569
+ const meta = {};
6570
+ let done = false;
6457
6571
  const promise = new Promise((resolve, reject) => {
6458
- const url = getUrl(opts);
6459
- const body = getBody(opts);
6460
- const meta = {};
6461
- Promise.resolve(opts.headers()).then((headers) => {
6462
- if (type === "subscription") {
6463
- throw new Error("Subscriptions should use wsLink");
6464
- }
6465
- return opts.fetch(url, {
6466
- method: METHOD[type],
6467
- signal: ac?.signal,
6468
- body,
6469
- headers: {
6470
- "content-type": "application/json",
6471
- ...headers
6472
- }
6473
- });
6474
- }).then((_res) => {
6572
+ fetchHTTPResponse(opts, ac).then((_res) => {
6475
6573
  meta.response = _res;
6574
+ done = true;
6476
6575
  return _res.json();
6477
6576
  }).then((json) => {
6577
+ meta.responseJSON = json;
6478
6578
  resolve({
6479
6579
  json,
6480
6580
  meta
6481
6581
  });
6482
- }).catch(reject);
6582
+ }).catch((err) => {
6583
+ done = true;
6584
+ reject(TRPCClientError.from(err, {
6585
+ meta
6586
+ }));
6587
+ });
6483
6588
  });
6484
6589
  const cancel = /* @__PURE__ */ __name(() => {
6485
- ac?.abort();
6590
+ if (!done) {
6591
+ ac?.abort();
6592
+ }
6486
6593
  }, "cancel");
6487
6594
  return {
6488
6595
  promise,
@@ -6491,7 +6598,7 @@ function httpRequest(opts) {
6491
6598
  }
6492
6599
  __name(httpRequest, "httpRequest");
6493
6600
 
6494
- // ../../../node_modules/.pnpm/@trpc+client@10.17.0_@trpc+server@10.17.0/node_modules/@trpc/client/dist/links/httpBatchLink.mjs
6601
+ // ../../../node_modules/.pnpm/@trpc+client@10.45.2_@trpc+server@10.45.2/node_modules/@trpc/client/dist/httpBatchLink-d0f9eac9.mjs
6495
6602
  var throwFatalError = /* @__PURE__ */ __name(() => {
6496
6603
  throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new");
6497
6604
  }, "throwFatalError");
@@ -6515,7 +6622,7 @@ function dataLoader(batchLoader) {
6515
6622
  }
6516
6623
  const lastGroup = groupedItems[groupedItems.length - 1];
6517
6624
  if (item.aborted) {
6518
- item.reject(new Error("Aborted"));
6625
+ item.reject?.(new Error("Aborted"));
6519
6626
  index++;
6520
6627
  continue;
6521
6628
  }
@@ -6526,7 +6633,7 @@ function dataLoader(batchLoader) {
6526
6633
  continue;
6527
6634
  }
6528
6635
  if (lastGroup.length === 0) {
6529
- item.reject(new Error("Input is too big for a single dispatch"));
6636
+ item.reject?.(new Error("Input is too big for a single dispatch"));
6530
6637
  index++;
6531
6638
  continue;
6532
6639
  }
@@ -6549,18 +6656,27 @@ function dataLoader(batchLoader) {
6549
6656
  for (const item of items) {
6550
6657
  item.batch = batch;
6551
6658
  }
6552
- const { promise, cancel } = batchLoader.fetch(batch.items.map((_item) => _item.key));
6659
+ const unitResolver = /* @__PURE__ */ __name((index, value) => {
6660
+ const item = batch.items[index];
6661
+ item.resolve?.(value);
6662
+ item.batch = null;
6663
+ item.reject = null;
6664
+ item.resolve = null;
6665
+ }, "unitResolver");
6666
+ const { promise, cancel } = batchLoader.fetch(batch.items.map((_item) => _item.key), unitResolver);
6553
6667
  batch.cancel = cancel;
6554
6668
  promise.then((result) => {
6555
6669
  for (let i = 0; i < result.length; i++) {
6556
6670
  const value = result[i];
6557
- const item = batch.items[i];
6558
- item.resolve(value);
6671
+ unitResolver(i, value);
6672
+ }
6673
+ for (const item of batch.items) {
6674
+ item.reject?.(new Error("Missing result"));
6559
6675
  item.batch = null;
6560
6676
  }
6561
6677
  }).catch((cause) => {
6562
6678
  for (const item of batch.items) {
6563
- item.reject(cause);
6679
+ item.reject?.(cause);
6564
6680
  item.batch = null;
6565
6681
  }
6566
6682
  });
@@ -6604,89 +6720,170 @@ function dataLoader(batchLoader) {
6604
6720
  };
6605
6721
  }
6606
6722
  __name(dataLoader, "dataLoader");
6607
- function httpBatchLink(opts) {
6608
- const resolvedOpts = resolveHTTPLinkOptions(opts);
6609
- return (runtime) => {
6610
- const maxURLLength = opts.maxURLLength || Infinity;
6611
- const batchLoader = /* @__PURE__ */ __name((type) => {
6612
- const validate = /* @__PURE__ */ __name((batchOps) => {
6613
- if (maxURLLength === Infinity) {
6614
- return true;
6615
- }
6616
- const path = batchOps.map((op) => op.path).join(",");
6617
- const inputs = batchOps.map((op) => op.input);
6618
- const url = getUrl({
6619
- ...resolvedOpts,
6620
- runtime,
6621
- type,
6622
- path,
6623
- inputs
6624
- });
6625
- return url.length <= maxURLLength;
6626
- }, "validate");
6627
- const fetch = /* @__PURE__ */ __name((batchOps) => {
6628
- const path = batchOps.map((op) => op.path).join(",");
6629
- const inputs = batchOps.map((op) => op.input);
6630
- const { promise, cancel } = httpRequest({
6723
+ function createHTTPBatchLink(requester) {
6724
+ return /* @__PURE__ */ __name(function httpBatchLink2(opts) {
6725
+ const resolvedOpts = resolveHTTPLinkOptions(opts);
6726
+ const maxURLLength = opts.maxURLLength ?? Infinity;
6727
+ return (runtime) => {
6728
+ const batchLoader = /* @__PURE__ */ __name((type) => {
6729
+ const validate = /* @__PURE__ */ __name((batchOps) => {
6730
+ if (maxURLLength === Infinity) {
6731
+ return true;
6732
+ }
6733
+ const path = batchOps.map((op) => op.path).join(",");
6734
+ const inputs = batchOps.map((op) => op.input);
6735
+ const url = getUrl({
6736
+ ...resolvedOpts,
6737
+ runtime,
6738
+ type,
6739
+ path,
6740
+ inputs
6741
+ });
6742
+ return url.length <= maxURLLength;
6743
+ }, "validate");
6744
+ const fetch = requester({
6631
6745
  ...resolvedOpts,
6632
6746
  runtime,
6633
6747
  type,
6634
- path,
6635
- inputs
6748
+ opts
6636
6749
  });
6637
6750
  return {
6638
- promise: promise.then((res) => {
6639
- const resJSON = Array.isArray(res.json) ? res.json : batchOps.map(() => res.json);
6640
- const result = resJSON.map((item) => ({
6641
- meta: res.meta,
6642
- json: item
6643
- }));
6644
- return result;
6645
- }),
6646
- cancel
6751
+ validate,
6752
+ fetch
6647
6753
  };
6648
- }, "fetch");
6649
- return {
6650
- validate,
6651
- fetch
6754
+ }, "batchLoader");
6755
+ const query = dataLoader(batchLoader("query"));
6756
+ const mutation = dataLoader(batchLoader("mutation"));
6757
+ const subscription = dataLoader(batchLoader("subscription"));
6758
+ const loaders = {
6759
+ query,
6760
+ subscription,
6761
+ mutation
6652
6762
  };
6653
- }, "batchLoader");
6654
- const query = dataLoader(batchLoader("query"));
6655
- const mutation = dataLoader(batchLoader("mutation"));
6656
- const subscription = dataLoader(batchLoader("subscription"));
6657
- const loaders = {
6658
- query,
6659
- subscription,
6660
- mutation
6661
- };
6662
- return ({ op }) => {
6663
- return observable((observer) => {
6664
- const loader = loaders[op.type];
6665
- const { promise, cancel } = loader.load(op);
6666
- promise.then((res) => {
6667
- const transformed = transformResult(res.json, runtime);
6668
- if (!transformed.ok) {
6669
- observer.error(TRPCClientError.from(transformed.error, {
6670
- meta: res.meta
6763
+ return ({ op }) => {
6764
+ return observable((observer) => {
6765
+ const loader = loaders[op.type];
6766
+ const { promise, cancel } = loader.load(op);
6767
+ let _res = void 0;
6768
+ promise.then((res) => {
6769
+ _res = res;
6770
+ const transformed = transformResult(res.json, runtime);
6771
+ if (!transformed.ok) {
6772
+ observer.error(TRPCClientError.from(transformed.error, {
6773
+ meta: res.meta
6774
+ }));
6775
+ return;
6776
+ }
6777
+ observer.next({
6778
+ context: res.meta,
6779
+ result: transformed.result
6780
+ });
6781
+ observer.complete();
6782
+ }).catch((err) => {
6783
+ observer.error(TRPCClientError.from(err, {
6784
+ meta: _res?.meta
6671
6785
  }));
6672
- return;
6673
- }
6674
- observer.next({
6675
- context: res.meta,
6676
- result: transformed.result
6677
6786
  });
6678
- observer.complete();
6679
- }).catch((err) => observer.error(TRPCClientError.from(err)));
6680
- return () => {
6681
- cancel();
6682
- };
6683
- });
6787
+ return () => {
6788
+ cancel();
6789
+ };
6790
+ });
6791
+ };
6792
+ };
6793
+ }, "httpBatchLink");
6794
+ }
6795
+ __name(createHTTPBatchLink, "createHTTPBatchLink");
6796
+ var batchRequester = /* @__PURE__ */ __name((requesterOpts) => {
6797
+ return (batchOps) => {
6798
+ const path = batchOps.map((op) => op.path).join(",");
6799
+ const inputs = batchOps.map((op) => op.input);
6800
+ const { promise, cancel } = jsonHttpRequester({
6801
+ ...requesterOpts,
6802
+ path,
6803
+ inputs,
6804
+ headers() {
6805
+ if (!requesterOpts.opts.headers) {
6806
+ return {};
6807
+ }
6808
+ if (typeof requesterOpts.opts.headers === "function") {
6809
+ return requesterOpts.opts.headers({
6810
+ opList: batchOps
6811
+ });
6812
+ }
6813
+ return requesterOpts.opts.headers;
6814
+ }
6815
+ });
6816
+ return {
6817
+ promise: promise.then((res) => {
6818
+ const resJSON = Array.isArray(res.json) ? res.json : batchOps.map(() => res.json);
6819
+ const result = resJSON.map((item) => ({
6820
+ meta: res.meta,
6821
+ json: item
6822
+ }));
6823
+ return result;
6824
+ }),
6825
+ cancel
6684
6826
  };
6685
6827
  };
6828
+ }, "batchRequester");
6829
+ var httpBatchLink = createHTTPBatchLink(batchRequester);
6830
+
6831
+ // ../../../node_modules/.pnpm/@trpc+client@10.45.2_@trpc+server@10.45.2/node_modules/@trpc/client/dist/links/httpLink.mjs
6832
+ function httpLinkFactory(factoryOpts) {
6833
+ return (opts) => {
6834
+ const resolvedOpts = resolveHTTPLinkOptions(opts);
6835
+ return (runtime) => ({ op }) => observable((observer) => {
6836
+ const { path, input, type } = op;
6837
+ const { promise, cancel } = factoryOpts.requester({
6838
+ ...resolvedOpts,
6839
+ runtime,
6840
+ type,
6841
+ path,
6842
+ input,
6843
+ headers() {
6844
+ if (!opts.headers) {
6845
+ return {};
6846
+ }
6847
+ if (typeof opts.headers === "function") {
6848
+ return opts.headers({
6849
+ op
6850
+ });
6851
+ }
6852
+ return opts.headers;
6853
+ }
6854
+ });
6855
+ let meta = void 0;
6856
+ promise.then((res) => {
6857
+ meta = res.meta;
6858
+ const transformed = transformResult(res.json, runtime);
6859
+ if (!transformed.ok) {
6860
+ observer.error(TRPCClientError.from(transformed.error, {
6861
+ meta
6862
+ }));
6863
+ return;
6864
+ }
6865
+ observer.next({
6866
+ context: res.meta,
6867
+ result: transformed.result
6868
+ });
6869
+ observer.complete();
6870
+ }).catch((cause) => {
6871
+ observer.error(TRPCClientError.from(cause, {
6872
+ meta
6873
+ }));
6874
+ });
6875
+ return () => {
6876
+ cancel();
6877
+ };
6878
+ });
6879
+ };
6686
6880
  }
6687
- __name(httpBatchLink, "httpBatchLink");
6881
+ __name(httpLinkFactory, "httpLinkFactory");
6882
+ var httpLink = httpLinkFactory({
6883
+ requester: jsonHttpRequester
6884
+ });
6688
6885
 
6689
- // ../../../node_modules/.pnpm/@trpc+client@10.17.0_@trpc+server@10.17.0/node_modules/@trpc/client/dist/index.mjs
6886
+ // ../../../node_modules/.pnpm/@trpc+client@10.45.2_@trpc+server@10.45.2/node_modules/@trpc/client/dist/index.mjs
6690
6887
  var TRPCUntypedClient = class {
6691
6888
  $request({ type, input, path, context = {} }) {
6692
6889
  const chain$ = createChain({
@@ -6759,23 +6956,34 @@ var TRPCUntypedClient = class {
6759
6956
  }
6760
6957
  constructor(opts) {
6761
6958
  this.requestId = 0;
6762
- function getTransformer() {
6959
+ const combinedTransformer = (() => {
6763
6960
  const transformer = opts.transformer;
6764
- if (!transformer)
6765
- return {
6766
- serialize: (data) => data,
6767
- deserialize: (data) => data
6768
- };
6769
- if ("input" in transformer)
6961
+ if (!transformer) {
6770
6962
  return {
6771
- serialize: transformer.input.serialize,
6772
- deserialize: transformer.output.deserialize
6963
+ input: {
6964
+ serialize: (data) => data,
6965
+ deserialize: (data) => data
6966
+ },
6967
+ output: {
6968
+ serialize: (data) => data,
6969
+ deserialize: (data) => data
6970
+ }
6773
6971
  };
6774
- return transformer;
6775
- }
6776
- __name(getTransformer, "getTransformer");
6972
+ }
6973
+ if ("input" in transformer) {
6974
+ return opts.transformer;
6975
+ }
6976
+ return {
6977
+ input: transformer,
6978
+ output: transformer
6979
+ };
6980
+ })();
6777
6981
  this.runtime = {
6778
- transformer: getTransformer()
6982
+ transformer: {
6983
+ serialize: (data) => combinedTransformer.input.serialize(data),
6984
+ deserialize: (data) => combinedTransformer.output.deserialize(data)
6985
+ },
6986
+ combinedTransformer
6779
6987
  };
6780
6988
  this.links = opts.links.map((link) => link(this.runtime));
6781
6989
  }
@@ -6786,18 +6994,23 @@ var clientCallTypeMap = {
6786
6994
  mutate: "mutation",
6787
6995
  subscribe: "subscription"
6788
6996
  };
6997
+ var clientCallTypeToProcedureType = /* @__PURE__ */ __name((clientCallType) => {
6998
+ return clientCallTypeMap[clientCallType];
6999
+ }, "clientCallTypeToProcedureType");
6789
7000
  function createTRPCClientProxy(client) {
6790
7001
  return createFlatProxy((key) => {
6791
7002
  if (client.hasOwnProperty(key)) {
6792
7003
  return client[key];
6793
7004
  }
7005
+ if (key === "__untypedClient") {
7006
+ return client;
7007
+ }
6794
7008
  return createRecursiveProxy(({ path, args }) => {
6795
7009
  const pathCopy = [
6796
7010
  key,
6797
7011
  ...path
6798
7012
  ];
6799
- const clientCallType = pathCopy.pop();
6800
- const procedureType = clientCallTypeMap[clientCallType];
7013
+ const procedureType = clientCallTypeToProcedureType(pathCopy.pop());
6801
7014
  const fullPath = pathCopy.join(".");
6802
7015
  return client[procedureType](fullPath, ...args);
6803
7016
  });
@@ -6810,6 +7023,161 @@ function createTRPCProxyClient(opts) {
6810
7023
  return proxy;
6811
7024
  }
6812
7025
  __name(createTRPCProxyClient, "createTRPCProxyClient");
7026
+ function getTextDecoder(customTextDecoder) {
7027
+ if (customTextDecoder) {
7028
+ return customTextDecoder;
7029
+ }
7030
+ if (typeof window !== "undefined" && window.TextDecoder) {
7031
+ return new window.TextDecoder();
7032
+ }
7033
+ if (typeof globalThis !== "undefined" && globalThis.TextDecoder) {
7034
+ return new globalThis.TextDecoder();
7035
+ }
7036
+ throw new Error("No TextDecoder implementation found");
7037
+ }
7038
+ __name(getTextDecoder, "getTextDecoder");
7039
+ async function parseJSONStream(opts) {
7040
+ const parse = opts.parse ?? JSON.parse;
7041
+ const onLine = /* @__PURE__ */ __name((line) => {
7042
+ if (opts.signal?.aborted)
7043
+ return;
7044
+ if (!line || line === "}") {
7045
+ return;
7046
+ }
7047
+ const indexOfColon = line.indexOf(":");
7048
+ const indexAsStr = line.substring(2, indexOfColon - 1);
7049
+ const text = line.substring(indexOfColon + 1);
7050
+ opts.onSingle(Number(indexAsStr), parse(text));
7051
+ }, "onLine");
7052
+ await readLines(opts.readableStream, onLine, opts.textDecoder);
7053
+ }
7054
+ __name(parseJSONStream, "parseJSONStream");
7055
+ async function readLines(readableStream, onLine, textDecoder) {
7056
+ let partOfLine = "";
7057
+ const onChunk = /* @__PURE__ */ __name((chunk2) => {
7058
+ const chunkText = textDecoder.decode(chunk2);
7059
+ const chunkLines = chunkText.split("\n");
7060
+ if (chunkLines.length === 1) {
7061
+ partOfLine += chunkLines[0];
7062
+ } else if (chunkLines.length > 1) {
7063
+ onLine(partOfLine + chunkLines[0]);
7064
+ for (let i = 1; i < chunkLines.length - 1; i++) {
7065
+ onLine(chunkLines[i]);
7066
+ }
7067
+ partOfLine = chunkLines[chunkLines.length - 1];
7068
+ }
7069
+ }, "onChunk");
7070
+ if ("getReader" in readableStream) {
7071
+ await readStandardChunks(readableStream, onChunk);
7072
+ } else {
7073
+ await readNodeChunks(readableStream, onChunk);
7074
+ }
7075
+ onLine(partOfLine);
7076
+ }
7077
+ __name(readLines, "readLines");
7078
+ function readNodeChunks(stream, onChunk) {
7079
+ return new Promise((resolve) => {
7080
+ stream.on("data", onChunk);
7081
+ stream.on("end", resolve);
7082
+ });
7083
+ }
7084
+ __name(readNodeChunks, "readNodeChunks");
7085
+ async function readStandardChunks(stream, onChunk) {
7086
+ const reader = stream.getReader();
7087
+ let readResult = await reader.read();
7088
+ while (!readResult.done) {
7089
+ onChunk(readResult.value);
7090
+ readResult = await reader.read();
7091
+ }
7092
+ }
7093
+ __name(readStandardChunks, "readStandardChunks");
7094
+ var streamingJsonHttpRequester = /* @__PURE__ */ __name((opts, onSingle) => {
7095
+ const ac = opts.AbortController ? new opts.AbortController() : null;
7096
+ const responsePromise = fetchHTTPResponse({
7097
+ ...opts,
7098
+ contentTypeHeader: "application/json",
7099
+ batchModeHeader: "stream",
7100
+ getUrl,
7101
+ getBody
7102
+ }, ac);
7103
+ const cancel = /* @__PURE__ */ __name(() => ac?.abort(), "cancel");
7104
+ const promise = responsePromise.then(async (res) => {
7105
+ if (!res.body)
7106
+ throw new Error("Received response without body");
7107
+ const meta = {
7108
+ response: res
7109
+ };
7110
+ return parseJSONStream({
7111
+ readableStream: res.body,
7112
+ onSingle,
7113
+ parse: (string) => ({
7114
+ json: JSON.parse(string),
7115
+ meta
7116
+ }),
7117
+ signal: ac?.signal,
7118
+ textDecoder: opts.textDecoder
7119
+ });
7120
+ });
7121
+ return {
7122
+ cancel,
7123
+ promise
7124
+ };
7125
+ }, "streamingJsonHttpRequester");
7126
+ var streamRequester = /* @__PURE__ */ __name((requesterOpts) => {
7127
+ const textDecoder = getTextDecoder(requesterOpts.opts.textDecoder);
7128
+ return (batchOps, unitResolver) => {
7129
+ const path = batchOps.map((op) => op.path).join(",");
7130
+ const inputs = batchOps.map((op) => op.input);
7131
+ const { cancel, promise } = streamingJsonHttpRequester({
7132
+ ...requesterOpts,
7133
+ textDecoder,
7134
+ path,
7135
+ inputs,
7136
+ headers() {
7137
+ if (!requesterOpts.opts.headers) {
7138
+ return {};
7139
+ }
7140
+ if (typeof requesterOpts.opts.headers === "function") {
7141
+ return requesterOpts.opts.headers({
7142
+ opList: batchOps
7143
+ });
7144
+ }
7145
+ return requesterOpts.opts.headers;
7146
+ }
7147
+ }, (index, res) => {
7148
+ unitResolver(index, res);
7149
+ });
7150
+ return {
7151
+ promise: promise.then(() => []),
7152
+ cancel
7153
+ };
7154
+ };
7155
+ }, "streamRequester");
7156
+ var unstable_httpBatchStreamLink = createHTTPBatchLink(streamRequester);
7157
+ var getBody2 = /* @__PURE__ */ __name((opts) => {
7158
+ if (!("input" in opts)) {
7159
+ return void 0;
7160
+ }
7161
+ if (!(opts.input instanceof FormData)) {
7162
+ throw new Error("Input is not FormData");
7163
+ }
7164
+ return opts.input;
7165
+ }, "getBody");
7166
+ var formDataRequester = /* @__PURE__ */ __name((opts) => {
7167
+ if (opts.type !== "mutation") {
7168
+ throw new Error("We only handle mutations with formdata");
7169
+ }
7170
+ return httpRequest({
7171
+ ...opts,
7172
+ getUrl() {
7173
+ return `${opts.url}/${opts.path}`;
7174
+ },
7175
+ getBody: getBody2
7176
+ });
7177
+ }, "formDataRequester");
7178
+ var experimental_formDataLink = httpLinkFactory({
7179
+ requester: formDataRequester
7180
+ });
6813
7181
 
6814
7182
  // ../../learn-card-network/cloud-client/dist/learn-cloud-client.esm.js
6815
7183
  var __defProp2 = Object.defineProperty;
@@ -6852,7 +7220,11 @@ var getClient = /* @__PURE__ */ __name2(async (url, didAuthFunction) => {
6852
7220
  let challenges = [];
6853
7221
  const challengeRequester = createTRPCProxyClient({
6854
7222
  links: [
6855
- httpBatchLink({ url, headers: { Authorization: `Bearer ${await didAuthFunction()}` } })
7223
+ httpBatchLink({
7224
+ url,
7225
+ maxURLLength: 2048,
7226
+ headers: { Authorization: `Bearer ${await didAuthFunction()}` }
7227
+ })
6856
7228
  ]
6857
7229
  });
6858
7230
  const getChallenges = /* @__PURE__ */ __name2(async (amount = 95 + Math.round((Math.random() - 0.5) * 5)) => {
@@ -6866,6 +7238,7 @@ var getClient = /* @__PURE__ */ __name2(async (url, didAuthFunction) => {
6866
7238
  }),
6867
7239
  httpBatchLink({
6868
7240
  url,
7241
+ maxURLLength: 2048,
6869
7242
  headers: async () => {
6870
7243
  if (challenges.length === 0)
6871
7244
  challenges.push(...await getChallenges());
@@ -6976,6 +7349,8 @@ var require_types_cjs_development = __commonJS2({
6976
7349
  LCNProfileValidator: () => LCNProfileValidator2,
6977
7350
  LCNSigningAuthorityForUserValidator: () => LCNSigningAuthorityForUserValidator2,
6978
7351
  LCNSigningAuthorityValidator: () => LCNSigningAuthorityValidator2,
7352
+ PaginatedBoostRecipientsValidator: () => PaginatedBoostRecipientsValidator2,
7353
+ PaginatedBoostsValidator: () => PaginatedBoostsValidator2,
6979
7354
  PaginatedConsentFlowContractsValidator: () => PaginatedConsentFlowContractsValidator2,
6980
7355
  PaginatedConsentFlowDataValidator: () => PaginatedConsentFlowDataValidator2,
6981
7356
  PaginatedConsentFlowTermsValidator: () => PaginatedConsentFlowTermsValidator2,
@@ -10787,11 +11162,17 @@ var require_types_cjs_development = __commonJS2({
10787
11162
  status: LCNBoostStatus2.optional(),
10788
11163
  autoConnectRecipients: mod2.boolean().optional()
10789
11164
  });
11165
+ var PaginatedBoostsValidator2 = PaginationResponseValidator2.extend({
11166
+ records: BoostValidator2.array()
11167
+ });
10790
11168
  var BoostRecipientValidator2 = mod2.object({
10791
11169
  to: LCNProfileValidator2,
10792
11170
  from: mod2.string(),
10793
11171
  received: mod2.string().optional()
10794
11172
  });
11173
+ var PaginatedBoostRecipientsValidator2 = PaginationResponseValidator2.extend({
11174
+ records: BoostRecipientValidator2.array()
11175
+ });
10795
11176
  var LCNBoostClaimLinkSigningAuthorityValidator2 = mod2.object({
10796
11177
  endpoint: mod2.string(),
10797
11178
  name: mod2.string(),
@@ -14737,11 +15118,17 @@ var BoostValidator = mod.object({
14737
15118
  status: LCNBoostStatus.optional(),
14738
15119
  autoConnectRecipients: mod.boolean().optional()
14739
15120
  });
15121
+ var PaginatedBoostsValidator = PaginationResponseValidator.extend({
15122
+ records: BoostValidator.array()
15123
+ });
14740
15124
  var BoostRecipientValidator = mod.object({
14741
15125
  to: LCNProfileValidator,
14742
15126
  from: mod.string(),
14743
15127
  received: mod.string().optional()
14744
15128
  });
15129
+ var PaginatedBoostRecipientsValidator = PaginationResponseValidator.extend({
15130
+ records: BoostRecipientValidator.array()
15131
+ });
14745
15132
  var LCNBoostClaimLinkSigningAuthorityValidator = mod.object({
14746
15133
  endpoint: mod.string(),
14747
15134
  name: mod.string(),