{"size": 1178, "ext": "js", "max_stars_repo_path": "website/core/plugins/Intercom.js", "max_stars_repo_name": "sumyapp/sider-docs", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "website/core/plugins/Intercom.js", "max_issues_repo_name": "sumyapp/sider-docs", "max_issues_repo_issues_event_min_datetime": "2020-07-10T01:34:36.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-28T00:03:27.000Z", "max_forks_repo_path": "website/core/plugins/Intercom.js", "max_forks_repo_name": "sumyapp/sider-docs", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 29, "max_forks_count": null, "avg_line_length": 33.6571428571, "max_line_length": 560, "alphanum_fraction": 0.5696095076}
const React = require("react");

const appId = process.env.CONTEXT === "production" ? "rpwp2i8e" : "671su9bf";

class Intercom extends React.Component {
  intercomChat() {
    return (
      <>
        <script
          dangerouslySetInnerHTML={{
            __html: `
              window.intercomSettings = {
                app_id: "${appId}"
              };
            `,
          }}
        />
        <script
          dangerouslySetInnerHTML={{
            __html: `
            (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/' + "${appId}";var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
            `,
          }}
        />
      </>
    );
  }

  render() {
    return this.intercomChat();
  }
}

module.exports = Intercom;
