function AdfSafariMobileAgent(a,b){this.Init(a,b)}AdfObject.createSubclass(AdfSafariMobileAgent,AdfSafariAgent);AdfSafariMobileAgent.prototype.Init=function(a,b){AdfSafariMobileAgent.superclass.Init.call(this,a,b);this._isWithinTouchEventsSequence=!0};AdfSafariMobileAgent.prototype.GetTouchCapability=function(){return this.getOS()!=AdfAgent.ANDROID_OS?AdfAgent.CAP_TOUCH_SCREEN_MULTIPLE:AdfSafariMobileAgent.superclass.GetTouchCapability.call(this)};
AdfSafariMobileAgent.prototype.createTouchMoveManager=function(a,b,d){return new AdfSafariTouchMoveManager(a,b,d)};AdfSafariMobileAgent.prototype.getBrowserViewportScrollTop=function(){return this.getDomWindow().pageYOffset};AdfSafariMobileAgent.prototype.getBrowserViewportScrollLeft=function(){return this.getDomWindow().pageXOffset};AdfSafariMobileAgent.prototype.isInlineDialogRepositioningOnScroll=function(){return!1};AdfSafariMobileAgent.prototype.isSelectionToggle=function(a){return!0};
AdfSafariMobileAgent.prototype.getMousePosition=function(a){if(-1<AdfCollections.indexOf(AdfAgent._REDISTRIBUTE_TOUCH_EVENTS,a.type)){a=AdfComponentTouchEvent.__getFirstTouch(a);var b=this.getBrowserViewportScrollTop(),d=this.getBrowserViewportScrollLeft();return{x:a.clientX+d,y:a.clientY+b}}return AdfSafariMobileAgent.superclass.getMousePosition.call(this,a)};
AdfSafariMobileAgent.prototype.getComponentEvent=function(a,b,d){var e=AdfSafariMobileAgent.superclass.mapNativeToComponentEventType.call(this,b.type);if(e){switch(e){case AdfComponentTouchEvent.TOUCH_START_EVENT_TYPE:this._isWithinTouchEventsSequence=!0}return new AdfComponentTouchEvent(a,e,b)}return this._isWithinTouchEventsSequence?AdfSafariMobileAgent.superclass.getComponentEvent.call(this,a,b,d):null};
AdfSafariMobileAgent.prototype.preventDefault=function(a){AdfSafariMobileAgent.superclass.preventDefault.call(this,a);a=a.type;if("touchstart"==a||"touchend"==a)this._isWithinTouchEventsSequence=!1};
AdfSafariMobileAgent.prototype.getEventTarget=function(a){var b=null,d=a.type;if(a._afrClonedEvent)b=AdfSafariMobileAgent.superclass.getEventTarget.call(this,a);else if(-1<AdfCollections.indexOf(AdfAgent._REDISTRIBUTE_TOUCH_EVENTS,d)&&(d=AdfComponentTouchEvent.__getFirstTouch(a)))b=d.target;b||(b=AdfSafariMobileAgent.superclass.getEventTarget.call(this,a));return null!=b?AdfDomUtils.getElement(b):null};
AdfSafariMobileAgent.prototype.isDragPrepEvent=function(a){return a.getType()==AdfComponentTouchEvent.TOUCH_START_EVENT_TYPE&&1==a.getTouchCount()};AdfSafariMobileAgent.prototype.createContextMenuEventGenerator=function(){return new AdfSafariTouchContextMenuManager};AdfSafariMobileAgent.prototype.createDraggableNode=function(a){var b=a.ownerDocument.createElement("DIV");AdfDomUtils.addCSSClassName(b,AdfAgent.DRAG_GHOST_STYLECLASS);this.CopyDragSize(a,b);return b};
AdfSafariMobileAgent.prototype.isLeftButton=function(a){return AdfSafariMobileAgent.superclass.isLeftButton.call(this,a)||null!=AdfSafariMobileAgent._NATIVE_TO_COMPONENT_MAPPINGS[a.type]};
AdfSafariMobileAgent.prototype.showTooltip=function(a){var b=a.getType();if(b==AdfComponentTouchEvent.TOUCH_START_EVENT_TYPE&&!a.isCanceled()&&1==a.getTouchCount())AdfSafariMobileAgent._hideTooltip();else if(b==AdfComponentEvent.CONTEXT_MENU_EVENT_TYPE){var b=AdfPage.PAGE,d=AdfSafariMobileAgent._TOOLTIP_PROPERTY_KEY,e=b.getPageProperty(d);e||(e={},e.popup=new AdfDhtmlTooltip,b.setPageProperty(d,e));e.timer=b.scheduleTimer(b,AdfSafariMobileAgent._showTooltip,a,1)}};
AdfSafariMobileAgent.prototype.isDefaultPrevented=function(a){return!this._isWithinTouchEventsSequence||AdfSafariMobileAgent.superclass.isDefaultPrevented.call(this,a)};AdfSafariMobileAgent.prototype.disableSelectionToggleOnEditableCell=function(){return!0};AdfSafariMobileAgent.prototype.addBubbleEventListener=function(a,b,d){a===AdfPage.PAGE.getDomDocument()&&this._saveEventListener(b,d,!1);AdfSafariMobileAgent.superclass.addBubbleEventListener.call(this,a,b,d)};
AdfSafariMobileAgent.prototype.addEventCaptures=function(a,b){if(a===AdfPage.PAGE.getDomDocument())for(var d=0;d<AdfAgent._REDISTRIBUTE_TOUCH_EVENTS.length;d++)this._saveEventListener(AdfAgent._REDISTRIBUTE_TOUCH_EVENTS[d],b,!0);AdfSafariMobileAgent.superclass.addEventCaptures.call(this,a,b)};
AdfSafariMobileAgent.prototype.addEventBubbles=function(a,b){if(a===AdfPage.PAGE.getDomDocument())for(var d=0;d<AdfAgent._REDISTRIBUTE_TOUCH_EVENTS.length;d++)this._saveEventListener(AdfAgent._REDISTRIBUTE_TOUCH_EVENTS[d],b,!1);AdfSafariMobileAgent.superclass.addEventBubbles.call(this,a,b)};AdfSafariMobileAgent.prototype.cloneEvent=function(a,b){var d=AdfSafariAgent.superclass.cloneEvent.call(this,a,b);d._afrClonedEvent=!0;return d};AdfSafariMobileAgent.prototype.isTouchFirstDevice=function(){return!0};
AdfSafariMobileAgent.prototype._getTouchEventListeners=function(){return this._touchEventListeners};
AdfSafariMobileAgent.prototype._saveEventListener=function(a,b,d){this._touchEventListeners||(this._touchEventListeners=[]);for(var e=0;e<this._touchEventListeners.length;e++)if(this._touchEventListeners[e].eventType===a&&this._touchEventListeners[e].listener===b&&this._touchEventListeners[e].capture===d)return;("touchstart"==a||"touchmove"==a||"touchend"==a||"touchcancel"==a)&&this._touchEventListeners.push({eventType:a,listener:b,capture:d})};
AdfSafariMobileAgent._showTooltip=function(a){var b=AdfPage.PAGE,d=b.getPageProperty(AdfSafariMobileAgent._TOOLTIP_PROPERTY_KEY);if(d){var e=d.popup,f=a.getNativeEventTarget();if(a=AdfSafariMobileAgent._getTitle(f)){var g=b.getPositionManager(),h=AdfRichPopup.ALIGN_AFTER_START,k=e.getHeight(),l=e.getWidth(),f=g.calculatePlacementPosition(k,l,h,f,null);0<f.y&&0<f.x?(AdfAgent.AGENT.setTextContent(e.getElement(),a),e.show(f.y,f.x),d.timer=b.scheduleTimer(b,AdfSafariMobileAgent._hideTooltip,null,AdfSafariMobileAgent._TOOLTIP_HIDE_TIMEOUT)):
(d.timer=null,AdfAgent.AGENT.setTextContent(e.getElement(),""))}else d.timer=null,AdfAgent.AGENT.setTextContent(e.getElement(),"")}};AdfSafariMobileAgent._hideTooltip=function(){var a=AdfPage.PAGE,b=a.getPageProperty(AdfSafariMobileAgent._TOOLTIP_PROPERTY_KEY);if(b){var d=b.timer;b.timer=null;d&&a.cancelTimer(d);b.popup.hide()}};AdfSafariMobileAgent._getTitle=function(a){for(var b=0;null!=a&&20>b++;){if(1==a.nodeType){var d=a.getAttribute("title");if(d&&0<d.length)return d}a=a.parentNode}return null};
AdfSafariMobileAgent._TOOLTIP_HIDE_TIMEOUT=3E3;AdfSafariMobileAgent._TOOLTIP_PROPERTY_KEY="oracle$adfinternal$tooltip";