<commit_before>{{!--

  Core JavaScript to power widget functionality.

  TODO: Eventually this should get merged in as part of the {{squatchHead}} core helper instead of being manually included in every template

  Eventually we can abstract this.

--}}

<script>
  window.squatch = window.squatch || {};
  window.squatch.user = {
    code     : '{{referredBy.referredByUser.referralCode}}',
    sharelink: '{{shareLinks.shareLink}}',
    email    : {
      share : {
        subject: '{{urlencode (variables 'widget.REFERRER_WIDGET.content.shareMessaging.emailShareSubject') space="%20"}}',
        body: '{{urlencode (variables 'widget.REFERRER_WIDGET.content.shareMessaging.emailShareBody') space="%20"}}',
        mailToLink: 'mailto:?subject={{urlencode (variables 'widget.REFERRER_WIDGET.content.shareMessaging.emailShareSubject') space="%20"}}&body={{urlencode (variables 'widget.REFERRER_WIDGET.content.shareMessaging.emailShareBody') space="%20"}}',
      },
      reminder: {
        subject: '{{urlencode "How do you like Acme so far?" space="%20"}}',
        body: '{{urlencode (stringFormat "Hey,%n %nI saw that you signed up for Acme. What do you think of it so far?%n %nBy the way, if you\'ve lost the link to Acme, here it is again - %s" shareLinks.emailShareLink) space="%20"}}',
        mailToLink: 'mailto:?subject={{urlencode "How do you like Acme so far?" space="%20"}}&body={{urlencode (stringFormat "Hey,%n %nI saw that you signed up for Acme. What do you think of it so far?%n %nBy the way, if you\'ve lost the link to Acme, here it is again - %s" shareLinks.emailShareLink) space="%20"}}',
      },
      type: 'UNKNOWN'
    },
    facebook: {
      title: '{{urlencode (variables 'widget.REFERRER_WIDGET.content.shareMessaging.facebookShareSubject')}}',
      summary: '{{urlencode (variables 'widget.REFERRER_WIDGET.content.shareMessaging.facebookShareBody')}}',
      link: '{{shareLinks.facebookShareLink}}',
{{#if variables.widget.REFERRER_WIDGET.content.shareMessaging.facebookShareImageURL}}
      shareImage: '{{urlencode (variables 'widget.REFERRER_WIDGET.content.shareMessaging.facebookShareImageURL')}}',
{{else}}
      shareImage: null,
{{/if}}
      appId: '157382547792399',
      redirectUrl: 'http://app.referralsaasquatch.com/widget/close'
    },
    twitter: {
      message: '{{urlencode (variables 'widget.REFERRER_WIDGET.content.shareMessaging.twitterShareBody')}}'
    },
    mobile: {
      sharelink: '{{shareLinks.shareLink}}',
      emailBody: '{{urlencode (stringFormat "Sign up for a %s account and we both get %s%% off our monthly bill. Use this link %s" companyName programDetails.referredRewardDetails.discountPercent shareLinks.mobileEmailShareLink)}}',
      facebookBody: '{{urlencode (stringFormat "Sign up for a %s account and we both get %s%% off our monthly bill. Use this link %s" companyName programDetails.referredRewardDetails.discountPercent shareLinks.mobileFacebookShareLink)}}',
      twitterBody: '{{urlencode (variables 'widget.REFERRER_WIDGET.content.shareMessaging.twitterShareBody') space="%20"}}',
      twitterShareLink: '{{shareLinks.mobileTwitterShareLink}}',
      facebookShareLink: '{{shareLinks.mobileFacebookShareLink}}',
      emailShareLink: '{{shareLinks.mobileEmailShareLink}}'
    },
    fallbackImg: 'https://www.gravatar.com/avatar/0?d=blank'
  };

  window.squatch.analytics = {
    apikey: '{{segmentApiKey}}',
    attributes: {
      tenant   : '{{tenantAlias}}',
      userId   : '{{user.id}}',
      accountId: '{{user.accountId}}'
    },
    user: {
      ident : '{{user.id}}',
      traits: {
        tenant   : '{{tenantAlias}}',
        accountId: '{{user.accountId}}'
      }
    },
    events: {
      OPENED_WIDGET : 'Opened Widget',
      OPENED_POPUP  : 'Opened Popup',
      CLOSED_POPUP  : 'Closed Popup',
      FACEBOOK_SHARE: 'Clicked Facebook Share',
      TWITTER_SHARE : 'Clicked Twitter Share',
      EMAIL_SHARE   : 'Clicked Email Share',
      LEARN_MORE    : 'Clicked Learn More',
      FAQ_BACK      : 'Clicked FAQ Back',
      COPY_LINK     : 'Clicked Copy Link',
      REMIND_FRIEND : 'Clicked Remind Friend'
    }
  };

  window.squatch.mode = {
    widgetMode     : '{{mode}}',
    POPUP_MODE     : 'POPUP',
    EMBED_MODE     : 'EMBED',
    DEMO_MODE      : 'DEMO',
    DEMO_EMBED_MODE: 'DEMO_EMBED',
    NOCONTENT_MODE : 'NOCONTENT'
  };

</script><commit_msg>EM - removed unused segment properties<commit_after>{{!--

  Core JavaScript to power widget functionality.

  TODO: Eventually this should get merged in as part of the {{squatchHead}} core helper instead of being manually included in every template

  Eventually we can abstract this.

--}}

<script>
  window.squatch = window.squatch || {};
  window.squatch.user = {
    code     : '{{referredBy.referredByUser.referralCode}}',
    sharelink: '{{shareLinks.shareLink}}',
    email    : {
      share : {
        subject: '{{urlencode (variables 'widget.REFERRER_WIDGET.content.shareMessaging.emailShareSubject') space="%20"}}',
        body: '{{urlencode (variables 'widget.REFERRER_WIDGET.content.shareMessaging.emailShareBody') space="%20"}}',
        mailToLink: 'mailto:?subject={{urlencode (variables 'widget.REFERRER_WIDGET.content.shareMessaging.emailShareSubject') space="%20"}}&body={{urlencode (variables 'widget.REFERRER_WIDGET.content.shareMessaging.emailShareBody') space="%20"}}',
      },
      reminder: {
        subject: '{{urlencode "How do you like Acme so far?" space="%20"}}',
        body: '{{urlencode (stringFormat "Hey,%n %nI saw that you signed up for Acme. What do you think of it so far?%n %nBy the way, if you\'ve lost the link to Acme, here it is again - %s" shareLinks.emailShareLink) space="%20"}}',
        mailToLink: 'mailto:?subject={{urlencode "How do you like Acme so far?" space="%20"}}&body={{urlencode (stringFormat "Hey,%n %nI saw that you signed up for Acme. What do you think of it so far?%n %nBy the way, if you\'ve lost the link to Acme, here it is again - %s" shareLinks.emailShareLink) space="%20"}}',
      },
      type: 'UNKNOWN'
    },
    facebook: {
      title: '{{urlencode (variables 'widget.REFERRER_WIDGET.content.shareMessaging.facebookShareSubject')}}',
      summary: '{{urlencode (variables 'widget.REFERRER_WIDGET.content.shareMessaging.facebookShareBody')}}',
      link: '{{shareLinks.facebookShareLink}}',
{{#if variables.widget.REFERRER_WIDGET.content.shareMessaging.facebookShareImageURL}}
      shareImage: '{{urlencode (variables 'widget.REFERRER_WIDGET.content.shareMessaging.facebookShareImageURL')}}',
{{else}}
      shareImage: null,
{{/if}}
      appId: '157382547792399',
      redirectUrl: 'http://app.referralsaasquatch.com/widget/close'
    },
    twitter: {
      message: '{{urlencode (variables 'widget.REFERRER_WIDGET.content.shareMessaging.twitterShareBody')}}'
    },
    mobile: {
      sharelink: '{{shareLinks.shareLink}}',
      emailBody: '{{urlencode (stringFormat "Sign up for a %s account and we both get %s%% off our monthly bill. Use this link %s" companyName programDetails.referredRewardDetails.discountPercent shareLinks.mobileEmailShareLink)}}',
      facebookBody: '{{urlencode (stringFormat "Sign up for a %s account and we both get %s%% off our monthly bill. Use this link %s" companyName programDetails.referredRewardDetails.discountPercent shareLinks.mobileFacebookShareLink)}}',
      twitterBody: '{{urlencode (variables 'widget.REFERRER_WIDGET.content.shareMessaging.twitterShareBody') space="%20"}}',
      twitterShareLink: '{{shareLinks.mobileTwitterShareLink}}',
      facebookShareLink: '{{shareLinks.mobileFacebookShareLink}}',
      emailShareLink: '{{shareLinks.mobileEmailShareLink}}'
    },
    fallbackImg: 'https://www.gravatar.com/avatar/0?d=blank'
  };

  window.squatch.analytics = {
    attributes: {
      tenant   : '{{tenantAlias}}',
      userId   : '{{user.id}}',
      accountId: '{{user.accountId}}'
    }
  };

  window.squatch.mode = {
    widgetMode     : '{{mode}}',
    POPUP_MODE     : 'POPUP',
    EMBED_MODE     : 'EMBED',
    DEMO_MODE      : 'DEMO',
    DEMO_EMBED_MODE: 'DEMO_EMBED',
    NOCONTENT_MODE : 'NOCONTENT'
  };

</script>
{'fraction_non_alphanumeric': 0.14234962636285678, 'fraction_numerical': 0.008330270733798849, 'mean_word_length': 3.9240048250904707, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5319557', 'n_tokens_mistral': 2676, 'n_tokens_neox': 2605, 'n_words': 601}