lucia-sdk 0.9.1 → 0.9.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.
Files changed (39) hide show
  1. package/dist/__tests__/auto-init.test.d.ts +5 -5
  2. package/dist/__tests__/base/index.test.d.ts +1 -1
  3. package/dist/__tests__/core/index.test.d.ts +1 -1
  4. package/dist/__tests__/integration/auto-init-integration.test.d.ts +9 -9
  5. package/dist/__tests__/integration/auto-track-integration.test.d.ts +4 -4
  6. package/dist/__tests__/integration/sdk-integration.test.d.ts +1 -1
  7. package/dist/__tests__/utils/click-tracker.test.d.ts +4 -4
  8. package/dist/__tests__/utils/data.test.d.ts +7 -7
  9. package/dist/__tests__/utils/evm.test.d.ts +1 -1
  10. package/dist/__tests__/utils/http-client.test.d.ts +1 -1
  11. package/dist/__tests__/utils/privacy.test.d.ts +4 -4
  12. package/dist/__tests__/utils/session.test.d.ts +1 -1
  13. package/dist/__tests__/utils/solana.test.d.ts +1 -1
  14. package/dist/__tests__/utils/store.test.d.ts +1 -1
  15. package/dist/base/index.d.ts +12 -12
  16. package/dist/constants.d.ts +2 -2
  17. package/dist/core/index.d.ts +65 -64
  18. package/dist/index.d.ts +5 -6
  19. package/dist/index.es.js +1 -18
  20. package/dist/index.es.js.map +1 -1
  21. package/dist/index.js +1 -18
  22. package/dist/index.js.map +1 -1
  23. package/dist/package.json +37 -47
  24. package/dist/types.d.ts +100 -99
  25. package/dist/umd/lucia-sdk-0.9.2.min.js +1 -0
  26. package/dist/umd/lucia-sdk-latest.min.js +1 -18
  27. package/dist/utils/click-tracker.d.ts +100 -100
  28. package/dist/utils/data.d.ts +98 -99
  29. package/dist/utils/evm.d.ts +69 -75
  30. package/dist/utils/http-client.d.ts +17 -17
  31. package/dist/utils/logger.d.ts +7 -7
  32. package/dist/utils/privacy.d.ts +33 -33
  33. package/dist/utils/session.d.ts +51 -51
  34. package/dist/utils/solana.d.ts +50 -50
  35. package/dist/utils/store.d.ts +14 -14
  36. package/dist/version.d.ts +1 -1
  37. package/package.json +37 -47
  38. package/CHANGELOG.md +0 -189
  39. package/dist/umd/lucia-sdk-0.9.1.min.js +0 -18
package/dist/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "lucia-sdk",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "license": "CC-BY-NC-4.0",
5
5
  "description": "Lucia JavaScript Library",
6
+ "type": "module",
6
7
  "main": "dist/index.js",
7
8
  "module": "dist/index.es.js",
8
9
  "types": "dist/index.d.ts",
@@ -19,65 +20,54 @@
19
20
  "package:copy": "cp package.json dist && cp README.md dist",
20
21
  "package:build": "yarn package:clean && rollup -c && yarn package:copy",
21
22
  "package:release": "release-it",
22
- "package:publish": "yarn package:build && yarn publish",
23
+ "package:publish": "yarn package:build && npm publish --access public",
23
24
  "tsc": "tsc --pretty --noEmit",
24
25
  "prepare": "yarn package:build",
25
- "setup": "husky install",
26
+ "setup": "husky init",
26
27
  "validate": "npm-run-all --parallel lint tsc",
27
28
  "commitlint": "commitlint",
28
- "lint": "eslint . --ext .js,.ts",
29
+ "lint": "eslint .",
29
30
  "lint:fix": "yarn lint --fix",
30
31
  "format": "npx prettier --config .prettierrc \"**/*.{css,scss,js,ts,md}\" --write",
31
32
  "format:test": "npx prettier --config .prettierrc \"**/*.{css,scss,js,ts,md}\" -l"
32
33
  },
33
34
  "devDependencies": {
34
- "@commitlint/config-conventional": "^17.4.2",
35
- "@release-it/conventional-changelog": "^8.0.1",
36
- "@rollup/plugin-commonjs": "^24.0.0",
37
- "@rollup/plugin-node-resolve": "^15.0.1",
38
- "@rollup/plugin-replace": "^5.0.5",
35
+ "@commitlint/config-conventional": "^20.2.0",
36
+ "@release-it/conventional-changelog": "^10.0.4",
37
+ "@rollup/plugin-commonjs": "^29.0.0",
38
+ "@rollup/plugin-node-resolve": "^16.0.3",
39
+ "@rollup/plugin-replace": "^6.0.3",
39
40
  "@rollup/plugin-terser": "^0.4.4",
40
- "@testing-library/jest-dom": "^5.16.5",
41
- "@types/crypto-js": "^4.2.2",
42
- "@types/jest": "^29.2.4",
41
+ "@testing-library/jest-dom": "^6.9.1",
42
+ "@types/jest": "^29.5.14",
43
43
  "@types/uuid": "^10.0.0",
44
- "@typescript-eslint/eslint-plugin": "^5.50.0",
45
- "@typescript-eslint/parser": "^5.50.0",
46
- "babel-eslint": "^10.1.0",
47
- "commitlint": "^17.4.2",
48
- "eslint": "^8.33.0",
49
- "eslint-config-airbnb-base": "^15.0.0",
50
- "eslint-config-airbnb-typescript": "^17.0.0",
51
- "eslint-config-prettier": "^8.6.0",
52
- "eslint-plugin-eslint-comments": "^3.2.0",
53
- "eslint-plugin-filenames": "^1.3.2",
54
- "eslint-plugin-import": "^2.27.5",
55
- "eslint-plugin-jest": "^27.2.1",
56
- "eslint-plugin-jsx-a11y": "^6.7.1",
57
- "eslint-plugin-promise": "^6.1.1",
58
- "eslint-plugin-sort-destructure-keys": "^1.4.0",
59
- "eslint-plugin-sort-keys-fix": "^1.1.2",
60
- "eslint-plugin-unicorn": "^45.0.2",
61
- "eslint-plugin-unused-imports": "^2.0.0",
62
- "husky": "^8.0.3",
63
- "jest": "^29.3.1",
64
- "jest-environment-jsdom": "^29.4.1",
65
- "lint-staged": "^13.1.0",
44
+ "@typescript-eslint/eslint-plugin": "^8.50.1",
45
+ "@typescript-eslint/parser": "^8.50.1",
46
+ "typescript-eslint": "^8.50.1",
47
+ "commitlint": "^20.2.0",
48
+ "eslint": "^9.39.2",
49
+ "eslint-config-prettier": "^10.1.8",
50
+ "eslint-plugin-import": "^2.32.0",
51
+ "eslint-plugin-jest": "^29.11.0",
52
+ "eslint-plugin-promise": "^7.2.1",
53
+ "eslint-plugin-unicorn": "^62.0.0",
54
+ "eslint-plugin-unused-imports": "^4.3.0",
55
+ "husky": "^9.1.7",
56
+ "jest": "^29.7.0",
57
+ "jest-environment-jsdom": "^29.7.0",
58
+ "lint-staged": "^16.2.7",
66
59
  "npm-run-all": "^4.1.5",
67
- "prettier": "^3.4.2",
68
- "release-it": "^19.0.0",
69
- "rollup": "^2.70.1",
70
- "rollup-plugin-peer-deps-external": "^2.2.4",
71
- "rollup-plugin-typescript2": "^0.34.1",
72
- "ts-jest": "^29.0.3",
73
- "typescript": "^4.9.4"
60
+ "prettier": "^3.7.4",
61
+ "release-it": "^19.2.1",
62
+ "rollup": "^4.54.0",
63
+ "rollup-plugin-typescript2": "^0.36.0",
64
+ "ts-jest": "^29.4.6",
65
+ "typescript": "^5.9.3"
74
66
  },
