!function(n){function bi(){}function k(n,t,i,r){n.addEventListener(t,i,!!wi&&(r||{}))}function ki(n){return n.charAt(0).toUpperCase()+n.slice(1)}function di(n){return tt+"["+it+"] "+n}function t(n){at&&"object"==typeof console&&console.log(di(n))}function h(n){"object"==typeof console&&console.warn(di(n))}function br(){!function(){function i(n){return"true"===n}var t=hi.substr(li).split(":");it=t[0];st=n!==t[1]?Number(t[1]):st;g=n!==t[2]?i(t[2]):g;at=n!==t[3]?i(t[3]):at;c=n!==t[4]?Number(t[4]):c;e=n!==t[6]?i(t[6]):e;d=t[7];r=n!==t[8]?t[8]:r;fi=t[9];ei=t[10];yt=n!==t[11]?Number(t[11]):yt;v.enable=n!==t[12]&&i(t[12]);vt=n!==t[13]?t[13]:vt;u=n!==t[14]?t[14]:u}();t("Initialising iFrame ("+location.href+")"),function(){function n(n,i){return"function"==typeof n&&(t("Setup custom "+i+"CalcMethod"),kt[i]=n,n="custom"),n}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(function(){var n=window.iFrameResizer;t("Reading data from page: "+JSON.stringify(n));Object.keys(n).forEach(kr,n);pt="onMessage"in n?n.onMessage:pt;wt="onReady"in n?n.onReady:wt;y="targetOrigin"in n?n.targetOrigin:y;r="heightCalculationMethod"in n?n.heightCalculationMethod:r;u="widthCalculationMethod"in n?n.widthCalculationMethod:u}(),r=n(r,"height"),u=n(u,"width"));t("TargetOrigin for parent set to: "+y)}(),function(){n===d&&(d=st+"px");ii("margin",function(n,t){return-1!==t.indexOf("-")&&(h("Negative CSS value ignored for "+n),t=""),t}("margin",d))}();ii("background",fi);ii("padding",ei),function(){var n=document.createElement("div");n.style.clear="both";n.style.display="block";n.style.height="0";document.body.appendChild(n)}();tr();ir();document.documentElement.style.height="";document.body.style.height="";t('HTML & body height set to "auto"');t("Enable public methods");pr.parentIFrame={autoResize:function(n){return!0===n&&!1===e?(e=!0,rr()):!1===n&&!0===e&&(e=!1,gi("remove"),null!==ht&&ht.disconnect(),clearInterval(ci)),f(0,0,"autoResize",JSON.stringify(e)),e},close:function(){f(0,0,"close")},getId:function(){return it},getPageInfo:function(n){"function"==typeof n?(bt=n,f(0,0,"pageInfo")):(bt=function(){},f(0,0,"pageInfoStop"))},moveToAnchor:function(n){v.findTarget(n)},reset:function(){cr("parentIFrame.reset")},scrollTo:function(n,t){f(t,n,"scrollTo")},scrollToOffset:function(n,t){f(t,n,"scrollToOffset")},sendMessage:function(n,t){f(0,0,"message",JSON.stringify(n),t)},setHeightCalculationMethod:function(n){r=n;tr()},setWidthCalculationMethod:function(n){u=n;ir()},setTargetOrigin:function(n){t("Set targetOrigin: "+n);y=n},size:function(n,t){a("size","parentIFrame.size("+((n||"")+(t?","+t:""))+")",n,t)}};rr();v=function(){function u(t){var i=t.getBoundingClientRect(),r={x:window.pageXOffset!==n?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==n?window.pageYOffset:document.documentElement.scrollTop};return{x:parseInt(i.left,10)+parseInt(r.x,10),y:parseInt(i.top,10)+parseInt(r.y,10)}}function i(i){var r,e=i.split("#")[1]||i,o=decodeURIComponent(e),s=document.getElementById(o)||document.getElementsByName(o)[0];n!==s?(r=u(s),t("Moving to in page link (#"+e+") at x: "+r.x+" y: "+r.y),f(r.y,r.x,"scrollToOffset")):(t("In page link (#"+e+") not found in iFrame, so sending to parent"),f(0,0,"inPageLink","#"+e))}function r(){""!==location.hash&&"#"!==location.hash&&i(location.href)}function e(){Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),function(n){"#"!==n.getAttribute("href")&&k(n,"click",function(n){n.preventDefault();i(this.getAttribute("href"))})})}return v.enable?Array.prototype.forEach&&document.querySelectorAll?(t("Setting up location.hash handlers"),e(),k(window,"hashchange",r),setTimeout(r,ct)):h("In page linking not fully supported in this browser! (See README.md for IE8 workaround)"):t("In page linking not enabled"),{findTarget:i}}();a("init","Init message from host page");wt()}function kr(n){var t=n.split("Callback"),i;2===t.length&&(i="on"+t[0].charAt(0).toUpperCase()+t[0].slice(1),this[i]=this[n],delete this[n],h("Deprecated: '"+n+"' has been renamed '"+i+"'. The old method will be removed in the next major version."))}function ii(i,r){n!==r&&""!==r&&"null"!==r&&t("Body "+i+' set to "'+(document.body.style[i]=r)+'"')}function i(n){var i={add:function(t){function i(){a(n.eventName,n.eventType)}dt[t]=i;k(window,t,i,{passive:!0})},remove:function(n){var t=dt[n];delete dt[n],function(n,t,i){n.removeEventListener(t,i,!1)}(window,n,t)}};n.eventNames&&Array.prototype.map?(n.eventName=n.eventNames[0],n.eventNames.map(i[n.method])):i[n.method](n.eventName);t(ki(n.method)+" event listener: "+n.eventType)}function gi(n){i({method:n,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]});i({method:n,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]});i({method:n,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]});i({method:n,eventType:"Input",eventName:"input"});i({method:n,eventType:"Mouse Up",eventName:"mouseup"});i({method:n,eventType:"Mouse Down",eventName:"mousedown"});i({method:n,eventType:"Orientation Change",eventName:"orientationchange"});i({method:n,eventType:"Print",eventName:["afterprint","beforeprint"]});i({method:n,eventType:"Ready State Change",eventName:"readystatechange"});i({method:n,eventType:"Touch Start",eventName:"touchstart"});i({method:n,eventType:"Touch End",eventName:"touchend"});i({method:n,eventType:"Touch Cancel",eventName:"touchcancel"});i({method:n,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]});i({method:n,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]});i({method:n,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]});"child"===vt&&i({method:n,eventType:"IFrame Resized",eventName:"resize"})}function nr(n,i,r,u){return i!==n&&(n in r||(h(n+" is not a valid option for "+u+"CalculationMethod."),n=i),t(u+' calculation method set to "'+n+'"')),n}function tr(){r=nr(r,lt,s,"height")}function ir(){u=nr(u,pi,l,"width")}function rr(){!0===e?(gi("add"),function(){var i=c<0;window.MutationObserver||window.WebKitMutationObserver?i?ur():ht=function(){function s(n){function i(n){!1===n.complete&&(t("Attach listeners to "+n.src),n.addEventListener("load",e,!1),n.addEventListener("error",o,!1),r.push(n))}"attributes"===n.type&&"src"===n.attributeName?i(n.target):"childList"===n.type&&Array.prototype.forEach.call(n.target.querySelectorAll("img"),i)}function u(n){t("Remove listeners from "+n.src);n.removeEventListener("load",e,!1);n.removeEventListener("error",o,!1),function(n){r.splice(r.indexOf(n),1)}(n)}function f(t,i,r){u(t.target);a(i,r+": "+t.target.src,n,n)}function e(n){f(n,"imageLoad","Image loaded")}function o(n){f(n,"imageLoadFailed","Image load failed")}function h(n){a("mutationObserver","mutationObserver: "+n[0].target+" "+n[0].type);n.forEach(s)}var r=[],c=window.MutationObserver||window.WebKitMutationObserver,i=function(){var n=document.querySelector("body");return i=new c(h),t("Create body MutationObserver"),i.observe(n,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),i}();return{disconnect:function(){"disconnect"in i&&(t("Disconnect body MutationObserver"),i.disconnect(),r.forEach(u))}}}():(t("MutationObserver not supported in this browser!"),ur())}()):t("Auto Resize disabled")}function ur(){0!==c&&(t("setInterval: "+c+"ms"),ci=setInterval(function(){a("interval","setInterval: "+c)},Math.abs(c)))}function ri(n,t){var i=0;return t=t||document.body,i=null!==(i=document.defaultView.getComputedStyle(t,null))?i[n]:0,parseInt(i,ar)}function ui(n,i){for(var e=i.length,o=0,f=0,s=ki(n),r=et(),u=0;u<e;u++)f<(o=i[u].getBoundingClientRect()[n]+ri("margin"+s,i[u]))&&(f=o);return r=et()-r,t("Parsed "+e+" HTML elements"),t("Element position calculated in "+r+"ms"),function(n){ut/2<n&&t("Event throttle increased to "+(ut=2*n)+"ms")}(r),f}function ot(n){return[n.bodyOffset(),n.bodyScroll(),n.documentElementOffset(),n.documentElementScroll()]}function fr(n,t){var i=document.querySelectorAll("["+t+"]");return 0===i.length&&(h("No tagged elements ("+t+") found on page"),document.querySelectorAll("body *")),ui(n,i)}function er(){return document.querySelectorAll("body *")}function or(i,e,o,h){function v(n,t){return!(Math.abs(n-t)<=yt)}var c,a;c=n!==o?o:s[r]();a=n!==h?h:l[u]();v(nt,c)||g&&v(ft,a)||"init"===i?(sr(),f(nt=c,ft=a,i)):i in{init:1,interval:1,size:1}||!(r in ai||g&&u in ai)?i in{interval:1}||t("No change in size detected"):cr(e)}function dr(){b=et();o=null;ti=ni.apply(p,w);o||(p=w=null)}function a(n,i,r,u){rt&&n in vr?t("Trigger event cancelled: "+n):(n in{reset:1,resetPage:1,init:1}||t("Trigger event: "+i),"init"===n?or(n,i,r,u):wr(n,i,r,u))}function sr(){rt||(rt=!0,t("Trigger event lock on"));clearTimeout(yi);yi=setTimeout(function(){rt=!1;t("Trigger event lock off");t("--")},ct)}function hr(n){nt=s[r]();ft=l[u]();f(nt,ft,n)}function cr(n){var i=r;r=lt;t("Reset trigger event: "+n);sr();hr("reset");r=i}function f(i,r,u,f,e){var o;!0===yr&&(n===e?e=y:t("Message targetOrigin: "+e),t("Sending message to host page ("+(o=it+":"+(i+":"+r)+":"+u+(n!==f?":"+f:""))+")"),vi.postMessage(tt+o,e))}function lr(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}var gt;if("undefined"!=typeof window){var e=!0,ar=10,fi="",st=0,d="",ht=null,ei="",g=!1,vr={resize:1,click:1},ct=128,oi=!0,nt=1,lt="bodyOffset",r=lt,si=!0,hi="",v={},c=32,ci=null,at=!1,tt="[iFrameSizer]",li=tt.length,it="",ai={max:1,min:1,bodyScroll:1,documentElementScroll:1},vt="child",yr=!0,vi=window.parent,y="*",yt=0,rt=!1,yi=null,ut=16,ft=1,pi="scroll",u=pi,pr=window,pt=function(){h("onMessage function not defined")},wt=function(){},bt=function(){},kt={height:function(){return h("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return h("Custom width calculation function not defined"),document.body.scrollWidth}},dt={},wi=!1;try{gt=Object.create({},{passive:{get:function(){wi=!0}}});window.addEventListener("test",bi,gt);window.removeEventListener("test",bi,gt)}catch(yi){}var ni,p,w,ti,o,b,et=Date.now||function(){return(new Date).getTime()},s={bodyOffset:function(){return document.body.offsetHeight+ri("marginTop")+ri("marginBottom")},offset:function(){return s.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return kt.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,ot(s))},min:function(){return Math.min.apply(null,ot(s))},grow:function(){return s.max()},lowestElement:function(){return Math.max(s.bodyOffset()||s.documentElementOffset(),ui("bottom",er()))},taggedElement:function(){return fr("bottom","data-iframe-height")}},l={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return kt.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(l.bodyScroll(),l.documentElementScroll())},max:function(){return Math.max.apply(null,ot(l))},min:function(){return Math.min.apply(null,ot(l))},rightMostElement:function(){return ui("right",er())},taggedElement:function(){return fr("right","data-iframe-width")}},wr=(ni=or,o=null,b=0,function(){var n=et(),t=ut-(n-(b=b||n));return p=this,w=arguments,t<=0||ut<t?(o&&(clearTimeout(o),o=null),b=n,ti=ni.apply(p,w),o||(p=w=null)):o=o||setTimeout(dr,t),ti});k(window,"message",function(n){function u(){return n.data.split("]")[1].split(":")[0]}function r(){return n.data.substr(n.data.indexOf(":")+1)}function f(){return n.data.split(":")[2]in{"true":1,"false":1}}function e(){var t=u();t in i?i[t]():("undefined"==typeof module||!module.exports)&&"iFrameResize"in window||"jQuery"in window&&"iFrameResize"in window.jQuery.prototype||f()||h("Unexpected message ("+n.data+")")}var i={init:function(){hi=n.data;vi=n.source;br();oi=!1;setTimeout(function(){si=!1},ct)},reset:function(){si?t("Page reset ignored by init"):(t("Page size reset by host page"),hr("resetPage"))},resize:function(){a("resizeParent","Parent window requested size check")},moveToAnchor:function(){v.findTarget(r())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var n=r();t("PageInfoFromParent called from parent: "+n);bt(JSON.parse(n));t(" --")},message:function(){var n=r();t("onMessage called from parent: "+n);pt(JSON.parse(n));t(" --")}};tt===(""+n.data).substr(0,li)&&(!1===oi?e():f()?i.init():t('Ignored message of type "'+u()+'". Received before initialization.'))});k(window,"readystatechange",lr);lr()}}()