AdfRichUIPeer.createPeerClass(AdfRichUIPeer,"AdfDhtmlInlineFramePeer");AdfDhtmlInlineFramePeer.InitSubclass=function(){var a=[];a._fastPoll=!1;a._timerId=void 0;this._iframeIds=a;AdfRichUIPeer.addComponentPropertyChanges(this,AdfRichInlineFrame.SOURCE);this._LOAD_EVENT_TYPE="inlineFrameLoad"};
AdfDhtmlInlineFramePeer.prototype.InitDomElement=function(a,b){AdfDhtmlInlineFramePeer.superclass.InitDomElement.call(this,a,b);AdfPage.PAGE.registerLoadingComponent(a);var d=this.__getIframe(b),e=d.getAttribute("_src");if(null!=e){AdfPage.PAGE.__perfTimings(!1,!1,!0,"GET request sent for iFrame. Source is: ",e);var f=AdfAgent.AGENT,g=f.getPlatform()==AdfAgent.WEBKIT_PLATFORM;!g||g&&535.19<=f.getVersion()?(d.setAttribute("src",e),d.removeAttribute("_src"),d.addEventListener("load",function(a){AdfDhtmlInlineFramePeer.__iframeLoadHandler(a)},
!0)):AdfDhtmlInlineFramePeer._replaceIframe(d)}};
AdfDhtmlInlineFramePeer.prototype.GetReadyState=function(){var a=this.__getIframe();if(a){AdfLogger.LOGGER.fine("AdfDhtmlInlineFramePeer.GetReadyState: Frame dom is present");try{var b=a.contentWindow;if("complete"===b.document.readyState){AdfLogger.LOGGER.fine("AdfDhtmlInlineFramePeer.GetReadyState: ","Determine inner document is ADF or not");var d=b.AdfPage;if(d){var e=d.PAGE;if(e&&e.isSynchronizedWithServer&&e.isSynchronizedWithServer())return AdfLogger.LOGGER.fine("AdfDhtmlInlineFramePeer.GetReadyState: inner ADF page ready"),AdfUIComponent.STATE_COMPLETE;
AdfLogger.LOGGER.fine("AdfDhtmlInlineFramePeer.GetReadyState: inner ADF page not ready");return AdfUIComponent.STATE_LOADING}AdfLogger.LOGGER.fine("AdfDhtmlInlineFramePeer.GetReadyState: Non ADF page ready");return AdfUIComponent.STATE_COMPLETE}AdfLogger.LOGGER.fine("AdfDhtmlInlineFramePeer.GetReadyState: inner document not yet ready");return AdfUIComponent.STATE_LOADING}catch(f){return AdfLogger.LOGGER.fine("AdfDhtmlInlineFramePeer.GetReadyState: Security exception."," Document from different domain, nothing more to do"),
AdfUIComponent.STATE_COMPLETE}}AdfLogger.LOGGER.fine("AdfDhtmlInlineFramePeer.GetReadyState: inlineFrame's dom is not ready");return AdfUIComponent.STATE_LOADING};
AdfDhtmlInlineFramePeer._replaceIframe=function(a){var b=AdfAgent.AGENT,d=a.getAttribute("_src"),e=AdfDomUtils.isVisible(a);AdfDomUtils.setVisible(a,!1);a.removeAttribute("_src");a.removeAttribute("src");var f=b.cloneNode(a);a.onload="void(0);";b.elementsRemoved(a);f.addEventListener("load",function(a){AdfDhtmlInlineFramePeer.__iframeLoadHandler(a)},!0);a.parentNode.replaceChild(f,a);-1<d.indexOf("javascript:''")?f.setAttribute("src","about:blank"):f.setAttribute("src",d);b.elementsAdded(f);AdfDomUtils.setVisible(f,
e)};AdfDhtmlInlineFramePeer.prototype.ComponentSourceChanged=function(a,b,d,e){e=b;"IFRAME"!=e.tagName&&(e=AdfDomUtils.getFirstChildElement(b));if(!e||"IFRAME"!=e.tagName)return!1;if(AdfPage.PAGE.isAnimationEnabled()&&d&&AdfDomUtils.isInPopup(a)&&(a=AdfDomUtils.getPopupAncestor(a))&&a.getProperty(AdfDhtmlPopupHints.ANIMATE)!==AdfRichPopup.ANIMATE_FALSE)return e.setAttribute("data-src",d),!0;e.src=d;return!0};
AdfDhtmlInlineFramePeer.prototype.BindToComponent=function(a,b){AdfDhtmlInlineFramePeer.superclass.BindToComponent.call(this,a,b);var d=b;"IFRAME"!=d.tagName&&(d=AdfDomUtils.getFirstChildElement(b));"preferred"===a.getSizing()&&"1"===d.getAttribute("_adfLoaded")&&AdfDhtmlInlineFramePeer._registerIFrameForSizing(d)};
AdfDhtmlInlineFramePeer.prototype.ComponentRemoved=function(a){var b=a.getSizing(),d=AdfPage.PAGE;d.unregisterLoadingComponent(a);"preferred"===b&&(b=AdfDhtmlInlineFramePeer._iframeIds,AdfCollections.removeArrayValue(b,a.getClientId()),0==b.length&&(d.getDomWindow().clearInterval(b._timerId),b._timerId=void 0));AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM&&(this.bind(a),d=this.__getIframe(),AdfDomUtils.setVisible(d,!1),d.setAttribute("onload","void(0)"),d.setAttribute("src","about:blank"));
AdfDhtmlInlineFramePeer.superclass.ComponentRemoved.call(this,a)};AdfDhtmlInlineFramePeer.prototype.ScrollIntoView=function(a,b,d){a=this.getDomElement();"IFRAME"!=a.tagName&&(a=AdfDomUtils.getFirstChildElement(a));a.scrollIntoView();var e=a.contentWindow.document,f=null;null!=d&&(f=e.getElementById(d))&&f.scrollIntoView();b&&(f?AdfFocusUtils.focusElement(f):AdfFocusUtils.focusElement(a))};
AdfDhtmlInlineFramePeer._loadHandler=function(a){AdfPage.PAGE.__perfTimings(!1,!1,!1,"iFrame load handler called.");var b=AdfAgent.AGENT,d=AdfPage.PAGE;b.getPlatform()==AdfAgent.IE_PLATFORM?(a||(a=d.getDomWindow().event),a=b.cloneEvent(a)):b.getPlatform()==AdfAgent.WEBKIT_PLATFORM&&(a=b.cloneEvent(a));b=b.getEventTarget(a);null==b&&(b=a.currentTarget);"1"===b.getAttribute("_adfLoaded")&&AdfPage.PAGE.__perfTimings(!1,!1,!0,"GET response received for iFrame. Source is: ",b.getAttribute("src"));var e=
b.getAttribute("id"),f=e.indexOf("::f");-1!=f&&f==e.length-3&&(e=b.parentNode.getAttribute("id"));AdfAssert.assertString(e,"clientId");(d=d.findComponent(e))?(AdfDhtmlInlineFramePeer._removeLoadingStatus(b,e),(new AdfDomComponentEvent(d,AdfDhtmlInlineFramePeer._LOAD_EVENT_TYPE,a)).queue(!0),"preferred"===d.getSizing()?AdfDhtmlInlineFramePeer._isIframeSizingAllowed(b)?"1"===b.getAttribute("_adfLoaded")?(b.style.minWidth="0px",b.style.minHeight="0px",AdfPage.PAGE.__perfTimings(!1,!1,!1,"Immediately resizing iFrame."),
AdfDhtmlInlineFramePeer._resizeIframeToPreferred(b),AdfPage.PAGE.__perfTimings(!0,!1,!0,"Response processig done for iFrame. Source is: ",b.getAttribute("src"))):(AdfPage.PAGE.__perfTimings(!1,!1,!1,"Registering iFrame for resizing."),AdfDhtmlInlineFramePeer._registerIFrameForSizing(b)):AdfPage.PAGE.__perfTimings(!0,!1,!0,"Response processig done for iFrame. Source is: ",b.getAttribute("src")):AdfPage.PAGE.__perfTimings(!0,!1,!0,"Response processig done for iFrame. Source is: ",b.getAttribute("src"))):
b.setAttribute("_adfLoaded","1")};AdfDhtmlInlineFramePeer.__iframeLoadHandler=function(a){a.target.contentWindow.postMessage("_adfShowBody","*");try{AdfDhtmlInlineFramePeer._loadHandler(a)}catch(b){AdfLogger.LOGGER.logErrorAsInfo(b,"inlineFrame load handler")}};
AdfDhtmlInlineFramePeer._removeLoadingStatus=function(a,b){null==a.getAttribute("_src")&&(AdfDomUtils.containsCSSClassName(a,"p_AFFlow")?(AdfDomUtils.removeCSSClassName(a,"p_AFBusy"),AdfLogger.LOGGER.fine("Removed busy from iframe: ",b)):(AdfDomUtils.removeCSSClassName(a.parentNode,"p_AFBusy"),AdfLogger.LOGGER.fine("Removed busy from iframe's parentNode: ",b)))};
AdfDhtmlInlineFramePeer._registerIFrameForSizing=function(a){AdfAssert.assertDomElement(a);if(AdfDhtmlInlineFramePeer._isIframeSizingAllowed(a)){var b=AdfDhtmlInlineFramePeer._iframeIds,d=a.id;-1<AdfCollections.indexOf(b,d)&&b.push(d);AdfDhtmlInlineFramePeer._resizeIframeToPreferred(a);AdfPage.PAGE.__perfTimings(!0,!1,!0,"Response processig done for iFrame. Source is: ",a.getAttribute("src"));1==b.length&&(b._timerId=AdfPage.PAGE.getDomWindow().setInterval(AdfDhtmlInlineFramePeer._minSizeResizeListener,
1E3))}};AdfDhtmlInlineFramePeer._isIframeSizingAllowed=function(a){try{return AdfAgent.AGENT.getWindowScrollWidth(a.contentWindow),!0}catch(b){return AdfLogger.LOGGER.logErrorAsWarning(b,"Error sizing iframe. This could occur if the iframe's sizing is set to preferred and the iframe's source is not from the same domain as the page. iframe id: "+a.id+", iframe source: "+a.src+", page location: "+window.location+"."),!1}};
AdfDhtmlInlineFramePeer._resizeIframeToPreferred=function(a){if(!AdfDhtmlInlineFramePeer._isIframeSizingAllowed(a))return!1;var b=!1,d=AdfPage.PAGE.getLookAndFeel();if(AdfDomUtils.containsCSSClassName(a,d.getStyleClass("AFStretchWidth"))||AdfDomUtils.containsCSSClassName(a,d.getStyleClass("AFAuxiliaryStretchWidth")))b=!0;var e=AdfAgent.AGENT,f=a.contentWindow,d=0;b||(d=e.getWindowScrollWidth(f)-e.getWindowClientWidth(f));f=e.getWindowScrollHeight(f)-e.getWindowClientHeight(f);b=!1;e=a.style;0<d&&
(e.minWidth=a.offsetWidth+d+"px",b=!0);var d=AdfDhtmlInlineFramePeer._iframeIds,g=a.id;0<f?(e.minHeight=a.offsetHeight+f+1+"px",b=!0,d[g]=a.clientWidth):(d=d[g],void 0!==d&&a.clientWidth>d&&(e.minHeight="0px",b=!0));return b};
AdfDhtmlInlineFramePeer._minSizeResizeListener=function(){var a=AdfDhtmlInlineFramePeer._iframeIds;if(0!=a.length){for(var b=!1,d=document,e=a.length,f=AdfDhtmlInlineFramePeer._resizeIframeToPreferred,g=0;g<e;g++)var h=d.getElementById(a[g]),b=b|f(h);b^a._fastPoll&&(d=AdfPage.PAGE.getDomWindow(),void 0!==a._timerId&&d.clearInterval(a._timerId),a._timerId=d.setInterval(AdfDhtmlInlineFramePeer._minSizeResizeListener,b?100:1E3),a._fastPoll=b)}};
AdfDhtmlInlineFramePeer.prototype.__getIframe=function(a){a=a?a:this.getDomElement();"IFRAME"!=a.tagName&&(a=AdfDomUtils.getFirstChildElement(a));AdfAssert.assertDomElement(a,"IFRAME");return a};