@rtstic.dev/pulse 0.0.96 → 0.0.98
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{function
|
|
1
|
+
"use strict";(()=>{function s(){return{firstName:sessionStorage.getItem("ty_firstName")??"",lastName:sessionStorage.getItem("ty_lastName")??"",email:sessionStorage.getItem("ty_email")??"",showCalendar:sessionStorage.getItem("ty_showCalendar")==="true",calendarName:sessionStorage.getItem("ty_calendarName")??"",embedUrl:sessionStorage.getItem("ty_embedUrl")??"",flow:sessionStorage.getItem("ty_flow")??""}}function n(){let e=document.querySelector("[hs-calender-block]");e&&(e.setAttribute("hs-calender-block-active","false"),e.innerHTML=""),document.querySelectorAll("[hs-thankyou-block-active]").forEach(t=>t.setAttribute("hs-thankyou-block-active","true"))}function r(){let e=sessionStorage.getItem("ty_flow")??"";e&&document.querySelectorAll("[hs-thankyou-flow]").forEach(t=>{let o=t.getAttribute("hs-thankyou-flow");t.setAttribute("form-flow-active",o===e?"true":"false")})}function i(){let e=s();if(r(),n(),e.embedUrl){let t=e.embedUrl.split("?")[0],o=new URLSearchParams;e.firstName&&o.set("firstName",e.firstName),e.lastName&&o.set("lastName",e.lastName),e.email&&o.set("email",e.email);let a=o.toString()?`${t}?${o.toString()}`:t;setTimeout(()=>{window.location.href=a},1e3)}}document.addEventListener("DOMContentLoaded",()=>{i()});})();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/form/book-a-demo/thank-you.ts"],
|
|
4
|
-
"sourcesContent": ["function getSessionData() {\n return {\n firstName: sessionStorage.getItem(\"ty_firstName\") ?? \"\",\n lastName: sessionStorage.getItem(\"ty_lastName\") ?? \"\",\n email: sessionStorage.getItem(\"ty_email\") ?? \"\",\n showCalendar: sessionStorage.getItem(\"ty_showCalendar\") === \"true\",\n calendarName: sessionStorage.getItem(\"ty_calendarName\") ?? \"\",\n embedUrl: sessionStorage.getItem(\"ty_embedUrl\") ?? \"\",\n flow: sessionStorage.getItem(\"ty_flow\") ?? \"\",\n };\n}\n\nfunction hasCookieConsent(): boolean {\n const state = (window as any).Termly?.getConsentState();\n if (!state) return false;\n return state.analytics === true && state.advertising === true;\n}\n\nfunction showThankYou(): void {\n const container = document.querySelector<HTMLElement>(\"[hs-calender-block]\");\n if (container) {\n container.setAttribute(\"hs-calender-block-active\", \"false\");\n container.innerHTML = \"\";\n }\n document.querySelectorAll<HTMLElement>(\"[hs-thankyou-block-active]\")\n .forEach((el) => el.setAttribute(\"hs-thankyou-block-active\", \"true\"));\n}\n\nfunction loadCalendar(data: ReturnType<typeof getSessionData>): void {\n const container = document.querySelector<HTMLElement>(\"[hs-calender-block]\");\n if (!container) return;\n\n const consentGiven = hasCookieConsent();\n\n if (!data.showCalendar || !data.embedUrl || !consentGiven) {\n
|
|
5
|
-
"mappings": ";;;AAAA,WAAS,iBAAiB;AACtB,WAAO;AAAA,MACH,WAAW,eAAe,QAAQ,cAAc,KAAK;AAAA,MACrD,UAAU,eAAe,QAAQ,aAAa,KAAK;AAAA,MACnD,OAAO,eAAe,QAAQ,UAAU,KAAK;AAAA,MAC7C,cAAc,eAAe,QAAQ,iBAAiB,MAAM;AAAA,MAC5D,cAAc,eAAe,QAAQ,iBAAiB,KAAK;AAAA,MAC3D,UAAU,eAAe,QAAQ,aAAa,KAAK;AAAA,MACnD,MAAM,eAAe,QAAQ,SAAS,KAAK;AAAA,IAC/C;AAAA,EACJ;
|
|
4
|
+
"sourcesContent": ["function getSessionData() {\n return {\n firstName: sessionStorage.getItem(\"ty_firstName\") ?? \"\",\n lastName: sessionStorage.getItem(\"ty_lastName\") ?? \"\",\n email: sessionStorage.getItem(\"ty_email\") ?? \"\",\n showCalendar: sessionStorage.getItem(\"ty_showCalendar\") === \"true\",\n calendarName: sessionStorage.getItem(\"ty_calendarName\") ?? \"\",\n embedUrl: sessionStorage.getItem(\"ty_embedUrl\") ?? \"\",\n flow: sessionStorage.getItem(\"ty_flow\") ?? \"\",\n };\n}\n\nfunction hasCookieConsent(): boolean {\n const state = (window as any).Termly?.getConsentState();\n if (!state) return false;\n return state.analytics === true && state.advertising === true;\n}\n\nfunction showThankYou(): void {\n const container = document.querySelector<HTMLElement>(\"[hs-calender-block]\");\n if (container) {\n container.setAttribute(\"hs-calender-block-active\", \"false\");\n container.innerHTML = \"\";\n }\n document.querySelectorAll<HTMLElement>(\"[hs-thankyou-block-active]\")\n .forEach((el) => el.setAttribute(\"hs-thankyou-block-active\", \"true\"));\n}\n\nfunction loadCalendar(data: ReturnType<typeof getSessionData>): void {\n // calendar disabled for now \u2014 always show thank you\n showThankYou();\n return;\n // ...\n // keeping below code for future use\n // const container = document.querySelector<HTMLElement>(\"[hs-calender-block]\");\n // if (!container) return;\n\n // const consentGiven = hasCookieConsent();\n\n // if (!data.showCalendar || !data.embedUrl || !consentGiven) {\n // showThankYou();\n // return;\n // }\n\n // container.setAttribute(\"hs-calender-block-active\", \"true\");\n // container.innerHTML = \"\";\n // document.querySelectorAll<HTMLElement>(\"[hs-thankyou-block-active]\")\n // .forEach((el) => el.setAttribute(\"hs-thankyou-block-active\", \"false\"));\n\n // const prefillParams = new URLSearchParams();\n // if (data.firstName) prefillParams.set(\"firstName\", data.firstName);\n // if (data.lastName) prefillParams.set(\"lastName\", data.lastName);\n // if (data.email) prefillParams.set(\"email\", data.email);\n\n // const separator = data.embedUrl.includes(\"?\") ? \"&\" : \"?\";\n // const embedUrl = prefillParams.toString()\n // ? `${data.embedUrl}${separator}${prefillParams.toString()}`\n // : data.embedUrl;\n\n // const meetingsDiv = document.createElement(\"div\");\n // meetingsDiv.className = \"meetings-iframe-container\";\n // meetingsDiv.setAttribute(\"data-src\", embedUrl);\n // container.appendChild(meetingsDiv);\n\n // const scriptSrc = \"https://static.hsappstatic.net/MeetingsEmbed/ex/MeetingsEmbedCode.js\";\n // const existingScript = document.querySelector<HTMLScriptElement>(`script[src=\"${scriptSrc}\"]`);\n // if (existingScript) existingScript.remove();\n\n // const script = document.createElement(\"script\");\n // script.type = \"text/javascript\";\n // script.src = scriptSrc;\n // container.appendChild(script);\n}\n\nfunction setFlowAttribute(): void {\n const flow = sessionStorage.getItem(\"ty_flow\") ?? \"\";\n if (!flow) return;\n\n document.querySelectorAll<HTMLElement>(\"[hs-thankyou-flow]\")\n .forEach((el) => {\n const elFlow = el.getAttribute(\"hs-thankyou-flow\");\n el.setAttribute(\n \"form-flow-active\",\n elFlow === flow ? \"true\" : \"false\"\n );\n });\n}\n\n// \u2500\u2500 Active boot \u2014 shows thank you for all cases \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nfunction init(): void {\n const data = getSessionData();\n // console.log(\"embedUrl:\", data.embedUrl);\n // console.log(\"showCalendar:\", data.showCalendar);\n setFlowAttribute();\n showThankYou();\n\n if (data.embedUrl) {\n // Strip any existing params from the embed URL before redirecting\n const cleanUrl = data.embedUrl.split(\"?\")[0];\n\n setTimeout(() => {\n window.location.href = cleanUrl;\n }, 1000);\n }\n}\n\n// \u2500\u2500 Future boot \u2014 uncomment when calendar is ready \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// document.addEventListener(\"DOMContentLoaded\", () => {\n// const data = getSessionData();\n// setFlowAttribute();\n// showThankYou();\n//\n// (window as any).Termly?.on(\"initialized\", () => {\n// setTimeout(() => loadCalendar(data), 300);\n// });\n//\n// (window as any).Termly?.on(\"consent\", () => {\n// setTimeout(() => loadCalendar(data), 300);\n// });\n//\n// setTimeout(() => {\n// const state = (window as any).Termly?.getConsentState();\n// if (state) loadCalendar(data);\n// }, 500);\n// });\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n init();\n console.log(\"welcome\uD83D\uDC38\")\n});"],
|
|
5
|
+
"mappings": ";;;AAAA,WAAS,iBAAiB;AACtB,WAAO;AAAA,MACH,WAA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