@epigraph/epigraph-std-lib 5.0.0-alpha.14 → 5.0.0-alpha.16

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 (41) hide show
  1. package/README.md +68 -68
  2. package/dist/Epigraph/epigraph.cjs +1 -1
  3. package/dist/Epigraph/epigraph.js +94 -126
  4. package/dist/Epigraph/epigraphBaseSolutions.cjs +1 -1
  5. package/dist/Epigraph/epigraphBaseSolutions.js +60 -68
  6. package/dist/EpigraphLibs/EpigraphAnalytics/consent-plugins/auto-consent-resolver.d.ts +21 -0
  7. package/dist/EpigraphLibs/EpigraphAnalytics/consent-plugins/one-trust-consent-plugin.d.ts +1 -0
  8. package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.cjs +1 -16
  9. package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.d.ts +14 -5
  10. package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.js +2 -1057
  11. package/dist/EpigraphLibs/EpigraphAnalytics/plugins/ga4-analytics-plugin.d.ts +6 -0
  12. package/dist/EpigraphLibs/EpigraphAnalytics/plugins/nexus-analytics-plugin.d.ts +1 -0
  13. package/dist/EpigraphLibs/EpigraphLogger/epigraphLogger.cjs +1 -1
  14. package/dist/EpigraphLibs/EpigraphLogger/epigraphLogger.js +74 -198
  15. package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.cjs +1 -1
  16. package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.js +197 -425
  17. package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.cjs +1 -7
  18. package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.js +2 -78
  19. package/dist/EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.cjs +1 -1
  20. package/dist/EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.js +24 -26
  21. package/dist/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.cjs +1 -1
  22. package/dist/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.js +2 -88
  23. package/dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.cjs +1 -1
  24. package/dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.js +44 -75
  25. package/dist/enums-BSSe4NAs.js +8 -0
  26. package/dist/enums-PfFMiIoe.cjs +1 -0
  27. package/dist/epigraph-std-lib.cjs +1 -1
  28. package/dist/epigraph-std-lib.js +11 -74
  29. package/dist/epigraphAnalytics-CADAVr-I.cjs +1 -0
  30. package/dist/epigraphAnalytics-Dv5dGbcW.js +851 -0
  31. package/dist/epigraphQrCodeGenerator-BXUNL2XK.js +54 -0
  32. package/dist/epigraphQrCodeGenerator-F2eLrPC_.cjs +7 -0
  33. package/dist/epigraphUnitsConverter-CwpmWl7p.cjs +1 -0
  34. package/dist/epigraphUnitsConverter-DsX4Rmsp.js +66 -0
  35. package/dist/lit--5TUYSGn.js +508 -0
  36. package/dist/lit-DZtv4Pds.cjs +2 -0
  37. package/package.json +40 -40
  38. package/dist/enums-1vqWxJ0i.cjs +0 -1
  39. package/dist/enums-CvOTKyNu.js +0 -5
  40. package/dist/lit-element-C3moVMGu.js +0 -524
  41. package/dist/lit-element-CYaaFRfk.cjs +0 -19
