text: import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Renderer2 } from '@angular/core';
  import { BsDropdownState } from './bs-dropdown.state';
  import { isBs3 } from '../utils/theme-provider';
  var BsDropdownContainerComponent = /** @class */ (function () {
      function BsDropdownContainerComponent(_state, cd, _renderer, _element) {
          var _this = this;
          this._state = _state;
          this.cd = cd;
          this._renderer = _renderer;
          this.isOpen = false;
          this._subscription = _state.isOpenChange.subscribe(function (value) {
              _this.isOpen = value;
              var dropdown = _element.nativeElement.querySelector('.dropdown-menu');
              if (dropdown && !isBs3()) {
                  _this._renderer.addClass(dropdown, 'is-open');
                  if (dropdown.classList.contains('dropdown-menu-right')) {
                      _this._renderer.setStyle(dropdown, 'left', 'auto');
                      _this._renderer.setStyle(dropdown, 'right', '0');
                  }
                  if (_this.direction === 'up') {
                      _this._renderer.setStyle(dropdown, 'top', 'auto');
                      _this._renderer.setStyle(dropdown, 'transform', 'translateY(-101%)');
                  }
              }
              _this.cd.markForCheck();
              _this.cd.detectChanges();
          });
      }
      Object.defineProperty(BsDropdownContainerComponent.prototype, "direction", {
          get: function () {
              return this._state.direction;
          },
          enumerable: true,
          configurable: true
      });
      BsDropdownContainerComponent.prototype.ngOnDestroy = function () {
          this._subscription.unsubscribe();
      };
      BsDropdownContainerComponent.decorators = [
          { type: Component, args: [{
                      selector: 'bs-dropdown-container',
                      changeDetection: ChangeDetectionStrategy.OnPush,
                      host: {
                          style: 'display:block;position: absolute;'
                      },
                      template: "\n    <div [class.dropup]=\"direction === 'up'\"\n         [class.dropdown]=\"direction === 'down'\"\n         [class.is-open]=\"isOpen\"\n         [class.open]=\"isOpen\"><ng-content></ng-content></div>\n  "
                  },] },
      ];
      /** @nocollapse */
      BsDropdownContainerComponent.ctorParameters = function () { return [
          { type: BsDropdownState, },
          { type: ChangeDetectorRef, },
          { type: Renderer2, },
          { type: ElementRef, },
      ]; };
      return BsDropdownContainerComponent;
  }());
  export { BsDropdownContainerComponent };
  //# sourceMappingURL=bs-dropdown-container.component.js.map