@iframe-resizer/child 6.0.0-beta.4 → 6.0.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -25,4 +25,4 @@ yarn add @iframe-resizer/child
25
25
 
26
26
  ---
27
27
 
28
- _iframe-resizer version 6.0.0-beta.4 2026-04-10 - 14:49:39.837Z_
28
+ _iframe-resizer version 6.0.0-beta.5 2026-04-10 - 15:33:04.965Z_
package/index.cjs.js CHANGED
@@ -1,28 +1,28 @@
1
- "use strict";const o=require("@iframe-resizer/common/consts"),bt=require("@iframe-resizer/common/deprecate"),wt=require("@iframe-resizer/common/format-advise"),u=require("@iframe-resizer/common/utils"),s=require("auto-console-group"),E=require("@iframe-resizer/common/mode");let me=!0,Ne=o.LABEL;const vt=u.esModuleInterop(s),x=vt({label:`${o.LABEL}(child)`,expand:!1});function yt(e){Ne=e.id||o.LABEL,x.label(`${Ne}`),x.expand(e.expand),me=e.enabled}const Qe=e=>(...t)=>me?x[e](...t):!0,d=Qe("log"),f=d,J=Qe("debug");function Ht(e,t){console.info(`%ciframe-resizer ${e}`,me||t<1?o.BOLD:s.NORMAL)}const{assert:At,endAutoGroup:$,error:Ke,errorBoundary:he,event:I,label:br,purge:wr,warn:C}=x,Je=wt(u.id),b=(...e)=>x.warn(...e.map(Je)),Nt=(...e)=>console.warn(...e.map(Je)),Ee=bt((e,t)=>b(t));Ee("Method");Ee("Method","replaced with");Ee("Option");const Ie=[];function Xe(e,t){d(`${e} event listener: %c${t}`,s.HIGHLIGHT)}const et=(e,t,n,r)=>{e.removeEventListener(t,n,r),Xe("Removed",t)},G=(e,t,n,r=!1)=>{e.addEventListener(t,n,r),Ie.push(()=>et(e,t,n,r)),Xe("Added",t)},c={applySelectors:null,firstRun:!0,hasTags:!1,hasOverflow:!1,height:0,isHidden:!1,initLock:!0,inPageLinks:{},origin:void 0,hasOverflowUpdated:!0,overflowedNodeSet:new Set,sameOrigin:!1,taggedElements:[],target:window?.parent,timerActive:!1,totalTime:0,triggerLocked:!1,width:0,win:window,onPageInfo:null,onParentInfo:null};let Me=!1;function Le(e){const t=window?.iframeResizer?.targetOrigin||"*",n=Array.isArray(t)?t:[t];for(const r of n)e.postMessage(o.CHILD_READY_MESSAGE,r)}function Ge(){if(document.readyState==="loading"||!c.firstRun||Me)return;const{parent:e,top:t}=window;I("ready"),d("Sending%c ready%c to parent from",s.HIGHLIGHT,s.FOREGROUND,window.location.href),Le(e),e!==t&&Le(t),Me=!0}const ze="iframeResize",Mt=e=>o.MESSAGE_ID===`${e.data}`.slice(0,o.MESSAGE_ID_LENGTH),Lt=()=>ze in window||window.jQuery!==void 0&&ze in window.jQuery.prototype,Gt=e=>e.data.split(o.SEPARATOR)[2]in{true:1,false:1},zt=()=>[document.documentElement,document.body],$t=["min-height","min-width","max-height","max-width"],$e=new Set,_t=e=>!!e&&e!=="0px"&&e!==o.AUTO&&e!==o.NONE,tt=e=>e.tagName?e.tagName.toLowerCase():"unknown",nt=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),kt=(e,t)=>_t(nt(e,t));function Ct(e,t){const n=e.style.getPropertyValue(t);return n?{source:"an inline style attribute",value:n}:null}function Dt({href:e}){$e.has(e)||(d("Unable to access stylesheet:",e),$e.add(e))}function Pt(e,t){for(const n of document.styleSheets)try{for(const r of n.cssRules||[]){if(!("selectorText"in r))continue;const i=r;if(!e.matches(i.selectorText))continue;const g=i.style.getPropertyValue(t);if(!g)continue;const{ownerNode:l}=n;return{source:l instanceof Element&&l.tagName==="STYLE"?"an inline <style> block":`stylesheet (${n.href})`,value:g}}}catch{Dt(n)}return{source:"cross-origin stylesheet",value:nt(e,t)}}const Bt=(e,t)=>Ct(e,t)||Pt(e,t),Ft=(e,t)=>{const{source:n,value:r}=Bt(e,t),i=tt(e);b(`The <b>${t}</> CSS property is set to <b>${r}</> on the <b><${i}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.
1
+ "use strict";const n=require("@iframe-resizer/common"),s=require("auto-console-group");let ue=!0,He=n.LABEL;const Rt=n.esModuleInterop(s),F=Rt({label:`${n.LABEL}(child)`,expand:!1});function Tt(e){He=e.id||n.LABEL,F.label(`${He}`),F.expand(e.expand),ue=e.enabled}const Ye=e=>(...t)=>ue?F[e](...t):!0,d=Ye("log"),f=d,Q=Ye("debug");function bt(e,t){console.info(`%ciframe-resizer ${e}`,ue||t<1?n.BOLD:s.NORMAL)}const{assert:wt,endAutoGroup:G,error:je,errorBoundary:ge,event:h,label:Or,purge:Sr,warn:_}=F,Qe=n.createFormatAdvise(n.id),R=(...e)=>F.warn(...e.map(Qe)),vt=(...e)=>console.warn(...e.map(Qe)),me=n.deprecate((e,t)=>R(t));me("Method");me("Method","replaced with");me("Option");const he=[];function Ke(e,t){d(`${e} event listener: %c${t}`,s.HIGHLIGHT)}const Je=(e,t,o,r)=>{e.removeEventListener(t,o,r),Ke("Removed",t)},N=(e,t,o,r=!1)=>{e.addEventListener(t,o,r),he.push(()=>Je(e,t,o,r)),Ke("Added",t)},c={applySelectors:null,firstRun:!0,hasTags:!1,hasOverflow:!1,height:0,isHidden:!1,initLock:!0,inPageLinks:{},origin:void 0,hasOverflowUpdated:!0,overflowedNodeSet:new Set,sameOrigin:!1,taggedElements:[],target:window?.parent,timerActive:!1,totalTime:0,triggerLocked:!1,width:0,win:window,onPageInfo:null,onParentInfo:null};let Ae=!1;function Me(e){const t=window?.iframeResizer?.targetOrigin||"*",o=Array.isArray(t)?t:[t];for(const r of o)e.postMessage(n.CHILD_READY_MESSAGE,r)}function Ne(){if(document.readyState==="loading"||!c.firstRun||Ae)return;const{parent:e,top:t}=window;h("ready"),d("Sending%c ready%c to parent from",s.HIGHLIGHT,s.FOREGROUND,window.location.href),Me(e),e!==t&&Me(t),Ae=!0}const Le="iframeResize",yt=e=>n.MESSAGE_ID===`${e.data}`.slice(0,n.MESSAGE_ID_LENGTH),Ht=()=>Le in window||window.jQuery!==void 0&&Le in window.jQuery.prototype,At=e=>e.data.split(n.SEPARATOR)[2]in{true:1,false:1},Mt=()=>[document.documentElement,document.body],Nt=["min-height","min-width","max-height","max-width"],Ge=new Set,Lt=e=>!!e&&e!=="0px"&&e!==n.AUTO&&e!==n.NONE,Xe=e=>e.tagName?e.tagName.toLowerCase():"unknown",et=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Gt=(e,t)=>Lt(et(e,t));function zt(e,t){const o=e.style.getPropertyValue(t);return o?{source:"an inline style attribute",value:o}:null}function $t({href:e}){Ge.has(e)||(d("Unable to access stylesheet:",e),Ge.add(e))}function _t(e,t){for(const o of document.styleSheets)try{for(const r of o.cssRules||[]){if(!("selectorText"in r))continue;const i=r;if(!e.matches(i.selectorText))continue;const u=i.style.getPropertyValue(t);if(!u)continue;const{ownerNode:l}=o;return{source:l instanceof Element&&l.tagName==="STYLE"?"an inline <style> block":`stylesheet (${o.href})`,value:u}}}catch{$t(o)}return{source:"cross-origin stylesheet",value:et(e,t)}}const kt=(e,t)=>zt(e,t)||_t(e,t),Ct=(e,t)=>{const{source:o,value:r}=kt(e,t),i=Xe(e);R(`The <b>${t}</> CSS property is set to <b>${r}</> on the <b><${i}></> element via ${o}. This may cause issues with the correct operation of <i>iframe-resizer</>.
2
2
 
3
- If you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function Ut(){for(const e of zt())for(const t of $t)d(`Checking <${tt(e)}> for blocking CSS: ${t}`),kt(e,t)&&Ft(e,t)}const xt=({calculateWidth:e,calculateHeight:t})=>e===t,a={autoResize:!0,bodyBackground:"",bodyMargin:0,bodyMarginStr:"",bodyPadding:"",calculateHeight:!0,calculateWidth:!1,heightCalcMode:o.AUTO,ignoreSelector:"",inPageLinks:!1,logging:!1,logExpand:!1,mode:0,mouseEvents:!1,offsetHeight:0,offsetWidth:0,parentId:void 0,sizeSelector:"",targetOrigin:"*",tolerance:0,widthCalcMode:o.AUTO,onBeforeResize:void 0,onMessage:()=>{C("onMessage function not defined")},onReady:()=>{}};function Vt(){try{c.sameOrigin=a.mode===1||"iframeParentListener"in window.parent}catch{d("Cross domain iframe detected")}}let _e=0;function Wt(e){const t=e.length===1?"":"s";C(`%c[${o.IGNORE_ATTR}]%c found on %c${e.length}%c element${t}`,s.BOLD,s.NORMAL,s.BOLD,s.NORMAL)}function qt(){const e=document.querySelectorAll(`*[${o.IGNORE_ATTR}]`),t=e.length>0;return t&&e.length!==_e&&(Wt(e),_e=e.length),t}function Zt(e,t,n){(!u.isDef(n)||t>-1&&e>t)&&(Ht(`v${o.VERSION} (${E.getModeLabel(e)})`,e),e===0&&Nt(E.getModeData(3)))}function Yt({key:e,key2:t,mode:n,version:r}){const i=n,g=u.isDef(e)?E({key:e}):-1,l=u.isDef(t)?E({key:t}):-1;let m;switch(n=Math.max(g,l),n){case-2:case-1:m=`${E.getModeData(Math.min(g,l)+2)}${E.getModeData(2)}`,c.firstRun=!1;break;case 1:case 2:case 3:m=E.getModeData(6);break;case 4:m=E.getModeData(7);break;case 5:m=E.getModeData(8);break}if(n>=0&&Zt(n,i,r),(!u.isDef(r)||!c.firstRun)&&(m&&b(m),n<0))throw b(E.getModeData(9)),m.split("<br>")[0].replace(/<\/?[a-z][^>]*>|<\/>/gi,"");a.mode=n}const jt="BackCompat",Qt=`<rb>Quirks Mode Detected</>
3
+ If you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function Dt(){for(const e of Mt())for(const t of Nt)d(`Checking <${Xe(e)}> for blocking CSS: ${t}`),Gt(e,t)&&Ct(e,t)}const Pt=({calculateWidth:e,calculateHeight:t})=>e===t,a={autoResize:!0,bodyBackground:"",bodyMargin:0,bodyMarginStr:"",bodyPadding:"",calculateHeight:!0,calculateWidth:!1,heightCalcMode:n.AUTO,ignoreSelector:"",inPageLinks:!1,logging:!1,logExpand:!1,mode:0,mouseEvents:!1,offsetHeight:0,offsetWidth:0,parentId:void 0,sizeSelector:"",targetOrigin:"*",tolerance:0,widthCalcMode:n.AUTO,onBeforeResize:void 0,onMessage:()=>{_("onMessage function not defined")},onReady:()=>{}};function Bt(){try{c.sameOrigin=a.mode===1||"iframeParentListener"in window.parent}catch{d("Cross domain iframe detected")}}let ze=0;function Ft(e){const t=e.length===1?"":"s";_(`%c[${n.IGNORE_ATTR}]%c found on %c${e.length}%c element${t}`,s.BOLD,s.NORMAL,s.BOLD,s.NORMAL)}function Ut(){const e=document.querySelectorAll(`*[${n.IGNORE_ATTR}]`),t=e.length>0;return t&&e.length!==ze&&(Ft(e),ze=e.length),t}function xt(e,t,o){(!n.isDef(o)||t>-1&&e>t)&&(bt(`v${n.VERSION} (${n.getModeLabel(e)})`,e),e===0&&vt(n.getModeData(3)))}function Vt({key:e,key2:t,mode:o,version:r}){const i=o,u=n.isDef(e)?n.setMode({key:e}):-1,l=n.isDef(t)?n.setMode({key:t}):-1;let g;switch(o=Math.max(u,l),o){case-2:case-1:g=`${n.getModeData(Math.min(u,l)+2)}${n.getModeData(2)}`,c.firstRun=!1;break;case 1:case 2:case 3:g=n.getModeData(6);break;case 4:g=n.getModeData(7);break;case 5:g=n.getModeData(8);break}if(o>=0&&xt(o,i,r),(!n.isDef(r)||!c.firstRun)&&(g&&R(g),o<0))throw R(n.getModeData(9)),g.split("<br>")[0].replace(/<\/?[a-z][^>]*>|<\/>/gi,"");a.mode=o}const Wt="BackCompat",Zt=`<rb>Quirks Mode Detected</>
4
4
 
5
5
  This iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.
6
6
 
7
7
  For more information see <u>https://iframe-resizer.com/quirks-mode</>.
8
- `;function Kt(){document.compatMode===jt&&b(Qt)}const Jt="complete";let ke=!1;function ot(e){document.readyState===Jt?u.isolateUserCode(e):ke||G(document,o.READY_STATE_CHANGE,()=>ot(e)),ke=!0}const Xt=()=>{f(`Set targetOrigin for parent: %c${a.targetOrigin}`,s.HIGHLIGHT),a.autoResize!==!0&&d("Auto Resize disabled")};function rt(){c.taggedElements=document.querySelectorAll(`[${o.SIZE_ATTR}]`),c.hasTags=c.taggedElements.length>0,d(`Tagged elements found: %c${c.hasTags}`,s.HIGHLIGHT)}const en=`<rb>Legacy version detected on parent page</>
8
+ `;function qt(){document.compatMode===Wt&&R(Zt)}const Yt="complete";let $e=!1;function tt(e){document.readyState===Yt?n.isolateUserCode(e):$e||N(document,n.READY_STATE_CHANGE,()=>tt(e)),$e=!0}const jt=()=>{f(`Set targetOrigin for parent: %c${a.targetOrigin}`,s.HIGHLIGHT),a.autoResize!==!0&&d("Auto Resize disabled")};function nt(){c.taggedElements=document.querySelectorAll(`[${n.SIZE_ATTR}]`),c.hasTags=c.taggedElements.length>0,d(`Tagged elements found: %c${c.hasTags}`,s.HIGHLIGHT)}const Qt=`<rb>Legacy version detected on parent page</>
9
9
 
10
10
  Detected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.
11
11
 
12
12
  See <u>https://iframe-resizer.com/setup/</> for more details.
13
- `,tn=e=>`<b>Version mismatch</>
13
+ `,Kt=e=>`<b>Version mismatch</>
14
14
 
15
15
  The parent and child pages are running different versions of <i>iframe resizer</>.
16
16
 
17
- Parent page: ${e} - Child page: ${o.VERSION}.
18
- `;function nn({version:e}){!e||e===""||e===o.FALSE?b(en):e!==o.VERSION&&b(tn(e))}const on=u.once(()=>b(E.getModeData(4)));function rn(e){if(!c.timerActive)return;const t=u.round(performance.now()-c.totalTime),n=e===o.INIT?`Initialised iframe in %c${t}ms`:`Size calculated in %c${t}ms`;d(n,s.HIGHLIGHT)}function sn(e){return e===void 0?e=a.targetOrigin:d(`Message targetOrigin: %c${e}`,s.HIGHLIGHT),e}function cn(e,t){const{mode:n}=a,{sameOrigin:r,target:i}=c;if(r)try{window.parent.iframeParentListener(o.MESSAGE_ID+e)}catch(g){if(E.checkMode(n))on();else throw new Error(g);return!1}else{At(i,"Internal error: postMessage target is undefined");const g=sn(t),l=Array.isArray(g)?g:[g];for(const m of l)i.postMessage(o.MESSAGE_ID+e,m)}return!0}function st(e,t,n,r,i){const{parentId:g}=a,{sameOrigin:l}=c,m=`${e}:${t}`,S=`${g}:${m}:${n}${r===void 0?"":`:${r}`}`;a.mode<-1||!cn(S,i)||(rn(n),f(`Sending message to parent page via ${l?"sameOrigin":"postMessage"}: %c%c${S}`,s.ITALIC,s.HIGHLIGHT))}const R=he((e,t,n,r,i)=>{I(n),st(e,t,n,r,i),$()}),an=e=>R(0,0,e.type,`${e.screenY}:${e.screenX}`);function Ce(e,t){d(`Add event listener: %c${t}`,s.HIGHLIGHT),G(window.document,e,an)}function dn({mouseEvents:e}){e===!0&&(Ce(o.MOUSE_ENTER,"Mouse Enter"),Ce(o.MOUSE_LEAVE,"Mouse Leave"))}const ln=()=>R(0,0,o.BEFORE_UNLOAD);function fn({persisted:e}){e||ln(),I(o.PAGE_HIDE),f("Page persisted:",e),!e&&Ie.forEach(u.invoke)}const un=()=>G(window,u.lower(o.PAGE_HIDE),fn),De=(e,t)=>!(Math.abs(e-t)<=a.tolerance);function gn(e,t){const{calculateHeight:n,calculateWidth:r}=a,{height:i,width:g}=c;return n&&De(i,e)||r&&De(g,t)}const M=[s.HIGHLIGHT,s.FOREGROUND,s.HIGHLIGHT],Q={height:0,width:0},k={height:0,width:0};function _(e,t,n){return k[e]=t,Q[e]=n,t}function mn(e){const t=e.getOffset();return t!==0&&f(`Page offsetSize: %c${t}px`,s.HIGHLIGHT),t}const hn=e=>e.documentElementScroll()+Math.max(0,e.getOffset());function it(e){const{hasOverflow:t,hasTags:n,triggerLocked:r}=c,i=e.label,g=i===o.HEIGHT,l=e.boundingClientRect(),m=Math.ceil(l),S=Math.floor(l),h=hn(e),T=`HTML: %c${l}px %cPage: %c${h}px`;let p;switch(!0){case!e.enabled():return Math.max(h,o.MIN_SIZE);case n:f("Found element with data-iframe-size attribute"),p=e.taggedElement();break;case(!t&&c.firstRun&&k[i]===0&&Q[i]===0):f(`Initial page size values: ${T}`,...M),p=_(i,l,h);break;case(r&&l===k[i]&&h===Q[i]):f(`Size unchanged: ${T}`,...M),p=Math.max(l,h);break;case(l===0&&h!==0):f(`Page is hidden: ${T}`,...M),p=h;break;case(!t&&l!==k[i]&&h<=Q[i]):f(`New <html> size: ${T} `,...M),f(`Previous <html> size: %c${k[i]}px`,s.HIGHLIGHT),p=_(i,l,h);break;case!g:p=e.taggedElement();break;case(!t&&l<k[i]):f(`<html> size decreased: ${T}`,...M),p=_(i,l,h);break;case(h===S||h===m):f(`<html> size equals page size: ${T}`,...M),p=_(i,l,h);break;case l>h:f(`Page size < <html> size: ${T}`,...M),p=_(i,l,h);break;case t:f("Found elements possibly overflowing <html> "),p=e.taggedElement();break;default:f(`Using <html> size: ${T}`,...M),p=_(i,l,h)}return f(`Content ${i}: %c${p}px`,s.HIGHLIGHT),p+=mn(e),Math.max(p,o.MIN_SIZE)}const En=1e3,In=5*En,pn=4,On=10,Sn=100,pe="--ifr-start",X="--ifr-end",ct="--ifr-measure",O=[];let K={},Pe=0,de;function at(){try{performance.clearMarks(pe),performance.clearMarks(X),performance.clearMeasures(ct)}catch{}}function Rn(){de=setInterval(()=>{if(O.length<On||K.hasTags&&K.len<25)return;O.sort();const e=Math.min(O.reduce((n,r)=>n+r,0)/O.length,O[Math.floor(O.length/2)]),t=u.round(e);t>Pe&&(Pe=t,I("performanceObserver"),d("Mean time:",u.round(O[Math.floor(O.length/2)])),d("Median time:",u.round(O.reduce((n,r)=>n+r,0)/O.length)),d("Average time:",t),d("Max time:",u.round(Math.max(...O)))),at(),!(e<=pn)&&(clearInterval(de),b(`<rb>Performance Warning</>
17
+ Parent page: ${e} - Child page: ${n.VERSION}.
18
+ `;function Jt({version:e}){!e||e===""||e===n.FALSE?R(Qt):e!==n.VERSION&&R(Kt(e))}const Xt=n.once(()=>R(n.getModeData(4)));function en(e){if(!c.timerActive)return;const t=n.round(performance.now()-c.totalTime),o=e===n.INIT?`Initialised iframe in %c${t}ms`:`Size calculated in %c${t}ms`;d(o,s.HIGHLIGHT)}function tn(e){return e===void 0?e=a.targetOrigin:d(`Message targetOrigin: %c${e}`,s.HIGHLIGHT),e}function nn(e,t){const{mode:o}=a,{sameOrigin:r,target:i}=c;if(r)try{window.parent.iframeParentListener(n.MESSAGE_ID+e)}catch(u){if(n.checkMode(o))Xt();else throw new Error(u);return!1}else{wt(i,"Internal error: postMessage target is undefined");const u=tn(t),l=Array.isArray(u)?u:[u];for(const g of l)i.postMessage(n.MESSAGE_ID+e,g)}return!0}function ot(e,t,o,r,i){const{parentId:u}=a,{sameOrigin:l}=c,g=`${e}:${t}`,p=`${u}:${g}:${o}${r===void 0?"":`:${r}`}`;a.mode<-1||!nn(p,i)||(en(o),f(`Sending message to parent page via ${l?"sameOrigin":"postMessage"}: %c%c${p}`,s.ITALIC,s.HIGHLIGHT))}const O=ge((e,t,o,r,i)=>{h(o),ot(e,t,o,r,i),G()}),on=e=>O(0,0,e.type,`${e.screenY}:${e.screenX}`);function _e(e,t){d(`Add event listener: %c${t}`,s.HIGHLIGHT),N(window.document,e,on)}function rn({mouseEvents:e}){e===!0&&(_e(n.MOUSE_ENTER,"Mouse Enter"),_e(n.MOUSE_LEAVE,"Mouse Leave"))}const sn=()=>O(0,0,n.BEFORE_UNLOAD);function cn({persisted:e}){e||sn(),h(n.PAGE_HIDE),f("Page persisted:",e),!e&&he.forEach(n.invoke)}const an=()=>N(window,n.lower(n.PAGE_HIDE),cn),ke=(e,t)=>!(Math.abs(e-t)<=a.tolerance);function dn(e,t){const{calculateHeight:o,calculateWidth:r}=a,{height:i,width:u}=c;return o&&ke(i,e)||r&&ke(u,t)}const A=[s.HIGHLIGHT,s.FOREGROUND,s.HIGHLIGHT],Y={height:0,width:0},$={height:0,width:0};function z(e,t,o){return $[e]=t,Y[e]=o,t}function ln(e){const t=e.getOffset();return t!==0&&f(`Page offsetSize: %c${t}px`,s.HIGHLIGHT),t}const fn=e=>e.documentElementScroll()+Math.max(0,e.getOffset());function rt(e){const{hasOverflow:t,hasTags:o,triggerLocked:r}=c,i=e.label,u=i===n.HEIGHT,l=e.boundingClientRect(),g=Math.ceil(l),p=Math.floor(l),m=fn(e),S=`HTML: %c${l}px %cPage: %c${m}px`;let E;switch(!0){case!e.enabled():return Math.max(m,n.MIN_SIZE);case o:f("Found element with data-iframe-size attribute"),E=e.taggedElement();break;case(!t&&c.firstRun&&$[i]===0&&Y[i]===0):f(`Initial page size values: ${S}`,...A),E=z(i,l,m);break;case(r&&l===$[i]&&m===Y[i]):f(`Size unchanged: ${S}`,...A),E=Math.max(l,m);break;case(l===0&&m!==0):f(`Page is hidden: ${S}`,...A),E=m;break;case(!t&&l!==$[i]&&m<=Y[i]):f(`New <html> size: ${S} `,...A),f(`Previous <html> size: %c${$[i]}px`,s.HIGHLIGHT),E=z(i,l,m);break;case!u:E=e.taggedElement();break;case(!t&&l<$[i]):f(`<html> size decreased: ${S}`,...A),E=z(i,l,m);break;case(m===p||m===g):f(`<html> size equals page size: ${S}`,...A),E=z(i,l,m);break;case l>m:f(`Page size < <html> size: ${S}`,...A),E=z(i,l,m);break;case t:f("Found elements possibly overflowing <html> "),E=e.taggedElement();break;default:f(`Using <html> size: ${S}`,...A),E=z(i,l,m)}return f(`Content ${i}: %c${E}px`,s.HIGHLIGHT),E+=ln(e),Math.max(E,n.MIN_SIZE)}const un=1e3,gn=5*un,mn=4,hn=10,En=100,Ee="--ifr-start",K="--ifr-end",st="--ifr-measure",I=[];let j={},Ce=0,ce;function it(){try{performance.clearMarks(Ee),performance.clearMarks(K),performance.clearMeasures(st)}catch{}}function In(){ce=setInterval(()=>{if(I.length<hn||j.hasTags&&j.len<25)return;I.sort();const e=Math.min(I.reduce((o,r)=>o+r,0)/I.length,I[Math.floor(I.length/2)]),t=n.round(e);t>Ce&&(Ce=t,h("performanceObserver"),d("Mean time:",n.round(I[Math.floor(I.length/2)])),d("Median time:",n.round(I.reduce((o,r)=>o+r,0)/I.length)),d("Average time:",t),d("Max time:",n.round(Math.max(...I)))),it(),!(e<=mn)&&(clearInterval(ce),R(`<rb>Performance Warning</>
19
19
 
20
- Calculating the page size is taking an excessive amount of time (${u.round(e)}ms).
20
+ Calculating the page size is taking an excessive amount of time (${n.round(e)}ms).
21
21
 
22
- To improve performance add the <b>data-iframe-size</> attribute to the ${K.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},In)}function Tn(e){e.getEntries().forEach(t=>{if(t.name===X)try{const{duration:n}=performance.measure(ct,pe,X);K=t.detail,O.push(n),O.length>Sn&&O.shift()}catch{}})}function bn(){f("Attached%c PerformanceObserver%c to page",s.HIGHLIGHT,s.FOREGROUND);const e=new PerformanceObserver(Tn);return e.observe({entryTypes:["mark"]}),Rn(),{disconnect:()=>{at(),clearInterval(de),e.disconnect(),f("Detached%c PerformanceObserver",s.HIGHLIGHT)}}}const wn=e=>`:not(${e})`,vn=`* ${Array.from(o.IGNORE_TAGS).map(wn).join("")}`,Oe=e=>e.querySelectorAll(vn);function yn(){const{hasOverflow:e,hasTags:t,overflowedNodeSet:n,taggedElements:r}=c;return t?r:e?Array.from(n):Oe(document.documentElement)}function Hn(e,t){const n=`margin-${t}`;let r,i=document.documentElement,g=c.hasTags?o.MIN_SIZE:document.documentElement.getBoundingClientRect().bottom;for(const l of e)r=l.getBoundingClientRect()[t]+parseFloat(getComputedStyle(l).getPropertyValue(n)),r>g&&(g=r,i=l);return{maxEl:i,maxVal:g}}function dt(e){performance.mark(pe);const t=u.capitalizeFirstLetter(e),{logging:n}=a,{hasTags:r}=c,i=yn(),{maxEl:g,maxVal:l}=Hn(i,e);return f(`${t} position calculated from:`,g),f(`Checked %c${i.length}%c elements`,s.HIGHLIGHT,s.FOREGROUND),performance.mark(X,{detail:{hasTags:r,len:i.length,logging:n,Side:t}}),l}const Se={label:o.HEIGHT,enabled:()=>a.calculateHeight,getOffset:()=>a.offsetHeight,auto:()=>it(Se),boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),documentElementScroll:()=>document.documentElement.scrollHeight,taggedElement:()=>dt(o.HEIGHT_EDGE)},Re={label:o.WIDTH,enabled:()=>a.calculateWidth,getOffset:()=>a.offsetWidth,auto:()=>it(Re),boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),documentElementScroll:()=>document.documentElement.scrollWidth,taggedElement:()=>dt(o.WIDTH_EDGE)};function An(e,t,n){const r=a.onBeforeResize(e,t,n);if(r===void 0)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(r))throw new TypeError(`Invalid value returned from onBeforeResize(): ${r}, expected Number`);if(r<o.MIN_SIZE)throw new RangeError(`Out of range value returned from onBeforeResize(): ${r}, must be at least ${o.MIN_SIZE}`);return r}const lt=(e,t)=>(n,r)=>{const i=e[n]();return e.enabled()&&a.onBeforeResize!==void 0?An(i,r,t):i},Nn=lt(Se,o.HEIGHT),Mn=lt(Re,o.WIDTH);function Ln(){(window.scrollY!==0||window.scrollX!==0)&&(f("Reset iframe scroll position to (0, 0)"),window.scrollTo(0,0))}function Gn(e,t,n,r){const{heightCalcMode:i,widthCalcMode:g}=a;Ln();const l=n??Nn(i,e),m=r??Mn(g,e),S=gn(l,m)?o.SIZE_CHANGE_DETECTED:e;switch(d(`Resize event: %c${t}`,s.HIGHLIGHT),S){case o.INIT:case o.ENABLE:case o.SIZE_CHANGE_DETECTED:case o.MANUAL_RESIZE_REQUEST:case o.PARENT_RESIZE_REQUEST:c.height=l,c.width=m;case o.SET_OFFSET_SIZE:return c;case o.OVERFLOW_OBSERVER:case o.MUTATION_OBSERVER:case o.RESIZE_OBSERVER:case o.VISIBILITY_OBSERVER:{d(o.NO_CHANGE);break}default:f(o.NO_CHANGE)}return null}let Z=!1,re=!1,B=null;function zn(e,t,n,r,i){const{autoResize:g}=a,{isHidden:l}=c;switch(I(e),!0){case(l===!0&&!(e in o.IGNORE_DISABLE_RESIZE)):{if(re===!0)break;d("Iframe hidden - Ignored resize request"),re=!0,Z=!1,cancelAnimationFrame(B),B=null;break}case(Z===!0&&e!==o.OVERFLOW_OBSERVER&&!(e in o.IGNORE_DISABLE_RESIZE)):{d("Resize already pending - Ignored resize request");break}case(!g&&!(e in o.IGNORE_DISABLE_RESIZE)):{f("Resizing disabled");break}default:{re=!1,Z=!0,c.totalTime=performance.now(),c.timerActive=!0;const m=Gn(e,t,n,r);m&&st(m.height,m.width,e,i),B||(B=requestAnimationFrame(()=>{Z=!1,B=null,I("requestAnimationFrame"),J(`Reset sendPending: %c${e}`,s.HIGHLIGHT)})),c.timerActive=!1}}$()}const A=he(zn);function Be({eventType:e,eventName:t}){G(window,t,()=>A(t,e),{passive:!0})}function $n(){Be({eventType:"After Print",eventName:"afterprint"}),Be({eventType:"Before Print",eventName:"beforeprint"})}function _n(){if(c.triggerLocked){d("TriggerLock blocked calculation");return}c.triggerLocked=!0,J("Trigger event lock on"),requestAnimationFrame(()=>{c.triggerLocked=!1,J("Trigger event lock off")})}function ft(e){const{heightCalcMode:t,widthCalcMode:n}=a,r=Se[t](),i=Re[n]();d(`Reset trigger event: %c${e}`,s.HIGHLIGHT),R(r,i,e)}function kn(e){const t=a.heightCalcMode;d(`Reset trigger event: %c${e}`,s.HIGHLIGHT),a.heightCalcMode=o.HEIGHT_CALC_MODE_DEFAULT,_n(),ft("reset"),a.heightCalcMode=t}const Cn=`Auto Resize can not be changed when <b>direction</> is set to '${o.NONE}'.`;function Dn(e){u.typeAssert(e,o.BOOLEAN,"parentIframe.autoResize(enable) enable");const{autoResize:t,calculateHeight:n,calculateWidth:r}=a;return r===!1&&n===!1?(I(o.ENABLE),b(Cn),!1):(e===!0&&t===!1?(a.autoResize=!0,queueMicrotask(()=>A(o.ENABLE,"Auto Resize enabled"))):e===!1&&t===!0&&(a.autoResize=!1),R(0,0,o.AUTO_RESIZE,JSON.stringify(a.autoResize)),a.autoResize)}function Pn(e){u.typeAssert(e,o.STRING,"parentIframe.moveToAnchor(anchor) anchor"),c.inPageLinks.findTarget(e)}function Bn(e){u.typeAssert(e,o.NUMBER,"parentIframe.setOffsetSize(offset) offset"),a.offsetHeight=e,a.offsetWidth=e,A(o.SET_OFFSET_SIZE,`parentIframe.setOffsetSize(${e})`)}const Fn=()=>c.origin;function Un(e){u.typeAssert(e,o.STRING,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),d(`Set targetOrigin: %c${e}`,s.HIGHLIGHT),a.targetOrigin=e}function xn(e){return u.typeAssert(e,o.FUNCTION,"parentIframe.getParentProps(callback) callback"),c.onParentInfo=e,R(0,0,o.PARENT_INFO),()=>{c.onParentInfo=null,R(0,0,o.PARENT_INFO_STOP)}}function Vn(e,t){e!==void 0&&u.typeAssert(e,o.NUMBER,"parentIframe.resize(customHeight, customWidth) customHeight"),t!==void 0&&u.typeAssert(t,o.NUMBER,"parentIframe.resize(customHeight, customWidth) customWidth");const n=e===void 0?"":e,r=t===void 0?"":`,${t}`,i=`${n}${r}`;A(o.MANUAL_RESIZE_REQUEST,`parentIframe.resize(${i})`,e,t)}const Te=e=>(t,n)=>{u.typeAssert(t,o.NUMBER,`parentIframe.${e}(x, y) x`),u.typeAssert(n,o.NUMBER,`parentIframe.${e}(x, y) y`),R(n,t,e)},Wn=Te(o.SCROLL_BY),qn=Te(o.SCROLL_TO),Zn=Te(o.SCROLL_TO_OFFSET);function Yn(e,t){t&&u.typeAssert(t,o.STRING,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),R(0,0,o.MESSAGE,JSON.stringify(e),t)}const jn=()=>R(0,0,o.CLOSE),Qn=()=>a.parentId,Kn=()=>kn("parentIframe.reset");function Jn(){const{win:e}=c;a.mode!==1&&(e.parentIframe=Object.freeze({autoResize:Dn,close:jn,getId:Qn,getParentOrigin:Fn,getParentProps:xn,moveToAnchor:Pn,reset:Kn,setOffsetSize:Bn,scrollBy:Wn,scrollTo:qn,scrollToOffset:Zn,sendMessage:Yn,setTargetOrigin:Un,resize:Vn}))}const V=(e="")=>t=>n=>{n.size>0&&J(`${t}Observer ${e}:`,...Array.from(n).flatMap(r=>[o.NEW_LINE,r]))},Xn=(e="")=>t=>n=>{n.size>0&&Ke(`${t}Observer ${e}:`,...Array.from(n).flatMap(r=>[o.NEW_LINE,r]))},ut=V("attached to"),gt=Xn("already attached"),eo=V("detached from"),ne=(e,t=!0)=>n=>{n>0&&f(`${t?"At":"De"}tached %c${e}Observer%c ${t?"to":"from"} %c${n}%c element${n===1?"":"s"}`,s.HIGHLIGHT,s.NORMAL,s.HIGHLIGHT,s.NORMAL)},mt=(e,t,n,r)=>{const i=eo(e);return g=>{const l=new Set;let m=0;for(const S of g)n.has(S)&&(t.unobserve(S),n.delete(S),l.add(S),m+=1);i(l),r(m),l.clear()}},Fe=16,Ue=2,to=200,be="Mutation",y=new Set,L=new Set,le=new Set,ee=[],no={attributes:!0,attributeFilter:[o.IGNORE_ATTR,o.SIZE_ATTR],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let se=1,we,fe=!1,ue=0;const oo=V("added")(be),ro=V("removed (page)")(be),so=V("removed (added)")(be),ht=e=>e.nodeType!==Node.ELEMENT_NODE||o.IGNORE_TAGS.has(e.tagName.toLowerCase());function io(e){const t=e.addedNodes;for(const n of t)ht(n)||y.add(n)}function co(e){const t=e.removedNodes;for(const n of t)ht(n)||(y.has(n)?(y.delete(n),le.add(n)):L.add(n))}const ao=e=>{f("Mutations:",e);for(const t of e)io(t),co(t);oo(y),ro(L),so(le),le.clear()};function lo(){L.size>0&&d(`Detected %c${L.size} %cremoved element${L.size>1?"s":""}`,s.HIGHLIGHT,s.FOREGROUND),y.size>0&&d(`Found %c${y.size} %cnew element${y.size>1?"s":""}`,s.HIGHLIGHT,s.FOREGROUND)}const fo=e=>()=>{const t=performance.now(),n=t-ue,r=Fe*se+++Ue;if(n>r&&n<to){I("mutationThrottled"),f("Update delayed due to heavy workload on the callStack"),f(`EventLoop busy time: %c${u.round(n)}ms %c> Max wait: %c${r-Ue}ms`,s.HIGHLIGHT,s.FOREGROUND,s.HIGHLIGHT),setTimeout(we,Fe*se),ue=t;return}se=1,ee.forEach(ao),ee.length=0,fe=!1,lo(),e({addedNodes:y,removedNodes:L}),y.clear(),L.clear()};function uo(e){ee.push(e),!fe&&(ue=performance.now(),fe=!0,requestAnimationFrame(we))}function go(e){const t=new window.MutationObserver(uo),n=document.body||document.documentElement;return we=fo(e),t.observe(n,no),f("Attached%c MutationObserver%c to body",s.HIGHLIGHT,s.FOREGROUND),{disconnect:()=>{y.clear(),L.clear(),ee.length=0,t.disconnect(),f("Detached%c MutationObserver",s.HIGHLIGHT)}}}const mo={characterData:!0,childList:!0,subtree:!0};function ho(e){const t=document.querySelector("title")??document.head??document.documentElement,n=new MutationObserver(e);return n.observe(t,mo),f("Attached%c TitleObserver%c to head",s.HIGHLIGHT,s.FOREGROUND),setTimeout(e),{disconnect:()=>{n.disconnect(),f("Detached%c TitleObserver",s.HIGHLIGHT)}}}function Eo(e){const t=new IntersectionObserver(r=>e(r.at(-1)?.isIntersecting??!1),{threshold:0}),n=document.documentElement;return t.observe(n),f("Attached%c VisibilityObserver%c to page",s.HIGHLIGHT,s.FOREGROUND),{disconnect:()=>{t.disconnect(),f("Detached%c VisibilityObserver",s.HIGHLIGHT)}}}let xe=new Set;function Io(e){const t=new Set,n=new Set;for(const r of e)r.closest(`[${o.IGNORE_ATTR}]`)?n.add(r):t.add(r);return n.size>0&&queueMicrotask(()=>{I("overflowIgnored"),f(`Ignoring elements with [data-iframe-ignore] > *:
23
- `,n),$()}),t}function Et(){const e=document.querySelectorAll(`[${o.OVERFLOW_ATTR}]`),t=Io(e);let n=!0;return typeof Set.prototype.symmetricDifference===o.FUNCTION&&(n=t.symmetricDifference(xe).size>0),xe=t,c.overflowedNodeSet=t,c.hasOverflow=t.size>0,{hasOverflowUpdated:n,overflowedNodeSet:t}}const H={},It=e=>{const t=new Set;for(const n of e)if(n instanceof Element){t.add(n);for(const r of Oe(n))t.add(r)}return f(`Inspecting:
24
- `,t),t},po=e=>{if(e.size===0)return;I("addObservers");const t=It(e);H.overflow.attachObservers(t),H.resize.attachObserverToNonStaticElements(t),$()},Oo=e=>{if(e.size===0)return;I("removeObservers");const t=It(e);H.overflow.detachObservers(t),H.resize.detachObservers(t),$()};function So({addedNodes:e,removedNodes:t}){I("contentMutated"),c.applySelectors(),rt(),Et(),$(),Oo(t),po(e)}function Ro(e){So(e),A(o.MUTATION_OBSERVER,"Mutation Observed")}const W="Overflow",To=ne(W),bo=ne(W,!1),wo=ut(W),vo=gt(W),yo=e=>e instanceof HTMLElement&&(!!e.hidden||e.offsetParent===null||e.style.display===o.NONE),Ho=(e,t)=>{const n=t.side||o.HEIGHT_EDGE,r={root:t.root,rootMargin:"0px",threshold:1},i=window?.requestAnimationFrame||u.id,g=(w=!1)=>e(w),l=(w,N)=>w===0||w>N[n],m=(w,N)=>{w.toggleAttribute(o.OVERFLOW_ATTR,N)};function S(w){for(const N of w){const{boundingClientRect:D,rootBounds:P,target:v}=N;if(!P)continue;const Rt=D[n],Tt=l(Rt,P)&&!(v instanceof HTMLElement&&yo(v));m(v,Tt)}i(g)}const h=new IntersectionObserver(S,r),T=new WeakSet;function p(w){const N=new Set,D=new Set;let P=0;for(const v of w)if(v instanceof Element){if(T.has(v)){N.add(v);continue}h.observe(v),T.add(v),D.add(v),P+=1}vo(N),wo(D),To(P),D.clear(),N.clear()}return{attachObservers:p,detachObservers:mt(W,h,T,bo),disconnect:()=>{h.disconnect(),f("Detached%c OverflowObserver",s.HIGHLIGHT)}}};function Ao(){const{hasOverflow:e}=c,{hasOverflowUpdated:t,overflowedNodeSet:n}=Et();switch(!0){case!t:return;case n.size>1:f("Overflowed Elements:",n);break;case e:break;default:f("No overflow detected")}A(o.OVERFLOW_OBSERVER,"Overflow updated")}function No(e){const t={root:document.documentElement,side:a.calculateHeight?o.HEIGHT_EDGE:o.WIDTH_EDGE};return H.overflow=Ho(Ao,t),H.overflow.attachObservers(e),H.overflow}const q="Resize",Mo=ne(q),Lo=ne(q,!1),Go=ut(q),zo=gt(q),te=new WeakSet,ie=new Set,ce=new Set;let U;function $o(e){let t=0;for(const n of e){if(!(n instanceof Element))continue;const r=getComputedStyle(n)?.position;if(!(r===""||r==="static")){if(te.has(n)){ie.add(n);continue}U.observe(n),te.add(n),ce.add(n),t+=1}}zo(ie),Go(ce),Mo(t),ce.clear(),ie.clear()}const _o=e=>(U=new ResizeObserver(e),U.observe(document.body),te.add(document.body),f("Attached%c ResizeObserver%c to body",s.HIGHLIGHT,s.FOREGROUND),{attachObserverToNonStaticElements:$o,detachObservers:mt(q,U,te,Lo),disconnect:()=>{U.disconnect(),f("Detached%c ResizeObserver",s.HIGHLIGHT)}});function ko(e){if(!Array.isArray(e)||e.length===0)return;const t=e[0].target;A(o.RESIZE_OBSERVER,`Element resized <${u.getElementName(t)}>`)}function Co(e){return H.resize=_o(ko),H.resize.attachObserverToNonStaticElements(e),H.resize}let Ve;function Do(){const e=document.title;e!==Ve&&(Ve=e,d(`Title: %c${e}`,s.HIGHLIGHT),e&&R(0,0,o.TITLE,e))}function Po(e){d(`Visible: %c${e}`,s.HIGHLIGHT),c.isHidden=!e,A(o.VISIBILITY_OBSERVER,"Visibility changed")}function Bo(e){Ie.push(...e.map(t=>t.disconnect))}function Fo(){I("attachObservers");const e=Oe(document.documentElement),t=[go(Ro),No(e),bn(),Co(e),ho(Do),Eo(Po)];Bo(t)}const We=(e,t,n)=>{if(n!==""){d(`${e}: %c${n}`,s.HIGHLIGHT);for(const r of document.querySelectorAll(n))d(`Applying ${t} to:`,r),r.toggleAttribute(t,!0)}};function Uo({sizeSelector:e,ignoreSelector:t}){return()=>{We("sizeSelector",o.SIZE_ATTR,e),We("ignoreSelector",o.IGNORE_ATTR,t)}}function xo(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Vo(e,t){return t.includes("-")&&(C(`Negative CSS value ignored for ${e}`),t=""),t}function ge(e,t){t===void 0||t===""||t===o.NULL||(document.body.style.setProperty(e,t),f(`Set body ${e}: %c${t}`,s.HIGHLIGHT))}function Wo({bodyMarginStr:e,bodyMargin:t}){e===void 0&&(e=`${t}px`),ge("margin",Vo("margin",e))}const qo=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function Zo(e){const t=e.getBoundingClientRect(),n=qo();return{x:Math.round(t.left+n.x),y:Math.round(t.top+n.y)}}function Yo(e,t){const n=Zo(t);d(`Moving to in page link (%c#${e}%c) at x: %c${n.x}%c y: %c${n.y}`,s.HIGHLIGHT,s.FOREGROUND,s.HIGHLIGHT,s.FOREGROUND,s.HIGHLIGHT),R(n.y,n.x,o.SCROLL_TO_OFFSET)}function ve(e){const t=e.split("#")[1]||e,n=decodeURIComponent(t),r=document.getElementById(n)||document.getElementsByName(n)[0];if(r!==void 0){Yo(t,r);return}d(`In page link (#${t}) not found in iframe, so sending to parent`),R(0,0,o.IN_PAGE_LINK,`#${t}`)}function pt(){const{hash:e,href:t}=window.location;e!==""&&e!=="#"&&ve(t)}function jo(){for(const e of document.querySelectorAll('a[href^="#"]'))e.getAttribute("href")!=="#"&&G(e,"click",t=>{t.preventDefault(),ve(e.getAttribute("href"))})}function Qo(){G(window,"hashchange",pt)}function Ko(){setTimeout(pt,o.EVENT_CANCEL_TIMER)}function Jo(){d("Setting up location.hash handlers"),jo(),Qo(),Ko(),c.inPageLinks={findTarget:ve}}function Xo(e){const{mode:t}=a;e?E.checkMode(t)?b(E.getModeData(5)):Jo():d("In page linking not enabled")}const er="important";function tr(){const e=t=>t.style.setProperty(o.HEIGHT,o.AUTO,er);e(document.documentElement),e(document.body),d("Set HTML & body height: %cauto !important",s.HIGHLIGHT)}const ye=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},ae=ye(o.FUNCTION),qe=ye(o.NUMBER),Y=ye(o.STRING),nr=e=>e!==null&&typeof e===o.OBJECT&&!Array.isArray(e);function or(e){const{calculateHeight:t,calculateWidth:n}=a;let r,i;return typeof e?.offsetSize===o.NUMBER&&(t&&(r=qe(e,o.OFFSET_SIZE)),n&&(i=qe(e,o.OFFSET_SIZE))),{offsetHeight:r,offsetWidth:i}}function rr(e){d("Reading data from page:",Object.keys(e));const{offsetHeight:t,offsetWidth:n}=or(e);return{offsetHeight:t,offsetWidth:n,ignoreSelector:Y(e,"ignoreSelector"),[E.getKey(3)]:Y(e,E.getKey(0)),sizeSelector:Y(e,"sizeSelector"),targetOrigin:Y(e,"targetOrigin"),onBeforeResize:ae(e,"onBeforeResize"),onMessage:ae(e,"onMessage"),onReady:ae(e,"onReady")}}function sr(){const{mode:e}=a;if(E.checkMode(e))return{};const t=window.iframeResizer||window.iFrameResizer;return nr(t)?rr(t):{}}const ir=e=>e==="true",Ot=e=>t=>t===void 0?void 0:e(t),z=Ot(ir),F=Ot(Number),cr=e=>({parentId:e[0],bodyMargin:F(e[1]),calculateWidth:z(e[2]),logging:z(e[3]),autoResize:z(e[6]),bodyMarginStr:e[7],bodyBackground:e[9],bodyPadding:e[10],tolerance:F(e[11]),inPageLinks:z(e[12]),mouseEvents:z(e[15]),offsetHeight:F(e[16]),offsetWidth:F(e[17]),calculateHeight:z(e[18]),key:e[19],version:e[20],mode:F(e[21]),logExpand:z(e[23])});function ar(e){const{mode:t}=a;e.forEach(n=>{try{n()}catch(r){if(t<0)throw r;b(`<rb>Error in setup function</>
22
+ To improve performance add the <b>data-iframe-size</> attribute to the ${j.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},gn)}function pn(e){e.getEntries().forEach(t=>{if(t.name===K)try{const{duration:o}=performance.measure(st,Ee,K);j=t.detail,I.push(o),I.length>En&&I.shift()}catch{}})}function On(){f("Attached%c PerformanceObserver%c to page",s.HIGHLIGHT,s.FOREGROUND);const e=new PerformanceObserver(pn);return e.observe({entryTypes:["mark"]}),In(),{disconnect:()=>{it(),clearInterval(ce),e.disconnect(),f("Detached%c PerformanceObserver",s.HIGHLIGHT)}}}const Sn=e=>`:not(${e})`,Rn=`* ${Array.from(n.IGNORE_TAGS).map(Sn).join("")}`,Ie=e=>e.querySelectorAll(Rn);function Tn(){const{hasOverflow:e,hasTags:t,overflowedNodeSet:o,taggedElements:r}=c;return t?r:e?Array.from(o):Ie(document.documentElement)}function bn(e,t){const o=`margin-${t}`;let r,i=document.documentElement,u=c.hasTags?n.MIN_SIZE:document.documentElement.getBoundingClientRect().bottom;for(const l of e)r=l.getBoundingClientRect()[t]+parseFloat(getComputedStyle(l).getPropertyValue(o)),r>u&&(u=r,i=l);return{maxEl:i,maxVal:u}}function ct(e){performance.mark(Ee);const t=n.capitalizeFirstLetter(e),{logging:o}=a,{hasTags:r}=c,i=Tn(),{maxEl:u,maxVal:l}=bn(i,e);return f(`${t} position calculated from:`,u),f(`Checked %c${i.length}%c elements`,s.HIGHLIGHT,s.FOREGROUND),performance.mark(K,{detail:{hasTags:r,len:i.length,logging:o,Side:t}}),l}const pe={label:n.HEIGHT,enabled:()=>a.calculateHeight,getOffset:()=>a.offsetHeight,auto:()=>rt(pe),boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),documentElementScroll:()=>document.documentElement.scrollHeight,taggedElement:()=>ct(n.HEIGHT_EDGE)},Oe={label:n.WIDTH,enabled:()=>a.calculateWidth,getOffset:()=>a.offsetWidth,auto:()=>rt(Oe),boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),documentElementScroll:()=>document.documentElement.scrollWidth,taggedElement:()=>ct(n.WIDTH_EDGE)};function wn(e,t,o){const r=a.onBeforeResize(e,t,o);if(r===void 0)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(r))throw new TypeError(`Invalid value returned from onBeforeResize(): ${r}, expected Number`);if(r<n.MIN_SIZE)throw new RangeError(`Out of range value returned from onBeforeResize(): ${r}, must be at least ${n.MIN_SIZE}`);return r}const at=(e,t)=>(o,r)=>{const i=e[o]();return e.enabled()&&a.onBeforeResize!==void 0?wn(i,r,t):i},vn=at(pe,n.HEIGHT),yn=at(Oe,n.WIDTH);function Hn(){(window.scrollY!==0||window.scrollX!==0)&&(f("Reset iframe scroll position to (0, 0)"),window.scrollTo(0,0))}function An(e,t,o,r){const{heightCalcMode:i,widthCalcMode:u}=a;Hn();const l=o??vn(i,e),g=r??yn(u,e),p=dn(l,g)?n.SIZE_CHANGE_DETECTED:e;switch(d(`Resize event: %c${t}`,s.HIGHLIGHT),p){case n.INIT:case n.ENABLE:case n.SIZE_CHANGE_DETECTED:case n.MANUAL_RESIZE_REQUEST:case n.PARENT_RESIZE_REQUEST:c.height=l,c.width=g;case n.SET_OFFSET_SIZE:return c;case n.OVERFLOW_OBSERVER:case n.MUTATION_OBSERVER:case n.RESIZE_OBSERVER:case n.VISIBILITY_OBSERVER:{d(n.NO_CHANGE);break}default:f(n.NO_CHANGE)}return null}let W=!1,ne=!1,D=null;function Mn(e,t,o,r,i){const{autoResize:u}=a,{isHidden:l}=c;switch(h(e),!0){case(l===!0&&!(e in n.IGNORE_DISABLE_RESIZE)):{if(ne===!0)break;d("Iframe hidden - Ignored resize request"),ne=!0,W=!1,cancelAnimationFrame(D),D=null;break}case(W===!0&&e!==n.OVERFLOW_OBSERVER&&!(e in n.IGNORE_DISABLE_RESIZE)):{d("Resize already pending - Ignored resize request");break}case(!u&&!(e in n.IGNORE_DISABLE_RESIZE)):{f("Resizing disabled");break}default:{ne=!1,W=!0,c.totalTime=performance.now(),c.timerActive=!0;const g=An(e,t,o,r);g&&ot(g.height,g.width,e,i),D||(D=requestAnimationFrame(()=>{W=!1,D=null,h("requestAnimationFrame"),Q(`Reset sendPending: %c${e}`,s.HIGHLIGHT)})),c.timerActive=!1}}G()}const y=ge(Mn);function De({eventType:e,eventName:t}){N(window,t,()=>y(t,e),{passive:!0})}function Nn(){De({eventType:"After Print",eventName:"afterprint"}),De({eventType:"Before Print",eventName:"beforeprint"})}function Ln(){if(c.triggerLocked){d("TriggerLock blocked calculation");return}c.triggerLocked=!0,Q("Trigger event lock on"),requestAnimationFrame(()=>{c.triggerLocked=!1,Q("Trigger event lock off")})}function dt(e){const{heightCalcMode:t,widthCalcMode:o}=a,r=pe[t](),i=Oe[o]();d(`Reset trigger event: %c${e}`,s.HIGHLIGHT),O(r,i,e)}function Gn(e){const t=a.heightCalcMode;d(`Reset trigger event: %c${e}`,s.HIGHLIGHT),a.heightCalcMode=n.HEIGHT_CALC_MODE_DEFAULT,Ln(),dt("reset"),a.heightCalcMode=t}const zn=`Auto Resize can not be changed when <b>direction</> is set to '${n.NONE}'.`;function $n(e){n.typeAssert(e,n.BOOLEAN,"parentIframe.autoResize(enable) enable");const{autoResize:t,calculateHeight:o,calculateWidth:r}=a;return r===!1&&o===!1?(h(n.ENABLE),R(zn),!1):(e===!0&&t===!1?(a.autoResize=!0,queueMicrotask(()=>y(n.ENABLE,"Auto Resize enabled"))):e===!1&&t===!0&&(a.autoResize=!1),O(0,0,n.AUTO_RESIZE,JSON.stringify(a.autoResize)),a.autoResize)}function _n(e){n.typeAssert(e,n.STRING,"parentIframe.moveToAnchor(anchor) anchor"),c.inPageLinks.findTarget(e)}function kn(e){n.typeAssert(e,n.NUMBER,"parentIframe.setOffsetSize(offset) offset"),a.offsetHeight=e,a.offsetWidth=e,y(n.SET_OFFSET_SIZE,`parentIframe.setOffsetSize(${e})`)}const Cn=()=>c.origin;function Dn(e){n.typeAssert(e,n.STRING,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),d(`Set targetOrigin: %c${e}`,s.HIGHLIGHT),a.targetOrigin=e}function Pn(e){return n.typeAssert(e,n.FUNCTION,"parentIframe.getParentProps(callback) callback"),c.onParentInfo=e,O(0,0,n.PARENT_INFO),()=>{c.onParentInfo=null,O(0,0,n.PARENT_INFO_STOP)}}function Bn(e,t){e!==void 0&&n.typeAssert(e,n.NUMBER,"parentIframe.resize(customHeight, customWidth) customHeight"),t!==void 0&&n.typeAssert(t,n.NUMBER,"parentIframe.resize(customHeight, customWidth) customWidth");const o=e===void 0?"":e,r=t===void 0?"":`,${t}`,i=`${o}${r}`;y(n.MANUAL_RESIZE_REQUEST,`parentIframe.resize(${i})`,e,t)}const Se=e=>(t,o)=>{n.typeAssert(t,n.NUMBER,`parentIframe.${e}(x, y) x`),n.typeAssert(o,n.NUMBER,`parentIframe.${e}(x, y) y`),O(o,t,e)},Fn=Se(n.SCROLL_BY),Un=Se(n.SCROLL_TO),xn=Se(n.SCROLL_TO_OFFSET);function Vn(e,t){t&&n.typeAssert(t,n.STRING,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),O(0,0,n.MESSAGE,JSON.stringify(e),t)}const Wn=()=>O(0,0,n.CLOSE),Zn=()=>a.parentId,qn=()=>Gn("parentIframe.reset");function Yn(){const{win:e}=c;a.mode!==1&&(e.parentIframe=Object.freeze({autoResize:$n,close:Wn,getId:Zn,getParentOrigin:Cn,getParentProps:Pn,moveToAnchor:_n,reset:qn,setOffsetSize:kn,scrollBy:Fn,scrollTo:Un,scrollToOffset:xn,sendMessage:Vn,setTargetOrigin:Dn,resize:Bn}))}const U=(e="")=>t=>o=>{o.size>0&&Q(`${t}Observer ${e}:`,...Array.from(o).flatMap(r=>[n.NEW_LINE,r]))},jn=(e="")=>t=>o=>{o.size>0&&je(`${t}Observer ${e}:`,...Array.from(o).flatMap(r=>[n.NEW_LINE,r]))},lt=U("attached to"),ft=jn("already attached"),Qn=U("detached from"),ee=(e,t=!0)=>o=>{o>0&&f(`${t?"At":"De"}tached %c${e}Observer%c ${t?"to":"from"} %c${o}%c element${o===1?"":"s"}`,s.HIGHLIGHT,s.NORMAL,s.HIGHLIGHT,s.NORMAL)},ut=(e,t,o,r)=>{const i=Qn(e);return u=>{const l=new Set;let g=0;for(const p of u)o.has(p)&&(t.unobserve(p),o.delete(p),l.add(p),g+=1);i(l),r(g),l.clear()}},Pe=16,Be=2,Kn=200,Re="Mutation",w=new Set,M=new Set,ae=new Set,J=[],Jn={attributes:!0,attributeFilter:[n.IGNORE_ATTR,n.SIZE_ATTR],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let oe=1,Te,de=!1,le=0;const Xn=U("added")(Re),eo=U("removed (page)")(Re),to=U("removed (added)")(Re),gt=e=>e.nodeType!==Node.ELEMENT_NODE||n.IGNORE_TAGS.has(e.tagName.toLowerCase());function no(e){const t=e.addedNodes;for(const o of t)gt(o)||w.add(o)}function oo(e){const t=e.removedNodes;for(const o of t)gt(o)||(w.has(o)?(w.delete(o),ae.add(o)):M.add(o))}const ro=e=>{f("Mutations:",e);for(const t of e)no(t),oo(t);Xn(w),eo(M),to(ae),ae.clear()};function so(){M.size>0&&d(`Detected %c${M.size} %cremoved element${M.size>1?"s":""}`,s.HIGHLIGHT,s.FOREGROUND),w.size>0&&d(`Found %c${w.size} %cnew element${w.size>1?"s":""}`,s.HIGHLIGHT,s.FOREGROUND)}const io=e=>()=>{const t=performance.now(),o=t-le,r=Pe*oe+++Be;if(o>r&&o<Kn){h("mutationThrottled"),f("Update delayed due to heavy workload on the callStack"),f(`EventLoop busy time: %c${n.round(o)}ms %c> Max wait: %c${r-Be}ms`,s.HIGHLIGHT,s.FOREGROUND,s.HIGHLIGHT),setTimeout(Te,Pe*oe),le=t;return}oe=1,J.forEach(ro),J.length=0,de=!1,so(),e({addedNodes:w,removedNodes:M}),w.clear(),M.clear()};function co(e){J.push(e),!de&&(le=performance.now(),de=!0,requestAnimationFrame(Te))}function ao(e){const t=new window.MutationObserver(co),o=document.body||document.documentElement;return Te=io(e),t.observe(o,Jn),f("Attached%c MutationObserver%c to body",s.HIGHLIGHT,s.FOREGROUND),{disconnect:()=>{w.clear(),M.clear(),J.length=0,t.disconnect(),f("Detached%c MutationObserver",s.HIGHLIGHT)}}}const lo={characterData:!0,childList:!0,subtree:!0};function fo(e){const t=document.querySelector("title")??document.head??document.documentElement,o=new MutationObserver(e);return o.observe(t,lo),f("Attached%c TitleObserver%c to head",s.HIGHLIGHT,s.FOREGROUND),setTimeout(e),{disconnect:()=>{o.disconnect(),f("Detached%c TitleObserver",s.HIGHLIGHT)}}}function uo(e){const t=new IntersectionObserver(r=>e(r.at(-1)?.isIntersecting??!1),{threshold:0}),o=document.documentElement;return t.observe(o),f("Attached%c VisibilityObserver%c to page",s.HIGHLIGHT,s.FOREGROUND),{disconnect:()=>{t.disconnect(),f("Detached%c VisibilityObserver",s.HIGHLIGHT)}}}let Fe=new Set;function go(e){const t=new Set,o=new Set;for(const r of e)r.closest(`[${n.IGNORE_ATTR}]`)?o.add(r):t.add(r);return o.size>0&&queueMicrotask(()=>{h("overflowIgnored"),f(`Ignoring elements with [data-iframe-ignore] > *:
23
+ `,o),G()}),t}function mt(){const e=document.querySelectorAll(`[${n.OVERFLOW_ATTR}]`),t=go(e);let o=!0;return typeof Set.prototype.symmetricDifference===n.FUNCTION&&(o=t.symmetricDifference(Fe).size>0),Fe=t,c.overflowedNodeSet=t,c.hasOverflow=t.size>0,{hasOverflowUpdated:o,overflowedNodeSet:t}}const v={},ht=e=>{const t=new Set;for(const o of e)if(o instanceof Element){t.add(o);for(const r of Ie(o))t.add(r)}return f(`Inspecting:
24
+ `,t),t},mo=e=>{if(e.size===0)return;h("addObservers");const t=ht(e);v.overflow.attachObservers(t),v.resize.attachObserverToNonStaticElements(t),G()},ho=e=>{if(e.size===0)return;h("removeObservers");const t=ht(e);v.overflow.detachObservers(t),v.resize.detachObservers(t),G()};function Eo({addedNodes:e,removedNodes:t}){h("contentMutated"),c.applySelectors(),nt(),mt(),G(),ho(t),mo(e)}function Io(e){Eo(e),y(n.MUTATION_OBSERVER,"Mutation Observed")}const x="Overflow",po=ee(x),Oo=ee(x,!1),So=lt(x),Ro=ft(x),To=e=>e instanceof HTMLElement&&(!!e.hidden||e.offsetParent===null||e.style.display===n.NONE),bo=(e,t)=>{const o=t.side||n.HEIGHT_EDGE,r={root:t.root,rootMargin:"0px",threshold:1},i=window?.requestAnimationFrame||n.id,u=(T=!1)=>e(T),l=(T,H)=>T===0||T>H[o],g=(T,H)=>{T.toggleAttribute(n.OVERFLOW_ATTR,H)};function p(T){for(const H of T){const{boundingClientRect:k,rootBounds:C,target:b}=H;if(!C)continue;const Ot=k[o],St=l(Ot,C)&&!(b instanceof HTMLElement&&To(b));g(b,St)}i(u)}const m=new IntersectionObserver(p,r),S=new WeakSet;function E(T){const H=new Set,k=new Set;let C=0;for(const b of T)if(b instanceof Element){if(S.has(b)){H.add(b);continue}m.observe(b),S.add(b),k.add(b),C+=1}Ro(H),So(k),po(C),k.clear(),H.clear()}return{attachObservers:E,detachObservers:ut(x,m,S,Oo),disconnect:()=>{m.disconnect(),f("Detached%c OverflowObserver",s.HIGHLIGHT)}}};function wo(){const{hasOverflow:e}=c,{hasOverflowUpdated:t,overflowedNodeSet:o}=mt();switch(!0){case!t:return;case o.size>1:f("Overflowed Elements:",o);break;case e:break;default:f("No overflow detected")}y(n.OVERFLOW_OBSERVER,"Overflow updated")}function vo(e){const t={root:document.documentElement,side:a.calculateHeight?n.HEIGHT_EDGE:n.WIDTH_EDGE};return v.overflow=bo(wo,t),v.overflow.attachObservers(e),v.overflow}const V="Resize",yo=ee(V),Ho=ee(V,!1),Ao=lt(V),Mo=ft(V),X=new WeakSet,re=new Set,se=new Set;let B;function No(e){let t=0;for(const o of e){if(!(o instanceof Element))continue;const r=getComputedStyle(o)?.position;if(!(r===""||r==="static")){if(X.has(o)){re.add(o);continue}B.observe(o),X.add(o),se.add(o),t+=1}}Mo(re),Ao(se),yo(t),se.clear(),re.clear()}const Lo=e=>(B=new ResizeObserver(e),B.observe(document.body),X.add(document.body),f("Attached%c ResizeObserver%c to body",s.HIGHLIGHT,s.FOREGROUND),{attachObserverToNonStaticElements:No,detachObservers:ut(V,B,X,Ho),disconnect:()=>{B.disconnect(),f("Detached%c ResizeObserver",s.HIGHLIGHT)}});function Go(e){if(!Array.isArray(e)||e.length===0)return;const t=e[0].target;y(n.RESIZE_OBSERVER,`Element resized <${n.getElementName(t)}>`)}function zo(e){return v.resize=Lo(Go),v.resize.attachObserverToNonStaticElements(e),v.resize}let Ue;function $o(){const e=document.title;e!==Ue&&(Ue=e,d(`Title: %c${e}`,s.HIGHLIGHT),e&&O(0,0,n.TITLE,e))}function _o(e){d(`Visible: %c${e}`,s.HIGHLIGHT),c.isHidden=!e,y(n.VISIBILITY_OBSERVER,"Visibility changed")}function ko(e){he.push(...e.map(t=>t.disconnect))}function Co(){h("attachObservers");const e=Ie(document.documentElement),t=[ao(Io),vo(e),On(),zo(e),fo($o),uo(_o)];ko(t)}const xe=(e,t,o)=>{if(o!==""){d(`${e}: %c${o}`,s.HIGHLIGHT);for(const r of document.querySelectorAll(o))d(`Applying ${t} to:`,r),r.toggleAttribute(t,!0)}};function Do({sizeSelector:e,ignoreSelector:t}){return()=>{xe("sizeSelector",n.SIZE_ATTR,e),xe("ignoreSelector",n.IGNORE_ATTR,t)}}function Po(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Bo(e,t){return t.includes("-")&&(_(`Negative CSS value ignored for ${e}`),t=""),t}function fe(e,t){t===void 0||t===""||t===n.NULL||(document.body.style.setProperty(e,t),f(`Set body ${e}: %c${t}`,s.HIGHLIGHT))}function Fo({bodyMarginStr:e,bodyMargin:t}){e===void 0&&(e=`${t}px`),fe("margin",Bo("margin",e))}const Uo=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function xo(e){const t=e.getBoundingClientRect(),o=Uo();return{x:Math.round(t.left+o.x),y:Math.round(t.top+o.y)}}function Vo(e,t){const o=xo(t);d(`Moving to in page link (%c#${e}%c) at x: %c${o.x}%c y: %c${o.y}`,s.HIGHLIGHT,s.FOREGROUND,s.HIGHLIGHT,s.FOREGROUND,s.HIGHLIGHT),O(o.y,o.x,n.SCROLL_TO_OFFSET)}function be(e){const t=e.split("#")[1]||e,o=decodeURIComponent(t),r=document.getElementById(o)||document.getElementsByName(o)[0];if(r!==void 0){Vo(t,r);return}d(`In page link (#${t}) not found in iframe, so sending to parent`),O(0,0,n.IN_PAGE_LINK,`#${t}`)}function Et(){const{hash:e,href:t}=window.location;e!==""&&e!=="#"&&be(t)}function Wo(){for(const e of document.querySelectorAll('a[href^="#"]'))e.getAttribute("href")!=="#"&&N(e,"click",t=>{t.preventDefault(),be(e.getAttribute("href"))})}function Zo(){N(window,"hashchange",Et)}function qo(){setTimeout(Et,n.EVENT_CANCEL_TIMER)}function Yo(){d("Setting up location.hash handlers"),Wo(),Zo(),qo(),c.inPageLinks={findTarget:be}}function jo(e){const{mode:t}=a;e?n.checkMode(t)?R(n.getModeData(5)):Yo():d("In page linking not enabled")}const Qo="important";function Ko(){const e=t=>t.style.setProperty(n.HEIGHT,n.AUTO,Qo);e(document.documentElement),e(document.body),d("Set HTML & body height: %cauto !important",s.HIGHLIGHT)}const we=e=>(t,o)=>{if(o in t){if(typeof t[o]===e)return t[o];throw new TypeError(`${o} is not a ${e}.`)}},ie=we(n.FUNCTION),Ve=we(n.NUMBER),Z=we(n.STRING),Jo=e=>e!==null&&typeof e===n.OBJECT&&!Array.isArray(e);function Xo(e){const{calculateHeight:t,calculateWidth:o}=a;let r,i;return typeof e?.offsetSize===n.NUMBER&&(t&&(r=Ve(e,n.OFFSET_SIZE)),o&&(i=Ve(e,n.OFFSET_SIZE))),{offsetHeight:r,offsetWidth:i}}function er(e){d("Reading data from page:",Object.keys(e));const{offsetHeight:t,offsetWidth:o}=Xo(e);return{offsetHeight:t,offsetWidth:o,ignoreSelector:Z(e,"ignoreSelector"),[n.getKey(3)]:Z(e,n.getKey(0)),sizeSelector:Z(e,"sizeSelector"),targetOrigin:Z(e,"targetOrigin"),onBeforeResize:ie(e,"onBeforeResize"),onMessage:ie(e,"onMessage"),onReady:ie(e,"onReady")}}function tr(){const{mode:e}=a;if(n.checkMode(e))return{};const t=window.iframeResizer||window.iFrameResizer;return Jo(t)?er(t):{}}const nr=e=>e==="true",It=e=>t=>t===void 0?void 0:e(t),L=It(nr),P=It(Number),or=e=>({parentId:e[0],bodyMargin:P(e[1]),calculateWidth:L(e[2]),logging:L(e[3]),autoResize:L(e[6]),bodyMarginStr:e[7],bodyBackground:e[9],bodyPadding:e[10],tolerance:P(e[11]),inPageLinks:L(e[12]),mouseEvents:L(e[15]),offsetHeight:P(e[16]),offsetWidth:P(e[17]),calculateHeight:L(e[18]),key:e[19],version:e[20],mode:P(e[21]),logExpand:L(e[23])});function rr(e){const{mode:t}=a;e.forEach(o=>{try{o()}catch(r){if(t<0)throw r;R(`<rb>Error in setup function</>
25
25
  <i>iframe-resizer</> detected an error during setup.
26
26
 
27
- Please report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>`),Ke(r)}})}function Ze(e){for(const[t,n]of Object.entries(e))n!==void 0&&(a[t]=n)}function dr({logExpand:e,logging:t,parentId:n=""}){yt({id:n,enabled:t,expand:e}),I("initReceived"),d(`Initialising iframe v${o.VERSION} ${window.location.href}`)}function lr(e){I("ready"),ot(u.once(e)),d("Initialization complete",(({key:t,key2:n,...r})=>r)(a))}function fr({bodyBackground:e,bodyPadding:t,inPageLinks:n,onReady:r}){const i=xt(a),g=[qt,Vt,Kt,rt,Xt,i?u.id:Ut,()=>Wo(a),()=>ge("background",e),()=>ge("padding",t),i?u.id:tr,xo,c.applySelectors,()=>Xo(n),$n,()=>dn(a),un,()=>Jn(),()=>A(o.INIT,"Init message from host page",void 0,void 0,`${o.VERSION}:${a.mode}`),Fo,$];nn(a),Yt(a),ar(g),lr(r)}function ur(e){c.firstRun&&(Ze(cr(e)),dr(a),Ze(sr()),c.applySelectors=Uo(a),fr(a))}function gr(e){if(document.readyState==="loading"){d("Page not ready, ignoring init message");return}const t=e.data.slice(o.MESSAGE_ID_LENGTH).split(o.SEPARATOR);c.target=e.source,c.origin=e.origin,ur(t),c.firstRun=!1,setTimeout(()=>{c.initLock=!1},o.EVENT_CANCEL_TIMER)}const{freeze:mr}=Object,{parse:He}=JSON,Ae=e=>mr(He(e)),St=e=>R(0,0,`${e}Stop`),oe=e=>e.data.slice(e.data.indexOf(o.SEPARATOR)+1),hr=e=>Gt(e)?o.INIT:e.data.split("]")[1].split(o.SEPARATOR)[0];function Er(e){const t=oe(e);d("onMessage called from parent:%c",s.HIGHLIGHT,Ae(t)),u.isolateUserCode(a.onMessage,He(t))}function Ir(e){const{onPageInfo:t}=c,n=oe(e);d("PageInfo received from parent:",Ae(n)),t?u.isolateUserCode(t,He(n)):St(o.PAGE_INFO)}function pr(e){const{onParentInfo:t}=c,n=Ae(oe(e));d("ParentInfo received from parent:",n),t?u.isolateUserCode(t,n):St(o.PARENT_INFO)}function Or(){if(c.initLock){d("Page reset ignored by init");return}d("Page size reset by host page"),ft("resetPage")}function Sr(){d("Resize requested by host page"),A(o.PARENT_RESIZE_REQUEST,"Parent window requested size check")}const Ye=e=>c.inPageLinks.findTarget(oe(e)),je={init:gr,reset:Or,resize:Sr,moveToAnchor:Ye,inPageLink:Ye,pageInfo:Ir,parentInfo:pr,message:Er};function Rr(e){const{firstRun:t}=c,n=hr(e);switch(I(n),!0){case n in je:je[n](e);break;case(t&&Lt()):C(`Ignored message of type "${n}". Received before initialization.`);break;default:C(`Unexpected message (${e.data}), this is likely due to a newer version of iframe-resizer running on the parent page.`)}}const j=he(e=>{Mt(e)&&Rr(e)});function Tr(){if("iframeChildListener"in window){C("Already setup");return}window.iframeChildListener=(t=>{setTimeout(()=>j({data:t,sameOrigin:!0}))}),I("listen"),G(window,o.MESSAGE,j),G(document,o.READY_STATE_CHANGE,Ge),Ge();function e(t){return j(t),c.win}try{top?.document?.getElementById("banner")&&(c.win={},window.mockMsgListener=e,et(window,o.MESSAGE,j),typeof window.define=="function"&&window.define([],()=>e))}catch{}}typeof window!==o.UNDEFINED&&Tr();
27
+ Please report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>`),je(r)}})}function We(e){for(const[t,o]of Object.entries(e))o!==void 0&&(a[t]=o)}function sr({logExpand:e,logging:t,parentId:o=""}){Tt({id:o,enabled:t,expand:e}),h("initReceived"),d(`Initialising iframe v${n.VERSION} ${window.location.href}`)}function ir(e){h("ready"),tt(n.once(e)),d("Initialization complete",(({key:t,key2:o,...r})=>r)(a))}function cr({bodyBackground:e,bodyPadding:t,inPageLinks:o,onReady:r}){const i=Pt(a),u=[Ut,Bt,qt,nt,jt,i?n.id:Dt,()=>Fo(a),()=>fe("background",e),()=>fe("padding",t),i?n.id:Ko,Po,c.applySelectors,()=>jo(o),Nn,()=>rn(a),an,()=>Yn(),()=>y(n.INIT,"Init message from host page",void 0,void 0,`${n.VERSION}:${a.mode}`),Co,G];Jt(a),Vt(a),rr(u),ir(r)}function ar(e){c.firstRun&&(We(or(e)),sr(a),We(tr()),c.applySelectors=Do(a),cr(a))}function dr(e){if(document.readyState==="loading"){d("Page not ready, ignoring init message");return}const t=e.data.slice(n.MESSAGE_ID_LENGTH).split(n.SEPARATOR);c.target=e.source,c.origin=e.origin,ar(t),c.firstRun=!1,setTimeout(()=>{c.initLock=!1},n.EVENT_CANCEL_TIMER)}const{freeze:lr}=Object,{parse:ve}=JSON,ye=e=>lr(ve(e)),pt=e=>O(0,0,`${e}Stop`),te=e=>e.data.slice(e.data.indexOf(n.SEPARATOR)+1),fr=e=>At(e)?n.INIT:e.data.split("]")[1].split(n.SEPARATOR)[0];function ur(e){const t=te(e);d("onMessage called from parent:%c",s.HIGHLIGHT,ye(t)),n.isolateUserCode(a.onMessage,ve(t))}function gr(e){const{onPageInfo:t}=c,o=te(e);d("PageInfo received from parent:",ye(o)),t?n.isolateUserCode(t,ve(o)):pt(n.PAGE_INFO)}function mr(e){const{onParentInfo:t}=c,o=ye(te(e));d("ParentInfo received from parent:",o),t?n.isolateUserCode(t,o):pt(n.PARENT_INFO)}function hr(){if(c.initLock){d("Page reset ignored by init");return}d("Page size reset by host page"),dt("resetPage")}function Er(){d("Resize requested by host page"),y(n.PARENT_RESIZE_REQUEST,"Parent window requested size check")}const Ze=e=>c.inPageLinks.findTarget(te(e)),qe={init:dr,reset:hr,resize:Er,moveToAnchor:Ze,inPageLink:Ze,pageInfo:gr,parentInfo:mr,message:ur};function Ir(e){const{firstRun:t}=c,o=fr(e);switch(h(o),!0){case o in qe:qe[o](e);break;case(t&&Ht()):_(`Ignored message of type "${o}". Received before initialization.`);break;default:_(`Unexpected message (${e.data}), this is likely due to a newer version of iframe-resizer running on the parent page.`)}}const q=ge(e=>{yt(e)&&Ir(e)});function pr(){if("iframeChildListener"in window){_("Already setup");return}window.iframeChildListener=(t=>{setTimeout(()=>q({data:t,sameOrigin:!0}))}),h("listen"),N(window,n.MESSAGE,q),N(document,n.READY_STATE_CHANGE,Ne),Ne();function e(t){return q(t),c.win}try{top?.document?.getElementById("banner")&&(c.win={},window.mockMsgListener=e,Je(window,n.MESSAGE,q),typeof window.define=="function"&&window.define([],()=>e))}catch{}}typeof window!==n.UNDEFINED&&pr();
28
28
  //# sourceMappingURL=index.cjs.js.map