<commit_before>/* eslint camelcase: ["error", {properties: "never"}] */

/** @ngInject */
export function DialogsEditState(routerHelper) {
  routerHelper.configureStates(getStates());
}

function getStates() {
  return {
    'dialogs.edit': {
      url: '/edit/:dialogId',
      templateUrl: 'app/states/dialogs/edit/edit.html',
      controller: StateController,
      controllerAs: 'vm',
      title: N_('Dialog Editing'),
      resolve: {
        dialog: resolveDialog,
      },
    },
  };
}

/** @ngInject */
function resolveDialog($stateParams, CollectionsApi) {
  var options = {attributes: ['content', 'buttons', 'label']};

  if ($stateParams.dialogId === 'new') {
    return {
      "content": [{
        "dialog_tabs": [{
          "label": "New tab",
          "position": 0,
          "dialog_groups": [
          ],
        }],
      }],
    };
  }

  return CollectionsApi.get('service_dialogs', $stateParams.dialogId, options);
}

/** @ngInject */
function StateController($state, dialog, DialogEditor, CollectionsApi,
         EventNotifications, lodash) {
  var vm = this;

  DialogEditor.setData(dialog);

  vm.dialog = dialog;
  vm.saveDialogDetails = saveDialogDetails;
  vm.dismissChanges = dismissChanges;

  function dismissChanges() {
    if (angular.isUndefined(dialog.id)) {<commit_msg>Formatting to kick off travis again<commit_after>/* eslint camelcase: ["error", {properties: "never"}] */

/** @ngInject */
export function DialogsEditState(routerHelper) {
  routerHelper.configureStates(getStates());
}

function getStates() {
  return {
    'dialogs.edit': {
      url: '/edit/:dialogId',
      templateUrl: 'app/states/dialogs/edit/edit.html',
      controller: StateController,
      controllerAs: 'vm',
      title: N_('Dialog Editing'),
      resolve: {
        dialog: resolveDialog,
      },
    },
  };
}

/** @ngInject */
function resolveDialog($stateParams, CollectionsApi) {
  var options = {attributes: ['content', 'buttons', 'label']};

  if ($stateParams.dialogId === 'new') {
    return {
      "content": [{
        "dialog_tabs": [{
          "label": "New tab",
          "position": 0,
          "dialog_groups": [],
        }],
      }],
    };
  }

  return CollectionsApi.get('service_dialogs', $stateParams.dialogId, options);
}

/** @ngInject */
function StateController($state, dialog, DialogEditor, CollectionsApi,
                         EventNotifications, lodash) {
  var vm = this;

  DialogEditor.setData(dialog);

  vm.dialog = dialog;
  vm.saveDialogDetails = saveDialogDetails;
  vm.dismissChanges = dismissChanges;

  function dismissChanges() {
    if (angular.isUndefined(dialog.id)) {
{'fraction_non_alphanumeric': 0.15454202789295138, 'fraction_numerical': 0.0007538635506973238, 'mean_word_length': 3.051908396946565, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4545007', 'n_tokens_mistral': 802, 'n_tokens_neox': 792, 'n_words': 159}