@elliemae/pui-logrocket 1.0.3 → 1.1.10

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 (161) hide show
  1. package/build/docs/404.html +16 -0
  2. package/build/docs/api/functions/buildLogRocketQueryParams/index.html +27 -0
  3. package/build/docs/api/functions/hasUserConsentedToSessionRecording/index.html +30 -0
  4. package/build/docs/api/functions/initLogRocket/index.html +36 -0
  5. package/build/docs/api/index.html +22 -0
  6. package/build/docs/api/type-aliases/LROptions/index.html +31 -0
  7. package/build/docs/api/variables/LogRocket/index.html +17 -0
  8. package/build/docs/assets/css/styles.48d5ef50.css +1 -0
  9. package/build/docs/assets/images/cookie-banner-44da75a3249d0545c24f9b735d2fa068.png +0 -0
  10. package/build/docs/assets/images/cookie-choices-2714be2ea99c6797644dd14b05ba1093.png +0 -0
  11. package/build/docs/assets/js/04ee7372.1f4e4f19.js +1 -0
  12. package/build/docs/assets/js/1519.382051d0.js +1 -0
  13. package/build/docs/assets/js/1653.0f512a56.js +1 -0
  14. package/build/docs/assets/js/1784.d8d3eb6f.js +1 -0
  15. package/build/docs/assets/js/17896441.6f8fb109.js +1 -0
  16. package/build/docs/assets/js/1945.f17ce4cb.js +1 -0
  17. package/build/docs/assets/js/1991.7f866f21.js +1 -0
  18. package/build/docs/assets/js/2045.1bebedee.js +1 -0
  19. package/build/docs/assets/js/211c08f1.d133fc82.js +1 -0
  20. package/build/docs/assets/js/2776.108cd80f.js +1 -0
  21. package/build/docs/assets/js/3038.002397e7.js +1 -0
  22. package/build/docs/assets/js/3070.7cbc892b.js +1 -0
  23. package/build/docs/assets/js/33.26b2760e.js +1 -0
  24. package/build/docs/assets/js/3899.9ba4046a.js +1 -0
  25. package/build/docs/assets/js/407.1609258d.js +1 -0
  26. package/build/docs/assets/js/4362.e67b3c91.js +1 -0
  27. package/build/docs/assets/js/459.0ef6028a.js +1 -0
  28. package/build/docs/assets/js/4860.aa45023e.js +1 -0
  29. package/build/docs/assets/js/4931.0293910b.js +1 -0
  30. package/build/docs/assets/js/5122.7fe63ad9.js +1 -0
  31. package/build/docs/assets/js/51c4ceb1.e88fb182.js +1 -0
  32. package/build/docs/assets/js/552a934f.61bd8d58.js +1 -0
  33. package/build/docs/assets/js/5621.853372b8.js +2 -0
  34. package/build/docs/assets/js/5621.853372b8.js.LICENSE.txt +1 -0
  35. package/build/docs/assets/js/5820.c04e4b12.js +1 -0
  36. package/build/docs/assets/js/5e8c322a.86d2fc4a.js +1 -0
  37. package/build/docs/assets/js/5e95c892.add994c9.js +1 -0
  38. package/build/docs/assets/js/638.a490f71f.js +2 -0
  39. package/build/docs/assets/js/638.a490f71f.js.LICENSE.txt +9 -0
  40. package/build/docs/assets/js/6409.6f06126b.js +1 -0
  41. package/build/docs/assets/js/654.d3bf8f92.js +1 -0
  42. package/build/docs/assets/js/6959.110f49dd.js +1 -0
  43. package/build/docs/assets/js/7039.0493dc3c.js +1 -0
  44. package/build/docs/assets/js/7299.909bd2d8.js +1 -0
  45. package/build/docs/assets/js/7666.f71add4d.js +1 -0
  46. package/build/docs/assets/js/7685.feb9b2b8.js +1 -0
  47. package/build/docs/assets/js/7807.9aa70b38.js +1 -0
  48. package/build/docs/assets/js/7860.d45cb0c2.js +1 -0
  49. package/build/docs/assets/js/7868.0076697f.js +1 -0
  50. package/build/docs/assets/js/7968.92fc7d89.js +1 -0
  51. package/build/docs/assets/js/7997.2ae474c8.js +1 -0
  52. package/build/docs/assets/js/7fcbe1af.57ab9f7e.js +1 -0
  53. package/build/docs/assets/js/8130.4423e15c.js +1 -0
  54. package/build/docs/assets/js/8182.16116f9a.js +1 -0
  55. package/build/docs/assets/js/8257.8e164d61.js +1 -0
  56. package/build/docs/assets/js/8587.8653f695.js +1 -0
  57. package/build/docs/assets/js/8796.163faa83.js +1 -0
  58. package/build/docs/assets/js/8907.6cf12a5a.js +1 -0
  59. package/build/docs/assets/js/9176.d6ec3115.js +1 -0
  60. package/build/docs/assets/js/967.54c4bee1.js +1 -0
  61. package/build/docs/assets/js/9839.6a9eb650.js +1 -0
  62. package/build/docs/assets/js/a7bd4aaa.6aa43433.js +1 -0
  63. package/build/docs/assets/js/a94703ab.53aa43ca.js +1 -0
  64. package/build/docs/assets/js/aba21aa0.c2c2f2c9.js +1 -0
  65. package/build/docs/assets/js/acaa8c75.be91209b.js +1 -0
  66. package/build/docs/assets/js/c377a04b.e8bab181.js +1 -0
  67. package/build/docs/assets/js/common.783bea07.js +1 -0
  68. package/build/docs/assets/js/e376fc56.8ffdd859.js +1 -0
  69. package/build/docs/assets/js/ed616b60.5ce87321.js +1 -0
  70. package/build/docs/assets/js/main.2ad67b76.js +2 -0
  71. package/build/docs/assets/js/main.2ad67b76.js.LICENSE.txt +51 -0
  72. package/build/docs/assets/js/runtime~main.6269ea83.js +1 -0
  73. package/build/docs/compliance/index.html +165 -0
  74. package/build/docs/img/favicon.ico +0 -0
  75. package/build/docs/img/logo.jpeg +0 -0
  76. package/build/docs/img/logo.svg +22 -0
  77. package/build/docs/img/readme.md +1 -0
  78. package/build/docs/index.html +51 -0
  79. package/build/docs/readme.md +1 -0
  80. package/build/docs/sitemap.xml +1 -0
  81. package/build/docs/usage-guide/index.html +81 -0
  82. package/dist/cjs/index.html +5 -2
  83. package/dist/cjs/index.js +2 -0
  84. package/dist/cjs/logrocket.js +116 -17
  85. package/dist/cjs/package.json +4 -1
  86. package/dist/cjs/utils.js +39 -0
  87. package/dist/esm/index.html +5 -2
  88. package/dist/esm/index.js +8 -1
  89. package/dist/esm/logrocket.js +115 -16
  90. package/dist/esm/package.json +4 -1
  91. package/dist/esm/utils.js +19 -0
  92. package/dist/public/index.html +1 -1
  93. package/dist/public/js/emuiLogrocket.4599eff24f56589d959a.js +45 -0
  94. package/dist/public/js/emuiLogrocket.4599eff24f56589d959a.js.br +0 -0
  95. package/dist/public/js/emuiLogrocket.4599eff24f56589d959a.js.gz +0 -0
  96. package/dist/public/js/emuiLogrocket.4599eff24f56589d959a.js.map +1 -0
  97. package/dist/public/microapp1-same-domain.html +17 -0
  98. package/dist/public/microapp1-same-domain.js +3 -0
  99. package/dist/public/microapp1-same-domain.js.br +0 -0
  100. package/dist/public/microapp1-same-domain.js.gz +0 -0
  101. package/dist/public/microapp1-same-domain.js.map +1 -0
  102. package/dist/public/microapp2-1-cross-domain.html +17 -0
  103. package/dist/public/microapp2-1-cross-domain.js +3 -0
  104. package/dist/public/microapp2-1-cross-domain.js.br +0 -0
  105. package/dist/public/microapp2-1-cross-domain.js.gz +0 -0
  106. package/dist/public/microapp2-1-cross-domain.js.map +1 -0
  107. package/dist/public/microapp2-cross-domain.html +28 -0
  108. package/dist/public/microapp2-cross-domain.js +3 -0
  109. package/dist/public/microapp2-cross-domain.js.br +0 -0
  110. package/dist/public/microapp2-cross-domain.js.gz +0 -0
  111. package/dist/public/microapp2-cross-domain.js.map +1 -0
  112. package/dist/public/test.html +144 -0
  113. package/dist/public/test.js +12 -0
  114. package/dist/public/test.js.br +0 -0
  115. package/dist/public/test.js.gz +0 -0
  116. package/dist/public/test.js.map +1 -0
  117. package/dist/public/utils.js +3 -0
  118. package/dist/public/utils.js.br +0 -0
  119. package/dist/public/utils.js.gz +0 -0
  120. package/dist/public/utils.js.map +1 -0
  121. package/dist/types/lib/index.d.ts +1 -1
  122. package/dist/types/lib/logrocket.d.ts +52 -12
  123. package/dist/types/lib/tests/logrocket-dom-isenabled.test.d.ts +1 -0
  124. package/dist/types/lib/tests/logrocket.test.d.ts +1 -0
  125. package/dist/types/lib/typings/window.d.ts +73 -0
  126. package/dist/types/lib/utils.d.ts +8 -0
  127. package/dist/types/tsconfig.tsbuildinfo +1 -1
  128. package/dist/umd/index.html +1 -1
  129. package/dist/umd/index.js +20 -20
  130. package/dist/umd/index.js.br +0 -0
  131. package/dist/umd/index.js.gz +0 -0
  132. package/dist/umd/index.js.map +1 -1
  133. package/dist/umd/microapp1-same-domain.html +17 -0
  134. package/dist/umd/microapp1-same-domain.js +3 -0
  135. package/dist/umd/microapp1-same-domain.js.br +0 -0
  136. package/dist/umd/microapp1-same-domain.js.gz +0 -0
  137. package/dist/umd/microapp1-same-domain.js.map +1 -0
  138. package/dist/umd/microapp2-1-cross-domain.html +17 -0
  139. package/dist/umd/microapp2-1-cross-domain.js +3 -0
  140. package/dist/umd/microapp2-1-cross-domain.js.br +0 -0
  141. package/dist/umd/microapp2-1-cross-domain.js.gz +0 -0
  142. package/dist/umd/microapp2-1-cross-domain.js.map +1 -0
  143. package/dist/umd/microapp2-cross-domain.html +28 -0
  144. package/dist/umd/microapp2-cross-domain.js +3 -0
  145. package/dist/umd/microapp2-cross-domain.js.br +0 -0
  146. package/dist/umd/microapp2-cross-domain.js.gz +0 -0
  147. package/dist/umd/microapp2-cross-domain.js.map +1 -0
  148. package/dist/umd/test.html +144 -0
  149. package/dist/umd/test.js +12 -0
  150. package/dist/umd/test.js.br +0 -0
  151. package/dist/umd/test.js.gz +0 -0
  152. package/dist/umd/test.js.map +1 -0
  153. package/dist/umd/utils.js +3 -0
  154. package/dist/umd/utils.js.br +0 -0
  155. package/dist/umd/utils.js.gz +0 -0
  156. package/dist/umd/utils.js.map +1 -0
  157. package/package.json +22 -25
  158. package/dist/public/js/emuiLogrocket.6856581ccca61dc0bae2.js +0 -45
  159. package/dist/public/js/emuiLogrocket.6856581ccca61dc0bae2.js.br +0 -0
  160. package/dist/public/js/emuiLogrocket.6856581ccca61dc0bae2.js.gz +0 -0
  161. package/dist/public/js/emuiLogrocket.6856581ccca61dc0bae2.js.map +0 -1
