aesirx-analytics 2.2.10 → 2.2.12

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 CHANGED
@@ -155,6 +155,8 @@ window.trackEventAnalytics(endpoint, referer, data)
155
155
 
156
156
  (`data` is the data you want to track)
157
157
 
158
+ (`event_type` should be `conversion` if you want to track event as conversion)
159
+
158
160
  For example:
159
161
 
160
162
  ```
@@ -9,9 +9,8 @@ import {
9
9
  getWeb3ID,
10
10
  no_default,
11
11
  privacy_default,
12
- useConsentStatus_default,
13
- yes_default
14
- } from "./chunk-5VSCCPP6.js";
12
+ useConsentStatus_default
13
+ } from "./chunk-PD33NAQI.js";
15
14
  import {
16
15
  AnalyticsContext,
17
16
  agreeConsents,
@@ -25,19 +24,21 @@ import {
25
24
  revokeConsents,
26
25
  useTranslation,
27
26
  verifySignature
28
- } from "./chunk-N36VEWSG.js";
27
+ } from "./chunk-R4T7FUMB.js";
29
28
 
30
29
  // src/Components/Consent.tsx
31
- import React, { useContext, useEffect, useState } from "react";
30
+ import React, { Suspense, useContext, useEffect, useState } from "react";
32
31
  import { Button, Form } from "react-bootstrap";
33
32
  import { ToastContainer, toast } from "react-toastify";
34
33
 
34
+ // src/Assets/yes.svg
35
+ var yes_default = 'data:image/svg+xml,<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">%0A<path d="M9 1C7.41775 1 5.87103 1.46919 4.55544 2.34824C3.23985 3.22729 2.21447 4.47672 1.60897 5.93853C1.00347 7.40034 0.84504 9.00887 1.15372 10.5607C1.4624 12.1126 2.22433 13.538 3.34315 14.6569C4.46197 15.7757 5.88743 16.5376 7.43928 16.8463C8.99113 17.155 10.5997 16.9965 12.0615 16.391C13.5233 15.7855 14.7727 14.7602 15.6518 13.4446C16.5308 12.129 17 10.5823 17 9C17 6.87827 16.1571 4.84344 14.6569 3.34315C13.1566 1.84285 11.1217 1 9 1V1ZM9 16C7.61553 16 6.26216 15.5895 5.11101 14.8203C3.95987 14.0511 3.06266 12.9579 2.53285 11.6788C2.00303 10.3997 1.86441 8.99223 2.13451 7.63437C2.4046 6.2765 3.07129 5.02922 4.05026 4.05025C5.02922 3.07128 6.2765 2.4046 7.63437 2.1345C8.99224 1.86441 10.3997 2.00303 11.6788 2.53284C12.9579 3.06266 14.0511 3.95986 14.8203 5.11101C15.5895 6.26215 16 7.61553 16 9C16 10.8565 15.2625 12.637 13.9498 13.9497C12.637 15.2625 10.8565 16 9 16Z" fill="white"/>%0A<path d="M13.9985 6.04969C13.9048 5.95657 13.7781 5.9043 13.646 5.9043C13.5139 5.9043 13.3872 5.95657 13.2935 6.04969L7.7435 11.5747L4.7435 8.57469C4.652 8.4759 4.52501 8.4175 4.39045 8.41234C4.25589 8.40719 4.1248 8.45569 4.026 8.54719C3.92721 8.63869 3.86881 8.76569 3.86365 8.90025C3.8585 9.03481 3.907 9.1659 3.9985 9.26469L7.7435 12.9997L13.9985 6.75969C14.0454 6.71321 14.0826 6.65791 14.108 6.59698C14.1333 6.53605 14.1464 6.4707 14.1464 6.40469C14.1464 6.33869 14.1333 6.27333 14.108 6.21241C14.0826 6.15148 14.0454 6.09618 13.9985 6.04969Z" fill="white"/>%0A</svg>%0A';
36
+
35
37
  // src/Assets/no_white.svg
36
38
  var no_white_default = 'data:image/svg+xml,<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">%0A<path d="M9 2C13.1421 2 16.5 5.35786 16.5 9.5C16.5 13.6421 13.1421 17 9 17C4.85786 17 1.5 13.6421 1.5 9.5C1.5 5.35786 4.85786 2 9 2ZM9 3.125C5.47918 3.125 2.625 5.97918 2.625 9.5C2.625 13.0208 5.47918 15.875 9 15.875C12.5208 15.875 15.375 13.0208 15.375 9.5C15.375 5.97918 12.5208 3.125 9 3.125ZM11.5847 6.79779L11.6477 6.85225C11.8474 7.05195 11.8656 7.36445 11.7022 7.58466L11.6477 7.64775L9.79575 9.5L11.6477 11.3523C11.8474 11.552 11.8656 11.8645 11.7022 12.0847L11.6477 12.1477C11.448 12.3474 11.1355 12.3656 10.9153 12.2022L10.8523 12.1477L9 10.2957L7.14775 12.1477C6.94805 12.3474 6.63555 12.3656 6.41534 12.2022L6.35225 12.1477C6.15255 11.948 6.1344 11.6355 6.29779 11.4153L6.35225 11.3523L8.20425 9.5L6.35225 7.64775C6.15255 7.44805 6.1344 7.13555 6.29779 6.91534L6.35225 6.85225C6.55195 6.65255 6.86445 6.6344 7.08466 6.79779L7.14775 6.85225L9 8.70425L10.8523 6.85225C11.052 6.65255 11.3645 6.6344 11.5847 6.79779Z" fill="%23fff"/>%0A</svg>%0A';
37
39
 
38
40
  // src/Components/Consent.tsx
39
41
  import ContentLoader from "react-content-loader";
40
- import { SSOButton } from "aesirx-sso";
41
42
  import {
42
43
  MAINNET,
43
44
  WithWalletConnector,
@@ -49,6 +50,9 @@ import {
49
50
  } from "@concordium/react-components";
50
51
  import { OsTypes, isDesktop, isMobile, osName } from "react-device-detect";
51
52
  import { useAccount, useSignMessage } from "wagmi";
53
+ var SSOButton = React.lazy(
54
+ () => import("aesirx-sso").then((module) => ({ default: module.SSOButton }))
55
+ );
52
56
  var ConsentComponent = ({
53
57
  endpoint,
54
58
  aesirXEndpoint,
@@ -650,7 +654,7 @@ var ConsentComponentApp = (props) => {
650
654
  className: "text-white d-flex align-items-center revoke-btn fs-14"
651
655
  },
652
656
  t("txt_revoke_consent")
653
- ) : /* @__PURE__ */ React.createElement(React.Fragment, null), (sessionStorage.getItem("aesirx-analytics-revoke") === "4" || sessionStorage.getItem("aesirx-analytics-revoke") === "2") && /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
657
+ ) : /* @__PURE__ */ React.createElement(React.Fragment, null), (sessionStorage.getItem("aesirx-analytics-revoke") === "4" || sessionStorage.getItem("aesirx-analytics-revoke") === "2") && /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Suspense, { fallback: /* @__PURE__ */ React.createElement("div", null, "Loading...") }, /* @__PURE__ */ React.createElement(
654
658
  SSOButton,
655
659
  {
656
660
  className: "d-none revokeLogin",
@@ -658,7 +662,7 @@ var ConsentComponentApp = (props) => {
658
662
  ssoState: "noscopes",
659
663
  onGetData
660
664
  }
661
- )))))))))
665
+ ))))))))))
662
666
  )
663
667
  ), /* @__PURE__ */ React.createElement(
664
668
  "div",
@@ -708,7 +712,7 @@ var ConsentComponentApp = (props) => {
708
712
  {
709
713
  className: `ssoBtnWrapper me-1 bg-success ${level === 2 || level === 4 && !account && !address ? "" : "d-none"}`
710
714
  },
711
- /* @__PURE__ */ React.createElement(
715
+ /* @__PURE__ */ React.createElement(Suspense, { fallback: /* @__PURE__ */ React.createElement("div", null, "Loading...") }, /* @__PURE__ */ React.createElement(
712
716
  SSOButton,
713
717
  {
714
718
  className: "btn btn-success text-white d-flex align-items-center loginSSO",
@@ -717,7 +721,7 @@ var ConsentComponentApp = (props) => {
717
721
  onGetData,
718
722
  ...level === 2 ? { noCreateAccount: true } : {}
719
723
  }
720
- )
724
+ ))
721
725
  ), level === 2 || level === 4 && !account && !address ? /* @__PURE__ */ React.createElement(React.Fragment, null) : /* @__PURE__ */ React.createElement(
722
726
  Button,
723
727
  {