@worldcoin/idkit 2.2.0 → 2.2.2
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/build/config-BRFx4nLT.d.cts +45 -0
- package/build/index.cjs +2371 -0
- package/build/index.d.cts +56 -0
- package/build/index.js +165 -150
- package/build/internal.cjs +269 -0
- package/build/internal.d.cts +53 -0
- package/package.json +17 -6
package/build/index.js
CHANGED
|
@@ -25,9 +25,6 @@ var useIDKit_default = useIDKit;
|
|
|
25
25
|
// src/components/IDKitWidget/index.tsx
|
|
26
26
|
import { memo } from "react";
|
|
27
27
|
|
|
28
|
-
// src/components/IDKitWidget/BaseWidget.tsx
|
|
29
|
-
import root from "react-shadow";
|
|
30
|
-
|
|
31
28
|
// src/hooks/useMedia.ts
|
|
32
29
|
import { useEffect as useEffect2, useState } from "react";
|
|
33
30
|
var useMedia = () => {
|
|
@@ -1187,12 +1184,30 @@ import { jsx } from "react/jsx-runtime";
|
|
|
1187
1184
|
var Styles = () => /* @__PURE__ */ jsx("style", { children: styles_default });
|
|
1188
1185
|
var Styles_default = Styles;
|
|
1189
1186
|
|
|
1187
|
+
// src/components/IDKitWidget/ShadowHost.tsx
|
|
1188
|
+
import ReactDOM from "react-dom";
|
|
1189
|
+
import { useState as useState2, useCallback } from "react";
|
|
1190
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
1191
|
+
var ShadowHost = ({ id, children, mode = "open", delegatesFocus = false }) => {
|
|
1192
|
+
const [shadowRoot, setShadowRoot] = useState2(null);
|
|
1193
|
+
const hostRef = useCallback(
|
|
1194
|
+
(node) => {
|
|
1195
|
+
if (node) {
|
|
1196
|
+
const root = node.shadowRoot ?? node.attachShadow({ mode, delegatesFocus });
|
|
1197
|
+
setShadowRoot(root);
|
|
1198
|
+
}
|
|
1199
|
+
},
|
|
1200
|
+
[mode, delegatesFocus]
|
|
1201
|
+
);
|
|
1202
|
+
return /* @__PURE__ */ jsx2("div", { ref: hostRef, id, children: shadowRoot && ReactDOM.createPortal(children, shadowRoot) });
|
|
1203
|
+
};
|
|
1204
|
+
|
|
1190
1205
|
// src/components/IDKitWidget/BaseWidget.tsx
|
|
1191
1206
|
import { shallow as shallow2 } from "zustand/shallow";
|
|
1192
1207
|
|
|
1193
1208
|
// src/components/Icons/XMarkIcon.tsx
|
|
1194
|
-
import { jsx as
|
|
1195
|
-
var XMarkIcon = (props) => /* @__PURE__ */
|
|
1209
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
1210
|
+
var XMarkIcon = (props) => /* @__PURE__ */ jsx3("svg", { ...props, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx3(
|
|
1196
1211
|
"path",
|
|
1197
1212
|
{
|
|
1198
1213
|
strokeWidth: "1.5",
|
|
@@ -1221,14 +1236,14 @@ function clsx() {
|
|
|
1221
1236
|
var clsx_default = clsx;
|
|
1222
1237
|
|
|
1223
1238
|
// src/components/Icons/ErrorIcon.tsx
|
|
1224
|
-
import { jsx as
|
|
1239
|
+
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
1225
1240
|
var ErrorIcon = (props) => /* @__PURE__ */ jsxs("svg", { ...props, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 100 100", children: [
|
|
1226
|
-
/* @__PURE__ */
|
|
1241
|
+
/* @__PURE__ */ jsx4("circle", { cx: "50", cy: "50", r: "49.375", fill: "url(#a)", fillOpacity: ".65", stroke: "url(#b)", strokeWidth: "1.25" }),
|
|
1227
1242
|
/* @__PURE__ */ jsxs("g", { filter: "url(#c)", children: [
|
|
1228
|
-
/* @__PURE__ */
|
|
1229
|
-
/* @__PURE__ */
|
|
1243
|
+
/* @__PURE__ */ jsx4("circle", { cx: "50", cy: "50", r: "35", fill: "#fff" }),
|
|
1244
|
+
/* @__PURE__ */ jsx4("circle", { cx: "50", cy: "50", r: "34.432", stroke: "#FFC9AD", strokeWidth: "1.136" })
|
|
1230
1245
|
] }),
|
|
1231
|
-
/* @__PURE__ */
|
|
1246
|
+
/* @__PURE__ */ jsx4(
|
|
1232
1247
|
"path",
|
|
1233
1248
|
{
|
|
1234
1249
|
stroke: "#FF4732",
|
|
@@ -1240,12 +1255,12 @@ var ErrorIcon = (props) => /* @__PURE__ */ jsxs("svg", { ...props, xmlns: "http:
|
|
|
1240
1255
|
),
|
|
1241
1256
|
/* @__PURE__ */ jsxs("defs", { children: [
|
|
1242
1257
|
/* @__PURE__ */ jsxs("linearGradient", { id: "a", x1: "50", x2: "50", y1: "0", y2: "100", gradientUnits: "userSpaceOnUse", children: [
|
|
1243
|
-
/* @__PURE__ */
|
|
1244
|
-
/* @__PURE__ */
|
|
1258
|
+
/* @__PURE__ */ jsx4("stop", { stopColor: "#FFA483" }),
|
|
1259
|
+
/* @__PURE__ */ jsx4("stop", { offset: "1", stopColor: "#FFA483", stopOpacity: "0" })
|
|
1245
1260
|
] }),
|
|
1246
1261
|
/* @__PURE__ */ jsxs("linearGradient", { id: "b", x1: "50", x2: "50", y1: "0", y2: "100", gradientUnits: "userSpaceOnUse", children: [
|
|
1247
|
-
/* @__PURE__ */
|
|
1248
|
-
/* @__PURE__ */
|
|
1262
|
+
/* @__PURE__ */ jsx4("stop", { stopColor: "#FFA483" }),
|
|
1263
|
+
/* @__PURE__ */ jsx4("stop", { offset: ".713", stopColor: "#FFA483", stopOpacity: "0" })
|
|
1249
1264
|
] }),
|
|
1250
1265
|
/* @__PURE__ */ jsxs(
|
|
1251
1266
|
"filter",
|
|
@@ -1258,13 +1273,13 @@ var ErrorIcon = (props) => /* @__PURE__ */ jsxs("svg", { ...props, xmlns: "http:
|
|
|
1258
1273
|
colorInterpolationFilters: "sRGB",
|
|
1259
1274
|
filterUnits: "userSpaceOnUse",
|
|
1260
1275
|
children: [
|
|
1261
|
-
/* @__PURE__ */
|
|
1262
|
-
/* @__PURE__ */
|
|
1263
|
-
/* @__PURE__ */
|
|
1264
|
-
/* @__PURE__ */
|
|
1265
|
-
/* @__PURE__ */
|
|
1266
|
-
/* @__PURE__ */
|
|
1267
|
-
/* @__PURE__ */
|
|
1276
|
+
/* @__PURE__ */ jsx4("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
1277
|
+
/* @__PURE__ */ jsx4("feColorMatrix", { in: "SourceAlpha", result: "hardAlpha", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }),
|
|
1278
|
+
/* @__PURE__ */ jsx4("feOffset", { dy: "1.875" }),
|
|
1279
|
+
/* @__PURE__ */ jsx4("feGaussianBlur", { stdDeviation: "1.875" }),
|
|
1280
|
+
/* @__PURE__ */ jsx4("feColorMatrix", { values: "0 0 0 0 1 0 0 0 0 0.788235 0 0 0 0 0.678431 0 0 0 0.45 0" }),
|
|
1281
|
+
/* @__PURE__ */ jsx4("feBlend", { in2: "BackgroundImageFix", result: "effect1_dropShadow_39_740" }),
|
|
1282
|
+
/* @__PURE__ */ jsx4("feBlend", { in: "SourceGraphic", in2: "effect1_dropShadow_39_740", result: "shape" })
|
|
1268
1283
|
]
|
|
1269
1284
|
}
|
|
1270
1285
|
)
|
|
@@ -1276,8 +1291,8 @@ var ErrorIcon_default = ErrorIcon;
|
|
|
1276
1291
|
import { AppErrorCodes } from "@worldcoin/idkit-core";
|
|
1277
1292
|
|
|
1278
1293
|
// src/components/Icons/ReloadIcon.tsx
|
|
1279
|
-
import { jsx as
|
|
1280
|
-
var ReloadIcon = (props) => /* @__PURE__ */
|
|
1294
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1295
|
+
var ReloadIcon = (props) => /* @__PURE__ */ jsx5("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ jsx5(
|
|
1281
1296
|
"path",
|
|
1282
1297
|
{
|
|
1283
1298
|
d: "M12.3809 1.6665L13.3626 4.24214C12.3754 3.66434 11.2263 3.33317 9.99992 3.33317C6.31802 3.33317 3.33325 6.31794 3.33325 9.99984C3.33325 11.2141 3.6579 12.3526 4.22513 13.3332M7.61897 18.3332L6.63719 15.7575C7.62438 16.3353 8.77348 16.6665 9.99992 16.6665C13.6818 16.6665 16.6666 13.6817 16.6666 9.99984C16.6666 8.78555 16.3419 7.64708 15.7747 6.6665",
|
|
@@ -1290,9 +1305,9 @@ var ReloadIcon = (props) => /* @__PURE__ */ jsx4("svg", { width: "20", height: "
|
|
|
1290
1305
|
var ReloadIcon_default = ReloadIcon;
|
|
1291
1306
|
|
|
1292
1307
|
// src/components/Icons/WarningIcon.tsx
|
|
1293
|
-
import { jsx as
|
|
1308
|
+
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1294
1309
|
var WarningIcon = (props) => /* @__PURE__ */ jsxs2("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 100 100", ...props, children: [
|
|
1295
|
-
/* @__PURE__ */
|
|
1310
|
+
/* @__PURE__ */ jsx6(
|
|
1296
1311
|
"circle",
|
|
1297
1312
|
{
|
|
1298
1313
|
cx: "50",
|
|
@@ -1305,10 +1320,10 @@ var WarningIcon = (props) => /* @__PURE__ */ jsxs2("svg", { xmlns: "http://www.w
|
|
|
1305
1320
|
}
|
|
1306
1321
|
),
|
|
1307
1322
|
/* @__PURE__ */ jsxs2("g", { filter: "url(#warning-c)", children: [
|
|
1308
|
-
/* @__PURE__ */
|
|
1309
|
-
/* @__PURE__ */
|
|
1323
|
+
/* @__PURE__ */ jsx6("circle", { cx: "50", cy: "50", r: "35", fill: "#fff" }),
|
|
1324
|
+
/* @__PURE__ */ jsx6("circle", { cx: "50", cy: "50", r: "34.432", stroke: "#FFE999", strokeWidth: "1.136" })
|
|
1310
1325
|
] }),
|
|
1311
|
-
/* @__PURE__ */
|
|
1326
|
+
/* @__PURE__ */ jsx6(
|
|
1312
1327
|
"path",
|
|
1313
1328
|
{
|
|
1314
1329
|
fill: "#FFB200",
|
|
@@ -1319,12 +1334,12 @@ var WarningIcon = (props) => /* @__PURE__ */ jsxs2("svg", { xmlns: "http://www.w
|
|
|
1319
1334
|
),
|
|
1320
1335
|
/* @__PURE__ */ jsxs2("defs", { children: [
|
|
1321
1336
|
/* @__PURE__ */ jsxs2("linearGradient", { id: "warning-a", x1: "50", x2: "50", y1: "0", y2: "100", gradientUnits: "userSpaceOnUse", children: [
|
|
1322
|
-
/* @__PURE__ */
|
|
1323
|
-
/* @__PURE__ */
|
|
1337
|
+
/* @__PURE__ */ jsx6("stop", { stopColor: "#FFDA66" }),
|
|
1338
|
+
/* @__PURE__ */ jsx6("stop", { offset: "1", stopColor: "#FFDA66", stopOpacity: "0" })
|
|
1324
1339
|
] }),
|
|
1325
1340
|
/* @__PURE__ */ jsxs2("linearGradient", { id: "warning-b", x1: "50", x2: "50", y1: "0", y2: "100", gradientUnits: "userSpaceOnUse", children: [
|
|
1326
|
-
/* @__PURE__ */
|
|
1327
|
-
/* @__PURE__ */
|
|
1341
|
+
/* @__PURE__ */ jsx6("stop", { stopColor: "#FFDA66" }),
|
|
1342
|
+
/* @__PURE__ */ jsx6("stop", { offset: ".713", stopColor: "#FFDA66", stopOpacity: "0" })
|
|
1328
1343
|
] }),
|
|
1329
1344
|
/* @__PURE__ */ jsxs2(
|
|
1330
1345
|
"filter",
|
|
@@ -1337,13 +1352,13 @@ var WarningIcon = (props) => /* @__PURE__ */ jsxs2("svg", { xmlns: "http://www.w
|
|
|
1337
1352
|
colorInterpolationFilters: "sRGB",
|
|
1338
1353
|
filterUnits: "userSpaceOnUse",
|
|
1339
1354
|
children: [
|
|
1340
|
-
/* @__PURE__ */
|
|
1341
|
-
/* @__PURE__ */
|
|
1342
|
-
/* @__PURE__ */
|
|
1343
|
-
/* @__PURE__ */
|
|
1344
|
-
/* @__PURE__ */
|
|
1345
|
-
/* @__PURE__ */
|
|
1346
|
-
/* @__PURE__ */
|
|
1355
|
+
/* @__PURE__ */ jsx6("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
1356
|
+
/* @__PURE__ */ jsx6("feColorMatrix", { in: "SourceAlpha", result: "hardAlpha", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }),
|
|
1357
|
+
/* @__PURE__ */ jsx6("feOffset", { dy: "1.875" }),
|
|
1358
|
+
/* @__PURE__ */ jsx6("feGaussianBlur", { stdDeviation: "1.875" }),
|
|
1359
|
+
/* @__PURE__ */ jsx6("feColorMatrix", { values: "0 0 0 0 1 0 0 0 0 0.913725 0 0 0 0 0.6 0 0 0 0.45 0" }),
|
|
1360
|
+
/* @__PURE__ */ jsx6("feBlend", { in2: "BackgroundImageFix", result: "effect1_dropShadow_39_758" }),
|
|
1361
|
+
/* @__PURE__ */ jsx6("feBlend", { in: "SourceGraphic", in2: "effect1_dropShadow_39_758", result: "shape" })
|
|
1347
1362
|
]
|
|
1348
1363
|
}
|
|
1349
1364
|
)
|
|
@@ -1352,7 +1367,7 @@ var WarningIcon = (props) => /* @__PURE__ */ jsxs2("svg", { xmlns: "http://www.w
|
|
|
1352
1367
|
var WarningIcon_default = WarningIcon;
|
|
1353
1368
|
|
|
1354
1369
|
// src/components/IDKitWidget/States/ErrorState.tsx
|
|
1355
|
-
import { jsx as
|
|
1370
|
+
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1356
1371
|
var getParams = ({ retryFlow, errorState }) => ({ retryFlow, errorState });
|
|
1357
1372
|
var ERROR_TITLES = {
|
|
1358
1373
|
[AppErrorCodes.GenericError]: __("Something went wrong"),
|
|
@@ -1384,19 +1399,19 @@ var ErrorState = (props) => {
|
|
|
1384
1399
|
const { retryFlow, errorState } = idkit_default(getParams);
|
|
1385
1400
|
const { show_modal } = props;
|
|
1386
1401
|
return /* @__PURE__ */ jsxs3("div", { className: "space-y-8", children: [
|
|
1387
|
-
/* @__PURE__ */
|
|
1402
|
+
/* @__PURE__ */ jsx7("div", { className: clsx_default("flex items-center justify-center", show_modal ? "-mt-5" : ""), children: errorState?.code == AppErrorCodes.VerificationRejected ? /* @__PURE__ */ jsx7(WarningIcon_default, { className: "w-24" }) : /* @__PURE__ */ jsx7(ErrorIcon_default, { className: "w-24" }) }),
|
|
1388
1403
|
/* @__PURE__ */ jsxs3("div", { children: [
|
|
1389
|
-
/* @__PURE__ */
|
|
1390
|
-
/* @__PURE__ */
|
|
1404
|
+
/* @__PURE__ */ jsx7("p", { className: "text-center text-2xl font-semibold text-gray-900 dark:text-white", children: (errorState?.code && ERROR_TITLES[errorState.code]) ?? ERROR_TITLES[AppErrorCodes.GenericError] }),
|
|
1405
|
+
/* @__PURE__ */ jsx7("p", { className: "mx-auto mt-2 max-w-[224px] text-center text-657080", children: errorState?.message ?? ERROR_MESSAGES[errorState?.code ?? AppErrorCodes.GenericError] })
|
|
1391
1406
|
] }),
|
|
1392
|
-
/* @__PURE__ */
|
|
1407
|
+
/* @__PURE__ */ jsx7("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxs3(
|
|
1393
1408
|
"button",
|
|
1394
1409
|
{
|
|
1395
1410
|
type: "button",
|
|
1396
1411
|
onClick: retryFlow,
|
|
1397
1412
|
className: "inline-flex items-center rounded-lg border border-ebecef bg-transparent px-8 py-3 font-medium text-3c424b shadow-sm transition duration-300 hover:shadow focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-40",
|
|
1398
1413
|
children: [
|
|
1399
|
-
/* @__PURE__ */
|
|
1414
|
+
/* @__PURE__ */ jsx7(ReloadIcon_default, { className: "mr-1.5 size-5" }),
|
|
1400
1415
|
__("Try Again")
|
|
1401
1416
|
]
|
|
1402
1417
|
}
|
|
@@ -1409,9 +1424,9 @@ var ErrorState_default = ErrorState;
|
|
|
1409
1424
|
import * as Toast from "@radix-ui/react-toast";
|
|
1410
1425
|
|
|
1411
1426
|
// src/components/Icons/CheckIcon.tsx
|
|
1412
|
-
import { jsx as
|
|
1427
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1413
1428
|
var CheckIcon = (props) => /* @__PURE__ */ jsxs4("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 100 100", ...props, children: [
|
|
1414
|
-
/* @__PURE__ */
|
|
1429
|
+
/* @__PURE__ */ jsx8(
|
|
1415
1430
|
"circle",
|
|
1416
1431
|
{
|
|
1417
1432
|
cx: "50",
|
|
@@ -1424,10 +1439,10 @@ var CheckIcon = (props) => /* @__PURE__ */ jsxs4("svg", { xmlns: "http://www.w3.
|
|
|
1424
1439
|
}
|
|
1425
1440
|
),
|
|
1426
1441
|
/* @__PURE__ */ jsxs4("g", { filter: "url(#success-c)", children: [
|
|
1427
|
-
/* @__PURE__ */
|
|
1428
|
-
/* @__PURE__ */
|
|
1442
|
+
/* @__PURE__ */ jsx8("circle", { cx: "50", cy: "50", r: "35", fill: "#fff" }),
|
|
1443
|
+
/* @__PURE__ */ jsx8("circle", { cx: "50", cy: "50", r: "34.432", stroke: "#CCEBCC", strokeWidth: "1.136" })
|
|
1429
1444
|
] }),
|
|
1430
|
-
/* @__PURE__ */
|
|
1445
|
+
/* @__PURE__ */ jsx8(
|
|
1431
1446
|
"path",
|
|
1432
1447
|
{
|
|
1433
1448
|
stroke: "#090",
|
|
@@ -1439,12 +1454,12 @@ var CheckIcon = (props) => /* @__PURE__ */ jsxs4("svg", { xmlns: "http://www.w3.
|
|
|
1439
1454
|
),
|
|
1440
1455
|
/* @__PURE__ */ jsxs4("defs", { children: [
|
|
1441
1456
|
/* @__PURE__ */ jsxs4("linearGradient", { id: "success-a", x1: "50", x2: "50", y1: "0", y2: "100", gradientUnits: "userSpaceOnUse", children: [
|
|
1442
|
-
/* @__PURE__ */
|
|
1443
|
-
/* @__PURE__ */
|
|
1457
|
+
/* @__PURE__ */ jsx8("stop", { stopColor: "#99D699" }),
|
|
1458
|
+
/* @__PURE__ */ jsx8("stop", { offset: "1", stopColor: "#99D699", stopOpacity: "0" })
|
|
1444
1459
|
] }),
|
|
1445
1460
|
/* @__PURE__ */ jsxs4("linearGradient", { id: "success-b", x1: "50", x2: "50", y1: "0", y2: "100", gradientUnits: "userSpaceOnUse", children: [
|
|
1446
|
-
/* @__PURE__ */
|
|
1447
|
-
/* @__PURE__ */
|
|
1461
|
+
/* @__PURE__ */ jsx8("stop", { stopColor: "#99D699" }),
|
|
1462
|
+
/* @__PURE__ */ jsx8("stop", { offset: ".713", stopColor: "#99D699", stopOpacity: "0" })
|
|
1448
1463
|
] }),
|
|
1449
1464
|
/* @__PURE__ */ jsxs4(
|
|
1450
1465
|
"filter",
|
|
@@ -1457,13 +1472,13 @@ var CheckIcon = (props) => /* @__PURE__ */ jsxs4("svg", { xmlns: "http://www.w3.
|
|
|
1457
1472
|
colorInterpolationFilters: "sRGB",
|
|
1458
1473
|
filterUnits: "userSpaceOnUse",
|
|
1459
1474
|
children: [
|
|
1460
|
-
/* @__PURE__ */
|
|
1461
|
-
/* @__PURE__ */
|
|
1462
|
-
/* @__PURE__ */
|
|
1463
|
-
/* @__PURE__ */
|
|
1464
|
-
/* @__PURE__ */
|
|
1465
|
-
/* @__PURE__ */
|
|
1466
|
-
/* @__PURE__ */
|
|
1475
|
+
/* @__PURE__ */ jsx8("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
1476
|
+
/* @__PURE__ */ jsx8("feColorMatrix", { in: "SourceAlpha", result: "hardAlpha", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }),
|
|
1477
|
+
/* @__PURE__ */ jsx8("feOffset", { dy: "1.875" }),
|
|
1478
|
+
/* @__PURE__ */ jsx8("feGaussianBlur", { stdDeviation: "1.875" }),
|
|
1479
|
+
/* @__PURE__ */ jsx8("feColorMatrix", { values: "0 0 0 0 0.8 0 0 0 0 0.921569 0 0 0 0 0.8 0 0 0 0.45 0" }),
|
|
1480
|
+
/* @__PURE__ */ jsx8("feBlend", { in2: "BackgroundImageFix", result: "effect1_dropShadow_39_712" }),
|
|
1481
|
+
/* @__PURE__ */ jsx8("feBlend", { in: "SourceGraphic", in2: "effect1_dropShadow_39_712", result: "shape" })
|
|
1467
1482
|
]
|
|
1468
1483
|
}
|
|
1469
1484
|
)
|
|
@@ -1472,13 +1487,13 @@ var CheckIcon = (props) => /* @__PURE__ */ jsxs4("svg", { xmlns: "http://www.w3.
|
|
|
1472
1487
|
var CheckIcon_default = CheckIcon;
|
|
1473
1488
|
|
|
1474
1489
|
// src/components/IDKitWidget/States/SuccessState.tsx
|
|
1475
|
-
import { jsx as
|
|
1490
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1476
1491
|
var SuccessState = (props) => {
|
|
1477
1492
|
return /* @__PURE__ */ jsxs5("div", { className: "space-y-6", children: [
|
|
1478
|
-
/* @__PURE__ */
|
|
1493
|
+
/* @__PURE__ */ jsx9("div", { className: clsx_default("flex items-center justify-center", props.show_modal ? "-mt-5" : ""), children: /* @__PURE__ */ jsx9(CheckIcon_default, { className: "w-24 text-white" }) }),
|
|
1479
1494
|
/* @__PURE__ */ jsxs5("div", { children: [
|
|
1480
|
-
/* @__PURE__ */
|
|
1481
|
-
/* @__PURE__ */
|
|
1495
|
+
/* @__PURE__ */ jsx9("p", { className: "text-center text-2xl font-semibold text-gray-900 dark:text-white", children: __("Successfully verified") }),
|
|
1496
|
+
/* @__PURE__ */ jsx9("p", { className: "mx-auto mt-2 max-w-[224px] text-center text-lg text-657080", children: __("Your World ID verification was successful") })
|
|
1482
1497
|
] })
|
|
1483
1498
|
] });
|
|
1484
1499
|
};
|
|
@@ -1486,12 +1501,12 @@ var SuccessState_default = SuccessState;
|
|
|
1486
1501
|
|
|
1487
1502
|
// src/components/IDKitWidget/States/WorldID/QRState.tsx
|
|
1488
1503
|
import copy from "copy-to-clipboard";
|
|
1489
|
-
import { useCallback, useState as
|
|
1504
|
+
import { useCallback as useCallback2, useState as useState3 } from "react";
|
|
1490
1505
|
import { AnimatePresence, motion } from "framer-motion";
|
|
1491
1506
|
|
|
1492
1507
|
// src/components/Icons/WorldcoinIcon.tsx
|
|
1493
|
-
import { jsx as
|
|
1494
|
-
var WorldcoinIcon = (props) => /* @__PURE__ */
|
|
1508
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1509
|
+
var WorldcoinIcon = (props) => /* @__PURE__ */ jsx10("svg", { ...props, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 33 32", children: /* @__PURE__ */ jsx10(
|
|
1495
1510
|
"path",
|
|
1496
1511
|
{
|
|
1497
1512
|
fill: "currentColor",
|
|
@@ -1501,9 +1516,9 @@ var WorldcoinIcon = (props) => /* @__PURE__ */ jsx9("svg", { ...props, xmlns: "h
|
|
|
1501
1516
|
var WorldcoinIcon_default = WorldcoinIcon;
|
|
1502
1517
|
|
|
1503
1518
|
// src/components/Icons/QRPlaceholderIcon.tsx
|
|
1504
|
-
import { jsx as
|
|
1519
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1505
1520
|
var QRPlaceholderIcon = (props) => /* @__PURE__ */ jsxs6("svg", { ...props, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 200 200", children: [
|
|
1506
|
-
/* @__PURE__ */
|
|
1521
|
+
/* @__PURE__ */ jsx11(
|
|
1507
1522
|
"path",
|
|
1508
1523
|
{
|
|
1509
1524
|
fill: "#EBECEF",
|
|
@@ -1512,14 +1527,14 @@ var QRPlaceholderIcon = (props) => /* @__PURE__ */ jsxs6("svg", { ...props, xmln
|
|
|
1512
1527
|
clipRule: "evenodd"
|
|
1513
1528
|
}
|
|
1514
1529
|
),
|
|
1515
|
-
/* @__PURE__ */
|
|
1530
|
+
/* @__PURE__ */ jsx11(
|
|
1516
1531
|
"path",
|
|
1517
1532
|
{
|
|
1518
1533
|
fill: "#EBECEF",
|
|
1519
1534
|
d: "M197.026 200c.789 0 1.545-.309 2.103-.86.558-.55.871-1.297.871-2.076v-17.616c0-.778-.313-1.525-.871-2.076a2.996 2.996 0 0 0-2.103-.86h-5.948c-.789 0-1.545.31-2.103.86a2.918 2.918 0 0 0-.871 2.076v8.808h-11.897v-11.744h-11.896v-23.487h11.896v8.808c0 .778.314 1.525.872 2.076.557.55 1.314.86 2.102.86h5.949c.788 0 1.545-.31 2.103-.86a2.922 2.922 0 0 0 .871-2.076v-8.808h8.922c.789 0 1.545-.309 2.103-.86a2.916 2.916 0 0 0 .871-2.076v-5.872c0-.779-.313-1.525-.871-2.076a2.992 2.992 0 0 0-2.103-.86h-29.741c-.789 0-1.545.309-2.103.86a2.916 2.916 0 0 0-.871 2.076v8.808h-23.792v-11.744h8.922c.789 0 1.545-.309 2.103-.86.558-.55.871-1.297.871-2.076v-5.872c0-.778-.313-1.525-.871-2.076a2.996 2.996 0 0 0-2.103-.86h-5.948c-.789 0-1.546.31-2.103.86a2.918 2.918 0 0 0-.871 2.076v8.808H119.7c-.789 0-1.545.309-2.103.86a2.916 2.916 0 0 0-.871 2.076v5.872c0 .779.313 1.525.871 2.076.558.551 1.314.86 2.103.86h20.819v8.808c0 .778.313 1.525.871 2.076.557.55 1.314.86 2.103.86h8.922v8.808c0 .778.313 1.525.871 2.076.558.55 1.314.859 2.103.859h8.922v11.744h-20.818c-.789 0-1.546.31-2.103.86a2.916 2.916 0 0 0-.871 2.076v5.872c0 .779.313 1.526.871 2.076a2.99 2.99 0 0 0 2.103.86h17.844c.789 0 1.545-.309 2.103-.86.558-.55.871-1.297.871-2.076v-8.808h11.896v8.808c0 .779.314 1.526.872 2.076a2.99 2.99 0 0 0 2.102.86h17.845Z"
|
|
1520
1535
|
}
|
|
1521
1536
|
),
|
|
1522
|
-
/* @__PURE__ */
|
|
1537
|
+
/* @__PURE__ */ jsx11(
|
|
1523
1538
|
"path",
|
|
1524
1539
|
{
|
|
1525
1540
|
fill: "#EBECEF",
|
|
@@ -1528,14 +1543,14 @@ var QRPlaceholderIcon = (props) => /* @__PURE__ */ jsxs6("svg", { ...props, xmln
|
|
|
1528
1543
|
clipRule: "evenodd"
|
|
1529
1544
|
}
|
|
1530
1545
|
),
|
|
1531
|
-
/* @__PURE__ */
|
|
1546
|
+
/* @__PURE__ */ jsx11(
|
|
1532
1547
|
"path",
|
|
1533
1548
|
{
|
|
1534
1549
|
fill: "#EBECEF",
|
|
1535
1550
|
d: "M6.05 89.68A6.05 6.05 0 0 0 0 95.73v9.252a6.05 6.05 0 0 0 6.05 6.05h9.253a6.05 6.05 0 0 0 6.05-6.05V95.73c0-.678-.112-1.33-.318-1.94.445.105.908.16 1.385.16h27.758a6.05 6.05 0 0 0 6.05-6.05v-9.252a6.05 6.05 0 0 0-6.05-6.05H22.42a6.05 6.05 0 0 0-6.05 6.05V87.9c0 .678.112 1.33.317 1.939a6.065 6.065 0 0 0-1.385-.16H6.05Zm102.135-40.926a6.05 6.05 0 0 1 6.05-6.05h9.253a6.05 6.05 0 0 1 6.049 6.05v9.253a6.05 6.05 0 0 1-6.049 6.05h-9.253a6.05 6.05 0 0 1-6.05-6.05v-9.253ZM67.616 184.698a6.05 6.05 0 0 1 6.05-6.05h9.252c.678 0 1.33.111 1.939.317a6.064 6.064 0 0 1-.16-1.385v-9.253a6.05 6.05 0 0 1 6.05-6.049H100a6.05 6.05 0 0 1 6.05 6.049v9.253a6.05 6.05 0 0 1-6.05 6.05h-9.253c-.678 0-1.33-.112-1.938-.317.104.444.159.908.159 1.385v9.252a6.05 6.05 0 0 1-6.05 6.05h-9.253a6.05 6.05 0 0 1-6.05-6.05v-9.252Zm78.291-120.285a6.05 6.05 0 0 1 6.05-6.05h41.993a6.05 6.05 0 0 1 6.05 6.05v9.252a6.05 6.05 0 0 1-6.05 6.05h-41.993a6.05 6.05 0 0 1-6.05-6.05v-9.252ZM95.018 0a6.05 6.05 0 0 0-6.05 6.05v17.082a6.05 6.05 0 0 0 6.05 6.05h9.252a6.05 6.05 0 0 0 6.05-6.05V6.05A6.05 6.05 0 0 0 104.27 0h-9.252Z"
|
|
1536
1551
|
}
|
|
1537
1552
|
),
|
|
1538
|
-
/* @__PURE__ */
|
|
1553
|
+
/* @__PURE__ */ jsx11(
|
|
1539
1554
|
"path",
|
|
1540
1555
|
{
|
|
1541
1556
|
fill: "url(#a)",
|
|
@@ -1544,14 +1559,14 @@ var QRPlaceholderIcon = (props) => /* @__PURE__ */ jsxs6("svg", { ...props, xmln
|
|
|
1544
1559
|
clipRule: "evenodd"
|
|
1545
1560
|
}
|
|
1546
1561
|
),
|
|
1547
|
-
/* @__PURE__ */
|
|
1562
|
+
/* @__PURE__ */ jsx11(
|
|
1548
1563
|
"path",
|
|
1549
1564
|
{
|
|
1550
1565
|
fill: "url(#a)",
|
|
1551
1566
|
d: "M197.026 200c.789 0 1.545-.309 2.103-.86.558-.55.871-1.297.871-2.076v-17.616c0-.778-.313-1.525-.871-2.076a2.996 2.996 0 0 0-2.103-.86h-5.948c-.789 0-1.545.31-2.103.86a2.918 2.918 0 0 0-.871 2.076v8.808h-11.897v-11.744h-11.896v-23.487h11.896v8.808c0 .778.314 1.525.872 2.076.557.55 1.314.86 2.102.86h5.949c.788 0 1.545-.31 2.103-.86a2.922 2.922 0 0 0 .871-2.076v-8.808h8.922c.789 0 1.545-.309 2.103-.86a2.916 2.916 0 0 0 .871-2.076v-5.872c0-.779-.313-1.525-.871-2.076a2.992 2.992 0 0 0-2.103-.86h-29.741c-.789 0-1.545.309-2.103.86a2.916 2.916 0 0 0-.871 2.076v8.808h-23.792v-11.744h8.922c.789 0 1.545-.309 2.103-.86.558-.55.871-1.297.871-2.076v-5.872c0-.778-.313-1.525-.871-2.076a2.996 2.996 0 0 0-2.103-.86h-5.948c-.789 0-1.546.31-2.103.86a2.918 2.918 0 0 0-.871 2.076v8.808H119.7c-.789 0-1.545.309-2.103.86a2.916 2.916 0 0 0-.871 2.076v5.872c0 .779.313 1.525.871 2.076.558.551 1.314.86 2.103.86h20.819v8.808c0 .778.313 1.525.871 2.076.557.55 1.314.86 2.103.86h8.922v8.808c0 .778.313 1.525.871 2.076.558.55 1.314.859 2.103.859h8.922v11.744h-20.818c-.789 0-1.546.31-2.103.86a2.916 2.916 0 0 0-.871 2.076v5.872c0 .779.313 1.526.871 2.076a2.99 2.99 0 0 0 2.103.86h17.844c.789 0 1.545-.309 2.103-.86.558-.55.871-1.297.871-2.076v-8.808h11.896v8.808c0 .779.314 1.526.872 2.076a2.99 2.99 0 0 0 2.102.86h17.845Z"
|
|
1552
1567
|
}
|
|
1553
1568
|
),
|
|
1554
|
-
/* @__PURE__ */
|
|
1569
|
+
/* @__PURE__ */ jsx11(
|
|
1555
1570
|
"path",
|
|
1556
1571
|
{
|
|
1557
1572
|
fill: "url(#a)",
|
|
@@ -1560,7 +1575,7 @@ var QRPlaceholderIcon = (props) => /* @__PURE__ */ jsxs6("svg", { ...props, xmln
|
|
|
1560
1575
|
clipRule: "evenodd"
|
|
1561
1576
|
}
|
|
1562
1577
|
),
|
|
1563
|
-
/* @__PURE__ */
|
|
1578
|
+
/* @__PURE__ */ jsx11(
|
|
1564
1579
|
"path",
|
|
1565
1580
|
{
|
|
1566
1581
|
fill: "url(#a)",
|
|
@@ -1569,55 +1584,55 @@ var QRPlaceholderIcon = (props) => /* @__PURE__ */ jsxs6("svg", { ...props, xmln
|
|
|
1569
1584
|
clipRule: "evenodd"
|
|
1570
1585
|
}
|
|
1571
1586
|
),
|
|
1572
|
-
/* @__PURE__ */
|
|
1587
|
+
/* @__PURE__ */ jsx11(
|
|
1573
1588
|
"path",
|
|
1574
1589
|
{
|
|
1575
1590
|
fill: "url(#a)",
|
|
1576
1591
|
d: "M6.05 89.68A6.05 6.05 0 0 0 0 95.73v9.252a6.05 6.05 0 0 0 6.05 6.05h9.253a6.05 6.05 0 0 0 6.05-6.05V95.73c0-.678-.112-1.33-.318-1.94.445.105.908.16 1.385.16h27.758a6.05 6.05 0 0 0 6.05-6.05v-9.252a6.05 6.05 0 0 0-6.05-6.05H22.42a6.05 6.05 0 0 0-6.05 6.05V87.9c0 .678.112 1.33.317 1.939a6.065 6.065 0 0 0-1.385-.16H6.05Z"
|
|
1577
1592
|
}
|
|
1578
1593
|
),
|
|
1579
|
-
/* @__PURE__ */
|
|
1594
|
+
/* @__PURE__ */ jsx11(
|
|
1580
1595
|
"path",
|
|
1581
1596
|
{
|
|
1582
1597
|
fill: "url(#a)",
|
|
1583
1598
|
d: "M108.185 48.754a6.05 6.05 0 0 1 6.05-6.05h9.253a6.05 6.05 0 0 1 6.049 6.05v9.253a6.05 6.05 0 0 1-6.049 6.05h-9.253a6.05 6.05 0 0 1-6.05-6.05v-9.253Z"
|
|
1584
1599
|
}
|
|
1585
1600
|
),
|
|
1586
|
-
/* @__PURE__ */
|
|
1601
|
+
/* @__PURE__ */ jsx11(
|
|
1587
1602
|
"path",
|
|
1588
1603
|
{
|
|
1589
1604
|
fill: "url(#a)",
|
|
1590
1605
|
d: "M67.616 184.698a6.05 6.05 0 0 1 6.05-6.05h9.252c.678 0 1.33.111 1.939.317a6.064 6.064 0 0 1-.16-1.385v-9.253a6.05 6.05 0 0 1 6.05-6.049H100a6.05 6.05 0 0 1 6.05 6.049v9.253a6.05 6.05 0 0 1-6.05 6.05h-9.253c-.678 0-1.33-.112-1.938-.317.104.444.159.908.159 1.385v9.252a6.05 6.05 0 0 1-6.05 6.05h-9.253a6.05 6.05 0 0 1-6.05-6.05v-9.252Z"
|
|
1591
1606
|
}
|
|
1592
1607
|
),
|
|
1593
|
-
/* @__PURE__ */
|
|
1608
|
+
/* @__PURE__ */ jsx11(
|
|
1594
1609
|
"path",
|
|
1595
1610
|
{
|
|
1596
1611
|
fill: "url(#a)",
|
|
1597
1612
|
d: "M145.907 64.413a6.05 6.05 0 0 1 6.05-6.05h41.993a6.05 6.05 0 0 1 6.05 6.05v9.252a6.05 6.05 0 0 1-6.05 6.05h-41.993a6.05 6.05 0 0 1-6.05-6.05v-9.252Z"
|
|
1598
1613
|
}
|
|
1599
1614
|
),
|
|
1600
|
-
/* @__PURE__ */
|
|
1615
|
+
/* @__PURE__ */ jsx11(
|
|
1601
1616
|
"path",
|
|
1602
1617
|
{
|
|
1603
1618
|
fill: "url(#a)",
|
|
1604
1619
|
d: "M95.018 0a6.05 6.05 0 0 0-6.05 6.05v17.082a6.05 6.05 0 0 0 6.05 6.05h9.252a6.05 6.05 0 0 0 6.05-6.05V6.05A6.05 6.05 0 0 0 104.27 0h-9.252Z"
|
|
1605
1620
|
}
|
|
1606
1621
|
),
|
|
1607
|
-
/* @__PURE__ */
|
|
1608
|
-
/* @__PURE__ */
|
|
1609
|
-
/* @__PURE__ */
|
|
1610
|
-
/* @__PURE__ */
|
|
1622
|
+
/* @__PURE__ */ jsx11("defs", { children: /* @__PURE__ */ jsxs6("linearGradient", { id: "a", x1: "0", x2: "200", y1: "0", y2: "200", gradientUnits: "userSpaceOnUse", children: [
|
|
1623
|
+
/* @__PURE__ */ jsx11("stop", { offset: ".37", stopColor: "#fff", stopOpacity: "0" }),
|
|
1624
|
+
/* @__PURE__ */ jsx11("stop", { offset: ".5", stopColor: "#fff", stopOpacity: ".85" }),
|
|
1625
|
+
/* @__PURE__ */ jsx11("stop", { offset: ".63", stopColor: "#fff", stopOpacity: "0" })
|
|
1611
1626
|
] }) })
|
|
1612
1627
|
] });
|
|
1613
1628
|
var QRPlaceholderIcon_default = QRPlaceholderIcon;
|
|
1614
1629
|
|
|
1615
1630
|
// src/components/IDKitWidget/States/WorldID/QRState.tsx
|
|
1616
|
-
import { Fragment, jsx as
|
|
1631
|
+
import { Fragment, jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1617
1632
|
var QRState = ({ qrData, showQR, setShowQR }) => {
|
|
1618
1633
|
const media = useMedia_default();
|
|
1619
|
-
const [copiedLink, setCopiedLink] =
|
|
1620
|
-
const copyLink =
|
|
1634
|
+
const [copiedLink, setCopiedLink] = useState3(false);
|
|
1635
|
+
const copyLink = useCallback2(() => {
|
|
1621
1636
|
copy(qrData ?? "");
|
|
1622
1637
|
setCopiedLink(true);
|
|
1623
1638
|
setTimeout(() => setCopiedLink(false), 2e3);
|
|
@@ -1638,8 +1653,8 @@ var QRState = ({ qrData, showQR, setShowQR }) => {
|
|
|
1638
1653
|
{ hidden: showQR }
|
|
1639
1654
|
),
|
|
1640
1655
|
children: [
|
|
1641
|
-
/* @__PURE__ */
|
|
1642
|
-
/* @__PURE__ */
|
|
1656
|
+
/* @__PURE__ */ jsx12(WorldcoinIcon_default, { className: "size-5" }),
|
|
1657
|
+
/* @__PURE__ */ jsx12(
|
|
1643
1658
|
motion.span,
|
|
1644
1659
|
{
|
|
1645
1660
|
className: "flex-1 text-center",
|
|
@@ -1653,11 +1668,11 @@ var QRState = ({ qrData, showQR, setShowQR }) => {
|
|
|
1653
1668
|
),
|
|
1654
1669
|
/* @__PURE__ */ jsxs7("div", { className: clsx_default("mb-3", { "space-y-4": !showQR, hidden: media === "mobile" }), children: [
|
|
1655
1670
|
/* @__PURE__ */ jsxs7("div", { className: clsx_default("flex items-center space-x-4 ", { hidden: showQR }), children: [
|
|
1656
|
-
/* @__PURE__ */
|
|
1657
|
-
/* @__PURE__ */
|
|
1658
|
-
/* @__PURE__ */
|
|
1671
|
+
/* @__PURE__ */ jsx12("hr", { className: "flex-1" }),
|
|
1672
|
+
/* @__PURE__ */ jsx12("span", { className: "text-xs font-medium text-9ba3ae", children: "or" }),
|
|
1673
|
+
/* @__PURE__ */ jsx12("hr", { className: "flex-1" })
|
|
1659
1674
|
] }),
|
|
1660
|
-
/* @__PURE__ */
|
|
1675
|
+
/* @__PURE__ */ jsx12(
|
|
1661
1676
|
motion.button,
|
|
1662
1677
|
{
|
|
1663
1678
|
className: "w-full rounded-2xl border border-ebecef p-4 text-lg font-medium text-3c424b",
|
|
@@ -1668,7 +1683,7 @@ var QRState = ({ qrData, showQR, setShowQR }) => {
|
|
|
1668
1683
|
] })
|
|
1669
1684
|
] }),
|
|
1670
1685
|
(media == "desktop" || showQR) && /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
1671
|
-
/* @__PURE__ */
|
|
1686
|
+
/* @__PURE__ */ jsx12(AnimatePresence, { children: copiedLink && /* @__PURE__ */ jsx12(
|
|
1672
1687
|
motion.div,
|
|
1673
1688
|
{
|
|
1674
1689
|
className: "text-sm text-9eafc0",
|
|
@@ -1701,14 +1716,14 @@ var QRState = ({ qrData, showQR, setShowQR }) => {
|
|
|
1701
1716
|
}
|
|
1702
1717
|
}
|
|
1703
1718
|
},
|
|
1704
|
-
children: /* @__PURE__ */
|
|
1719
|
+
children: /* @__PURE__ */ jsx12("span", { className: "rounded-lg border border-f1f5f8 px-2 py-1 text-sm", children: __("QR Code copied") })
|
|
1705
1720
|
},
|
|
1706
1721
|
"copied"
|
|
1707
1722
|
) }),
|
|
1708
|
-
/* @__PURE__ */
|
|
1723
|
+
/* @__PURE__ */ jsx12("div", { className: "relative inline-flex items-center justify-center rounded-2xl border border-f1f5f8 p-2 dark:border-f1f5f8/10", children: /* @__PURE__ */ jsx12("div", { className: "text-29343f dark:text-white", children: qrData ? (
|
|
1709
1724
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
1710
|
-
/* @__PURE__ */
|
|
1711
|
-
) : /* @__PURE__ */
|
|
1725
|
+
/* @__PURE__ */ jsx12("div", { onClick: copyLink, className: "cursor-pointer", children: /* @__PURE__ */ jsx12(QRCode_default, { data: qrData, size: 244 }) })
|
|
1726
|
+
) : /* @__PURE__ */ jsx12("div", { className: "flex size-[244px] items-center justify-center", children: /* @__PURE__ */ jsx12(QRPlaceholderIcon_default, { className: "size-[244px] animate-pulse" }) }) }) })
|
|
1712
1727
|
] })
|
|
1713
1728
|
] });
|
|
1714
1729
|
};
|
|
@@ -1716,15 +1731,15 @@ var QRState_default = QRState;
|
|
|
1716
1731
|
|
|
1717
1732
|
// src/components/IDKitWidget/States/WorldIDState.tsx
|
|
1718
1733
|
import { shallow } from "zustand/shallow";
|
|
1719
|
-
import { useEffect as
|
|
1734
|
+
import { useEffect as useEffect5, useState as useState4 } from "react";
|
|
1720
1735
|
|
|
1721
1736
|
// src/services/wld-bridge.ts
|
|
1722
|
-
import { useEffect as
|
|
1737
|
+
import { useEffect as useEffect4, useRef as useRef2 } from "react";
|
|
1723
1738
|
import { useWorldBridgeStore } from "@worldcoin/idkit-core";
|
|
1724
1739
|
var useWorldBridge = (app_id, action, signal, bridge_url, verification_level, action_description, partner) => {
|
|
1725
|
-
const ref_verification_level =
|
|
1740
|
+
const ref_verification_level = useRef2(verification_level);
|
|
1726
1741
|
const { reset, result, connectorURI, createClient, pollForUpdates, verificationState, errorCode } = useWorldBridgeStore();
|
|
1727
|
-
|
|
1742
|
+
useEffect4(() => {
|
|
1728
1743
|
if (!connectorURI) {
|
|
1729
1744
|
void createClient({
|
|
1730
1745
|
app_id,
|
|
@@ -1747,7 +1762,7 @@ var useWorldBridge = (app_id, action, signal, bridge_url, verification_level, ac
|
|
|
1747
1762
|
connectorURI,
|
|
1748
1763
|
partner
|
|
1749
1764
|
]);
|
|
1750
|
-
|
|
1765
|
+
useEffect4(() => {
|
|
1751
1766
|
if (!connectorURI || result || errorCode) return;
|
|
1752
1767
|
const interval = setInterval(() => void pollForUpdates(), 3e3);
|
|
1753
1768
|
return () => clearInterval(interval);
|
|
@@ -1756,7 +1771,7 @@ var useWorldBridge = (app_id, action, signal, bridge_url, verification_level, ac
|
|
|
1756
1771
|
};
|
|
1757
1772
|
|
|
1758
1773
|
// src/components/Icons/LoadingIcon.tsx
|
|
1759
|
-
import { jsx as
|
|
1774
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1760
1775
|
var LoadingIcon = ({ className, ...props }) => /* @__PURE__ */ jsxs8(
|
|
1761
1776
|
"svg",
|
|
1762
1777
|
{
|
|
@@ -1766,8 +1781,8 @@ var LoadingIcon = ({ className, ...props }) => /* @__PURE__ */ jsxs8(
|
|
|
1766
1781
|
className: `animate-spin motion-reduce:animate-[spin_1.5s_linear_infinite] ${className}`,
|
|
1767
1782
|
...props,
|
|
1768
1783
|
children: [
|
|
1769
|
-
/* @__PURE__ */
|
|
1770
|
-
/* @__PURE__ */
|
|
1784
|
+
/* @__PURE__ */ jsx13("circle", { cx: "12", cy: "12", r: "10.75", stroke: "#191C20", strokeOpacity: ".16", strokeWidth: "2.5" }),
|
|
1785
|
+
/* @__PURE__ */ jsx13(
|
|
1771
1786
|
"path",
|
|
1772
1787
|
{
|
|
1773
1788
|
fill: "#191C20",
|
|
@@ -1781,7 +1796,7 @@ var LoadingIcon_default = LoadingIcon;
|
|
|
1781
1796
|
|
|
1782
1797
|
// src/components/IDKitWidget/States/WorldIDState.tsx
|
|
1783
1798
|
import { AppErrorCodes as AppErrorCodes2, VerificationState, VerificationLevel } from "@worldcoin/idkit-core";
|
|
1784
|
-
import { jsx as
|
|
1799
|
+
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1785
1800
|
var getOptions = (store) => ({
|
|
1786
1801
|
signal: store.signal,
|
|
1787
1802
|
app_id: store.app_id,
|
|
@@ -1796,7 +1811,7 @@ var getOptions = (store) => ({
|
|
|
1796
1811
|
});
|
|
1797
1812
|
var WorldIDState = (props) => {
|
|
1798
1813
|
const media = useMedia_default();
|
|
1799
|
-
const [showQR, setShowQR] =
|
|
1814
|
+
const [showQR, setShowQR] = useState4(false);
|
|
1800
1815
|
const {
|
|
1801
1816
|
app_id,
|
|
1802
1817
|
action,
|
|
@@ -1818,8 +1833,8 @@ var WorldIDState = (props) => {
|
|
|
1818
1833
|
action_description,
|
|
1819
1834
|
partner
|
|
1820
1835
|
);
|
|
1821
|
-
|
|
1822
|
-
|
|
1836
|
+
useEffect5(() => reset, [reset]);
|
|
1837
|
+
useEffect5(() => {
|
|
1823
1838
|
if (verificationState === VerificationState.Failed) {
|
|
1824
1839
|
setStage("ERROR" /* ERROR */);
|
|
1825
1840
|
setErrorState({ code: errorCode ?? AppErrorCodes2.GenericError });
|
|
@@ -1844,32 +1859,32 @@ var WorldIDState = (props) => {
|
|
|
1844
1859
|
),
|
|
1845
1860
|
children: [
|
|
1846
1861
|
/* @__PURE__ */ jsxs9("div", { className: clsx_default(!show_modal ? "hidden" : ""), children: [
|
|
1847
|
-
/* @__PURE__ */
|
|
1848
|
-
/* @__PURE__ */
|
|
1862
|
+
/* @__PURE__ */ jsx14("div", { className: "mb-4 flex items-center justify-center", children: /* @__PURE__ */ jsx14(WorldcoinIcon_default, { className: "h-10 text-0d151d dark:text-white" }) }),
|
|
1863
|
+
/* @__PURE__ */ jsx14("p", { className: "font-sora text-2xl font-semibold text-gray-900 dark:text-white", children: __("Verify with World ID") }),
|
|
1849
1864
|
/* @__PURE__ */ jsxs9("p", { className: clsx_default("mt-3 text-657080 dark:text-9eafc0 md:mt-2", { hidden: media === "mobile" }), children: [
|
|
1850
1865
|
"Use your camera to scan the QR code. ",
|
|
1851
|
-
/* @__PURE__ */
|
|
1866
|
+
/* @__PURE__ */ jsx14("br", {}),
|
|
1852
1867
|
" ",
|
|
1853
|
-
/* @__PURE__ */
|
|
1868
|
+
/* @__PURE__ */ jsx14("span", { className: "text-red-500", children: "Keep this window open after scanning." })
|
|
1854
1869
|
] })
|
|
1855
1870
|
] }),
|
|
1856
1871
|
/* @__PURE__ */ jsxs9("div", { className: "relative w-full", children: [
|
|
1857
1872
|
verificationState === VerificationState.WaitingForApp && /* @__PURE__ */ jsxs9("div", { className: "absolute inset-0 flex flex-col items-center justify-center space-y-6", children: [
|
|
1858
|
-
/* @__PURE__ */
|
|
1873
|
+
/* @__PURE__ */ jsx14(LoadingIcon_default, { className: "size-6" }),
|
|
1859
1874
|
/* @__PURE__ */ jsxs9("div", { children: [
|
|
1860
|
-
/* @__PURE__ */
|
|
1861
|
-
/* @__PURE__ */
|
|
1862
|
-
/* @__PURE__ */
|
|
1875
|
+
/* @__PURE__ */ jsx14("p", { className: "font-bold text-657080", children: "Verifying" }),
|
|
1876
|
+
/* @__PURE__ */ jsx14("p", { className: "text-sm text-657080", children: "Please continue in app" }),
|
|
1877
|
+
/* @__PURE__ */ jsx14("p", { className: clsx_default(show_modal ? "" : "hidden", "mt-2 text-sm font-bold text-red-500"), children: "Don't close this window" })
|
|
1863
1878
|
] })
|
|
1864
1879
|
] }),
|
|
1865
|
-
/* @__PURE__ */
|
|
1880
|
+
/* @__PURE__ */ jsx14(
|
|
1866
1881
|
"div",
|
|
1867
1882
|
{
|
|
1868
1883
|
className: clsx_default(
|
|
1869
1884
|
"transition duration-500 ease-in-out",
|
|
1870
1885
|
verificationState === VerificationState.WaitingForApp && "opacity-40 blur-lg"
|
|
1871
1886
|
),
|
|
1872
|
-
children: /* @__PURE__ */
|
|
1887
|
+
children: /* @__PURE__ */ jsx14("div", { className: "mx-auto", children: /* @__PURE__ */ jsx14(QRState_default, { showQR, setShowQR, qrData: connectorURI }) })
|
|
1873
1888
|
}
|
|
1874
1889
|
)
|
|
1875
1890
|
] })
|
|
@@ -1881,21 +1896,21 @@ var WorldIDState_default = WorldIDState;
|
|
|
1881
1896
|
|
|
1882
1897
|
// src/components/IDKitWidget/BaseWidget.tsx
|
|
1883
1898
|
import * as Dialog from "@radix-ui/react-dialog";
|
|
1884
|
-
import { Fragment as Fragment2, useEffect as
|
|
1899
|
+
import { Fragment as Fragment2, useEffect as useEffect6, useMemo } from "react";
|
|
1885
1900
|
import { AnimatePresence as AnimatePresence2, motion as motion2 } from "framer-motion";
|
|
1886
1901
|
|
|
1887
1902
|
// src/components/IDKitWidget/States/HostAppVerificationState.tsx
|
|
1888
|
-
import { jsx as
|
|
1903
|
+
import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1889
1904
|
var HostAppVerificationState = () => {
|
|
1890
1905
|
return /* @__PURE__ */ jsxs10("div", { className: "space-y-6", children: [
|
|
1891
|
-
/* @__PURE__ */
|
|
1892
|
-
/* @__PURE__ */
|
|
1906
|
+
/* @__PURE__ */ jsx15("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx15(LoadingIcon_default, { className: "size-24" }) }),
|
|
1907
|
+
/* @__PURE__ */ jsx15("div", { className: "mt-4 text-70868f", children: __("Transmitting verification to host app. Please wait...") })
|
|
1893
1908
|
] });
|
|
1894
1909
|
};
|
|
1895
1910
|
var HostAppVerificationState_default = HostAppVerificationState;
|
|
1896
1911
|
|
|
1897
1912
|
// src/components/IDKitWidget/BaseWidget.tsx
|
|
1898
|
-
import { jsx as
|
|
1913
|
+
import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1899
1914
|
var getParams2 = ({ open, processing, onOpenChange, stage, setStage, setOptions }) => ({
|
|
1900
1915
|
stage,
|
|
1901
1916
|
setStage,
|
|
@@ -1913,7 +1928,7 @@ var IDKitWidget = ({
|
|
|
1913
1928
|
}) => {
|
|
1914
1929
|
const media = useMedia_default();
|
|
1915
1930
|
const { isOpen, onOpenChange, stage, setOptions } = idkit_default(getParams2, shallow2);
|
|
1916
|
-
|
|
1931
|
+
useEffect6(() => {
|
|
1917
1932
|
if (config.action === "") {
|
|
1918
1933
|
throw new Error(__("Action cannot be an empty string."));
|
|
1919
1934
|
}
|
|
@@ -1922,22 +1937,22 @@ var IDKitWidget = ({
|
|
|
1922
1937
|
const StageContent = useMemo(() => {
|
|
1923
1938
|
switch (stage) {
|
|
1924
1939
|
case "WORLD_ID" /* WORLD_ID */:
|
|
1925
|
-
return /* @__PURE__ */
|
|
1940
|
+
return /* @__PURE__ */ jsx16(WorldIDState_default, { show_modal });
|
|
1926
1941
|
case "SUCCESS" /* SUCCESS */:
|
|
1927
|
-
return /* @__PURE__ */
|
|
1942
|
+
return /* @__PURE__ */ jsx16(SuccessState_default, {});
|
|
1928
1943
|
case "ERROR" /* ERROR */:
|
|
1929
|
-
return /* @__PURE__ */
|
|
1944
|
+
return /* @__PURE__ */ jsx16(ErrorState_default, {});
|
|
1930
1945
|
case "HOST_APP_VERIFICATION" /* HOST_APP_VERIFICATION */:
|
|
1931
|
-
return /* @__PURE__ */
|
|
1946
|
+
return /* @__PURE__ */ jsx16(HostAppVerificationState_default, {});
|
|
1932
1947
|
default:
|
|
1933
1948
|
throw new Error(__("Invalid IDKitStage :stage.", { stage }));
|
|
1934
1949
|
}
|
|
1935
1950
|
}, [stage, show_modal]);
|
|
1936
|
-
const widgetContent = /* @__PURE__ */ jsxs11(
|
|
1937
|
-
/* @__PURE__ */
|
|
1951
|
+
const widgetContent = /* @__PURE__ */ jsxs11(ShadowHost, { mode: "open", id: "idkit-widget", children: [
|
|
1952
|
+
/* @__PURE__ */ jsx16(Styles_default, {}),
|
|
1938
1953
|
/* @__PURE__ */ jsxs11(Toast.Provider, { children: [
|
|
1939
|
-
/* @__PURE__ */
|
|
1940
|
-
/* @__PURE__ */
|
|
1954
|
+
/* @__PURE__ */ jsx16(Toast.Viewport, { className: "flex justify-center" }),
|
|
1955
|
+
/* @__PURE__ */ jsx16(
|
|
1941
1956
|
"div",
|
|
1942
1957
|
{
|
|
1943
1958
|
id: "widget-content-inline",
|
|
@@ -1961,10 +1976,10 @@ var IDKitWidget = ({
|
|
|
1961
1976
|
};
|
|
1962
1977
|
return /* @__PURE__ */ jsxs11(Dialog.Root, { open: isOpen, onOpenChange, children: [
|
|
1963
1978
|
children?.({ open: () => onOpenChange(true) }),
|
|
1964
|
-
/* @__PURE__ */
|
|
1965
|
-
/* @__PURE__ */
|
|
1979
|
+
/* @__PURE__ */ jsx16(Dialog.Portal, { forceMount: true, children: /* @__PURE__ */ jsx16(Fragment2, { children: /* @__PURE__ */ jsx16(AnimatePresence2, { children: isOpen && /* @__PURE__ */ jsxs11(ShadowHost, { mode: "open", id: "idkit-widget", children: [
|
|
1980
|
+
/* @__PURE__ */ jsx16(Styles_default, {}),
|
|
1966
1981
|
/* @__PURE__ */ jsxs11("div", { id: "modal", className: "fixed z-[9999] font-sans", children: [
|
|
1967
|
-
/* @__PURE__ */
|
|
1982
|
+
/* @__PURE__ */ jsx16(Dialog.Overlay, { asChild: true, children: /* @__PURE__ */ jsx16(
|
|
1968
1983
|
motion2.div,
|
|
1969
1984
|
{
|
|
1970
1985
|
initial: { opacity: 0 },
|
|
@@ -1973,15 +1988,15 @@ var IDKitWidget = ({
|
|
|
1973
1988
|
className: "fixed inset-0 bg-black/50 backdrop-blur-lg"
|
|
1974
1989
|
}
|
|
1975
1990
|
) }),
|
|
1976
|
-
/* @__PURE__ */
|
|
1977
|
-
/* @__PURE__ */
|
|
1978
|
-
/* @__PURE__ */
|
|
1991
|
+
/* @__PURE__ */ jsx16("div", { className: "fixed inset-0 z-[9999] overflow-y-hidden md:overflow-y-auto", children: /* @__PURE__ */ jsxs11("div", { className: "flex min-h-full items-end justify-center text-center md:items-center md:p-4", children: [
|
|
1992
|
+
/* @__PURE__ */ jsx16(Dialog.Title, {}),
|
|
1993
|
+
/* @__PURE__ */ jsx16(
|
|
1979
1994
|
Dialog.Content,
|
|
1980
1995
|
{
|
|
1981
1996
|
asChild: true,
|
|
1982
1997
|
onPointerDownOutside: avoidDefaultDomBehavior,
|
|
1983
1998
|
onInteractOutside: avoidDefaultDomBehavior,
|
|
1984
|
-
children: /* @__PURE__ */
|
|
1999
|
+
children: /* @__PURE__ */ jsx16(
|
|
1985
2000
|
motion2.div,
|
|
1986
2001
|
{
|
|
1987
2002
|
layout: media == "mobile" ? "position" : true,
|
|
@@ -1997,10 +2012,10 @@ var IDKitWidget = ({
|
|
|
1997
2012
|
transition: { layout: { duration: 0.15 } },
|
|
1998
2013
|
className: "relative z-50 flex min-h-screen w-full flex-col bg-white pt-6 shadow focus:outline-none focus-visible:ring focus-visible:ring-purple-500/75 dark:bg-0d151d md:min-h-[35rem] md:max-w-md md:rounded-2xl",
|
|
1999
2014
|
children: /* @__PURE__ */ jsxs11(Toast.Provider, { children: [
|
|
2000
|
-
/* @__PURE__ */
|
|
2001
|
-
/* @__PURE__ */
|
|
2002
|
-
/* @__PURE__ */
|
|
2003
|
-
/* @__PURE__ */
|
|
2015
|
+
/* @__PURE__ */ jsx16(Toast.Viewport, { className: "flex justify-center" }),
|
|
2016
|
+
/* @__PURE__ */ jsx16("div", { className: "mx-6 mb-12 flex items-center justify-between", children: /* @__PURE__ */ jsx16(Dialog.Close, { className: "flex size-11 items-center justify-center rounded-full text-black dark:text-white", children: /* @__PURE__ */ jsx16(XMarkIcon_default, { className: "size-5" }) }) }),
|
|
2017
|
+
/* @__PURE__ */ jsx16("div", { className: "relative mx-6 mb-6 flex flex-1 flex-col items-center justify-center", children: StageContent }),
|
|
2018
|
+
/* @__PURE__ */ jsx16("div", { className: "flex items-center justify-center border-t border-f5f5f7 p-7 md:rounded-b-2xl", children: /* @__PURE__ */ jsx16(
|
|
2004
2019
|
"a",
|
|
2005
2020
|
{
|
|
2006
2021
|
href: "https://developer.worldcoin.org/privacy-statement",
|
|
@@ -2031,7 +2046,7 @@ import { verifyCloudProof } from "@worldcoin/idkit-core/backend";
|
|
|
2031
2046
|
import { VerificationLevel as VerificationLevel2, VerificationState as VerificationState3 } from "@worldcoin/idkit-core";
|
|
2032
2047
|
|
|
2033
2048
|
// src/hooks/useSession.ts
|
|
2034
|
-
import { useEffect as
|
|
2049
|
+
import { useEffect as useEffect7 } from "react";
|
|
2035
2050
|
import { useShallow } from "zustand/react/shallow";
|
|
2036
2051
|
import { VerificationState as VerificationState2 } from "@worldcoin/idkit-core";
|
|
2037
2052
|
import { useWorldBridgeStore as useWorldBridgeStore2 } from "@worldcoin/idkit-core";
|
|
@@ -2048,12 +2063,12 @@ function useSession(config) {
|
|
|
2048
2063
|
errorCode: state.errorCode
|
|
2049
2064
|
}))
|
|
2050
2065
|
);
|
|
2051
|
-
|
|
2066
|
+
useEffect7(() => {
|
|
2052
2067
|
if (verificationState === VerificationState2.PreparingClient && !connectorURI) {
|
|
2053
2068
|
void createClient(config);
|
|
2054
2069
|
}
|
|
2055
2070
|
}, [verificationState, connectorURI, createClient, config]);
|
|
2056
|
-
|
|
2071
|
+
useEffect7(() => {
|
|
2057
2072
|
if (TERMINAL_STATES.includes(verificationState)) return;
|
|
2058
2073
|
const interval = setInterval(() => {
|
|
2059
2074
|
void pollForUpdates();
|