<commit_before><!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../gold-email-input/gold-email-input.html">
<link rel="import" href="../iron-icons/iron-icons.html">
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../paper-dialog/paper-dialog.html">
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../paper-material/paper-material.html">
<script src="https://apis.google.com/js/platform.js" async defer></script>
<script src='../web-firebase/firebasejs/3.0.0-eap.2/firebase.js'></script>
<!--
An element providing a solution to no problem in particular.

Example:

    <firebase-ui api-key="<KEY>" database-url="https://some-firebase.firebaseio.com/" app-name="TestApp"></firebase-ui>

Example:

    <firebase-ui api-key="<KEY>" database-url="https://some-firebase.firebaseio.com/" app-name="TestApp" google-client-id="1234567890-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com" facebook-app-id="123457890" enable-google enable-facebook></firebase-ui>

@demo demo/index.html
@hero hero.svg
-->
<dom-module id="firebase-ui">
  <template>
    <style>
      :host {
        display: block;
        box-sizing: border-box;
      }
      
      paper-dialog {
        background-color: var(--dialog-background-color);
        border-radius: var(--dialog-border-radius);
        max-width: var(--dialog-max-width);
      }
      
      h2 {
        font-weight: lighter;
        text-align: center;
        padding: 0 1rem;
      }
      
      .close {
        position: absolute;
        top: -1.5rem;
        right: 0;
      }
      
      paper-button {
        margin: .5rem;
        width: calc(100% - 1rem);
      }
      
      paper-button[disabled] {
        opacity: 0.5;
      }
      
      paper-input,
      gold-email-input {
        margin: 0 .5rem;
      }
      
      paper-icon-button {
        width: 35px;
      }
      
      .firebase-button {
        background-color: var(--firebase-login-color);
        color: white;
      }
      
      #google {
        background-color: var(--google-login-color);
        color: white;
      }
      
      #facebook {
        background-color: var(--facebook-login-color);
        color: white;
      }
      
      #twitter {
        background-color: var(--twitter-login-color);
        color: white;
      }
      
      .divider {
        width: 100%;
        text-align: center;
        position: relative;
      }
      
      .divider * {
        display: inline-block;
        background: white;
        padding: 0 .25rem;
        color: var(--secondary-text-color);
      }
      
      .divider:before {
        content: "";
        display: block;
        border-top: 1px solid var(--divider-color);
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        z-index: -1;
      }
      
      #confirmationDialog p {
        max-width: 12rem;
      }
    </style>
    <meta name="google-signin-scope" content="[[googleSigninScope]]">
    <meta name="google-signin-client_id" content="[[googleClientId]]">
    <meta name="google-signin-cookiepolicy" content="single_host_origin">
    <paper-dialog id="loginDialog" modal>
      <paper-material elevation="0">
        <paper-icon-button class="close" icon="close" dialog-dismiss></paper-icon-button>
        <h2>Please Sign In</h2>
        <paper-dialog-scrollable class="layout vertical">
          <gold-email-input label="<EMAIL>" value="{{email::input}}"></gold-email-input>
          <paper-input label="password" type="password" value="{{password::input}}"></paper-input>
          <paper-button class="firebase-button" raised on-click="signInWithEmailAndPassword" disabled$="[[!credentialsValid]]">Login</paper-button>
          <div class="divider">
            <span>or</span>
          </div>
          <div class="g-signin2" data-theme="light" style="visibility: hidden; position: absolute;"></div>
          <paper-button id="google" raised on-click="loginWithGoogle">Google</paper-button>
          <paper-button id="facebook" raised on-click="loginWithFacebook">Facebook</paper-button>
        </paper-dialog-scrollable>
      </paper-material>
    </paper-dialog>
    <paper-dialog id="confirmationDialog" modal>
      <paper-material elevation="0">
        <paper-icon-button class="close" icon="close" dialog-dismiss></paper-icon-button>
        <h2>Confirm Ownership</h2>
        <p>
          Please confirm ownership of an existing account to log in with {{credentialsToConfirm.provider}}.
        </p>
        <p>
          Existing account email must be {{credentialsToConfirm.user.email}}.
        </p>
        <paper-dialog-scrollable class="layout vertical">
          <template is="dom-if" if="{{confirmEmailPassword}}">
            <gold-email-input label="<EMAIL>" value="{{email::input}}"></gold-email-input>
            <paper-input label="password" type="password" value="{{password::input}}"></paper-input>
            <paper-button class="firebase-button" raised on-click="getCredentialForEmailAndPassword" disabled$="[[!credentialsValid]]">Login</paper-button>  
          </template>
  <template is="dom-if" if="{{confirmGoogle}}">
            <div class="g-signin2" data-theme="light" style="visibility: hidden; position: absolute;"></div>
            <paper-button id="google" raised on-click="getCredentialForGoogle">Google</paper-button>  
          </template>
  <template is="dom-if" if="{{confirmFacebook}}">
            <paper-button id="facebook" raised on-click="getCredentialForFacebook">Facebook</paper-button>  
          </template>
  </paper-dialog-scrollable>
  </paper-material>
  </paper-dialog>
  <paper-dialog id="registerDialog" modal>
    <paper-material elevation="0">
      <paper-icon-button class="close" icon="close" dialog-dismiss></paper-icon-button>
      <h2>Register</h2>
      <paper-dialog-scrollable class="layout vertical">
        <gold-email-input label="<EMAIL>" value="{{email::input}}"></gold-email-input>
        <paper-input label="password" type="password" value="{{password::input}}"></paper-input>
        <paper-button class="firebase-button" raised on-click="createUserWithEmailAndPassword" disabled$="[[!credentialsValid]]">Register</paper-button>
      </paper-dialog-scrollable>
    </paper-material>
  </paper-dialog>
  <paper-dialog id="resetDialog" modal>
    <paper-material elevation="0">
      <paper-icon-button class="close" icon="close" dialog-dismiss></paper-icon-button>
      <h2>Send Password Reset Email</h2>
      <paper-dialog-scrollable class="layout vertical">
        <gold-email-input label="<EMAIL>" value="{{email::input}}"></gold-email-input>
        <paper-button class="firebase-button" raised on-click="sendPasswordResetEmail" disabled$="[[!emailValid]]">Send</paper-button>
      </paper-dialog-scrollable>
    </paper-material>
  </paper-dialog>
  <paper-dialog id="changePasswordDialog" modal>
    <paper-material elevation="0">
      <paper-icon-button class="close" icon="close" dialog-dismiss></paper-icon-button>
      <h2>Change Password</h2>
      <paper-dialog-scrollable class="layout vertical">
        <gold-email-input label="<EMAIL>" value="{{email::input}}"></gold-email-input>
        <paper-input label="current password" type="password" value="{{password::input}}"></paper-input>
        <paper-input label="new password" type="password" value="{{newPassword::input}}"></paper-input>
        <paper-button class="firebase-button" raised on-click="confirmPasswordReset" disabled$="[[!resetValid]]">Reset Password</paper-button>
      </paper-dialog-scrollable>
    </paper-material>
  </paper-dialog>
  </template>
  <script>
    Polymer({
    is: 'firebase-ui',

    properties: {
      /**
       * `api-key` is required and can be found under your API keys
       * at https://console.cloud.google.com/apis/credentials
       */
      apiKey: {
        type: String
      },

      /**
       * `database-url` is required and can be found under your Firebase project
       * at https://console.firebase.google.com/project/
       */
      databaseUrl: {
        type: String
      },

      /**
       * `app-name` is used to initialize your Firebase app.
       */
      appName: {
        type: String,
        value: 'Firebase App'
      },

      /**
       * `google-client-id` is required and can be found under your OAuth 2.0 client IDs 
       * at https://console.cloud.google.com/apis/credentials
       */
      googleClientId: {
        type: String
      },

      /**
       * `facebook-app-id` is required for facebook auth.
       */
      facebookAppId: {
        type: String,
        value: false
      },

      /**
       * `enable-email-password` enables email/password authentication
       */
      enableEmailPassword: {
        type: Boolean,
        value: true
      },

      /**
       * `enable-google` enables google sign-in
       */
      enableGoogle: {
        type: Boolean,
        value: false
      },

      /**
       * `enable-facebook` enables facebook sign-in
       */
      enableFacebook: {
        type: Boolean,
        value: false
      },

      /**
       * `google-signin-scope': see https://developers.google.com/+/web/api/rest/oauth#authorization-scopes
       */
      googleSigninScope: {
        type: String,
        value: 'profile email'
      },

      /**
       * `facebook-signin-scope': see https://developers.facebook.com/docs/javascript/examples#login
       */
      facebookSigninScope: {
        type: String,
        value: 'public_profile,email'
      },

      app: Object,
      auth: Object,

      email: String,
      password: <PASSWORD>,
      newPassword: <PASSWORD>,

      emailValid: {
        type: Boolean,
        value: false
      },

      credentialsValid: {
        type: Boolean,
        value: false
      },

      resetValid: {
        type: Boolean,
        value: false
      },
      
      confirmEmailPassword: Boolean,
      confirmGoogle: Boolean,
      confirmFacebook: Boolean,
      credentialsToConfirm: Object,
    },

    observers: [
      '_setEmailValid(email)',
      '_setCredentialsValid(email, password)',
      '_setResetValid(email, password, <PASSWORD>)'
    ],

    // Element Lifecycle

    ready: function() {
      // `ready` is called after all elements have been configured, but
      // propagates bottom-up. This element's children are ready, but parents
      // are not.
      //
      // This is the point where you should make modifications to the DOM (when
      // necessary), or kick off any processes the element wants to perform.
    },

    attached: function() {
      var firebaseUI = this;

      if (this.apiKey) {
        this.app = firebase.App.initialize({
          apiKey: this.apiKey,
          databaseUrl: this.databaseUrl
        }, this.appName);
        this.auth = this.app.auth();

        this.auth.addAuthStateListener(function(auth) {
          firebaseUI.set('user', auth.currentUser);
          if (auth.currentUser) {
            firebaseUI.fire('login', auth.currentUser);
          } else {
            firebaseUI.fire('logout');
          }
        });
      } else {
        console.log('api-key required for firebase-ui');
      }


      if (this.facebookAppId) {
        window.fbAsyncInit = function() {
          FB.init({
            appId: firebaseUI.facebookAppId,
            xfbml: true,
            version: 'v2.5'
          });
        };

        (function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {
            return;
          }
          js = d.createElement(s);
          js.id = id;
          js.src = "//connect.facebook.net/en_US/sdk.js";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));
      } else if (this.enableFacebook) {
        console.log('facebook-app-id required');
      }

      if (!this.googleClientId && this.enableGoogle) {
        console.log('google-client-id required'); 
      }
    },

    detached: function() {
      // The analog to `attached`, `detached` fires when the element has been
      // removed from a document.
      //
      // Use this to clean up anything you did in `attached`.
    },

    // Element Behavior

    /**
     * Open Firebase UI login dialog<commit_msg>So many bug fixes.<commit_after><!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../gold-email-input/gold-email-input.html">
<link rel="import" href="../iron-icons/iron-icons.html">
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../paper-dialog/paper-dialog.html">
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../paper-material/paper-material.html">
<script src="https://apis.google.com/js/platform.js" async defer></script>
<script src='../web-firebase/firebasejs/3.0.0-eap.2/firebase.js'></script>
<!--
An element providing a solution to no problem in particular.

Example:

    <firebase-ui api-key="<KEY>" database-url="https://some-firebase.firebaseio.com/" app-name="TestApp"></firebase-ui>

Example:

    <firebase-ui api-key="<KEY>" database-url="https://some-firebase.firebaseio.com/" app-name="TestApp" google-client-id="1234567890-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com" facebook-app-id="123457890" enable-google enable-facebook></firebase-ui>

@demo demo/index.html
@hero hero.svg
-->
<dom-module id="firebase-ui">
  <template>
    <style>
      :host {
        display: block;
        box-sizing: border-box;
      }
      
      paper-dialog {
        background-color: var(--dialog-background-color);
        border-radius: var(--dialog-border-radius);
        max-width: var(--dialog-max-width);
      }
      
      h2 {
        font-weight: lighter;
        text-align: center;
        padding: 0 1rem;
      }
      
      .close {
        position: absolute;
        top: -1.5rem;
        right: 0;
      }
      
      paper-button {
        margin: .5rem;
        width: calc(100% - 1rem);
      }
      
      paper-button[disabled] {
        opacity: 0.5;
      }
      
      paper-input,
      gold-email-input {
        margin: 0 .5rem;
      }
      
      paper-icon-button {
        width: 35px;
      }
      
      .firebase-button {
        background-color: var(--firebase-login-color);
        color: white;
      }
      
      #google {
        background-color: var(--google-login-color);
        color: white;
      }
      
      #facebook {
        background-color: var(--facebook-login-color);
        color: white;
      }
      
      #twitter {
        background-color: var(--twitter-login-color);
        color: white;
      }
      
      .divider {
        width: 100%;
        text-align: center;
        position: relative;
      }
      
      .divider * {
        display: inline-block;
        background: white;
        padding: 0 .25rem;
        color: var(--secondary-text-color);
      }
      
      .divider:before {
        content: "";
        display: block;
        border-top: 1px solid var(--divider-color);
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        z-index: -1;
      }
      
      #confirmationDialog p {
        max-width: 12rem;
      }
    </style>
    <!--<meta name="google-signin-scope" content="[[googleSigninScope]]">
    <meta name="google-signin-client_id" content="[[googleClientId]]">-->
    <!--<meta name="google-signin-cookiepolicy" content="single_host_origin">-->
    <paper-dialog id="loginDialog" modal>
      <paper-material elevation="0">
        <paper-icon-button class="close" icon="close" dialog-dismiss></paper-icon-button>
        <h2>Please Sign In</h2>
        <paper-dialog-scrollable class="layout vertical">
          <gold-email-input label="<EMAIL>" value="{{email::input}}"></gold-email-input>
          <paper-input label="password" type="password" value="{{password::input}}"></paper-input>
          <paper-button class="firebase-button" raised on-click="signInWithEmailAndPassword" disabled$="[[!credentialsValid]]">Login</paper-button>
          <div class="divider">
            <span>or</span>
          </div>
          <div class="g-signin2" data-theme="light" style="visibility: hidden; position: absolute;"></div>
          <paper-button id="google" raised on-click="loginWithGoogle">Google</paper-button>
          <paper-button id="facebook" raised on-click="loginWithFacebook">Facebook</paper-button>
        </paper-dialog-scrollable>
      </paper-material>
    </paper-dialog>
    <paper-dialog id="confirmationDialog" modal>
      <paper-material elevation="0">
        <paper-icon-button class="close" icon="close" dialog-dismiss></paper-icon-button>
        <h2>Confirm Ownership</h2>
        <p>
          Please confirm ownership of an existing account to log in with {{credentialsToConfirm.provider}}.
        </p>
        <p>
          Existing account email must be {{credentialsToConfirm.user.email}}.
        </p>
        <paper-dialog-scrollable class="layout vertical">
          <template is="dom-if" if="{{confirmEmailPassword}}">
            <gold-email-input label="<EMAIL>" value="{{email::input}}"></gold-email-input>
            <paper-input label="password" type="password" value="{{password::input}}"></paper-input>
            <paper-button class="firebase-button" raised on-click="getCredentialForEmailAndPassword" disabled$="[[!credentialsValid]]">Login</paper-button>  
          </template>
  <template is="dom-if" if="{{confirmGoogle}}">
            <div class="g-signin2" data-theme="light" style="visibility: hidden; position: absolute;"></div>
            <paper-button id="google" raised on-click="getCredentialForGoogle">Google</paper-button>  
          </template>
  <template is="dom-if" if="{{confirmFacebook}}">
            <paper-button id="facebook" raised on-click="getCredentialForFacebook">Facebook</paper-button>  
          </template>
  </paper-dialog-scrollable>
  </paper-material>
  </paper-dialog>
  <paper-dialog id="registerDialog" modal>
    <paper-material elevation="0">
      <paper-icon-button class="close" icon="close" dialog-dismiss></paper-icon-button>
      <h2>Register</h2>
      <paper-dialog-scrollable class="layout vertical">
        <gold-email-input label="<EMAIL>" value="{{email::input}}"></gold-email-input>
        <paper-input label="password" type="password" value="{{password::input}}"></paper-input>
        <paper-button class="firebase-button" raised on-click="createUserWithEmailAndPassword" disabled$="[[!credentialsValid]]">Register</paper-button>
      </paper-dialog-scrollable>
    </paper-material>
  </paper-dialog>
  <paper-dialog id="resetDialog" modal>
    <paper-material elevation="0">
      <paper-icon-button class="close" icon="close" dialog-dismiss></paper-icon-button>
      <h2>Send Password Reset Email</h2>
      <paper-dialog-scrollable class="layout vertical">
        <gold-email-input label="<EMAIL>" value="{{email::input}}"></gold-email-input>
        <paper-button class="firebase-button" raised on-click="sendPasswordResetEmail" disabled$="[[!emailValid]]">Send</paper-button>
      </paper-dialog-scrollable>
    </paper-material>
  </paper-dialog>
  <paper-dialog id="changePasswordDialog" modal>
    <paper-material elevation="0">
      <paper-icon-button class="close" icon="close" dialog-dismiss></paper-icon-button>
      <h2>Change Password</h2>
      <paper-dialog-scrollable class="layout vertical">
        <gold-email-input label="<EMAIL>" value="{{email::input}}"></gold-email-input>
        <paper-input label="current password" type="password" value="{{password::input}}"></paper-input>
        <paper-input label="new password" type="password" value="{{newPassword::input}}"></paper-input>
        <paper-button class="firebase-button" raised on-click="confirmPasswordReset" disabled$="[[!resetValid]]">Reset Password</paper-button>
      </paper-dialog-scrollable>
    </paper-material>
  </paper-dialog>
  </template>
  <script>
    Polymer({
    is: 'firebase-ui',

    properties: {
      /**
       * `api-key` is required and can be found under your API keys
       * at https://console.cloud.google.com/apis/credentials
       */
      apiKey: {
        type: String
      },

      /**
       * `database-url` is required and can be found under your Firebase project
       * at https://console.firebase.google.com/project/
       */
      databaseUrl: {
        type: String
      },

      /**
       * `app-name` is used to initialize your Firebase app.
       */
      appName: {
        type: String,
        value: 'Firebase App'
      },

      /**
       * `google-client-id` is required and can be found under your OAuth 2.0 client IDs 
       * at https://console.cloud.google.com/apis/credentials
       */
      googleClientId: {
        type: String
      },

      /**
       * `facebook-app-id` is required for facebook auth.
       */
      facebookAppId: {
        type: String,
        value: false
      },

      /**
       * `enable-email-password` enables email/password authentication
       */
      enableEmailPassword: {
        type: Boolean,
        value: true
      },

      /**
       * `enable-google` enables google sign-in
       */
      enableGoogle: {
        type: Boolean,
        value: false
      },

      /**
       * `enable-facebook` enables facebook sign-in
       */
      enableFacebook: {
        type: Boolean,
        value: false
      },

      /**
       * `google-signin-scope': see https://developers.google.com/+/web/api/rest/oauth#authorization-scopes
       */
      googleSigninScope: {
        type: String,
        value: 'profile email'
      },

      /**
       * `facebook-signin-scope': see https://developers.facebook.com/docs/javascript/examples#login
       */
      facebookSigninScope: {
        type: String,
        value: 'public_profile,email'
      },
      
      user: {
        type: Object,
        notify: true
      },

      app: Object,
      auth: Object,

      email: String,
      password: String,
      newPassword: String,

      emailValid: {
        type: Boolean,
        value: false
      },

      credentialsValid: {
        type: Boolean,
        value: false
      },

      resetValid: {
        type: Boolean,
        value: false
      },
      
      confirmEmailPassword: Boolean,
      confirmGoogle: Boolean,
      confirmFacebook: Boolean,
      credentialsToConfirm: Object,
    },

    observers: [
      '_setEmailValid(email)',
      '_setCredentialsValid(email, password)',
      '_setResetValid(email, password, newPassword)',
      '_initializeFirebase(apiKey)',
      '_initializeFacebook(facebookAppId)',
      '_initializeGoogle(googleClientId)',
    ],

    // Element Lifecycle

    ready: function() {
      // `ready` is called after all elements have been configured, but
      // propagates bottom-up. This element's children are ready, but parents
      // are not.
      //
      // This is the point where you should make modifications to the DOM (when
      // necessary), or kick off any processes the element wants to perform.
    },

    attached: function() {
      
    },
    
    _initializeFirebase: function() {
      var firebaseUI = this;

      if (this.apiKey) {
        this.app = firebase.App.initialize({
          apiKey: this.apiKey,
          databaseUrl: this.databaseUrl
        }, this.appName);
        this.auth = this.app.auth();

        this.auth.addAuthStateListener(function(auth) {
          firebaseUI.set('user', auth.currentUser);
          if (auth.currentUser) {
            firebaseUI.fire('login', auth.currentUser);
          } else {
            firebaseUI.fire('logout');
          }
        });
      } else {
        // console.log('api-key required for firebase-ui');
      }
    },
    
    _initializeFacebook: function() {
      var firebaseUI = this;
      
      if (this.facebookAppId) {
        window.fbAsyncInit = function() {
          FB.init({
            appId: firebaseUI.facebookAppId,
            xfbml: true,
            version: 'v2.5'
          });
        };

        (function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {
            return;
          }
          js = d.createElement(s);
          js.id = id;
          js.src = "//connect.facebook.net/en_US/sdk.js";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));
      } else if (this.enableFacebook) {
        // console.log('facebook-app-id required');
      }
    },
    
    _initializeGoogle: function() {
      var firebaseUI = this;
      if (this.googleClientId && this.enableGoogle) {
        gapi.load('auth2', function() {
          gapi.auth2.init({
            client_id: firebaseUI.googleClientId,
            scope: firebaseUI.googleSigninScope,
            cookie_policy: 'single_host_origin'
          }).then(function() {
            console.log('success', arguments);
          }, function() {
            console.log('err', arguments);
          });
        });
      } else if (this.enableGoogle) {
        // console.log('google-client-id required');
      }
    },

    detached: function() {
      // The analog to `attached`, `detached` fires when the element has been
      // removed from a document.
      //
      // Use this to clean up anything you did in `attached`.
    },

    // Element Behavior

    /**
     * Open Firebase UI login dialog
{'fraction_non_alphanumeric': 0.1473374105011933, 'fraction_numerical': 0.006041169451073985, 'mean_word_length': 2.3119673953316044, 'pattern_counts': {'":': 0, '<': 288, '<?xml version=': 0, '>': 288, 'https://': 16, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1598659', 'n_tokens_mistral': 8001, 'n_tokens_neox': 7765, 'n_words': 1602}