@rhinestone/deposit-modal 0.14.0 → 0.14.1
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/README.md +6 -12
- package/dist/{ClaimModal-SEKNWRMA.mjs → ClaimModal-GDFENSLV.mjs} +5 -5
- package/dist/ClaimModal-L3FUBI5U.cjs +13 -0
- package/dist/{DepositModalReown-Q2JMLT47.mjs → DepositModalReown-2EVV64OA.mjs} +29 -27
- package/dist/{DepositModalReown-46LPVFB6.cjs → DepositModalReown-GAD45GIC.cjs} +76 -74
- package/dist/WithdrawModal-FAQH35NG.cjs +12 -0
- package/dist/{WithdrawModal-5ICGD4HJ.mjs → WithdrawModal-IKUHF5CF.mjs} +4 -4
- package/dist/{chunk-7ICSHJFE.cjs → chunk-4J5ADVIN.cjs} +71 -67
- package/dist/{chunk-KTUVSKR4.mjs → chunk-5Q5CSVKF.mjs} +74 -32
- package/dist/{chunk-LZFRL2AL.cjs → chunk-62UCV2LG.cjs} +3 -3
- package/dist/{chunk-X2IPAPXU.cjs → chunk-7AZFT2MV.cjs} +8 -8
- package/dist/{chunk-MTFJSE52.cjs → chunk-A6JPBMYY.cjs} +65 -65
- package/dist/{chunk-6KG642KH.cjs → chunk-AQVJUXSG.cjs} +1 -1
- package/dist/{chunk-PKML3XVS.mjs → chunk-GZ4GQ5MC.mjs} +2 -2
- package/dist/{chunk-V2OBGLJD.cjs → chunk-HAQOFI3D.cjs} +90 -60
- package/dist/{chunk-K4H6TGBE.mjs → chunk-LMG46EP2.mjs} +1 -1
- package/dist/{chunk-YCQZJQO6.cjs → chunk-NQMC5VKQ.cjs} +343 -301
- package/dist/{chunk-CFKC77SV.mjs → chunk-QACOOLOE.mjs} +3 -3
- package/dist/{chunk-WUJIKCFU.mjs → chunk-R5UQ3TN4.mjs} +1 -1
- package/dist/{chunk-IN77XSWO.mjs → chunk-UX35GYLM.mjs} +59 -29
- package/dist/{chunk-ZEO6ADM3.mjs → chunk-VALXN5IO.mjs} +2 -2
- package/dist/{chunk-7SR7ENVJ.mjs → chunk-XCTRKCNM.mjs} +6 -2
- package/dist/{chunk-YWMWI7PZ.cjs → chunk-YP7QVKQ6.cjs} +53 -53
- package/dist/claim.cjs +6 -6
- package/dist/claim.mjs +5 -5
- package/dist/constants.cjs +2 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +6 -6
- package/dist/deposit.mjs +5 -5
- package/dist/embed.cjs +18 -18
- package/dist/embed.mjs +8 -8
- package/dist/index.cjs +9 -9
- package/dist/index.mjs +8 -8
- package/dist/withdraw.cjs +5 -5
- package/dist/withdraw.mjs +4 -4
- package/package.json +7 -6
- package/dist/ClaimModal-IKTJU43Y.cjs +0 -13
- package/dist/WithdrawModal-VP6PMIRO.cjs +0 -12
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkAQVJUXSGcjs = require('./chunk-AQVJUXSG.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -892,7 +892,7 @@ function createDepositService(baseUrl, options) {
|
|
|
892
892
|
try {
|
|
893
893
|
const response = await fetch(apiUrl("/qr/tokens"), {
|
|
894
894
|
method: "GET",
|
|
895
|
-
headers:
|
|
895
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, )
|
|
896
896
|
});
|
|
897
897
|
if (!response.ok) {
|
|
898
898
|
debugLog(debug, scope, "getTopTokens:unavailable", {
|
|
@@ -919,7 +919,7 @@ function createDepositService(baseUrl, options) {
|
|
|
919
919
|
try {
|
|
920
920
|
const response = await fetch(apiUrl("/chains"), {
|
|
921
921
|
method: "GET",
|
|
922
|
-
headers:
|
|
922
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, )
|
|
923
923
|
});
|
|
924
924
|
if (!response.ok) {
|
|
925
925
|
debugLog(debug, scope, "getChains:unavailable", {
|
|
@@ -973,7 +973,7 @@ function createDepositService(baseUrl, options) {
|
|
|
973
973
|
});
|
|
974
974
|
const response = await fetch(url, {
|
|
975
975
|
method: "POST",
|
|
976
|
-
headers:
|
|
976
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ),
|
|
977
977
|
body: JSON.stringify({ account: params })
|
|
978
978
|
});
|
|
979
979
|
if (!response.ok) {
|
|
@@ -1005,7 +1005,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1005
1005
|
debugLog(debug, scope, "fetchPortfolio:request", { url, address });
|
|
1006
1006
|
const response = await fetch(url, {
|
|
1007
1007
|
method: "GET",
|
|
1008
|
-
headers:
|
|
1008
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, )
|
|
1009
1009
|
});
|
|
1010
1010
|
if (!response.ok) {
|
|
1011
1011
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1056,7 +1056,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1056
1056
|
});
|
|
1057
1057
|
const response = await fetch(url, {
|
|
1058
1058
|
method: "GET",
|
|
1059
|
-
headers:
|
|
1059
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, )
|
|
1060
1060
|
});
|
|
1061
1061
|
if (!response.ok) {
|
|
1062
1062
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1085,7 +1085,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1085
1085
|
debugLog(debug, scope, "checkAccount:request", { url, address });
|
|
1086
1086
|
const response = await fetch(url, {
|
|
1087
1087
|
method: "GET",
|
|
1088
|
-
headers:
|
|
1088
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, )
|
|
1089
1089
|
});
|
|
1090
1090
|
if (!response.ok) {
|
|
1091
1091
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1121,7 +1121,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1121
1121
|
);
|
|
1122
1122
|
const response = await fetch(url, {
|
|
1123
1123
|
method: "GET",
|
|
1124
|
-
headers:
|
|
1124
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ),
|
|
1125
1125
|
cache: "no-store"
|
|
1126
1126
|
});
|
|
1127
1127
|
if (!response.ok) {
|
|
@@ -1149,7 +1149,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1149
1149
|
);
|
|
1150
1150
|
const response = await fetch(url, {
|
|
1151
1151
|
method: "GET",
|
|
1152
|
-
headers:
|
|
1152
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ),
|
|
1153
1153
|
cache: "no-store"
|
|
1154
1154
|
});
|
|
1155
1155
|
if (!response.ok) {
|
|
@@ -1173,7 +1173,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1173
1173
|
);
|
|
1174
1174
|
const response = await fetch(url, {
|
|
1175
1175
|
method: "GET",
|
|
1176
|
-
headers:
|
|
1176
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ),
|
|
1177
1177
|
cache: "no-store"
|
|
1178
1178
|
});
|
|
1179
1179
|
if (!response.ok) {
|
|
@@ -1195,7 +1195,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1195
1195
|
async getPositions(address) {
|
|
1196
1196
|
const url = apiUrl(`/positions/${address}`);
|
|
1197
1197
|
debugLog(debug, scope, "getPositions:request", { url, address });
|
|
1198
|
-
const response = await fetch(url, { headers:
|
|
1198
|
+
const response = await fetch(url, { headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ) });
|
|
1199
1199
|
if (!response.ok) {
|
|
1200
1200
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
1201
1201
|
debugError(debug, scope, "getPositions:failed", error, {
|
|
@@ -1229,7 +1229,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1229
1229
|
});
|
|
1230
1230
|
const response = await fetch(url, {
|
|
1231
1231
|
method: "POST",
|
|
1232
|
-
headers:
|
|
1232
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ),
|
|
1233
1233
|
body: JSON.stringify({ account, market, chainId, asset, amount })
|
|
1234
1234
|
});
|
|
1235
1235
|
if (!response.ok) {
|
|
@@ -1265,7 +1265,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1265
1265
|
});
|
|
1266
1266
|
const response = await fetch(url, {
|
|
1267
1267
|
method: "POST",
|
|
1268
|
-
headers:
|
|
1268
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ),
|
|
1269
1269
|
body: JSON.stringify({
|
|
1270
1270
|
depositWallet,
|
|
1271
1271
|
owner,
|
|
@@ -1307,7 +1307,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1307
1307
|
});
|
|
1308
1308
|
const response = await fetch(url, {
|
|
1309
1309
|
method: "GET",
|
|
1310
|
-
headers:
|
|
1310
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ),
|
|
1311
1311
|
cache: "no-store"
|
|
1312
1312
|
});
|
|
1313
1313
|
if (!response.ok) {
|
|
@@ -1357,7 +1357,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1357
1357
|
});
|
|
1358
1358
|
const response = await fetch(url, {
|
|
1359
1359
|
method: "GET",
|
|
1360
|
-
headers:
|
|
1360
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ),
|
|
1361
1361
|
cache: "no-store"
|
|
1362
1362
|
});
|
|
1363
1363
|
if (!response.ok) {
|
|
@@ -1405,7 +1405,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1405
1405
|
try {
|
|
1406
1406
|
const response = await fetch(url, {
|
|
1407
1407
|
method: "POST",
|
|
1408
|
-
headers:
|
|
1408
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ),
|
|
1409
1409
|
body: JSON.stringify(body),
|
|
1410
1410
|
cache: "no-store"
|
|
1411
1411
|
});
|
|
@@ -1445,7 +1445,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1445
1445
|
try {
|
|
1446
1446
|
const response = await fetch(url, {
|
|
1447
1447
|
method: "POST",
|
|
1448
|
-
headers:
|
|
1448
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ),
|
|
1449
1449
|
body: JSON.stringify({ ...params, kind: "auto" }),
|
|
1450
1450
|
cache: "no-store"
|
|
1451
1451
|
});
|
|
@@ -1539,7 +1539,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1539
1539
|
try {
|
|
1540
1540
|
response = await fetch(url, {
|
|
1541
1541
|
method: "POST",
|
|
1542
|
-
headers:
|
|
1542
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ),
|
|
1543
1543
|
body: JSON.stringify(params)
|
|
1544
1544
|
});
|
|
1545
1545
|
} catch (error) {
|
|
@@ -1590,7 +1590,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1590
1590
|
try {
|
|
1591
1591
|
const response = await fetch(url, {
|
|
1592
1592
|
method: "GET",
|
|
1593
|
-
headers:
|
|
1593
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ),
|
|
1594
1594
|
cache: "no-store"
|
|
1595
1595
|
});
|
|
1596
1596
|
if (!response.ok) {
|
|
@@ -1622,7 +1622,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1622
1622
|
try {
|
|
1623
1623
|
const response = await fetch(url, {
|
|
1624
1624
|
method: "GET",
|
|
1625
|
-
headers:
|
|
1625
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ),
|
|
1626
1626
|
cache: "no-store"
|
|
1627
1627
|
});
|
|
1628
1628
|
if (!response.ok) {
|
|
@@ -1647,7 +1647,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1647
1647
|
});
|
|
1648
1648
|
const response = await fetch(url, {
|
|
1649
1649
|
method: "POST",
|
|
1650
|
-
headers:
|
|
1650
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ),
|
|
1651
1651
|
body: JSON.stringify(params)
|
|
1652
1652
|
});
|
|
1653
1653
|
if (!response.ok) {
|
|
@@ -1679,7 +1679,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1679
1679
|
});
|
|
1680
1680
|
const response = await fetch(url, {
|
|
1681
1681
|
method: "POST",
|
|
1682
|
-
headers:
|
|
1682
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ),
|
|
1683
1683
|
body: JSON.stringify(params)
|
|
1684
1684
|
});
|
|
1685
1685
|
if (!response.ok) {
|
|
@@ -1716,7 +1716,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1716
1716
|
debugLog(debug, scope, "getSwappedConnectExchanges:request");
|
|
1717
1717
|
const response = await fetch(url, {
|
|
1718
1718
|
method: "GET",
|
|
1719
|
-
headers:
|
|
1719
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ),
|
|
1720
1720
|
cache: "no-store"
|
|
1721
1721
|
});
|
|
1722
1722
|
if (!response.ok) {
|
|
@@ -1769,7 +1769,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1769
1769
|
try {
|
|
1770
1770
|
const response = await fetch(url, {
|
|
1771
1771
|
method: "GET",
|
|
1772
|
-
headers:
|
|
1772
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ),
|
|
1773
1773
|
cache: "no-store"
|
|
1774
1774
|
});
|
|
1775
1775
|
if (!response.ok) {
|
|
@@ -1855,7 +1855,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1855
1855
|
try {
|
|
1856
1856
|
const response = await fetch(url, {
|
|
1857
1857
|
method: "GET",
|
|
1858
|
-
headers:
|
|
1858
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ),
|
|
1859
1859
|
cache: "no-store"
|
|
1860
1860
|
});
|
|
1861
1861
|
if (!response.ok) {
|
|
@@ -1882,7 +1882,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1882
1882
|
);
|
|
1883
1883
|
const response = await fetch(url, {
|
|
1884
1884
|
method: "GET",
|
|
1885
|
-
headers:
|
|
1885
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ),
|
|
1886
1886
|
cache: "no-store"
|
|
1887
1887
|
});
|
|
1888
1888
|
if (!response.ok) return null;
|
|
@@ -2894,8 +2894,12 @@ var FLUSH_DELAY_MS = 5e3;
|
|
|
2894
2894
|
var MAX_BODY_BYTES = 48 * 1024;
|
|
2895
2895
|
var TOKEN_REFRESH_MARGIN_MS = 6e4;
|
|
2896
2896
|
var TOKEN_TIMEOUT_MS = 3e3;
|
|
2897
|
+
var CLOSE_MINT_WAIT_MS = 1500;
|
|
2897
2898
|
var MAX_ATTEMPTS = 3;
|
|
2898
2899
|
var MAX_BACKOFF_MS = 3e4;
|
|
2900
|
+
var IDLE = 0;
|
|
2901
|
+
var CLOSING = 1;
|
|
2902
|
+
var DISMISSAL = 2;
|
|
2899
2903
|
var ENVELOPE_FIELDS = /* @__PURE__ */ new Set([
|
|
2900
2904
|
"type",
|
|
2901
2905
|
"timestamp",
|
|
@@ -2930,8 +2934,9 @@ function createIngestTransport(options) {
|
|
|
2930
2934
|
let timer = null;
|
|
2931
2935
|
let sending = false;
|
|
2932
2936
|
let disposed = false;
|
|
2933
|
-
let
|
|
2934
|
-
let
|
|
2937
|
+
let pendingRun = false;
|
|
2938
|
+
let urgency = IDLE;
|
|
2939
|
+
let minting = null;
|
|
2935
2940
|
let mintAbort = null;
|
|
2936
2941
|
const sleepers = /* @__PURE__ */ new Set();
|
|
2937
2942
|
function report(reason, status) {
|
|
@@ -3009,11 +3014,11 @@ function createIngestTransport(options) {
|
|
|
3009
3014
|
try {
|
|
3010
3015
|
response = await fetchImpl(mintUrl, {
|
|
3011
3016
|
method: "POST",
|
|
3012
|
-
headers:
|
|
3017
|
+
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ),
|
|
3013
3018
|
signal: _optionalChain([controller, 'optionalAccess', _114 => _114.signal])
|
|
3014
3019
|
});
|
|
3015
3020
|
} catch (e7) {
|
|
3016
|
-
if (
|
|
3021
|
+
if (urgency !== DISMISSAL) {
|
|
3017
3022
|
mintFailures += 1;
|
|
3018
3023
|
mintBackoffUntil = now() + backoff(mintFailures);
|
|
3019
3024
|
}
|
|
@@ -3045,19 +3050,28 @@ function createIngestTransport(options) {
|
|
|
3045
3050
|
report("token_unavailable", response.status);
|
|
3046
3051
|
}
|
|
3047
3052
|
}
|
|
3048
|
-
|
|
3053
|
+
function startMint() {
|
|
3054
|
+
if (!minting) {
|
|
3055
|
+
minting = mintToken().finally(() => {
|
|
3056
|
+
minting = null;
|
|
3057
|
+
});
|
|
3058
|
+
}
|
|
3059
|
+
return minting;
|
|
3060
|
+
}
|
|
3061
|
+
async function ensureToken(maxWaitMs) {
|
|
3049
3062
|
if (mintUnavailable) return;
|
|
3050
3063
|
if (token && token.expiresAt - now() > TOKEN_REFRESH_MARGIN_MS) return;
|
|
3051
3064
|
if (now() < mintBackoffUntil) return;
|
|
3052
|
-
|
|
3065
|
+
const pending = startMint();
|
|
3066
|
+
await (maxWaitMs === void 0 ? pending : Promise.race([pending, sleep(maxWaitMs)]));
|
|
3053
3067
|
}
|
|
3054
|
-
async function deliver(batch
|
|
3068
|
+
async function deliver(batch) {
|
|
3055
3069
|
if (!fetchImpl) return drop(batch, "unsupported");
|
|
3056
3070
|
let attempt = 0;
|
|
3057
3071
|
let refreshed = false;
|
|
3058
3072
|
let unattributed = false;
|
|
3059
3073
|
for (; ; ) {
|
|
3060
|
-
const terminal =
|
|
3074
|
+
const terminal = urgency === DISMISSAL;
|
|
3061
3075
|
attempt += 1;
|
|
3062
3076
|
const headers = {
|
|
3063
3077
|
"Content-Type": "application/json"
|
|
@@ -3084,7 +3098,7 @@ function createIngestTransport(options) {
|
|
|
3084
3098
|
token = null;
|
|
3085
3099
|
if (!refreshed && !terminal) {
|
|
3086
3100
|
refreshed = true;
|
|
3087
|
-
await
|
|
3101
|
+
await startMint();
|
|
3088
3102
|
if (token) continue;
|
|
3089
3103
|
}
|
|
3090
3104
|
if (!unattributed) {
|
|
@@ -3104,33 +3118,47 @@ function createIngestTransport(options) {
|
|
|
3104
3118
|
return drop(batch, "rejected", status);
|
|
3105
3119
|
}
|
|
3106
3120
|
}
|
|
3107
|
-
|
|
3108
|
-
if (
|
|
3121
|
+
function escalate(level) {
|
|
3122
|
+
if (level <= urgency) return;
|
|
3123
|
+
urgency = level;
|
|
3124
|
+
if (level === DISMISSAL) interruptForUnload();
|
|
3125
|
+
}
|
|
3126
|
+
function onDismissal(event) {
|
|
3127
|
+
if (event.type === "pagehide" || document.visibilityState === "hidden") {
|
|
3128
|
+
escalate(DISMISSAL);
|
|
3129
|
+
}
|
|
3130
|
+
}
|
|
3131
|
+
function dismissalGuard(attach) {
|
|
3132
|
+
if (typeof window === "undefined" || typeof document === "undefined") return;
|
|
3133
|
+
const bind = attach ? "addEventListener" : "removeEventListener";
|
|
3134
|
+
window[bind]("pagehide", onDismissal);
|
|
3135
|
+
document[bind]("visibilitychange", onDismissal);
|
|
3136
|
+
}
|
|
3137
|
+
async function run(level) {
|
|
3138
|
+
escalate(level);
|
|
3109
3139
|
if (sending) {
|
|
3110
|
-
|
|
3111
|
-
pendingTerminal = true;
|
|
3112
|
-
interruptForUnload();
|
|
3113
|
-
}
|
|
3140
|
+
pendingRun = true;
|
|
3114
3141
|
return;
|
|
3115
3142
|
}
|
|
3116
3143
|
sending = true;
|
|
3117
3144
|
try {
|
|
3118
3145
|
while (queue.length > 0) {
|
|
3119
|
-
const terminal = requestedTerminal || terminalRequested;
|
|
3120
3146
|
const batch = takeBatch();
|
|
3121
|
-
if (
|
|
3122
|
-
|
|
3123
|
-
|
|
3147
|
+
if (urgency !== DISMISSAL) {
|
|
3148
|
+
await ensureToken(urgency === CLOSING ? CLOSE_MINT_WAIT_MS : void 0);
|
|
3149
|
+
}
|
|
3150
|
+
await deliver(batch);
|
|
3124
3151
|
}
|
|
3125
3152
|
} finally {
|
|
3126
3153
|
sending = false;
|
|
3127
3154
|
}
|
|
3128
|
-
if (
|
|
3129
|
-
|
|
3130
|
-
await run(
|
|
3155
|
+
if (pendingRun) {
|
|
3156
|
+
pendingRun = false;
|
|
3157
|
+
await run(urgency);
|
|
3131
3158
|
return;
|
|
3132
3159
|
}
|
|
3133
|
-
if (!disposed
|
|
3160
|
+
if (!disposed) urgency = IDLE;
|
|
3161
|
+
else dismissalGuard(false);
|
|
3134
3162
|
}
|
|
3135
3163
|
function clearFlushTimer() {
|
|
3136
3164
|
if (timer !== null) {
|
|
@@ -3142,35 +3170,37 @@ function createIngestTransport(options) {
|
|
|
3142
3170
|
if (timer !== null || disposed) return;
|
|
3143
3171
|
timer = setTimeout(() => {
|
|
3144
3172
|
timer = null;
|
|
3145
|
-
void run(
|
|
3173
|
+
void run(IDLE);
|
|
3146
3174
|
}, FLUSH_DELAY_MS);
|
|
3147
3175
|
}
|
|
3148
3176
|
return {
|
|
3149
3177
|
enqueue(event) {
|
|
3150
3178
|
if (disposed) return;
|
|
3151
3179
|
queue.push(toWireEvent(event));
|
|
3180
|
+
if (sequence === 1) void ensureToken();
|
|
3152
3181
|
if (queue.length > MAX_QUEUE) {
|
|
3153
3182
|
dropped += queue.length - MAX_QUEUE;
|
|
3154
3183
|
queue.splice(0, queue.length - MAX_QUEUE);
|
|
3155
3184
|
}
|
|
3156
3185
|
if (queue.length >= MAX_BATCH) {
|
|
3157
3186
|
clearFlushTimer();
|
|
3158
|
-
void run(
|
|
3187
|
+
void run(IDLE);
|
|
3159
3188
|
} else {
|
|
3160
3189
|
scheduleFlush();
|
|
3161
3190
|
}
|
|
3162
3191
|
},
|
|
3163
3192
|
flush(flushOptions) {
|
|
3164
|
-
const
|
|
3165
|
-
if (disposed && !
|
|
3193
|
+
const dismissal = _nullishCoalesce(_optionalChain([flushOptions, 'optionalAccess', _115 => _115.terminal]), () => ( false));
|
|
3194
|
+
if (disposed && !dismissal) return;
|
|
3166
3195
|
clearFlushTimer();
|
|
3167
|
-
void run(
|
|
3196
|
+
void run(dismissal ? DISMISSAL : IDLE);
|
|
3168
3197
|
},
|
|
3169
3198
|
dispose() {
|
|
3170
3199
|
if (disposed) return;
|
|
3171
3200
|
disposed = true;
|
|
3172
3201
|
clearFlushTimer();
|
|
3173
|
-
|
|
3202
|
+
dismissalGuard(true);
|
|
3203
|
+
void run(CLOSING);
|
|
3174
3204
|
}
|
|
3175
3205
|
};
|
|
3176
3206
|
}
|
|
@@ -3244,7 +3274,7 @@ function AnalyticsSession(props) {
|
|
|
3244
3274
|
type: "analytics_ingest_failure",
|
|
3245
3275
|
session_id: sessionIdRef.current,
|
|
3246
3276
|
modal,
|
|
3247
|
-
widget_version:
|
|
3277
|
+
widget_version: _chunkAQVJUXSGcjs.MODAL_VERSION,
|
|
3248
3278
|
timestamp: nowRef.current().toISOString(),
|
|
3249
3279
|
reason,
|
|
3250
3280
|
...status === void 0 ? {} : { status },
|
|
@@ -3272,7 +3302,7 @@ function AnalyticsSession(props) {
|
|
|
3272
3302
|
proxyOrigin,
|
|
3273
3303
|
sessionId: sessionIdRef.current,
|
|
3274
3304
|
modal,
|
|
3275
|
-
widgetVersion:
|
|
3305
|
+
widgetVersion: _chunkAQVJUXSGcjs.MODAL_VERSION,
|
|
3276
3306
|
sessionProperties: sessionPropertiesRef.current,
|
|
3277
3307
|
onFailure: (failure) => emitFailure(failure),
|
|
3278
3308
|
fetchImpl: props.fetchImpl,
|
|
@@ -3328,7 +3358,7 @@ function AnalyticsSession(props) {
|
|
|
3328
3358
|
...payload,
|
|
3329
3359
|
session_id: sessionIdRef.current,
|
|
3330
3360
|
modal,
|
|
3331
|
-
widget_version:
|
|
3361
|
+
widget_version: _chunkAQVJUXSGcjs.MODAL_VERSION,
|
|
3332
3362
|
timestamp: nowRef.current().toISOString(),
|
|
3333
3363
|
session_properties: sessionPropertiesRef.current,
|
|
3334
3364
|
funding_method: fundingMethod
|
|
@@ -3347,7 +3377,7 @@ function AnalyticsSession(props) {
|
|
|
3347
3377
|
...payload,
|
|
3348
3378
|
session_id: sessionIdRef.current,
|
|
3349
3379
|
modal,
|
|
3350
|
-
widget_version:
|
|
3380
|
+
widget_version: _chunkAQVJUXSGcjs.MODAL_VERSION,
|
|
3351
3381
|
timestamp: nowRef.current().toISOString(),
|
|
3352
3382
|
session_properties: sessionPropertiesRef.current
|
|
3353
3383
|
};
|
|
@@ -3363,7 +3393,7 @@ function AnalyticsSession(props) {
|
|
|
3363
3393
|
...payload,
|
|
3364
3394
|
session_id: sessionIdRef.current,
|
|
3365
3395
|
modal,
|
|
3366
|
-
widget_version:
|
|
3396
|
+
widget_version: _chunkAQVJUXSGcjs.MODAL_VERSION,
|
|
3367
3397
|
timestamp: nowRef.current().toISOString(),
|
|
3368
3398
|
session_properties: sessionPropertiesRef.current
|
|
3369
3399
|
};
|