package/README.md CHANGED
@@ -1,68 +1,68 @@
1
- # INTRODUCTION
2
-
3
- Epigraph Standard Library or epigraph-std-lib is a collection of standards that we follow across our solutions. The idea is to have a single source of truth across solutions while ensuring that the dependencies are always up to date with the industry standards.
4
-
5
- ### EPIGRAPH
6
- A global object that must only be initialized once per session and provides some common functionalities across solutions in that session.
7
-
8
- ### EPIGRAPH LIBRARY EXPORTS
9
-
10
- | Name | Description |
11
- |---|---|
12
- | EpigraphBaseSolutionHtmlElement | A base class intended to enforce some common functionalities across our solutions, built by extending the HTMLElement |
13
- | EpigraphBaseSolutionLitElement | A base class intended to enforce some common functionalities across our solutions, built by extending the LitElement |
14
- | EpigraphLogger | A logger class that provides a convenient way for logging info, warning or errors in any given session |
15
- | EpigraphQrCoreGenerator | A Utility class that allows the generation of a QR code from a give string input |
16
- | EpigraphUnitsConverter | |
17
- | EpigraphUrlProcessor | |
18
-
19
-
20
- # HOW TO:
21
-
22
- ### Add a new EpigraphLibrary:
23
- 1. Create a new directory under lib/EpigraphLibs/`<MyEpigraphLibrary>`
24
- 2. Create the module file/s. Ensure that the names of these files are in camelCase.
25
- 3. Write a test for this Library under tests/<MyEpigraphLibrary.test.ts>
26
- 4. Add the module that you wish to export as an entry in vite.config.ts > defineConfig > build > entry, similar to other entries in there. This will bundle the new module on build.
27
- 5. Go to package.json:
28
- - Add the new module entry under exports similar to other entries in that field.
29
- - Add the new module entry under typesVersions similar to other entries in that field.
30
-
31
- ### Use the library
32
- This library exports the module into submodules to allow for better tree shaking when bundling the final product. Here is how you can import the submodules individually.
33
-
34
- ```javascript
35
- // Epigraph Object
36
- import { Epigraph } from "@epigraph/epigraph-std-lib/dist/Epigraph/epigraph";
37
-
38
- // Epigraph libs
39
- import { EpigraphAnalytics } from "@epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphAnalytics";
40
-
41
- ```
42
-
43
- Exported Submodules:
44
- | Name | Description |
45
- |---|---|
46
- | @epigraph/epigraph-std-lib/dist/Epigraph/epigraph | A base class intended to enforce some common functionalities across our solutions, built by extending the HTMLElement |
47
- | @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphAnalytics | An Analytics modules that exports handy ways to log analytics across our solutions |
48
- | @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphLogger | A Logger modules that exports handy ways to log across our solutions |
49
- | @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphNexusApi | A Nexus API modules that exports handy ways to interact with the Nexus API across our solutions |
50
- | @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphQrCodeGenerator | A QR Code generator modules that exports handy ways to generate QR Codes across our solutions |
51
- | @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphResultFactory | A Result Factory modules that exports handy ways to generate Result objects across our solutions |
52
- | @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphUnitsConverter | A Utility class that allows conversion between different standard unit, including but not limited to Distance, Color, etc. |
53
- | @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphUrlProcessor | A Utility class that provides various methods to generate, process, manipulate URLs |
54
-
55
-
56
- ### Write a test:
57
- We use [vitest](https://vitest.dev/guide/) to write tests in this repository using [happy-dom](https://www.npmjs.com/package/happy-dom) to support some but not all browser functionalities. In order to write a new test:
58
-
59
- 1. Create a new file for a specific test under tests/ as `<MyEpigraphLibrary>`.test.ts
60
- 2. Write a test following the instructions and samples [here](https://vitest.dev/guide/#writing-tests)
61
- 3. Make sure to import the library from "../dist/epigraph-std-lib" to avoid any issues that might come up after bundling.
62
- 4. Open a terminal and execute "npm run test". This will build all the libraries under dist/ and then run tests using those.
63
-
64
-
65
- # REFERENCES
66
- A huge thanks to everyone who inspired the setup for this repository:
67
- 1. [Andreas Riedmuller's Article](https://dev.to/receter/how-to-create-a-react-component-library-using-vites-library-mode-4lma)
68
- 2. [Vitest Docs](https://vitest.dev/guide/)
1
+ # INTRODUCTION
2
+
3
+ Epigraph Standard Library or epigraph-std-lib is a collection of standards that we follow across our solutions. The idea is to have a single source of truth across solutions while ensuring that the dependencies are always up to date with the industry standards.
4
+
5
+ ### EPIGRAPH
6
+ A global object that must only be initialized once per session and provides some common functionalities across solutions in that session.
7
+
8
+ ### EPIGRAPH LIBRARY EXPORTS
9
+
10
+ | Name | Description |
11
+ |---|---|
12
+ | EpigraphBaseSolutionHtmlElement | A base class intended to enforce some common functionalities across our solutions, built by extending the HTMLElement |
13
+ | EpigraphBaseSolutionLitElement | A base class intended to enforce some common functionalities across our solutions, built by extending the LitElement |
14
+ | EpigraphLogger | A logger class that provides a convenient way for logging info, warning or errors in any given session |
15
+ | EpigraphQrCoreGenerator | A Utility class that allows the generation of a QR code from a give string input |
16
+ | EpigraphUnitsConverter | |
17
+ | EpigraphUrlProcessor | |
18
+
19
+
20
+ # HOW TO:
21
+
22
+ ### Add a new EpigraphLibrary:
23
+ 1. Create a new directory under lib/EpigraphLibs/`<MyEpigraphLibrary>`
24
+ 2. Create the module file/s. Ensure that the names of these files are in camelCase.
25
+ 3. Write a test for this Library under tests/<MyEpigraphLibrary.test.ts>
26
+ 4. Add the module that you wish to export as an entry in vite.config.ts > defineConfig > build > entry, similar to other entries in there. This will bundle the new module on build.
27
+ 5. Go to package.json:
28
+ - Add the new module entry under exports similar to other entries in that field.
29
+ - Add the new module entry under typesVersions similar to other entries in that field.
30
+
31
+ ### Use the library
32
+ This library exports the module into submodules to allow for better tree shaking when bundling the final product. Here is how you can import the submodules individually.
33
+
34
+ ```javascript
35
+ // Epigraph Object
36
+ import { Epigraph } from "@epigraph/epigraph-std-lib/dist/Epigraph/epigraph";
37
+
38
+ // Epigraph libs
39
+ import { EpigraphAnalytics } from "@epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphAnalytics";
40
+
41
+ ```
42
+
43
+ Exported Submodules:
44
+ | Name | Description |
45
+ |---|---|
46
+ | @epigraph/epigraph-std-lib/dist/Epigraph/epigraph | A base class intended to enforce some common functionalities across our solutions, built by extending the HTMLElement |
47
+ | @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphAnalytics | An Analytics modules that exports handy ways to log analytics across our solutions |
48
+ | @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphLogger | A Logger modules that exports handy ways to log across our solutions |
49
+ | @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphNexusApi | A Nexus API modules that exports handy ways to interact with the Nexus API across our solutions |
50
+ | @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphQrCodeGenerator | A QR Code generator modules that exports handy ways to generate QR Codes across our solutions |
51
+ | @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphResultFactory | A Result Factory modules that exports handy ways to generate Result objects across our solutions |
52
+ | @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphUnitsConverter | A Utility class that allows conversion between different standard unit, including but not limited to Distance, Color, etc. |
53
+ | @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphUrlProcessor | A Utility class that provides various methods to generate, process, manipulate URLs |
54
+
55
+
56
+ ### Write a test:
57
+ We use [vitest](https://vitest.dev/guide/) to write tests in this repository using [happy-dom](https://www.npmjs.com/package/happy-dom) to support some but not all browser functionalities. In order to write a new test:
58
+
59
+ 1. Create a new file for a specific test under tests/ as `<MyEpigraphLibrary>`.test.ts
60
+ 2. Write a test following the instructions and samples [here](https://vitest.dev/guide/#writing-tests)
61
+ 3. Make sure to import the library from "../dist/epigraph-std-lib" to avoid any issues that might come up after bundling.
62
+ 4. Open a terminal and execute "npm run test". This will build all the libraries under dist/ and then run tests using those.
63
+
64
+
65
+ # REFERENCES
66
+ A huge thanks to everyone who inspired the setup for this repository:
67
+ 1. [Andreas Riedmuller's Article](https://dev.to/receter/how-to-create-a-react-component-library-using-vites-library-mode-4lma)
68
+ 2. [Vitest Docs](https://vitest.dev/guide/)
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../EpigraphLibs/EpigraphLogger/epigraphLogger.cjs"),s=require("../enums-1vqWxJ0i.cjs"),g=require("../EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.cjs");class o{constructor(e){if(this._loggerContext="EPIGRAPH",this._isReady=!1,this._logger=new r.EpigraphLogger("EPIGRAPH LOGGER"),this._environment=s.ENVIRONMENT_TYPE.DEVELOPMENT,this._activeComponentsInSession=new Map,this._staleComponentsInSession=new Map,this._isSessionWebGL2Compatible=!1,window.epigraph)return window.epigraph.registerActiveComponent(e),window.epigraph;this._isSessionWebGL2Compatible=this._checkIfWebGL2IsAvailable(),window.epigraph=this,window.epigraph.registerActiveComponent(e),this.logBranding(),this._initializer=e,this._environment=this._initializer.environment;const t=this.getLoggerModeNameFromEnvironment();this._logger.setCurrentMode(t),this._urlProcessor=new g.EpigraphUrlProcessor,this.id=o.safeGenerateUuid();const i=this._urlProcessor.getParameterInUrl(g.QUERY_PARAMETER_NAMES.epigraphSessionId);this._epigraphSessionId=i??o.safeGenerateUuid(),this._logger.info({title:"Epigraph Object Ready!!",details:this,contextOverride:this._loggerContext}),this._isReady=!0}get isReady(){return this._isReady}get logger(){return this._logger}get urlProcessor(){return this._urlProcessor}get epigraphSessionId(){return this._epigraphSessionId}get environment(){return this._environment}get initializer(){return this._initializer}get activeComponentsInSession(){return this._activeComponentsInSession}get staleComponentsInSession(){return this._staleComponentsInSession}isSessionWebGL2Compatible(){return this._isSessionWebGL2Compatible}logBranding(){console.group("Powered by: "),console.log("%cEPIGRAPH","font-weight: bold; font-size: 50px; text-shadow: 3px 3px 0 rgb(100,100,100)"),console.log("Visit for more details: www.epigraph.us"),console.groupEnd()}_checkIfWebGL2IsAvailable(){try{const e=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&e.getContext("webgl2"))}catch{return!1}}registerActiveComponent(e){this._activeComponentsInSession.set(e.uuid,e),this._logger.info({title:"Registered a new Active Component",details:e,contextOverride:this._loggerContext})}deregisterActiveComponent(e){const t=this._activeComponentsInSession.get(e.uuid);t&&(this._staleComponentsInSession.set(t.uuid,t),this._activeComponentsInSession.delete(t.uuid),this._logger.info({title:"Deregistered a new Active Component",details:e,contextOverride:this._loggerContext}))}getLoggerModeNameFromEnvironment(){let e=r.LoggerModeNames.Dev;return this._environment===s.ENVIRONMENT_TYPE.STAGING?e=r.LoggerModeNames.Staging:this._environment===s.ENVIRONMENT_TYPE.PRODUCTION&&(e=r.LoggerModeNames.Release),e}static safeGenerateUuid(){let e="";try{e=crypto.randomUUID()}catch{console.error("crypto not available. Not generating a UUID")}return e}static generateXPath(e){let t="",i=e;for(;i;){let a=1,n=i.previousSibling;for(;n;)n.nodeName===i.nodeName&&a++,n=n.previousSibling;t=`/${i.nodeName.toLowerCase()+(a>1?`[${a}]`:"")}${t}`,i=i.parentNode}return t}}exports.ENVIRONMENT_TYPE=s.ENVIRONMENT_TYPE;exports.Epigraph=o;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../EpigraphLibs/EpigraphLogger/epigraphLogger.cjs"),t=require("../enums-PfFMiIoe.cjs"),n=require("../EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.cjs");var r=class r{constructor(i){if(this._loggerContext=`EPIGRAPH`,this._isReady=!1,this._logger=new e.EpigraphLogger(`EPIGRAPH LOGGER`),this._environment=t.t.DEVELOPMENT,this._activeComponentsInSession=new Map,this._staleComponentsInSession=new Map,this._isSessionWebGL2Compatible=!1,window.epigraph)return window.epigraph.registerActiveComponent(i),window.epigraph;this._isSessionWebGL2Compatible=this._checkIfWebGL2IsAvailable(),window.epigraph=this,window.epigraph.registerActiveComponent(i),this.logBranding(),this._initializer=i,this._environment=this._initializer.environment;let a=this.getLoggerModeNameFromEnvironment();this._logger.setCurrentMode(a),this._urlProcessor=new n.EpigraphUrlProcessor,this.id=r.safeGenerateUuid();let o=this._urlProcessor.getParameterInUrl(n.QUERY_PARAMETER_NAMES.epigraphSessionId);this._epigraphSessionId=o??r.safeGenerateUuid(),this._logger.info({title:`Epigraph Object Ready!!`,details:this,contextOverride:this._loggerContext}),this._isReady=!0}get isReady(){return this._isReady}get logger(){return this._logger}get urlProcessor(){return this._urlProcessor}get epigraphSessionId(){return this._epigraphSessionId}get environment(){return this._environment}get initializer(){return this._initializer}get activeComponentsInSession(){return this._activeComponentsInSession}get staleComponentsInSession(){return this._staleComponentsInSession}isSessionWebGL2Compatible(){return this._isSessionWebGL2Compatible}logBranding(){console.group(`Powered by: `),console.log(`%cEPIGRAPH`,`font-weight: bold; font-size: 50px; text-shadow: 3px 3px 0 rgb(100,100,100)`),console.log(`Visit for more details: www.epigraph.us`),console.groupEnd()}_checkIfWebGL2IsAvailable(){try{let e=document.createElement(`canvas`);return!!(window.WebGL2RenderingContext&&e.getContext(`webgl2`))}catch{return!1}}registerActiveComponent(e){this._activeComponentsInSession.set(e.uuid,e),this._logger.info({title:`Registered a new Active Component`,details:e,contextOverride:this._loggerContext})}deregisterActiveComponent(e){let t=this._activeComponentsInSession.get(e.uuid);t&&(this._staleComponentsInSession.set(t.uuid,t),this._activeComponentsInSession.delete(t.uuid),this._logger.info({title:`Deregistered a new Active Component`,details:e,contextOverride:this._loggerContext}))}getLoggerModeNameFromEnvironment(){let n=e.LoggerModeNames.Dev;return this._environment===t.t.STAGING?n=e.LoggerModeNames.Staging:this._environment===t.t.PRODUCTION&&(n=e.LoggerModeNames.Release),n}static safeGenerateUuid(){let e=``;try{e=crypto.randomUUID()}catch{console.error(`crypto not available. Not generating a UUID`)}return e}static generateXPath(e){let t=``,n=e;for(;n;){let e=1,r=n.previousSibling;for(;r;)r.nodeName===n.nodeName&&e++,r=r.previousSibling;t=`/${n.nodeName.toLowerCase()+(e>1?`[${e}]`:``)}${t}`,n=n.parentNode}return t}};exports.ENVIRONMENT_TYPE=t.t,exports.Epigraph=r;
@@ -1,127 +1,95 @@
1
- import { EpigraphLogger as g, LoggerModeNames as s } from "../EpigraphLibs/EpigraphLogger/epigraphLogger.js";
2
- import { E as r } from "../enums-CvOTKyNu.js";
3
- import { EpigraphUrlProcessor as l, QUERY_PARAMETER_NAMES as h } from "../EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.js";
4
- class a {
5
- constructor(e) {
6
- if (this._loggerContext = "EPIGRAPH", this._isReady = !1, this._logger = new g("EPIGRAPH LOGGER"), this._environment = r.DEVELOPMENT, this._activeComponentsInSession = /* @__PURE__ */ new Map(), this._staleComponentsInSession = /* @__PURE__ */ new Map(), this._isSessionWebGL2Compatible = !1, window.epigraph)
7
- return window.epigraph.registerActiveComponent(e), window.epigraph;
8
- this._isSessionWebGL2Compatible = this._checkIfWebGL2IsAvailable(), window.epigraph = this, window.epigraph.registerActiveComponent(e), this.logBranding(), this._initializer = e, this._environment = this._initializer.environment;
9
- const t = this.getLoggerModeNameFromEnvironment();
10
- this._logger.setCurrentMode(t), this._urlProcessor = new l(), this.id = a.safeGenerateUuid();
11
- const i = this._urlProcessor.getParameterInUrl(h.epigraphSessionId);
12
- this._epigraphSessionId = i ?? a.safeGenerateUuid(), this._logger.info({ title: "Epigraph Object Ready!!", details: this, contextOverride: this._loggerContext }), this._isReady = !0;
13
- }
14
- get isReady() {
15
- return this._isReady;
16
- }
17
- get logger() {
18
- return this._logger;
19
- }
20
- get urlProcessor() {
21
- return this._urlProcessor;
22
- }
23
- get epigraphSessionId() {
24
- return this._epigraphSessionId;
25
- }
26
- get environment() {
27
- return this._environment;
28
- }
29
- get initializer() {
30
- return this._initializer;
31
- }
32
- get activeComponentsInSession() {
33
- return this._activeComponentsInSession;
34
- }
35
- get staleComponentsInSession() {
36
- return this._staleComponentsInSession;
37
- }
38
- isSessionWebGL2Compatible() {
39
- return this._isSessionWebGL2Compatible;
40
- }
41
- /**
42
- * Logs Epigraph Branding in the console to help redirect potential interests in the right direction.
43
- */
44
- logBranding() {
45
- console.group("Powered by: "), console.log("%cEPIGRAPH", "font-weight: bold; font-size: 50px; text-shadow: 3px 3px 0 rgb(100,100,100)"), console.log("Visit for more details: www.epigraph.us"), console.groupEnd();
46
- }
47
- /**
48
- * Used to check if the current session can support WebGL2 or not.
49
- *
50
- * @returns {boolean}
51
- */
52
- _checkIfWebGL2IsAvailable() {
53
- try {
54
- const e = document.createElement("canvas");
55
- return !!(window.WebGL2RenderingContext && e.getContext("webgl2"));
56
- } catch {
57
- return !1;
58
- }
59
- }
60
- /**
61
- * Registers a new component that was initialized on this page.
62
- * This is optional from the perspective of the initialization flow but highly recommend
63
- * registering any component that gets initialized in this session.
64
- * Any component that inherits from EpigraphBaseSolution should automatically register itself on initialization.
65
- *
66
- * @param {EpigraphBaseSolutionTypes} solutionRef A type of Epigraph base component that is initialized in the session.
67
- */
68
- registerActiveComponent(e) {
69
- this._activeComponentsInSession.set(e.uuid, e), this._logger.info({ title: "Registered a new Active Component", details: e, contextOverride: this._loggerContext });
70
- }
71
- /**
72
- * De-Registers a component that was initialized on this page.
73
- * This is optional from the perspective of the unmount flow but highly recommend
74
- * de-registering any component that gets removed in this session.
75
- * Any component that inherits from EpigraphBaseSolution should automatically de-register itself on unmount.
76
- *
77
- * @param {EpigraphBaseSolutionTypes} solutionRef A type of Epigraph base component that is initialized in the session.
78
- */
79
- deregisterActiveComponent(e) {
80
- const t = this._activeComponentsInSession.get(e.uuid);
81
- t && (this._staleComponentsInSession.set(t.uuid, t), this._activeComponentsInSession.delete(t.uuid), this._logger.info({ title: "Deregistered a new Active Component", details: e, contextOverride: this._loggerContext }));
82
- }
83
- /**
84
- * Gets the mode that the logger should be executed in, based on the runtime environment.
85
- *
86
- * @returns {LoggerModeNames} A valid logger mode name.
87
- */
88
- getLoggerModeNameFromEnvironment() {
89
- let e = s.Dev;
90
- return this._environment === r.STAGING ? e = s.Staging : this._environment === r.PRODUCTION && (e = s.Release), e;
91
- }
92
- /**
93
- * Generates a random UUID using crypto.randomUUID with a fallback on custom generator,
94
- * if the first option fails for any reason in an environment.1
95
- *
96
- * @returns {string} A random generated ID.
97
- */
98
- static safeGenerateUuid() {
99
- let e = "";
100
- try {
101
- e = crypto.randomUUID();
102
- } catch {
103
- console.error("crypto not available. Not generating a UUID");
104
- }
105
- return e;
106
- }
107
- /**
108
- * Generates an XPath based on a DOM nodes location on the page.
109
- *
110
- * @param {HTMLElement} element The element that we need the XPath for.
111
- * @returns {string} The generated XPath.
112
- */
113
- static generateXPath(e) {
114
- let t = "", i = e;
115
- for (; i; ) {
116
- let o = 1, n = i.previousSibling;
117
- for (; n; )
118
- n.nodeName === i.nodeName && o++, n = n.previousSibling;
119
- t = `/${i.nodeName.toLowerCase() + (o > 1 ? `[${o}]` : "")}${t}`, i = i.parentNode;
120
- }
121
- return t;
122
- }
123
- }
124
- export {
125
- r as ENVIRONMENT_TYPE,
126
- a as Epigraph
1
+ import { EpigraphLogger as e, LoggerModeNames as t } from "../EpigraphLibs/EpigraphLogger/epigraphLogger.js";
2
+ import { t as n } from "../enums-BSSe4NAs.js";
3
+ import { EpigraphUrlProcessor as r, QUERY_PARAMETER_NAMES as i } from "../EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.js";
4
+ //#region lib/Epigraph/epigraph.ts
5
+ var a = class a {
6
+ constructor(t) {
7
+ if (this._loggerContext = "EPIGRAPH", this._isReady = !1, this._logger = new e("EPIGRAPH LOGGER"), this._environment = n.DEVELOPMENT, this._activeComponentsInSession = /* @__PURE__ */ new Map(), this._staleComponentsInSession = /* @__PURE__ */ new Map(), this._isSessionWebGL2Compatible = !1, window.epigraph) return window.epigraph.registerActiveComponent(t), window.epigraph;
8
+ this._isSessionWebGL2Compatible = this._checkIfWebGL2IsAvailable(), window.epigraph = this, window.epigraph.registerActiveComponent(t), this.logBranding(), this._initializer = t, this._environment = this._initializer.environment;
9
+ let o = this.getLoggerModeNameFromEnvironment();
10
+ this._logger.setCurrentMode(o), this._urlProcessor = new r(), this.id = a.safeGenerateUuid();
11
+ let s = this._urlProcessor.getParameterInUrl(i.epigraphSessionId);
12
+ this._epigraphSessionId = s ?? a.safeGenerateUuid(), this._logger.info({
13
+ title: "Epigraph Object Ready!!",
14
+ details: this,
15
+ contextOverride: this._loggerContext
16
+ }), this._isReady = !0;
17
+ }
18
+ get isReady() {
19
+ return this._isReady;
20
+ }
21
+ get logger() {
22
+ return this._logger;
23
+ }
24
+ get urlProcessor() {
25
+ return this._urlProcessor;
26
+ }
27
+ get epigraphSessionId() {
28
+ return this._epigraphSessionId;
29
+ }
30
+ get environment() {
31
+ return this._environment;
32
+ }
33
+ get initializer() {
34
+ return this._initializer;
35
+ }
36
+ get activeComponentsInSession() {
37
+ return this._activeComponentsInSession;
38
+ }
39
+ get staleComponentsInSession() {
40
+ return this._staleComponentsInSession;
41
+ }
42
+ isSessionWebGL2Compatible() {
43
+ return this._isSessionWebGL2Compatible;
44
+ }
45
+ logBranding() {
46
+ console.group("Powered by: "), console.log("%cEPIGRAPH", "font-weight: bold; font-size: 50px; text-shadow: 3px 3px 0 rgb(100,100,100)"), console.log("Visit for more details: www.epigraph.us"), console.groupEnd();
47
+ }
48
+ _checkIfWebGL2IsAvailable() {
49
+ try {
50
+ let e = document.createElement("canvas");
51
+ return !!(window.WebGL2RenderingContext && e.getContext("webgl2"));
52
+ } catch {
53
+ return !1;
54
+ }
55
+ }
56
+ registerActiveComponent(e) {
57
+ this._activeComponentsInSession.set(e.uuid, e), this._logger.info({
58
+ title: "Registered a new Active Component",
59
+ details: e,
60
+ contextOverride: this._loggerContext
61
+ });
62
+ }
63
+ deregisterActiveComponent(e) {
64
+ let t = this._activeComponentsInSession.get(e.uuid);
65
+ t && (this._staleComponentsInSession.set(t.uuid, t), this._activeComponentsInSession.delete(t.uuid), this._logger.info({
66
+ title: "Deregistered a new Active Component",
67
+ details: e,
68
+ contextOverride: this._loggerContext
69
+ }));
70
+ }
71
+ getLoggerModeNameFromEnvironment() {
72
+ let e = t.Dev;
73
+ return this._environment === n.STAGING ? e = t.Staging : this._environment === n.PRODUCTION && (e = t.Release), e;
74
+ }
75
+ static safeGenerateUuid() {
76
+ let e = "";
77
+ try {
78
+ e = crypto.randomUUID();
79
+ } catch {
80
+ console.error("crypto not available. Not generating a UUID");
81
+ }
82
+ return e;
83
+ }
84
+ static generateXPath(e) {
85
+ let t = "", n = e;
86
+ for (; n;) {
87
+ let e = 1, r = n.previousSibling;
88
+ for (; r;) r.nodeName === n.nodeName && e++, r = r.previousSibling;
89
+ t = `/${n.nodeName.toLowerCase() + (e > 1 ? `[${e}]` : "")}${t}`, n = n.parentNode;
90
+ }
91
+ return t;
92
+ }
127
93
  };
94
+ //#endregion
95
+ export { n as ENVIRONMENT_TYPE, a as Epigraph };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../lit-element-CYaaFRfk.cjs"),e=require("./epigraph.cjs");class s extends HTMLElement{constructor(t,i){super(),this._isReady=!1,this._elementName="epigraph-base-solution-html",this._solutionVersion="",this._loggerContextOverride="[EPIGRAPH BASE SOLUTION]",this.attachShadow({mode:"open"}),this.__environment=i,this._solutionVersion=t,this.__xPath=e.Epigraph.generateXPath(this),this.__uuid=e.Epigraph.safeGenerateUuid()??this.__xPath,new e.Epigraph(this),window.epigraph.logger.info({title:"Epigraph Base Solution Ready",contextOverride:this._loggerContextOverride})}get isReady(){return this._isReady}get environment(){return this.__environment}get elementName(){return this._elementName}get solutionVersion(){return this._solutionVersion}get uuid(){return this.__uuid}get xPath(){return this.__xPath}disconnectedCallback(){window.epigraph.deregisterActiveComponent(this)}}class o extends r.i{constructor(t,i){super(),this._isReady=!1,this._elementName="epigraph-base-solution-lit",this._solutionVersion="",this._loggerContextOverride="[EPIGRAPH BASE SOLUTION]",this._environment=i,this._solutionVersion=t,this._xPath=e.Epigraph.generateXPath(this),this._uuid=e.Epigraph.safeGenerateUuid()??this._xPath,new e.Epigraph(this),this._isReady=!0,window.epigraph.logger.info({title:"Epigraph Base Solution Ready",contextOverride:this._loggerContextOverride})}get isReady(){return this._isReady}get environment(){return this._environment}get elementName(){return this._elementName}get solutionVersion(){return this._solutionVersion}get uuid(){return this._uuid}get xPath(){return this._xPath}disconnectedCallback(){window.epigraph.deregisterActiveComponent(this)}}exports.EpigraphBaseSolutionHtmlElement=s;exports.EpigraphBaseSolutionLitElement=o;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./epigraph.cjs"),t=require("../lit-DZtv4Pds.cjs");var n=class extends HTMLElement{constructor(t,n){super(),this._isReady=!1,this._elementName=`epigraph-base-solution-html`,this._solutionVersion=``,this._loggerContextOverride=`[EPIGRAPH BASE SOLUTION]`,this.attachShadow({mode:`open`}),this.__environment=n,this._solutionVersion=t,this.__xPath=e.Epigraph.generateXPath(this),this.__uuid=e.Epigraph.safeGenerateUuid()??this.__xPath,new e.Epigraph(this),window.epigraph.logger.info({title:`Epigraph Base Solution Ready`,contextOverride:this._loggerContextOverride})}get isReady(){return this._isReady}get environment(){return this.__environment}get elementName(){return this._elementName}get solutionVersion(){return this._solutionVersion}get uuid(){return this.__uuid}get xPath(){return this.__xPath}disconnectedCallback(){window.epigraph.deregisterActiveComponent(this)}},r=class extends t.t{constructor(t,n){super(),this._isReady=!1,this._elementName=`epigraph-base-solution-lit`,this._solutionVersion=``,this._loggerContextOverride=`[EPIGRAPH BASE SOLUTION]`,this._environment=n,this._solutionVersion=t,this._xPath=e.Epigraph.generateXPath(this),this._uuid=e.Epigraph.safeGenerateUuid()??this._xPath,new e.Epigraph(this),this._isReady=!0,window.epigraph.logger.info({title:`Epigraph Base Solution Ready`,contextOverride:this._loggerContextOverride})}get isReady(){return this._isReady}get environment(){return this._environment}get elementName(){return this._elementName}get solutionVersion(){return this._solutionVersion}get uuid(){return this._uuid}get xPath(){return this._xPath}disconnectedCallback(){window.epigraph.deregisterActiveComponent(this)}};exports.EpigraphBaseSolutionHtmlElement=n,exports.EpigraphBaseSolutionLitElement=r;
@@ -1,70 +1,62 @@
1
- import { i as s } from "../lit-element-C3moVMGu.js";
2
1
  import { Epigraph as e } from "./epigraph.js";
3
- class h extends HTMLElement {
4
- constructor(t, i) {
5
- super(), this._isReady = !1, this._elementName = "epigraph-base-solution-html", this._solutionVersion = "", this._loggerContextOverride = "[EPIGRAPH BASE SOLUTION]", this.attachShadow({ mode: "open" }), this.__environment = i, this._solutionVersion = t, this.__xPath = e.generateXPath(this), this.__uuid = e.safeGenerateUuid() ?? this.__xPath, new e(this), window.epigraph.logger.info({
6
- title: "Epigraph Base Solution Ready",
7
- contextOverride: this._loggerContextOverride
8
- });
9
- }
10
- get isReady() {
11
- return this._isReady;
12
- }
13
- get environment() {
14
- return this.__environment;
15
- }
16
- get elementName() {
17
- return this._elementName;
18
- }
19
- /**
20
- * This is the npm package version of this solution.
21
- */
22
- get solutionVersion() {
23
- return this._solutionVersion;
24
- }
25
- get uuid() {
26
- return this.__uuid;
27
- }
28
- get xPath() {
29
- return this.__xPath;
30
- }
31
- disconnectedCallback() {
32
- window.epigraph.deregisterActiveComponent(this);
33
- }
34
- }
35
- class a extends s {
36
- constructor(t, i) {
37
- super(), this._isReady = !1, this._elementName = "epigraph-base-solution-lit", this._solutionVersion = "", this._loggerContextOverride = "[EPIGRAPH BASE SOLUTION]", this._environment = i, this._solutionVersion = t, this._xPath = e.generateXPath(this), this._uuid = e.safeGenerateUuid() ?? this._xPath, new e(this), this._isReady = !0, window.epigraph.logger.info({
38
- title: "Epigraph Base Solution Ready",
39
- contextOverride: this._loggerContextOverride
40
- });
41
- }
42
- get isReady() {
43
- return this._isReady;
44
- }
45
- get environment() {
46
- return this._environment;
47
- }
48
- get elementName() {
49
- return this._elementName;
50
- }
51
- /**
52
- * This is the npm package version of this solution.
53
- */
54
- get solutionVersion() {
55
- return this._solutionVersion;
56
- }
57
- get uuid() {
58
- return this._uuid;
59
- }
60
- get xPath() {
61
- return this._xPath;
62
- }
63
- disconnectedCallback() {
64
- window.epigraph.deregisterActiveComponent(this);
65
- }
66
- }
67
- export {
68
- h as EpigraphBaseSolutionHtmlElement,
69
- a as EpigraphBaseSolutionLitElement
2
+ import { t } from "../lit--5TUYSGn.js";
3
+ //#region lib/Epigraph/epigraphBaseSolutions.ts
4
+ var n = class extends HTMLElement {
5
+ constructor(t, n) {
6
+ super(), this._isReady = !1, this._elementName = "epigraph-base-solution-html", this._solutionVersion = "", this._loggerContextOverride = "[EPIGRAPH BASE SOLUTION]", this.attachShadow({ mode: "open" }), this.__environment = n, this._solutionVersion = t, this.__xPath = e.generateXPath(this), this.__uuid = e.safeGenerateUuid() ?? this.__xPath, new e(this), window.epigraph.logger.info({
7
+ title: "Epigraph Base Solution Ready",
8
+ contextOverride: this._loggerContextOverride
9
+ });
10
+ }
11
+ get isReady() {
12
+ return this._isReady;
13
+ }
14
+ get environment() {
15
+ return this.__environment;
16
+ }
17
+ get elementName() {
18
+ return this._elementName;
19
+ }
20
+ get solutionVersion() {
21
+ return this._solutionVersion;
22
+ }
23
+ get uuid() {
24
+ return this.__uuid;
25
+ }
26
+ get xPath() {
27
+ return this.__xPath;
28
+ }
29
+ disconnectedCallback() {
30
+ window.epigraph.deregisterActiveComponent(this);
31
+ }
32
+ }, r = class extends t {
33
+ constructor(t, n) {
34
+ super(), this._isReady = !1, this._elementName = "epigraph-base-solution-lit", this._solutionVersion = "", this._loggerContextOverride = "[EPIGRAPH BASE SOLUTION]", this._environment = n, this._solutionVersion = t, this._xPath = e.generateXPath(this), this._uuid = e.safeGenerateUuid() ?? this._xPath, new e(this), this._isReady = !0, window.epigraph.logger.info({
35
+ title: "Epigraph Base Solution Ready",
36
+ contextOverride: this._loggerContextOverride
37
+ });
38
+ }
39
+ get isReady() {
40
+ return this._isReady;
41
+ }
42
+ get environment() {
43
+ return this._environment;
44
+ }
45
+ get elementName() {
46
+ return this._elementName;
47
+ }
48
+ get solutionVersion() {
49
+ return this._solutionVersion;
50
+ }
51
+ get uuid() {
52
+ return this._uuid;
53
+ }
54
+ get xPath() {
55
+ return this._xPath;
56
+ }
57
+ disconnectedCallback() {
58
+ window.epigraph.deregisterActiveComponent(this);
59
+ }
70
60
  };
61
+ //#endregion
62
+ export { n as EpigraphBaseSolutionHtmlElement, r as EpigraphBaseSolutionLitElement };
@@ -0,0 +1,21 @@
1
+ export type ConsentSignal = 'granted' | 'denied' | 'unknown';
2
+ /**
3
+ * Resolves the visitor's analytics consent from signals the page already exposes, so consent is
4
+ * honored even when no consent plugin was configured (which is the norm for our installs).
5
+ *
6
+ * Signals, in priority order:
7
+ * 1. Google Consent Mode — every major CMP feeds it, making it a single integration point. The
8
+ * resolved state lives at window.google_tag_data.ics; entries carry default/update booleans per
9
+ * category and ics.active distinguishes "consent mode in use" from the implicit-granted state
10
+ * that exists on pages with no consent setup.
11
+ * 2. Known CMP globals, for pages where the CMP blocks the Google stack from loading at all
12
+ * (so ics never exists): Cookiebot, OneTrust.
13
+ *
14
+ * 'unknown' means no signal is present — the caller decides the default.
15
+ */
16
+ export declare class AutoConsentResolver {
17
+ resolve(): ConsentSignal;
18
+ private readGoogleConsentMode;
19
+ private readCookiebot;
20
+ private readOneTrust;
21
+ }
@@ -10,4 +10,5 @@ export declare class OneTrustConsentPlugin implements IConsentPlugin {
10
10
  */
11
11
  hasConsent(): boolean;
12
12
  private addConsentChangedListener;
13
+ private registerOnConsentChanged;
13
14
  }