gearboxdownloadmodal 8.5.4 → 8.5.6

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/index.es.js CHANGED
@@ -285,18 +285,18 @@ function gl() {
285
285
  if (wi && ii && typeof wi.stack == "string") {
286
286
  for (var li = wi.stack.split(`
287
287
  `), xi = ii.stack.split(`
288
- `), Ji = li.length - 1, Wi = xi.length - 1; Ji >= 1 && Wi >= 0 && li[Ji] !== xi[Wi]; )
288
+ `), ki = li.length - 1, Wi = xi.length - 1; ki >= 1 && Wi >= 0 && li[ki] !== xi[Wi]; )
289
289
  Wi--;
290
- for (; Ji >= 1 && Wi >= 0; Ji--, Wi--)
291
- if (li[Ji] !== xi[Wi]) {
292
- if (Ji !== 1 || Wi !== 1)
290
+ for (; ki >= 1 && Wi >= 0; ki--, Wi--)
291
+ if (li[ki] !== xi[Wi]) {
292
+ if (ki !== 1 || Wi !== 1)
293
293
  do
294
- if (Ji--, Wi--, Wi < 0 || li[Ji] !== xi[Wi]) {
294
+ if (ki--, Wi--, Wi < 0 || li[ki] !== xi[Wi]) {
295
295
  var ie = `
296
- ` + li[Ji].replace(" at new ", " at ");
296
+ ` + li[ki].replace(" at new ", " at ");
297
297
  return d.displayName && ie.includes("<anonymous>") && (ie = ie.replace("<anonymous>", d.displayName)), typeof d == "function" && ai.set(d, ie), ie;
298
298
  }
299
- while (Ji >= 1 && Wi >= 0);
299
+ while (ki >= 1 && Wi >= 0);
300
300
  break;
301
301
  }
302
302
  }
@@ -362,8 +362,8 @@ function gl() {
362
362
  throw xi.name = "Invariant Violation", xi;
363
363
  }
364
364
  li = d[qi](E, qi, ii, N, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
365
- } catch (Ji) {
366
- li = Ji;
365
+ } catch (ki) {
366
+ li = ki;
367
367
  }
368
368
  li && !(li instanceof Error) && (T(Ki), k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", ii || "React class", N, qi, typeof li), T(null)), li instanceof Error && !(li.message in Pi) && (Pi[li.message] = !0, T(Ki), k("Failed %s type: %s", N, li.message), T(null));
369
369
  }
@@ -422,7 +422,7 @@ function gl() {
422
422
  ge[N] || (k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', f(bi.current.type), d.ref), ge[N] = !0);
423
423
  }
424
424
  }
