/*!
 *  @preserve
 *  
 *  @module      iframe-resizer/parent 5.5.6 (umd) - 2025-09-10
 *
 *  @license     GPL-3.0 for non-commercial use only.
 *               For commercial use, you must purchase a license from
 *               https://iframe-resizer.com/pricing
 * 
 *  @description Keep same and cross domain iFrames sized to their content 
 *
 *  @author      David J. Bradshaw <info@iframe-resizer.com>
 * 
 *  @see         {@link https://iframe-resizer.com}
 * 
 *  @copyright  (c) 2013 - 2025, David J. Bradshaw. All rights reserved.
 */


!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,function(){"use strict";const e="font-weight: normal;",t=e+"font-style: italic;",n="default",o=Object.freeze({assert:!0,error:!0,warn:!0}),i={expand:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},a=Object.assign(console);const{fromEntries:s,keys:l}=Object,c=e=>[e,a[e]],u=e=>t=>[t,function(n){e[t]=n}],d=(e,t)=>s(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",m=f?"color: #E3E3E3;":"color: #1F1F1F;",h="5.5.6",g="iframeResizer",y="autoResize",b="init",w="iframeReady",v="load",z="message",$="onload",j="pageInfo",T="parentInfo",k="reset",x="resize",M="scroll",E="none",R="vertical",S="horizontal",O="[iFrameSizer]",C=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),I=Object.freeze({[$]:1,[b]:1,[w]:1}),A="expanded",W="collapsed",L=Object.freeze({[A]:1,[W]:1}),N=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),F=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),B=e=>e,H={},P=(q=function(s={}){const l={},f={},p=[],m={...i,expand:!s.collapsed||i.expanded,...s};let h="";function g(){p.length=0,h=""}function y(){delete m.event,g()}const b=()=>!!p.some(([e])=>e in o)||!!m.expand;function w(){if(0!==p.length){a[b()?"group":"groupCollapsed"](`%c${m.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(m)} %c${m.showTime?h:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)a.assert(e in a,`Unknown console method: ${e}`),e in a&&a[e](...t);a.groupEnd(),y()}else y()}function v(){""===h&&(h=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function z(e,...t){0===p.length&&(v(),queueMicrotask(()=>queueMicrotask(w))),p.push([e,...t])}function $(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...d(m,u(m)),...d(console,e=>[e,(...t)=>z(e,...t)]),...d(r,c),assert:function(e,...t){!0!==e&&z("assert",e,...t)},count:function(e=n){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=n){delete f[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e),w()}return n},event:function(e){v(),m.event=e},purge:g,time:function(e=n){v(),l[e]=performance.now()},timeEnd:function(e=n){$(e),delete l[e]},timeLog:$,touch:v}},q?.__esModule?q.default:q);var q;let D=!0;const U=P({expand:!1,label:"parent"}),J=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const Z=e=>(t,...n)=>H[t]?H[t].console[e](...n):U[e](...n);var V;const X=(V="log",(e,...t)=>!0===(e=>H[e]?H[e].log:D)(e)?Z(V)(e,...t):null),Y=Z("warn"),G=Z("error"),_=Z("event"),K=Z("purge"),Q=Z("errorBoundary");const ee=(e,...t)=>H[e]?H[e].console.warn(N(B)(...t)):queueMicrotask(()=>console?.warn(N((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t))),te=(e=>(t,n="renamed to")=>(o,i,r="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(ee),ne=te("Function"),oe=te("Option"),ie=(e,t,n,o)=>e.addEventListener(t,n,o||!1),re=(e,t,n)=>e.removeEventListener(t,n,!1),ae=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,i=0;i<e.length;i++)o=e.codePointAt(i),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},se=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),le=["spjluzl","rlf","clyzpvu"],ce=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],ue=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],de=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),fe=e=>se(ce[e]),pe=e=>{const t=e[se(le[0])]||e[se(le[1])]||e[se(le[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=ae(se(e));return n in de&&(t=de[n]),t}(n[0]);return 0===o||(e=>e[2]===ae(e[0]+e[1]))(n)||(o=-2),o};function me(e,t){const{msgTimeout:n,warningTimeout:o}=t[e];o&&(n&&clearTimeout(n),t[e].msgTimeout=setTimeout(function(){if(void 0===t[e])return;const{initialised:n,loadErrorShown:o}=t[e];t[e].msgTimeout=void 0,n||o||(t[e].loadErrorShown=!0,function(e,t){const{iframe:n,waitForLoad:o}=t[e],{sandbox:i}=n,r="object"==typeof i&&i.length>0&&!(i.contains("allow-scripts")&&i.contains("allow-same-origin"));_(e,"noResponse"),ee(e,`<rb>No response from iframe</>\n          \nThe iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <b>'true'</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <b>'false'</>.  \n":""}${r?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n":""}\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`)}(e,t))},o))}const he=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:R,firstRun:!0,inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof H[e.id].onInit&&(oe("init()","onReady()","",e.id),H[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),ge={position:null,version:h};function ye(e){function t(){ke(L),je(B),S("onResized",L)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function o(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const i=e=>A.slice(A.indexOf(":")+7+e);const r=(e,t)=>(n,o)=>{const i={};var r,a;r=function(){Me(`${n} (${e})`,`${e}:${t()}`,o)},i[a=o]||(r(),i[a]=requestAnimationFrame(()=>{i[a]=null}))},a=(e,t)=>()=>{let n=!1;const o=t=>()=>{H[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame(()=>{n=!1})):s()},i=o(M),r=o("resize window");function a(e,t){t(window,M,i),t(window,x,r)}function s(){_(l,`stop${t}`),a(0,re),c.disconnect(),u.disconnect(),re(H[l].iframe,v,s)}const l=B,c=new ResizeObserver(o("pageObserver")),u=new ResizeObserver(o("iframeObserver"));H[l]&&(H[l][`stop${t}`]=s,ie(H[l].iframe,v,s),a(0,ie),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),u.observe(H[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},s=e=>()=>{e in H[B]&&(H[B][e](),delete H[B][e])},l=r(j,function(){const e=document.body.getBoundingClientRect(),t=L.iframe.getBoundingClientRect(),{scrollY:n,scrollX:o,innerHeight:i,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,i||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:o,documentHeight:a,documentWidth:s,windowHeight:i,windowWidth:r})}),c=r(T,function(){const{iframe:e}=L,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})}),u=a(l,"PageInfo"),d=a(c,"ParentInfo"),f=s("stopPageInfo"),g=s("stopParentInfo");function w(e){const t=e.getBoundingClientRect();return ze(),{x:Number(t.left)+Number(ge.position.x),y:Number(t.top)+Number(ge.position.y)}}function $(e){const t=e?w(L.iframe):{x:0,y:0};X(B,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,m,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(L,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){setTimeout(()=>t["scrollTo"+(e?"Offset":"")](n.x,n.y))}(o,n):function(e){ge.position=e,E(B)}(n)}function E(e){const{x:t,y:n}=ge.position,o=H[e]?.iframe;!1!==S("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?je(e):$e()}function R(e){let t={};if(0===L.width&&0===L.height){const e=i(9).split(":");t={x:e[1],y:e[0]}}else t={x:L.width,y:L.height};S(e,{iframe:L.iframe,screenX:Number(t.x),screenY:Number(t.y),type:L.type})}const S=(e,t)=>be(B,e,t);function C(){const{height:e,iframe:n,msg:o,type:r,width:a}=L;switch(H[B]?.firstRun&&function(){if(!H[B])return;Oe(B,L.mode),H[B].firstRun=!1}(),r){case"close":ve(n);break;case z:l=i(6),S("onMessage",{iframe:L.iframe,message:JSON.parse(l)});break;case"mouseenter":R("onMouseEnter");break;case"mouseleave":R("onMouseLeave");break;case"beforeUnload":X(B,"Ready state reset"),H[B].initialised=!1;break;case y:H[B].autoResize=JSON.parse(i(9));break;case"scrollBy":!function(){const e=L.width,t=L.height,n=window.parentIframe||window.parentIFrame||window;X(B,`scrollBy: x: %c${e}%c y: %c${t}`,p,m,p),n.scrollBy(e,t)}();break;case"scrollTo":$(!1);break;case"scrollToOffset":$(!0);break;case j:u();break;case T:d();break;case"pageInfoStop":f();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let o=document.getElementById(n)||document.getElementsByName(n)[0];o?function(){const e=w(o);X(B,`Moving to in page link: %c#${t}`,p),ge.position={x:e.x,y:e.y},E(B),window.location.hash=t}():window.top!==window.self&&function(){const e=window.parentIframe||window.parentIFrame;e&&e.moveToAnchor(t)}()}(i(9));break;case"title":!function(e,t){H[t]?.syncTitle&&(H[t].iframe.title=e,X(t,`Set iframe title attribute: %c${e}`,p))}(o,B);break;case k:Te(L);break;case b:t(),function(e){try{H[e].sameOrigin=!!H[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){H[e].sameOrigin=!1}}(B),(s=o)!==h&&(void 0!==s||ee(B,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),H[B].initialised=!0,S("onReady",n);break;default:if(0===a&&0===e)return void Y(B,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===a||0===e)return;if(document.hidden)return;t()}var s,l}function I(e){if(!H[e])throw new Error(`${L.type} No settings for ${e}. Message was: ${A}`)}let A=e.data;if("[iFrameResizerChild]Ready"===A)return W=e.source,void Object.values(H).forEach((e=>({initChild:t,initialised:n,postMessageTarget:o})=>{n||e!==o||t()})(W));var W;if(!(e=>O===`${e}`.slice(0,13)&&e.slice(13).split(":")[0]in H)(A)){if("string"!=typeof A)return;return void _("parent","ignoredMessage")}const L=function(e){const t=e.slice(13).split(":"),i=t[1]?Number(t[1]):0,r=H[t[0]]?.iframe,a=getComputedStyle(r),s={iframe:r,id:t[0],height:i+n(a)+o(a),width:Number(t[2]),type:t[3],msg:t[4]};return t[5]&&(s.mode=t[5]),s}(A),{id:N,type:F}=L,B=N;B?(_(B,F),Q(B,function(t){I(B),L.type in{true:1,false:1,undefined:1}||(null!==L.iframe||(Y(B,`The iframe (${L.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let o=H[B]?.checkOrigin;if(o&&"null"!=`${t}`&&!(o.constructor===Array?function(){let e=0,n=!1;for(;e<o.length;e++)if(o[e]===t){n=!0;break}return n}():function(){const e=H[B]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${L.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&C()})(A)):Y("","iframeResizer received messageData without id, message was: ",A)}function be(e,t,n){let o=null,i=null;if(H[e]){if(o=H[e][t],"function"!=typeof o)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{i=o(n)}catch(n){console.error(n),Y(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(o,n)}return i}function we(e){const{id:t}=e;delete H[t],delete e.iframeResizer}function ve(e){const{id:t}=e;if(!1!==be(t,"onBeforeClose",t)){try{e.parentNode&&e.remove()}catch(e){Y(t,e)}be(t,"onAfterClose",t),we(e)}}function ze(e){null===ge.position&&(ge.position={x:window.scrollX,y:window.scrollY})}function $e(){ge.position=null}function je(e){null!==ge.position&&(window.scrollTo(ge.position.x,ge.position.y),X(e,`Set page position: %c${ge.position.x}%c, %c${ge.position.y}`,p,m,p),$e())}function Te(e){ze(e.id),ke(e),Me(k,k,e.id)}function ke(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,X(n,`Set ${t}: %c${o}`,p)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=H[n];o&&t("height"),i&&t("width")}const xe=e=>e.split(":").filter((e,t)=>19!==t).join(":");function Me(e,t,n){function o(o){const i=e in I?xe(t):t;X(n,o,p,m,p),X(n,`Message data: %c${i}`,p)}_(n,e),H[n]&&(H[n]?.postMessageTarget?function(){const{iframe:i,postMessageTarget:r,sameOrigin:a,targetOrigin:s}=H[n];if(a)try{return i.contentWindow.iframeChildListener(O+t),void o(`Sending message to iframe %c${n}%c via same origin%c`)}catch(t){e in I?H[n].sameOrigin=!1:Y(n,"Same origin messaging failed, falling back to postMessage")}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${s}`),r.postMessage(O+t,s)}():Y(n,`Iframe(${n}) not found`))}let Ee=0,Re=!1,Se=!1;function Oe(t,n=-3){if(Re)return;const o=Math.max(H[t].mode,n);if(o>H[t].mode&&(H[t].mode=o),o<0)throw K(t),H[t].vAdvised||ee(t||"Parent",`${fe(o+2)}${fe(2)}`),H[t].vAdvised=!0,fe(o+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");o>0&&Se||function(t,n){queueMicrotask(()=>console.info(`%ciframe-resizer ${t}`,D||n<1?"font-weight: bold;":e))}(`v${h} (${(e=>se(ue[e]))(o)})`,o),o<1&&ee("Parent",fe(3)),Re=!0}const Ce=e=>t=>{function n(){if(H[u]){const{iframe:e}=H[u],t={close:ve.bind(null,e),disconnect:we.bind(null,e),removeListeners(){ee(u,"<rb>Deprecated Method Name</>\n\nThe [removeListeners()</> method has been renamed to [disconnect()</>.\n"),this.disconnect()},resize(){ee(u,"<rb>Deprecated Method</>\n        \nUse of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As their are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code."),Me.bind(null,"Window resize",x,u)},moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${o=t,o.charAt(0).toUpperCase()+o.slice(1)}`);var o})(e,"string","moveToAnchor(anchor) anchor"),Me("Move to anchor",`moveToAnchor:${e}`,u)},sendMessage(e){e=JSON.stringify(e),Me(z,`${z}:${e}`,u)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e,n){const{waitForLoad:o}=H[e],i=o=>()=>{H[e]&&!0!==H[e].initialised&&(Me(o,n,e),me(e,H),H[e].firstRun||H[u]?.heightCalculationMethod in C&&Te({iframe:t,height:1,width:1,type:b}))},r=i($);ie(t,v,()=>setTimeout(r,1)),H[e].initChild=i(w),!0!==o&&((e=>{const{src:t,srcdoc:n}=e;return!n&&(null==t||""===t||"about:blank"===t)})(t)?setTimeout(()=>{_(e,"noContent"),X(e,"No content detected in the iframe, delaying initialisation")}):setTimeout(i(b)))}function i(e){return e?(("sizeWidth"in e||"sizeHeight"in e||y in e)&&ee(u,`<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"${R}"</>, <i>"${S}"</> or <i>"${E}"</>.\n`),e):{}}function r(e){const t=H[e]?.iframe?.title;return""===t||void 0===t}function a(e,t){F(H[u],e)&&(ee(u,`<rb>Deprecated option</>\n\nThe <b>${e}</> option has been renamed to <b>${t}</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.`),H[u][t]=H[u][e],delete H[u][e])}const s=e=>F(e,"onMouseEnter")||F(e,"onMouseLeave");function l(e){var n,o;H[u]={...H[u],iframe:t,remoteHost:t?.src.split("/").slice(0,3).join("/"),...he,...i(e),mouseEvents:s(e),mode:pe(e),syncTitle:r(u)},a("offset","offsetSize"),a("onClose","onBeforeClose"),a("onClosed","onAfterClose"),_(u,"setup"),function(){const{direction:e}=H[u];switch(e){case R:break;case S:H[u].sizeHeight=!1;case"both":H[u].sizeWidth=!0;break;case E:H[u].sizeWidth=!1,H[u].sizeHeight=!1,H[u].autoResize=!1;break;default:throw new TypeError(u,`Direction value of "${e}" is not valid`)}}(),(n=e?.offsetSize||e?.offset)&&(H[u].direction===R?H[u].offsetHeight=n:H[u].offsetWidth=n),function(e){e?.offset&&ee(u,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.")}(e),H[u].warningTimeout||X(u,"warningTimeout:%c disabled",p),null===H[u].postMessageTarget&&(H[u].postMessageTarget=t.contentWindow),H[u].targetOrigin=!0===H[u].checkOrigin?""===(o=H[u].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}const c=()=>g in t,u=function(n){if(n&&"string"!=typeof n)throw new TypeError("Invalid id for iFrame. Expected String");return""!==n&&n||(n=function(){let t=e?.id||he.id+Ee++;return null!==document.getElementById(t)&&(t+=Ee++),t}(),t.id=n,_(n,"assignId")),n}(t.id);if("object"!=typeof e)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=W,e.logExpand=t.includes("ifrlog=expanded"))}(e),function(e,t){const n=F(t,"log"),o="string"==typeof t.log,i=n?!!o||t.log:he.log;F(t,"logExpand")||(t.logExpand=n&&o?t.log===A:he.logExpand),function(e){-1===e?.log&&(e.log=!1,Se=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const o=P({expand:t,label:J(n)});D=e,H[n]||(H[n]={console:o})}({enabled:i,expand:t.logExpand,iframeId:e}),o&&!(t.log in L)&&G(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=i}(u,e),Q(u,function(e){c()?Y(u,`Ignored iframe (${u}), already setup.`):(l(e),function(){if(Re)return;const{mode:e}=H[u];-1!==e&&Oe(u,e)}(),Ae(),function(){switch(t.style.overflow=!1===H[u]?.scrolling?"hidden":"auto",H[u]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=H[u]?H[u].scrolling:"no"}}(),function(){const{bodyMargin:e}=H[u];"number"!=typeof e&&"0"!==e||(H[u].bodyMargin=`${e}px`)}(),o(u,function(e){const t=H[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,ge.version,t.mode,"",t.logExpand].join(":")}(u)),n())})(e),t?.iframeResizer};function Ie(){!0!==document.hidden&&((e,t)=>{Object.values(H).filter(({autoResize:e,firstRun:t})=>e&&!t).forEach(({iframe:n})=>Me(e,t,n.id))})("tabVisible",x)}const Ae=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{ie(window,z,ye),ie(document,"visibilitychange",Ie),window.iframeParentListener=e=>setTimeout(()=>ye({data:e,sameOrigin:!0}))}),We=`[${g}] `;const Le=function(){function e(e){switch(!0){case!e:throw new TypeError(`${We}iframe is not defined`);case!e.tagName:throw new TypeError(`${We}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${We}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(o,i){if("undefined"==typeof window)return[];switch(t=Ce(o),n=[],typeof i){case"undefined":case"string":document.querySelectorAll(i||"iframe").forEach(e);break;case"object":e(i);break;default:throw new TypeError(`${We}Unexpected data type (${typeof i})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){ne("iFrameResize()","iframeResize()","","parent"),Le(...e)}),Le});
