var $AdfDhtmlCommandNavigationItemPeer$$ = $AdfRichUIPeer$$.$createPeerClass$($AdfRichUIPeer$$, "AdfDhtmlCommandNavigationItemPeer");
$goog$exportSymbol$$("AdfDhtmlCommandNavigationItemPeer", $AdfDhtmlCommandNavigationItemPeer$$);
$AdfDhtmlCommandNavigationItemPeer$$.$InitSubclass$ = function $$AdfDhtmlCommandNavigationItemPeer$$$$InitSubclass$$() {
  $AdfRichUIPeer$$.$addComponentEventHandlers$(this, $AdfUIInputEvent$$.$KEY_UP_EVENT_TYPE$, $AdfUIInputEvent$$.$CLICK_EVENT_TYPE$, $AdfUIInputEvent$$.$FOCUS_EVENT_TYPE$, $AdfUIInputEvent$$.$BLUR_EVENT_TYPE$);
  $AdfRichUIPeer$$.$addComponentPropertyChanges$(this, AdfRichCommandNavigationItem.TEXT);
  $AdfRichUIPeer$$.$addComponentPropertyGetters$(this, AdfRichCommandNavigationItem.TEXT);
  $AdfAgent$$.$AGENT$.$isTouchFirstDevice$() || $AdfRichUIPeer$$.$addComponentEventHandlers$(this, $AdfUIInputEvent$$.$MOUSE_IN_EVENT_TYPE$);
  this.$_TAB_ANCHOR_ID$ = "disclosureAnchor";
  this.$_REMOVE_ICON_ID$ = "rmAbv";
  this.$_HIGHLIGHTED_STYLE_CLASS$ = "p_AFHighlighted";
};
$goog$exportSymbol$$("AdfDhtmlCommandNavigationItemPeer.InitSubclass", $AdfDhtmlCommandNavigationItemPeer$$.$InitSubclass$);
$AdfDhtmlCommandNavigationItemPeer$$.prototype.$InitDomElement$ = function $$AdfDhtmlCommandNavigationItemPeer$$$$$InitDomElement$$($component$$982$$, $domElement$$147$$) {
  $AdfDhtmlCommandNavigationItemPeer$$.$superclass$.$InitDomElement$.call(this, $component$$982$$, $domElement$$147$$);
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlCommandNavigationItemPeer.prototype.InitDomElement", {$InitDomElement$:$AdfDhtmlCommandNavigationItemPeer$$.prototype.$InitDomElement$});
$AdfDhtmlCommandNavigationItemPeer$$.prototype.$HandleComponentKeyUp$ = function $$AdfDhtmlCommandNavigationItemPeer$$$$$HandleComponentKeyUp$$($componentEvent$$167_target$$121$$) {
  var $component$$983_evt$$93$$ = $componentEvent$$167_target$$121$$.$getNativeEvent$(), $keyCode$$53$$ = $componentEvent$$167_target$$121$$.$getKeyCode$();
  $component$$983_evt$$93$$.ctrlKey && $component$$983_evt$$93$$.altKey && $keyCode$$53$$ == $AdfKeyStroke$$.$F4_KEY$ && ($component$$983_evt$$93$$ = this.$getComponent$(), !$component$$983_evt$$93$$.getDisabled() && this.$canRemove$() && (this.$_saveAndRemoveCompressedLayout$(), $componentEvent$$167_target$$121$$ = $componentEvent$$167_target$$121$$.$getNativeEventTarget$(), $AdfFocusUtils$$.$focusNextTabStop$($componentEvent$$167_target$$121$$, null, !0), $AdfItemEvent$$.$queueItemRemoveEvent$($component$$983_evt$$93$$)));
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlCommandNavigationItemPeer.prototype.HandleComponentKeyUp", {$HandleComponentKeyUp$:$AdfDhtmlCommandNavigationItemPeer$$.prototype.$HandleComponentKeyUp$});
$AdfDhtmlCommandNavigationItemPeer$$.prototype.$HandleComponentClick$ = function $$AdfDhtmlCommandNavigationItemPeer$$$$$HandleComponentClick$$($componentEvent$$168$$) {
  var $component$$984$$ = this.$getComponent$();
  if ($componentEvent$$168$$.getSource() == $component$$984$$) {
    if (this.$_isDisabled$()) {
      $componentEvent$$168$$.$stopBubbling$();
    } else {
      if ($componentEvent$$168$$.$isLeftButtonPressed$()) {
        if (this.$_isOnRemoveButton$($componentEvent$$168$$)) {
          if (this.$canRemove$()) {
            this.$_saveAndRemoveCompressedLayout$();
            var $itemHref_target$$122$$ = $componentEvent$$168$$.$getNativeEventTarget$();
            $AdfFocusUtils$$.$focusNextTabStop$($itemHref_target$$122$$, null, !0);
            $AdfItemEvent$$.$queueItemRemoveEvent$($component$$984$$);
          }
        } else {
          var $domElement$$148$$ = $AdfRichUIPeer$$.$getDomElementForComponent$($component$$984$$), $itemHref_target$$122$$ = $domElement$$148$$.href;
          void 0 == $itemHref_target$$122$$ && ($itemHref_target$$122$$ = $domElement$$148$$.getAttribute("href"));
          var $documentHref$$1_trimmedDocHref$$1$$ = $AdfAgent$$.$AGENT$.$getDomDocument$().location.href, $hashIndex$$7$$ = $documentHref$$1_trimmedDocHref$$1$$.indexOf("#"), $documentHref$$1_trimmedDocHref$$1$$ = -1 == $hashIndex$$7$$ ? $documentHref$$1_trimmedDocHref$$1$$ : $documentHref$$1_trimmedDocHref$$1$$.substring(0, $hashIndex$$7$$);
          $itemHref_target$$122$$ && (-1 == $itemHref_target$$122$$.indexOf($documentHref$$1_trimmedDocHref$$1$$) || 1 < $itemHref_target$$122$$.substring($itemHref_target$$122$$.indexOf("#")).length) ? ($AdfPage$$.$PAGE$.$__perfTimings$(!0, !0, !0, "User click Command Navigation , GET request"), $itemHref_target$$122$$ = $domElement$$148$$.getAttribute("target"), $AdfPage$$.$PAGE$.$__handleNavigation$($domElement$$148$$.attributes.href.value, $itemHref_target$$122$$), $componentEvent$$168$$.cancel()) : 
          (this.$_saveAndRemoveCompressedLayout$(), $AdfActionEvent$$.$queue$($component$$984$$, $component$$984$$.getPartialSubmit()));
        }
      }
    }
  }
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlCommandNavigationItemPeer.prototype.HandleComponentClick", {$HandleComponentClick$:$AdfDhtmlCommandNavigationItemPeer$$.prototype.$HandleComponentClick$});
$AdfDhtmlCommandNavigationItemPeer$$.prototype.$HandleComponentFocus$ = function $$AdfDhtmlCommandNavigationItemPeer$$$$$HandleComponentFocus$$($componentEvent$$169$$) {
  this.$_isDisabled$() ? $componentEvent$$169$$.$stopBubbling$() : this.$_handleTabFocusOrBlur$($componentEvent$$169$$, !0);
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlCommandNavigationItemPeer.prototype.HandleComponentFocus", {$HandleComponentFocus$:$AdfDhtmlCommandNavigationItemPeer$$.prototype.$HandleComponentFocus$});
$AdfDhtmlCommandNavigationItemPeer$$.prototype.$HandleComponentBlur$ = function $$AdfDhtmlCommandNavigationItemPeer$$$$$HandleComponentBlur$$($componentEvent$$170$$) {
  this.$_handleTabFocusOrBlur$($componentEvent$$170$$, !1);
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlCommandNavigationItemPeer.prototype.HandleComponentBlur", {$HandleComponentBlur$:$AdfDhtmlCommandNavigationItemPeer$$.prototype.$HandleComponentBlur$});
$AdfDhtmlCommandNavigationItemPeer$$.prototype.$_handleTabFocusOrBlur$ = function $$AdfDhtmlCommandNavigationItemPeer$$$$$_handleTabFocusOrBlur$$($componentEvent$$171$$, $isFocus$$) {
  $componentEvent$$171$$.cancel();
  var $id$$286_tabElement_tokens$$20$$ = $componentEvent$$171$$.$getNativeEventTarget$().id;
  null != $id$$286_tabElement_tokens$$20$$ && ($id$$286_tabElement_tokens$$20$$ = $id$$286_tabElement_tokens$$20$$.split("::"), 1 >= $id$$286_tabElement_tokens$$20$$.length || $id$$286_tabElement_tokens$$20$$[$id$$286_tabElement_tokens$$20$$.length - 1] != $AdfDhtmlCommandNavigationItemPeer$$.$_TAB_ANCHOR_ID$ || ($id$$286_tabElement_tokens$$20$$ = this.$getDomElement$(), $isFocus$$ ? $AdfDomUtils$$.$addCSSClassName$($id$$286_tabElement_tokens$$20$$, $AdfDhtmlCommandNavigationItemPeer$$.$_HIGHLIGHTED_STYLE_CLASS$) : 
  $AdfDomUtils$$.$removeCSSClassName$($id$$286_tabElement_tokens$$20$$, $AdfDhtmlCommandNavigationItemPeer$$.$_HIGHLIGHTED_STYLE_CLASS$)));
};
$AdfDhtmlCommandNavigationItemPeer$$.prototype.$HandleComponentMouseOver$ = function $$AdfDhtmlCommandNavigationItemPeer$$$$$HandleComponentMouseOver$$($componentEvent$$172$$) {
  this.$_isDisabled$() && $componentEvent$$172$$.$stopBubbling$();
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlCommandNavigationItemPeer.prototype.HandleComponentMouseOver", {$HandleComponentMouseOver$:$AdfDhtmlCommandNavigationItemPeer$$.prototype.$HandleComponentMouseOver$});
$AdfDhtmlCommandNavigationItemPeer$$.prototype.$GetInlineEditor$ = function $$AdfDhtmlCommandNavigationItemPeer$$$$$GetInlineEditor$$() {
  return $AdfDhtmlNavigationItemTextEditor$$.$getInlineEditor$();
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlCommandNavigationItemPeer.prototype.GetInlineEditor", {$GetInlineEditor$:$AdfDhtmlCommandNavigationItemPeer$$.prototype.$GetInlineEditor$});
$AdfDhtmlCommandNavigationItemPeer$$.prototype.$ComponentTextChanged$ = function $$AdfDhtmlCommandNavigationItemPeer$$$$$ComponentTextChanged$$($component$$985$$, $domElement$$149_textWrapperElement$$1$$, $newValue$$58$$, $oldValue$$36$$) {
  return null != $oldValue$$36$$ && ($domElement$$149_textWrapperElement$$1$$ = $AdfDhtmlCommandNavigationItemPeer$$.$getInlineEditableTextElement$($component$$985$$, $domElement$$149_textWrapperElement$$1$$)) ? $AdfDomUtils$$.$handleTextChangeWithAccessKey$($component$$985$$, $domElement$$149_textWrapperElement$$1$$, $newValue$$58$$) : !1;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlCommandNavigationItemPeer.prototype.ComponentTextChanged", {$ComponentTextChanged$:$AdfDhtmlCommandNavigationItemPeer$$.prototype.$ComponentTextChanged$});
$AdfDhtmlCommandNavigationItemPeer$$.$getInlineEditableTextElement$ = function $$AdfDhtmlCommandNavigationItemPeer$$$$getInlineEditableTextElement$$($component$$986$$, $domElement$$150$$) {
  $AdfAssert$$.assert(null != $component$$986$$.$getProperty$("text"));
  var $lastChildElement_textWrapperElement$$2$$ = $AdfDomUtils$$.$getFirstDescendentElement$($domElement$$150$$, "a");
  $lastChildElement_textWrapperElement$$2$$ || "a" == $AdfAgent$$.$AGENT$.$getNodeName$($domElement$$150$$).toLowerCase() && ($lastChildElement_textWrapperElement$$2$$ = $domElement$$150$$);
  if ($lastChildElement_textWrapperElement$$2$$) {
    if ($AdfDomUtils$$.$getFirstDescendentElement$($lastChildElement_textWrapperElement$$2$$, "img")) {
      if ($lastChildElement_textWrapperElement$$2$$ = $AdfDomUtils$$.$getLastChildElement$($lastChildElement_textWrapperElement$$2$$), "SPAN" == $lastChildElement_textWrapperElement$$2$$.tagName) {
        return $lastChildElement_textWrapperElement$$2$$;
      }
    } else {
      return $lastChildElement_textWrapperElement$$2$$;
    }
  }
  return null;
};
$goog$exportSymbol$$("AdfDhtmlCommandNavigationItemPeer.getInlineEditableTextElement", $AdfDhtmlCommandNavigationItemPeer$$.$getInlineEditableTextElement$);
$AdfDhtmlCommandNavigationItemPeer$$.prototype.$_isOnRemoveButton$ = function $$AdfDhtmlCommandNavigationItemPeer$$$$$_isOnRemoveButton$$($componentEvent$$173_target$$124$$) {
  var $cniId_cniRemoveId$$ = this.$getComponent$().$getClientId$(), $cniId_cniRemoveId$$ = $AdfRichUIPeer$$.$createSubId$($cniId_cniRemoveId$$, $AdfDhtmlCommandNavigationItemPeer$$.$_REMOVE_ICON_ID$);
  $componentEvent$$173_target$$124$$ = $componentEvent$$173_target$$124$$.$getNativeEventTarget$();
  return $componentEvent$$173_target$$124$$.id == $cniId_cniRemoveId$$ ? !0 : $componentEvent$$173_target$$124$$.parentNode.id == $cniId_cniRemoveId$$;
};
$AdfDhtmlCommandNavigationItemPeer$$.prototype.$canRemove$ = function $$AdfDhtmlCommandNavigationItemPeer$$$$$canRemove$$() {
  var $cniId$$1_cniRemoveId$$1_component$$988$$ = this.$getComponent$();
  if ($cniId$$1_cniRemoveId$$1_component$$988$$.getRemove) {
    var $itemRemoveType_parent$$28_tabRemovalType$$ = $cniId$$1_cniRemoveId$$1_component$$988$$.getRemove();
    if ($itemRemoveType_parent$$28_tabRemovalType$$ && ("no" == $itemRemoveType_parent$$28_tabRemovalType$$ || "disabled" == $itemRemoveType_parent$$28_tabRemovalType$$)) {
      return !1;
    }
  }
  $itemRemoveType_parent$$28_tabRemovalType$$ = $cniId$$1_cniRemoveId$$1_component$$988$$.getParent();
  if (null == $itemRemoveType_parent$$28_tabRemovalType$$.getItemRemoval) {
    return !1;
  }
  $itemRemoveType_parent$$28_tabRemovalType$$ = $itemRemoveType_parent$$28_tabRemovalType$$.getItemRemoval();
  if ($cniId$$1_cniRemoveId$$1_component$$988$$.getDisabled() || null == $itemRemoveType_parent$$28_tabRemovalType$$ || "none" == $itemRemoveType_parent$$28_tabRemovalType$$) {
    return !1;
  }
  if ("all" == $itemRemoveType_parent$$28_tabRemovalType$$) {
    return !0;
  }
  if ("allExceptLast" == $itemRemoveType_parent$$28_tabRemovalType$$) {
    return $cniId$$1_cniRemoveId$$1_component$$988$$ = $cniId$$1_cniRemoveId$$1_component$$988$$.$getClientId$(), $cniId$$1_cniRemoveId$$1_component$$988$$ = $AdfRichUIPeer$$.$createSubId$($cniId$$1_cniRemoveId$$1_component$$988$$, $AdfDhtmlCommandNavigationItemPeer$$.$_REMOVE_ICON_ID$), null != $AdfAgent$$.$getAgent$().getElementById($cniId$$1_cniRemoveId$$1_component$$988$$);
  }
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlCommandNavigationItemPeer.prototype.canRemove", {$canRemove$:$AdfDhtmlCommandNavigationItemPeer$$.prototype.$canRemove$});
$AdfDhtmlCommandNavigationItemPeer$$.prototype.$_saveAndRemoveCompressedLayout$ = function $$AdfDhtmlCommandNavigationItemPeer$$$$$_saveAndRemoveCompressedLayout$$() {
  var $parentComponent$$7$$ = this.$getComponent$().getParent(), $parentPeer$$7$$ = null != $parentComponent$$7$$ ? $parentComponent$$7$$.$getPeer$() : null;
  $parentPeer$$7$$ && ($parentPeer$$7$$.bind($parentComponent$$7$$), $parentPeer$$7$$ && $parentPeer$$7$$.$__saveAndRemoveCompressedLayout$ && $parentPeer$$7$$.$__saveAndRemoveCompressedLayout$());
};
$AdfDhtmlCommandNavigationItemPeer$$.prototype.$_isDisabled$ = function $$AdfDhtmlCommandNavigationItemPeer$$$$$_isDisabled$$() {
  var $rootElement$$49$$ = this.$getDomElement$();
  return $rootElement$$49$$.disabled || $AdfDomUtils$$.$containsCSSClassName$($rootElement$$49$$, $AdfRichUIPeer$$.$DISABLED_STYLECLASS$);
};
$AdfDhtmlCommandNavigationItemPeer$$.prototype.$GetComponentText$ = function $$AdfDhtmlCommandNavigationItemPeer$$$$$GetComponentText$$($component$$990$$, $domElement$$151$$) {
  "A" != $domElement$$151$$.tagName && ($domElement$$151$$ = $AdfDomUtils$$.$getFirstDescendentElement$($domElement$$151$$, "a"));
  if ($domElement$$151$$) {
    var $text$$27$$ = $AdfAgent$$.$AGENT$.$getTextContent$($domElement$$151$$);
    return "" == $text$$27$$ ? null : $text$$27$$;
  }
  $AdfAssert$$.assert(!1, "Unable to find the element containing the text");
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlCommandNavigationItemPeer.prototype.GetComponentText", {$GetComponentText$:$AdfDhtmlCommandNavigationItemPeer$$.prototype.$GetComponentText$});
$AdfDhtmlCommandNavigationItemPeer$$.prototype.$GetAccessibleName$ = function $$AdfDhtmlCommandNavigationItemPeer$$$$$GetAccessibleName$$() {
  return this.$getComponent$().getText();
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlCommandNavigationItemPeer.prototype.GetAccessibleName", {$GetAccessibleName$:$AdfDhtmlCommandNavigationItemPeer$$.prototype.$GetAccessibleName$});
