function $AdfChainSuggestionsMap$$() {
  this.Init();
}
$goog$exportSymbol$$("AdfChainSuggestionsMap", $AdfChainSuggestionsMap$$);
$AdfObject$$.$createSubclass$($AdfChainSuggestionsMap$$, $AdfSuggestionMap$$);
$AdfChainSuggestionsMap$$.$InitClass$ = function $$AdfChainSuggestionsMap$$$$InitClass$$() {
};
$goog$exportSymbol$$("AdfChainSuggestionsMap.InitClass", $AdfChainSuggestionsMap$$.$InitClass$);
$AdfChainSuggestionsMap$$.prototype.Init = function $$AdfChainSuggestionsMap$$$$Init$() {
  $AdfChainSuggestionsMap$$.$superclass$.Init.call(this);
  this.$_chain$ = [];
  this.$_source$ = [];
  this.$inclusiveHeaderLength$ = this.length = 0;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfChainSuggestionsMap.prototype.Init", {Init:$AdfChainSuggestionsMap$$.prototype.Init});
$AdfChainSuggestionsMap$$.prototype.$addSuggestionMap$ = function $$AdfChainSuggestionsMap$$$$$addSuggestionMap$$($suggestionMap$$, $section$$1$$) {
  $AdfAssert$$.$assertPrototype$($suggestionMap$$, $AdfSuggestionMap$$);
  this.$_chain$.push($suggestionMap$$);
  this.$_source$.push($section$$1$$);
  this.length += $suggestionMap$$.length;
  this.$inclusiveHeaderLength$ += $section$$1$$ ? $suggestionMap$$.length + 1 : $suggestionMap$$.length;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfChainSuggestionsMap.prototype.addSuggestionMap", {$addSuggestionMap$:$AdfChainSuggestionsMap$$.prototype.$addSuggestionMap$});
$AdfChainSuggestionsMap$$.prototype.$getSuggestionMap$ = function $$AdfChainSuggestionsMap$$$$$getSuggestionMap$$($index$$83$$) {
  return this.$_chain$[$index$$83$$];
};
$AdfObject$$.$exportPrototypeSymbol$("AdfChainSuggestionsMap.prototype.getSuggestionMap", {$getSuggestionMap$:$AdfChainSuggestionsMap$$.prototype.$getSuggestionMap$});
$AdfChainSuggestionsMap$$.prototype.$updateSuggestionMap$ = function $$AdfChainSuggestionsMap$$$$$updateSuggestionMap$$($index$$84$$, $suggestionMap$$1$$) {
  this.length -= this.$_chain$[$index$$84$$].length;
  this.$inclusiveHeaderLength$ -= this.$_chain$[$index$$84$$].length;
  this.$_chain$[$index$$84$$] = $suggestionMap$$1$$;
  this.length += $suggestionMap$$1$$.length;
  this.$inclusiveHeaderLength$ += $suggestionMap$$1$$.length;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfChainSuggestionsMap.prototype.updateSuggestionMap", {$updateSuggestionMap$:$AdfChainSuggestionsMap$$.prototype.$updateSuggestionMap$});
$AdfChainSuggestionsMap$$.prototype.$at$ = function $$AdfChainSuggestionsMap$$$$$at$$($chainedIndex$$) {
  for (var $accumulatedIndex$$ = 0, $i$$129$$ = 0, $chainLen$$ = this.$_chain$.length;$i$$129$$ < $chainLen$$;$i$$129$$++) {
    var $suggestionMap$$2$$ = this.$_chain$[$i$$129$$], $index$$85$$ = $chainedIndex$$ - $accumulatedIndex$$;
    if ($suggestionMap$$2$$.length - 1 >= $index$$85$$) {
      return $suggestionMap$$2$$.$at$($index$$85$$);
    }
    $accumulatedIndex$$ += $suggestionMap$$2$$.length;
  }
};
$AdfObject$$.$exportPrototypeSymbol$("AdfChainSuggestionsMap.prototype.at", {$at$:$AdfChainSuggestionsMap$$.prototype.$at$});
$AdfChainSuggestionsMap$$.prototype.get = function $$AdfChainSuggestionsMap$$$$get$($key$$44$$) {
  for (var $i$$130$$ = 0, $chainLen$$1$$ = this.$_chain$.length;$i$$130$$ < $chainLen$$1$$;$i$$130$$++) {
    var $item$$3$$ = this.$_chain$[$i$$130$$].get($key$$44$$);
    if ($item$$3$$) {
      return $item$$3$$;
    }
  }
};
$AdfObject$$.$exportPrototypeSymbol$("AdfChainSuggestionsMap.prototype.get", {get:$AdfChainSuggestionsMap$$.prototype.get});
$AdfChainSuggestionsMap$$.prototype.forEach = function $$AdfChainSuggestionsMap$$$$forEach$($callback$$84$$, $thisArg$$6$$) {
  for (var $chainedIndex$$1$$ = 0, $i$$131$$ = 0, $chainLen$$2$$ = this.$_chain$.length;$i$$131$$ < $chainLen$$2$$;$i$$131$$++) {
    for (var $array$$20$$ = this.$_chain$[$i$$131$$].$getArray$(), $j$$12$$ = 0, $arrayLen$$ = $array$$20$$.length;$j$$12$$ < $arrayLen$$;$j$$12$$++) {
      var $item$$4$$ = $array$$20$$[$j$$12$$];
      $callback$$84$$.call($thisArg$$6$$, $item$$4$$.data, $item$$4$$.key, $chainedIndex$$1$$, $item$$4$$);
      $chainedIndex$$1$$++;
    }
  }
};
$AdfObject$$.$exportPrototypeSymbol$("AdfChainSuggestionsMap.prototype.forEach", {forEach:$AdfChainSuggestionsMap$$.prototype.forEach});
$AdfChainSuggestionsMap$$.prototype.filter = function $$AdfChainSuggestionsMap$$$$filter$($callback$$85$$, $thisArg$$7$$) {
  for (var $newArray$$ = [], $chainedIndex$$2$$ = 0, $i$$132$$ = 0, $chainLen$$3$$ = this.$_chain$.length;$i$$132$$ < $chainLen$$3$$;$i$$132$$++) {
    for (var $array$$21$$ = this.$_chain$[$i$$132$$].$getArray$(), $j$$13$$ = 0, $arrayLen$$1$$ = $array$$21$$.length;$j$$13$$ < $arrayLen$$1$$;$j$$13$$++) {
      var $item$$5$$ = $array$$21$$[$j$$13$$];
      $callback$$85$$.call($thisArg$$7$$, $item$$5$$.data, $item$$5$$.key, $chainedIndex$$2$$, $item$$5$$) && $newArray$$.push($item$$5$$);
      $chainedIndex$$2$$++;
    }
  }
  return $newArray$$;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfChainSuggestionsMap.prototype.filter", {filter:$AdfChainSuggestionsMap$$.prototype.filter});
$AdfChainSuggestionsMap$$.prototype.$getArray$ = function $$AdfChainSuggestionsMap$$$$$getArray$$() {
  for (var $newArray$$1$$ = [], $i$$133$$ = 0, $chainLen$$4$$ = this.$_chain$.length;$i$$133$$ < $chainLen$$4$$;$i$$133$$++) {
    for (var $array$$22$$ = this.$_chain$[$i$$133$$].$getArray$(), $j$$14$$ = 0, $arrayLen$$2$$ = $array$$22$$.length;$j$$14$$ < $arrayLen$$2$$;$j$$14$$++) {
      $newArray$$1$$.push($array$$22$$[$j$$14$$]);
    }
  }
  return $newArray$$1$$;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfChainSuggestionsMap.prototype.getArray", {$getArray$:$AdfChainSuggestionsMap$$.prototype.$getArray$});
$AdfChainSuggestionsMap$$.prototype.$inclusiveHeaderForEach$ = function $$AdfChainSuggestionsMap$$$$$inclusiveHeaderForEach$$($inclusiveHeaderStartIndex$$, $inclusiveHeaderEndIndex$$, $callback$$86$$, $thisArg$$8$$) {
  var $chainNoAndIndex_chainedIndex$$3$$ = $JSCompiler_StaticMethods__getChainNoAndIndex$$(this, $inclusiveHeaderStartIndex$$);
  if ($chainNoAndIndex_chainedIndex$$3$$) {
    var $chainLen$$5_startChainNo$$ = $chainNoAndIndex_chainedIndex$$3$$.$chainNo$, $i$$134_startIndex$$4$$ = $chainNoAndIndex_chainedIndex$$3$$.index, $chainNoAndIndex_chainedIndex$$3$$ = $chainNoAndIndex_chainedIndex$$3$$.$chainedIndex$;
    0 > $i$$134_startIndex$$4$$ && $JSCompiler_StaticMethods__shouldCountSectionHeader$$(this, $chainLen$$5_startChainNo$$) && ($callback$$86$$.call($thisArg$$8$$, this.$_source$[$chainLen$$5_startChainNo$$], $inclusiveHeaderStartIndex$$), $i$$134_startIndex$$4$$++, $inclusiveHeaderStartIndex$$++, $chainNoAndIndex_chainedIndex$$3$$++);
    for (var $len$$8$$ = this.$_chain$[$chainLen$$5_startChainNo$$].length;$i$$134_startIndex$$4$$ < $len$$8$$ && $inclusiveHeaderStartIndex$$ < $inclusiveHeaderEndIndex$$;$i$$134_startIndex$$4$$++, $inclusiveHeaderStartIndex$$++, $chainNoAndIndex_chainedIndex$$3$$++) {
      $callback$$86$$.call($thisArg$$8$$, this.$_chain$[$chainLen$$5_startChainNo$$].$at$($i$$134_startIndex$$4$$), $inclusiveHeaderStartIndex$$, $chainNoAndIndex_chainedIndex$$3$$);
    }
    $i$$134_startIndex$$4$$ = $chainLen$$5_startChainNo$$ + 1;
    for ($chainLen$$5_startChainNo$$ = this.$_chain$.length;$i$$134_startIndex$$4$$ < $chainLen$$5_startChainNo$$ && $inclusiveHeaderStartIndex$$ < $inclusiveHeaderEndIndex$$;$i$$134_startIndex$$4$$++) {
      $JSCompiler_StaticMethods__shouldCountSectionHeader$$(this, $i$$134_startIndex$$4$$) && $callback$$86$$.call($thisArg$$8$$, this.$_source$[$i$$134_startIndex$$4$$]);
      for (var $suggestionMap$$3$$ = this.$_chain$[$i$$134_startIndex$$4$$], $j$$15$$ = 0, $len$$8$$ = $suggestionMap$$3$$.length;$j$$15$$ < $len$$8$$ && $inclusiveHeaderStartIndex$$ < $inclusiveHeaderEndIndex$$;$j$$15$$++, $inclusiveHeaderStartIndex$$++, $chainNoAndIndex_chainedIndex$$3$$++) {
        $callback$$86$$.call($thisArg$$8$$, $suggestionMap$$3$$.$at$($j$$15$$), $inclusiveHeaderStartIndex$$, $chainNoAndIndex_chainedIndex$$3$$);
      }
    }
  }
};
$AdfObject$$.$exportPrototypeSymbol$("AdfChainSuggestionsMap.prototype.inclusiveHeaderForEach", {$inclusiveHeaderForEach$:$AdfChainSuggestionsMap$$.prototype.$inclusiveHeaderForEach$});
$AdfChainSuggestionsMap$$.prototype.$getInclusiveHeaderIndex$ = function $$AdfChainSuggestionsMap$$$$$getInclusiveHeaderIndex$$($chainedIndex$$4$$) {
  for (var $inclusiveIndex$$ = 0, $accumulatedIndex$$1$$ = 0, $i$$135$$ = 0, $chainLen$$6$$ = this.$_chain$.length;$i$$135$$ < $chainLen$$6$$;$i$$135$$++) {
    var $inclusiveIndex$$ = $inclusiveIndex$$ + ($JSCompiler_StaticMethods__shouldCountSectionHeader$$(this, $i$$135$$) ? 1 : 0), $suggestionMap$$4$$ = this.$_chain$[$i$$135$$], $index$$86$$ = $chainedIndex$$4$$ - $accumulatedIndex$$1$$;
    if ($suggestionMap$$4$$.length - 1 >= $index$$86$$) {
      return $inclusiveIndex$$ + $index$$86$$;
    }
    $accumulatedIndex$$1$$ += $suggestionMap$$4$$.length;
    $inclusiveIndex$$ += $suggestionMap$$4$$.length;
  }
};
$AdfObject$$.$exportPrototypeSymbol$("AdfChainSuggestionsMap.prototype.getInclusiveHeaderIndex", {$getInclusiveHeaderIndex$:$AdfChainSuggestionsMap$$.prototype.$getInclusiveHeaderIndex$});
$AdfChainSuggestionsMap$$.prototype.$getChainedIndex$ = function $$AdfChainSuggestionsMap$$$$$getChainedIndex$$($inclusiveIndex$$1$$) {
  return $JSCompiler_StaticMethods__getChainNoAndIndex$$(this, $inclusiveIndex$$1$$).$chainedIndex$;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfChainSuggestionsMap.prototype.getChainedIndex", {$getChainedIndex$:$AdfChainSuggestionsMap$$.prototype.$getChainedIndex$});
function $JSCompiler_StaticMethods__getChainNoAndIndex$$($JSCompiler_StaticMethods__getChainNoAndIndex$self$$, $inclusiveIndex$$2$$) {
  for (var $chainedIndex$$5$$ = 0, $accumulatedIndex$$2$$ = 0, $i$$136$$ = 0, $chainLen$$7$$ = $JSCompiler_StaticMethods__getChainNoAndIndex$self$$.$_chain$.length;$i$$136$$ < $chainLen$$7$$;$i$$136$$++) {
    var $accumulatedIndex$$2$$ = $accumulatedIndex$$2$$ + ($JSCompiler_StaticMethods__shouldCountSectionHeader$$($JSCompiler_StaticMethods__getChainNoAndIndex$self$$, $i$$136$$) ? 1 : 0), $suggestionMap$$5$$ = $JSCompiler_StaticMethods__getChainNoAndIndex$self$$.$_chain$[$i$$136$$], $index$$87$$ = $inclusiveIndex$$2$$ - $accumulatedIndex$$2$$;
    if ($suggestionMap$$5$$.length - 1 >= $index$$87$$) {
      return {index:$index$$87$$, chainNo:$i$$136$$, chainedIndex:$chainedIndex$$5$$ + $index$$87$$};
    }
    $accumulatedIndex$$2$$ += $suggestionMap$$5$$.length;
    $chainedIndex$$5$$ += $suggestionMap$$5$$.length;
  }
}
function $JSCompiler_StaticMethods__shouldCountSectionHeader$$($JSCompiler_StaticMethods__shouldCountSectionHeader$self$$, $index$$88$$) {
  var $source$$121$$ = $JSCompiler_StaticMethods__shouldCountSectionHeader$self$$.$_source$[$index$$88$$];
  return $source$$121$$ && $AdfDhtmlSuggestionsSectionPeer$$.$hasHeader$($source$$121$$) && 0 < $JSCompiler_StaticMethods__shouldCountSectionHeader$self$$.$_chain$[$index$$88$$].length;
}
;