@iframe-resizer/jquery 5.5.4-beta.2 → 5.5.4-beta.3

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
@@ -1,12 +1,13 @@
1
1
  <p align="center"><br>
2
2
  <img src="https://iframe-resizer.com/logo-full.svg" alt="iframe-resizer - keep iframes sized to their content" title="" width="90%" style="width: 90%">
3
- <p>
3
+ <p><br>
4
4
 
5
5
  # @iframe-resizer/jquery
6
6
 
7
- This package is part of __[iframe-resizer](https://iframe-resizer.com)__, a library that enables the automatic resizing of the height and width of both same and cross origin iframes to fit their contained content. Additionally it provides a range of features to address the most common issues with using iframes.
7
+ This package is part of the __[iframe-resizer](https://iframe-resizer.com)__ library, which automatically resizes the height and width of both same-origin and cross-origin iframes to match their content. It also includes a range of features designed to address common issues associated with using iframes.
8
8
 
9
- __See [iframe-resizer.com](https://iframe-resizer.com) for details.__
9
+
10
+ __For more information, visit [iframe-resizer.com](https://iframe-resizer.com).__
10
11
 
11
12
  ## Install
12
13
 
@@ -24,4 +25,4 @@ yarn add @iframe-resizer/jquery
24
25
 
25
26
  ---
26
27
 
27
- _iframe-resizer version 5.5.4-beta.2 2025-08-26 - 14:11:59.344Z_
28
+ _iframe-resizer version 5.5.4-beta.3 2025-08-27 - 10:36:14.661Z_
package/index.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/jquery 5.5.4-beta.2 (cjs) - 2025-08-26
4
+ * @module iframe-resizer/jquery 5.5.4-beta.3 (cjs) - 2025-08-27
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
package/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/jquery 5.5.4-beta.2 (esm) - 2025-08-26
4
+ * @module iframe-resizer/jquery 5.5.4-beta.3 (esm) - 2025-08-27
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
package/index.umd.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/jquery 5.5.4-beta.2 (umd) - 2025-08-26
4
+ * @module iframe-resizer/jquery 5.5.4-beta.3 (umd) - 2025-08-27
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -17,5 +17,5 @@
17
17
  */
18
18
 
19
19
 
20
- !function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";const e="font-weight: normal;",t=e+"font-style: italic;",n="default",o=Object.freeze({assert:!0,error:!0,warn:!0}),i={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},s=Object.assign(console);const{fromEntries:a,keys:l}=Object,c=e=>[e,s[e]],d=e=>t=>[t,function(n){e[t]=n}],u=(e,t)=>a(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",m=f?"color: #E3E3E3;":"color: #1F1F1F;",h="5.5.4-beta.2",g="none",y="vertical",b="horizontal",w="[iFrameSizer]",v=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),z="onload",$="init",j=Object.freeze({[z]:1,[$]:1}),k="expanded",T="collapsed",x=Object.freeze({[k]:1,[T]:1}),M=(e,t,n,o)=>e.addEventListener(t,n,o||!1),R=(e,t,n)=>e.removeEventListener(t,n,!1),S=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,i=0;i<e.length;i++)o=e.codePointAt(i),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},O=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),E=["spjluzl","rlf","clyzpvu"],I=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],C=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],A=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),W=e=>O(I[e]),L=e=>{const t=e[O(E[0])]||e[O(E[1])]||e[O(E[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=S(O(e));return n in A&&(t=A[n]),t}(n[0]);return 0===o||(e=>e[2]===S(e[0]+e[1]))(n)||(o=-2),o},B=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),N=e=>e,F=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)),H=(P=function(a={}){const l={},f={},p=[],m={...i,expand:!a.collapsed||i.expanded,...a};let h="";function g(){p.length=0,h=""}function y(){delete m.event,g()}const b=()=>!!p.some(([e])=>e in o)||!!m.expand;function w(){if(0!==p.length){s[b()?"group":"groupCollapsed"](`%c${m.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(m)} %c${m.showTime?h:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)s.assert(e in s,`Unknown console method: ${e}`),e in s&&s[e](...t);s.groupEnd(),y()}else y()}function v(){""===h&&(h=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function z(e,...t){0===p.length&&(v(),queueMicrotask(()=>queueMicrotask(w))),p.push([e,...t])}function $(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...u(m,d(m)),...u(console,e=>[e,(...t)=>z(e,...t)]),...u(r,c),assert:function(e,...t){!0!==e&&z("assert",e,...t)},count:function(e=n){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=n){delete f[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e),w()}return n},event:function(e){v(),m.event=e},purge:g,time:function(e=n){v(),l[e]=performance.now()},timeEnd:function(e=n){$(e),delete l[e]},timeLog:$,touch:v}},P?.__esModule?P.default:P);var P;let q={},D=!1;const U=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const Q=e=>(t,...n)=>q[t]?.console[e](...n),J=(V="log",(e,...t)=>!0===(e=>q[e]?q[e].log:D)(e)?Q(V)(e,...t):null);var V;const Z=J,G=Q("warn"),X=Q("error"),Y=Q("event"),_=Q("purge"),K=Q("errorBoundary");const ee=(e,...t)=>q[e]?q[e].console.warn(F(N)(...t)):queueMicrotask(()=>console?.warn(F((e=>(...t)=>[`iframeResizer(${e})`,...t].join(" "))(e))(...t))),te=(e=>(t,n="renamed to")=>(o,i,r="",s="")=>e(s,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(ee),ne=te("Method"),oe=te("Option");function ie(e,t){const{msgTimeout:n,warningTimeout:o}=t[e];o&&(n&&clearTimeout(n),t[e].msgTimeout=setTimeout(function(){if(void 0===t[e])return;const{ready:n,loadErrorShown:o}=t[e];t[e].msgTimeout=void 0,n||o||(t[e].loadErrorShown=!0,function(e,t){const{iframe:n,waitForLoad:o}=t[e],{sandbox:i}=n,r="object"==typeof i&&i.length>0&&!(i.contains("allow-scripts")&&i.contains("allow-same-origin"));Y(e,"noResponse"),ee(e,`<rb>No response from iframe</>\n \nThe iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <b>'true'</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <b>'false'</>. \n":""}${r?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n":""}\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`)}(e,t))},o))}const re={},se=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:y,inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof re[e.id].onInit&&(oe("init()","onReady()","",e.id),re[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),ae={position:null,version:h};function le(e){function t(){ge(x),me(S),$("onResized",x)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function o(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const i=e=>T.slice(T.indexOf(":")+7+e);const r=(e,t)=>(n,o)=>{const i={};var r,s;r=function(){be(`${n} (${e})`,`${e}:${t()}`,o)},i[s=o]||(r(),i[s]=requestAnimationFrame(()=>{i[s]=null}))},s=(e,t)=>()=>{let n=!1;const o=t=>()=>{re[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame(()=>{n=!1})):a()},i=o("scroll"),r=o("resize window");function s(e,n){J(l,`${e}listeners for send${t}`),n(window,"scroll",i),n(window,"resize",r)}function a(){Y(l,`stop${t}`),s("Remove ",R),c.disconnect(),d.disconnect(),R(re[l].iframe,"load",a)}const l=S,c=new ResizeObserver(o("pageObserver")),d=new ResizeObserver(o("iframeObserver"));re[l]&&(re[l][`stop${t}`]=a,M(re[l].iframe,"load",a),s("Add ",M),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(re[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},a=e=>()=>{e in re[S]&&(re[S][e](),delete re[S][e])},l=r("pageInfo",function(){const e=document.body.getBoundingClientRect(),t=x.iframe.getBoundingClientRect(),{scrollY:n,scrollX:o,innerHeight:i,innerWidth:r}=window,{clientHeight:s,clientWidth:a}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(s,i||0),clientWidth:Math.max(a,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:o,documentHeight:s,documentWidth:a,windowHeight:i,windowWidth:r})}),c=r("parentInfo",function(){const{iframe:e}=x,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:o,height:i,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:o,height:i,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}})}),d=s(l,"PageInfo"),u=s(c,"ParentInfo"),f=a("stopPageInfo"),g=a("stopParentInfo");function y(e){const t=e.getBoundingClientRect();return fe(S),{x:Number(t.left)+Number(ae.position.x),y:Number(t.top)+Number(ae.position.y)}}function b(e){const t=e?y(x.iframe):{x:0,y:0};Z(S,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,m,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(x,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(o,n):function(e){ae.position=e,v(S)}(n)}function v(e){const{x:t,y:n}=ae.position,o=re[e]?.iframe;!1!==$("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?me(e):pe()}function z(e){let t={};if(0===x.width&&0===x.height){const e=i(9).split(":");t={x:e[1],y:e[0]}}else t={x:x.width,y:x.height};$(e,{iframe:x.iframe,screenX:Number(t.x),screenY:Number(t.y),type:x.type})}const $=(e,t)=>ce(S,e,t);function j(){const{height:e,iframe:n,msg:o,type:r,width:s}=x;switch(re[S]?.firstRun&&function(){if(!re[S])return;ke(S,x.mode),re[S].firstRun=!1}(),r){case"close":ue(n);break;case"message":l=i(6),J(S,`onMessage passed: {iframe: %c${x.iframe.id}%c, message: %c${l}%c}`,p,m,p,m),$("onMessage",{iframe:x.iframe,message:JSON.parse(l)});break;case"mouseenter":z("onMouseEnter");break;case"mouseleave":z("onMouseLeave");break;case"beforeUnload":Z(S,"Ready state reset"),re[S].ready=!1;break;case"autoResize":re[S].autoResize=JSON.parse(i(9));break;case"scrollBy":!function(){const e=x.width,t=x.height,n=window.parentIframe||window.parentIFrame||window;Z(S,`scrollBy: x: %c${e}%c y: %c${t}`,p,m,p),n.scrollBy(e,t)}();break;case"scrollTo":b(!1);break;case"scrollToOffset":b(!0);break;case"pageInfo":d();break;case"parentInfo":u();break;case"pageInfoStop":f();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let o=document.getElementById(n)||document.getElementsByName(n)[0];o?function(){const e=y(o);Z(S,`Moving to in page link: %c#${t}`,p),ae.position={x:e.x,y:e.y},v(S),window.location.hash=t}():window.top!==window.self?function(){const e=window.parentIframe||window.parentIFrame;e?e.moveToAnchor(t):J(S,`In page link #${t} not found and window.parentIframe not found`)}():J(S,`In page link #${t} not found`)}(i(9));break;case"title":!function(e,t){re[t]?.syncTitle&&(re[t].iframe.title=e,Z(t,`Set iframe title attribute: %c${e}`,p))}(o,S);break;case"reset":he(x);break;case"init":t(),function(e){try{re[e].sameOrigin=!!re[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){re[e].sameOrigin=!1}J(e,`sameOrigin: %c${re[e].sameOrigin}`,p)}(S),(a=o)!==h&&(void 0!==a?J(S,`Version mismatch (Child: %c${a}%c !== Parent: %c${h})`,p,m,p):ee(S,"<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")),ze=!0,$("onReady",n);break;default:if(0===s&&0===e)return void G(S,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===s||0===e)return void J(S,"Ignoring message with 0 height or width");if(document.hidden)return void J(S,"Page hidden - ignored resize request");t()}var a,l}function k(e){re[e].ready||(be("iframe requested init",we(e),e),ie(e,re))}let T=e.data,x={},S=null;"[iFrameResizerChild]Ready"!==T?w===`${T}`.slice(0,13)&&T.slice(13).split(":")[0]in re?(x=function(){const e=T.slice(13).split(":"),t=e[1]?Number(e[1]):0,i=re[e[0]]?.iframe,r=getComputedStyle(i),s={iframe:i,id:e[0],height:t+n(r)+o(r),width:Number(e[2]),type:e[3],msg:e[4]};return e[5]&&(s.mode=e[5]),s}(),S=x.id,S?(Y(S,x.type),K(S,function(){!function(e){if(!re[e])throw new Error(`${x.type} No settings for ${e}. Message was: ${T}`)}(S),function(){const e=x.type in{true:1,false:1,undefined:1};return e&&J(S,"Ignoring init message from meta parent page"),e}()||(J(S,`Received: %c${T}`,p),re[S].ready=!0,(null!==x.iframe||(G(S,`The iframe (${x.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let o=re[S]?.checkOrigin;if(o&&"null"!=`${t}`&&!(o.constructor===Array?function(){let e=0,n=!1;for(J(S,`Checking connection is from allowed list of origins: %c${o}`,p);e<o.length;e++)if(o[e]===t){n=!0;break}return n}():function(){const e=re[S]?.remoteHost;return J(S,`Checking connection is from: %c${e}`,p),t===e}()))throw new Error(`Unexpected message received from: ${t} for ${x.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&j())})()):G("","iframeResizer received messageData without id, message was: ",T)):null!==S&&J(S,"Ignored:",T):Object.keys(re).forEach(k)}function ce(e,t,n){let o=null,i=null;if(re[e]){if(o=re[e][t],"function"!=typeof o)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{i=o(n)}catch(n){console.error(n),G(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(o,n)}return i}function de(e){const{id:t}=e;J(t,"Disconnected from iframe"),delete re[t],delete e.iframeResizer}function ue(e){const{id:t}=e;if(!1!==ce(t,"onBeforeClose",t)){J(t,`Removing iFrame: %c${t}`,p);try{e.parentNode&&e.remove()}catch(e){G(t,e)}ce(t,"onAfterClose",t),de(e)}else J(t,"Close iframe cancelled by onBeforeClose")}function fe(e){null===ae.position&&(ae.position={x:window.scrollX,y:window.scrollY},J(e,`Get page position: %c${ae.position.x}%c, %c${ae.position.y}`,p,m,p))}function pe(){ae.position=null}function me(e){null!==ae.position&&(window.scrollTo(ae.position.x,ae.position.y),Z(e,`Set page position: %c${ae.position.x}%c, %c${ae.position.y}`,p,m,p),pe())}function he(e){J(e.id,"Size reset requested by "+("init"===e.type?"parent page":"child page")),fe(e.id),ge(e),be("reset","reset",e.id)}function ge(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,Z(n,`Set ${t}: %c${o}`,p)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=re[n];o&&t("height"),i&&t("width")}q=re;const ye=e=>e.split(":").filter((e,t)=>19!==t).join(":");function be(e,t,n){function o(o){const i=e in j?ye(t):t;Z(n,o,p,m,p),Z(n,`Message data: %c${i}`,p)}Y(n,e),re[n]&&(re[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:i,sameOrigin:r,targetOrigin:s}=re[n];if(r)try{return e.contentWindow.iframeChildListener(w+t),void o(`Sending message to iframe %c${n}%c via sameOrigin`)}catch(e){J(n,"Same domain connection failed. Trying cross domain%c")}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${s}`),i.postMessage(w+t,s)}():G(n,`Iframe(${n}) not found`))}function we(e){const t=re[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,ae.version,t.mode,"",t.logExpand].join(":")}let ve=0,ze=!1,$e=!1,je=!1;function ke(t,n=-3){if($e)return;const o=Math.max(re[t].mode,n);if(o>re[t].mode&&(re[t].mode=o),o<0)throw _(t),re[t].vAdvised||ee(t||"Parent",`${W(o+2)}${W(2)}`),re[t].vAdvised=!0,W(o+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");o>-1&&je||function(t,n){queueMicrotask(()=>console.info(`%ciframe-resizer ${t}`,D||n<1?"font-weight: bold;":e))}(`v${h} (${(e=>O(C[e]))(o)})`,o),o<1&&ee("Parent",W(3)),$e=!0}const Te=e=>t=>{function n(){if(re[d]){const{iframe:e}=re[d],t={close:ue.bind(null,e),disconnect:de.bind(null,e),removeListeners(){ee(d,"<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize(){ee(d,"<rb>Deprecated Method</>\n \nUse of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As their are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code."),be.bind(null,"Window resize","resize",d)},moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${o=t,o.charAt(0).toUpperCase()+o.slice(1)}`);var o})(e,"string","moveToAnchor(anchor) anchor"),be("Move to anchor",`moveToAnchor:${e}`,d)},sendMessage(e){be("message",`message:${e=JSON.stringify(e)}`,d)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e){const{id:n}=t,{waitForLoad:o}=re[n];M(t,"load",()=>{be(z,`${e}:${ze}`,n),ie(n,re),function(){const e=re[d]?.firstRun,n=re[d]?.heightCalculationMethod in v;!e&&n&&he({iframe:t,height:0,width:0,type:"init"})}()}),!0!==o&&(be($,`${e}:${ze}`,n),ie(n,re))}function i(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&ee(d,`<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>"${y}"</>, <i>"${b}"</> or <i>"${g}"</>.\n`),e):{}}function r(e){const t=re[e]?.iframe?.title;return""===t||void 0===t}function s(e,t){B(re[d],e)&&(ee(d,`<rb>Deprecated option</>\n\nThe <b>${e}</> option has been renamed to <b>${t}</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.`),re[d][t]=re[d][e],delete re[d][e])}const a=e=>B(e,"onMouseEnter")||B(e,"onMouseLeave");function l(e){var n,o;re[d]={...re[d],iframe:t,firstRun:!0,remoteHost:t?.src.split("/").slice(0,3).join("/"),...se,...i(e),mouseEvents:a(e),mode:L(e),syncTitle:r(d)},s("offset","offsetSize"),s("onClose","onBeforeClose"),s("onClosed","onAfterClose"),Y(d,"setup"),function(){const{direction:e}=re[d];switch(e){case y:break;case b:re[d].sizeHeight=!1;case"both":re[d].sizeWidth=!0;break;case g:re[d].sizeWidth=!1,re[d].sizeHeight=!1,re[d].autoResize=!1;break;default:throw new TypeError(d,`Direction value of "${e}" is not valid`)}J(d,`direction: %c${e}`,p)}(),(n=e?.offsetSize||e?.offset)&&(re[d].direction===y?(re[d].offsetHeight=n,J(d,`Offset height: %c${n}`,p)):(re[d].offsetWidth=n,J(d,`Offset width: %c${n}`,p))),function(e){e?.offset&&ee(d,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.")}(e),re[d].warningTimeout||Z(d,"warningTimeout:%c disabled",p),null===re[d].postMessageTarget&&(re[d].postMessageTarget=t.contentWindow),re[d].targetOrigin=!0===re[d].checkOrigin?""===(o=re[d].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}const c=()=>"iframeResizer"in t,d=function(n){if(n&&"string"!=typeof n)throw new TypeError("Invalid id for iFrame. Expected String");return""!==n&&n||(n=function(){let t=e?.id||se.id+ve++;return null!==document.getElementById(t)&&(t+=ve++),t}(),t.id=n,J(n,`Added missing iframe ID: ${n} (${t.src})`)),n}(t.id);if("object"!=typeof e)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=T,e.logExpand=t.includes("ifrlog=expanded"))}(e),function(e,t){const n=B(t,"log"),o="string"==typeof t.log,i=n?!!o||t.log:se.log;B(t,"logExpand")||(t.logExpand=n&&o?t.log===k:se.logExpand),function(e){-1===e?.log&&(e.log=!1,je=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const o=H({expand:t,label:U(n)});D=e,q[n]||(q[n]={console:o})}({enabled:i,expand:t.logExpand,iframeId:e}),o&&!(t.log in x)&&X(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=i}(d,e),K(d,function(e){c()?G(d,`Ignored iframe (${d}), already setup.`):(l(e),function(){if($e)return;const{mode:e}=re[d];-1!==e&&ke(d,e)}(),Me(),function(){switch(J(d,`Iframe scrolling ${re[d]?.scrolling?"enabled":"disabled"} for ${d}`),t.style.overflow=!1===re[d]?.scrolling?"hidden":"auto",re[d]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=re[d]?re[d].scrolling:"no"}}(),function(){const{bodyMargin:e}=re[d];"number"!=typeof e&&"0"!==e||(re[d].bodyMargin=`${e}px`)}(),o(we(d)),n(),J(d,"Setup complete"))})(e),t?.iframeResizer};function xe(){!1===document.hidden&&(J("document","Trigger event: Visibility change"),function(e,t){const n=e=>re[e]?.autoResize&&!re[e]?.firstRun;Object.keys(re).forEach(function(o){n(o)&&be(e,t,o)})}("tabVisible","resize"))}const Me=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{M(window,"message",le),M(document,"visibilitychange",xe),window.iframeParentListener=e=>setTimeout(()=>le({data:e,sameOrigin:!0}))});switch(!0){case void 0===window.jQuery:G("","Unable to bind to jQuery, it is not available.");break;case!window.jQuery.fn:G("","Unable to bind to jQuery, it is not fully loaded.");break;case window.jQuery.fn.iframeResize:G("","iframeResize is already assigned to jQuery.fn.");break;default:window.jQuery.fn.iframeResize=function(e){const t=Te(e);return this.filter("iframe").each((e,n)=>t(n)).end()},window.jQuery.fn.iFrameResize=function(e){return ne("iFrameResize()","iframeResize()","","jQuery"),this.iframeResize(e)}}});
20
+ !function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";const e="font-weight: normal;",t=e+"font-style: italic;",n="default",o=Object.freeze({assert:!0,error:!0,warn:!0}),i={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},s=Object.assign(console);const{fromEntries:a,keys:l}=Object,c=e=>[e,s[e]],d=e=>t=>[t,function(n){e[t]=n}],u=(e,t)=>a(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",m=f?"color: #E3E3E3;":"color: #1F1F1F;",h="5.5.4-beta.3",g="none",y="vertical",b="horizontal",w="[iFrameSizer]",v=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),z="onload",$="init",j=Object.freeze({[z]:1,[$]:1}),k="expanded",T="collapsed",x=Object.freeze({[k]:1,[T]:1}),M=(e,t,n,o)=>e.addEventListener(t,n,o||!1),R=(e,t,n)=>e.removeEventListener(t,n,!1),S=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,i=0;i<e.length;i++)o=e.codePointAt(i),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},O=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),E=["spjluzl","rlf","clyzpvu"],I=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],C=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],A=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),W=e=>O(I[e]),L=e=>{const t=e[O(E[0])]||e[O(E[1])]||e[O(E[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=S(O(e));return n in A&&(t=A[n]),t}(n[0]);return 0===o||(e=>e[2]===S(e[0]+e[1]))(n)||(o=-2),o},B=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),N=e=>e,F=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)),H=(P=function(a={}){const l={},f={},p=[],m={...i,expand:!a.collapsed||i.expanded,...a};let h="";function g(){p.length=0,h=""}function y(){delete m.event,g()}const b=()=>!!p.some(([e])=>e in o)||!!m.expand;function w(){if(0!==p.length){s[b()?"group":"groupCollapsed"](`%c${m.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(m)} %c${m.showTime?h:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)s.assert(e in s,`Unknown console method: ${e}`),e in s&&s[e](...t);s.groupEnd(),y()}else y()}function v(){""===h&&(h=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function z(e,...t){0===p.length&&(v(),queueMicrotask(()=>queueMicrotask(w))),p.push([e,...t])}function $(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...u(m,d(m)),...u(console,e=>[e,(...t)=>z(e,...t)]),...u(r,c),assert:function(e,...t){!0!==e&&z("assert",e,...t)},count:function(e=n){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=n){delete f[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e),w()}return n},event:function(e){v(),m.event=e},purge:g,time:function(e=n){v(),l[e]=performance.now()},timeEnd:function(e=n){$(e),delete l[e]},timeLog:$,touch:v}},P?.__esModule?P.default:P);var P;let q={},D=!1;const U=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const Q=e=>(t,...n)=>q[t]?.console[e](...n),J=(V="log",(e,...t)=>!0===(e=>q[e]?q[e].log:D)(e)?Q(V)(e,...t):null);var V;const Z=J,G=Q("warn"),X=Q("error"),Y=Q("event"),_=Q("purge"),K=Q("errorBoundary");const ee=(e,...t)=>q[e]?q[e].console.warn(F(N)(...t)):queueMicrotask(()=>console?.warn(F((e=>(...t)=>[`iframeResizer(${e})`,...t].join(" "))(e))(...t))),te=(e=>(t,n="renamed to")=>(o,i,r="",s="")=>e(s,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(ee),ne=te("Method"),oe=te("Option");function ie(e,t){const{msgTimeout:n,warningTimeout:o}=t[e];o&&(n&&clearTimeout(n),t[e].msgTimeout=setTimeout(function(){if(void 0===t[e])return;const{ready:n,loadErrorShown:o}=t[e];t[e].msgTimeout=void 0,n||o||(t[e].loadErrorShown=!0,function(e,t){const{iframe:n,waitForLoad:o}=t[e],{sandbox:i}=n,r="object"==typeof i&&i.length>0&&!(i.contains("allow-scripts")&&i.contains("allow-same-origin"));Y(e,"noResponse"),ee(e,`<rb>No response from iframe</>\n \nThe iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <b>'true'</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <b>'false'</>. \n":""}${r?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n":""}\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`)}(e,t))},o))}const re={},se=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:y,inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof re[e.id].onInit&&(oe("init()","onReady()","",e.id),re[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),ae={position:null,version:h};function le(e){function t(){ge(x),me(S),$("onResized",x)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function o(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const i=e=>T.slice(T.indexOf(":")+7+e);const r=(e,t)=>(n,o)=>{const i={};var r,s;r=function(){be(`${n} (${e})`,`${e}:${t()}`,o)},i[s=o]||(r(),i[s]=requestAnimationFrame(()=>{i[s]=null}))},s=(e,t)=>()=>{let n=!1;const o=t=>()=>{re[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame(()=>{n=!1})):a()},i=o("scroll"),r=o("resize window");function s(e,n){J(l,`${e}listeners for send${t}`),n(window,"scroll",i),n(window,"resize",r)}function a(){Y(l,`stop${t}`),s("Remove ",R),c.disconnect(),d.disconnect(),R(re[l].iframe,"load",a)}const l=S,c=new ResizeObserver(o("pageObserver")),d=new ResizeObserver(o("iframeObserver"));re[l]&&(re[l][`stop${t}`]=a,M(re[l].iframe,"load",a),s("Add ",M),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(re[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},a=e=>()=>{e in re[S]&&(re[S][e](),delete re[S][e])},l=r("pageInfo",function(){const e=document.body.getBoundingClientRect(),t=x.iframe.getBoundingClientRect(),{scrollY:n,scrollX:o,innerHeight:i,innerWidth:r}=window,{clientHeight:s,clientWidth:a}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(s,i||0),clientWidth:Math.max(a,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:o,documentHeight:s,documentWidth:a,windowHeight:i,windowWidth:r})}),c=r("parentInfo",function(){const{iframe:e}=x,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:o,height:i,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:o,height:i,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}})}),d=s(l,"PageInfo"),u=s(c,"ParentInfo"),f=a("stopPageInfo"),g=a("stopParentInfo");function y(e){const t=e.getBoundingClientRect();return fe(S),{x:Number(t.left)+Number(ae.position.x),y:Number(t.top)+Number(ae.position.y)}}function b(e){const t=e?y(x.iframe):{x:0,y:0};Z(S,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,m,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(x,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(o,n):function(e){ae.position=e,v(S)}(n)}function v(e){const{x:t,y:n}=ae.position,o=re[e]?.iframe;!1!==$("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?me(e):pe()}function z(e){let t={};if(0===x.width&&0===x.height){const e=i(9).split(":");t={x:e[1],y:e[0]}}else t={x:x.width,y:x.height};$(e,{iframe:x.iframe,screenX:Number(t.x),screenY:Number(t.y),type:x.type})}const $=(e,t)=>ce(S,e,t);function j(){const{height:e,iframe:n,msg:o,type:r,width:s}=x;switch(re[S]?.firstRun&&function(){if(!re[S])return;ke(S,x.mode),re[S].firstRun=!1}(),r){case"close":ue(n);break;case"message":l=i(6),J(S,`onMessage passed: {iframe: %c${x.iframe.id}%c, message: %c${l}%c}`,p,m,p,m),$("onMessage",{iframe:x.iframe,message:JSON.parse(l)});break;case"mouseenter":z("onMouseEnter");break;case"mouseleave":z("onMouseLeave");break;case"beforeUnload":Z(S,"Ready state reset"),re[S].ready=!1;break;case"autoResize":re[S].autoResize=JSON.parse(i(9));break;case"scrollBy":!function(){const e=x.width,t=x.height,n=window.parentIframe||window.parentIFrame||window;Z(S,`scrollBy: x: %c${e}%c y: %c${t}`,p,m,p),n.scrollBy(e,t)}();break;case"scrollTo":b(!1);break;case"scrollToOffset":b(!0);break;case"pageInfo":d();break;case"parentInfo":u();break;case"pageInfoStop":f();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let o=document.getElementById(n)||document.getElementsByName(n)[0];o?function(){const e=y(o);Z(S,`Moving to in page link: %c#${t}`,p),ae.position={x:e.x,y:e.y},v(S),window.location.hash=t}():window.top!==window.self?function(){const e=window.parentIframe||window.parentIFrame;e?e.moveToAnchor(t):J(S,`In page link #${t} not found and window.parentIframe not found`)}():J(S,`In page link #${t} not found`)}(i(9));break;case"title":!function(e,t){re[t]?.syncTitle&&(re[t].iframe.title=e,Z(t,`Set iframe title attribute: %c${e}`,p))}(o,S);break;case"reset":he(x);break;case"init":t(),function(e){try{re[e].sameOrigin=!!re[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){re[e].sameOrigin=!1}J(e,`sameOrigin: %c${re[e].sameOrigin}`,p)}(S),(a=o)!==h&&(void 0!==a?J(S,`Version mismatch (Child: %c${a}%c !== Parent: %c${h})`,p,m,p):ee(S,"<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")),ze=!0,$("onReady",n);break;default:if(0===s&&0===e)return void G(S,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===s||0===e)return void J(S,"Ignoring message with 0 height or width");if(document.hidden)return void J(S,"Page hidden - ignored resize request");t()}var a,l}function k(e){re[e].ready||(be("iframe requested init",we(e),e),ie(e,re))}let T=e.data,x={},S=null;"[iFrameResizerChild]Ready"!==T?w===`${T}`.slice(0,13)&&T.slice(13).split(":")[0]in re?(x=function(){const e=T.slice(13).split(":"),t=e[1]?Number(e[1]):0,i=re[e[0]]?.iframe,r=getComputedStyle(i),s={iframe:i,id:e[0],height:t+n(r)+o(r),width:Number(e[2]),type:e[3],msg:e[4]};return e[5]&&(s.mode=e[5]),s}(),S=x.id,S?(Y(S,x.type),K(S,function(){!function(e){if(!re[e])throw new Error(`${x.type} No settings for ${e}. Message was: ${T}`)}(S),function(){const e=x.type in{true:1,false:1,undefined:1};return e&&J(S,"Ignoring init message from meta parent page"),e}()||(J(S,`Received: %c${T}`,p),re[S].ready=!0,(null!==x.iframe||(G(S,`The iframe (${x.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let o=re[S]?.checkOrigin;if(o&&"null"!=`${t}`&&!(o.constructor===Array?function(){let e=0,n=!1;for(J(S,`Checking connection is from allowed list of origins: %c${o}`,p);e<o.length;e++)if(o[e]===t){n=!0;break}return n}():function(){const e=re[S]?.remoteHost;return J(S,`Checking connection is from: %c${e}`,p),t===e}()))throw new Error(`Unexpected message received from: ${t} for ${x.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&j())})()):G("","iframeResizer received messageData without id, message was: ",T)):null!==S&&J(S,"Ignored:",T):Object.keys(re).forEach(k)}function ce(e,t,n){let o=null,i=null;if(re[e]){if(o=re[e][t],"function"!=typeof o)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{i=o(n)}catch(n){console.error(n),G(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(o,n)}return i}function de(e){const{id:t}=e;J(t,"Disconnected from iframe"),delete re[t],delete e.iframeResizer}function ue(e){const{id:t}=e;if(!1!==ce(t,"onBeforeClose",t)){J(t,`Removing iFrame: %c${t}`,p);try{e.parentNode&&e.remove()}catch(e){G(t,e)}ce(t,"onAfterClose",t),de(e)}else J(t,"Close iframe cancelled by onBeforeClose")}function fe(e){null===ae.position&&(ae.position={x:window.scrollX,y:window.scrollY},J(e,`Get page position: %c${ae.position.x}%c, %c${ae.position.y}`,p,m,p))}function pe(){ae.position=null}function me(e){null!==ae.position&&(window.scrollTo(ae.position.x,ae.position.y),Z(e,`Set page position: %c${ae.position.x}%c, %c${ae.position.y}`,p,m,p),pe())}function he(e){J(e.id,"Size reset requested by "+("init"===e.type?"parent page":"child page")),fe(e.id),ge(e),be("reset","reset",e.id)}function ge(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,Z(n,`Set ${t}: %c${o}`,p)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=re[n];o&&t("height"),i&&t("width")}q=re;const ye=e=>e.split(":").filter((e,t)=>19!==t).join(":");function be(e,t,n){function o(o){const i=e in j?ye(t):t;Z(n,o,p,m,p),Z(n,`Message data: %c${i}`,p)}Y(n,e),re[n]&&(re[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:i,sameOrigin:r,targetOrigin:s}=re[n];if(r)try{return e.contentWindow.iframeChildListener(w+t),void o(`Sending message to iframe %c${n}%c via sameOrigin`)}catch(e){J(n,"Same domain connection failed. Trying cross domain%c")}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${s}`),i.postMessage(w+t,s)}():G(n,`Iframe(${n}) not found`))}function we(e){const t=re[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,ae.version,t.mode,"",t.logExpand].join(":")}let ve=0,ze=!1,$e=!1,je=!1;function ke(t,n=-3){if($e)return;const o=Math.max(re[t].mode,n);if(o>re[t].mode&&(re[t].mode=o),o<0)throw _(t),re[t].vAdvised||ee(t||"Parent",`${W(o+2)}${W(2)}`),re[t].vAdvised=!0,W(o+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");o>-1&&je||function(t,n){queueMicrotask(()=>console.info(`%ciframe-resizer ${t}`,D||n<1?"font-weight: bold;":e))}(`v${h} (${(e=>O(C[e]))(o)})`,o),o<1&&ee("Parent",W(3)),$e=!0}const Te=e=>t=>{function n(){if(re[d]){const{iframe:e}=re[d],t={close:ue.bind(null,e),disconnect:de.bind(null,e),removeListeners(){ee(d,"<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize(){ee(d,"<rb>Deprecated Method</>\n \nUse of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As their are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code."),be.bind(null,"Window resize","resize",d)},moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${o=t,o.charAt(0).toUpperCase()+o.slice(1)}`);var o})(e,"string","moveToAnchor(anchor) anchor"),be("Move to anchor",`moveToAnchor:${e}`,d)},sendMessage(e){be("message",`message:${e=JSON.stringify(e)}`,d)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e){const{id:n}=t,{waitForLoad:o}=re[n];M(t,"load",()=>{be(z,`${e}:${ze}`,n),ie(n,re),function(){const e=re[d]?.firstRun,n=re[d]?.heightCalculationMethod in v;!e&&n&&he({iframe:t,height:0,width:0,type:"init"})}()}),!0!==o&&(be($,`${e}:${ze}`,n),ie(n,re))}function i(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&ee(d,`<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>"${y}"</>, <i>"${b}"</> or <i>"${g}"</>.\n`),e):{}}function r(e){const t=re[e]?.iframe?.title;return""===t||void 0===t}function s(e,t){B(re[d],e)&&(ee(d,`<rb>Deprecated option</>\n\nThe <b>${e}</> option has been renamed to <b>${t}</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.`),re[d][t]=re[d][e],delete re[d][e])}const a=e=>B(e,"onMouseEnter")||B(e,"onMouseLeave");function l(e){var n,o;re[d]={...re[d],iframe:t,firstRun:!0,remoteHost:t?.src.split("/").slice(0,3).join("/"),...se,...i(e),mouseEvents:a(e),mode:L(e),syncTitle:r(d)},s("offset","offsetSize"),s("onClose","onBeforeClose"),s("onClosed","onAfterClose"),Y(d,"setup"),function(){const{direction:e}=re[d];switch(e){case y:break;case b:re[d].sizeHeight=!1;case"both":re[d].sizeWidth=!0;break;case g:re[d].sizeWidth=!1,re[d].sizeHeight=!1,re[d].autoResize=!1;break;default:throw new TypeError(d,`Direction value of "${e}" is not valid`)}J(d,`direction: %c${e}`,p)}(),(n=e?.offsetSize||e?.offset)&&(re[d].direction===y?(re[d].offsetHeight=n,J(d,`Offset height: %c${n}`,p)):(re[d].offsetWidth=n,J(d,`Offset width: %c${n}`,p))),function(e){e?.offset&&ee(d,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.")}(e),re[d].warningTimeout||Z(d,"warningTimeout:%c disabled",p),null===re[d].postMessageTarget&&(re[d].postMessageTarget=t.contentWindow),re[d].targetOrigin=!0===re[d].checkOrigin?""===(o=re[d].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}const c=()=>"iframeResizer"in t,d=function(n){if(n&&"string"!=typeof n)throw new TypeError("Invalid id for iFrame. Expected String");return""!==n&&n||(n=function(){let t=e?.id||se.id+ve++;return null!==document.getElementById(t)&&(t+=ve++),t}(),t.id=n,J(n,`Added missing iframe ID: ${n} (${t.src})`)),n}(t.id);if("object"!=typeof e)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=T,e.logExpand=t.includes("ifrlog=expanded"))}(e),function(e,t){const n=B(t,"log"),o="string"==typeof t.log,i=n?!!o||t.log:se.log;B(t,"logExpand")||(t.logExpand=n&&o?t.log===k:se.logExpand),function(e){-1===e?.log&&(e.log=!1,je=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const o=H({expand:t,label:U(n)});D=e,q[n]||(q[n]={console:o})}({enabled:i,expand:t.logExpand,iframeId:e}),o&&!(t.log in x)&&X(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=i}(d,e),K(d,function(e){c()?G(d,`Ignored iframe (${d}), already setup.`):(l(e),function(){if($e)return;const{mode:e}=re[d];-1!==e&&ke(d,e)}(),Me(),function(){switch(J(d,`Iframe scrolling ${re[d]?.scrolling?"enabled":"disabled"} for ${d}`),t.style.overflow=!1===re[d]?.scrolling?"hidden":"auto",re[d]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=re[d]?re[d].scrolling:"no"}}(),function(){const{bodyMargin:e}=re[d];"number"!=typeof e&&"0"!==e||(re[d].bodyMargin=`${e}px`)}(),o(we(d)),n(),J(d,"Setup complete"))})(e),t?.iframeResizer};function xe(){!1===document.hidden&&(J("document","Trigger event: Visibility change"),function(e,t){const n=e=>re[e]?.autoResize&&!re[e]?.firstRun;Object.keys(re).forEach(function(o){n(o)&&be(e,t,o)})}("tabVisible","resize"))}const Me=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{M(window,"message",le),M(document,"visibilitychange",xe),window.iframeParentListener=e=>setTimeout(()=>le({data:e,sameOrigin:!0}))});switch(!0){case void 0===window.jQuery:G("","Unable to bind to jQuery, it is not available.");break;case!window.jQuery.fn:G("","Unable to bind to jQuery, it is not fully loaded.");break;case window.jQuery.fn.iframeResize:G("","iframeResize is already assigned to jQuery.fn.");break;default:window.jQuery.fn.iframeResize=function(e){const t=Te(e);return this.filter("iframe").each((e,n)=>t(n)).end()},window.jQuery.fn.iFrameResize=function(e){return ne("iFrameResize()","iframeResize()","","jQuery"),this.iframeResize(e)}}});
21
21
  //# sourceMappingURL=index.umd.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iframe-resizer/jquery",
3
- "version": "5.5.4-beta.2",
3
+ "version": "5.5.4-beta.3",
4
4
  "license": "GPL-3.0",
5
5
  "homepage": "https://iframe-resizer.com",
6
6
  "author": {
@@ -34,6 +34,6 @@
34
34
  "jquery"
35
35
  ],
36
36
  "dependencies": {
37
- "@iframe-resizer/core": "5.5.4-beta.2"
37
+ "@iframe-resizer/core": "5.5.4-beta.3"
38
38
  }
39
39
  }