text: /*!
   * UI development toolkit for HTML5 (OpenUI5)
   * (c) Copyright 2009-2017 SAP SE or an SAP affiliate company.
   * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
   */
  (function(g){"use strict";var o;if(g.module){o=g.module;g.module=undefined;}sap.ui.define(['jquery.sap.global','sap/ui/core/routing/HashChanger','sap/ui/base/Object','sap/ui/core/mvc/View','./matchers/Ancestor','./matchers/Interactable','./matchers/Visible','./pipelines/MatcherPipeline','./_autoWaiter','sap/ui/test/_opaCorePlugin'],function($,H,U,V,A,I,a,M,_,b){var m=new M(),i=new I(),v=new a(),c=["id","viewName","controlType","searchOpenDialogs"];var O=U.extend("sap.ui.test.OpaPlugin",{constructor:function(l){l=l||"sap.ui.test.OpaPlugin";this._oLogger=$.sap.log.getLogger(l);},getAllControls:function(C){return b.getAllControls(C);},getView:function(d){var e=this.getAllControls(V);return e.filter(function(f){return f.getViewName()===d;})[0];},getControlInView:function(d){var e=((d.viewNamespace||"")+"."+(d.viewName||"")).replace(/\.+/g,'.').replace(/^\.|\.$/g,""),f=this.getView(e),r=[],C,h=typeof d.id==="string",j;if(!f){this._oLogger.debug("Found no view with the name: '"+e+"'");if(h){return null;}return[];}if($.isArray(d.id)){$.each(d.id,function(l,n){C=f.byId(n);if(C){r.push(C);}});return r;}if(h){var E=f.byId(d.id);if(!E){this._oLogger.debug("Found no control with the id: '"+d.id+"' in the view: '"+e+"'");return null;}return E;}var k=this.getAllControlsWithTheParent(f,d.controlType);if($.type(d.id)==="regexp"){j=f.getId();k=k.filter(function(C){var u=C.getId().replace(j,"");return d.id.test(u);});}return k;},getAllControlsWithTheParent:function(p,C){var d=new A(p);return this._filterUniqueControlsByCondition(this.getAllControls(C),d);},getAllControlsInContainer:function(C,f){return this._filterUniqueControlsByCondition(C.find("*").control(),function(d){return b.checkControlType(d,f);});},getMatchingControls:function(d){var r=null;d=d||{};var h=this._modifyControlType(d);if(!h){return typeof d.id==="string"?r:[];}if(d.searchOpenDialogs){r=this.getAllControlsInContainer($("#sap-ui-static"),d.controlType);}else if(d.viewName){r=this.getControlInView(d);}else if(d.id){r=this.getControlByGlobalId(d);}else if(d.controlType){r=this.getAllControls(d.controlType);}else{r=this.getAllControls();}if(!r||d.visible===false){return r;}var e=[];if(d.interactable){e.push(i);}else{e.push(v);}var p=m.process({control:r,matchers:e});if(!p){if($.isArray(r)){return[];}if(r){return null;}return r;}return p;},getFilterdControls:function(d){var p=$.extend({},d,{interactable:!!d.actions||d.autoWait}),P=this._isLookingForAControl(p);var C=null,r=null;if(P){C=this.getMatchingControls(p);}else if(d.autoWait&&_.hasToWait()){return O.FILTER_FOUND_NO_CONTROLS;}if(typeof d.id==="string"&&!C){return O.FILTER_FOUND_NO_CONTROLS;}if(!d.id&&(d.viewName||d.searchOpenDialogs)&&C.length===0){this._oLogger.debug("found no controls in view: "+d.viewName+" with controlType "+d.sOriginalControlType,"","Opa");return O.FILTER_FOUND_NO_CONTROLS;}if($.type(d.id)==="regexp"&&!C.length){this._oLogger.debug("found no control with the id regex"+d.id);return O.FILTER_FOUND_NO_CONTROLS;}if($.isArray(d.id)&&(!C||C.length!==d.id.length)){if(C&&C.length){this._oLogger.debug("found not all controls with the ids "+d.id+" onlyFound the controls: "+C.map(function(e){return e.sId;}));}else{this._oLogger.debug("found no control with the id  "+d.id);}return O.FILTER_FOUND_NO_CONTROLS;}if(d.controlType&&$.isArray(C)&&!C.length){this._oLogger.debug("found no controls with the type  "+d.sOriginalControlType,"","Opa");return O.FILTER_FOUND_NO_CONTROLS;}if((C||!P)&&d.matchers){r=m.process({matchers:d.matchers,control:C});if(!r){return O.FILTER_FOUND_NO_CONTROLS;}}else{r=C;}return r;},getControlByGlobalId:function(d){var S=d.id,C=[],e=[],f=b.getCoreElements();if(typeof S==="string"){C=f[S];if(!C){this._oLogger.debug("Found no control with the global id: '"+S+"'");return null;}if(!b.checkControlType(C,d.controlType)){this._oLogger.error("An id: '"+d.id+"' was passed together with the controlType '"+d.sOriginalControlType+"' but the type does not match the control retrieved: '"+C+"' - null is returned");return null;}return C;}if($.type(S)==="regexp"){for(var p in f){if(!f.hasOwnProperty(p)){continue;}if(!S.test(p)){continue;}e.push(p);}}else if($.isArray(S)){e=S;}return e.map(function(h){return f[h];}).filter(function(h){return b.checkControlType(h,d.controlType)&&h&&!h.bIsDestroyed;});},getControlConstructor:function(C){if(sap.ui.lazyRequire._isStub(C)){this._oLogger.debug("The control type "+C+" is currently a lazy stub.");return null;}var f=$.sap.getObject(C);if(!f){this._oLogger.debug("The control type "+C+" is undefined.");return null;}return f;},_isLookingForAControl:function(d){return Object.keys(d).some(function(k){return c.indexOf(k)!==-1&&!!d[k];});},_filterUniqueControlsByCondition:function(C,f){return C.filter(function(d,p,e){var k=!!f(d);return k&&e.indexOf(d)===p;});},_modifyControlType:function(d){var C=d.controlType;if(typeof C!=="string"){if(C&&C._sapUiLazyLoader){this._oLogger.debug("The control type is currently a lazy stub");return false;}return true;}var f=this.getControlConstructor(C);if(!f){return false;}d.sOriginalControlType=C;d.controlType=f;return true;}});var s;O.getInstance=function(){if(!s){s=new O("sap.ui.test.Opa5");}return s;};O.FILTER_FOUND_NO_CONTROLS="FILTER_FOUND_NO_CONTROL";return O;},true);if(o){g.module=o;}})(window);
  