@@ -0,0 +1,17 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>MicroApp1</title>
7
+ <script src="http://localhost:3001/index.js"></script>
8
+ </head>
9
+ <body data-public>
10
+ <h3>MicroApp1 in same domain as parent (vinothvk.com)</h3>
11
+ <!-- print some lorem ipsum text -->
12
+ <p id="lorem-ipsum-text">click the button to change this text</p>
13
+ <!-- add a button to generate random lorem ipsum text -->
14
+ <button id="lorem-ipsum-btn">Random text</button>
15
+ <script src="./microapp1-same-domain.js" type="module"></script>
16
+ </body>
17
+ </html>
@@ -0,0 +1,3 @@
1
+ import"./utils.js";import{faker as t}from"https://cdn.jsdelivr.net/npm/@faker-js/faker/+esm";const e=()=>{window.emui.logRocketConfig.appId="abcd",window.emuiLogrocket.initLogRocket({appId:"xyz",isReact:!1})},n=()=>{const o=document.getElementById("lorem-ipsum-text");o.textContent=t.lorem.paragraph(),o.style.color=`#${Math.floor(Math.random()*16777215).toString(16)}`},m=()=>{document.getElementById("lorem-ipsum-btn").addEventListener("click",n)};window.emuiLogrocket&&e(),window.addEventListener("load",m);
2
+
3
+ //# sourceMappingURL=microapp1-same-domain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack://emuiLogrocket/microapp1-same-domain.js"],"sourcesContent":["import './utils.js';\nimport { faker } from 'https://cdn.jsdelivr.net/npm/@faker-js/faker/+esm';\n\n/**\n * Initializes LogRocket for the microapp.\n */\nconst initLogRocket = () => {\n //window.emui.logRocketConfig.enable = false;\n // the appIds set in window variable and passed to initLogRocket are superceded by lrAppId in url params\n window.emui.logRocketConfig.appId = 'abcd';\n window.emuiLogrocket.initLogRocket({ appId: 'xyz', isReact: false });\n};\n\n/**\n * Event handler for the \"lorem-ipsum-btn\" button click event.\n */\nconst onLoremIpsumClick = () => {\n const loremIpsumText = document.getElementById('lorem-ipsum-text');\n loremIpsumText.textContent = faker.lorem.paragraph();\n loremIpsumText.style.color = `#${Math.floor(\n Math.random() * 16777215,\n ).toString(16)}`;\n};\n\n/**\n * Event handler for the window load event.\n */\nconst onLoad = () => {\n const loremIpsumBtn = document.getElementById('lorem-ipsum-btn');\n loremIpsumBtn.addEventListener('click', onLoremIpsumClick);\n};\n\nif (window.emuiLogrocket) initLogRocket();\nwindow.addEventListener('load', onLoad);\n"],"mappings":"AAAA,MAAO,aACP,OAAS,SAAAA,MAAa,oDAKtB,MAAMC,EAAgB,IAAM,CAG1B,OAAO,KAAK,gBAAgB,MAAQ,OACpC,OAAO,cAAc,cAAc,CAAE,MAAO,MAAO,QAAS,EAAM,CAAC,CACrE,EAKMC,EAAoB,IAAM,CAC9B,MAAMC,EAAiB,SAAS,eAAe,kBAAkB,EACjEA,EAAe,YAAcH,EAAM,MAAM,UAAU,EACnDG,EAAe,MAAM,MAAQ,IAAI,KAAK,MACpC,KAAK,OAAO,EAAI,QAClB,EAAE,SAAS,EAAE,CAAC,EAChB,EAKMC,EAAS,IAAM,CACG,SAAS,eAAe,iBAAiB,EACjD,iBAAiB,QAASF,CAAiB,CAC3D,EAEI,OAAO,eAAeD,EAAc,EACxC,OAAO,iBAAiB,OAAQG,CAAM","names":["faker","initLogRocket","onLoremIpsumClick","loremIpsumText","onLoad"],"sourceRoot":"","file":"microapp1-same-domain.js"}
@@ -0,0 +1,17 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>MicroApp2</title>
7
+ <script src="http://localhost:3001/index.js"></script>
8
+ </head>
9
+ <body data-public>
10
+ <h3>MicroApp3 in cross domain and nested (beta.vinothvk.com)</h3>
11
+ <!-- print some lorem ipsum text -->
12
+ <p id="lorem-ipsum-text">click the button to change this text</p>
13
+ <!-- add a button to generate random lorem ipsum text -->
14
+ <button id="lorem-ipsum-btn">Change Lorem Ipsum text</button>
15
+ <script src="./microapp2-1-cross-domain.js" type="module"></script>
16
+ </body>
17
+ </html>
@@ -0,0 +1,3 @@
1
+ import"./utils.js";import{faker as o}from"https://cdn.jsdelivr.net/npm/@faker-js/faker/+esm";const t=()=>{window.emuiLogrocket.initLogRocket({isReact:!1})},r=()=>{window.emuiLogrocket&&window.emui.logRocket.captureMessage("Unable to process request",{description:"An error occurred while processing the request.",severity:"error"})},n=()=>{const e=document.getElementById("lorem-ipsum-text");e.textContent=o.lorem.paragraph(),r()},i=()=>{document.getElementById("lorem-ipsum-btn").addEventListener("click",n)};window.emuiLogrocket&&t(),window.addEventListener("load",i);
2
+
3
+ //# sourceMappingURL=microapp2-1-cross-domain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack://emuiLogrocket/microapp2-1-cross-domain.js"],"sourcesContent":["import './utils.js';\nimport { faker } from 'https://cdn.jsdelivr.net/npm/@faker-js/faker/+esm';\n\n/**\n * Initializes LogRocket for the microapp.\n */\nconst initLogRocket = () => {\n window.emuiLogrocket.initLogRocket({ isReact: false });\n};\n\n/**\n * Reports an issue to LogRocket.\n */\nconst reportIssue = () => {\n if (window.emuiLogrocket) {\n window.emui.logRocket.captureMessage('Unable to process request', {\n description: 'An error occurred while processing the request.',\n severity: 'error',\n });\n }\n};\n\n/**\n * Event handler for the \"lorem-ipsum-btn\" button click event.\n */\nconst onLoremIpsumClick = () => {\n const loremIpsumText = document.getElementById('lorem-ipsum-text');\n loremIpsumText.textContent = faker.lorem.paragraph();\n reportIssue();\n};\n\n/**\n * Event handler for the window load event.\n */\nconst onLoad = () => {\n const loremIpsumBtn = document.getElementById('lorem-ipsum-btn');\n loremIpsumBtn.addEventListener('click', onLoremIpsumClick);\n};\n\nif (window.emuiLogrocket) initLogRocket();\nwindow.addEventListener('load', onLoad);\n"],"mappings":"AAAA,MAAO,aACP,OAAS,SAAAA,MAAa,oDAKtB,MAAMC,EAAgB,IAAM,CAC1B,OAAO,cAAc,cAAc,CAAE,QAAS,EAAM,CAAC,CACvD,EAKMC,EAAc,IAAM,CACpB,OAAO,eACT,OAAO,KAAK,UAAU,eAAe,4BAA6B,CAChE,YAAa,kDACb,SAAU,OACZ,CAAC,CAEL,EAKMC,EAAoB,IAAM,CAC9B,MAAMC,EAAiB,SAAS,eAAe,kBAAkB,EACjEA,EAAe,YAAcJ,EAAM,MAAM,UAAU,EACnDE,EAAY,CACd,EAKMG,EAAS,IAAM,CACG,SAAS,eAAe,iBAAiB,EACjD,iBAAiB,QAASF,CAAiB,CAC3D,EAEI,OAAO,eAAeF,EAAc,EACxC,OAAO,iBAAiB,OAAQI,CAAM","names":["faker","initLogRocket","reportIssue","onLoremIpsumClick","loremIpsumText","onLoad"],"sourceRoot":"","file":"microapp2-1-cross-domain.js"}
@@ -0,0 +1,28 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>MicroApp2</title>
7
+ <script src="http://localhost:3001/index.js"></script>
8
+ </head>
9
+ <body data-public>
10
+ <h3>MicroApp2 in cross domain (vinothkumarvk.com)</h3>
11
+ <!-- print some lorem ipsum text -->
12
+ <p>
13
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
14
+ tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
15
+ veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
16
+ commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
17
+ velit esse
18
+ </p>
19
+ <!-- add a button to print current date time in a output element -->
20
+ <button id="print-date-btn">Print Current Date Time</button>
21
+ <p id="date-output"></p>
22
+ <div>
23
+ <button id="load-nested-app-btn">Load Child App</button>
24
+ <div id="child-apps-container"></div>
25
+ </div>
26
+ <script src="./microapp2-cross-domain.js" type="module"></script>
27
+ </body>
28
+ </html>
@@ -0,0 +1,3 @@
1
+ import{createIFramedMicroapp as n}from"./utils.js";const i=()=>{window.emui.logRocketConfig.childDomains=["https://vinothkumarvk.com","https://beta.vinothvk.com"],window.emuiLogrocket.initLogRocket({isReact:!1})},o=(t,e)=>{window.emuiLogrocket&&window.emui.logRocket.track(t,e)},a=()=>{n("https://beta.vinothvk.com/microapp2-1-cross-domain.html"),o("nested_app_open",{timestamp:Date.now().toString()})},d=()=>{const t=document.getElementById("date-output");t.textContent=`Current Date and Time: ${new Date().toLocaleString()}`,o("print_date",{date:Date.now().toString()})},c=()=>{document.getElementById("load-nested-app-btn").addEventListener("click",a),document.getElementById("print-date-btn").addEventListener("click",d)};window.emuiLogrocket&&i(),window.addEventListener("load",c);
2
+
3
+ //# sourceMappingURL=microapp2-cross-domain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack://emuiLogrocket/microapp2-cross-domain.js"],"sourcesContent":["import { createIFramedMicroapp } from './utils.js';\n\n/**\n * Initializes LogRocket with specified child domains.\n */\nconst initLogRocket = () => {\n window.emui.logRocketConfig.childDomains = [\n 'https://vinothkumarvk.com',\n 'https://beta.vinothvk.com',\n ];\n window.emuiLogrocket.initLogRocket({ isReact: false });\n};\n\n// report custom event to logrocket\nconst reportCustomEvent = (eventName, eventData) => {\n if (window.emuiLogrocket) {\n window.emui.logRocket.track(eventName, eventData);\n }\n};\n\n/**\n * Event handler for the \"load-nested-app-btn\" button click event.\n */\nconst onLoadNestedAppClick = () => {\n createIFramedMicroapp(\n `https://beta.vinothvk.com/microapp2-1-cross-domain.html`,\n );\n reportCustomEvent('nested_app_open', { timestamp: Date.now().toString() });\n};\n\n/**\n * Event handler for the \"print-date-btn\" button click event.\n */\nconst onPrintDateClick = () => {\n const dateOutput = document.getElementById('date-output');\n dateOutput.textContent = `Current Date and Time: ${new Date().toLocaleString()}`;\n reportCustomEvent('print_date', { date: Date.now().toString() });\n};\n\n/**\n * Event handler for the window load event.\n */\nconst onLoad = () => {\n const loadNesstedAppBtn = document.getElementById('load-nested-app-btn');\n loadNesstedAppBtn.addEventListener('click', onLoadNestedAppClick);\n const printDateBtn = document.getElementById('print-date-btn');\n printDateBtn.addEventListener('click', onPrintDateClick);\n};\n\nif (window.emuiLogrocket) initLogRocket();\nwindow.addEventListener('load', onLoad);\n"],"mappings":"AAAA,OAAS,yBAAAA,MAA6B,aAKtC,MAAMC,EAAgB,IAAM,CAC1B,OAAO,KAAK,gBAAgB,aAAe,CACzC,4BACA,2BACF,EACA,OAAO,cAAc,cAAc,CAAE,QAAS,EAAM,CAAC,CACvD,EAGMC,EAAoB,CAACC,EAAWC,IAAc,CAC9C,OAAO,eACT,OAAO,KAAK,UAAU,MAAMD,EAAWC,CAAS,CAEpD,EAKMC,EAAuB,IAAM,CACjCL,EACE,yDACF,EACAE,EAAkB,kBAAmB,CAAE,UAAW,KAAK,IAAI,EAAE,SAAS,CAAE,CAAC,CAC3E,EAKMI,EAAmB,IAAM,CAC7B,MAAMC,EAAa,SAAS,eAAe,aAAa,EACxDA,EAAW,YAAc,0BAA0B,IAAI,KAAK,EAAE,eAAe,CAAC,GAC9EL,EAAkB,aAAc,CAAE,KAAM,KAAK,IAAI,EAAE,SAAS,CAAE,CAAC,CACjE,EAKMM,EAAS,IAAM,CACO,SAAS,eAAe,qBAAqB,EACrD,iBAAiB,QAASH,CAAoB,EAC3C,SAAS,eAAe,gBAAgB,EAChD,iBAAiB,QAASC,CAAgB,CACzD,EAEI,OAAO,eAAeL,EAAc,EACxC,OAAO,iBAAiB,OAAQO,CAAM","names":["createIFramedMicroapp","initLogRocket","reportCustomEvent","eventName","eventData","onLoadNestedAppClick","onPrintDateClick","dateOutput","onLoad"],"sourceRoot":"","file":"microapp2-cross-domain.js"}
@@ -0,0 +1,144 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Product</title>
7
+ <script src="http://localhost:3001/index.js"></script>
8
+ </head>
9
+ <body>
10
+ <main>
11
+ <h1>Product (vinothvk.com)</h1>
12
+ <p>This is a Main product page.</p>
13
+ <!-- create some dummy navigation open links in a new window -->
14
+ <nav data-public>
15
+ <a
16
+ href="https://mortgagetech.ice.com/index"
17
+ target="_blank"
18
+ rel="noopener noreferrer"
19
+ >Home</a
20
+ >
21
+ |
22
+ <a
23
+ href="https://mortgagetech.ice.com/about"
24
+ target="_blank"
25
+ rel="noopener noreferrer"
26
+ >About</a
27
+ >
28
+ |
29
+ <a
30
+ href="https://mortgagetech.ice.com/support"
31
+ target="_blank"
32
+ rel="noopener noreferrer"
33
+ >Support</a
34
+ >
35
+ </nav>
36
+ <hr />
37
+ <div style="display: flex; gap: 40px; align-items: flex-start">
38
+ <div style="flex: 1">
39
+ <h2 data-public>Loan Calculator</h2>
40
+ <!-- it takes some loan application information and displays it -->
41
+ <p>
42
+ <strong data-public>Applicant Email:</strong>
43
+ <span id="applicant-email" data-private="true">Loading...</span>
44
+ </p>
45
+ <label for="applicant-name" data-public>Applicant Name:</label>
46
+ <input
47
+ type="text"
48
+ id="applicant-name"
49
+ name="applicant-name"
50
+ /><br /><br />
51
+ <label for="loan-amount" data-public>Loan Amount:</label>
52
+ <input
53
+ type="number"
54
+ id="loan-amount"
55
+ name="loan-amount"
56
+ /><br /><br />
57
+ <label for="loan-term" data-public>Loan Term (years):</label>
58
+ <input type="number" id="loan-term" name="loan-term" /><br /><br />
59
+ <label for="interest-rate" data-public>Interest Rate (%):</label>
60
+ <input
61
+ type="number"
62
+ id="interest-rate"
63
+ name="interest-rate"
64
+ step="0.01"
65
+ /><br /><br />
66
+ <button id="calculate-btn" data-public>
67
+ Calculate Monthly Payment
68
+ </button>
69
+ <h2 id="monthly-payment" data-public></h2>
70
+ </div>
71
+
72
+ <div style="flex: 1" data-public>
73
+ <h2>Current Loan Rates</h2>
74
+ <table style="width: 100%; border-collapse: collapse">
75
+ <thead>
76
+ <tr style="background-color: #f0f0f0">
77
+ <th
78
+ style="border: 1px solid #ddd; padding: 8px; text-align: left"
79
+ >
80
+ Loan Type
81
+ </th>
82
+ <th
83
+ style="border: 1px solid #ddd; padding: 8px; text-align: left"
84
+ >
85
+ Term
86
+ </th>
87
+ <th
88
+ style="border: 1px solid #ddd; padding: 8px; text-align: left"
89
+ >
90
+ Rate (%)
91
+ </th>
92
+ </tr>
93
+ </thead>
94
+ <tbody>
95
+ <tr>
96
+ <td style="border: 1px solid #ddd; padding: 8px">Fixed Rate</td>
97
+ <td style="border: 1px solid #ddd; padding: 8px">15 years</td>
98
+ <td style="border: 1px solid #ddd; padding: 8px">6.25</td>
99
+ </tr>
100
+ <tr style="background-color: #f9f9f9">
101
+ <td style="border: 1px solid #ddd; padding: 8px">Fixed Rate</td>
102
+ <td style="border: 1px solid #ddd; padding: 8px">30 years</td>
103
+ <td style="border: 1px solid #ddd; padding: 8px">6.75</td>
104
+ </tr>
105
+ <tr>
106
+ <td style="border: 1px solid #ddd; padding: 8px">ARM 5/1</td>
107
+ <td style="border: 1px solid #ddd; padding: 8px">30 years</td>
108
+ <td style="border: 1px solid #ddd; padding: 8px">5.95</td>
109
+ </tr>
110
+ <tr style="background-color: #f9f9f9">
111
+ <td style="border: 1px solid #ddd; padding: 8px">ARM 7/1</td>
112
+ <td style="border: 1px solid #ddd; padding: 8px">30 years</td>
113
+ <td style="border: 1px solid #ddd; padding: 8px">6.10</td>
114
+ </tr>
115
+ <tr>
116
+ <td style="border: 1px solid #ddd; padding: 8px">FHA Loan</td>
117
+ <td style="border: 1px solid #ddd; padding: 8px">30 years</td>
118
+ <td style="border: 1px solid #ddd; padding: 8px">6.50</td>
119
+ </tr>
120
+ <tr style="background-color: #f9f9f9">
121
+ <td style="border: 1px solid #ddd; padding: 8px">VA Loan</td>
122
+ <td style="border: 1px solid #ddd; padding: 8px">30 years</td>
123
+ <td style="border: 1px solid #ddd; padding: 8px">6.35</td>
124
+ </tr>
125
+ </tbody>
126
+ </table>
127
+ <p
128
+ style="margin-top: 15px; font-size: 0.9em; color: #666"
129
+ data-private="true"
130
+ >
131
+ <em
132
+ >* Rates are subject to change. Last updated: October 21, 2025</em
133
+ >
134
+ </p>
135
+ </div>
136
+ </div>
137
+ <div>
138
+ <button id="load-child-apps-btn">Load Child Apps</button>
139
+ <div id="child-apps-container"></div>
140
+ </div>
141
+ <script src="./test.js" type="module"></script>
142
+ </main>
143
+ </body>
144
+ </html>
@@ -0,0 +1,12 @@
1
+ import{createIFramedMicroapp as s}from"./utils.js";import{faker as r}from"https://cdn.jsdelivr.net/npm/@faker-js/faker/+esm";const c=r.person.fullName(),n=r.internet.email();`${c}${n}`;const u=()=>{window.emui.logRocketConfig.childDomains=["https://vinothvk.com","https://beta.vinothvk.com","https://vinothkumarvk.com"];const e={isReact:!1,release:"26.1.0"};window.emuiLogrocket.initLogRocket(e),window.emui.logRocket.identify(n,{name:c,email:n})},p=()=>{fetch("https://jsonplaceholder.typicode.com/posts/1").then(e=>e.json()).catch(e=>console.error("Error fetching post:",e)),fetch("https://jsonplaceholder.typicode.com/users/1").then(e=>e.json()).catch(e=>console.error("Error fetching user:",e)),window.emui.logRocket.track("fetch_done",{timestamp:new Date().toISOString()})},h=()=>{const e=document.getElementById("monthly-payment"),t=parseFloat(document.getElementById("loan-amount").value),o=parseFloat(document.getElementById("loan-term").value),l=parseFloat(document.getElementById("interest-rate").value)/100;if(isNaN(t)||isNaN(o)||isNaN(l)){e.textContent="Please enter valid numbers.";return}const i=l/12,m=o*12,d=t*i/(1-(1+i)**-m);e.textContent=`Monthly Payment: $${d.toFixed(2)}`,p()},g=()=>{s("./microapp1-same-domain.html"),s("https://vinothkumarvk.com/microapp2-cross-domain.html",{height:"400px"})},a=()=>{window.emuiLogrocket&&u(),document.getElementById("applicant-name").value=c,document.getElementById("applicant-email").textContent=n,document.getElementById("calculate-btn").addEventListener("click",h),document.getElementById("load-child-apps-btn").addEventListener("click",g)},y=()=>{const e=document.createElement("dialog");e.id="cookie-consent-dialog",e.innerHTML=`
2
+ <form method="dialog">
3
+ <h2>Cookie Consent</h2>
4
+ <p>We use cookies to enhance your experience. By clicking "Accept All", you consent to the use of all cookies. You can also choose to "Reject All" cookies.</p>
5
+ <menu>
6
+ <button id="accept-all" value="accept">Accept All</button>
7
+ <button id="reject-all" value="reject">Reject All</button>
8
+ </menu>
9
+ </form>
10
+ `,document.body.appendChild(e),e.showModal();const t=document.getElementById("accept-all"),o=document.getElementById("reject-all");t.addEventListener("click",()=>{window.OnetrustActiveGroups="C0002,C0004",e.close(),a()}),o.addEventListener("click",()=>{window.OnetrustActiveGroups="",e.close(),a()})},k=()=>{if(new URLSearchParams(window.location.search).get("trackingConsent")==="false"){y();return}else window.emui=window.emui||{},window.emui.dangerouslyOverrideOneTrustConsent=!0,a()};window.addEventListener("load",k);
11
+
12
+ //# sourceMappingURL=test.js.map
Binary file
Binary file
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack://emuiLogrocket/test.js"],"sourcesContent":["import { createIFramedMicroapp } from './utils.js';\nimport { faker } from 'https://cdn.jsdelivr.net/npm/@faker-js/faker/+esm';\n\n// Generate and log a random user name and email using faker\nconst randomName = faker.person.fullName();\nconst randomEmail = faker.internet.email();\nconsole.log(`Random User: ${randomName}, Email: ${randomEmail}`);\n\n/**\n * Initializes LogRocket with specified child domains and identifies the user.\n */\nconst initLogRocket = () => {\n window.emui.logRocketConfig.childDomains = [\n 'https://vinothvk.com',\n 'https://beta.vinothvk.com',\n 'https://vinothkumarvk.com',\n ];\n const options = {\n isReact: false,\n release: '26.1.0',\n // dom : {\n // hiddenAttributes: [],\n // inputSanitizer: true,\n // textSanitizer: true,\n // }\n };\n window.emuiLogrocket.initLogRocket(options);\n window.emui.logRocket.identify(randomEmail, {\n name: randomName,\n email: randomEmail,\n });\n};\n\n/**\n * make some sample fetch calls to demonstrate network logging\n */\nconst makeSampleFetchCalls = () => {\n fetch('https://jsonplaceholder.typicode.com/posts/1')\n .then((response) => response.json())\n .catch((error) => console.error('Error fetching post:', error));\n\n fetch('https://jsonplaceholder.typicode.com/users/1')\n .then((response) => response.json())\n .catch((error) => console.error('Error fetching user:', error));\n\n // log a metric\n window.emui.logRocket.track('fetch_done', {\n timestamp: new Date().toISOString(),\n });\n};\n\n/**\n * Calculates the monthly payment for a loan.\n * @returns {void}\n */\nconst calculateMonthlyPayment = () => {\n const monthlyPaymentEl = document.getElementById('monthly-payment');\n const principal = parseFloat(document.getElementById('loan-amount').value);\n const years = parseFloat(document.getElementById('loan-term').value);\n const interestRate =\n parseFloat(document.getElementById('interest-rate').value) / 100;\n\n if (isNaN(principal) || isNaN(years) || isNaN(interestRate)) {\n monthlyPaymentEl.textContent = 'Please enter valid numbers.';\n return;\n }\n\n const monthlyInterestRate = interestRate / 12;\n const numberOfPayments = years * 12;\n\n const monthlyPayment =\n (principal * monthlyInterestRate) /\n (1 - (1 + monthlyInterestRate) ** -numberOfPayments);\n monthlyPaymentEl.textContent = `Monthly Payment: $${monthlyPayment.toFixed(\n 2,\n )}`;\n makeSampleFetchCalls();\n};\n\n/**\n * Creates iframes for the microapps.\n */\nconst createIframes = () => {\n createIFramedMicroapp(`./microapp1-same-domain.html`);\n createIFramedMicroapp(\n `https://vinothkumarvk.com/microapp2-cross-domain.html`,\n { height: '400px' },\n );\n};\n\n/**\n * Loads the main application functionalities.\n */\nconst load = () => {\n // Initialize LogRocket if available\n if (window.emuiLogrocket) initLogRocket();\n // Set up event listeners for buttons\n document.getElementById('applicant-name').value = randomName;\n document.getElementById('applicant-email').textContent = randomEmail;\n const calculateBtn = document.getElementById('calculate-btn');\n calculateBtn.addEventListener('click', calculateMonthlyPayment);\n const loadAppsBtn = document.getElementById('load-child-apps-btn');\n loadAppsBtn.addEventListener('click', createIframes);\n};\n\n/**\n * Creates and displays a cookie consent banner dialog.\n * The dialog allows users to accept or reject all cookies.\n * Sets the `window.OnetrustActiveGroups` variable based on user choice,\n * closes the dialog, and calls the `load()` function.\n *\n * @function\n */\nconst createCookieBannerDialog = () => {\n const dialog = document.createElement('dialog');\n dialog.id = 'cookie-consent-dialog';\n dialog.innerHTML = `\n <form method=\"dialog\">\n <h2>Cookie Consent</h2>\n <p>We use cookies to enhance your experience. By clicking \"Accept All\", you consent to the use of all cookies. You can also choose to \"Reject All\" cookies.</p>\n <menu>\n <button id=\"accept-all\" value=\"accept\">Accept All</button>\n <button id=\"reject-all\" value=\"reject\">Reject All</button>\n </menu>\n </form>\n `;\n document.body.appendChild(dialog);\n dialog.showModal();\n\n const acceptBtn = document.getElementById('accept-all');\n const rejectBtn = document.getElementById('reject-all');\n\n acceptBtn.addEventListener('click', () => {\n window.OnetrustActiveGroups = 'C0002,C0004';\n dialog.close();\n load();\n });\n\n rejectBtn.addEventListener('click', () => {\n window.OnetrustActiveGroups = '';\n dialog.close();\n load();\n });\n};\n\n/**\n * event handler for the window load event.\n * @returns {void}\n */\nconst onLoad = () => {\n // if cookie consent query param is present, do not show cookie banner\n const urlParams = new URLSearchParams(window.location.search);\n if (urlParams.get('trackingConsent') === 'false') {\n createCookieBannerDialog();\n return;\n } else {\n //window.OnetrustActiveGroups = 'C0002,C0004';\n window.emui = window.emui || {};\n window.emui.dangerouslyOverrideOneTrustConsent = true;\n load();\n }\n};\n\nwindow.addEventListener('load', onLoad);\n"],"mappings":"AAAA,OAAS,yBAAAA,MAA6B,aACtC,OAAS,SAAAC,MAAa,oDAGtB,MAAMC,EAAaD,EAAM,OAAO,SAAS,EACnCE,EAAcF,EAAM,SAAS,MAAM,EACb,GAAAC,CAN5B,GAMkDC,CANlD,GAWA,MAAMC,EAAgB,IAAM,CAC1B,OAAO,KAAK,gBAAgB,aAAe,CACzC,uBACA,4BACA,2BACF,EACA,MAAMC,EAAU,CACd,QAAS,GACT,QAAS,QAMX,EACA,OAAO,cAAc,cAAcA,CAAO,EAC1C,OAAO,KAAK,UAAU,SAASF,EAAa,CAC1C,KAAMD,EACN,MAAOC,CACT,CAAC,CACH,EAKMG,EAAuB,IAAM,CACjC,MAAM,8CAA8C,EACjD,KAAMC,GAAaA,EAAS,KAAK,CAAC,EAClC,MAAOC,GAAU,QAAQ,MAAM,uBAAwBA,CAAK,CAAC,EAEhE,MAAM,8CAA8C,EACjD,KAAMD,GAAaA,EAAS,KAAK,CAAC,EAClC,MAAOC,GAAU,QAAQ,MAAM,uBAAwBA,CAAK,CAAC,EAGhE,OAAO,KAAK,UAAU,MAAM,aAAc,CACxC,UAAW,IAAI,KAAK,EAAE,YAAY,CACpC,CAAC,CACH,EAMMC,EAA0B,IAAM,CACpC,MAAMC,EAAmB,SAAS,eAAe,iBAAiB,EAC5DC,EAAY,WAAW,SAAS,eAAe,aAAa,EAAE,KAAK,EACnEC,EAAQ,WAAW,SAAS,eAAe,WAAW,EAAE,KAAK,EAC7DC,EACJ,WAAW,SAAS,eAAe,eAAe,EAAE,KAAK,EAAI,IAE/D,GAAI,MAAMF,CAAS,GAAK,MAAMC,CAAK,GAAK,MAAMC,CAAY,EAAG,CAC3DH,EAAiB,YAAc,8BAC/B,MACF,CAEA,MAAMI,EAAsBD,EAAe,GACrCE,EAAmBH,EAAQ,GAE3BI,EACHL,EAAYG,GACZ,GAAK,EAAIA,IAAwB,CAACC,GACrCL,EAAiB,YAAc,qBAAqBM,EAAe,QACjE,CACF,CAAC,GACDV,EAAqB,CACvB,EAKMW,EAAgB,IAAM,CAC1BjB,EAAsB,8BAA8B,EACpDA,EACE,wDACA,CAAE,OAAQ,OAAQ,CACpB,CACF,EAKMkB,EAAO,IAAM,CAEb,OAAO,eAAed,EAAc,EAExC,SAAS,eAAe,gBAAgB,EAAE,MAAQF,EAClD,SAAS,eAAe,iBAAiB,EAAE,YAAcC,EACpC,SAAS,eAAe,eAAe,EAC/C,iBAAiB,QAASM,CAAuB,EAC1C,SAAS,eAAe,qBAAqB,EACrD,iBAAiB,QAASQ,CAAa,CACrD,EAUME,EAA2B,IAAM,CACrC,MAAMC,EAAS,SAAS,cAAc,QAAQ,EAC9CA,EAAO,GAAK,wBACZA,EAAO,UAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAUnB,SAAS,KAAK,YAAYA,CAAM,EAChCA,EAAO,UAAU,EAEjB,MAAMC,EAAY,SAAS,eAAe,YAAY,EAChDC,EAAY,SAAS,eAAe,YAAY,EAEtDD,EAAU,iBAAiB,QAAS,IAAM,CACxC,OAAO,qBAAuB,cAC9BD,EAAO,MAAM,EACbF,EAAK,CACP,CAAC,EAEDI,EAAU,iBAAiB,QAAS,IAAM,CACxC,OAAO,qBAAuB,GAC9BF,EAAO,MAAM,EACbF,EAAK,CACP,CAAC,CACH,EAMMK,EAAS,IAAM,CAGnB,GADkB,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAC9C,IAAI,iBAAiB,IAAM,QAAS,CAChDJ,EAAyB,EACzB,MACF,MAEE,OAAO,KAAO,OAAO,MAAQ,CAAC,EAC9B,OAAO,KAAK,mCAAqC,GACjDD,EAAK,CAET,EAEA,OAAO,iBAAiB,OAAQK,CAAM","names":["createIFramedMicroapp","faker","randomName","randomEmail","initLogRocket","options","makeSampleFetchCalls","response","error","calculateMonthlyPayment","monthlyPaymentEl","principal","years","interestRate","monthlyInterestRate","numberOfPayments","monthlyPayment","createIframes","load","createCookieBannerDialog","dialog","acceptBtn","rejectBtn","onLoad"],"sourceRoot":"","file":"test.js"}
@@ -0,0 +1,3 @@
1
+ window.emui=window.emui||{},window.emui.logRocketConfig={appId:"fds38t/test-1izuw",rootHostname:".vinothvk.com"},window.emui.dangerouslyOverrideSessionRecordingConsent=!0;export const createIFramedMicroapp=(e,{width:t="100%",height:n="150px"}={})=>{const i=document.getElementById("child-apps-container"),r=window.emuiLogrocket.buildLogRocketQueryParams(),o=document.createElement("iframe");o.src=`${e}?${r}`,o.style.width=t,o.style.height=n,o.style.marginTop="10px";const a=`#${Math.floor(Math.random()*16777215).toString(16)}`;o.style.border=`1px dashed ${a}`,o.sandbox="allow-forms allow-scripts allow-same-origin",i.appendChild(o)};
2
+
3
+ //# sourceMappingURL=utils.js.map
Binary file
Binary file
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack://emuiLogrocket/utils.js"],"sourcesContent":["window.emui = window.emui || {};\nwindow.emui.logRocketConfig = {\n // enable: false,\n appId: 'fds38t/test-1izuw',\n rootHostname: '.vinothvk.com',\n};\nwindow.emui.dangerouslyOverrideSessionRecordingConsent = true;\n\n/**\n * Creates an iframe microapp and appends it to the child apps container.\n * @param {*} src\n */\nexport const createIFramedMicroapp = (\n src,\n { width = '100%', height = '150px' } = {},\n) => {\n const childAppsContainer = document.getElementById('child-apps-container');\n const urlParams = window.emuiLogrocket.buildLogRocketQueryParams();\n const iframe = document.createElement('iframe');\n iframe.src = `${src}?${urlParams}`;\n iframe.style.width = width;\n iframe.style.height = height;\n iframe.style.marginTop = '10px';\n const randomColor = `#${Math.floor(Math.random() * 16777215).toString(16)}`;\n iframe.style.border = `1px dashed ${randomColor}`;\n iframe.sandbox = 'allow-forms allow-scripts allow-same-origin';\n childAppsContainer.appendChild(iframe);\n};\n"],"mappings":"AAAA,OAAO,KAAO,OAAO,MAAQ,CAAC,EAC9B,OAAO,KAAK,gBAAkB,CAE5B,MAAO,oBACP,aAAc,eAChB,EACA,OAAO,KAAK,2CAA6C,GAMlD,aAAM,sBAAwB,CACnCA,EACA,CAAE,MAAAC,EAAQ,OAAQ,OAAAC,EAAS,OAAQ,EAAI,CAAC,IACrC,CACH,MAAMC,EAAqB,SAAS,eAAe,sBAAsB,EACnEC,EAAY,OAAO,cAAc,0BAA0B,EAC3DC,EAAS,SAAS,cAAc,QAAQ,EAC9CA,EAAO,IAAM,GAAGL,CAAG,IAAII,CAAS,GAChCC,EAAO,MAAM,MAAQJ,EACrBI,EAAO,MAAM,OAASH,EACtBG,EAAO,MAAM,UAAY,OACzB,MAAMC,EAAc,IAAI,KAAK,MAAM,KAAK,OAAO,EAAI,QAAQ,EAAE,SAAS,EAAE,CAAC,GACzED,EAAO,MAAM,OAAS,cAAcC,CAAW,GAC/CD,EAAO,QAAU,8CACjBF,EAAmB,YAAYE,CAAM,CACvC","names":["src","width","height","childAppsContainer","urlParams","iframe","randomColor"],"sourceRoot":"","file":"utils.js"}
@@ -1,2 +1,2 @@
1
- export { initLogRocket, LogRocket } from './logrocket.js';
1
+ export { initLogRocket, hasUserConsentedToSessionRecording, buildLogRocketQueryParams, LogRocket, } from './logrocket.js';
2
2
  export type { LROptions } from './logrocket.js';
