1717 *
1818 * ENGRID PAGE TEMPLATE ASSETS
1919 *
20- * Date: Thursday, November 13, 2025 @ 00:28:58 ET
21- * By: fernando
20+ * Date: Thursday, November 13, 2025 @ 08: 00:35 ET
21+ * By: michael
2222 * ENGrid styles: v0.23.0
2323 * ENGrid scripts: v0.23.2
2424 *
@@ -26967,6 +26967,71 @@ class AddDAF {
2696726967 });
2696826968 }
2696926969
26970+ }
26971+ ;// CONCATENATED MODULE: ./src/scripts/Bridger.ts
26972+
26973+ class Bridger {
26974+ constructor() {
26975+ _defineProperty(this, "endpoint", "https://wwfusprdenbridgercheckeus1.azurewebsites.net/api/createsearch");
26976+
26977+ _defineProperty(this, "key", "-CDxXc3SdzG6a_LLJGKA_p3qJMnZnnsH3DLDGeK97nwXAzFuFmfh5g==");
26978+
26979+ _defineProperty(this, "bridgerAmountThreshold", window.BridgerAmountThreshold || 500);
26980+
26981+ if (!this.shouldRun()) return;
26982+ this.createBridgerSearchRecord();
26983+ }
26984+
26985+ shouldRun() {
26986+ return window.pageJson.giftProcess && window.pageJson.amount >= this.bridgerAmountThreshold && window.pageJson.currency === "USD";
26987+ }
26988+
26989+ createBridgerSearchRecord() {
26990+ this.sendApiRequest().then(data => {//console.log(data);
26991+ });
26992+ }
26993+
26994+ async sendApiRequest() {
26995+ let data = null;
26996+
26997+ try {
26998+ const body = JSON.stringify({
26999+ firstName: this.getUserData("firstName"),
27000+ lastName: this.getUserData("lastName"),
27001+ address1: `${this.getUserData("address1")} ${this.getUserData("address2")}`,
27002+ city: this.getUserData("city"),
27003+ country: this.getUserData("country"),
27004+ postalCode: this.getUserData("zipCode")
27005+ });
27006+ const response = await fetch(this.endpoint, {
27007+ method: "POST",
27008+ headers: {
27009+ "Content-Type": "application/json",
27010+ "x-functions-key": this.key
27011+ },
27012+ body: body
27013+ });
27014+
27015+ if (response.ok) {
27016+ data = await response.json();
27017+ } else {
27018+ console.log("API request failed");
27019+ }
27020+ } catch (error) {
27021+ console.log("API request failed");
27022+ }
27023+
27024+ return data;
27025+ }
27026+
27027+ getUserData(property) {
27028+ if (!window.userData || !window.userData[property] || window.userData[property].startsWith("{")) {
27029+ return "";
27030+ }
27031+
27032+ return window.userData[property];
27033+ }
27034+
2697027035}
2697127036;// CONCATENATED MODULE: ./src/index.ts
2697227037 // Uses ENGrid via NPM
@@ -26987,6 +27052,7 @@ class AddDAF {
2698727052
2698827053
2698927054
27055+
2699027056const options = {
2699127057 AutoYear: true,
2699227058 applePay: false,
@@ -27155,6 +27221,8 @@ const options = {
2715527221
2715627222 unsubscribeAllRadio.closest(".en__field")?.classList.add("hide");
2715727223 }
27224+
27225+ new Bridger();
2715827226 },
2715927227 onResize: () => console.log("Starter Theme Window Resized"),
2716027228 onSubmit: () => {
0 commit comments