425
- function ki(d, E) {
425
+ function Ji(d, E) {
426
426
  {
427
427
  var N = function() {
428
428
  At || (At = !0, k("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", E));
@@ -480,13 +480,13 @@ function gl() {
480
480
  for (hi in E)
481
481
  Gi.call(E, hi) && !re.hasOwnProperty(hi) && (qi[hi] = E[hi]);
482
482
  if (d && d.defaultProps) {
483
- var Ji = d.defaultProps;
484
- for (hi in Ji)
485
- qi[hi] === void 0 && (qi[hi] = Ji[hi]);
483
+ var ki = d.defaultProps;
484
+ for (hi in ki)
485
+ qi[hi] === void 0 && (qi[hi] = ki[hi]);
486
486
  }
487
487
  if (li || xi) {
488
488
  var Wi = typeof d == "function" ? d.displayName || d.name || "Unknown" : d;
489
- li && ki(qi, Wi), xi && Vi(qi, Wi);
489
+ li && Ji(qi, Wi), xi && Vi(qi, Wi);
490
490
  }
491
491
  return ke(d, li, xi, Ki, ii, bi.current, qi);
492
492
  }
@@ -618,8 +618,8 @@ Check the top-level render call using <` + N + ">.");
618
618
  (d === void 0 || typeof d == "object" && d !== null && Object.keys(d).length === 0) && (li += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
619
619
  var xi = tl(Ki);
620
620
  xi ? li += xi : li += ar();
621
- var Ji;
622
- d === null ? Ji = "null" : Ii(d) ? Ji = "array" : d !== void 0 && d.$$typeof === i ? (Ji = "<" + (f(d.type) || "Unknown") + " />", li = " Did you accidentally export a JSX literal instead of a component?") : Ji = typeof d, k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Ji, li);
621
+ var ki;
622
+ d === null ? ki = "null" : Ii(d) ? ki = "array" : d !== void 0 && d.$$typeof === i ? (ki = "<" + (f(d.type) || "Unknown") + " />", li = " Did you accidentally export a JSX literal instead of a component?") : ki = typeof d, k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ki, li);
623
623
  }
624
624
  var Wi = _i(d, E, N, Ki, hi);
625
625
  if (Wi == null)
@@ -10040,7 +10040,8 @@ async function ko(e, i, t) {
10040
10040
  _id: i,
10041
10041
  networks: t.networks,
10042
10042
  versions: t.versions,
10043
- interactions: t.interactions || ["0 click"]
10043
+ interactions: t.interactions || ["0 click"],
10044
+ extras: t.extras || {}
10044
10045
  })).data;
10045
10046
  }
10046
10047
  const yI = ({
@@ -10077,12 +10078,12 @@ const yI = ({
10077
10078
  adikteev: "Copy CDN"
10078
10079
  }, bi = () => {
10079
10080
  t(e);
10080
- }, re = async (ni, ki, Vi) => {
10081
+ }, re = async (ni, Ji, Vi) => {
10081
10082
  if (H(!0), l === "Flex" && R.flex === !1 && R.customer !== "playableFactoryInternal") {
10082
10083
  p("|ACCESS|"), H(!1);
10083
10084
  return;
10084
10085
  }
10085
- if (_ && _.length > 0 && ki === "download")
10086
+ if (_ && _.length > 0 && Ji === "download")
10086
10087
  try {
10087
10088
  if (!c || !c._id)
10088
10089
  throw new Error("Game data is required for multi-version download");
@@ -10100,16 +10101,16 @@ const yI = ({
10100
10101
  urlType: G,
10101
10102
  responsiveType: "responsive"
10102
10103
  };
10103
- if (ge ? ki === "copy" ? (b(!0), ki = "download", ke.molocoGenerateHtml = !0) : z(!0) : Gt && (ke.responsiveType = Vi), console.log("getVersion", ni, ki, ke), ni === "cdn") {
10104
+ if (ge ? Ji === "copy" ? (b(!0), Ji = "download", ke.molocoGenerateHtml = !0) : z(!0) : Gt && (ke.responsiveType = Vi), console.log("getVersion", ni, Ji, ke), ni === "cdn") {
10104
10105
  j(!0), await F(!0), H(!1);
10105
10106
  return;
10106
10107
  }
10107
- return ni === "adikteev" && (ki = "copy"), new Promise((_i, ye) => {
10108
+ return ni === "adikteev" && (Ji = "copy"), new Promise((_i, ye) => {
10108
10109
  it(
10109
10110
  A,
10110
10111
  ni,
10111
10112
  Ie ? I : null,
10112
- ki,
10113
+ Ji,
10113
10114
  h,
10114
10115
  ke
10115
10116
  ).then(($i) => {
@@ -10120,24 +10121,24 @@ const yI = ({
10120
10121
  });
10121
10122
  }, At = async (ni = !1) => {
10122
10123
  ni ? b(!0) : z(!0);
10123
- const ki = {
10124
+ const Ji = {
10124
10125
  molocoGenerateHtml: !1
10125
10126
  };
10126
- if (ni && (ki.molocoGenerateHtml = !0), _ && _.length > 0)
10127
+ if (ni && (Ji.molocoGenerateHtml = !0), _ && _.length > 0)
10127
10128
  try {
10128
10129
  if (!c || !c._id)
10129
10130
  throw new Error("Game data is required for multi-version download");
10130
10131
  const Vi = await ko(q, c._id, {
10131
10132
  networks: ["moloco"],
10132
10133
  versions: _,
10133
- extras: { molocoGenerateHtml: ni }
10134
+ extras: Ji
10134
10135
  }), ke = u + "/" + Vi.url, ye = await (await fetch(ke)).blob(), $i = window.URL.createObjectURL(ye), Ti = document.createElement("a");
10135
10136
  return Ti.href = $i, Ti.download = Vi.url.split("/").pop() || "download.zip", document.body.appendChild(Ti), Ti.click(), window.URL.revokeObjectURL($i), document.body.removeChild(Ti), H(!1), ni ? b(!1) : z(!1), V(!1), Vi.url;
10136
10137
  } catch (Vi) {
10137
10138
  console.log("multi-version single network download error", Vi), H(!1), p(Vi.message, Vi);
10138
10139
  return;
10139
10140
  }
10140
- it(A, o, Ie ? I : null, "download", h, ki).then((Vi) => {
10141
+ it(A, o, Ie ? I : null, "download", h, Ji).then((Vi) => {
10141
10142
  ni ? b(!1) : z(!1), V(!1);
10142
10143
  }).catch((Vi) => {
10143
10144
  p(Vi.message, Vi);
@@ -10145,8 +10146,8 @@ const yI = ({
10145
10146
  }, Yt = async () => {
10146
10147
  ei(!0);
10147
10148
  const ni = await CI(q, A, o, l);
10148
- let ki = `${u}/${ni == null ? void 0 : ni.url}`;
10149
- at(ki) ? (ai(!0), setTimeout(() => ai(!1), 2e3), ei(!1)) : (J(ki), ei(!1));
10149
+ let Ji = `${u}/${ni == null ? void 0 : ni.url}`;
10150
+ at(Ji) ? (ai(!0), setTimeout(() => ai(!1), 2e3), ei(!1)) : (J(Ji), ei(!1));
10150
10151
  }, ge = o === "moloco" || o === "molocoV2", Gt = o === "google", bt = gi.find((ni) => ni.name === o);
10151
10152
  return /* @__PURE__ */ m.jsxs(m.Fragment, { children: [
10152
10153
  /* @__PURE__ */ m.jsxs(
@@ -10284,8 +10285,8 @@ const yI = ({
10284
10285
  Ni(!0);
10285
10286
  else {
10286
10287
  g("download");
10287
- const ki = I.iosUrl, Vi = I.googleUrl;
10288
- o === "cdn" && K && K.willSpendCredit && !v || o !== "cdn" && K && K.willSpendCredit ? (Z(!0), x("download"), L(!0)) : ["Playable", "Flex", "Ready"].includes(l) && (!ki || !Vi) ? (Z(!0), W(!0)) : (W(!1), L(!1), await re(o, "download"));
10288
+ const Ji = I.iosUrl, Vi = I.googleUrl;
10289
+ o === "cdn" && K && K.willSpendCredit && !v || o !== "cdn" && K && K.willSpendCredit ? (Z(!0), x("download"), L(!0)) : ["Playable", "Flex", "Ready"].includes(l) && (!Ji || !Vi) ? (Z(!0), W(!0)) : (W(!1), L(!1), await re(o, "download"));
10289
10290
  }
10290
10291
  },
10291
10292
  children: ge ? /* @__PURE__ */ m.jsxs(m.Fragment, { children: [
@@ -10341,8 +10342,8 @@ const yI = ({
10341
10342
  if (ni.stopPropagation(), Si)
10342
10343
  return;
10343
10344
  g("copyLink");
10344
- const ki = I.iosUrl, Vi = I.googleUrl;
10345
- K && (K != null && K.willSpendCredit) ? (x("copy"), Z(!0), L(!0)) : l !== "Import" && (!ki || !Vi) ? (Z(!0), W(!0)) : (L(!1), W(!1), await re(o, "copy"), Y(!0), setTimeout(() => Y(!1), 2e3));
10345
+ const Ji = I.iosUrl, Vi = I.googleUrl;
10346
+ K && (K != null && K.willSpendCredit) ? (x("copy"), Z(!0), L(!0)) : l !== "Import" && (!Ji || !Vi) ? (Z(!0), W(!0)) : (L(!1), W(!1), await re(o, "copy"), Y(!0), setTimeout(() => Y(!1), 2e3));
10346
10347
  },
10347
10348
  disabled: k,
10348
10349
  isCopied: Si,
@@ -10356,8 +10357,8 @@ const yI = ({
10356
10357
  typeOfProduct: l,
10357
10358
  onClickDonwload: async (ni) => {
10358
10359
  ni.stopPropagation(), g("copyLink");
10359
- const ki = I.iosUrl, Vi = I.googleUrl;
10360
- K && (K != null && K.willSpendCredit) ? (x("download"), Z(!0), L(!0)) : l !== "Import" && (!ki || !Vi) ? (Z(!0), W(!0)) : (L(!1), W(!1), await At(!0));
10360
+ const Ji = I.iosUrl, Vi = I.googleUrl;
10361
+ K && (K != null && K.willSpendCredit) ? (x("download"), Z(!0), L(!0)) : l !== "Import" && (!Ji || !Vi) ? (Z(!0), W(!0)) : (L(!1), W(!1), await At(!0));
10361
10362
  },
10362
10363
  disabled: k,
10363
10364
  children: [
@@ -11467,39 +11468,33 @@ const jI = ({ selectedVersionIds: e, api: i, fetchFileUrl: t }) => {
11467
11468
  try {
11468
11469
  const n = await QI(i, !1, e);
11469
11470
  o(
11470
- (l) => l.map((A, q) => {
11471
- var p;
11471
+ (l) => l.map((A) => {
11472
+ const q = n.find((p) => p._id === A.versionId);
11472
11473
  return {
11473
11474
  ...A,
11474
- versionName: ((p = n[q]) == null ? void 0 : p.name) || `Version ${A.versionId}`
11475
+ versionName: (q == null ? void 0 : q.name) || `Version ${A.versionId}`
11475
11476
  };
11476
11477
  })
11477
- ), e.forEach(async (l, A) => {
11478
+ ), e.forEach(async (l) => {
11478
11479
  try {
11479
- const q = await it(
11480
- l,
11481
- "preview",
11482
- null,
11483
- null,
11484
- !1
11480
+ const A = await it(l, "preview", null, null, !1);
11481
+ o((q) => q.map(
11482
+ (p) => p.versionId === l ? {
11483
+ ...p,
11484
+ size: A.size,
11485
+ status: A.size >= 5 ? "exceeded" : "ok"
11486
+ } : p
11487
+ ));
11488
+ } catch (A) {
11489
+ console.error(`Error checking version ${l}:`, A), o(
11490
+ (q) => q.map(
11491
+ (p) => p.versionId === l ? {
11492
+ ...p,
11493
+ status: "ok"
11494
+ // Default to ok if there's an fetch error
11495
+ } : p
11496
+ )
11485
11497
  );
11486
- o((p) => {
11487
- const u = [...p];
11488
- return u[A] = {
11489
- ...u[A],
11490
- size: q.size,
11491
- status: q.size >= 5 ? "exceeded" : "ok"
11492
- }, u;
11493
- });
11494
- } catch (q) {
11495
- console.error(`Error checking version ${l}:`, q), o((p) => {
11496
- const u = [...p];
11497
- return u[A] = {
11498
- ...u[A],
11499
- status: "ok"
11500
- // Default to ok if there's an error
11501
- }, u;
11502
- });
11503
11498
  }
11504
11499
  });
11505
11500
  } catch (n) {