75
67
  "dependencies": {
76
- "@solana/spl-token": "^0.4.13",
77
- "@solana/web3.js": "^1.98.0",
78
- "crypto-js": "^4.2.0",
79
- "uuid": "^10.0.0"
68
+ "uuid": "^11.1.0"
80
69
  },
81
- "peerDependencies": {},
82
- "resolutions": {}
70
+ "resolutions": {
71
+ "conventional-changelog-conventionalcommits": "^9.1.0"
72
+ }
83
73
  }
package/dist/types.d.ts CHANGED
@@ -1,99 +1,100 @@
1
- /**
2
- * Configuration for automated click tracking
3
- */
4
- export interface AutoTrackClicksConfig {
5
- enabled?: boolean;
6
- selectors?: string[];
7
- ignore?: string[];
8
- }
9
- export interface Config {
10
- apiKey: string;
11
- debug?: boolean;
12
- testENV?: boolean;
13
- debugURL?: string;
14
- autoTrackClicks?: boolean | AutoTrackClicksConfig;
15
- }
16
- /**
17
- * Click event data payload
18
- */
19
- export interface ClickEventMetadata {
20
- elementType?: string;
21
- text?: string;
22
- href?: string | null;
23
- meta?: Record<string, string>;
24
- }
25
- export interface SDK {
26
- init: (config: Config) => Promise<LuciaSDKClass>;
27
- userInfo: (user: string, userInfo: object) => Promise<void>;
28
- pageView: (page: string) => Promise<void>;
29
- trackConversion: (eventTag: string, amount: number, eventDetails: object) => Promise<void>;
30
- buttonClick: (button: string, metadata?: ClickEventMetadata) => Promise<void>;
31
- sendWalletInfo: (walletAddress: string, chainId: number | string, walletName?: 'Metamask' | 'Phantom') => Promise<void>;
32
- trackUserAcquisition: (userId: string, acquisitionData?: object) => Promise<void>;
33
- checkMetaMaskConnection: () => boolean;
34
- VERSION: string;
35
- }
36
- export interface LuciaSDKClass extends Omit<SDK, 'init' | 'VERSION'> {
37
- init: () => void;
38
- }
39
- /**
40
- * Utility function to safely access properties that might throw exceptions
41
- */
42
- export interface SafeAccess {
43
- <T>(fn: () => T): T | undefined;
44
- <T>(fn: () => T, fallback: T): T;
45
- }
46
- /**
47
- * Browser data object returned by getBrowserData()
48
- */
49
- export interface BrowserData {
50
- device: {
51
- cores?: number;
52
- memory?: number;
53
- cpuClass?: string;
54
- touch: boolean;
55
- devicePixelRatio?: number;
56
- };
57
- screen: {
58
- width?: number;
59
- height?: number;
60
- colorDepth?: number;
61
- availHeight?: number;
62
- availWidth?: number;
63
- orientation: {
64
- type?: string;
65
- angle?: number;
66
- };
67
- };
68
- browser: {
69
- language?: string;
70
- encoding?: string;
71
- timezone?: number;
72
- pluginsLength?: number;
73
- pluginNames?: string[];
74
- applePayAvailable?: boolean;
75
- uniqueHash?: string;
76
- colorGamut: string[];
77
- contrastPreference?: string;
78
- };
79
- permissions: {
80
- navPer?: any;
81
- renderedPer?: any;
82
- geoPer?: any;
83
- };
84
- storage: {
85
- localStorage?: boolean;
86
- indexedDB?: boolean;
87
- openDB?: any;
88
- };
89
- }
90
- /**
91
- * Wallet data object returned by getWalletData()
92
- */
93
- export interface WalletData {
94
- providerInfo?: any;
95
- walletAddress?: string | null;
96
- solanaAddress?: string | null;
97
- walletName?: string | null;
98
- solWalletName?: string | null;
99
- }
1
+ export interface LuciaSDKInstance extends Omit<SDK, 'init' | 'VERSION'> {
2
+ init: () => Promise<void>;
3
+ destroy: () => void;
4
+ }
5
+ /**
6
+ * Configuration for automated click tracking
7
+ */
8
+ export interface AutoTrackClicksConfig {
9
+ enabled?: boolean;
10
+ selectors?: string[];
11
+ ignore?: string[];
12
+ }
13
+ export interface Config {
14
+ apiKey: string;
15
+ debug?: boolean;
16
+ testENV?: boolean;
17
+ debugURL?: string;
18
+ autoTrackClicks?: boolean | AutoTrackClicksConfig;
19
+ }
20
+ /**
21
+ * Click event data payload
22
+ */
23
+ export interface ClickEventMetadata {
24
+ elementType?: string;
25
+ text?: string;
26
+ href?: string | null;
27
+ meta?: Record<string, string>;
28
+ }
29
+ export interface SDK {
30
+ init: (config: Config) => Promise<LuciaSDKInstance>;
31
+ userInfo: (user: string, userInfo: object) => Promise<void>;
32
+ pageView: (page: string) => Promise<void>;
33
+ trackConversion: (eventTag: string, amount: number, eventDetails: object) => Promise<void>;
34
+ buttonClick: (button: string, metadata?: ClickEventMetadata) => Promise<void>;
35
+ sendWalletInfo: (walletAddress: string, chainId: number | string, walletName?: 'Metamask' | 'Phantom') => Promise<void>;
36
+ trackUserAcquisition: (userId: string, acquisitionData?: object) => Promise<void>;
37
+ checkMetaMaskConnection: () => boolean;
38
+ VERSION: string;
39
+ }
40
+ /**
41
+ * Utility function to safely access properties that might throw exceptions
42
+ */
43
+ export interface SafeAccess {
44
+ <T>(fn: () => T): T | undefined;
45
+ <T>(fn: () => T, fallback: T): T;
46
+ }
47
+ /**
48
+ * Browser data object returned by getBrowserData()
49
+ */
50
+ export interface BrowserData {
51
+ device: {
52
+ cores?: number;
53
+ memory?: number;
54
+ cpuClass?: string;
55
+ touch: boolean;
56
+ devicePixelRatio?: number;
57
+ };
58
+ screen: {
59
+ width?: number;
60
+ height?: number;
61
+ colorDepth?: number;
62
+ availHeight?: number;
63
+ availWidth?: number;
64
+ orientation: {
65
+ type?: string;
66
+ angle?: number;
67
+ };
68
+ };
69
+ browser: {
70
+ language?: string;
71
+ encoding?: string;
72
+ timezone?: number;
73
+ pluginsLength?: number;
74
+ pluginNames?: string[];
75
+ applePayAvailable?: boolean;
76
+ uniqueHash?: string;
77
+ colorGamut: string[];
78
+ contrastPreference?: string;
79
+ };
80
+ permissions: {
81
+ navPer?: any;
82
+ renderedPer?: any;
83
+ geoPer?: any;
84
+ };
85
+ storage: {
86
+ localStorage?: boolean;
87
+ indexedDB?: boolean;
88
+ openDB?: any;
89
+ };
90
+ }
91
+ /**
92
+ * Wallet data object returned by getWalletData()
93
+ */
94
+ export interface WalletData {
95
+ providerInfo?: any;
96
+ walletAddress?: string | null;
97
+ solanaAddress?: string | null;
98
+ walletName?: string | null;
99
+ solWalletName?: string | null;
100
+ }
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).LuciaSDK={})}(this,function(e){"use strict";var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},t(e,n)};var n=function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};function r(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}u((r=r.apply(e,t||[])).next())})}function i(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function o(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var a=function(){function e(e){this.store=e}return e.prototype.log=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];(null===(t=this.store.config)||void 0===t?void 0:t.debug)&&console[e](n)},e}(),s="0.9.2",u=function(){function e(e){this.requestQueue=[],this.isProcessingQueue=!1,this.initComplete=!1,this.store=e,this.baseURL=this.getBaseURL(),this.logger=new a(this.store)}return e.prototype.getBaseURL=function(){var e=this.store.config;return(null==e?void 0:e.debugURL)?e.debugURL:(null==e?void 0:e.testENV)?"http://52.22.177.60/fk":"https://api.clickinsights.xyz"},e.prototype.get=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:if(!this.store.config)return this.logger.log("error","Config is not set"),[2,null];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,fetch("".concat(this.baseURL).concat(e),{method:"GET",headers:{"Content-Type":"application/json","X-API-KEY":this.store.config.apiKey,"SDK-VERSION":s}})];case 2:return[4,n.sent().json()];case 3:return[2,n.sent()];case 4:return t=n.sent(),this.logger.log("error",t),[3,5];case 5:return[2,null]}})})},e.prototype.post=function(e,t){return r(this,arguments,void 0,function(e,t,n){var r,o,a=this;return void 0===n&&(n=!0),i(this,function(i){switch(i.label){case 0:return this.store.config?(r="/api/sdk/init"===e)||this.initComplete?r?[4,this.executePost(e,t,n)]:[3,3]:[2,new Promise(function(i,o){a.requestQueue.push({url:e,data:t,fireAndForget:n,resolve:i,reject:o,isInit:r}),a.processQueue()})]:(this.logger.log("error","Config is not set"),[2,null]);case 1:return o=i.sent(),this.initComplete=!0,[4,this.processQueue()];case 2:return i.sent(),[2,o];case 3:return[2,this.executePost(e,t,n)]}})})},e.prototype.processQueue=function(){return r(this,void 0,void 0,function(){var e,t=this;return i(this,function(n){switch(n.label){case 0:if(this.isProcessingQueue||!this.initComplete||0===this.requestQueue.length)return[2];this.isProcessingQueue=!0,n.label=1;case 1:return n.trys.push([1,,3,4]),e=function(){return r(t,void 0,void 0,function(){var t,n,r;return i(this,function(i){switch(i.label){case 0:if(0===this.requestQueue.length)return[2];t=this.requestQueue.shift(),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.executePost(t.url,t.data,t.fireAndForget)];case 2:return n=i.sent(),t.resolve(n),[3,4];case 3:return r=i.sent(),t.reject(r),[3,4];case 4:return[4,e()];case 5:return i.sent(),[2]}})})},[4,e()];case 2:return n.sent(),[3,4];case 3:return this.isProcessingQueue=!1,[7];case 4:return[2]}})})},e.prototype.executePost=function(e,t){return r(this,arguments,void 0,function(e,t,r){var o,a,u,c,l;return void 0===r&&(r=!0),i(this,function(i){switch(i.label){case 0:if(!this.store.config)return this.logger.log("error","Config is not set"),[2,null];if(r&&"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon){try{o="".concat(this.baseURL).concat(e),a=t&&"object"==typeof t&&!Array.isArray(t)?t:{payload:t},u=JSON.stringify(n(n({},a),{_apiKey:this.store.config.apiKey})),c=new Blob([u],{type:"application/json"}),navigator.sendBeacon(o,c)||this.logger.log("error","sendBeacon failed")}catch(e){this.logger.log("error",e)}return[2,null]}i.label=1;case 1:return i.trys.push([1,4,,5]),[4,fetch("".concat(this.baseURL).concat(e),{method:"POST",headers:{"Content-Type":"application/json","X-API-KEY":this.store.config.apiKey,"SDK-VERSION":s},body:JSON.stringify(t)})];case 2:return[4,i.sent().json()];case 3:return[2,i.sent()];case 4:return l=i.sent(),this.logger.log("error",l),[3,5];case 5:return[2,null]}})})},e}(),c={isInitialized:!1,config:null,session:null},l=function(){function e(){}return e.dispatch=function(t){Object.keys(t).forEach(function(r){if(Object.keys(e.store).includes(r)){var i=t[r];e.store[r]="object"==typeof i?Array.isArray(i)?o([],i,!0):n({},i):i}})},e.store=c,e}(),d=function(e){this.store=l.store,this.dispatch=l.dispatch,this.dispatch({config:e}),this.httpClient=new u(this.store),this.logger=new a(this.store)},h=['input[type="password"]','input[type="text"][autocomplete*="cc-"]','input[type="text"][autocomplete*="card"]','input[type="text"][name*="card"]','input[type="text"][name*="cvv"]','input[type="text"][name*="cvc"]','input[name*="ssn"]','input[name*="social"]',"[data-sensitive]","[data-private]"],f=[/\b\d{3}-\d{2}-\d{4}\b/,/\b\d{4}[\s-]\d{4}[\s-]\d{4}[\s-]\d{4}\b/,/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/i],p=new(function(){function e(e){void 0===e&&(e=[]),this.sensitiveSelectors=o(o([],h,!0),e,!0)}return e.prototype.isSensitive=function(e){if(this.sensitiveSelectors.some(function(t){try{return e.matches(t)}catch(e){return!1}}))return!0;for(var t=e.parentElement,n=function(){var e=t;if(r.sensitiveSelectors.some(function(t){try{return e.matches(t)}catch(e){return!1}}))return{value:!0};t=t.parentElement},r=this;t;){var i=n();if("object"==typeof i)return i.value}return!1},e.prototype.containsSensitiveData=function(e){return!!e&&f.some(function(t){return t.test(e)})},e.prototype.sanitizeText=function(e){if(!e)return"";var t=e;return t=(t=(t=t.replace(/\b\d{3}-\d{2}-\d{4}\b/g,"***-**-****")).replace(/\b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}\b/g,"****-****-****-****")).replace(/\b([A-Z0-9._%+-]+)@([A-Z0-9.-]+\.[A-Z]{2,})\b/gi,"***@$2")},e}()),g=["button","a[href]",'[role="button"]'],w=["[data-lucia-ignore]",'[data-lucia-track="false"]'],v=function(){function e(e,t,n,r){var i,o,a;this.debounceTimers=new Map,this.listenerAttached=!1,this.boundHandleClick=null,this.sdkConfig=e,this.config={enabled:null===(i=t.enabled)||void 0===i||i,selectors:null!==(o=t.selectors)&&void 0!==o?o:g,ignore:null!==(a=t.ignore)&&void 0!==a?a:w},this.trackingCallback=n,this.logger=r,this.privacyGuard=p,this.config.enabled&&this.attachListener()}return e.prototype.attachListener=function(){this.listenerAttached||("undefined"!=typeof document?(this.boundHandleClick=this.handleClick.bind(this),document.addEventListener("click",this.boundHandleClick,{passive:!0,capture:!1}),this.listenerAttached=!0,this.logger.log("log","ClickTracker: Delegated click listener attached")):this.logger.log("warn","ClickTracker: document not available, cannot attach listener"))},e.prototype.handleClick=function(e){if(this.config.enabled){var t=e.target;if(t){var n=this.findTrackableElement(t);if(n)if(this.shouldIgnore(n))this.logger.log("log","ClickTracker: Element ignored",n);else if(this.privacyGuard.isSensitive(n))this.logger.log("warn","ClickTracker: Sensitive element not tracked",n);else if(this.isDebounced(n))this.logger.log("log","ClickTracker: Click debounced",n);else{var r=this.extractTrackingData(n);r&&(this.logger.log("log","ClickTracker: Tracking click",r),this.trackingCallback(r))}}}},e.prototype.findTrackableElement=function(e){var t=this.config.selectors||g;try{var n=e.closest('[data-lucia-track]:not([data-lucia-track="false"])');if(n&&n!==document.body&&document.body.contains(n))return this.config.selectors&&this.config.selectors!==g?t.some(function(e){try{return n.matches(e)}catch(e){return!1}})?n:null:n;var r=t.join(", "),i=e.closest(r);return i&&i!==document.body&&document.body.contains(i)?i:null}catch(t){this.logger.log("warn","ClickTracker: Invalid combined selector, using fallback",t);for(var o=e;o&&o!==document.body;){if(this.isTrackable(o))return o;o=o.parentElement}return null}},e.prototype.isTrackable=function(e){var t=this;return(this.config.selectors||g).some(function(n){try{return e.matches(n)}catch(e){return t.logger.log("warn",'ClickTracker: Invalid selector "'.concat(n,'"'),e),!1}})},e.prototype.shouldIgnore=function(e){var t=this;return(this.config.ignore||w).some(function(n){try{return e.matches(n)}catch(e){return t.logger.log("warn",'ClickTracker: Invalid ignore selector "'.concat(n,'"'),e),!1}})},e.prototype.isDebounced=function(e){var t=Date.now(),n=this.debounceTimers.get(e);return!!(n&&t-n<500)||(this.debounceTimers.set(e,t),this.debounceTimers.size>100&&this.cleanupDebounceTimers(),!1)},e.prototype.cleanupDebounceTimers=function(){var e=this,t=Date.now();Array.from(this.debounceTimers.entries()).forEach(function(n){var r=n[0],i=n[1];t-i>1e3&&e.debounceTimers.delete(r)})},e.prototype.extractTrackingData=function(e){var t,n=this.getElementIdentifier(e);if(!n)return this.logger.log("warn","ClickTracker: Could not generate identifier for element",e),null;var r={button:n,elementType:this.getElementType(e),timestamp:Date.now()},i=null===(t=e.textContent)||void 0===t?void 0:t.trim();i&&(this.privacyGuard.containsSensitiveData(i)||(r.text=this.sanitizeText(i))),"a"===e.tagName.toLowerCase()?r.href=e.getAttribute("href"):r.href=null;var o=this.extractMetadata(e);return o&&Object.keys(o).length>0&&(r.meta=o),r},e.prototype.getElementIdentifier=function(e){var t,n=e.getAttribute("data-lucia-track");if(n&&"false"!==n)return n;var r=e.getAttribute("id");if(r)return r;var i=e.getAttribute("name");if(i)return i;var o=e.getAttribute("aria-label");if(o)return o;if("a"===e.tagName.toLowerCase()){var a=e.getAttribute("href");if(a)return"link:".concat(a)}var s=null===(t=e.textContent)||void 0===t?void 0:t.trim();if(s)return this.sdkConfig.debug&&this.logger.log("warn","ClickTracker: Using text content as identifier for element. Consider adding data-lucia-track attribute.",e),"text:".concat(this.sanitizeText(s).substring(0,50));var u=this.generateCSSPath(e);return this.sdkConfig.debug&&this.logger.log("warn","ClickTracker: Using CSS path as identifier. Consider adding data-lucia-track attribute.",e),"path:".concat(u)},e.prototype.getElementType=function(e){var t=e.tagName.toLowerCase();if("a"===t)return"link";if("button"===t)return"button";var n=e.getAttribute("role");return n||t},e.prototype.sanitizeText=function(e){return e.trim().replace(/\s+/g," ").substring(0,100)},e.prototype.generateCSSPath=function(e){for(var t=[],n=e;n&&n!==document.body&&t.length<5;){var r=n.tagName.toLowerCase();if(n.id){r+="#".concat(n.id),t.unshift(r);break}var i=n.getAttribute("class");if(i){var o=i.trim().split(/\s+/).slice(0,2);o.length>0&&(r+=".".concat(o.join(".")))}t.unshift(r),n=n.parentElement}return t.join(" > ")},e.prototype.extractMetadata=function(e){var t={},n=e.attributes;return Array.from(n).forEach(function(e){if(e.name.startsWith("data-lucia-meta-")){var n=e.name.replace("data-lucia-meta-","").replace(/-([a-z])/g,function(e){return e[1].toUpperCase()});t[n]=e.value}}),Object.keys(t).length>0?t:null},e.prototype.enable=function(){this.config.enabled||(this.config.enabled=!0,this.attachListener(),this.logger.log("log","ClickTracker: Enabled"))},e.prototype.disable=function(){this.config.enabled=!1,this.logger.log("log","ClickTracker: Disabled")},e.prototype.destroy=function(){this.listenerAttached&&this.boundHandleClick&&"undefined"!=typeof document&&(document.removeEventListener("click",this.boundHandleClick),this.listenerAttached=!1),this.debounceTimers.clear(),this.boundHandleClick=null,this.logger.log("log","ClickTracker: Destroyed")},e}(),m=new a(l.store);function y(){return r(this,void 0,void 0,function(){var e,t,n;return i(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),(null==(e=window.ethereum)?void 0:e.request)?[4,e.request({method:"eth_accounts"})]:[2,null];case 1:return(t=r.sent())&&t.length>0?[2,t[0]]:[2,null];case 2:return n=r.sent(),m.log("error","Error checking connected wallet:",n),[2,null];case 3:return[2]}})})}function b(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),window.ethereum?window.ethereum.isMetaMask?[2,"MetaMask"]:window.ethereum.request?[4,window.ethereum.request({method:"wallet_getName"})]:[2,null]:[2,null];case 1:return[2,t.sent()||null];case 2:return e=t.sent(),m.log("error","Error getting wallet name:",e),[2,null];case 3:return[2]}})})}function k(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){return window.ethereum?(e={isMetaMask:!!window.ethereum.isMetaMask,isCoinbaseWallet:!!window.ethereum.isCoinbaseWallet||!!window.ethereum.isCoinbase,isWalletConnect:!!window.ethereum.isWalletConnect,isTrust:!!window.ethereum.isTrust||!!window.ethereum.isTrustWallet,isImToken:!!window.ethereum.isImToken,isBraveWallet:!!window.ethereum.isBraveWallet,isTokenPocket:!!window.ethereum.isTokenPocket,isStatus:!!window.ethereum.isStatus,isTally:!(!window.ethereum.isTally&&!window.ethereum.isTallyWallet),isAlphaWallet:!!window.ethereum.isAlphaWallet,isOpera:!!window.ethereum.isOpera,isCoin98:!!window.ethereum.isCoin98,isMathWallet:!!window.ethereum.isMathWallet,isOneInch:!(!window.ethereum.isOneInchIOSWallet&&!window.ethereum.isOneInchAndroidWallet),isRainbow:!!window.ethereum.isRainbow,isBinanceChainWallet:!1,isFrame:!!window.ethereum.isFrame,userAgent:window.navigator.userAgent,chainId:window.ethereum.chainId||void 0,networkVersion:window.ethereum.networkVersion||void 0,name:""},Object.values(e).some(Boolean)||(Object.prototype.hasOwnProperty.call(window.ethereum,"_metamask")&&(e.isMetaMask=!0),window.BinanceChain&&(e.isBinanceChainWallet=!0),window.ethereum.isFrame&&(e.isFrame=!0),"function"==typeof window.ethereum.request&&void 0===window.ethereum._metamask&&(e.isPossiblyGenericInjectedProvider=!0)),e.name=function(e){if(e.isMetaMask)return"MetaMask";if(e.isCoinbaseWallet)return"Coinbase Wallet";if(e.isWalletConnect)return"WalletConnect";if(e.isTrust)return"Trust Wallet";if(e.isImToken)return"imToken";if(e.isBraveWallet)return"Brave Wallet";if(e.isTokenPocket)return"TokenPocket";if(e.isStatus)return"Status";if(e.isTally)return"Tally";if(e.isAlphaWallet)return"AlphaWallet";if(e.isOpera)return"Opera";if(e.isCoin98)return"Coin98";if(e.isMathWallet)return"MathWallet";if(e.isOneInch)return"1inch Wallet";if(e.isRainbow)return"Rainbow";if(e.isBinanceChainWallet)return"Binance Chain Wallet";if(e.isFrame)return"Frame";var t=e.userAgent.toLowerCase();return t.includes("trust")?"Trust Wallet (UA)":t.includes("rainbow")?"Rainbow (UA)":"Unknown Provider"}(e),[2,e]):[2,null]})})}var C=new a(l.store);function T(){return r(this,void 0,void 0,function(){var e,t,n,r,o,a,s;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,7,,8]),window.solana?window.solana.isConnected&&window.solana.publicKey?[2,window.solana.publicKey.toString()]:[3,6]:[3,1];case 1:return window.solflare?window.solflare.isConnected&&window.solflare.publicKey?[2,window.solflare.publicKey.toString()]:[3,6]:[3,2];case 2:if(!(null===(o=window.phantom)||void 0===o?void 0:o.solana))return[3,6];i.label=3;case 3:return i.trys.push([3,5,,6]),[4,window.phantom.solana.connect({onlyIfTrusted:!0})];case 4:return i.sent()&&window.phantom.solana.publicKey?[2,window.phantom.solana.publicKey.toString()]:[3,6];case 5:return e=i.sent(),C.log("error","Error silently connecting to Phantom wallet:",e),[3,6];case 6:return t=[],(null===(a=window.walletAdapterNetwork)||void 0===a?void 0:a.adapters)&&t.push.apply(t,window.walletAdapterNetwork.adapters),(null===(s=window.SolanaWalletAdapterContext)||void 0===s?void 0:s.current)&&t.push(window.SolanaWalletAdapterContext.current),(n=t.find(function(e){return e.connected&&e.publicKey}))?[2,n.publicKey.toString()]:[2,null];case 7:return r=i.sent(),C.log("error","Error detecting Solana wallet:",r),[2,null];case 8:return[2]}})})}function A(){return r(this,void 0,void 0,function(){var e,t,n,r,o,a;return i(this,function(i){switch(i.label){case 0:return[4,T()];case 1:return(e=i.sent())?(null===(r=window.phantom)||void 0===r?void 0:r.solana)?[2,"Phantom"]:window.solflare?[2,"Solflare"]:(t=[],(null===(o=window.walletAdapterNetwork)||void 0===o?void 0:o.adapters)&&t.push.apply(t,window.walletAdapterNetwork.adapters),(null===(a=window.SolanaWalletAdapterContext)||void 0===a?void 0:a.current)&&t.push(window.SolanaWalletAdapterContext.current),(n=t.find(function(t){return t.connected&&t.publicKey&&t.publicKey.toString()===e}))?[2,n.name||"Unknown Wallet"]:[2,null]):[2,null]}})})}function S(){return r(this,void 0,void 0,function(){var e,t,n,r,o,a,s;return i(this,function(i){switch(i.label){case 0:return W?[2,W]:(e={cores:x(function(){return navigator.hardwareConcurrency}),memory:x(function(){return navigator.deviceMemory}),cpuClass:x(function(){return navigator.cpuClass}),touch:j(),devicePixelRatio:x(function(){return window.devicePixelRatio})},t={width:x(function(){return window.screen.width}),height:x(function(){return window.screen.height}),colorDepth:x(function(){return window.screen.colorDepth}),availHeight:x(function(){return window.screen.availHeight}),availWidth:x(function(){return window.screen.availWidth}),orientation:{type:x(function(){return window.screen.orientation.type}),angle:x(function(){return window.screen.orientation.angle})}},s={language:x(function(){return navigator.language}),encoding:x(function(){return TextDecoder.encoding}),timezone:x(function(){return-(new Date).getTimezoneOffset()/60}),pluginsLength:x(function(){return navigator.plugins.length}),pluginNames:x(function(){return Array.from(navigator.plugins,function(e){return e.name})}),applePayAvailable:_()},[4,O()]);case 1:return s.uniqueHash=i.sent(),s.colorGamut=U(),s.contrastPreference=M(),n=s,r={navPer:x(function(){return navigator.permissions.webglVersion}),renderedPer:x(function(){return navigator.permissions.RENDERER}),geoPer:x(function(){return navigator.permissions.geolocation})},o={localStorage:x(function(){return!!window.localStorage}),indexedDB:x(function(){return!!window.indexedDB}),openDB:x(function(){return window.openDatabase})},W=a={device:e,screen:t,browser:n,permissions:r,storage:o},[2,a]}})})}function I(){return r(this,void 0,void 0,function(){var e,t,n,r,o,a;return i(this,function(i){switch(i.label){case 0:return[4,Promise.all([T(),y(),b(),A(),k()])];case 1:return e=i.sent(),t=e[0],n=e[1],r=e[2],o=e[3],a=e[4],[2,{walletAddress:n,solanaAddress:t,providerInfo:a&&E(a),walletName:r,solWalletName:o}]}})})}function P(){var e=new URL(window.location.href).searchParams,t={};return e.forEach(function(e,n){(n.startsWith("utm_")||n.includes("id")||"ref"===n||"source"===n)&&(t[n]=e)}),t}function x(e,t){try{return e()}catch(e){return t}}function E(e){var t={};return Object.keys(e).forEach(function(n){var r=n;e[r]&&(t[r]=e[r])}),t}function D(e){return r(this,void 0,void 0,function(){var t,n,r;return i(this,function(i){switch(i.label){case 0:return t=new TextEncoder,n=t.encode(e),[4,crypto.subtle.digest("SHA-256",n)];case 1:return r=i.sent(),[2,Array.from(new Uint8Array(r)).map(function(e){return e.toString(16).padStart(2,"0")}).join("")]}})})}var W=null;function O(){return r(this,void 0,void 0,function(){var e,t,n,r,o,a;return i(this,function(i){try{return e=document.createElement("canvas"),(t=e.getContext("2d",{willReadFrequently:!0}))?(n=200,r=120,e.width=n,e.height=r,e.style.width="".concat(n,"px"),e.style.height="".concat(r,"px"),t.fillStyle="#ffffff",t.fillRect(0,0,n,r),t.fillStyle="#ff00ff",t.fillRect(10,10,100,100),t.fillStyle="#00ffff",t.beginPath(),t.arc(150,50,40,0,2*Math.PI,!0),t.fill(),o=t.getImageData(0,0,n,r).data,a=[[20,20],[60,60],[100,100],[150,50],[150,60],[140,50],[5,5]].map(function(e){var t=e[0],r=4*(e[1]*n+t);return"".concat(o[r],",").concat(o[r+1],",").concat(o[r+2],",").concat(o[r+3],";")}).join(""),[2,D(a)]):[2,void 0]}catch(e){return[2,void 0]}return[2]})})}function j(){try{return!!document.createEvent("TouchEvent")}catch(e){return!1}}function _(){var e;try{return"function"==typeof(null===(e=window.ApplePaySession)||void 0===e?void 0:e.canMakePayments)&&window.ApplePaySession.canMakePayments()}catch(e){return}}function M(){try{var e=window.matchMedia,t=function(t){return e("(prefers-contrast: ".concat(t,")")).matches};return t("no-preference")?"None":t("high")||t("more")?"More":t("low")||t("less")?"Less":t("forced")?"ForcedColors":void 0}catch(e){return}}function U(){try{return["rec2020","p3","srgb","display-p3","adobe-rgb"].filter(function(e){return window.matchMedia("(color-gamut: ".concat(e,")")).matches})}catch(e){return[]}}const L=[];for(let e=0;e<256;++e)L.push((e+256).toString(16).slice(1));let R;const K=new Uint8Array(16);var N={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function B(e,t,n){if(N.randomUUID&&!e)return N.randomUUID();const r=(e=e||{}).random??e.rng?.()??function(){if(!R){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");R=crypto.getRandomValues.bind(crypto)}return R(K)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return(L[e[t+0]]+L[e[t+1]]+L[e[t+2]]+L[e[t+3]]+"-"+L[e[t+4]]+L[e[t+5]]+"-"+L[e[t+6]]+L[e[t+7]]+"-"+L[e[t+8]]+L[e[t+9]]+"-"+L[e[t+10]]+L[e[t+11]]+L[e[t+12]]+L[e[t+13]]+L[e[t+14]]+L[e[t+15]]).toLowerCase()}(r)}var q="luci_session",V=new a(l.store);function z(){try{var e=sessionStorage.getItem(q);return e?JSON.parse(e):null}catch(e){return V.log("error","Error retrieving session data:",e),null}}function Q(){var e={id:B(),timestamp:Date.now()};return sessionStorage.setItem(q,JSON.stringify(e)),e}function F(){var e=localStorage.getItem("lid");return"undefined"===e||"null"===e?(localStorage.removeItem("lid"),null):e}function H(){var e=localStorage.getItem("luc_uid");return"undefined"===e||"null"===e?(localStorage.removeItem("luc_uid"),null):e}var G=function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.clickTracker=null,t}return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(o,e),o.prototype.authenticate=function(){this.httpClient.post("/api/key/auth",{})},o.prototype.init=function(){return r(this,void 0,void 0,function(){var e,t,n,r,o,a,s;return i(this,function(i){switch(i.label){case 0:return(e=z())||(e=Q()),[4,S()];case 1:return t=i.sent(),n=new URL(window.location.href),r=n.searchParams.get("lucia"),[4,I()];case 2:return o=i.sent(),a={id:e.id},e.hash&&(a.hash=e.hash),[4,this.httpClient.post("/api/sdk/init",{user:{name:H()},data:t,walletData:o,session:a,redirectHash:r,utm:P()},!1)];case 3:return(s=i.sent())&&(s.lid&&localStorage.setItem("lid",s.lid),s.session&&(u=s.session,c={id:u.id,hash:u.hash,timestamp:Date.now()},sessionStorage.setItem(q,JSON.stringify(c)))),this.initAutoTracking(),[2]}var u,c})})},o.prototype.initAutoTracking=function(){var e;this.clickTracker&&(this.clickTracker.destroy(),this.clickTracker=null);var t,n=null===(e=this.store.config)||void 0===e?void 0:e.autoTrackClicks;n&&(!1!==(t="boolean"==typeof n?{enabled:n}:n).enabled&&(this.clickTracker=new v(this.store.config,t,this.handleAutoTrackedClick.bind(this),this.logger),this.logger.log("log","Auto-tracking initialized",t)))},o.prototype.handleAutoTrackedClick=function(e){var t={elementType:e.elementType,text:e.text,href:e.href,meta:e.meta};this.buttonClick(e.button,t)},o.prototype.userInfo=function(e,t){return r(this,void 0,void 0,function(){var n,r,o;return i(this,function(i){switch(i.label){case 0:return n=F(),r=z(),e&&localStorage.setItem("luc_uid",e),o={user:{name:e,userInfo:t},session:r},n&&(o.lid=n),[4,this.httpClient.post("/api/sdk/user",o)];case 1:return i.sent(),[2]}})})},o.prototype.pageView=function(e){return r(this,void 0,void 0,function(){var t,n,r;return i(this,function(i){switch(i.label){case 0:return t=F(),n=z(),r={page:e,user:{name:H()},session:n},t&&(r.lid=t),[4,this.httpClient.post("/api/sdk/page",r)];case 1:return i.sent(),[2]}})})},o.prototype.trackConversion=function(e,t,n){return r(this,void 0,void 0,function(){var r,o,a;return i(this,function(i){switch(i.label){case 0:return r=F(),o=z(),a={tag:e,amount:t,event:n,user:{name:H()},session:o},r&&(a.lid=r),[4,this.httpClient.post("/api/sdk/conversion",a)];case 1:return i.sent(),[2]}})})},o.prototype.buttonClick=function(e,t){return r(this,void 0,void 0,function(){var n,r,o;return i(this,function(i){switch(i.label){case 0:return n=F(),r=z(),o={button:e,user:{name:H()},session:r},n&&(o.lid=n),t&&(t.elementType&&(o.elementType=t.elementType),t.text&&(o.text=t.text),void 0!==t.href&&(o.href=t.href),t.meta&&(o.meta=t.meta),o.timestamp=Date.now()),[4,this.httpClient.post("/api/sdk/click",o)];case 1:return i.sent(),[2]}})})},o.prototype.sendWalletInfo=function(e,t,n){return r(this,void 0,void 0,function(){var r,o,a;return i(this,function(i){switch(i.label){case 0:return r=F(),o=z(),a={walletAddress:e,chainId:t,walletName:n,user:{name:H()},session:o},r&&(a.lid=r),[4,this.httpClient.post("/api/sdk/wallet",a)];case 1:return i.sent(),[2]}})})},o.prototype.trackUserAcquisition=function(e){return r(this,arguments,void 0,function(e,t){var r,o,a;return void 0===t&&(t={}),i(this,function(i){switch(i.label){case 0:return[4,S()];case 1:return r=i.sent(),o=P(),a=z(),[4,this.httpClient.post("/api/sdk/acquisition",{user:{name:e},session:a,data:n({timestamp:(new Date).toISOString(),browserData:r,utmParams:o},t)})];case 2:return i.sent(),[2]}})})},o.prototype.checkMetaMaskConnection=function(){var e,t,n;return!(!(null===(t=null===(e=window.ethereum)||void 0===e?void 0:e.isConnected)||void 0===t?void 0:t.call(e))||!(null===(n=window.ethereum)||void 0===n?void 0:n.selectedAddress))},o.prototype.destroy=function(){this.clickTracker&&(this.clickTracker.destroy(),this.clickTracker=null)},o}(d),Z=null,J=function(){var e=Z||"undefined"!=typeof window&&window.__luciaInitPromise;if(!e)throw new Error("LuciaSDK not initialized. Please call LuciaSDK.init() first");return e},X={init:function(e){if("undefined"==typeof window)return Promise.reject(new Error("LuciaSDK requires a browser environment"));if(Z)return Z;if(window.__luciaInitPromise)return Z=window.__luciaInitPromise;if(!(null==e?void 0:e.apiKey))return Promise.reject(new Error("apiKey is required in config"));var t=r(void 0,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return[4,(t=new G(e)).init()];case 1:return n.sent(),[2,t]}})});return Z=t,window.__luciaInitPromise=t,t},userInfo:function(e,t){return r(void 0,void 0,void 0,function(){return i(this,function(n){switch(n.label){case 0:return[4,J()];case 1:return[2,n.sent().userInfo(e,t)]}})})},pageView:function(e){return r(void 0,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,J()];case 1:return[2,t.sent().pageView(e)]}})})},trackConversion:function(e,t,n){return r(void 0,void 0,void 0,function(){return i(this,function(r){switch(r.label){case 0:return[4,J()];case 1:return[2,r.sent().trackConversion(e,t,n)]}})})},buttonClick:function(e,t){return r(void 0,void 0,void 0,function(){return i(this,function(n){switch(n.label){case 0:return[4,J()];case 1:return[2,n.sent().buttonClick(e,t)]}})})},sendWalletInfo:function(e,t,n){return r(void 0,void 0,void 0,function(){return i(this,function(r){switch(r.label){case 0:return[4,J()];case 1:return[2,r.sent().sendWalletInfo(e,t,n)]}})})},trackUserAcquisition:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return r(void 0,o([e],t,!0),void 0,function(e,t){return void 0===t&&(t={}),i(this,function(n){switch(n.label){case 0:return[4,J()];case 1:return[2,n.sent().trackUserAcquisition(e,t)]}})})},checkMetaMaskConnection:function(){var e,t,n;return!(!(null===(t=null===(e=window.ethereum)||void 0===e?void 0:e.isConnected)||void 0===t?void 0:t.call(e))||!(null===(n=window.ethereum)||void 0===n?void 0:n.selectedAddress))},VERSION:s};if("undefined"!=typeof window){window.LuciaSDK=X;var Y=function(){var e=document.currentScript||document.querySelector("script[data-api-key]"),t=null==e?void 0:e.getAttribute("data-api-key");if(t){var r=e.getAttribute("data-debug-url"),i=e.getAttribute("data-auto-track-clicks"),o=e.getAttribute("data-track-selectors");X.init(n(n(n({apiKey:t},r&&{debugURL:r}),"true"===i&&{autoTrackClicks:!o||{enabled:!0,selectors:o.split(",").map(function(e){return e.trim()})}}),"false"===i&&{autoTrackClicks:!1})).catch(function(e){return console.error("LuciaSDK auto-init failed:",e)})}};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Y):Y()}e.__resetInstance=function(){var e=Z||"undefined"!=typeof window&&window.__luciaInitPromise;e&&e.then(function(e){return e.destroy()}).catch(function(){}),Z=null,"undefined"!=typeof window&&delete window.__luciaInitPromise},e.default=X,e.filterObject=E,e.getApplePayAvailable=_,e.getBrowserData=S,e.getCanvasFingerprint=O,e.getColorGamut=U,e.getContrastPreference=M,e.getUtmParams=P,e.getWalletData=I,e.isTouchEnabled=j,e.safeAccess=x,Object.defineProperty(e,"__esModule",{value:!0})});