@@ -1,4 +1,7 @@
1
- import LogRocket from 'logrocket';
1
+ import * as LogRocket from 'logrocket';
2
+ /**
3
+ * LogRocket initialization options
4
+ */
2
5
  export type LROptions = Parameters<typeof LogRocket.init>[1] & {
3
6
  /**
4
7
  * unique identifier of the logrocket project
@@ -13,16 +16,53 @@ export type LROptions = Parameters<typeof LogRocket.init>[1] & {
13
16
  isReact?: boolean;
14
17
  };
15
18
  /**
16
- * initialize LogRocket
17
- * @example
18
- * initLogRocket({
19
- * appId: 'your-project/your-app',
20
- * isReact: true, // default is true
21
- * rootHostname: '.ice.com', // default is .ice.com
22
- * childDomains: ['.your-domain.com'], // default is null
23
- * parentDomain: '.your-domain.com', // default is null
24
- * });
25
- * @param options LROptions option to initialize logrocket
19
+ * Determines whether the user has consented to session recording based on OneTrust configuration and other signals.
20
+ *
21
+ * This function checks for user consent using multiple strategies, in the following order:
22
+ * 1. Checks for a manual override via `window.emui.dangerouslyOverrideSessionRecordingConsent`.
23
+ * 2. If OneTrust is loaded, checks if `window.OnetrustActiveGroups` contains the session recording group ID ('C0004').
24
+ * 3. If OneTrust is not loaded, checks the `analyticsConsent` query parameter in the URL.
25
+ * 4. Defaults to `false` if no consent can be determined.
26
+ *
27
+ * Note: When OneTrust is present, the OneTrust consent groups take precedence over the URL parameter.
28
+ * The `analyticsConsent` URL parameter only applies when OneTrust is not loaded.
29
+ * @returns {boolean} `true` if the user has consented to session recording, `false` otherwise.
30
+ */
31
+ declare const hasUserConsentedToSessionRecording: () => boolean;
32
+ /**
33
+ * Builds a URL query string containing LogRocket-related parameters.
34
+ *
35
+ * The query parameters include:
36
+ * - `analyticsConsent`: Indicates whether the user has consented to session recording (`'true'` or `'false'`).
37
+ * - `lrEnabled`: Indicates whether LogRocket is enabled based on the global configuration (`'true'` or `'false'`).
38
+ * - `lrAppId`: The LogRocket application ID, or an empty string if not available.
39
+ * @returns {string} The constructed query string with LogRocket parameters.
40
+ */
41
+ declare const buildLogRocketQueryParams: () => string;
42
+ /**
43
+ * Initialize LogRocket with optional OneTrust integration
44
+ *
45
+ * This function handles LogRocket initialization with support for OneTrust consent management.
46
+ * The initialization behavior depends on the `window.hasOneTrust` flag:
47
+ * - If `window.hasOneTrust` is true, initialization is deferred until OneTrust SDK calls `window.onetrustCallback`
48
+ * - If `window.hasOneTrust` is false or undefined, LogRocket initializes immediately
49
+ * @example
50
+ * // With OneTrust (when window.hasOneTrust is true)
51
+ * initLogRocket({
52
+ * appId: 'your-project/your-app',
53
+ * isReact: true,
54
+ * rootHostname: '.ice.com',
55
+ * childDomains: ['https://your-child-domain.com'],
56
+ * parentDomain: 'https://your-parent-domain.com',
57
+ * });
58
+ * @example
59
+ * // Without OneTrust (when window.hasOneTrust is false/undefined)
60
+ * initLogRocket({
61
+ * appId: 'your-project/your-app',
62
+ * });
63
+ * @param {LROptions} [options] - LogRocket initialization options
64
+ * @param {string} [options.appId] - LogRocket application ID
65
+ * @param {boolean} [options.isReact=true] - Whether the application uses React
26
66
  */
27
67
  declare const initLogRocket: (options?: LROptions) => void;
28
- export { LogRocket, initLogRocket };
68
+ export { LogRocket, initLogRocket, hasUserConsentedToSessionRecording, buildLogRocketQueryParams, };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,16 +1,89 @@
1
1
  import LogRocket from 'logrocket';
2
+ import { Logger } from '@elliemae/pui-diagnostics';
3
+ /**
4
+ * EMUI global interface
5
+ */
2
6
  interface EMUI {
7
+ /**
8
+ * LogRocket instance
9
+ */
3
10
  logRocket: typeof LogRocket;
11
+ /**
12
+ * LogRocket configuration options
13
+ */
4
14
  logRocketConfig?: {
15
+ /**
16
+ * Enable or disable LogRocket initialization
17
+ */
18
+ enable?: boolean;
19
+ /**
20
+ * LogRocket application ID
21
+ */
5
22
  appId: string;
23
+ /**
24
+ * Child domains for LogRocket session sharing
25
+ */
6
26
  childDomains?: string[];
27
+ /**
28
+ * Parent domain for LogRocket session sharing
29
+ */
7
30
  parentDomain?: string;
31
+ /**
32
+ * Root hostname for LogRocket session sharing
33
+ */
8
34
  rootHostname?: string;
9
35
  };
36
+ /**
37
+ * Logger instance for logging
38
+ */
39
+ logger?: Logger;
40
+ /**
41
+ * Flag for developers to manually set consent for testing purposes
42
+ */
43
+ dangerouslyOverrideSessionRecordingConsent?: boolean;
44
+ }
45
+ /**
46
+ * OneTrust API interface
47
+ */
48
+ interface OneTrustAPI {
49
+ IsAlertBoxClosed: () => boolean;
50
+ getGeolocationData: () => {
51
+ region: string;
52
+ country: string;
53
+ };
54
+ AllowAll: () => void;
55
+ RejectAll: () => void;
56
+ ToggleInfoDisplay: () => void;
57
+ LoadBanner: () => void;
10
58
  }
11
59
  declare global {
12
60
  interface Window {
61
+ /**
62
+ * EMUI global object provided by microapp
63
+ */
13
64
  emui: EMUI;
65
+ /**
66
+ * enable onetrust integration
67
+ */
68
+ hasOneTrust?: boolean;
69
+ /**
70
+ * OneTrust API object
71
+ */
72
+ OneTrust?: OneTrustAPI;
73
+ /**
74
+ * Comma-separated list of active OneTrust consent groups
75
+ */
76
+ OnetrustActiveGroups?: string;
77
+ /**
78
+ * Callback function invoked by OneTrust when consent preferences change
79
+ * @returns void
80
+ */
81
+ OptanonWrapper?: () => void;
82
+ /**
83
+ * Callback function to be invoked when OneTrust is ready
84
+ * @returns void
85
+ */
86
+ onetrustCallback?: () => void;
14
87
  }
15
88
  }
16
89
  export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Deep merges two objects, recursively merging nested objects.
3
+ * Arrays are replaced, not merged. Functions are copied by reference.
4
+ * @param {any} target - The target object to merge into
5
+ * @param {any} source - The source object to merge from
6
+ * @returns {any} The merged object
7
+ */
8
+ export declare const deepMerge: (target: any, source: any) => any;