define('@cardstack/tools/components/cs-branch-control', ['exports', '@cardstack/tools/templates/components/cs-branch-control', '@cardstack/plugin-utils/environment'], function (exports, _csBranchControl, _environment) {
  'use strict';

  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.default = Ember.Component.extend({
    layout: _csBranchControl.default,
    classNames: ['cs-branch-control'],
    classNameBindings: ['enabled'],
    tools: Ember.inject.service('cardstack-tools'),

    enabled: Ember.computed('tools.branch', function () {
      return !!this.get('tools.branch');
    }),

    previewing: Ember.computed('enabled', 'tools.branch', function () {
      return this.get('enabled') && _environment.defaultBranch !== this.get('tools.branch');
    }),

    actions: {
      goLive: function goLive() {
        this.get('tools').setBranch(_environment.defaultBranch);
      },
      goPreview: function goPreview() {
        this.get('tools').setBranch('draft');
      }
    }
  });
});