function $AdfRepositionable$$($floatingElement$$11$$, $handle$$38$$) {
  this.Init($floatingElement$$11$$, $handle$$38$$);
}
$goog$exportSymbol$$("AdfRepositionable", $AdfRepositionable$$);
$AdfObject$$.$createSubclass$($AdfRepositionable$$);
$AdfRepositionable$$.$InitClass$ = function $$AdfRepositionable$$$$InitClass$$() {
  var $prototype$$ = this.prototype;
  $prototype$$.$NORMAL$ = 0;
  $prototype$$.$START_DRAGGING$ = 1;
  $prototype$$.$DRAGGING$ = 2;
};
$goog$exportSymbol$$("AdfRepositionable.InitClass", $AdfRepositionable$$.$InitClass$);
$AdfRepositionable$$.prototype.Init = function $$AdfRepositionable$$$$Init$($floatingElement$$12$$, $handle$$39$$) {
  $AdfRepositionable$$.$superclass$.Init.call(this);
  this.$_floatingElement$ = $floatingElement$$12$$;
  this.$_handle$ = $handle$$39$$;
  var $agent$$154$$ = $AdfAgent$$.$AGENT$;
  this.$_mousedownStub$ = this.$createCallback$(this.$_mouseDownHandler$);
  this.$_mousemoveStub$ = this.$createCallback$(this.$_mouseMoveHandler$);
  this.$_mouseupStub$ = this.$createCallback$(this.$_stopDragging$);
  $agent$$154$$.$getCapabilities$();
  $agent$$154$$.$addBubbleEventListener$(this.$_handle$, "touchstart", this.$_mousedownStub$);
  $agent$$154$$.$addBubbleEventListener$(this.$_handle$, "mousedown", this.$_mousedownStub$);
  $agent$$154$$.$disableUserSelect$($handle$$39$$);
  this.$_originalLeftPosition$ = this.$_originalTopPosition$ = null;
  this.$_state$ = this.$NORMAL$;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfRepositionable.prototype.Init", {Init:$AdfRepositionable$$.prototype.Init});
$AdfRepositionable$$.prototype.$destroy$ = function $$AdfRepositionable$$$$$destroy$$() {
  var $agent$$155$$ = $AdfAgent$$.$AGENT$;
  $agent$$155$$.$removeBubbleEventListener$(this.$_handle$, "touchstart", this.$_mousedownStub$);
  $agent$$155$$.$removeBubbleEventListener$(this.$_handle$, "mousedown", this.$_mousedownStub$);
  this.$_state$ != this.$NORMAL$ && $AdfPage$$.$PAGE$.$stopDrag$();
};
$AdfObject$$.$exportPrototypeSymbol$("AdfRepositionable.prototype.destroy", {$destroy$:$AdfRepositionable$$.prototype.$destroy$});
$AdfRepositionable$$.prototype.$getElement$ = function $$AdfRepositionable$$$$$getElement$$() {
  return this.$_floatingElement$.$getElement$();
};
$AdfObject$$.$exportPrototypeSymbol$("AdfRepositionable.prototype.getElement", {$getElement$:$AdfRepositionable$$.prototype.$getElement$});
$JSCompiler_prototypeAlias$$ = $AdfRepositionable$$.prototype;
$JSCompiler_prototypeAlias$$.$_mouseDownHandler$ = function $$JSCompiler_prototypeAlias$$$$_mouseDownHandler$$($evt$$75$$) {
  var $page$$82$$ = $AdfPage$$.$PAGE$;
  if (!$page$$82$$.$isDragging$()) {
    var $agent$$156_handle$$40$$ = $AdfAgent$$.$AGENT$;
    $evt$$75$$ = $evt$$75$$ || $agent$$156_handle$$40$$.$getDomWindow$().event;
    if (!($evt$$75$$ instanceof MouseEvent) || $agent$$156_handle$$40$$.$isLeftButton$($evt$$75$$)) {
      this.$_state$ = this.$START_DRAGGING$;
      $agent$$156_handle$$40$$.preventDefault($evt$$75$$);
      var $target$$105$$ = $agent$$156_handle$$40$$.$getEventTarget$($evt$$75$$);
      $AdfPage$$.$PAGE$.$getAutoDismissalManager$().$dismiss$($target$$105$$);
      if ($agent$$156_handle$$40$$.$getPlatform$() == $AdfAgent$$.$IE_PLATFORM$) {
        $agent$$156_handle$$40$$ = this.$_handle$;
        try {
          $agent$$156_handle$$40$$.setActive();
        } catch ($e$$94$$) {
          $AdfLogger$$.$LOGGER$.fine("Could not restore focus to handle:", $agent$$156_handle$$40$$.id ? $agent$$156_handle$$40$$.id : "unknown");
        }
      }
      $page$$82$$.$startDrag$($evt$$75$$, this.$_mousemoveStub$, this.$_mouseupStub$, null, !0);
    }
  }
};
$JSCompiler_prototypeAlias$$.$_mouseMoveHandler$ = function $$JSCompiler_prototypeAlias$$$$_mouseMoveHandler$$($evt$$76_windowWidth$$9$$, $deltaX$$4_moveDeltaX$$, $deltaY$$6_moveDeltaY$$) {
  var $agent$$157_windowHeight$$9$$ = $AdfAgent$$.$AGENT$;
  $agent$$157_windowHeight$$9$$.$getMousePosition$($evt$$76_windowWidth$$9$$);
  if (this.$_state$ == this.$START_DRAGGING$) {
    this.$_onDragStart$.apply(this.$_floatingElement$);
    this.$_state$ = this.$DRAGGING$;
    this.$_originalLeftPosition$ = parseInt(this.$_floatingElement$.$getLeft$());
    this.$_originalTopPosition$ = parseInt(this.$_floatingElement$.$getTop$());
    this.$_moveDeltaY$ = this.$_moveDeltaX$ = 0;
    this.$_originalLeftPosition$ || (this.$_originalLeftPosition$ = 0);
    this.$_originalTopPosition$ || (this.$_originalTopPosition$ = 0);
    var $adjustment_documentElement$$10_el$$13$$ = $AdfPage$$.$PAGE$.$getDomDocument$().documentElement, $isIE$$5$$ = $agent$$157_windowHeight$$9$$.$getPlatform$() == $AdfAgent$$.$IE_PLATFORM$, $isRTL$$3$$ = $AdfPage$$.$PAGE$.$getLocaleContext$().$isRightToLeft$(), $domWindow$$83_shadowSize$$8$$ = $agent$$157_windowHeight$$9$$.$getDomWindow$();
    $evt$$76_windowWidth$$9$$ = $agent$$157_windowHeight$$9$$.$getWindowScrollWidth$($domWindow$$83_shadowSize$$8$$);
    var $agent$$157_windowHeight$$9$$ = $agent$$157_windowHeight$$9$$.$getWindowScrollHeight$($domWindow$$83_shadowSize$$8$$), $domWindow$$83_shadowSize$$8$$ = $AdfDhtmlShadowDecorator$$.$getShadowSize$(), $minLeft$$ = $isRTL$$3$$ ? $domWindow$$83_shadowSize$$8$$ : 0;
    $isIE$$5$$ && $isRTL$$3$$ && ($adjustment_documentElement$$10_el$$13$$ = $adjustment_documentElement$$10_el$$13$$.scrollWidth - $adjustment_documentElement$$10_el$$13$$.clientWidth, $minLeft$$ -= $adjustment_documentElement$$10_el$$13$$, $evt$$76_windowWidth$$9$$ -= $adjustment_documentElement$$10_el$$13$$);
    this.$_minLeft$ = $minLeft$$;
    $adjustment_documentElement$$10_el$$13$$ = this.$getElement$();
    this.$_wiggleWidth$ = $evt$$76_windowWidth$$9$$ - $adjustment_documentElement$$10_el$$13$$.offsetWidth - 2 * $domWindow$$83_shadowSize$$8$$;
    this.$_wiggleHeight$ = $agent$$157_windowHeight$$9$$ - $adjustment_documentElement$$10_el$$13$$.offsetHeight - 2 * $domWindow$$83_shadowSize$$8$$;
  }
  this.$_state$ == this.$DRAGGING$ && ($deltaX$$4_moveDeltaX$$ = this.$_moveDeltaX$ += $deltaX$$4_moveDeltaX$$, $deltaY$$6_moveDeltaY$$ = this.$_moveDeltaY$ += $deltaY$$6_moveDeltaY$$, this.$_move$($deltaX$$4_moveDeltaX$$, $deltaY$$6_moveDeltaY$$));
};
$JSCompiler_prototypeAlias$$.$_stopDragging$ = function $$JSCompiler_prototypeAlias$$$$_stopDragging$$() {
  this.$_originalTopPosition$ = this.$_originalLeftPosition$ = null;
  this.$_state$ == this.$DRAGGING$ && this.$_onDragEnd$.apply(this.$_floatingElement$);
  this.$_state$ = this.$NORMAL$;
};
$JSCompiler_prototypeAlias$$.$_move$ = function $$JSCompiler_prototypeAlias$$$$_move$$($deltaX$$6$$, $deltaY$$8$$) {
  var $newLeft$$1$$ = this.$_originalLeftPosition$ + $deltaX$$6$$, $newTop$$1$$ = this.$_originalTopPosition$ + $deltaY$$8$$, $minLeft$$1$$ = this.$_minLeft$, $wiggleWidth$$ = this.$_wiggleWidth$, $wiggleHeight$$ = this.$_wiggleHeight$, $newLeft$$1$$ = $newLeft$$1$$ > $minLeft$$1$$ ? Math.min($newLeft$$1$$, $wiggleWidth$$) : $minLeft$$1$$, $newTop$$1$$ = 0 < $newTop$$1$$ ? Math.min($newTop$$1$$, $wiggleHeight$$) : 0;
  this.$_floatingElement$.setPosition($newTop$$1$$, $newLeft$$1$$);
  this.$_onDrag$();
};
$JSCompiler_prototypeAlias$$.$setDragStartHandler$ = function $$JSCompiler_prototypeAlias$$$$setDragStartHandler$$($handler$$4$$) {
  this.$_onDragStart$ = $handler$$4$$;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfRepositionable.prototype.setDragStartHandler", {$setDragStartHandler$:$AdfRepositionable$$.prototype.$setDragStartHandler$});
$AdfRepositionable$$.prototype.$setDragEndHandler$ = function $$AdfRepositionable$$$$$setDragEndHandler$$($handler$$5$$) {
  this.$_onDragEnd$ = $handler$$5$$;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfRepositionable.prototype.setDragEndHandler", {$setDragEndHandler$:$AdfRepositionable$$.prototype.$setDragEndHandler$});
$AdfRepositionable$$.prototype.$setDragHandler$ = function $$AdfRepositionable$$$$$setDragHandler$$($handler$$6$$) {
  this.$_onDrag$ = $handler$$6$$;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfRepositionable.prototype.setDragHandler", {$setDragHandler$:$AdfRepositionable$$.prototype.$setDragHandler$});
$AdfRepositionable$$.prototype.$_onDragStart$ = function $$AdfRepositionable$$$$$_onDragStart$$() {
};
$AdfRepositionable$$.prototype.$_onDragEnd$ = function $$AdfRepositionable$$$$$_onDragEnd$$() {
};
$AdfRepositionable$$.prototype.$_onDrag$ = function $$AdfRepositionable$$$$$_onDrag$$() {
};
