function $AdfRestRequestQueueManager$$() {
  this.Init();
}
$goog$exportSymbol$$("AdfRestRequestQueueManager", $AdfRestRequestQueueManager$$);
$AdfObject$$.$createSubclass$($AdfRestRequestQueueManager$$);
$AdfRestRequestQueueManager$$.$InitClass$ = function $$AdfRestRequestQueueManager$$$$InitClass$$() {
};
$goog$exportSymbol$$("AdfRestRequestQueueManager.InitClass", $AdfRestRequestQueueManager$$.$InitClass$);
$AdfRestRequestQueueManager$$.prototype.Init = function $$AdfRestRequestQueueManager$$$$Init$() {
  $AdfRestRequestQueueManager$$.$superclass$.Init.call(this);
  this.$_regularRequestQueue$ = [];
  this.$_priorityRequestQueue$ = [];
};
$AdfObject$$.$exportPrototypeSymbol$("AdfRestRequestQueueManager.prototype.Init", {Init:$AdfRestRequestQueueManager$$.prototype.Init});
$AdfRestRequestQueueManager$$.$getClientIdList$ = function $$AdfRestRequestQueueManager$$$$getClientIdList$$($dispatchRequest_options$$9$$) {
  var $clientIdList$$ = [];
  $dispatchRequest_options$$9$$ = $dispatchRequest_options$$9$$.options;
  for (var $i$$118$$ = 0, $length$$35$$ = $dispatchRequest_options$$9$$.length;$i$$118$$ < $length$$35$$;$i$$118$$++) {
    $clientIdList$$.push($dispatchRequest_options$$9$$[$i$$118$$].$clientId$);
  }
  return $clientIdList$$;
};
$goog$exportSymbol$$("AdfRestRequestQueueManager.getClientIdList", $AdfRestRequestQueueManager$$.$getClientIdList$);
$AdfRestRequestQueueManager$$.$markDead$ = function $$AdfRestRequestQueueManager$$$$markDead$$($request$$9$$) {
  $request$$9$$.$_isDead$ = !0;
};
$goog$exportSymbol$$("AdfRestRequestQueueManager.markDead", $AdfRestRequestQueueManager$$.$markDead$);
$AdfRestRequestQueueManager$$.prototype.first = function $$AdfRestRequestQueueManager$$$$first$() {
  var $req$$ = $AdfRestRequestQueueManager$$.$_peekNextOutstandingRequest$(this.$_priorityRequestQueue$);
  $req$$ || ($req$$ = $AdfRestRequestQueueManager$$.$_peekNextOutstandingRequest$(this.$_regularRequestQueue$));
  return $req$$;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfRestRequestQueueManager.prototype.first", {first:$AdfRestRequestQueueManager$$.prototype.first});
$AdfRestRequestQueueManager$$.prototype.$hasOutstandingPriorityRequests$ = function $$AdfRestRequestQueueManager$$$$$hasOutstandingPriorityRequests$$() {
  $AdfRestRequestQueueManager$$.$_deQueueDeadRequests$(this.$_priorityRequestQueue$);
  return 0 != this.$_priorityRequestQueue$.length;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfRestRequestQueueManager.prototype.hasOutstandingPriorityRequests", {$hasOutstandingPriorityRequests$:$AdfRestRequestQueueManager$$.prototype.$hasOutstandingPriorityRequests$});
$AdfRestRequestQueueManager$$.prototype.shift = function $$AdfRestRequestQueueManager$$$$shift$() {
  var $nextReqToProcess$$ = $AdfRestRequestQueueManager$$.$_shiftNextOutstandingRequest$(this.$_priorityRequestQueue$);
  $nextReqToProcess$$ || ($nextReqToProcess$$ = $AdfRestRequestQueueManager$$.$_shiftNextOutstandingRequest$(this.$_regularRequestQueue$));
  return $nextReqToProcess$$;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfRestRequestQueueManager.prototype.shift", {shift:$AdfRestRequestQueueManager$$.prototype.shift});
$AdfRestRequestQueueManager$$.prototype.$registerRequestQueuedListener$ = function $$AdfRestRequestQueueManager$$$$$registerRequestQueuedListener$$($callback$$82$$) {
  this.$_requestQueuedListener$ = $callback$$82$$;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfRestRequestQueueManager.prototype.registerRequestQueuedListener", {$registerRequestQueuedListener$:$AdfRestRequestQueueManager$$.prototype.$registerRequestQueuedListener$});
$AdfRestRequestQueueManager$$.prototype.push = function $$AdfRestRequestQueueManager$$$$push$($actionURL$$9$$, $options$$10$$) {
  $AdfAssert$$.$assertNonEmptyString$($actionURL$$9$$);
  var $copyRequest$$inline_610_isPrioritized$$ = $options$$10$$[$AdfRestDataService$$.$PRIORITIZE$], $request$$10_request$$inline_616_requestData$$inline_605$$;
  $request$$10_request$$inline_616_requestData$$inline_605$$ = $options$$10$$[$AdfRestDataService$$.$REQUEST_DATA$];
  var $request$$inline_606$$ = $AdfRestRequestQueueManager$$.$_findMatchingOutstandingRequest$(this.$_priorityRequestQueue$, $actionURL$$9$$, $request$$10_request$$inline_616_requestData$$inline_605$$);
  $request$$inline_606$$ || ($request$$inline_606$$ = $AdfRestRequestQueueManager$$.$_findMatchingOutstandingRequest$(this.$_regularRequestQueue$, $actionURL$$9$$, $request$$10_request$$inline_616_requestData$$inline_605$$));
  ($request$$10_request$$inline_616_requestData$$inline_605$$ = $request$$inline_606$$) ? ($request$$10_request$$inline_616_requestData$$inline_605$$.options.push($options$$10$$), $copyRequest$$inline_610_isPrioritized$$ && !$request$$10_request$$inline_616_requestData$$inline_605$$[$AdfRestDataService$$.$PRIORITIZE$] && ($request$$10_request$$inline_616_requestData$$inline_605$$.$_isDead$ = !0, $copyRequest$$inline_610_isPrioritized$$ = $AdfRestRequestQueueManager$$.$_cloneSimpleObject$($request$$10_request$$inline_616_requestData$$inline_605$$), 
  $copyRequest$$inline_610_isPrioritized$$.$_isDead$ = !1, this.$_priorityRequestQueue$.push($copyRequest$$inline_610_isPrioritized$$), $copyRequest$$inline_610_isPrioritized$$[$AdfRestDataService$$.$PRIORITIZE$] = !0)) : ($request$$10_request$$inline_616_requestData$$inline_605$$ = {}, $request$$10_request$$inline_616_requestData$$inline_605$$.$actionURL$ = $actionURL$$9$$, $request$$10_request$$inline_616_requestData$$inline_605$$.options = [$options$$10$$], $request$$10_request$$inline_616_requestData$$inline_605$$[$AdfRestDataService$$.$PRIORITIZE$] = 
  $copyRequest$$inline_610_isPrioritized$$, ($copyRequest$$inline_610_isPrioritized$$ ? this.$_priorityRequestQueue$ : this.$_regularRequestQueue$).push($request$$10_request$$inline_616_requestData$$inline_605$$), this.$_requestQueuedListener$());
};
$AdfObject$$.$exportPrototypeSymbol$("AdfRestRequestQueueManager.prototype.push", {push:$AdfRestRequestQueueManager$$.prototype.push});
$AdfRestRequestQueueManager$$.$_cloneSimpleObject$ = function $$AdfRestRequestQueueManager$$$$_cloneSimpleObject$$($object$$23$$) {
  for (var $copyObject$$ = {}, $keys$$1$$ = Object.keys($object$$23$$), $i$$119$$ = 0;$i$$119$$ < $keys$$1$$.length;$i$$119$$++) {
    $copyObject$$[$keys$$1$$[$i$$119$$]] = $object$$23$$[$keys$$1$$[$i$$119$$]];
  }
  return $copyObject$$;
};
$AdfRestRequestQueueManager$$.$_deQueueDeadRequests$ = function $$AdfRestRequestQueueManager$$$$_deQueueDeadRequests$$($queue$$) {
  for (;0 != $queue$$.length && $queue$$[0].$_isDead$;) {
    $queue$$.shift();
  }
};
$AdfRestRequestQueueManager$$.$_findMatchingOutstandingRequest$ = function $$AdfRestRequestQueueManager$$$$_findMatchingOutstandingRequest$$($queue$$1$$, $actionURL$$10$$, $requestData$$1$$) {
  for (var $i$$120$$ = 0;$i$$120$$ < $queue$$1$$.length;$i$$120$$++) {
    var $qItem$$ = $queue$$1$$[$i$$120$$];
    if ($qItem$$.$actionURL$ === $actionURL$$10$$ && !$qItem$$.$_isDead$) {
      var $qRequestData$$ = $qItem$$.options[0][$AdfRestDataService$$.$REQUEST_DATA$];
      if ($qRequestData$$.method == $requestData$$1$$.method && $qRequestData$$.body == $requestData$$1$$.body) {
        return $qItem$$;
      }
    }
  }
};
$AdfRestRequestQueueManager$$.$_peekNextOutstandingRequest$ = function $$AdfRestRequestQueueManager$$$$_peekNextOutstandingRequest$$($queue$$2$$) {
  $AdfRestRequestQueueManager$$.$_deQueueDeadRequests$($queue$$2$$);
  return $queue$$2$$[0];
};
$AdfRestRequestQueueManager$$.$_shiftNextOutstandingRequest$ = function $$AdfRestRequestQueueManager$$$$_shiftNextOutstandingRequest$$($queue$$3$$) {
  $AdfRestRequestQueueManager$$.$_deQueueDeadRequests$($queue$$3$$);
  return $queue$$3$$.shift();
};
