function $AdfQueryUtils$$() {
  this.Init();
}
$goog$exportSymbol$$("AdfQueryUtils", $AdfQueryUtils$$);
$AdfQueryUtils$$.$InitClass$ = function $$AdfQueryUtils$$$$InitClass$$() {
};
$goog$exportSymbol$$("AdfQueryUtils.InitClass", $AdfQueryUtils$$.$InitClass$);
$AdfQueryUtils$$.prototype.Init = function $$AdfQueryUtils$$$$Init$() {
  $AdfQueryUtils$$.$superclass$.Init.call();
};
$AdfObject$$.$exportPrototypeSymbol$("AdfQueryUtils.prototype.Init", {Init:$AdfQueryUtils$$.prototype.Init});
$AdfQueryUtils$$.$_PROTECTED_SEARCH_PAGE_PROPERTY$ = "_afrProtectedSearch";
$AdfQueryUtils$$.$_QUERY_ID_JSON_PROPERTY$ = "queryId";
$AdfQueryUtils$$.$_QUERY_ITEMS_JSON_PROPERTY$ = "queryItems";
$AdfQueryUtils$$.$_QUERIES_JSON_PROPERTY$ = "queries";
$AdfQueryUtils$$.$_CLIENTID_JSON_PROPERTY$ = "clientId";
$AdfQueryUtils$$.$_SEARCHTERM_JSON_PROPERTY$ = "searchTerm";
$AdfQueryUtils$$.$_QUERIES_JSON_PROPERTY$ = "queries";
$AdfQueryUtils$$.$_OPERATOR_JSON_PROPERTY$ = "operator";
$AdfQueryUtils$$.$_QUICKQUERY_CRITERION_VALUE_SUBID$ = "criterionValue";
$AdfQueryUtils$$.$_OPERATOR_EXPANDO_SUBID$ = "oExp";
$AdfQueryUtils$$.$queueQueryEvent$ = function $$AdfQueryUtils$$$$queueQueryEvent$$($component$$2363$$) {
  if ($AdfPage$$.$PAGE$.$getPageProperty$($AdfQueryUtils$$.$_PROTECTED_SEARCH_PAGE_PROPERTY$)) {
    var $protectedElement$$1_queryItems$$ = $AdfQueryUtils$$.$_collectProtectionKeys$($component$$2363$$);
    if ($protectedElement$$1_queryItems$$ && 0 < $protectedElement$$1_queryItems$$.length) {
      var $formElement$$11_queryClientId$$1_queryElement$$ = $component$$2363$$.$getClientId$(), $bluecoatJSON$$ = {}, $queries$$3$$ = {};
      $queries$$3$$[$AdfQueryUtils$$.$_QUERY_ID_JSON_PROPERTY$] = $formElement$$11_queryClientId$$1_queryElement$$;
      $queries$$3$$[$AdfQueryUtils$$.$_QUERY_ITEMS_JSON_PROPERTY$] = $protectedElement$$1_queryItems$$;
      $bluecoatJSON$$[$AdfQueryUtils$$.$_QUERIES_JSON_PROPERTY$] = $queries$$3$$;
      $formElement$$11_queryClientId$$1_queryElement$$ = $AdfRichUIPeer$$.$getDomNodeForComponent$($component$$2363$$);
      $protectedElement$$1_queryItems$$ = document.getElementById($AdfDhtmlPage$$.$PROTECTED_SEARCH_TOKENIZED_QUERY_PARAMETER$);
      $formElement$$11_queryClientId$$1_queryElement$$ = $AdfDomUtils$$.$getFormElement$($formElement$$11_queryClientId$$1_queryElement$$);
      $protectedElement$$1_queryItems$$ || ($protectedElement$$1_queryItems$$ = $formElement$$11_queryClientId$$1_queryElement$$.ownerDocument.createElement("input"), $formElement$$11_queryClientId$$1_queryElement$$.appendChild($protectedElement$$1_queryItems$$), $protectedElement$$1_queryItems$$.setAttribute("name", $AdfDhtmlPage$$.$PROTECTED_SEARCH_TOKENIZED_QUERY_PARAMETER$), $protectedElement$$1_queryItems$$.setAttribute("id", $AdfDhtmlPage$$.$PROTECTED_SEARCH_TOKENIZED_QUERY_PARAMETER$), $protectedElement$$1_queryItems$$.setAttribute("type", 
      "hidden"));
      $protectedElement$$1_queryItems$$.setAttribute("value", JSON.stringify($bluecoatJSON$$));
    }
  }
  (new $AdfQueryEvent$$($component$$2363$$)).$queue$();
};
$goog$exportSymbol$$("AdfQueryUtils.queueQueryEvent", $AdfQueryUtils$$.$queueQueryEvent$);
$AdfQueryUtils$$.$_collectProtectionKeys$ = function $$AdfQueryUtils$$$$_collectProtectionKeys$$($component$$2364_descComponents$$3$$) {
  var $queryClientId$$2$$ = $component$$2364_descComponents$$3$$.$getClientId$();
  $component$$2364_descComponents$$3$$ = $component$$2364_descComponents$$3$$.$getDescendantComponents$();
  var $queryItems$$1$$ = [];
  if ($component$$2364_descComponents$$3$$) {
    for (var $j$$79$$ = 0;$j$$79$$ < $component$$2364_descComponents$$3$$.length;$j$$79$$++) {
      var $childComp$$5_valueClientId$$ = $component$$2364_descComponents$$3$$[$j$$79$$];
      if ($childComp$$5_valueClientId$$.$getProperty$($AdfDhtmlPage$$.$PROTECTED_KEY_ATTRIBUTE$)) {
        var $criterionIndex_operator_value$$277$$ = $childComp$$5_valueClientId$$.getValue();
        if (null != $criterionIndex_operator_value$$277$$ && "" != $criterionIndex_operator_value$$277$$) {
          var $queryItem$$ = {}, $childComp$$5_valueClientId$$ = $childComp$$5_valueClientId$$.$getClientId$(), $valueIndex$$;
          $queryItem$$[$AdfQueryUtils$$.$_CLIENTID_JSON_PROPERTY$] = $childComp$$5_valueClientId$$;
          $queryItem$$[$AdfQueryUtils$$.$_SEARCHTERM_JSON_PROPERTY$] = [];
          $queryItem$$[$AdfQueryUtils$$.$_SEARCHTERM_JSON_PROPERTY$].push($criterionIndex_operator_value$$277$$);
          if (-1 == $childComp$$5_valueClientId$$.indexOf($AdfQueryUtils$$.$_QUICKQUERY_CRITERION_VALUE_SUBID$)) {
            $criterionIndex_operator_value$$277$$ = $childComp$$5_valueClientId$$.substring($queryClientId$$2$$.length + 1);
            $valueIndex$$ = parseInt($criterionIndex_operator_value$$277$$.substring($criterionIndex_operator_value$$277$$.length - 1, $criterionIndex_operator_value$$277$$.length));
            if (0 < $valueIndex$$) {
              continue;
            }
            var $criterionIndex_operator_value$$277$$ = $criterionIndex_operator_value$$277$$.substring(3, $criterionIndex_operator_value$$277$$.length - 1), $operatorElement$$1$$ = $AdfAgent$$.$AGENT$.getElementById($queryClientId$$2$$ + ":" + $AdfDhtmlQueryPeer$$.$_OPERATOR_DROPDOWN_SUBID$ + $criterionIndex_operator_value$$277$$ + "::" + $AdfDhtmlQueryPeer$$.$CONTENT_SUBID$);
            $operatorElement$$1$$ ? ($criterionIndex_operator_value$$277$$ = $operatorElement$$1$$.options[$operatorElement$$1$$.selectedIndex].value) && "\x3d" != $criterionIndex_operator_value$$277$$ && "!\x3d" != $criterionIndex_operator_value$$277$$ ? $queryItem$$[$AdfQueryUtils$$.$_OPERATOR_JSON_PROPERTY$] = $criterionIndex_operator_value$$277$$ : $queryItem$$ = {} : $AdfQueryUtils$$.$_populateOperatorValueFromExpando$($queryItem$$, $queryClientId$$2$$ + ":" + $AdfDhtmlQueryPeer$$.$_CRITERION_SUBID$ + 
            $criterionIndex_operator_value$$277$$);
          } else {
            $AdfQueryUtils$$.$_populateOperatorValueFromExpando$($queryItem$$, $queryClientId$$2$$);
          }
          $AdfQueryUtils$$.$_adjustForSpecialOprators$($queryItem$$, $childComp$$5_valueClientId$$, $valueIndex$$);
          $queryItem$$[$AdfQueryUtils$$.$_OPERATOR_JSON_PROPERTY$] && $queryItems$$1$$.push($queryItem$$);
        }
      }
    }
    return $queryItems$$1$$;
  }
};
$AdfQueryUtils$$.$_adjustForSpecialOprators$ = function $$AdfQueryUtils$$$$_adjustForSpecialOprators$$($queryItem$$1$$, $twinComp_twinCompValue_valueClientId$$1$$, $valueIndex$$1$$) {
  "undefined" == typeof $valueIndex$$1$$ || "BETWEEN" != $queryItem$$1$$[$AdfQueryUtils$$.$_OPERATOR_JSON_PROPERTY$] && "NOTBETWEEN" != $queryItem$$1$$[$AdfQueryUtils$$.$_OPERATOR_JSON_PROPERTY$] || !($twinComp_twinCompValue_valueClientId$$1$$ = $AdfPage$$.$PAGE$.$findComponent$($twinComp_twinCompValue_valueClientId$$1$$.substring(0, $twinComp_twinCompValue_valueClientId$$1$$.length - 1) + ($valueIndex$$1$$ + 1))) || ($twinComp_twinCompValue_valueClientId$$1$$ = $twinComp_twinCompValue_valueClientId$$1$$.getValue(), 
  null != $twinComp_twinCompValue_valueClientId$$1$$ && "" != $twinComp_twinCompValue_valueClientId$$1$$ && $queryItem$$1$$[$AdfQueryUtils$$.$_SEARCHTERM_JSON_PROPERTY$].push($twinComp_twinCompValue_valueClientId$$1$$));
};
$AdfQueryUtils$$.$_populateOperatorValueFromExpando$ = function $$AdfQueryUtils$$$$_populateOperatorValueFromExpando$$($queryItem$$2$$, $clientId$$494$$) {
  var $operatorExpando$$ = $AdfQueryUtils$$.$_evaluateExpando$($clientId$$494$$);
  $operatorExpando$$ && "\x3d" != $operatorExpando$$ && "!\x3d" != $operatorExpando$$ && ($queryItem$$2$$[$AdfQueryUtils$$.$_OPERATOR_JSON_PROPERTY$] = $operatorExpando$$);
};
$AdfQueryUtils$$.$_evaluateExpando$ = function $$AdfQueryUtils$$$$_evaluateExpando$$($operatorExpandoClientid_queryClientId$$3$$) {
  $operatorExpandoClientid_queryClientId$$3$$ = $AdfRichUIPeer$$.$CreateSubId$($operatorExpandoClientid_queryClientId$$3$$, $AdfQueryUtils$$.$_OPERATOR_EXPANDO_SUBID$);
  return (operatorElement = $AdfAgent$$.$AGENT$.getElementById($operatorExpandoClientid_queryClientId$$3$$)) ? operatorElement.getAttribute("data-afr-operator") : null;
};
