{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/9vKm3dRBJxRDnJAs2gHk/Ryg7VfgqK8CdQLy1awK1/Trengo_open_chat.js"],
  "sourcesContent": ["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useCallback } from \"react\";\nexport function withTrengoChat(Component) {\n  return props => {\n    // Define the click handler using useCallback for performance\n    const handleAction = useCallback(() => {\n      window.Trengo.Api.Widget.open(\"chat\");\n    }, []) // Empty dependency array ensures this callback is memoized across renders.\n    ;\n    return /*#__PURE__*/_jsx(Component, {\n      ...props,\n      onTap: handleAction,\n      onClick: handleAction\n    });\n  };\n}\nexport function withTrengoWhatsapp(Component) {\n  return props => {\n    // Define the click handler using useCallback for performance\n    const handleAction = useCallback(() => {\n      window.Trengo.Api.Widget.open(\"whatsapp\");\n    }, []) // Empty dependency array ensures this callback is memoized across renders.\n    ;\n    return /*#__PURE__*/_jsx(Component, {\n      ...props,\n      onTap: handleAction,\n      onClick: handleAction\n    });\n  };\n} // New function for Odoo Chat\nexport function withOdooChat(Component) {\n  return props => {\n    // Define the click handler using useCallback for performance\n    const handleAction = useCallback(() => {\n      // Locate Odoo live chat button by its class\n      const odooChatButton = document.querySelector(\".openerp.o_livechat_button.d-print-none\"); // Simulate a click event on the live chat button\n      if (odooChatButton) {\n        odooChatButton.click();\n      }\n    }, []) // Empty dependency array ensures this callback is memoized across renders.\n    ;\n    return /*#__PURE__*/_jsx(Component, {\n      ...props,\n      onTap: handleAction,\n      onClick: handleAction\n    });\n  };\n}\nexport const __FramerMetadata__ = {\n  \"exports\": {\n    \"withOdooChat\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"withOdooChat\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"withTrengoChat\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"withTrengoChat\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"withTrengoWhatsapp\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"withTrengoWhatsapp\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"__FramerMetadata__\": {\n      \"type\": \"variable\"\n    }\n  }\n};\n//# sourceMappingURL=./Trengo_open_chat.map"],
  "mappings": "kIAAAA,IAEO,SAASC,EAAeC,EAAW,CACxC,OAAOC,GAAS,CAEd,IAAMC,EAAeC,EAAY,IAAM,CACrCC,EAAO,OAAO,IAAI,OAAO,KAAK,MAAM,CACtC,EAAG,CAAC,CAAC,EAEL,OAAoBC,EAAKL,EAAW,CAClC,GAAGC,EACH,MAAOC,EACP,QAASA,CACX,CAAC,CACH,CACF,CAeO,SAASI,EAAaC,EAAW,CACtC,OAAOC,GAAS,CAEd,IAAMC,EAAeC,EAAY,IAAM,CAErC,IAAMC,EAAiB,SAAS,cAAc,yCAAyC,EACnFA,GACFA,EAAe,MAAM,CAEzB,EAAG,CAAC,CAAC,EAEL,OAAoBC,EAAKL,EAAW,CAClC,GAAGC,EACH,MAAOC,EACP,QAASA,CACX,CAAC,CACH,CACF",
  "names": ["init_shims", "withTrengoChat", "Component", "props", "handleAction", "te", "window", "p", "withOdooChat", "Component", "props", "handleAction", "te", "odooChatButton", "p"]
}
