(()=>{var e={};!function(t){if("undefined"!=typeof window){var n=!0,o="",i=0,r="",a=null,u="",c=!1,s={resize:1,click:1},d=128,l=!0,f=1,m="bodyOffset",h=m,g=!0,p="",v={},y=32,w=null,b=!1,T=!1,E="[iFrameSizer]",O=E.length,S="",M={max:1,min:1,bodyScroll:1,documentElementScroll:1},I="child",N=window.parent,A="*",C=0,z=!1,k=null,R=16,x=1,L="scroll",F=L,P=window,D=function(){re("onMessage function not defined")},j=function(){},q=function(){},H={height:function(){return re("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return re("Custom width calculation function not defined"),document.body.scrollWidth}},W={},B=!1;try{var J=Object.create({},{passive:{get:function(){B=!0}}});window.addEventListener("test",ee,J),window.removeEventListener("test",ee,J)}catch(e){}var U,V,X,Y,K,Q,G,Z={bodyOffset:function(){return document.body.offsetHeight+pe("marginTop")+pe("marginBottom")},offset:function(){return Z.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return H.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,ye(Z))},min:function(){return Math.min.apply(null,ye(Z))},grow:function(){return Z.max()},lowestElement:function(){return Math.max(Z.bodyOffset()||Z.documentElementOffset(),ve("bottom",be()))},taggedElement:function(){return we("bottom","data-iframe-height")}},$={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return H.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max($.bodyScroll(),$.documentElementScroll())},max:function(){return Math.max.apply(null,ye($))},min:function(){return Math.min.apply(null,ye($))},rightMostElement:function(){return ve("right",be())},taggedElement:function(){return we("right","data-iframe-width")}},_=(U=Te,K=null,Q=0,G=function(){Q=Date.now(),K=null,Y=U.apply(V,X),K||(V=X=null)},function(){var e=Date.now();Q||(Q=e);var t=R-(e-Q);return V=this,X=arguments,t<=0||t>R?(K&&(clearTimeout(K),K=null),Q=e,Y=U.apply(V,X),K||(V=X=null)):K||(K=setTimeout(G,t)),Y});te(window,"message",(function(t){var n={init:function(){p=t.data,N=t.source,ae(),l=!1,setTimeout((function(){g=!1}),d)},reset:function(){g?ie("Page reset ignored by init"):(ie("Page size reset by host page"),Se("resetPage"))},resize:function(){Ee("resizeParent","Parent window requested size check")},moveToAnchor:function(){v.findTarget(i())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var e=i();ie("PageInfoFromParent called from parent: "+e),q(JSON.parse(e)),ie(" --")},message:function(){var e=i();ie("onMessage called from parent: "+e),D(JSON.parse(e)),ie(" --")}};function o(){return t.data.split("]")[1].split(":")[0]}function i(){return t.data.substr(t.data.indexOf(":")+1)}function r(){return t.data.split(":")[2]in{true:1,false:1}}function a(){var i=o();i in n?n[i]():!e&&"iFrameResize"in window||"jQuery"in window&&"iFrameResize"in window.jQuery.prototype||r()||re("Unexpected message ("+t.data+")")}E===(""+t.data).substr(0,O)&&(!1===l?a():r()?n.init():ie('Ignored message of type "'+o()+'". Received before initialization.'))})),te(window,"readystatechange",Ne),Ne()}function ee(){}function te(e,t,n,o){e.addEventListener(t,n,!!B&&(o||{}))}function ne(e){return e.charAt(0).toUpperCase()+e.slice(1)}function oe(e){return E+"["+S+"] "+e}function ie(e){b&&"object"==typeof window.console&&console.log(oe(e))}function re(e){"object"==typeof window.console&&console.warn(oe(e))}function ae(){var e;!function(){function e(e){return"true"===e}var a=p.substr(O).split(":");S=a[0],i=t!==a[1]?Number(a[1]):i,c=t!==a[2]?e(a[2]):c,b=t!==a[3]?e(a[3]):b,y=t!==a[4]?Number(a[4]):y,n=t!==a[6]?e(a[6]):n,r=a[7],h=t!==a[8]?a[8]:h,o=a[9],u=a[10],C=t!==a[11]?Number(a[11]):C,v.enable=t!==a[12]&&e(a[12]),I=t!==a[13]?a[13]:I,F=t!==a[14]?a[14]:F,T=t!==a[15]?Boolean(a[15]):T}(),ie("Initialising iFrame ("+window.location.href+")"),function(){function e(){var e=window.iFrameResizer;ie("Reading data from page: "+JSON.stringify(e)),Object.keys(e).forEach(ue,e),D="onMessage"in e?e.onMessage:D,j="onReady"in e?e.onReady:j,A="targetOrigin"in e?e.targetOrigin:A,h="heightCalculationMethod"in e?e.heightCalculationMethod:h,F="widthCalculationMethod"in e?e.widthCalculationMethod:F}function t(e,t){return"function"==typeof e&&(ie("Setup custom "+t+"CalcMethod"),H[t]=e,e="custom"),e}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),h=t(h,"height"),F=t(F,"width"));ie("TargetOrigin for parent set to: "+A)}(),function(){t===r&&(r=i+"px");ce("margin",function(e,t){-1!==t.indexOf("-")&&(re("Negative CSS value ignored for "+e),t="");return t}("margin",r))}(),ce("background",o),ce("padding",u),(e=document.createElement("div")).style.clear="both",e.style.display="block",e.style.height="0",document.body.appendChild(e),fe(),me(),document.documentElement.style.height="",document.body.style.height="",ie('HTML & body height set to "auto"'),ie("Enable public methods"),P.parentIFrame={autoResize:function(e){return!0===e&&!1===n?(n=!0,he()):!1===e&&!0===n&&(n=!1,de("remove"),null!==a&&a.disconnect(),clearInterval(w)),Ie(0,0,"autoResize",JSON.stringify(n)),n},close:function(){Ie(0,0,"close")},getId:function(){return S},getPageInfo:function(e){"function"==typeof e?(q=e,Ie(0,0,"pageInfo")):(q=function(){},Ie(0,0,"pageInfoStop"))},moveToAnchor:function(e){v.findTarget(e)},reset:function(){Me("parentIFrame.reset")},scrollTo:function(e,t){Ie(t,e,"scrollTo")},scrollToOffset:function(e,t){Ie(t,e,"scrollToOffset")},sendMessage:function(e,t){Ie(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod:function(e){h=e,fe()},setWidthCalculationMethod:function(e){F=e,me()},setTargetOrigin:function(e){ie("Set targetOrigin: "+e),A=e},size:function(e,t){Ee("size","parentIFrame.size("+(e||"")+(t?","+t:"")+")",e,t)}},function(){if(!0!==T)return;function e(e){Ie(0,0,e.type,e.screenY+":"+e.screenX)}function t(t,n){ie("Add event listener: "+n),te(window.document,t,e)}t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave")}(),he(),v=function(){function e(){return{x:window.pageXOffset!==t?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==t?window.pageYOffset:document.documentElement.scrollTop}}function n(t){var n=t.getBoundingClientRect(),o=e();return{x:parseInt(n.left,10)+parseInt(o.x,10),y:parseInt(n.top,10)+parseInt(o.y,10)}}function o(e){function o(e){var t=n(e);ie("Moving to in page link (#"+i+") at x: "+t.x+" y: "+t.y),Ie(t.y,t.x,"scrollToOffset")}var i=e.split("#")[1]||e,r=decodeURIComponent(i),a=document.getElementById(r)||document.getElementsByName(r)[0];t!==a?o(a):(ie("In page link (#"+i+") not found in iFrame, so sending to parent"),Ie(0,0,"inPageLink","#"+i))}function i(){var e=window.location.hash,t=window.location.href;""!==e&&"#"!==e&&o(t)}function r(){function e(e){function t(e){e.preventDefault(),o(this.getAttribute("href"))}"#"!==e.getAttribute("href")&&te(e,"click",t)}Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),e)}function a(){te(window,"hashchange",i)}function u(){setTimeout(i,d)}function c(){Array.prototype.forEach&&document.querySelectorAll?(ie("Setting up location.hash handlers"),r(),a(),u()):re("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}v.enable?c():ie("In page linking not enabled");return{findTarget:o}}(),Ee("init","Init message from host page"),j()}function ue(e){var t=e.split("Callback");if(2===t.length){var n="on"+t[0].charAt(0).toUpperCase()+t[0].slice(1);this[n]=this[e],delete this[e],re("Deprecated: '"+e+"' has been renamed '"+n+"'. The old method will be removed in the next major version.")}}function ce(e,n){t!==n&&""!==n&&"null"!==n&&(document.body.style[e]=n,ie("Body "+e+' set to "'+n+'"'))}function se(e){var t={add:function(t){function n(){Ee(e.eventName,e.eventType)}W[t]=n,te(window,t,n,{passive:!0})},remove:function(e){var t,n,o,i=W[e];delete W[e],t=window,n=e,o=i,t.removeEventListener(n,o,!1)}};e.eventNames&&Array.prototype.map?(e.eventName=e.eventNames[0],e.eventNames.map(t[e.method])):t[e.method](e.eventName),ie(ne(e.method)+" event listener: "+e.eventType)}function de(e){se({method:e,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),se({method:e,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),se({method:e,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),se({method:e,eventType:"Input",eventName:"input"}),se({method:e,eventType:"Mouse Up",eventName:"mouseup"}),se({method:e,eventType:"Mouse Down",eventName:"mousedown"}),se({method:e,eventType:"Orientation Change",eventName:"orientationchange"}),se({method:e,eventType:"Print",eventName:["afterprint","beforeprint"]}),se({method:e,eventType:"Ready State Change",eventName:"readystatechange"}),se({method:e,eventType:"Touch Start",eventName:"touchstart"}),se({method:e,eventType:"Touch End",eventName:"touchend"}),se({method:e,eventType:"Touch Cancel",eventName:"touchcancel"}),se({method:e,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),se({method:e,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),se({method:e,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),"child"===I&&se({method:e,eventType:"IFrame Resized",eventName:"resize"})}function le(e,t,n,o){return t!==e&&(e in n||(re(e+" is not a valid option for "+o+"CalculationMethod."),e=t),ie(o+' calculation method set to "'+e+'"')),e}function fe(){h=le(h,m,Z,"height")}function me(){F=le(F,L,$,"width")}function he(){var e;!0===n?(de("add"),e=0>y,window.MutationObserver||window.WebKitMutationObserver?e?ge():a=function(){function e(e){function t(e){!1===e.complete&&(ie("Attach listeners to "+e.src),e.addEventListener("load",i,!1),e.addEventListener("error",r,!1),c.push(e))}"attributes"===e.type&&"src"===e.attributeName?t(e.target):"childList"===e.type&&Array.prototype.forEach.call(e.target.querySelectorAll("img"),t)}function t(e){c.splice(c.indexOf(e),1)}function n(e){ie("Remove listeners from "+e.src),e.removeEventListener("load",i,!1),e.removeEventListener("error",r,!1),t(e)}function o(e,t,o){n(e.target),Ee(t,o+": "+e.target.src)}function i(e){o(e,"imageLoad","Image loaded")}function r(e){o(e,"imageLoadFailed","Image load failed")}function a(t){Ee("mutationObserver","mutationObserver: "+t[0].target+" "+t[0].type),t.forEach(e)}function u(){var e=document.querySelector("body"),t={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0};return d=new s(a),ie("Create body MutationObserver"),d.observe(e,t),d}var c=[],s=window.MutationObserver||window.WebKitMutationObserver,d=u();return{disconnect:function(){"disconnect"in d&&(ie("Disconnect body MutationObserver"),d.disconnect(),c.forEach(n))}}}():(ie("MutationObserver not supported in this browser!"),ge())):ie("Auto Resize disabled")}function ge(){0!==y&&(ie("setInterval: "+y+"ms"),w=setInterval((function(){Ee("interval","setInterval: "+y)}),Math.abs(y)))}function pe(e,t){var n=0;return t=t||document.body,n=null!==(n=document.defaultView.getComputedStyle(t,null))?n[e]:0,parseInt(n,10)}function ve(e,t){for(var n=t.length,o=0,i=0,r=ne(e),a=Date.now(),u=0;ui&&(i=o);return a=Date.now()-a,ie("Parsed "+n+" HTML elements"),ie("Element position calculated in "+a+"ms"),function(e){e>R/2&&ie("Event throttle increased to "+(R=2*e)+"ms")}(a),i}function ye(e){return[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll()]}function we(e,t){var n=document.querySelectorAll("["+t+"]");return 0===n.length&&(re("No tagged elements ("+t+") found on page"),document.querySelectorAll("body *")),ve(e,n)}function be(){return document.querySelectorAll("body *")}function Te(e,n,o,i){var r,a;!function(){function e(e,t){return!(Math.abs(e-t)<=C)}return r=t!==o?o:Z[h](),a=t!==i?i:$[F](),e(f,r)||c&&e(x,a)}()&&"init"!==e?!(e in{init:1,interval:1,size:1})&&(h in M||c&&F in M)?Me(n):e in{interval:1}||ie("No change in size detected"):(Oe(),Ie(f=r,x=a,e))}function Ee(e,t,n,o){z&&e in s?ie("Trigger event cancelled: "+e):(e in{reset:1,resetPage:1,init:1}||ie("Trigger event: "+t),"init"===e?Te(e,t,n,o):_(e,t,n,o))}function Oe(){z||(z=!0,ie("Trigger event lock on")),clearTimeout(k),k=setTimeout((function(){z=!1,ie("Trigger event lock off"),ie("--")}),d)}function Se(e){f=Z[h](),x=$[F](),Ie(f,x,e)}function Me(e){var t=h;h=m,ie("Reset trigger event: "+e),Oe(),Se("reset"),h=t}function Ie(e,n,o,i,r){var a;t===r?r=A:ie("Message targetOrigin: "+r),ie("Sending message to host page ("+(a=S+":"+e+":"+n+":"+o+(t!==i?":"+i:""))+")"),N.postMessage(E+a,r)}function Ne(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}}()})(); //# sourceMappingURL=embed.js.map