UNPKG

@iframe-resizer/core

Version:

Keep iframes sized to their content.

21 lines (18 loc) 18.9 kB
/*! * @preserve * * @module iframe-resizer/core 5.4.5 (umd) - 2025-04-16 * * @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(require("auto-console-group")):"function"==typeof define&&define.amd?define(["auto-console-group"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).createResizer=t(e.acg)}(this,(function(e){"use strict";const t="5.4.5",i="[iFrameSizer]",n=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),o="onload",r="init",s=Object.freeze({[o]:1,[r]:1}),a="expanded",l="collapsed",c=Object.freeze({[a]:1,[l]:1}),u=(e,t,i,n)=>e.addEventListener(t,i,n||!1),d=(e,t,i)=>e.removeEventListener(t,i,!1),f=e=>{if(!e)return"";let t=-559038744,i=1103547984;for(let n,o=0;o<e.length;o++)n=e.codePointAt(o),t=Math.imul(t^n,2246822519),i=Math.imul(i^n,3266489917);return t^=Math.imul(t^i>>>15,1935289751),i^=Math.imul(i^t>>>15,3405138345),t^=i>>>16,i^=t>>>16,(2097152*(i>>>0)+(t>>>11)).toString(36)},p=e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),h=["<iy><yi>Puchspk Spjluzl Rlf</><iy><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."],m=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],g=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),y=e=>p(h[e]),b=e=>{const t=e[p("spjluzl")];if(!t)return-1;const i=t.split("-");let n=function(e=""){let t=-2;const i=f(p(e));return i in g&&(t=g[i]),t}(i[0]);return 0===n||(e=>e[2]===f(e[0]+e[1]))(i)||(n=-2),n},v=e=>e,w=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),z=(j=e,j?.__esModule?j.default:j);var j;let T={},$=!1;const I=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const k=e=>(t,...i)=>T[t]?.console[e](...i);var H;const x=(H="log",(e,...t)=>!0===(e=>T[e]?T[e].log:$)(e)?k(H)(e,...t):null),O=k("warn"),R=k("error"),M=k("event"),L=k("purge"),S=k("errorBoundary");const E=(e,...t)=>T[e]?T[e].console.warn(w(v)(...t)):queueMicrotask((()=>console?.warn(w((e=>(...t)=>[`iframeResizer(${e})`,...t].join(" "))(e))(...t)))),W=(e=>(t,i="renamed to")=>(n,o,r="",s="")=>e(s,`<rb>Deprecated ${t}(${n.replace("()","")})</>\n\nThe <b>${n}</> ${t.toLowerCase()} has been ${i} <b>${o}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(E),N=W("Option"),G={},C=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",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",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof G[e.id].onInit&&(N("init()","onReady()","",e.id),G[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),A={position:null,version:t};function F(n){function o(){V(k),J(H),T("onResized",k)}function r(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function s(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const a=e=>I.slice(I.indexOf(":")+7+e);const l=(e,t)=>(i,n)=>{const o={};var r,s;r=function(){Y(`${i} (${e})`,`${e}:${t()}`,n)},o[s=n]||(r(),o[s]=requestAnimationFrame((()=>{o[s]=null})))},c=(e,t)=>()=>{let i=!1;const n=t=>()=>{G[l]?i&&i!==t||(e(t,l),i=t,requestAnimationFrame((()=>{i=!1}))):a()},o=n("scroll"),r=n("resize window");function s(e,t){t(window,"scroll",o),t(window,"resize",r)}function a(){M(l,`stop${t}`),s(0,d),c.disconnect(),f.disconnect(),d(G[l].iframe,"load",a)}const l=H,c=new ResizeObserver(n("pageObserver")),f=new ResizeObserver(n("iframeObserver"));G[l]&&(G[l][`stop${t}`]=a,u(G[l].iframe,"load",a),s(0,u),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),f.observe(G[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},f=e=>()=>{e in G[H]&&(G[H][e](),delete G[H][e])},p=l("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=k.iframe.getBoundingClientRect(),{scrollY:i,scrollX:n,innerHeight:o,innerWidth:r}=window,{clientHeight:s,clientWidth:a}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(s,o||0),clientWidth:Math.max(a,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:i,scrollLeft:n,documentHeight:s,documentWidth:a,windowHeight:o,windowWidth:r})})),h=l("parentInfo",(function(){const{iframe:e}=k,{scrollWidth:t,scrollHeight:i}=document.documentElement,{width:n,height:o,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:i},viewport:{width:n,height:o,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}})})),m=c(p,"PageInfo"),g=c(h,"ParentInfo"),y=f("stopPageInfo"),b=f("stopParentInfo");function v(e){const t=e.getBoundingClientRect();return q(),{x:Number(t.left)+Number(A.position.x),y:Number(t.top)+Number(A.position.y)}}function w(t){const i=t?v(k.iframe):{x:0,y:0};x(H,`Reposition requested (offset x:%c${i.x}%c y:%c${i.y})`,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(k,i),o=window.parentIframe||window.parentIFrame;o?function(e,i){e["scrollTo"+(t?"Offset":"")](i.x,i.y)}(o,n):function(e){A.position=e,z(H)}(n)}function z(e){const{x:t,y:i}=A.position,n=G[e]?.iframe;!1!==T("onScroll",{iframe:n,top:i,left:t,x:t,y:i})?J(e):U()}function j(e){let t={};if(0===k.width&&0===k.height){const e=a(9).split(":");t={x:e[1],y:e[0]}}else t={x:k.width,y:k.height};T(e,{iframe:k.iframe,screenX:Number(t.x),screenY:Number(t.y),type:k.type})}const T=(e,t)=>B(H,e,t);function $(){const{height:i,iframe:n,msg:r,type:s,width:l}=k;switch(G[H]?.firstRun&&G[H]&&(G[H].firstRun=!1),s){case"close":D(n);break;case"message":u=a(6),T("onMessage",{iframe:k.iframe,message:JSON.parse(u)});break;case"mouseenter":j("onMouseEnter");break;case"mouseleave":j("onMouseLeave");break;case"autoResize":G[H].autoResize=JSON.parse(a(9));break;case"scrollBy":!function(){const t=k.width,i=k.height,n=window.parentIframe||window.parentIFrame||window;x(H,`scrollBy: x: %c${t}%c y: %c${i}`,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT),n.scrollBy(t,i)}();break;case"scrollTo":w(!1);break;case"scrollToOffset":w(!0);break;case"pageInfo":m();break;case"parentInfo":g();break;case"pageInfoStop":y();break;case"parentInfoStop":b();break;case"inPageLink":!function(t){const i=t.split("#")[1]||"",n=decodeURIComponent(i);let o=document.getElementById(n)||document.getElementsByName(n)[0];o?function(){const t=v(o);x(H,`Moving to in page link: %c#${i}`,e.HIGHLIGHT),A.position={x:t.x,y:t.y},z(H),window.location.hash=i}():window.top!==window.self&&function(){const e=window.parentIframe||window.parentIFrame;e&&e.moveToAnchor(i)}()}(a(9));break;case"title":!function(t,i){G[i]?.syncTitle&&(G[i].iframe.title=t,x(i,`Set iframe title attribute: %c${t}`,e.HIGHLIGHT))}(r,H);break;case"reset":Z(k);break;case"init":o(),function(e){try{G[e].sameOrigin=!!G[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){G[e].sameOrigin=!1}}(H),(c=r)!==t&&(void 0!==c||E(H,"<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")),Q=!0,T("onReady",n);break;default:if(0===l&&0===i)return void O(H,`Unsupported message received (${s}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===l||0===i)return;if(document.hidden)return;o()}var c,u}let I=n.data,k={},H=null;"[iFrameResizerChild]Ready"!==I?i===`${I}`.slice(0,13)&&I.slice(13).split(":")[0]in G&&(k=function(){const e=I.slice(13).split(":"),t=e[1]?Number(e[1]):0,i=G[e[0]]?.iframe,n=getComputedStyle(i);return{iframe:i,id:e[0],height:t+r(n)+s(n),width:Number(e[2]),type:e[3],msg:e[4]}}(),H=k.id,H?(M(H,k.type),S(H,(function(){!function(e){if(!G[e])throw new Error(`${k.type} No settings for ${e}. Message was: ${I}`)}(H),k.type in{true:1,false:1,undefined:1}||(G[H].loaded=!0,(null!==k.iframe||(O(H,`The iframe (${k.id}) was not found.`),0))&&function(){const{origin:e,sameOrigin:t}=n;if(t)return!0;let i=G[H]?.checkOrigin;if(i&&"null"!=`${e}`&&!(i.constructor===Array?function(){let t=0,n=!1;for(;t<i.length;t++)if(i[t]===e){n=!0;break}return n}():function(){const t=G[H]?.remoteHost;return e===t}()))throw new Error(`Unexpected message received from: ${e} for ${k.iframe.id}. Message was: ${n.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&$())}))()):O("","iframeResizer received messageData without id, message was: ",I)):Object.keys(G).forEach((e=>{G[e].mode>=0&&Y("iFrame requested init",_(e),e)}))}function B(e,t,i){let n=null,o=null;if(G[e]){if(n=G[e][t],"function"!=typeof n)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onClose"===t||"onScroll"===t)try{o=n(i)}catch(i){console.error(i),O(e,`Error in ${t} callback`)}else setTimeout((()=>n(i)))}return o}function P(e){const{id:t}=e;delete G[t],delete e.iframeResizer}function D(e){const{id:t}=e;if(!1!==B(t,"onClose",t)){try{e.parentNode&&e.remove()}catch(e){O(t,e)}B(t,"onClosed",t),P(e)}}function q(e){null===A.position&&(A.position={x:window.scrollX,y:window.scrollY})}function U(){A.position=null}function J(t){null!==A.position&&(window.scrollTo(A.position.x,A.position.y),x(t,`Set page position: %c${A.position.x}%c, %c${A.position.y}`,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT),U())}function Z(e){q(e.id),V(e),Y("reset","reset",e.id)}function V(t){function i(i){const o=`${t[i]}px`;t.iframe.style[i]=o,x(n,`Set ${i}: %c${o}`,e.HIGHLIGHT)}const{id:n}=t,{sizeHeight:o,sizeWidth:r}=G[n];o&&i("height"),r&&i("width")}T=G;const X=e=>e.split(":").filter(((e,t)=>19!==t)).join(":");function Y(t,n,o,r){function a(i){const r=t in s?X(n):n;x(o,i,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT),x(o,`Message data: %c${r}`,e.HIGHLIGHT)}M(o,t),G[o]&&(G[o]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:t,sameOrigin:r,targetOrigin:s}=G[o];if(r)try{return e.contentWindow.iframeChildListener(i+n),void a(`Sending message to iframe %c${o}%c via sameOrigin`)}catch(e){}a(`Sending message to iframe: %c${o}%c targetOrigin: %c${s}`),t.postMessage(i+n,s)}():O(o,`Iframe(${o}) not found`),r&&G[o]?.warningTimeout&&(G[o].msgTimeout=setTimeout((function(){if(void 0===G[o])return;const{iframe:e,loaded:t,loadErrorShown:i,waitForLoad:n}=G[o],{sandbox:r}=e,s="object"==typeof r&&r.length>0;t||i||(G[o].loadErrorShown=!0,E(o,`<rb>No response from iFrame</>\n \nThe iframe (<i>${o}</>) has not responded within ${G[o].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${n?"\nThe <b>waitForLoad</> option is currently set to <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}${!s||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"} \n${!s||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"}This 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`))}),G[o].warningTimeout)))}function _(e){const t=G[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,A.version,t.mode,"",t.logExpand].join(":")}let K=0,Q=!1,ee=!1;function te(){!1===document.hidden&&function(e,t){const i=e=>G[e]?.autoResize&&!G[e]?.firstRun;Object.keys(G).forEach((function(n){i(n)&&Y(e,t,n)}))}("Tab Visible","resize")}const ie=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{u(window,"message",F),u(document,"visibilitychange",te),window.iframeParentListener=e=>setTimeout((()=>F({data:e,sameOrigin:!0})))}));return i=>s=>{function l(){if(G[k]){const{iframe:e}=G[k],t={close:D.bind(null,e),disconnect:P.bind(null,e),removeListeners(){E(k,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:Y.bind(null,"Window resize","resize",k),moveToAnchor(e){((e,t,i)=>{if(typeof e!==t)throw new TypeError(`${i} is not a ${n=t,n.charAt(0).toUpperCase()+n.slice(1)}`);var n})(e,"string","moveToAnchor(anchor) anchor"),Y("Move to anchor",`moveToAnchor:${e}`,k)},sendMessage(e){Y("message",`message:${e=JSON.stringify(e)}`,k)}};e.iframeResizer=t,e.iFrameResizer=t}}function d(e){const{id:t}=s,{mode:i,waitForLoad:a}=G[t];-1!==i&&-2!==i&&(u(s,"load",(function(){Y(o,`${e}:${Q}`,t,!0),function(){const e=G[k]?.firstRun,t=G[k]?.heightCalculationMethod in n;!e&&t&&Z({iframe:s,height:0,width:0,type:"init"})}()})),!1===a&&Y(r,`${e}:${Q}`,t,!0))}function f(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&E(k,'<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>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e):{}}function h(){const{mode:n}=G[k];if(n<0)throw E("Parent",`${y(n+2)}${y(2)}`),L(k),y(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");ee||n>0&&i.vInfoDisable||function(t,i){queueMicrotask((()=>console.info(`%ciframe-resizer ${t}`,$||i<1?"font-weight: bold;":e.NORMAL)))}(`v${t} (${(e=>p(m[e]))(n)})`,n),!ee&&n<1&&E("Parent",y(3)),ee=!0}function g(e){const t=G[e]?.iframe?.title;return""===t||void 0===t}const v=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function w(e){var t,i;G[k]={...G[k],iframe:s,firstRun:!0,remoteHost:s?.src.split("/").slice(0,3).join("/"),...C,...f(e),mouseEvents:v(e),mode:b(e),syncTitle:g(k)},M(k,"setup"),function(){const{direction:e}=G[k];if("horizontal"===e)return G[k].sizeWidth=!0,void(G[k].sizeHeight=!1);if("none"===e)return G[k].sizeWidth=!1,G[k].sizeHeight=!1,void(G[k].autoResize=!1);if("vertical"!==e)throw new TypeError(k,`Direction value of "${e}" is not valid`)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===G[k].direction?G[k].offsetHeight=t:G[k].offsetWidth=t),e?.offset&&E(k,"<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</>."),null===G[k].postMessageTarget&&(G[k].postMessageTarget=s.contentWindow),G[k].targetOrigin=!0===G[k].checkOrigin?""===(i=G[k].remoteHost)||null!==i.match(/^(about:blank|javascript:|file:\/\/)/)?"*":i:"*"}const j=()=>"iframeResizer"in s,k=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=i?.id||C.id+K++;return null!==document.getElementById(e)&&(e+=K++),e}(),s.id=e),e}(s.id);if("object"!=typeof i)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=a,e.logExpand=!t.includes("ifrlog=collapsed"))}(i),function(e,t){const i=Object.hasOwn(t,"log"),n="string"==typeof t.log,o=i?!!n||t.log:C.log;Object.hasOwn(t,"logExpand")||(t.logExpand=i&&n?t.log===a:C.logExpand),function(e){-1===e?.log&&(e.log=!1,e.vInfoDisable=!0)}(t),function({enabled:e,expand:t,iframeId:i}){const n=z({expand:t,label:I(i)});$=e,T[i]||(T[i]={console:n})}({enabled:o,expand:t.logExpand,iframeId:e}),n&&!(t.log in c)&&R(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=o}(k,i),S(k,(function(e){j()?O(k,`Ignored iframe (${k}), already setup.`):(w(e),h(),ie(),function(){switch(s.style.overflow=!1===G[k]?.scrolling?"hidden":"auto",G[k]?.scrolling){case"omit":break;case!0:s.scrolling="yes";break;case!1:s.scrolling="no";break;default:s.scrolling=G[k]?G[k].scrolling:"no"}}(),function(){const{bodyMargin:e}=G[k];"number"!=typeof e&&"0"!==e||(G[k].bodyMargin=`${e}px`)}(),d(_(k)),l())}))(i),s?.iFrameResizer}}));