@iframe-resizer/core 6.0.0-beta.4 → 6.0.0-beta.6
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 +1 -1
- package/index.cjs.js +18 -24
- package/index.cjs.js.map +1 -1
- package/index.esm.js +18 -964
- package/index.esm.js.map +1 -1
- package/index.umd.js +18 -24
- package/index.umd.js.map +1 -1
- package/package.json +2 -2
package/index.umd.js
CHANGED
|
@@ -1,27 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* @preserve
|
|
3
|
+
*
|
|
4
|
+
* @module iframe-resizer/core 6.0.0-beta.6 (esm) - 2026-04-10
|
|
5
|
+
*
|
|
6
|
+
* @license GPL-3.0 For use with GPL compliant sites (fully published front & backend source code)
|
|
7
|
+
* Alternatively for commercial use, you can purchase a license from
|
|
8
|
+
* https://iframe-resizer.com/pricing
|
|
9
|
+
*
|
|
10
|
+
* @description Keep same and cross domain iframes sized to their content
|
|
11
|
+
*
|
|
12
|
+
* @author David J. Bradshaw <info@iframe-resizer.com>
|
|
13
|
+
*
|
|
14
|
+
* @see {@link https://iframe-resizer.com}
|
|
15
|
+
*
|
|
16
|
+
* @copyright (c) 2013 - 2026, David J. Bradshaw. All rights reserved.
|
|
17
|
+
*/
|
|
2
18
|
|
|
3
|
-
Detected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.
|
|
4
19
|
|
|
5
|
-
See <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.
|
|
6
|
-
`);return}u(e,`Version mismatch (Child: %c${n}%c !== Parent: %c${i.VERSION})`,s.HIGHLIGHT,s.FOREGROUND,s.HIGHLIGHT)}}function R(e,n,t){if(!r[e])return null;const o=r[e][n];if(typeof o!==i.FUNCTION)throw new TypeError(`${n} on iframe[${e}] is not a function`);if(n!=="onBeforeClose"&&n!=="onScroll")return p.isolateUserCode(o,t);try{return o(t)}catch(a){return console.error(a),L(e,`Error in ${n} callback`),null}}function ze(e,n){const{id:t,iframe:o}=e;u(t,`onMessage passed: {iframe: %c${t}%c, message: %c${n}%c}`,s.HIGHLIGHT,s.FOREGROUND,s.HIGHLIGHT,s.FOREGROUND),R(t,"onMessage",{iframe:o,message:JSON.parse(n)})}function N(e,n){const{lastMessage:t}=r[e];return t.slice(t.indexOf(i.SEPARATOR)+i.MESSAGE_HEADER_LENGTH+n)}function B(e,n){const{id:t,iframe:o,height:a,type:l,width:c}=n;let f={x:0,y:0};if(c===0&&a===0){const d=N(t,9).split(i.SEPARATOR);f={x:d[1],y:d[0]}}else f={x:c,y:a};R(t,e,{iframe:o,screenX:Number(f.x),screenY:Number(f.y),type:l})}const E={position:null,version:i.VERSION};function x(){E.position=null}const Ce=()=>E.position;function Fe(e){E.position=e}function W(e){return E.position===null&&(E.position={x:window.scrollX,y:window.scrollY}),u(e,`Get page position: %c${E.position.x}%c, %c${E.position.y}`,s.HIGHLIGHT,s.FOREGROUND,s.HIGHLIGHT),E.position}function U(e){E.position!==null&&(window.scrollTo(E.position.x,E.position.y),O(e,`Set page position: %c${E.position.x}%c, %c${E.position.y}`,s.HIGHLIGHT,s.FOREGROUND,s.HIGHLIGHT),x())}function V(e,n){const{id:t}=n,o=`${n[e]}px`;r[t].iframe.style[e]=o,O(t,`Set ${e}: %c${o}`,s.HIGHLIGHT)}function j(e){const{id:n}=e,{sizeHeight:t,sizeWidth:o}=r[n];t&&V(i.HEIGHT,e),o&&V(i.WIDTH,e)}function q(e){const{id:n}=e;j(e),U(n),R(n,"onResized",e)}function X(e){const{id:n}=e;u(n,"Disconnected from iframe"),delete r[n],delete e.iframeResizer}function Z(e){const{id:n}=e;if(R(n,"onBeforeClose",n)===!1){u(n,"Close iframe cancelled by onBeforeClose");return}u(n,`Removing iframe: %c${n}`,s.HIGHLIGHT);try{e.parentNode&&e.remove()}catch(t){L(n,t)}R(n,"onAfterClose",n),X(e)}function Y(e){const{id:n,type:t}=e;u(n,`Size reset requested by ${t===i.INIT?"parent page":"child page"}`),W(n),j(e),G(i.RESET,i.RESET,n)}const J=(e,n)=>{const t={};return(o,a)=>{const{iframe:l}=r[a];function c(d,g){t[g]||(d(),t[g]=requestAnimationFrame(()=>{t[g]=null}))}function f(){G(`${o} (${e})`,`${e}:${n(l)}`,a)}c(f,a)}},K=e=>n=>{e in r[n]&&(r[n][e](),delete r[n][e])},Q=((e,n)=>t=>{let o=!1;const a=I=>()=>{r[t]?(!o||o===I)&&(e(I,t),o=I,requestAnimationFrame(()=>{o=!1})):h()},l=a(i.SCROLL),c=a("resize window"),f=new ResizeObserver(a("pageObserver")),d=new ResizeObserver(a("iframeObserver"));function g(I,A){u(t,`${I}listeners for send${n}`),A(window,i.SCROLL,l),A(window,i.RESIZE,c)}function h(){w(t,`stop${n}`),g("Remove ",H.removeEventListener),f.disconnect(),d.disconnect(),r[t]&&H.removeEventListener(r[t].iframe,i.LOAD,h)}function M(){g("Add ",H.addEventListener),f.observe(document.body),d.observe(r[t].iframe)}r[t]&&(r[t][`stop${n}`]=h,H.addEventListener(r[t].iframe,i.LOAD,h),M())});function Be(e){const n=document.body.getBoundingClientRect(),t=e.getBoundingClientRect(),{scrollY:o,scrollX:a,innerHeight:l,innerWidth:c}=window,{clientHeight:f,clientWidth:d}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(f,l||0),clientWidth:Math.max(d,c||0),offsetTop:Math.trunc(t.top-n.top),offsetLeft:Math.trunc(t.left-n.left),scrollTop:o,scrollLeft:a,documentHeight:f,documentWidth:d,windowHeight:l,windowWidth:c})}const xe=J(i.PAGE_INFO,Be),We=Q(xe,"PageInfo"),Ue=K("stopPageInfo");function Ve(e){const{scrollWidth:n,scrollHeight:t}=document.documentElement,o=typeof window<"u"&&window.visualViewport?window.visualViewport:{},{width:a=0,height:l=0,offsetLeft:c=0,offsetTop:f=0,pageLeft:d=0,pageTop:g=0,scale:h=1}=o;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:n,scrollHeight:t},viewport:{width:a,height:l,offsetLeft:c,offsetTop:f,pageLeft:d,pageTop:g,scale:h}})}const je=J(i.PARENT_INFO,Ve),qe=Q(je,"ParentInfo"),Xe=K("stopParentInfo");function ee(e){const n=e.getBoundingClientRect(),t=W(e.id);return{x:Number(n.left)+Number(t.x),y:Number(n.top)+Number(t.y)}}function ne(e){const{x:n,y:t}=Ce(),o=r[e]?.iframe;if(R(e,"onScroll",{iframe:o,top:t,left:n,x:n,y:t})===!1){x();return}U(e)}function Ze(e){const{id:n,height:t,width:o}=e,a=window.parentIframe||window.parentIFrame||window;O(n,`scrollBy: x: %c${o}%c y: %c${t}`,s.HIGHLIGHT,s.FOREGROUND,s.HIGHLIGHT),a.scrollBy(o,t)}const te=e=>n=>{const{id:t,iframe:o,height:a,width:l}=n;function c(I){Fe(I),ne(t)}function f(I,A){I[`scrollTo${e?"Offset":""}`](A.x,A.y)}const d=I=>({x:l+I.x,y:a+I.y}),g=e?ee(o):{x:0,y:0},h=d(g),M=window.parentIframe||window.parentIFrame;O(t,`Reposition requested (offset x:%c${g.x}%c y:%c${g.y})`,s.HIGHLIGHT,s.FOREGROUND,s.HIGHLIGHT),M?f(M,h):c(h)},Ye=te(!1),Je=te(!0);function Ke(e,n,t){const{x:o,y:a}=ee(t);O(e,`Moving to in page link: %c#${n}`,s.HIGHLIGHT),E.position={x:o,y:a},ne(e),window.location.hash=n}function Qe(e,n){const t=window.parentIframe||window.parentIFrame;if(!t){u(e,`In page link #${n} not found`);return}t.moveToAnchor(n)}function en(e,n){const t=n.split("#")[1]||"",o=decodeURIComponent(t),a=document.getElementById(o)||document.getElementsByName(o)[0];if(a){Ke(e,t,a);return}if(window.top===window.self){u(e,`In page link #${t} not found`);return}Qe(e,t)}function nn(e){const n=r[e]?.iframe?.title;return n===""||n===void 0}function tn(e,n){r[e]?.syncTitle&&(r[e].iframe.title=n,O(e,`Set iframe title attribute: %c${n}`,s.HIGHLIGHT))}let v=!1,ie=!1;function re(e,n=-3){if(v)return;const t=Math.max(r[e].mode,n);if(t>r[e].mode&&(r[e].mode=t),t<0)throw Ee(e),r[e].vAdvised||b(e||"Parent",`${T.getModeData(t+2)}${T.getModeData(2)}`),r[e].vAdvised=!0,T.getModeData(t+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");switch(t>5&&ie||Ie(`v${i.VERSION} (${T.getModeLabel(t)})`,t),t){case 1:case 2:case 3:b("Parent",T.getModeData(6));break;case 4:b("Parent",T.getModeData(7));break;case 5:b("Parent",T.getModeData(8));break;default:t<1&&b("Parent",T.getModeData(3))}v=!0}function rn(e){if(v)return;const{mode:n}=r[e];n>5&&re(e,n)}function on(e){e?.log===-1&&(e.log=!1,ie=!0)}function an(e,n){r[e]&&(u(e,`First run for ${e}`),re(e,n===void 0?void 0:Number(n)),r[e].firstRun=!1)}function sn(e){const{height:n,id:t,iframe:o,mode:a,message:l,type:c,width:f}=e,{lastMessage:d}=r[t];switch(r[t]?.firstRun&&an(t,a),u(t,`Received: %c${d}`,s.HIGHLIGHT),c){case i.AUTO_RESIZE:r[t].autoResize=JSON.parse(N(t,9));break;case i.BEFORE_UNLOAD:O(t,"Ready state reset"),r[t].initialised=!1;break;case i.CLOSE:Z(o);break;case i.IN_PAGE_LINK:en(t,N(t,9));break;case i.INIT:q(e),De(t),_e(t,l),r[t].initialised=!0,R(t,"onReady",o);break;case i.MESSAGE:ze(e,N(t,6));break;case i.MOUSE_ENTER:B("onMouseEnter",e);break;case i.MOUSE_LEAVE:B("onMouseLeave",e);break;case i.PAGE_INFO:We(t);break;case i.PARENT_INFO:qe(t);break;case i.PAGE_INFO_STOP:Ue(t);break;case i.PARENT_INFO_STOP:Xe(t);break;case i.RESET:Y(e);break;case i.SCROLL_BY:Ze(e);break;case i.SCROLL_TO:Ye(e);break;case i.SCROLL_TO_OFFSET:Je(e);break;case i.TITLE:tn(t,l);break;default:if(f===0&&n===0){L(t,`Unsupported message received (${c}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);return}if(f===0||n===0){u(t,"Ignoring message with 0 height or width");return}if(document.hidden){u(t,"Page hidden - ignored resize request");return}q(e)}}const cn=e=>({initChild:n,postMessageTarget:t})=>{e===t&&n()},fn=e=>Object.values(r).forEach(cn(e));function oe(e){const n=e.data;if(n===i.CHILD_READY_MESSAGE){fn(e.source);return}if(!ve(n)){if(typeof n!==i.STRING)return;w(i.PARENT,"ignoredMessage"),me(i.PARENT,n);return}const t=ye(n),{id:o,type:a}=t;switch(w(o,a),!0){case!r[o]:throw new Error(`${a} No settings for ${o}. Message was: ${n}`);case!Pe(t):case ke(t):case!$e(t,e):return;default:r[o].lastMessage=e.data,C(o,sn)(t)}}const un=p.once(()=>{H.addEventListener(window,i.MESSAGE,oe),H.addEventListener(document,"visibilitychange",Ae),window.iframeParentListener=e=>setTimeout(()=>oe({data:e,sameOrigin:!0}))}),ae={};function ln(e){if(ae[e]===!0)return!1;const n=document.querySelectorAll(`iframe#${CSS.escape(e)}`);if(n.length<=1)return!0;ae[e]=!0;const t=Array.from(n).flatMap(o=>[i.NEW_LINE,o,i.NEW_LINE]);return b(e,`<rb>Duplicate ID attributes detected</>
|
|
7
|
-
|
|
8
|
-
The <b>${e}</> ID is not unique. Having multiple iframes on the same page with the same ID causes problems with communication between the iframe and parent page. Please ensure that the ID of each iframe has a unique value.
|
|
9
|
-
|
|
10
|
-
Found <bb>${n.length}</> iframes with the <b>${e}</> ID:`,...t,i.NEW_LINE),!1}function dn(e){if(r[e]){const{iframe:n}=r[e];n.iframeResizer={close:Z.bind(null,n),disconnect:X.bind(null,n),moveToAnchor(t){p.typeAssert(t,i.STRING,"moveToAnchor(anchor) anchor"),G("Move to anchor",`moveToAnchor:${t}`,e)},sendMessage(t){t=JSON.stringify(t),G(i.MESSAGE,`${i.MESSAGE}:${t}`,e)}}}}const gn="8",mn="32",hn=i.CHILD,En=!0;function pn(e){const{autoResize:n,bodyBackground:t,bodyMargin:o,bodyPadding:a,heightCalculationMethod:l,inPageLinks:c,license:f,log:d,logExpand:g,mouseEvents:h,offsetHeight:M,offsetWidth:I,mode:A,sizeHeight:qn,sizeWidth:Xn,tolerance:Zn,widthCalculationMethod:Yn}=r[e];return[e,gn,Xn,d,mn,En,n,o,l,t,a,Zn,c,hn,Yn,h,M,I,qn,f,E.version,A,"",g].join(i.SEPARATOR)}const In="0";function On(e){const{bodyMargin:n}=r[e];(typeof n===i.NUMBER||n===In)&&(r[e].bodyMargin=`${n}px`)}const bn=e=>{try{return new URL(e).origin}catch{return null}},Tn=e=>typeof e===i.OBJECT&&e.length>0&&!(e.contains("allow-scripts")&&e.contains("allow-same-origin"));function wn(e,n){const{checkOrigin:t,iframe:{src:o,sandbox:a},initialisedFirstPage:l,waitForLoad:c}=n[e],f=bn(o);w(e,"noResponse"),b(e,`<rb>No response from iframe</>
|
|
11
|
-
|
|
12
|
-
The iframe (<i>${e}</>) has not responded within ${n[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.
|
|
13
|
-
${t&&f?`
|
|
14
|
-
The <b>checkOrigin</> option is currently enabled. If the iframe redirects away from <i>${f}</>, then the connection to the iframe may be blocked by the browser. To disable this option, set <b>checkOrigin</> to <bb>false</> or an array of allowed origins. See <u>https://iframe-resizer.com/checkorigin</> for more information.
|
|
15
|
-
`:""}${c&&!l?`
|
|
16
|
-
The <b>waitForLoad</> option is currently set to <bb>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 <bb>false</>.
|
|
17
|
-
`:""}${Tn(a)?`
|
|
18
|
-
The iframe has the <b>sandbox</> attribute, please ensure it contains both the <bb>allow-same-origin</> and <bb>allow-scripts</> values.
|
|
19
|
-
`:""}
|
|
20
|
-
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.
|
|
21
|
-
`)}function Ln(e,n){function t(){if(n[e]===void 0)return;const{initialised:l,loadErrorShown:c}=n[e];if(n[e].msgTimeout=void 0,l){n[e].initialisedFirstPage=!0;return}c||(n[e].loadErrorShown=!0,wn(e,n))}const{msgTimeout:o,warningTimeout:a}=n[e];a&&(o&&clearTimeout(o),n[e].msgTimeout=setTimeout(t,a))}const Hn=1,Sn=e=>e.loading===i.LAZY,Rn=e=>e===i.INIT;function An(e){r[e]?.heightCalculationMethod in i.RESET_REQUIRED_METHODS&&Y({id:e,iframe:r[e].iframe,height:i.MIN_SIZE,width:i.MIN_SIZE,type:i.INIT})}function Gn(e,n){const t=()=>setTimeout(n,Hn);H.addEventListener(e,i.LOAD,t)}const Mn=e=>{const{src:n,srcdoc:t}=e;return!t&&(n==null||n===""||n==="about:blank")};function yn(e,n){const{iframe:t,waitForLoad:o}=r[e];if(o!==!0){if(Mn(t)){setTimeout(()=>{w(e,"noContent"),O(e,"No content detected in the iframe, delaying initialisation")});return}setTimeout(n)}}function Nn(e,n){const t=a=>()=>{if(!r[e])return;const{firstRun:l,iframe:c}=r[e];G(a,n,e),Rn(a)&&Sn(c)||Ln(e,r),l||An(e)},{iframe:o}=r[e];r[e].initChild=t(i.INIT_FROM_IFRAME),Gn(o,t(i.ONLOAD)),yn(e,t(i.INIT))}function Pn(e,n){return n?(("sizeWidth"in n||"sizeHeight"in n||i.AUTO_RESIZE in n)&&b(e,`<rb>Deprecated Option</>
|
|
22
|
-
|
|
23
|
-
The <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <bb>${i.VERTICAL}</>, <bb>${i.HORIZONTAL}</>, <bb>${i.BOTH}</> or <bb>${i.NONE}</>.
|
|
24
|
-
`),n):{}}function $n(e){r[e].warningTimeout||O(e,"warningTimeout:%c disabled",s.HIGHLIGHT)}function vn(e,{offset:n,offsetSize:t}){const o=t||n;o&&(r[e].direction===i.VERTICAL?(r[e].offsetHeight=o,u(e,`Offset height: %c${o}`,s.HIGHLIGHT)):(r[e].offsetWidth=o,u(e,`Offset width: %c${o}`,s.HIGHLIGHT)))}function kn(e){const{direction:n}=r[e];switch(n){case i.VERTICAL:break;case i.HORIZONTAL:r[e].sizeHeight=!1;case i.BOTH:r[e].sizeWidth=!0;break;case i.NONE:r[e].sizeWidth=!1,r[e].sizeHeight=!1,r[e].autoResize=!1;break;default:throw new TypeError(`Direction value of "${n}" is not valid`)}u(e,`direction: %c${n}`,s.HIGHLIGHT)}const se=e=>e===""||e.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":e;function Dn(e){const{checkOrigin:n,remoteHost:t}=r[e];Array.isArray(n)&&n.length===0&&L(e,"checkOrigin is an empty array — no messages will be sent to the iframe"),r[e].targetOrigin=Array.isArray(n)?n.map(se):[n===!1?"*":se(t)]}function _n(e){const{id:n}=e;r[n].postMessageTarget===null&&(r[n].postMessageTarget=e.contentWindow)}function k(e,n,t){p.hasOwn(r[e],n)&&(b(e,`<rb>Deprecated option</>
|
|
25
|
-
|
|
26
|
-
The <b>${n}</> option has been renamed to <b>${t}</>. ${i.REMOVED_NEXT_VERSION}`),r[e][t]=r[e][n],delete r[e][n])}function zn(e){k(e,i.OFFSET,i.OFFSET_SIZE),k(e,"onClose","onBeforeClose"),k(e,"onClosed","onAfterClose")}const Cn=e=>p.hasOwn(e,"onMouseEnter")||p.hasOwn(e,"onMouseLeave");function Fn(e,n){const{id:t}=e;r[t]={...r[t],iframe:e,remoteHost:e?.src.split("/").slice(0,3).join("/"),...y,...Pn(t,n),mouseEvents:Cn(n),mode:T(n),syncTitle:nn(t)},zn(t),kn(t),vn(t,n),$n(t),_n(e),Dn(t)}const Bn="yes",ce="no";function xn(e){const{id:n}=e;switch(u(n,`Iframe scrolling ${r[n]?.scrolling?"enabled":"disabled"} for ${n}`),e.style.overflow=r[n]?.scrolling===!1?i.HIDDEN:i.AUTO,r[n]?.scrolling){case i.OMIT:break;case!0:e.scrolling=Bn;break;case!1:e.scrolling=ce;break;default:e.scrolling=r[n]?.scrolling||ce}}function Wn(e,n,t){Fn(n,t),u(e,`src: %c${n.srcdoc||n.src}`,s.HIGHLIGHT),rn(e),xn(n),On(e),Nn(e,pn(e)),dn(e),u(e,"Setup complete")}function Un(e,n){const{id:t}=e;w(t,"setup"),ln(t)&&Wn(t,e,n),pe(t)}function Vn(e,n){n.log===i.LOG_DISABLED?n.log=!1:n.log===i.LOG_COLLAPSED?n.log=i.COLLAPSE:n.log===i.LOG_EXPANDED&&(n.log=i.EXPAND);const t=p.hasOwn(n,"log"),o=p.isString(n.log),a=t?o?!0:n.log:y.log;p.hasOwn(n,"logExpand")||(n.logExpand=t&&o?n.log===i.EXPAND:y.logExpand),on(n),ge({enabled:a,expand:n.logExpand,iframeId:e}),o&&!(n.log in i.LOG_OPTIONS)&&he(e,`Invalid value for options.log: Accepted values are "${i.EXPAND}" and "${i.COLLAPSE}"`),n.log=a}function jn(e){if(!p.isObject(e))throw new TypeError("Options is not an object");return un(),Le(e),n=>{const t=we(n,e);return i.LABEL in n?(w(t,"alreadySetup"),L(t,`Ignored iframe (${t}), already setup.`)):(Vn(t,e),C(t,Un)(n,e)),n?.iframeResizer}}Object.defineProperty(m,"LOG_COLLAPSED",{enumerable:!0,get:()=>i.LOG_COLLAPSED}),Object.defineProperty(m,"LOG_DISABLED",{enumerable:!0,get:()=>i.LOG_DISABLED}),Object.defineProperty(m,"LOG_EXPANDED",{enumerable:!0,get:()=>i.LOG_EXPANDED}),m.default=jn,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
20
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@iframe-resizer/common"),require("auto-console-group")):"function"==typeof define&&define.amd?define(["exports","@iframe-resizer/common","auto-console-group"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).connectResizer={},e.common,e.acg)}(this,function(e,n,t){"use strict";const i={},o=n.esModuleInterop(t);let r=!0;const s=o({expand:!1,label:n.PARENT}),a=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const c=e=>(n,...t)=>i[n]?i[n].console[e](...t):s[e](...t),d=e=>(n,...t)=>!0===(e=>i[e]?i[e].log:r)(n)?c(e)(n,...t):null,l=d("log"),f=l,u=d("debug"),g=c("warn"),m=c("error"),h=c("event"),p=c("purge"),E=c("endAutoGroup"),I=c("errorBoundary");const b=n.createFormatAdvise(n.id),T=(e,...t)=>i[e]?i[e].console.warn(...t.map(b)):queueMicrotask(()=>{const i=n.createFormatAdvise((e=>(...t)=>[`${n.LABEL}(${e})`,...t].join(" "))(e));console?.warn(...t.map(i))}),O=n.deprecate(T);O("Function"),O("Method"),O("Option");const w=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:n.VERTICAL,firstRun:!0,inPageLinks:!1,heightCalculationMethod:n.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:n.AUTO,onBeforeClose:()=>!0,onAfterClose(){},onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady(){},onResized(){},onScroll:()=>!0});let L=0;function H(e,t){let{id:i}=e;if(i&&!n.isString(i))throw new TypeError("Invalid id for iframe. Expected String");return i&&""!==i||(i=function(e){const n=e?.id||w.id+L++;return null===document.getElementById(n)?n:`${n}${L++}`}(t),e.id=i,h(i,"assignId"),l(i,`Added missing iframe ID: ${i} (${e.src})`)),i}function S(e,o,r){function s(i){const s=e in n.INIT_EVENTS?(e=>e.split(n.SEPARATOR).filter((e,n)=>19!==n).join(n.SEPARATOR))(o):o;f(r,i,t.HIGHLIGHT,t.FOREGROUND,t.HIGHLIGHT),f(r,`Message data: %c${s}`,t.HIGHLIGHT)}const{iframe:a,postMessageTarget:c,sameOrigin:d,targetOrigin:u}=i[r];if(d)try{return a.contentWindow.iframeChildListener(n.MESSAGE_ID+o),void s(`Sending message to iframe %c${r}%c via same origin%c`)}catch(m){e in n.INIT_EVENTS?(i[r].sameOrigin=!1,l(r,"New iframe does not support same origin")):g(r,"Same origin messaging failed, falling back to postMessage")}s(`Sending message to iframe: %c${r}%c targetOrigin: %c${u.join(", ")}`);for(const t of u)c.postMessage(n.MESSAGE_ID+o,t)}function y(e,n,t){h(t,e),i[t]?.postMessageTarget?S(e,n,t):g(t,"Iframe not found")}function R(){var e,t;!0!==document.hidden&&(e="tabVisible",t=n.RESIZE,Object.values(i).filter(({autoResize:e,firstRun:n})=>e&&!n).forEach(({iframe:n})=>y(e,t,n.id)))}function G(e){const t=e.slice(n.MESSAGE_ID_LENGTH).split(":"),o=t[1]?Number(t[1]):0,r=i[t[0]]?.iframe,s=r?getComputedStyle(r):null,a=s?function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(s)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(s):0,c={iframe:r,id:t[0],height:o+a,width:Number(t[2]),type:t[3],msg:t[4],message:t[4]};return t[5]&&(c.mode=t[5]),c}const A={true:1,false:1,undefined:1};function N(e,t,o){if(!i[e])return null;const r=i[e][t];if(typeof r!==n.FUNCTION)throw new TypeError(`${t} on iframe[${e}] is not a function`);if("onBeforeClose"!==t&&"onScroll"!==t)return n.isolateUserCode(r,o);try{return r(o)}catch(s){return console.error(s),g(e,`Error in ${t} callback`),null}}function $(e,t){const{lastMessage:o}=i[e];return o.slice(o.indexOf(n.SEPARATOR)+n.MESSAGE_HEADER_LENGTH+t)}function v(e,t){const{id:i,iframe:o,height:r,type:s,width:a}=t;let c={x:0,y:0};if(0===a&&0===r){const e=$(i,9).split(n.SEPARATOR);c={x:e[1],y:e[0]}}else c={x:a,y:r};N(i,e,{iframe:o,screenX:Number(c.x),screenY:Number(c.y),type:s})}const M={position:null,version:n.VERSION};function D(){M.position=null}function _(e){return null===M.position&&(M.position={x:window.scrollX,y:window.scrollY}),l(e,`Get page position: %c${M.position.x}%c, %c${M.position.y}`,t.HIGHLIGHT,t.FOREGROUND,t.HIGHLIGHT),M.position}function P(e){null!==M.position&&(window.scrollTo(M.position.x,M.position.y),f(e,`Set page position: %c${M.position.x}%c, %c${M.position.y}`,t.HIGHLIGHT,t.FOREGROUND,t.HIGHLIGHT),D())}function k(e,n){const{id:o}=n,r=`${n[e]}px`;i[o].iframe.style[e]=r,f(o,`Set ${e}: %c${r}`,t.HIGHLIGHT)}function C(e){const{id:t}=e,{sizeHeight:o,sizeWidth:r}=i[t];o&&k(n.HEIGHT,e),r&&k(n.WIDTH,e)}function x(e){const{id:n}=e;C(e),P(n),N(n,"onResized",e)}function z(e){const{id:n}=e;l(n,"Disconnected from iframe"),delete i[n],delete e.iframeResizer}function F(e){const{id:n}=e;if(!1!==N(n,"onBeforeClose",n)){l(n,`Removing iframe: %c${n}`,t.HIGHLIGHT);try{e.parentNode&&e.remove()}catch(i){g(n,i)}N(n,"onAfterClose",n),z(e)}else l(n,"Close iframe cancelled by onBeforeClose")}function B(e){const{id:t,type:i}=e;l(t,"Size reset requested by "+(i===n.INIT?"parent page":"child page")),_(t),C(e),y(n.RESET,n.RESET,t)}const W=(e,n)=>{const t={};return(o,r)=>{const{iframe:s}=i[r];var a,c;a=function(){y(`${o} (${e})`,`${e}:${n(s)}`,r)},t[c=r]||(a(),t[c]=requestAnimationFrame(()=>{t[c]=null}))}},U=e=>n=>{e in i[n]&&(i[n][e](),delete i[n][e])},V=(e,t)=>o=>{let r=!1;const s=n=>()=>{i[o]?r&&r!==n||(e(n,o),r=n,requestAnimationFrame(()=>{r=!1})):g()},a=s(n.SCROLL),c=s("resize window"),d=new ResizeObserver(s("pageObserver")),f=new ResizeObserver(s("iframeObserver"));function u(e,i){l(o,`${e}listeners for send${t}`),i(window,n.SCROLL,a),i(window,n.RESIZE,c)}function g(){h(o,`stop${t}`),u("Remove ",n.removeEventListener),d.disconnect(),f.disconnect(),i[o]&&n.removeEventListener(i[o].iframe,n.LOAD,g)}i[o]&&(i[o][`stop${t}`]=g,n.addEventListener(i[o].iframe,n.LOAD,g),u("Add ",n.addEventListener),d.observe(document.body),f.observe(i[o].iframe))};const j=V(W(n.PAGE_INFO,function(e){const n=document.body.getBoundingClientRect(),t=e.getBoundingClientRect(),{scrollY:i,scrollX:o,innerHeight:r,innerWidth:s}=window,{clientHeight:a,clientWidth:c}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,r||0),clientWidth:Math.max(c,s||0),offsetTop:Math.trunc(t.top-n.top),offsetLeft:Math.trunc(t.left-n.left),scrollTop:i,scrollLeft:o,documentHeight:a,documentWidth:c,windowHeight:r,windowWidth:s})}),"PageInfo"),X=U("stopPageInfo");const q=V(W(n.PARENT_INFO,function(e){const{scrollWidth:n,scrollHeight:t}=document.documentElement,i="undefined"!=typeof window&&window.visualViewport?window.visualViewport:{},{width:o=0,height:r=0,offsetLeft:s=0,offsetTop:a=0,pageLeft:c=0,pageTop:d=0,scale:l=1}=i;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:n,scrollHeight:t},viewport:{width:o,height:r,offsetLeft:s,offsetTop:a,pageLeft:c,pageTop:d,scale:l}})}),"ParentInfo"),Z=U("stopParentInfo");function J(e){const n=e.getBoundingClientRect(),t=_(e.id);return{x:Number(n.left)+Number(t.x),y:Number(n.top)+Number(t.y)}}function Y(e){const{x:n,y:t}=M.position,o=i[e]?.iframe;!1!==N(e,"onScroll",{iframe:o,top:t,left:n,x:n,y:t})?P(e):D()}const K=e=>n=>{const{id:i,iframe:o,height:r,width:s}=n;const a=e?J(o):{x:0,y:0},c={x:s+(d=a).x,y:r+d.y};var d;const l=window.parentIframe||window.parentIFrame;var u;f(i,`Reposition requested (offset x:%c${a.x}%c y:%c${a.y})`,t.HIGHLIGHT,t.FOREGROUND,t.HIGHLIGHT),l?(u=c,l["scrollTo"+(e?"Offset":"")](u.x,u.y)):function(e){var n;n=e,M.position=n,Y(i)}(c)},Q=K(!1),ee=K(!0);function ne(e,n){const i=n.split("#")[1]||"",o=decodeURIComponent(i),r=document.getElementById(o)||document.getElementsByName(o)[0];r?function(e,n,i){const{x:o,y:r}=J(i);f(e,`Moving to in page link: %c#${n}`,t.HIGHLIGHT),M.position={x:o,y:r},Y(e),window.location.hash=n}(e,i,r):window.top!==window.self?function(e,n){const t=window.parentIframe||window.parentIFrame;t?t.moveToAnchor(n):l(e,`In page link #${n} not found`)}(e,i):l(e,`In page link #${i} not found`)}function te(e){const n=i[e]?.iframe?.title;return""===n||void 0===n}let ie=!1,oe=!1;function re(e,o=-3){if(ie)return;const s=Math.max(i[e].mode,o);if(s>i[e].mode&&(i[e].mode=s),s<0)throw p(e),i[e].vAdvised||T(e||"Parent",`${n.getModeData(s+2)}${n.getModeData(2)}`),i[e].vAdvised=!0,n.getModeData(s+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");switch(s>5&&oe||function(e,i){queueMicrotask(()=>console.info(`%ciframe-resizer ${e}`,r||i<1?n.BOLD:t.NORMAL))}(`v${n.VERSION} (${n.getModeLabel(s)})`,s),s){case 1:case 2:case 3:T("Parent",n.getModeData(6));break;case 4:T("Parent",n.getModeData(7));break;case 5:T("Parent",n.getModeData(8));break;default:s<1&&T("Parent",n.getModeData(3))}ie=!0}function se(e){const{height:o,id:r,iframe:s,mode:a,message:c,type:d,width:u}=e,{lastMessage:m}=i[r];switch(i[r]?.firstRun&&function(e,n){i[e]&&(l(e,`First run for ${e}`),re(e,void 0===n?void 0:Number(n)),i[e].firstRun=!1)}(r,a),l(r,`Received: %c${m}`,t.HIGHLIGHT),d){case n.AUTO_RESIZE:i[r].autoResize=JSON.parse($(r,9));break;case n.BEFORE_UNLOAD:f(r,"Ready state reset"),i[r].initialised=!1;break;case n.CLOSE:F(s);break;case n.IN_PAGE_LINK:ne(r,$(r,9));break;case n.INIT:x(e),function(e){try{i[e].sameOrigin=!!i[e]?.iframe?.contentWindow?.iframeChildListener}catch(n){i[e].sameOrigin=!1}l(e,`sameOrigin: %c${i[e].sameOrigin}`,t.HIGHLIGHT)}(r),function(e,i){i!==n.VERSION&&(void 0!==i?l(e,`Version mismatch (Child: %c${i}%c !== Parent: %c${n.VERSION})`,t.HIGHLIGHT,t.FOREGROUND,t.HIGHLIGHT):T(e,"<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"))}(r,c),i[r].initialised=!0,N(r,"onReady",s);break;case n.MESSAGE:!function(e,n){const{id:i,iframe:o}=e;l(i,`onMessage passed: {iframe: %c${i}%c, message: %c${n}%c}`,t.HIGHLIGHT,t.FOREGROUND,t.HIGHLIGHT,t.FOREGROUND),N(i,"onMessage",{iframe:o,message:JSON.parse(n)})}(e,$(r,6));break;case n.MOUSE_ENTER:v("onMouseEnter",e);break;case n.MOUSE_LEAVE:v("onMouseLeave",e);break;case n.PAGE_INFO:j(r);break;case n.PARENT_INFO:q(r);break;case n.PAGE_INFO_STOP:X(r);break;case n.PARENT_INFO_STOP:Z(r);break;case n.RESET:B(e);break;case n.SCROLL_BY:!function(e){const{id:n,height:i,width:o}=e,r=window.parentIframe||window.parentIFrame||window;f(n,`scrollBy: x: %c${o}%c y: %c${i}`,t.HIGHLIGHT,t.FOREGROUND,t.HIGHLIGHT),r.scrollBy(o,i)}(e);break;case n.SCROLL_TO:Q(e);break;case n.SCROLL_TO_OFFSET:ee(e);break;case n.TITLE:!function(e,n){i[e]?.syncTitle&&(i[e].iframe.title=n,f(e,`Set iframe title attribute: %c${n}`,t.HIGHLIGHT))}(r,c);break;default:if(0===u&&0===o)return void g(r,`Unsupported message received (${d}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===u||0===o)return void l(r,"Ignoring message with 0 height or width");if(document.hidden)return void l(r,"Page hidden - ignored resize request");x(e)}}function ae(e){const o=e.data;if(o===n.CHILD_READY_MESSAGE)return r=e.source,void Object.values(i).forEach((e=>({initChild:n,postMessageTarget:t})=>{e===t&&n()})(r));var r,s;if(s=o,n.MESSAGE_ID!==`${s}`.slice(0,n.MESSAGE_ID_LENGTH)||!(s.slice(n.MESSAGE_ID_LENGTH).split(":")[0]in i)){if(typeof o!==n.STRING)return;return h(n.PARENT,"ignoredMessage"),void u(n.PARENT,o)}const a=G(o),{id:c,type:d}=a;switch(h(c,d),!0){case!i[c]:throw new Error(`${d} No settings for ${c}. Message was: ${o}`);case!function(e){const{id:i,msg:o,iframe:r}=e,s=n.isIframe(r);return s||(l(i,`Received: %c${o}`,t.HIGHLIGHT),g(i,"The target iframe was not found.")),s}(a):case function(e){const{id:n,type:t}=e,i=t in A;return i&&l(n,"Ignoring init message from meta parent page"),i}(a):case!function(e,n){const{id:o}=e,{data:r,origin:s}=n;if("sameOrigin"in n&&n.sameOrigin)return!0;const a=i[o]?.checkOrigin;if(a&&"null"!=`${s}`&&!(a.constructor===Array?function(){l(o,`Checking connection is from allowed list of origins: %c${a}`,t.HIGHLIGHT);for(const e of a)if(e===s)return!0;return!1}():function(){const e=i[o]?.remoteHost;return l(o,`Checking connection is from: %c${e}`,t.HIGHLIGHT),s===e}()))throw new Error(`Unexpected message received from: ${s} for ${o}. Message was: ${r}. This error can be disabled by setting the checkOrigin: false option or by providing an array of trusted domains.`);return!0}(a,e):return;default:i[c].lastMessage=e.data,I(c,se)(a)}}const ce=n.once(()=>{n.addEventListener(window,n.MESSAGE,ae),n.addEventListener(document,"visibilitychange",R),window.iframeParentListener=e=>setTimeout(()=>ae({data:e,sameOrigin:!0}))}),de={};const le="8",fe="32",ue=n.CHILD,ge=!0;function me(e,t){const{checkOrigin:i,iframe:{src:o,sandbox:r},initialisedFirstPage:s,waitForLoad:a}=t[e],c=(e=>{try{return new URL(e).origin}catch(n){return null}})(o);h(e,"noResponse"),T(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${i&&c?`\nThe <b>checkOrigin</> option is currently enabled. If the iframe redirects away from <i>${c}</>, then the connection to the iframe may be blocked by the browser. To disable this option, set <b>checkOrigin</> to <bb>false</> or an array of allowed origins. See <u>https://iframe-resizer.com/checkorigin</> for more information.\n`:""}${a&&!s?"\nThe <b>waitForLoad</> option is currently set to <bb>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 <bb>false</>.\n":""}${(e=>typeof e===n.OBJECT&&e.length>0&&!(e.contains("allow-scripts")&&e.contains("allow-same-origin")))(r)?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <bb>allow-same-origin</> and <bb>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`)}function he(e,t){const o=o=>()=>{if(!i[e])return;const{firstRun:r,iframe:s}=i[e];y(o,t,e),(e=>e===n.INIT)(o)&&(e=>e.loading===n.LAZY)(s)||function(e,n){const{msgTimeout:t,warningTimeout:i}=n[e];i&&(t&&clearTimeout(t),n[e].msgTimeout=setTimeout(function(){if(void 0===n[e])return;const{initialised:t,loadErrorShown:i}=n[e];n[e].msgTimeout=void 0,t?n[e].initialisedFirstPage=!0:i||(n[e].loadErrorShown=!0,me(e,n))},i))}(e,i),r||function(e){i[e]?.heightCalculationMethod in n.RESET_REQUIRED_METHODS&&B({id:e,iframe:i[e].iframe,height:n.MIN_SIZE,width:n.MIN_SIZE,type:n.INIT})}(e)},{iframe:r}=i[e];i[e].initChild=o(n.INIT_FROM_IFRAME),function(e,t){n.addEventListener(e,n.LOAD,()=>setTimeout(t,1))}(r,o(n.ONLOAD)),function(e,n){const{iframe:t,waitForLoad:o}=i[e];!0!==o&&((e=>{const{src:n,srcdoc:t}=e;return!t&&(null==n||""===n||"about:blank"===n)})(t)?setTimeout(()=>{h(e,"noContent"),f(e,"No content detected in the iframe, delaying initialisation")}):setTimeout(n))}(e,o(n.INIT))}function pe(e,t){return t?(("sizeWidth"in t||"sizeHeight"in t||n.AUTO_RESIZE in t)&&T(e,`<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 <bb>${n.VERTICAL}</>, <bb>${n.HORIZONTAL}</>, <bb>${n.BOTH}</> or <bb>${n.NONE}</>.\n`),t):{}}const Ee=e=>""===e||null!==e.match(/^(about:blank|javascript:|file:\/\/)/)?"*":e;function Ie(e,t,o){n.hasOwn(i[e],t)&&(T(e,`<rb>Deprecated option</>\n\nThe <b>${t}</> option has been renamed to <b>${o}</>. ${n.REMOVED_NEXT_VERSION}`),i[e][o]=i[e][t],delete i[e][t])}const be=e=>n.hasOwn(e,"onMouseEnter")||n.hasOwn(e,"onMouseLeave");function Te(e,o){const{id:r}=e;i[r]={...i[r],iframe:e,remoteHost:e?.src.split("/").slice(0,3).join("/"),...w,...pe(r,o),mouseEvents:be(o),mode:n.setMode(o),syncTitle:te(r)},function(e){Ie(e,n.OFFSET,n.OFFSET_SIZE),Ie(e,"onClose","onBeforeClose"),Ie(e,"onClosed","onAfterClose")}(r),function(e){const{direction:o}=i[e];switch(o){case n.VERTICAL:break;case n.HORIZONTAL:i[e].sizeHeight=!1;case n.BOTH:i[e].sizeWidth=!0;break;case n.NONE:i[e].sizeWidth=!1,i[e].sizeHeight=!1,i[e].autoResize=!1;break;default:throw new TypeError(`Direction value of "${o}" is not valid`)}l(e,`direction: %c${o}`,t.HIGHLIGHT)}(r),function(e,{offset:o,offsetSize:r}){const s=r||o;s&&(i[e].direction===n.VERTICAL?(i[e].offsetHeight=s,l(e,`Offset height: %c${s}`,t.HIGHLIGHT)):(i[e].offsetWidth=s,l(e,`Offset width: %c${s}`,t.HIGHLIGHT)))}(r,o),function(e){i[e].warningTimeout||f(e,"warningTimeout:%c disabled",t.HIGHLIGHT)}(r),function(e){const{id:n}=e;null===i[n].postMessageTarget&&(i[n].postMessageTarget=e.contentWindow)}(e),function(e){const{checkOrigin:n,remoteHost:t}=i[e];Array.isArray(n)&&0===n.length&&g(e,"checkOrigin is an empty array — no messages will be sent to the iframe"),i[e].targetOrigin=Array.isArray(n)?n.map(Ee):[!1===n?"*":Ee(t)]}(r)}function Oe(e,o,r){Te(o,r),l(e,`src: %c${o.srcdoc||o.src}`,t.HIGHLIGHT),function(e){if(ie)return;const{mode:n}=i[e];n>5&&re(e,n)}(e),function(e){const{id:t}=e;switch(l(t,`Iframe scrolling ${i[t]?.scrolling?"enabled":"disabled"} for ${t}`),e.style.overflow=!1===i[t]?.scrolling?n.HIDDEN:n.AUTO,i[t]?.scrolling){case n.OMIT:break;case!0:e.scrolling="yes";break;case!1:e.scrolling="no";break;default:e.scrolling=i[t]?.scrolling||"no"}}(o),function(e){const{bodyMargin:t}=i[e];typeof t!==n.NUMBER&&"0"!==t||(i[e].bodyMargin=`${t}px`)}(e),he(e,function(e){const{autoResize:t,bodyBackground:o,bodyMargin:r,bodyPadding:s,heightCalculationMethod:a,inPageLinks:c,license:d,log:l,logExpand:f,mouseEvents:u,offsetHeight:g,offsetWidth:m,mode:h,sizeHeight:p,sizeWidth:E,tolerance:I,widthCalculationMethod:b}=i[e];return[e,le,E,l,fe,ge,t,r,a,o,s,I,c,ue,b,u,g,m,p,d,M.version,h,"",f].join(n.SEPARATOR)}(e)),function(e){if(i[e]){const{iframe:t}=i[e];t.iframeResizer={close:F.bind(null,t),disconnect:z.bind(null,t),moveToAnchor(t){n.typeAssert(t,n.STRING,"moveToAnchor(anchor) anchor"),y("Move to anchor",`moveToAnchor:${t}`,e)},sendMessage(t){t=JSON.stringify(t),y(n.MESSAGE,`${n.MESSAGE}:${t}`,e)}}}}(e),l(e,"Setup complete")}function we(e,t){const{id:i}=e;h(i,"setup"),function(e){if(!0===de[e])return!1;const t=document.querySelectorAll(`iframe#${CSS.escape(e)}`);if(t.length<=1)return!0;de[e]=!0;const i=Array.from(t).flatMap(e=>[n.NEW_LINE,e,n.NEW_LINE]);return T(e,`<rb>Duplicate ID attributes detected</>\n\nThe <b>${e}</> ID is not unique. Having multiple iframes on the same page with the same ID causes problems with communication between the iframe and parent page. Please ensure that the ID of each iframe has a unique value.\n\nFound <bb>${t.length}</> iframes with the <b>${e}</> ID:`,...i,n.NEW_LINE),!1}(i)&&Oe(i,e,t),E(i)}function Le(e,t){t.log===n.LOG_DISABLED?t.log=!1:t.log===n.LOG_COLLAPSED?t.log=n.COLLAPSE:t.log===n.LOG_EXPANDED&&(t.log=n.EXPAND);const s=n.hasOwn(t,"log"),c=n.isString(t.log),d=s?!!c||t.log:w.log;n.hasOwn(t,"logExpand")||(t.logExpand=s&&c?t.log===n.EXPAND:w.logExpand),function(e){-1===e?.log&&(e.log=!1,oe=!0)}(t),function({enabled:e,expand:n,iframeId:t}){const s=o({expand:n,label:a(t)});r=e,i[t]||(i[t]={console:s})}({enabled:d,expand:t.logExpand,iframeId:e}),c&&!(t.log in n.LOG_OPTIONS)&&m(e,`Invalid value for options.log: Accepted values are "${n.EXPAND}" and "${n.COLLAPSE}"`),t.log=d}Object.defineProperty(e,"LOG_COLLAPSED",{enumerable:!0,get:()=>n.LOG_COLLAPSED}),Object.defineProperty(e,"LOG_DISABLED",{enumerable:!0,get:()=>n.LOG_DISABLED}),Object.defineProperty(e,"LOG_EXPANDED",{enumerable:!0,get:()=>n.LOG_EXPANDED}),e.default=function(e){if(!n.isObject(e))throw new TypeError("Options is not an object");return ce(),function(e){const{search:t}=window.location;if(t.includes("ifrlog"))switch(new URLSearchParams(t).get("ifrlog")){case String(n.LOG_DISABLED):e.log=!1;break;case n.EXPAND:case String(n.LOG_EXPANDED):e.log=n.EXPAND;break;case n.COLLAPSE:case String(n.LOG_COLLAPSED):default:e.log=n.COLLAPSE}}(e),t=>{const i=H(t,e);return n.LABEL in t?(h(i,"alreadySetup"),g(i,`Ignored iframe (${i}), already setup.`)):(Le(i,e),I(i,we)(t,e)),t?.iframeResizer}},Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
27
21
|
//# sourceMappingURL=index.umd.js.map
|