@iframe-resizer/child 5.4.7-beta.4 → 5.4.7

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
@@ -22,4 +22,4 @@ yarn add @iframe-resizer/child
22
22
 
23
23
  ---
24
24
 
25
- _iframe-resizer version 5.4.7-beta.4 2025-06-30 - 16:51:23.328Z_
25
+ _iframe-resizer version 5.4.7 2025-07-08 - 11:34:37.580Z_
package/index.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/child 5.4.7-beta.4 (cjs) - 2025-06-30
4
+ * @module iframe-resizer/child 5.4.7 (cjs) - 2025-07-08
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,4 @@
17
17
  */
18
18
 
19
19
 
20
- "use strict";const e=require("auto-console-group"),t="5.4.7-beta.4",n=10,o="data-iframe-size",r="data-iframe-overflowed",i="data-iframe-ignore",a="bottom",s="right",l="autoResizeEnabled",c=Symbol("sizeChanged"),u="manualResize",d="parentResize",m={[u]:1,[d]:1},f="setOffsetSize",p="resizeObserver",h="overflowObserver",g="mutationObserver",y="none",b="No change in content size detected",v="init",z=(e,t,n,o)=>e.addEventListener(t,n,o||!1),w=["<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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const $=e=>(e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(w[e]),I=(e,...t)=>setTimeout((()=>e(...t)),0),S=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},H=e=>e,T=e=>Math.round(1e3*e)/1e3,O=e=>e.charAt(0).toUpperCase()+e.slice(1),E=e=>""!=`${e}`&&void 0!==e;function M(e){switch(!0){case!E(e):return"";case E(e.id):return`${e.nodeName}#${e.id}`;case E(e.name):return`${e.nodeName} (${e.name}`;case E(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}const k=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${O(t)}`)};let j=!0;var G;const A=(G=e,G?.__esModule?G.default:G)({label:"iframeResizer(child)"});const L=(R="log",(...e)=>!j||A[R](...e));var R;const C=L,{assert:P,debug:x,endAutoGroup:N,error:B,errorBoundary:q,event:D,label:F,purge:W,warn:U}=A,V=e=>{return A.warn((t=H,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},Z=V,J=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,t)=>V(t))),_=J("Method"),Q=J("Method","replaced with"),Y=J("Option"),X=["min-height","min-width","max-height","max-width"],K=new Set,ee=e=>e.tagName?e.tagName.toLowerCase():"unknown",te=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),ne=(e,t)=>{return(n=te(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function oe({href:e}){K.has(e)||(L("Unable to access stylesheet:",e),K.add(e))}const re=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){oe(n)}return{source:"cross-origin stylesheet",value:te(e,t)}}(e,t),ie=(e,t)=>{const{source:n,value:o}=re(e,t),r=ee(e);V(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function ae(){for(const e of[document.documentElement,document.body])for(const t of X)L(`Checking <${ee(e)}> for blocking CSS: ${t}`),ne(e,t)&&ie(e,t)}const se=e=>t=>void 0===t?void 0:e(t),le=se((e=>"true"===e)),ce=se(Number),ue="--ifr-start",de="--ifr-end",me=[],fe=new WeakSet,pe=e=>"object"==typeof e&&fe.add(e);let he={},ge=0;const ye=setInterval((()=>{if(me.length<10)return;if(he.hasTags&&he.len<25)return;me.sort();const e=Math.min(me.reduce(((e,t)=>e+t),0)/me.length,me[Math.floor(me.length/2)]),t=T(e);t>ge&&(ge=t,D("performanceObserver"),L("Mean time:",T(me[Math.floor(me.length/2)])),L("Median time:",T(me.reduce(((e,t)=>e+t),0)/me.length)),L("Average time:",t),L("Max time:",T(Math.max(...me)))),e<=4||(clearInterval(ye),V(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${T(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${he.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function be(e){e.getEntries().forEach((e=>{if(e.name===de){const{duration:t}=performance.measure("--ifr-measure",ue,de);he=e.detail,me.push(t),me.length>100&&me.shift()}}))}function ve(){new PerformanceObserver(be).observe({entryTypes:["mark"]}),pe(document.documentElement),pe(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",ve):ve());const ze=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},we=ze("function"),$e=ze("number"),Ie=ze("string");"undefined"!=typeof window&&function(){const w={height:()=>(U("Custom height calculation function not defined"),St.auto()),width:()=>(U("Custom width calculation function not defined"),Ht.auto())},E={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},G={},R="auto",B="[iFrameSizer]",W="scroll";let J,X,K,ee,te,ne,oe,re=!0,ie="",se=0,me="",fe="",pe=!1,he=!0,ge=!1,ye=!0,be=!1,ve=!1,ze=!1,Se=1,He=R,Te="",Oe=!0,Ee={},Me=!0,ke=!1,je="",Ge=0,Ae=!1,Le="",Re=H,Ce=[],Pe="child",xe=null,Ne=!1,Be="",qe=[],De=window.parent,Fe="*",We=0,Ue=!1,Ve=1,Ze=W,Je=window,_e=()=>{U("onMessage function not defined")},Qe=()=>{},Ye=null,Xe=null;function Ke(c){var d,m,p;!function(e){Le=e[0]??Le,se=ce(e[1])??se,ge=le(e[2])??ge,ke=le(e[3])??ke,re=le(e[6])??re,me=e[7]??me,He=e[8]??He,ie=e[9]??ie,fe=e[10]??fe,We=ce(e[11])??We,Ee.enable=le(e[12])??!1,Pe=e[13]??Pe,Ze=e[14]??Ze,Ae=le(e[15])??Ae,J=ce(e[16])??J,X=ce(e[17])??X,he=le(e[18])??he,je=e[19]??je,ne=e[20]??ne,Ge=ce(e[21])??Ge,Me=le(e[23])??Me}(c),d={id:Le,enabled:ke,expand:Me},A.label(`${d.id}`),A.expand(d.expand),j=d.enabled,L(`Initialising iframe v${t} ${window.location.href}`),function(){function t(e){L("Reading data from page:",e),oe=we(e,"onBeforeResize")??oe,_e=we(e,"onMessage")??_e,Qe=we(e,"onReady")??Qe,"number"==typeof e?.offset&&(Y("offset","offsetSize"),he&&(J=$e(e,"offset")??J),ge&&(X=$e(e,"offset")??X)),"number"==typeof e?.offsetSize&&(he&&(J=$e(e,"offsetSize")??J),ge&&(X=$e(e,"offsetSize")??X)),Te=Ie(e,"ignoreSelector")??Te,Be=Ie(e,"sizeSelector")??Be,Fe=Ie(e,"targetOrigin")??Fe,He=e?.heightCalculationMethod||He,Ze=e?.widthCalculationMethod||Ze}function n(e,t){return"function"==typeof e&&(V(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),w[t]=e,e="custom"),e}if(1===Ge)return;const o=window.iframeResizer||window.iFrameResizer;"object"==typeof o&&(t(o),He=n(He,"height"),Ze=n(Ze,"width"),C(`Set targetOrigin for parent: %c${Fe}`,e.HIGHLIGHT))}(),ct(),function(){try{Ne=1===Ge||"iframeParentListener"in window.parent}catch(e){L("Cross domain iframe detected")}}(),ge===he&&(pe=!0),Ge<0?Z(`${$(Ge+2)}${$(2)}`):ne?.codePointAt(0)>4||Ge<2&&Z($(3)),ne&&""!==ne&&"false"!==ne?ne!==t&&V(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ne} - Child page: ${t}.\n`):V("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n"),mt(),ft(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(o,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&V("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),"BackCompat"===document.compatMode&&V("<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n"),ot(),pe||ae(),1!==Ge&&(Je.parentIframe=Object.freeze({autoResize:e=>(k(e,"boolean","parentIframe.autoResize(enable) enable"),!1===ge&&!1===he?(D(l),V(`Auto Resize can not be changed when <b>direction</> is set to '${y}'.`),!1):(!0===e&&!1===re?(re=!0,queueMicrotask((()=>kt(l,"Auto Resize enabled")))):!1===e&&!0===re&&(re=!1),Gt(0,0,"autoResize",JSON.stringify(re)),re)),close(){Gt(0,0,"close")},getId:()=>Le,getOrigin:()=>(_("getOrigin()","getParentOrigin()"),K),getParentOrigin:()=>K,getPageInfo(e){if("function"==typeof e)return Ye=e,Gt(0,0,"pageInfo"),void Q("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Ye=null,Gt(0,0,"pageInfoStop")},getParentProps:e=>(k(e,"function","parentIframe.getParentProps(callback) callback"),Xe=e,Gt(0,0,"parentInfo"),()=>{Xe=null,Gt(0,0,"parentInfoStop")}),getParentProperties(e){_("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){k(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Ee.findTarget(e)},reset(){!function(){const t=He;He=R,L("Reset trigger event: %cparentIframe.reset",e.HIGHLIGHT),Ue?L("TriggerLock blocked calculation"):(Ue=!0,x("Trigger event lock on"),requestAnimationFrame((()=>{Ue=!1,x("Trigger event lock off")}))),jt("reset"),He=t}()},setOffsetSize(e){k(e,"number","parentIframe.setOffsetSize(offset) offset"),J=e,X=e,kt(f,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){k(e,"number","parentIframe.scrollBy(x, y) x"),k(t,"number","parentIframe.scrollBy(x, y) y"),Gt(t,e,"scrollBy")},scrollTo(e,t){k(e,"number","parentIframe.scrollTo(x, y) x"),k(t,"number","parentIframe.scrollTo(x, y) y"),Gt(t,e,"scrollTo")},scrollToOffset(e,t){k(e,"number","parentIframe.scrollToOffset(x, y) x"),k(t,"number","parentIframe.scrollToOffset(x, y) y"),Gt(t,e,"scrollToOffset")},sendMessage(e,t){t&&k(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Gt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){He=e,mt()},setWidthCalculationMethod(e){Ze=e,ft()},setTargetOrigin(t){k(t,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),L(`Set targetOrigin: %c${t}`,e.HIGHLIGHT),Fe=t},resize(e,t){e&&k(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&k(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),kt(u,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){_("size()","resize()"),this.resize(e,t)}}),Je.parentIFrame=Je.parentIframe),function(){function t(e){Gt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function n(n,o){L(`Add event listener: %c${o}`,e.HIGHLIGHT),z(window.document,n,t)}!0===Ae&&(n("mouseenter","Mouse Enter"),n("mouseleave","Mouse Leave"))}(),Ee=function(){const t=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function o(e){const o=e.getBoundingClientRect(),r=t();return{x:parseInt(o.left,n)+parseInt(r.x,n),y:parseInt(o.top,n)+parseInt(r.y,n)}}function r(t){function n(t){const n=o(t);L(`Moving to in page link (%c#${r}%c) at x: %c${n.x}%c y: %c${n.y}`,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT),Gt(n.y,n.x,"scrollToOffset")}const r=t.split("#")[1]||t,i=decodeURIComponent(r),a=document.getElementById(i)||document.getElementsByName(i)[0];void 0===a?(L(`In page link (#${r}) not found in iFrame, so sending to parent`),Gt(0,0,"inPageLink",`#${r}`)):n(a)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&r(t)}function a(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&z(e,"click",(t=>{t.preventDefault(),r(e.getAttribute("href"))}))}function s(){z(window,"hashchange",i)}function l(){setTimeout(i,128)}function c(){L("Setting up location.hash handlers"),a(),s(),l()}return Ee.enable?1===Ge?V("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):c():L("In page linking not enabled"),{findTarget:r}}(),void 0===me&&(me=`${se}px`),st("margin",(m="margin",(p=me).includes("-")&&(U(`Negative CSS value ignored for ${m}`),p=""),p)),st("background",ie),st("padding",fe),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),pe||function(){const t=e=>e.style.setProperty("height","auto","important");t(document.documentElement),t(document.body),L("Set HTML & body height: %cauto !important",e.HIGHLIGHT)}(),!0!==re&&L("Auto Resize disabled"),function(e){ut({method:e,eventType:"After Print",eventName:"afterprint"}),ut({method:e,eventType:"Before Print",eventName:"beforeprint"}),ut({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const t=new Set,n=[];let r=!1,a=0;const s=e=>{C("Mutations observed:",e);for(const n of e){const{addedNodes:e,removedNodes:o}=n;for(const n of e)t.add(n);for(const e of o)t.delete(e)}},l=16,c=2,u=200;let d=1;function m(e){ct(),rt(e),e.forEach(gt),e.clear()}function f(){const o=performance.now(),i=o-a,p=l*d+++c;if(i>p&&i<u)return C("Backed off due to heavy workload on callStack"),L(`Delay: %c${T(i)}ms %c> Delay limit: %c${p}ms`,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT),setTimeout(f,l*d),void(a=o);d=1,n.forEach(s),n.length=0,t.size>0&&m(t),ot(),tt(),r=!1,kt(g,"Mutation Observed")}function p(e){n.push(e),r||(a=performance.now(),r=!0,requestAnimationFrame(f))}function h(){const e=new window.MutationObserver(p),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[i,o],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return L("Setup <body> MutationObserver"),e.observe(t,n),e}h()}(),L("Setup ResizeObserver"),xe=new ResizeObserver(pt),xe.observe(document.body),ht.add(document.body),gt(document.body),he!==ge&&(L("Setup OverflowObserver"),Re=(e=>{const t=e.side||a,n=e.onChange||H,o={root:e.root,rootMargin:"0px",threshold:1},i=window?.requestAnimationFrame||H,s=(e=!1)=>n(e),l=(e,n)=>0===e||e>n[t],c=(e,t)=>e.toggleAttribute(r,t),u=new IntersectionObserver((function(e){for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,a=e[t],s=l(a,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);c(i,s)}var n;i(s)}),o),d=new WeakSet;return function(e){L("Attached overflowObservers");for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=d.has(t);!n&&e?(u.observe(t),d.add(t)):P(!n,"Node already observed",t)}}})({onChange:nt,root:document.documentElement,side:he?a:s})),rt(vt(document)()),et(S(Qe)),L("Initialization complete"),kt(v,"Init message from host page",void 0,void 0,t),document.title&&""!==document.title&&Gt(0,0,"title",document.title)}function et(e){"complete"===document.readyState?I(e):z(document,"readystatechange",(()=>et(e)))}function tt(){const e=document.querySelectorAll(`[${r}]`);Ce=Array.from(e).filter((e=>!e.closest(`[${i}]`))),ve=Ce.length>0}function nt(e){tt(),(ve||e)&&(ve?C("Overflowed Elements:",...Ce):C("Overflow removed"),kt(h,"Overflow updated"))}function ot(){qe=document.querySelectorAll(`[${o}]`),ze=qe.length>0,L(`Tagged elements found: %c${ze}`,e.HIGHLIGHT)}function rt(e){ze||Re(e)}let it=0;function at(){const t=document.querySelectorAll(`*[${i}]`);be=t.length>0,be&&t.length!==it&&(function(t){const n=1===t.length?"":"s";U(`%c[${i}]%c found on %c${t.length}%c element${n}`,e.BOLD,e.NORMAL,e.BOLD,e.NORMAL)}(t),it=t.length)}function st(t,n){void 0!==n&&""!==n&&"null"!==n&&(document.body.style.setProperty(t,n),C(`Set body ${t}: %c${n}`,e.HIGHLIGHT))}function lt(t,n,o){if(""!==o){L(`${t}: %c${o}`,e.HIGHLIGHT);for(const e of document.querySelectorAll(o))L(`Applying ${n} to:`,e),e.toggleAttribute(n,!0)}}function ct(){lt("sizeSelector",o,Be),lt("ignoreSelector",i,Te)}function ut(t){({add(e){function n(){kt(t.eventName,t.eventType)}G[e]=n,z(window,e,n,{passive:!0})},remove(e){const t=G[e];var n,o;delete G[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[t.method](t.eventName),L(`${O(t.method)} event listener: %c${t.eventType}`,e.HIGHLIGHT)}function dt(t,n,o,r){return n!==t&&(t in o||(U(`${t} is not a valid option for ${r}CalculationMethod.`),t=n),t in E)&&V(`<rb>Deprecated ${r}CalculationMethod (${t})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${r} calculation method. It is recommended that you ${ne?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),L(`Set ${r} calculation method: %c${t}`,e.HIGHLIGHT),t}function mt(){He=dt(He,R,St,"height")}function ft(){Ze=dt(Ze,W,Ht,"width")}function pt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;kt(p,`Element resized <${M(t)}>`)}const ht=new WeakSet;function gt(t){if(t.nodeType!==Node.ELEMENT_NODE)return;if(!ht.has(t)){const n=getComputedStyle(t)?.position;""!==n&&"static"!==n&&(xe.observe(t),ht.add(t),L(`Attached resizeObserver: %c${M(t)}`,e.HIGHLIGHT))}const n=vt(t)();for(const t of n){if(ht.has(t)||t?.nodeType!==Node.ELEMENT_NODE)continue;const n=getComputedStyle(t)?.position;""!==n&&"static"!==n&&(xe.observe(t),ht.add(t),L(`Attached resizeObserver: %c${M(t)}`,e.HIGHLIGHT))}}function yt(e){performance.mark(ue);const t=O(e);let n=0,o=document.documentElement,r=ze?0:document.documentElement.getBoundingClientRect().bottom;const i=ze?qe:ve?Ce:vt(document)();for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return C(`${t} position calculated from:`,o),performance.mark(de,{detail:{hasTags:ze,len:i.length,logging:ke,Side:t}}),r}const bt=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],vt=e=>()=>{at();const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return be&&t.push(`not([${i}])`,`not([${i}] *)`),e.querySelectorAll(t.join(":"))},zt={height:0,width:0},wt={height:0,width:0},$t=[e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT];function It(t){function n(){return wt[r]=i,zt[r]=l,i}const o=t===St,r=o?"height":"width",i=t.boundingClientRect(),a=Math.ceil(i),s=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(t),c=`HTML: %c${i}px %cPage: %c${l}px`;let u=0;switch(!0){case!t.enabled():return l;case ze:C("Found element with data-iframe-size attribute"),u=t.taggedElement();break;case!ve&&0===wt[r]&&0===zt[r]:C(`Initial page size values: ${c}`,...$t),u=n();break;case Ue&&i===wt[r]&&l===zt[r]:C(`Size unchanged: ${c}`,...$t),u=Math.max(i,l);break;case 0===i:C(`Page is hidden: ${c}`,...$t),u=l;break;case!ve&&i!==wt[r]&&l<=zt[r]:C(`New <html> size: ${c} `,...$t),C(`Previous <html> size: %c${wt[r]}px`,e.HIGHLIGHT),u=n();break;case!o:u=t.taggedElement();break;case!ve&&i<wt[r]:C(`<html> size decreased: ${c}`,...$t),u=n();break;case l===s||l===a:C(`<html> size equals page size: ${c}`,...$t),u=n();break;case i>l:C(`Page size < <html> size: ${c}`,...$t),u=n();break;case ve:C("Found element overflowing <html> "),u=t.taggedElement();break;default:C(`Using <html> size: ${c}`,...$t),u=n()}return C(`Content ${r}: %c${u}px`,e.HIGHLIGHT),u+=function(t){const n=t.getOffset();return 0!==n&&C(`Page offsetSize: %c${n}px`,e.HIGHLIGHT),n}(t),u}const St={enabled:()=>he,getOffset:()=>J,auto:()=>It(St),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,n)+parseInt(t.marginBottom,n)},bodyScroll:()=>document.body.scrollHeight,offset:()=>St.bodyOffset(),custom:()=>w.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...bt(St)),min:()=>Math.min(...bt(St)),grow:()=>St.max(),lowestElement:()=>yt(a),taggedElement:()=>yt(a)},Ht={enabled:()=>ge,getOffset:()=>X,auto:()=>It(Ht),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>w.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...bt(Ht)),min:()=>Math.min(...bt(Ht)),rightMostElement:()=>yt(s),scroll:()=>Math.max(Ht.bodyScroll(),Ht.documentElementScroll()),taggedElement:()=>yt(s)},Tt=(e,t)=>!(Math.abs(e-t)<=We);function Ot(e,t){const n=e[t]();return e.enabled()&&void 0!==oe?function(e){const t=oe(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);return t}(n):n}let Et=!1;const Mt=S((()=>Z($(4)))),kt=q(((t,n,o,r,i)=>{if(te=performance.now(),ee=!0,D(t),!0!==Et)return re||t in m?void(document.hidden?L("Page hidden - Ignored resize request"):(Et=!0,requestAnimationFrame((()=>{Et=!1})),function(t,n,o,r,i){const a=o??Ot(St,He),s=r??Ot(Ht,Ze),u=he&&Tt(Se,a)||ge&&Tt(Ve,s)?c:t;switch(L(`Resize event: %c${n}`,e.HIGHLIGHT),u){case v:case l:case c:Se=a,Ve=s;case f:Gt(Se,Ve,t,i);break;case p:case h:case g:L(b);break;default:C(b)}ee=!1}(t,n,o,r,i))):(C("Resizing disabled"),void N())}));function jt(e){Se=St[He](),Ve=Ht[Ze](),Gt(Se,Ve,e)}const Gt=q((function(t,n,o,r,i){Ge<-1||(D(o),void 0!==i?L(`Message targetOrigin: %c${i}`,e.HIGHLIGHT):i=Fe,function(){const a=`${Le}:${t}:${n}:${o}${void 0===r?"":`:${r}`}`;if(Ne)try{window.parent.iframeParentListener(B+a)}catch(e){if(1!==Ge)throw e;return void Mt()}else De.postMessage(B+a,i);ee&&L(function(){const e=T(performance.now()-te);return o===v?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),e.HIGHLIGHT),C(`Sending message to parent page via ${Ne?"sameOrigin":"postMessage"}: %c%c${a}`,e.ITALIC,e.HIGHLIGHT)}(),N())})),At=q((function(t){D("onMessage");const{freeze:n}=Object,{parse:o}=JSON,r=e=>n(o(e)),i=e=>Gt(0,0,`${e}Stop`),a={init:function(){if("loading"===document.readyState)return void L("Page not ready, ignoring init message");const e=t.data.slice(13).split(":");De=t.source,K=t.origin,Ke(e),ye=!1,setTimeout((()=>{Oe=!1}),128)},reset(){Oe?L("Page reset ignored by init"):(L("Page size reset by host page"),jt("resetPage"))},resize(){L("Resize requested by host page"),kt(d,"Parent window requested size check")},moveToAnchor(){Ee.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();L("PageInfo received from parent:",r(e)),Ye?I(Ye,o(e)):i("pageInfo")},parentInfo(){const e=r(l());L("ParentInfo received from parent:",e),Xe?I(Xe,e):i("parentInfo")},message(){const t=l();L("onMessage called from parent:%c",e.HIGHLIGHT,r(t)),I(_e,o(t))}},s=()=>t.data.split("]")[1].split(":")[0],l=()=>t.data.slice(t.data.indexOf(":")+1),c=()=>t.data.split(":")[2]in{true:1,false:1};function u(){const e=s();D(e),e in a?a[e]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||c()||U(`Unexpected message (${t.data})`)}B===`${t.data}`.slice(0,13)&&function(){if(!1!==ye)return c()?(F(s()),D(v),void a.init()):void L(`Ignored message of type "${s()}". Received before initialization.`);u()}()}));function Lt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?U("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>At({data:e,sameOrigin:!0}))),z(window,"message",At),z(window,"readystatechange",Lt),Lt())}();
21
- //# sourceMappingURL=index.cjs.js.map
20
+ "use strict";const e=require("auto-console-group"),t="5.4.7",n=10,o="data-iframe-size",r="data-iframe-overflowed",i="data-iframe-ignore",a="bottom",s="right",l="autoResizeEnabled",c=Symbol("sizeChanged"),u="manualResize",d="parentResize",m={[u]:1,[d]:1},f="setOffsetSize",p="resizeObserver",h="overflowObserver",y="mutationObserver",g="none",b="init",v=(e,t,n,o)=>e.addEventListener(t,n,o||!1),z=["<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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const w=e=>(e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(z[e]),$=(e,...t)=>setTimeout((()=>e(...t)),0),S=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},O=e=>e,I=e=>Math.round(1e3*e)/1e3,E=e=>e.charAt(0).toUpperCase()+e.slice(1),T=e=>""!=`${e}`&&void 0!==e;const j=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${E(t)}`)};let k=!0;var M;const C=(M=e,M?.__esModule?M.default:M)({label:"iframeResizer(child)"});var x;const A=(x="log",(...e)=>!k||C[x](...e)),{assert:N,debug:P,endAutoGroup:R,error:L,errorBoundary:H,event:B,label:q,purge:G,warn:W}=C,D=e=>{return C.warn((t=O,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},F=D,U=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,t)=>D(t))),V=U("Method"),Z=U("Method","replaced with"),J=U("Option"),_=["min-height","min-width","max-height","max-width"],Q=new Set,Y=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),X=(e,t)=>{return(n=Y(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function K({href:e}){Q.has(e)||Q.add(e)}const ee=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){K(n)}return{source:"cross-origin stylesheet",value:Y(e,t)}}(e,t),te=(e,t)=>{const{source:n,value:o}=ee(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);D(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function ne(){for(const e of[document.documentElement,document.body])for(const t of _)X(e,t)&&te(e,t)}const oe=e=>t=>void 0===t?void 0:e(t),re=oe((e=>"true"===e)),ie=oe(Number),ae="--ifr-start",se="--ifr-end",le=[],ce=new WeakSet,ue=e=>"object"==typeof e&&ce.add(e);let de={},me=0;const fe=setInterval((()=>{if(le.length<10)return;if(de.hasTags&&de.len<25)return;le.sort();const e=Math.min(le.reduce(((e,t)=>e+t),0)/le.length,le[Math.floor(le.length/2)]),t=I(e);t>me&&(me=t,B("performanceObserver")),e<=4||(clearInterval(fe),D(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${I(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${de.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function pe(e){e.getEntries().forEach((e=>{if(e.name===se){const{duration:t}=performance.measure("--ifr-measure",ae,se);de=e.detail,le.push(t),le.length>100&&le.shift()}}))}function he(){new PerformanceObserver(pe).observe({entryTypes:["mark"]}),ue(document.documentElement),ue(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",he):he());const ye=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},ge=ye("function"),be=ye("number"),ve=ye("string");"undefined"!=typeof window&&function(){const z={height:()=>(W("Custom height calculation function not defined"),vt.auto()),width:()=>(W("Custom width calculation function not defined"),zt.auto())},I={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},M={},x="auto",P="[iFrameSizer]",L="scroll";let U,_,Q,Y,X,K=!0,ee="",te=0,oe="",le="",ce=!1,ue=!0,de=!1,me=!0,fe=!1,pe=!1,he=!1,ye=1,ze=x,we="",$e=!0,Se={},Oe=!0,Ie=!1,Ee="",Te=0,je=!1,ke="",Me=O,Ce=[],xe="child",Ae=null,Ne=!1,Pe="",Re=[],Le=window.parent,He="*",Be=0,qe=!1,Ge=1,We=L,De=window,Fe=()=>{W("onMessage function not defined")},Ue=()=>{},Ve=null,Ze=null;function Je(c){var d,m,p;!function(e){ke=e[0]??ke,te=ie(e[1])??te,de=re(e[2])??de,Ie=re(e[3])??Ie,K=re(e[6])??K,oe=e[7]??oe,ze=e[8]??ze,ee=e[9]??ee,le=e[10]??le,Be=ie(e[11])??Be,Se.enable=re(e[12])??!1,xe=e[13]??xe,We=e[14]??We,je=re(e[15])??je,U=ie(e[16])??U,_=ie(e[17])??_,ue=re(e[18])??ue,Ee=e[19]??Ee,Y=e[20]??Y,Te=ie(e[21])??Te,Oe=re(e[23])??Oe}(c),d={id:ke,enabled:Ie,expand:Oe},C.label(`${d.id}`),C.expand(d.expand),k=d.enabled,function(){function t(e){X=ge(e,"onBeforeResize")??X,Fe=ge(e,"onMessage")??Fe,Ue=ge(e,"onReady")??Ue,"number"==typeof e?.offset&&(J("offset","offsetSize"),ue&&(U=be(e,"offset")??U),de&&(_=be(e,"offset")??_)),"number"==typeof e?.offsetSize&&(ue&&(U=be(e,"offsetSize")??U),de&&(_=be(e,"offsetSize")??_)),we=ve(e,"ignoreSelector")??we,Pe=ve(e,"sizeSelector")??Pe,He=ve(e,"targetOrigin")??He,ze=e?.heightCalculationMethod||ze,We=e?.widthCalculationMethod||We}function n(e,t){return"function"==typeof e&&(D(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),z[t]=e,e="custom"),e}if(1===Te)return;const o=window.iframeResizer||window.iFrameResizer;"object"==typeof o&&(t(o),ze=n(ze,"height"),We=n(We,"width"),A(`Set targetOrigin for parent: %c${He}`,e.HIGHLIGHT))}(),rt(),function(){try{Ne=1===Te||"iframeParentListener"in window.parent}catch(e){}}(),de===ue&&(ce=!0),Te<0?F(`${w(Te+2)}${w(2)}`):Y?.codePointAt(0)>4||Te<2&&F(w(3)),Y&&""!==Y&&"false"!==Y?Y!==t&&D(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Y} - Child page: ${t}.\n`):D("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n"),st(),lt(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(o,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&D("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),"BackCompat"===document.compatMode&&D("<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n"),Xe(),ce||ne(),1!==Te&&(De.parentIframe=Object.freeze({autoResize:e=>(j(e,"boolean","parentIframe.autoResize(enable) enable"),!1===de&&!1===ue?(B(l),D(`Auto Resize can not be changed when <b>direction</> is set to '${g}'.`),!1):(!0===e&&!1===K?(K=!0,queueMicrotask((()=>It(l,"Auto Resize enabled")))):!1===e&&!0===K&&(K=!1),Tt(0,0,"autoResize",JSON.stringify(K)),K)),close(){Tt(0,0,"close")},getId:()=>ke,getOrigin:()=>(V("getOrigin()","getParentOrigin()"),Q),getParentOrigin:()=>Q,getPageInfo(e){if("function"==typeof e)return Ve=e,Tt(0,0,"pageInfo"),void Z("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Ve=null,Tt(0,0,"pageInfoStop")},getParentProps:e=>(j(e,"function","parentIframe.getParentProps(callback) callback"),Ze=e,Tt(0,0,"parentInfo"),()=>{Ze=null,Tt(0,0,"parentInfoStop")}),getParentProperties(e){V("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){j(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Se.findTarget(e)},reset(){!function(){const e=ze;ze=x,qe||(qe=!0,requestAnimationFrame((()=>{qe=!1}))),Et("reset"),ze=e}()},setOffsetSize(e){j(e,"number","parentIframe.setOffsetSize(offset) offset"),U=e,_=e,It(f,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){j(e,"number","parentIframe.scrollBy(x, y) x"),j(t,"number","parentIframe.scrollBy(x, y) y"),Tt(t,e,"scrollBy")},scrollTo(e,t){j(e,"number","parentIframe.scrollTo(x, y) x"),j(t,"number","parentIframe.scrollTo(x, y) y"),Tt(t,e,"scrollTo")},scrollToOffset(e,t){j(e,"number","parentIframe.scrollToOffset(x, y) x"),j(t,"number","parentIframe.scrollToOffset(x, y) y"),Tt(t,e,"scrollToOffset")},sendMessage(e,t){t&&j(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Tt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){ze=e,st()},setWidthCalculationMethod(e){We=e,lt()},setTargetOrigin(e){j(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),He=e},resize(e,t){e&&j(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&j(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),It(u,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){V("size()","resize()"),this.resize(e,t)}}),De.parentIFrame=De.parentIframe),function(){function e(e){Tt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){v(window.document,t,e)}!0===je&&(t("mouseenter"),t("mouseleave"))}(),Se=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function t(t){const o=t.getBoundingClientRect(),r=e();return{x:parseInt(o.left,n)+parseInt(r.x,n),y:parseInt(o.top,n)+parseInt(r.y,n)}}function o(e){function n(e){const n=t(e);Tt(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,r=decodeURIComponent(o),i=document.getElementById(r)||document.getElementsByName(r)[0];void 0===i?Tt(0,0,"inPageLink",`#${o}`):n(i)}function r(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function i(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&v(e,"click",(t=>{t.preventDefault(),o(e.getAttribute("href"))}))}function a(){v(window,"hashchange",r)}function s(){setTimeout(r,128)}function l(){i(),a(),s()}return Se.enable&&(1===Te?D("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):l()),{findTarget:o}}(),void 0===oe&&(oe=`${te}px`),nt("margin",(m="margin",(p=oe).includes("-")&&(W(`Negative CSS value ignored for ${m}`),p=""),p)),nt("background",ee),nt("padding",le),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),ce||function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),function(e){it({method:e,eventType:"After Print",eventName:"afterprint"}),it({method:e,eventType:"Before Print",eventName:"beforeprint"}),it({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,r=0;const a=t=>{A("Mutations observed:",t);for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},s=16,l=2,c=200;let u=1;function d(e){rt(),Ke(e),e.forEach(dt),e.clear()}function m(){const o=performance.now(),i=o-r;if(i>s*u+++l&&i<c)return A("Backed off due to heavy workload on callStack"),setTimeout(m,s*u),void(r=o);u=1,t.forEach(a),t.length=0,e.size>0&&d(e),Xe(),Qe(),n=!1,It(y,"Mutation Observed")}function f(e){t.push(e),n||(r=performance.now(),n=!0,requestAnimationFrame(m))}function p(){const e=new window.MutationObserver(f),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[i,o],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return e.observe(t,n),e}p()}(),Ae=new ResizeObserver(ct),Ae.observe(document.body),ut.add(document.body),dt(document.body),ue!==de&&(Me=(e=>{const t=e.side||a,n=e.onChange||O,o={root:e.root,rootMargin:"0px",threshold:1},i=window?.requestAnimationFrame||O,s=(e=!1)=>n(e),l=(e,n)=>0===e||e>n[t],c=(e,t)=>e.toggleAttribute(r,t),u=new IntersectionObserver((function(e){for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,a=e[t],s=l(a,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);c(i,s)}var n;i(s)}),o),d=new WeakSet;return function(e){for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=d.has(t);!n&&e?(u.observe(t),d.add(t)):N(!n,"Node already observed",t)}}})({onChange:Ye,root:document.documentElement,side:ue?a:s})),Ke(pt(document)()),_e(S(Ue)),It(b,"Init message from host page",void 0,void 0,t),document.title&&""!==document.title&&Tt(0,0,"title",document.title)}function _e(e){"complete"===document.readyState?$(e):v(document,"readystatechange",(()=>_e(e)))}function Qe(){const e=document.querySelectorAll(`[${r}]`);Ce=Array.from(e).filter((e=>!e.closest(`[${i}]`))),pe=Ce.length>0}function Ye(e){Qe(),(pe||e)&&(pe?A("Overflowed Elements:",...Ce):A("Overflow removed"),It(h,"Overflow updated"))}function Xe(){Re=document.querySelectorAll(`[${o}]`),he=Re.length>0}function Ke(e){he||Me(e)}let et=0;function tt(){const t=document.querySelectorAll(`*[${i}]`);fe=t.length>0,fe&&t.length!==et&&(function(t){const n=1===t.length?"":"s";W(`%c[${i}]%c found on %c${t.length}%c element${n}`,e.BOLD,e.NORMAL,e.BOLD,e.NORMAL)}(t),et=t.length)}function nt(t,n){void 0!==n&&""!==n&&"null"!==n&&(document.body.style.setProperty(t,n),A(`Set body ${t}: %c${n}`,e.HIGHLIGHT))}function ot(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function rt(){ot(0,o,Pe),ot(0,i,we)}function it(e){({add(t){function n(){It(e.eventName,e.eventType)}M[t]=n,v(window,t,n,{passive:!0})},remove(e){const t=M[e];var n,o;delete M[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function at(e,t,n,o){return t!==e&&(e in n||(W(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in I)&&D(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you ${Y?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),e}function st(){ze=at(ze,x,vt,"height")}function lt(){We=at(We,L,zt,"width")}function ct(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;It(p,`Element resized <${function(e){switch(!0){case!T(e):return"";case T(e.id):return`${e.nodeName}#${e.id}`;case T(e.name):return`${e.nodeName} (${e.name}`;case T(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}const ut=new WeakSet;function dt(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!ut.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Ae.observe(e),ut.add(e))}const t=pt(e)();for(const e of t){if(ut.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Ae.observe(e),ut.add(e))}}function mt(e){performance.mark(ae);const t=E(e);let n=0,o=document.documentElement,r=he?0:document.documentElement.getBoundingClientRect().bottom;const i=he?Re:pe?Ce:pt(document)();for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return A(`${t} position calculated from:`,o),performance.mark(se,{detail:{hasTags:he,len:i.length,logging:Ie,Side:t}}),r}const ft=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],pt=e=>()=>{tt();const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return fe&&t.push(`not([${i}])`,`not([${i}] *)`),e.querySelectorAll(t.join(":"))},ht={height:0,width:0},yt={height:0,width:0},gt=[e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT];function bt(t){function n(){return yt[r]=i,ht[r]=l,i}const o=t===vt,r=o?"height":"width",i=t.boundingClientRect(),a=Math.ceil(i),s=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(t),c=`HTML: %c${i}px %cPage: %c${l}px`;let u=0;switch(!0){case!t.enabled():return l;case he:A("Found element with data-iframe-size attribute"),u=t.taggedElement();break;case!pe&&0===yt[r]&&0===ht[r]:A(`Initial page size values: ${c}`,...gt),u=n();break;case qe&&i===yt[r]&&l===ht[r]:A(`Size unchanged: ${c}`,...gt),u=Math.max(i,l);break;case 0===i:A(`Page is hidden: ${c}`,...gt),u=l;break;case!pe&&i!==yt[r]&&l<=ht[r]:A(`New <html> size: ${c} `,...gt),A(`Previous <html> size: %c${yt[r]}px`,e.HIGHLIGHT),u=n();break;case!o:u=t.taggedElement();break;case!pe&&i<yt[r]:A(`<html> size decreased: ${c}`,...gt),u=n();break;case l===s||l===a:A(`<html> size equals page size: ${c}`,...gt),u=n();break;case i>l:A(`Page size < <html> size: ${c}`,...gt),u=n();break;case pe:A("Found element overflowing <html> "),u=t.taggedElement();break;default:A(`Using <html> size: ${c}`,...gt),u=n()}return A(`Content ${r}: %c${u}px`,e.HIGHLIGHT),u+=function(t){const n=t.getOffset();return 0!==n&&A(`Page offsetSize: %c${n}px`,e.HIGHLIGHT),n}(t),u}const vt={enabled:()=>ue,getOffset:()=>U,auto:()=>bt(vt),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,n)+parseInt(t.marginBottom,n)},bodyScroll:()=>document.body.scrollHeight,offset:()=>vt.bodyOffset(),custom:()=>z.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...ft(vt)),min:()=>Math.min(...ft(vt)),grow:()=>vt.max(),lowestElement:()=>mt(a),taggedElement:()=>mt(a)},zt={enabled:()=>de,getOffset:()=>_,auto:()=>bt(zt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>z.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...ft(zt)),min:()=>Math.min(...ft(zt)),rightMostElement:()=>mt(s),scroll:()=>Math.max(zt.bodyScroll(),zt.documentElementScroll()),taggedElement:()=>mt(s)},wt=(e,t)=>!(Math.abs(e-t)<=Be);function $t(e,t){const n=e[t]();return e.enabled()&&void 0!==X?function(e){const t=X(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);return t}(n):n}let St=!1;const Ot=S((()=>F(w(4)))),It=H(((e,t,n,o,r)=>{if(performance.now(),B(e),!0!==St)return K||e in m?void(document.hidden||(St=!0,requestAnimationFrame((()=>{St=!1})),function(e,t,n,o,r){const i=n??$t(vt,ze),a=o??$t(zt,We);switch(ue&&wt(ye,i)||de&&wt(Ge,a)?c:e){case b:case l:case c:ye=i,Ge=a;case f:Tt(ye,Ge,e,r);break;case p:case h:case y:G();break;default:G(),A("No change in content size detected")}}(e,0,n,o,r))):(A("Resizing disabled"),void R())}));function Et(e){ye=vt[ze](),Ge=zt[We](),Tt(ye,Ge,e)}const Tt=H((function(t,n,o,r,i){Te<-1||(B(o),void 0!==i||(i=He),function(){const a=`${ke}:${t}:${n}:${o}${void 0===r?"":`:${r}`}`;if(Ne)try{window.parent.iframeParentListener(P+a)}catch(e){if(1!==Te)throw e;return void Ot()}else Le.postMessage(P+a,i);A(`Sending message to parent page via ${Ne?"sameOrigin":"postMessage"}: %c%c${a}`,e.ITALIC,e.HIGHLIGHT)}(),R())})),jt=H((function(e){B("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Tt(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");Le=e.source,Q=e.origin,Je(t),me=!1,setTimeout((()=>{$e=!1}),128)},reset(){$e||Et("resetPage")},resize(){It(d,"Parent window requested size check")},moveToAnchor(){Se.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();Ve?$(Ve,n(e)):o("pageInfo")},parentInfo(){const e=(r=a(),t(n(r)));var r;Ze?$(Ze,e):o("parentInfo")},message(){const e=a();$(Fe,n(e))}},i=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),s=()=>e.data.split(":")[2]in{true:1,false:1};function l(){const t=i();B(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||W(`Unexpected message (${e.data})`)}P===`${e.data}`.slice(0,13)&&function(){if(!1!==me)return s()?(q(i()),B(b),void r.init()):void 0;l()}()}));function kt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?W("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>jt({data:e,sameOrigin:!0}))),v(window,"message",jt),v(window,"readystatechange",kt),kt())}();
package/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/child 5.4.7-beta.4 (esm) - 2025-06-30
4
+ * @module iframe-resizer/child 5.4.7 (esm) - 2025-07-08
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,4 @@
17
17
  */
18
18
 
19
19
 
20
- import e,{HIGHLIGHT as t,ITALIC as n,FOREGROUND as o,BOLD as r,NORMAL as i}from"auto-console-group";const a="5.4.7-beta.4",s=10,l="data-iframe-size",c="data-iframe-overflowed",u="data-iframe-ignore",d="bottom",m="right",f="autoResizeEnabled",p=Symbol("sizeChanged"),h="manualResize",g="parentResize",y={[h]:1,[g]:1},b="setOffsetSize",v="resizeObserver",z="overflowObserver",w="mutationObserver",$="none",S="No change in content size detected",O="init",M=(e,t,n,o)=>e.addEventListener(t,n,o||!1),k=["<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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const E=e=>(e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(k[e]),j=(e,...t)=>setTimeout((()=>e(...t)),0),T=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},I=e=>e,C=e=>Math.round(1e3*e)/1e3,P=e=>e.charAt(0).toUpperCase()+e.slice(1),x=e=>""!=`${e}`&&void 0!==e;function A(e){switch(!0){case!x(e):return"";case x(e.id):return`${e.nodeName}#${e.id}`;case x(e.name):return`${e.nodeName} (${e.name}`;case x(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}const R=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${P(t)}`)};let N=!0;var q;const B=(q=e,q?.__esModule?q.default:q)({label:"iframeResizer(child)"});const L=(W="log",(...e)=>!N||B[W](...e));var W;const F=L,{assert:D,debug:H,endAutoGroup:U,error:V,errorBoundary:Z,event:J,label:_,purge:Q,warn:Y}=B,G=e=>{return B.warn((t=I,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},X=G,K=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,t)=>G(t))),ee=K("Method"),te=K("Method","replaced with"),ne=K("Option"),oe=["min-height","min-width","max-height","max-width"],re=new Set,ie=e=>e.tagName?e.tagName.toLowerCase():"unknown",ae=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),se=(e,t)=>{return(n=ae(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function le({href:e}){re.has(e)||(L("Unable to access stylesheet:",e),re.add(e))}const ce=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){le(n)}return{source:"cross-origin stylesheet",value:ae(e,t)}}(e,t),ue=(e,t)=>{const{source:n,value:o}=ce(e,t),r=ie(e);G(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function de(){for(const e of[document.documentElement,document.body])for(const t of oe)L(`Checking <${ie(e)}> for blocking CSS: ${t}`),se(e,t)&&ue(e,t)}const me=e=>t=>void 0===t?void 0:e(t),fe=me((e=>"true"===e)),pe=me(Number),he="--ifr-start",ge="--ifr-end",ye=[],be=new WeakSet,ve=e=>"object"==typeof e&&be.add(e);let ze={},we=0;const $e=setInterval((()=>{if(ye.length<10)return;if(ze.hasTags&&ze.len<25)return;ye.sort();const e=Math.min(ye.reduce(((e,t)=>e+t),0)/ye.length,ye[Math.floor(ye.length/2)]),t=C(e);t>we&&(we=t,J("performanceObserver"),L("Mean time:",C(ye[Math.floor(ye.length/2)])),L("Median time:",C(ye.reduce(((e,t)=>e+t),0)/ye.length)),L("Average time:",t),L("Max time:",C(Math.max(...ye)))),e<=4||(clearInterval($e),G(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${C(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${ze.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function Se(e){e.getEntries().forEach((e=>{if(e.name===ge){const{duration:t}=performance.measure("--ifr-measure",he,ge);ze=e.detail,ye.push(t),ye.length>100&&ye.shift()}}))}function Oe(){new PerformanceObserver(Se).observe({entryTypes:["mark"]}),ve(document.documentElement),ve(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",Oe):Oe());const Me=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},ke=Me("function"),Ee=Me("number"),je=Me("string");"undefined"!=typeof window&&function(){const e={height:()=>(Y("Custom height calculation function not defined"),jt.auto()),width:()=>(Y("Custom width calculation function not defined"),Tt.auto())},k={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},x={},q="auto",W="[iFrameSizer]",V="scroll";let Q,K,oe,re,ie,ae,se,le=!0,ce="",ue=0,me="",ye="",be=!1,ve=!0,ze=!1,we=!0,$e=!1,Se=!1,Oe=!1,Me=1,Te=q,Ie="",Ce=!0,Pe={},xe=!0,Ae=!1,Re="",Ne=0,qe=!1,Be="",Le=I,We=[],Fe="child",De=null,He=!1,Ue="",Ve=[],Ze=window.parent,Je="*",_e=0,Qe=!1,Ye=1,Ge=V,Xe=window,Ke=()=>{Y("onMessage function not defined")},et=()=>{},tt=null,nt=null;function ot(n){var r,i,p;!function(e){Be=e[0]??Be,ue=pe(e[1])??ue,ze=fe(e[2])??ze,Ae=fe(e[3])??Ae,le=fe(e[6])??le,me=e[7]??me,Te=e[8]??Te,ce=e[9]??ce,ye=e[10]??ye,_e=pe(e[11])??_e,Pe.enable=fe(e[12])??!1,Fe=e[13]??Fe,Ge=e[14]??Ge,qe=fe(e[15])??qe,Q=pe(e[16])??Q,K=pe(e[17])??K,ve=fe(e[18])??ve,Re=e[19]??Re,ae=e[20]??ae,Ne=pe(e[21])??Ne,xe=fe(e[23])??xe}(n),r={id:Be,enabled:Ae,expand:xe},B.label(`${r.id}`),B.expand(r.expand),N=r.enabled,L(`Initialising iframe v${a} ${window.location.href}`),function(){function n(e){L("Reading data from page:",e),se=ke(e,"onBeforeResize")??se,Ke=ke(e,"onMessage")??Ke,et=ke(e,"onReady")??et,"number"==typeof e?.offset&&(ne("offset","offsetSize"),ve&&(Q=Ee(e,"offset")??Q),ze&&(K=Ee(e,"offset")??K)),"number"==typeof e?.offsetSize&&(ve&&(Q=Ee(e,"offsetSize")??Q),ze&&(K=Ee(e,"offsetSize")??K)),Ie=je(e,"ignoreSelector")??Ie,Ue=je(e,"sizeSelector")??Ue,Je=je(e,"targetOrigin")??Je,Te=e?.heightCalculationMethod||Te,Ge=e?.widthCalculationMethod||Ge}function o(t,n){return"function"==typeof t&&(G(`<rb>Deprecated Option(${n}CalculationMethod)</>\n\nThe use of <b>${n}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),e[n]=t,t="custom"),t}if(1===Ne)return;const r=window.iframeResizer||window.iFrameResizer;"object"==typeof r&&(n(r),Te=o(Te,"height"),Ge=o(Ge,"width"),F(`Set targetOrigin for parent: %c${Je}`,t))}(),ft(),function(){try{He=1===Ne||"iframeParentListener"in window.parent}catch(e){L("Cross domain iframe detected")}}(),ze===ve&&(be=!0),Ne<0?X(`${E(Ne+2)}${E(2)}`):ae?.codePointAt(0)>4||Ne<2&&X(E(3)),ae&&""!==ae&&"false"!==ae?ae!==a&&G(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ae} - Child page: ${a}.\n`):G("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n"),gt(),yt(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(l,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&G("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),"BackCompat"===document.compatMode&&G("<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n"),st(),be||de(),1!==Ne&&(Xe.parentIframe=Object.freeze({autoResize:e=>(R(e,"boolean","parentIframe.autoResize(enable) enable"),!1===ze&&!1===ve?(J(f),G(`Auto Resize can not be changed when <b>direction</> is set to '${$}'.`),!1):(!0===e&&!1===le?(le=!0,queueMicrotask((()=>At(f,"Auto Resize enabled")))):!1===e&&!0===le&&(le=!1),Nt(0,0,"autoResize",JSON.stringify(le)),le)),close(){Nt(0,0,"close")},getId:()=>Be,getOrigin:()=>(ee("getOrigin()","getParentOrigin()"),oe),getParentOrigin:()=>oe,getPageInfo(e){if("function"==typeof e)return tt=e,Nt(0,0,"pageInfo"),void te("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");tt=null,Nt(0,0,"pageInfoStop")},getParentProps:e=>(R(e,"function","parentIframe.getParentProps(callback) callback"),nt=e,Nt(0,0,"parentInfo"),()=>{nt=null,Nt(0,0,"parentInfoStop")}),getParentProperties(e){ee("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){R(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Pe.findTarget(e)},reset(){!function(){const e=Te;Te=q,L("Reset trigger event: %cparentIframe.reset",t),Qe?L("TriggerLock blocked calculation"):(Qe=!0,H("Trigger event lock on"),requestAnimationFrame((()=>{Qe=!1,H("Trigger event lock off")}))),Rt("reset"),Te=e}()},setOffsetSize(e){R(e,"number","parentIframe.setOffsetSize(offset) offset"),Q=e,K=e,At(b,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){R(e,"number","parentIframe.scrollBy(x, y) x"),R(t,"number","parentIframe.scrollBy(x, y) y"),Nt(t,e,"scrollBy")},scrollTo(e,t){R(e,"number","parentIframe.scrollTo(x, y) x"),R(t,"number","parentIframe.scrollTo(x, y) y"),Nt(t,e,"scrollTo")},scrollToOffset(e,t){R(e,"number","parentIframe.scrollToOffset(x, y) x"),R(t,"number","parentIframe.scrollToOffset(x, y) y"),Nt(t,e,"scrollToOffset")},sendMessage(e,t){t&&R(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Nt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Te=e,gt()},setWidthCalculationMethod(e){Ge=e,yt()},setTargetOrigin(e){R(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),L(`Set targetOrigin: %c${e}`,t),Je=e},resize(e,t){e&&R(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&R(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),At(h,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ee("size()","resize()"),this.resize(e,t)}}),Xe.parentIFrame=Xe.parentIframe),function(){function e(e){Nt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function n(n,o){L(`Add event listener: %c${o}`,t),M(window.document,n,e)}!0===qe&&(n("mouseenter","Mouse Enter"),n("mouseleave","Mouse Leave"))}(),Pe=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(t){const n=t.getBoundingClientRect(),o=e();return{x:parseInt(n.left,s)+parseInt(o.x,s),y:parseInt(n.top,s)+parseInt(o.y,s)}}function r(e){function r(e){const r=n(e);L(`Moving to in page link (%c#${i}%c) at x: %c${r.x}%c y: %c${r.y}`,t,o,t,o,t),Nt(r.y,r.x,"scrollToOffset")}const i=e.split("#")[1]||e,a=decodeURIComponent(i),s=document.getElementById(a)||document.getElementsByName(a)[0];void 0===s?(L(`In page link (#${i}) not found in iFrame, so sending to parent`),Nt(0,0,"inPageLink",`#${i}`)):r(s)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&r(t)}function a(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&M(e,"click",(t=>{t.preventDefault(),r(e.getAttribute("href"))}))}function l(){M(window,"hashchange",i)}function c(){setTimeout(i,128)}function u(){L("Setting up location.hash handlers"),a(),l(),c()}return Pe.enable?1===Ne?G("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):u():L("In page linking not enabled"),{findTarget:r}}(),void 0===me&&(me=`${ue}px`),dt("margin",(i="margin",(p=me).includes("-")&&(Y(`Negative CSS value ignored for ${i}`),p=""),p)),dt("background",ce),dt("padding",ye),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),be||function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),L("Set HTML & body height: %cauto !important",t)}(),!0!==le&&L("Auto Resize disabled"),function(e){pt({method:e,eventType:"After Print",eventName:"afterprint"}),pt({method:e,eventType:"Before Print",eventName:"beforeprint"}),pt({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,n=[];let r=!1,i=0;const a=t=>{F("Mutations observed:",t);for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},s=16,c=2,d=200;let m=1;function f(e){ft(),lt(e),e.forEach(zt),e.clear()}function p(){const l=performance.now(),u=l-i,h=s*m+++c;if(u>h&&u<d)return F("Backed off due to heavy workload on callStack"),L(`Delay: %c${C(u)}ms %c> Delay limit: %c${h}ms`,t,o,t),setTimeout(p,s*m),void(i=l);m=1,n.forEach(a),n.length=0,e.size>0&&f(e),st(),it(),r=!1,At(w,"Mutation Observed")}function h(e){n.push(e),r||(i=performance.now(),r=!0,requestAnimationFrame(p))}function g(){const e=new window.MutationObserver(h),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[u,l],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return L("Setup <body> MutationObserver"),e.observe(t,n),e}g()}(),L("Setup ResizeObserver"),De=new ResizeObserver(bt),De.observe(document.body),vt.add(document.body),zt(document.body),ve!==ze&&(L("Setup OverflowObserver"),Le=(e=>{const t=e.side||d,n=e.onChange||I,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||I,i=(e=!1)=>n(e),a=(e,n)=>0===e||e>n[t],s=(e,t)=>e.toggleAttribute(c,t),l=new IntersectionObserver((function(e){for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,l=e[t],c=a(l,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);s(i,c)}var n;r(i)}),o),u=new WeakSet;return function(e){L("Attached overflowObservers");for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=u.has(t);!n&&e?(l.observe(t),u.add(t)):D(!n,"Node already observed",t)}}})({onChange:at,root:document.documentElement,side:ve?d:m})),lt(St(document)()),rt(T(et)),L("Initialization complete"),At(O,"Init message from host page",void 0,void 0,a),document.title&&""!==document.title&&Nt(0,0,"title",document.title)}function rt(e){"complete"===document.readyState?j(e):M(document,"readystatechange",(()=>rt(e)))}function it(){const e=document.querySelectorAll(`[${c}]`);We=Array.from(e).filter((e=>!e.closest(`[${u}]`))),Se=We.length>0}function at(e){it(),(Se||e)&&(Se?F("Overflowed Elements:",...We):F("Overflow removed"),At(z,"Overflow updated"))}function st(){Ve=document.querySelectorAll(`[${l}]`),Oe=Ve.length>0,L(`Tagged elements found: %c${Oe}`,t)}function lt(e){Oe||Le(e)}let ct=0;function ut(){const e=document.querySelectorAll(`*[${u}]`);$e=e.length>0,$e&&e.length!==ct&&(function(e){const t=1===e.length?"":"s";Y(`%c[${u}]%c found on %c${e.length}%c element${t}`,r,i,r,i)}(e),ct=e.length)}function dt(e,n){void 0!==n&&""!==n&&"null"!==n&&(document.body.style.setProperty(e,n),F(`Set body ${e}: %c${n}`,t))}function mt(e,n,o){if(""!==o){L(`${e}: %c${o}`,t);for(const e of document.querySelectorAll(o))L(`Applying ${n} to:`,e),e.toggleAttribute(n,!0)}}function ft(){mt("sizeSelector",l,Ue),mt("ignoreSelector",u,Ie)}function pt(e){({add(t){function n(){At(e.eventName,e.eventType)}x[t]=n,M(window,t,n,{passive:!0})},remove(e){const t=x[e];var n,o;delete x[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),L(`${P(e.method)} event listener: %c${e.eventType}`,t)}function ht(e,n,o,r){return n!==e&&(e in o||(Y(`${e} is not a valid option for ${r}CalculationMethod.`),e=n),e in k)&&G(`<rb>Deprecated ${r}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${r} calculation method. It is recommended that you ${ae?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),L(`Set ${r} calculation method: %c${e}`,t),e}function gt(){Te=ht(Te,q,jt,"height")}function yt(){Ge=ht(Ge,V,Tt,"width")}function bt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;At(v,`Element resized <${A(t)}>`)}const vt=new WeakSet;function zt(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!vt.has(e)){const n=getComputedStyle(e)?.position;""!==n&&"static"!==n&&(De.observe(e),vt.add(e),L(`Attached resizeObserver: %c${A(e)}`,t))}const n=St(e)();for(const e of n){if(vt.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const n=getComputedStyle(e)?.position;""!==n&&"static"!==n&&(De.observe(e),vt.add(e),L(`Attached resizeObserver: %c${A(e)}`,t))}}function wt(e){performance.mark(he);const t=P(e);let n=0,o=document.documentElement,r=Oe?0:document.documentElement.getBoundingClientRect().bottom;const i=Oe?Ve:Se?We:St(document)();for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return F(`${t} position calculated from:`,o),performance.mark(ge,{detail:{hasTags:Oe,len:i.length,logging:Ae,Side:t}}),r}const $t=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],St=e=>()=>{ut();const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return $e&&t.push(`not([${u}])`,`not([${u}] *)`),e.querySelectorAll(t.join(":"))},Ot={height:0,width:0},Mt={height:0,width:0},kt=[t,o,t];function Et(e){function n(){return Mt[r]=i,Ot[r]=l,i}const o=e===jt,r=o?"height":"width",i=e.boundingClientRect(),a=Math.ceil(i),s=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: %c${i}px %cPage: %c${l}px`;let u=0;switch(!0){case!e.enabled():return l;case Oe:F("Found element with data-iframe-size attribute"),u=e.taggedElement();break;case!Se&&0===Mt[r]&&0===Ot[r]:F(`Initial page size values: ${c}`,...kt),u=n();break;case Qe&&i===Mt[r]&&l===Ot[r]:F(`Size unchanged: ${c}`,...kt),u=Math.max(i,l);break;case 0===i:F(`Page is hidden: ${c}`,...kt),u=l;break;case!Se&&i!==Mt[r]&&l<=Ot[r]:F(`New <html> size: ${c} `,...kt),F(`Previous <html> size: %c${Mt[r]}px`,t),u=n();break;case!o:u=e.taggedElement();break;case!Se&&i<Mt[r]:F(`<html> size decreased: ${c}`,...kt),u=n();break;case l===s||l===a:F(`<html> size equals page size: ${c}`,...kt),u=n();break;case i>l:F(`Page size < <html> size: ${c}`,...kt),u=n();break;case Se:F("Found element overflowing <html> "),u=e.taggedElement();break;default:F(`Using <html> size: ${c}`,...kt),u=n()}return F(`Content ${r}: %c${u}px`,t),u+=function(e){const n=e.getOffset();return 0!==n&&F(`Page offsetSize: %c${n}px`,t),n}(e),u}const jt={enabled:()=>ve,getOffset:()=>Q,auto:()=>Et(jt),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,s)+parseInt(t.marginBottom,s)},bodyScroll:()=>document.body.scrollHeight,offset:()=>jt.bodyOffset(),custom:()=>e.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...$t(jt)),min:()=>Math.min(...$t(jt)),grow:()=>jt.max(),lowestElement:()=>wt(d),taggedElement:()=>wt(d)},Tt={enabled:()=>ze,getOffset:()=>K,auto:()=>Et(Tt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>e.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...$t(Tt)),min:()=>Math.min(...$t(Tt)),rightMostElement:()=>wt(m),scroll:()=>Math.max(Tt.bodyScroll(),Tt.documentElementScroll()),taggedElement:()=>wt(m)},It=(e,t)=>!(Math.abs(e-t)<=_e);function Ct(e,t){const n=e[t]();return e.enabled()&&void 0!==se?function(e){const t=se(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);return t}(n):n}let Pt=!1;const xt=T((()=>X(E(4)))),At=Z(((e,n,o,r,i)=>{if(ie=performance.now(),re=!0,J(e),!0!==Pt)return le||e in y?void(document.hidden?L("Page hidden - Ignored resize request"):(Pt=!0,requestAnimationFrame((()=>{Pt=!1})),function(e,n,o,r,i){const a=o??Ct(jt,Te),s=r??Ct(Tt,Ge),l=ve&&It(Me,a)||ze&&It(Ye,s)?p:e;switch(L(`Resize event: %c${n}`,t),l){case O:case f:case p:Me=a,Ye=s;case b:Nt(Me,Ye,e,i);break;case v:case z:case w:L(S);break;default:F(S)}re=!1}(e,n,o,r,i))):(F("Resizing disabled"),void U())}));function Rt(e){Me=jt[Te](),Ye=Tt[Ge](),Nt(Me,Ye,e)}const Nt=Z((function(e,o,r,i,a){Ne<-1||(J(r),void 0!==a?L(`Message targetOrigin: %c${a}`,t):a=Je,function(){const s=`${Be}:${e}:${o}:${r}${void 0===i?"":`:${i}`}`;if(He)try{window.parent.iframeParentListener(W+s)}catch(e){if(1!==Ne)throw e;return void xt()}else Ze.postMessage(W+s,a);re&&L(function(){const e=C(performance.now()-ie);return r===O?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),t),F(`Sending message to parent page via ${He?"sameOrigin":"postMessage"}: %c%c${s}`,n,t)}(),U())})),qt=Z((function(e){J("onMessage");const{freeze:n}=Object,{parse:o}=JSON,r=e=>n(o(e)),i=e=>Nt(0,0,`${e}Stop`),a={init:function(){if("loading"===document.readyState)return void L("Page not ready, ignoring init message");const t=e.data.slice(13).split(":");Ze=e.source,oe=e.origin,ot(t),we=!1,setTimeout((()=>{Ce=!1}),128)},reset(){Ce?L("Page reset ignored by init"):(L("Page size reset by host page"),Rt("resetPage"))},resize(){L("Resize requested by host page"),At(g,"Parent window requested size check")},moveToAnchor(){Pe.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();L("PageInfo received from parent:",r(e)),tt?j(tt,o(e)):i("pageInfo")},parentInfo(){const e=r(l());L("ParentInfo received from parent:",e),nt?j(nt,e):i("parentInfo")},message(){const e=l();L("onMessage called from parent:%c",t,r(e)),j(Ke,o(e))}},s=()=>e.data.split("]")[1].split(":")[0],l=()=>e.data.slice(e.data.indexOf(":")+1),c=()=>e.data.split(":")[2]in{true:1,false:1};function u(){const t=s();J(t),t in a?a[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||c()||Y(`Unexpected message (${e.data})`)}W===`${e.data}`.slice(0,13)&&function(){if(!1!==we)return c()?(_(s()),J(O),void a.init()):void L(`Ignored message of type "${s()}". Received before initialization.`);u()}()}));function Bt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?Y("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>qt({data:e,sameOrigin:!0}))),M(window,"message",qt),M(window,"readystatechange",Bt),Bt())}();
21
- //# sourceMappingURL=index.esm.js.map
20
+ import e,{ITALIC as t,HIGHLIGHT as n,FOREGROUND as o,BOLD as r,NORMAL as i}from"auto-console-group";const a="5.4.7",s=10,l="data-iframe-size",c="data-iframe-overflowed",u="data-iframe-ignore",d="bottom",m="right",f="autoResizeEnabled",p=Symbol("sizeChanged"),h="manualResize",y="parentResize",g={[h]:1,[y]:1},b="setOffsetSize",v="resizeObserver",z="overflowObserver",w="mutationObserver",$="none",S="init",E=(e,t,n,o)=>e.addEventListener(t,n,o||!1),O=["<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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const j=e=>(e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(O[e]),k=(e,...t)=>setTimeout((()=>e(...t)),0),T=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},M=e=>e,C=e=>Math.round(1e3*e)/1e3,x=e=>e.charAt(0).toUpperCase()+e.slice(1),I=e=>""!=`${e}`&&void 0!==e;const P=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${x(t)}`)};let A=!0;var N;const R=(N=e,N?.__esModule?N.default:N)({label:"iframeResizer(child)"});var B;const q=(B="log",(...e)=>!A||R[B](...e)),{assert:L,debug:W,endAutoGroup:F,error:D,errorBoundary:H,event:V,label:U,purge:Z,warn:J}=R,_=e=>{return R.warn((t=M,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},Q=_,Y=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,t)=>_(t))),G=Y("Method"),X=Y("Method","replaced with"),K=Y("Option"),ee=["min-height","min-width","max-height","max-width"],te=new Set,ne=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),oe=(e,t)=>{return(n=ne(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function re({href:e}){te.has(e)||te.add(e)}const ie=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){re(n)}return{source:"cross-origin stylesheet",value:ne(e,t)}}(e,t),ae=(e,t)=>{const{source:n,value:o}=ie(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);_(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function se(){for(const e of[document.documentElement,document.body])for(const t of ee)oe(e,t)&&ae(e,t)}const le=e=>t=>void 0===t?void 0:e(t),ce=le((e=>"true"===e)),ue=le(Number),de="--ifr-start",me="--ifr-end",fe=[],pe=new WeakSet,he=e=>"object"==typeof e&&pe.add(e);let ye={},ge=0;const be=setInterval((()=>{if(fe.length<10)return;if(ye.hasTags&&ye.len<25)return;fe.sort();const e=Math.min(fe.reduce(((e,t)=>e+t),0)/fe.length,fe[Math.floor(fe.length/2)]),t=C(e);t>ge&&(ge=t,V("performanceObserver")),e<=4||(clearInterval(be),_(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${C(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${ye.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function ve(e){e.getEntries().forEach((e=>{if(e.name===me){const{duration:t}=performance.measure("--ifr-measure",de,me);ye=e.detail,fe.push(t),fe.length>100&&fe.shift()}}))}function ze(){new PerformanceObserver(ve).observe({entryTypes:["mark"]}),he(document.documentElement),he(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",ze):ze());const we=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},$e=we("function"),Se=we("number"),Ee=we("string");"undefined"!=typeof window&&function(){const e={height:()=>(J("Custom height calculation function not defined"),St.auto()),width:()=>(J("Custom width calculation function not defined"),Et.auto())},O={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},C={},N="auto",B="[iFrameSizer]",W="scroll";let D,Y,ee,te,ne,oe=!0,re="",ie=0,ae="",le="",fe=!1,pe=!0,he=!1,ye=!0,ge=!1,be=!1,ve=!1,ze=1,we=N,Oe="",je=!0,ke={},Te=!0,Me=!1,Ce="",xe=0,Ie=!1,Pe="",Ae=M,Ne=[],Re="child",Be=null,qe=!1,Le="",We=[],Fe=window.parent,De="*",He=0,Ve=!1,Ue=1,Ze=W,Je=window,_e=()=>{J("onMessage function not defined")},Qe=()=>{},Ye=null,Ge=null;function Xe(t){var o,r,i;!function(e){Pe=e[0]??Pe,ie=ue(e[1])??ie,he=ce(e[2])??he,Me=ce(e[3])??Me,oe=ce(e[6])??oe,ae=e[7]??ae,we=e[8]??we,re=e[9]??re,le=e[10]??le,He=ue(e[11])??He,ke.enable=ce(e[12])??!1,Re=e[13]??Re,Ze=e[14]??Ze,Ie=ce(e[15])??Ie,D=ue(e[16])??D,Y=ue(e[17])??Y,pe=ce(e[18])??pe,Ce=e[19]??Ce,te=e[20]??te,xe=ue(e[21])??xe,Te=ce(e[23])??Te}(t),o={id:Pe,enabled:Me,expand:Te},R.label(`${o.id}`),R.expand(o.expand),A=o.enabled,function(){function t(e){ne=$e(e,"onBeforeResize")??ne,_e=$e(e,"onMessage")??_e,Qe=$e(e,"onReady")??Qe,"number"==typeof e?.offset&&(K("offset","offsetSize"),pe&&(D=Se(e,"offset")??D),he&&(Y=Se(e,"offset")??Y)),"number"==typeof e?.offsetSize&&(pe&&(D=Se(e,"offsetSize")??D),he&&(Y=Se(e,"offsetSize")??Y)),Oe=Ee(e,"ignoreSelector")??Oe,Le=Ee(e,"sizeSelector")??Le,De=Ee(e,"targetOrigin")??De,we=e?.heightCalculationMethod||we,Ze=e?.widthCalculationMethod||Ze}function o(t,n){return"function"==typeof t&&(_(`<rb>Deprecated Option(${n}CalculationMethod)</>\n\nThe use of <b>${n}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),e[n]=t,t="custom"),t}if(1===xe)return;const r=window.iframeResizer||window.iFrameResizer;"object"==typeof r&&(t(r),we=o(we,"height"),Ze=o(Ze,"width"),q(`Set targetOrigin for parent: %c${De}`,n))}(),lt(),function(){try{qe=1===xe||"iframeParentListener"in window.parent}catch(e){}}(),he===pe&&(fe=!0),xe<0?Q(`${j(xe+2)}${j(2)}`):te?.codePointAt(0)>4||xe<2&&Q(j(3)),te&&""!==te&&"false"!==te?te!==a&&_(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${te} - Child page: ${a}.\n`):_("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n"),dt(),mt(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(l,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&_("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),"BackCompat"===document.compatMode&&_("<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n"),nt(),fe||se(),1!==xe&&(Je.parentIframe=Object.freeze({autoResize:e=>(P(e,"boolean","parentIframe.autoResize(enable) enable"),!1===he&&!1===pe?(V(f),_(`Auto Resize can not be changed when <b>direction</> is set to '${$}'.`),!1):(!0===e&&!1===oe?(oe=!0,queueMicrotask((()=>Mt(f,"Auto Resize enabled")))):!1===e&&!0===oe&&(oe=!1),xt(0,0,"autoResize",JSON.stringify(oe)),oe)),close(){xt(0,0,"close")},getId:()=>Pe,getOrigin:()=>(G("getOrigin()","getParentOrigin()"),ee),getParentOrigin:()=>ee,getPageInfo(e){if("function"==typeof e)return Ye=e,xt(0,0,"pageInfo"),void X("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Ye=null,xt(0,0,"pageInfoStop")},getParentProps:e=>(P(e,"function","parentIframe.getParentProps(callback) callback"),Ge=e,xt(0,0,"parentInfo"),()=>{Ge=null,xt(0,0,"parentInfoStop")}),getParentProperties(e){G("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){P(e,"string","parentIframe.moveToAnchor(anchor) anchor"),ke.findTarget(e)},reset(){!function(){const e=we;we=N,Ve||(Ve=!0,requestAnimationFrame((()=>{Ve=!1}))),Ct("reset"),we=e}()},setOffsetSize(e){P(e,"number","parentIframe.setOffsetSize(offset) offset"),D=e,Y=e,Mt(b,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){P(e,"number","parentIframe.scrollBy(x, y) x"),P(t,"number","parentIframe.scrollBy(x, y) y"),xt(t,e,"scrollBy")},scrollTo(e,t){P(e,"number","parentIframe.scrollTo(x, y) x"),P(t,"number","parentIframe.scrollTo(x, y) y"),xt(t,e,"scrollTo")},scrollToOffset(e,t){P(e,"number","parentIframe.scrollToOffset(x, y) x"),P(t,"number","parentIframe.scrollToOffset(x, y) y"),xt(t,e,"scrollToOffset")},sendMessage(e,t){t&&P(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),xt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){we=e,dt()},setWidthCalculationMethod(e){Ze=e,mt()},setTargetOrigin(e){P(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),De=e},resize(e,t){e&&P(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&P(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),Mt(h,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){G("size()","resize()"),this.resize(e,t)}}),Je.parentIFrame=Je.parentIframe),function(){function e(e){xt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){E(window.document,t,e)}!0===Ie&&(t("mouseenter"),t("mouseleave"))}(),ke=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function t(t){const n=t.getBoundingClientRect(),o=e();return{x:parseInt(n.left,s)+parseInt(o.x,s),y:parseInt(n.top,s)+parseInt(o.y,s)}}function n(e){function n(e){const n=t(e);xt(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,r=decodeURIComponent(o),i=document.getElementById(r)||document.getElementsByName(r)[0];void 0===i?xt(0,0,"inPageLink",`#${o}`):n(i)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&E(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function i(){E(window,"hashchange",o)}function a(){setTimeout(o,128)}function l(){r(),i(),a()}return ke.enable&&(1===xe?_("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):l()),{findTarget:n}}(),void 0===ae&&(ae=`${ie}px`),at("margin",(r="margin",(i=ae).includes("-")&&(J(`Negative CSS value ignored for ${r}`),i=""),i)),at("background",re),at("padding",le),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),fe||function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),function(e){ct({method:e,eventType:"After Print",eventName:"afterprint"}),ct({method:e,eventType:"Before Print",eventName:"beforeprint"}),ct({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const r=t=>{q("Mutations observed:",t);for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},i=16,a=2,s=200;let c=1;function d(e){lt(),ot(e),e.forEach(ht),e.clear()}function m(){const l=performance.now(),u=l-o;if(u>i*c+++a&&u<s)return q("Backed off due to heavy workload on callStack"),setTimeout(m,i*c),void(o=l);c=1,t.forEach(r),t.length=0,e.size>0&&d(e),nt(),et(),n=!1,Mt(w,"Mutation Observed")}function f(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(m))}function p(){const e=new window.MutationObserver(f),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[u,l],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return e.observe(t,n),e}p()}(),Be=new ResizeObserver(ft),Be.observe(document.body),pt.add(document.body),ht(document.body),pe!==he&&(Ae=(e=>{const t=e.side||d,n=e.onChange||M,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||M,i=(e=!1)=>n(e),a=(e,n)=>0===e||e>n[t],s=(e,t)=>e.toggleAttribute(c,t),l=new IntersectionObserver((function(e){for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,l=e[t],c=a(l,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);s(i,c)}var n;r(i)}),o),u=new WeakSet;return function(e){for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=u.has(t);!n&&e?(l.observe(t),u.add(t)):L(!n,"Node already observed",t)}}})({onChange:tt,root:document.documentElement,side:pe?d:m})),ot(bt(document)()),Ke(T(Qe)),Mt(S,"Init message from host page",void 0,void 0,a),document.title&&""!==document.title&&xt(0,0,"title",document.title)}function Ke(e){"complete"===document.readyState?k(e):E(document,"readystatechange",(()=>Ke(e)))}function et(){const e=document.querySelectorAll(`[${c}]`);Ne=Array.from(e).filter((e=>!e.closest(`[${u}]`))),be=Ne.length>0}function tt(e){et(),(be||e)&&(be?q("Overflowed Elements:",...Ne):q("Overflow removed"),Mt(z,"Overflow updated"))}function nt(){We=document.querySelectorAll(`[${l}]`),ve=We.length>0}function ot(e){ve||Ae(e)}let rt=0;function it(){const e=document.querySelectorAll(`*[${u}]`);ge=e.length>0,ge&&e.length!==rt&&(function(e){const t=1===e.length?"":"s";J(`%c[${u}]%c found on %c${e.length}%c element${t}`,r,i,r,i)}(e),rt=e.length)}function at(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),q(`Set body ${e}: %c${t}`,n))}function st(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function lt(){st(0,l,Le),st(0,u,Oe)}function ct(e){({add(t){function n(){Mt(e.eventName,e.eventType)}C[t]=n,E(window,t,n,{passive:!0})},remove(e){const t=C[e];var n,o;delete C[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function ut(e,t,n,o){return t!==e&&(e in n||(J(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in O)&&_(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you ${te?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),e}function dt(){we=ut(we,N,St,"height")}function mt(){Ze=ut(Ze,W,Et,"width")}function ft(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Mt(v,`Element resized <${function(e){switch(!0){case!I(e):return"";case I(e.id):return`${e.nodeName}#${e.id}`;case I(e.name):return`${e.nodeName} (${e.name}`;case I(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}const pt=new WeakSet;function ht(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!pt.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Be.observe(e),pt.add(e))}const t=bt(e)();for(const e of t){if(pt.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Be.observe(e),pt.add(e))}}function yt(e){performance.mark(de);const t=x(e);let n=0,o=document.documentElement,r=ve?0:document.documentElement.getBoundingClientRect().bottom;const i=ve?We:be?Ne:bt(document)();for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return q(`${t} position calculated from:`,o),performance.mark(me,{detail:{hasTags:ve,len:i.length,logging:Me,Side:t}}),r}const gt=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],bt=e=>()=>{it();const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return ge&&t.push(`not([${u}])`,`not([${u}] *)`),e.querySelectorAll(t.join(":"))},vt={height:0,width:0},zt={height:0,width:0},wt=[n,o,n];function $t(e){function t(){return zt[r]=i,vt[r]=l,i}const o=e===St,r=o?"height":"width",i=e.boundingClientRect(),a=Math.ceil(i),s=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: %c${i}px %cPage: %c${l}px`;let u=0;switch(!0){case!e.enabled():return l;case ve:q("Found element with data-iframe-size attribute"),u=e.taggedElement();break;case!be&&0===zt[r]&&0===vt[r]:q(`Initial page size values: ${c}`,...wt),u=t();break;case Ve&&i===zt[r]&&l===vt[r]:q(`Size unchanged: ${c}`,...wt),u=Math.max(i,l);break;case 0===i:q(`Page is hidden: ${c}`,...wt),u=l;break;case!be&&i!==zt[r]&&l<=vt[r]:q(`New <html> size: ${c} `,...wt),q(`Previous <html> size: %c${zt[r]}px`,n),u=t();break;case!o:u=e.taggedElement();break;case!be&&i<zt[r]:q(`<html> size decreased: ${c}`,...wt),u=t();break;case l===s||l===a:q(`<html> size equals page size: ${c}`,...wt),u=t();break;case i>l:q(`Page size < <html> size: ${c}`,...wt),u=t();break;case be:q("Found element overflowing <html> "),u=e.taggedElement();break;default:q(`Using <html> size: ${c}`,...wt),u=t()}return q(`Content ${r}: %c${u}px`,n),u+=function(e){const t=e.getOffset();return 0!==t&&q(`Page offsetSize: %c${t}px`,n),t}(e),u}const St={enabled:()=>pe,getOffset:()=>D,auto:()=>$t(St),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,s)+parseInt(t.marginBottom,s)},bodyScroll:()=>document.body.scrollHeight,offset:()=>St.bodyOffset(),custom:()=>e.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...gt(St)),min:()=>Math.min(...gt(St)),grow:()=>St.max(),lowestElement:()=>yt(d),taggedElement:()=>yt(d)},Et={enabled:()=>he,getOffset:()=>Y,auto:()=>$t(Et),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>e.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...gt(Et)),min:()=>Math.min(...gt(Et)),rightMostElement:()=>yt(m),scroll:()=>Math.max(Et.bodyScroll(),Et.documentElementScroll()),taggedElement:()=>yt(m)},Ot=(e,t)=>!(Math.abs(e-t)<=He);function jt(e,t){const n=e[t]();return e.enabled()&&void 0!==ne?function(e){const t=ne(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);return t}(n):n}let kt=!1;const Tt=T((()=>Q(j(4)))),Mt=H(((e,t,n,o,r)=>{if(performance.now(),V(e),!0!==kt)return oe||e in g?void(document.hidden||(kt=!0,requestAnimationFrame((()=>{kt=!1})),function(e,t,n,o,r){const i=n??jt(St,we),a=o??jt(Et,Ze);switch(pe&&Ot(ze,i)||he&&Ot(Ue,a)?p:e){case S:case f:case p:ze=i,Ue=a;case b:xt(ze,Ue,e,r);break;case v:case z:case w:Z();break;default:Z(),q("No change in content size detected")}}(e,0,n,o,r))):(q("Resizing disabled"),void F())}));function Ct(e){ze=St[we](),Ue=Et[Ze](),xt(ze,Ue,e)}const xt=H((function(e,o,r,i,a){xe<-1||(V(r),void 0!==a||(a=De),function(){const s=`${Pe}:${e}:${o}:${r}${void 0===i?"":`:${i}`}`;if(qe)try{window.parent.iframeParentListener(B+s)}catch(e){if(1!==xe)throw e;return void Tt()}else Fe.postMessage(B+s,a);q(`Sending message to parent page via ${qe?"sameOrigin":"postMessage"}: %c%c${s}`,t,n)}(),F())})),It=H((function(e){V("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>xt(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");Fe=e.source,ee=e.origin,Xe(t),ye=!1,setTimeout((()=>{je=!1}),128)},reset(){je||Ct("resetPage")},resize(){Mt(y,"Parent window requested size check")},moveToAnchor(){ke.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();Ye?k(Ye,n(e)):o("pageInfo")},parentInfo(){const e=(r=a(),t(n(r)));var r;Ge?k(Ge,e):o("parentInfo")},message(){const e=a();k(_e,n(e))}},i=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),s=()=>e.data.split(":")[2]in{true:1,false:1};function l(){const t=i();V(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||J(`Unexpected message (${e.data})`)}B===`${e.data}`.slice(0,13)&&function(){if(!1!==ye)return s()?(U(i()),V(S),void r.init()):void 0;l()}()}));function Pt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?J("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>It({data:e,sameOrigin:!0}))),E(window,"message",It),E(window,"readystatechange",Pt),Pt())}();
package/index.umd.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/child 5.4.7-beta.4 (umd) - 2025-06-30
4
+ * @module iframe-resizer/child 5.4.7 (umd) - 2025-07-08
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,4 @@
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="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0},l=Object.assign(console);const{fromEntries:c,keys:u}=Object,d=e=>[e,l[e]],f=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>c(u(e).map(t));const p=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,h=p?"color: #A9C7FB;":"color: #135CD2;",g=p?"color: #E3E3E3;":"color: #1F1F1F;",y="5.4.7-beta.4",b=10,v="data-iframe-size",z="data-iframe-overflowed",w="data-iframe-ignore",$="bottom",S="right",O="autoResizeEnabled",E=Symbol("sizeChanged"),M="manualResize",k="parentResize",j={[M]:1,[k]:1},T="setOffsetSize",I="resizeObserver",C="overflowObserver",x="mutationObserver",A="none",P="No change in content size detected",R="init",N=(e,t,n,o)=>e.addEventListener(t,n,o||!1),q=["<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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const B=e=>(e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(q[e]),L=(e,...t)=>setTimeout((()=>e(...t)),0),F=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},W=e=>e,D=e=>Math.round(1e3*e)/1e3,H=e=>e.charAt(0).toUpperCase()+e.slice(1),U=e=>""!=`${e}`&&void 0!==e;function V(e){switch(!0){case!U(e):return"";case U(e.id):return`${e.nodeName}#${e.id}`;case U(e.name):return`${e.nodeName} (${e.name}`;case U(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}const Z=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${H(t)}`)};let J=!0;const _=(Q=function(n={}){const c={},u={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function b(){delete h.event,y()}const v=()=>!!p.some((([e])=>e in i))||!!h.expand;function z(){if(0!==p.length){l[v()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?g:""}`,e,t,o);for(const[e,...t]of p)l.assert(e in l,`Unknown console method: ${e}`),e in l&&l[e](...t);l.groupEnd(),b()}else b()}function w(){""===g&&(g=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 $(e,...t){0===p.length&&(w(),queueMicrotask((()=>queueMicrotask(z)))),p.push([e,...t])}function S(e=r,...t){c[e]?$("log",`${e}: ${performance.now()-c[e]} ms`,...t):$("timeLog",e,...t)}return{...m(h,f(h)),...m(console,(e=>[e,(...t)=>$(e,...t)])),...m(s,d),assert:function(e,...t){e||$("assert",e,...t)},count:function(e=r){u[e]?u[e]+=1:u[e]=1,$("log",`${e}: ${u[e]}`)},countReset:function(e=r){delete u[e]},endAutoGroup:z,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;$("error",e)}return n},event:function(e){w(),h.event=e},purge:y,time:function(e=r){w(),c[e]=performance.now()},timeEnd:function(e=r){S(e),delete c[e]},timeLog:S,touch:w}},Q?.__esModule?Q.default:Q);var Q;const G=_({label:"iframeResizer(child)"});const Y=(X="log",(...e)=>!J||G[X](...e));var X;const K=Y,{assert:ee,debug:te,endAutoGroup:ne,error:oe,errorBoundary:re,event:ie,label:ae,purge:se,warn:le}=G,ce=e=>{return G.warn((t=W,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},ue=ce,de=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,t)=>ce(t))),fe=de("Method"),me=de("Method","replaced with"),pe=de("Option"),he=["min-height","min-width","max-height","max-width"],ge=new Set,ye=e=>e.tagName?e.tagName.toLowerCase():"unknown",be=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),ve=(e,t)=>{return(n=be(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function ze({href:e}){ge.has(e)||(Y("Unable to access stylesheet:",e),ge.add(e))}const we=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){ze(n)}return{source:"cross-origin stylesheet",value:be(e,t)}}(e,t),$e=(e,t)=>{const{source:n,value:o}=we(e,t),r=ye(e);ce(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function Se(){for(const e of[document.documentElement,document.body])for(const t of he)Y(`Checking <${ye(e)}> for blocking CSS: ${t}`),ve(e,t)&&$e(e,t)}const Oe=e=>t=>void 0===t?void 0:e(t),Ee=Oe((e=>"true"===e)),Me=Oe(Number),ke="--ifr-start",je="--ifr-end",Te=[],Ie=new WeakSet,Ce=e=>"object"==typeof e&&Ie.add(e);let xe={},Ae=0;const Pe=setInterval((()=>{if(Te.length<10)return;if(xe.hasTags&&xe.len<25)return;Te.sort();const e=Math.min(Te.reduce(((e,t)=>e+t),0)/Te.length,Te[Math.floor(Te.length/2)]),t=D(e);t>Ae&&(Ae=t,ie("performanceObserver"),Y("Mean time:",D(Te[Math.floor(Te.length/2)])),Y("Median time:",D(Te.reduce(((e,t)=>e+t),0)/Te.length)),Y("Average time:",t),Y("Max time:",D(Math.max(...Te)))),e<=4||(clearInterval(Pe),ce(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${D(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${xe.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function Re(e){e.getEntries().forEach((e=>{if(e.name===je){const{duration:t}=performance.measure("--ifr-measure",ke,je);xe=e.detail,Te.push(t),Te.length>100&&Te.shift()}}))}function Ne(){new PerformanceObserver(Re).observe({entryTypes:["mark"]}),Ce(document.documentElement),Ce(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",Ne):Ne());const qe=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Be=qe("function"),Le=qe("number"),Fe=qe("string");"undefined"!=typeof window&&function(){const o={height:()=>(le("Custom height calculation function not defined"),jt.auto()),width:()=>(le("Custom width calculation function not defined"),Tt.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},i={},a="auto",s="[iFrameSizer]",l="scroll";let c,u,d,f,m,p,q,U=!0,_="",Q=0,X="",oe="",se=!1,de=!0,he=!1,ge=!0,ye=!1,be=!1,ve=!1,ze=1,we=a,$e="",Oe=!0,Te={},Ie=!0,Ce=!1,xe="",Ae=0,Pe=!1,Re="",Ne=W,qe=[],We="child",De=null,He=!1,Ue="",Ve=[],Ze=window.parent,Je="*",_e=0,Qe=!1,Ge=1,Ye=l,Xe=window,Ke=()=>{le("onMessage function not defined")},et=()=>{},tt=null,nt=null;function ot(e){var t,n,r;!function(e){Re=e[0]??Re,Q=Me(e[1])??Q,he=Ee(e[2])??he,Ce=Ee(e[3])??Ce,U=Ee(e[6])??U,X=e[7]??X,we=e[8]??we,_=e[9]??_,oe=e[10]??oe,_e=Me(e[11])??_e,Te.enable=Ee(e[12])??!1,We=e[13]??We,Ye=e[14]??Ye,Pe=Ee(e[15])??Pe,c=Me(e[16])??c,u=Me(e[17])??u,de=Ee(e[18])??de,xe=e[19]??xe,p=e[20]??p,Ae=Me(e[21])??Ae,Ie=Ee(e[23])??Ie}(e),t={id:Re,enabled:Ce,expand:Ie},G.label(`${t.id}`),G.expand(t.expand),J=t.enabled,Y(`Initialising iframe v${y} ${window.location.href}`),function(){function e(e){Y("Reading data from page:",e),q=Be(e,"onBeforeResize")??q,Ke=Be(e,"onMessage")??Ke,et=Be(e,"onReady")??et,"number"==typeof e?.offset&&(pe("offset","offsetSize"),de&&(c=Le(e,"offset")??c),he&&(u=Le(e,"offset")??u)),"number"==typeof e?.offsetSize&&(de&&(c=Le(e,"offsetSize")??c),he&&(u=Le(e,"offsetSize")??u)),$e=Fe(e,"ignoreSelector")??$e,Ue=Fe(e,"sizeSelector")??Ue,Je=Fe(e,"targetOrigin")??Je,we=e?.heightCalculationMethod||we,Ye=e?.widthCalculationMethod||Ye}function t(e,t){return"function"==typeof e&&(ce(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),o[t]=e,e="custom"),e}if(1===Ae)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),we=t(we,"height"),Ye=t(Ye,"width"),K(`Set targetOrigin for parent: %c${Je}`,h))}(),mt(),function(){try{He=1===Ae||"iframeParentListener"in window.parent}catch(e){Y("Cross domain iframe detected")}}(),he===de&&(se=!0),Ae<0?ue(`${B(Ae+2)}${B(2)}`):p?.codePointAt(0)>4||Ae<2&&ue(B(3)),p&&""!==p&&"false"!==p?p!==y&&ce(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${p} - Child page: ${y}.\n`):ce("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n"),gt(),yt(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(v,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&ce("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),"BackCompat"===document.compatMode&&ce("<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n"),st(),se||Se(),1!==Ae&&(Xe.parentIframe=Object.freeze({autoResize:e=>(Z(e,"boolean","parentIframe.autoResize(enable) enable"),!1===he&&!1===de?(ie(O),ce(`Auto Resize can not be changed when <b>direction</> is set to '${A}'.`),!1):(!0===e&&!1===U?(U=!0,queueMicrotask((()=>Pt(O,"Auto Resize enabled")))):!1===e&&!0===U&&(U=!1),Nt(0,0,"autoResize",JSON.stringify(U)),U)),close(){Nt(0,0,"close")},getId:()=>Re,getOrigin:()=>(fe("getOrigin()","getParentOrigin()"),d),getParentOrigin:()=>d,getPageInfo(e){if("function"==typeof e)return tt=e,Nt(0,0,"pageInfo"),void me("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");tt=null,Nt(0,0,"pageInfoStop")},getParentProps:e=>(Z(e,"function","parentIframe.getParentProps(callback) callback"),nt=e,Nt(0,0,"parentInfo"),()=>{nt=null,Nt(0,0,"parentInfoStop")}),getParentProperties(e){fe("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){Z(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Te.findTarget(e)},reset(){!function(){const e=we;we=a,Y("Reset trigger event: %cparentIframe.reset",h),Qe?Y("TriggerLock blocked calculation"):(Qe=!0,te("Trigger event lock on"),requestAnimationFrame((()=>{Qe=!1,te("Trigger event lock off")}))),Rt("reset"),we=e}()},setOffsetSize(e){Z(e,"number","parentIframe.setOffsetSize(offset) offset"),c=e,u=e,Pt(T,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){Z(e,"number","parentIframe.scrollBy(x, y) x"),Z(t,"number","parentIframe.scrollBy(x, y) y"),Nt(t,e,"scrollBy")},scrollTo(e,t){Z(e,"number","parentIframe.scrollTo(x, y) x"),Z(t,"number","parentIframe.scrollTo(x, y) y"),Nt(t,e,"scrollTo")},scrollToOffset(e,t){Z(e,"number","parentIframe.scrollToOffset(x, y) x"),Z(t,"number","parentIframe.scrollToOffset(x, y) y"),Nt(t,e,"scrollToOffset")},sendMessage(e,t){t&&Z(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Nt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){we=e,gt()},setWidthCalculationMethod(e){Ye=e,yt()},setTargetOrigin(e){Z(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),Y(`Set targetOrigin: %c${e}`,h),Je=e},resize(e,t){e&&Z(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&Z(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),Pt(M,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){fe("size()","resize()"),this.resize(e,t)}}),Xe.parentIFrame=Xe.parentIframe),function(){function e(e){Nt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){Y(`Add event listener: %c${n}`,h),N(window.document,t,e)}!0===Pe&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),Te=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function t(t){const n=t.getBoundingClientRect(),o=e();return{x:parseInt(n.left,b)+parseInt(o.x,b),y:parseInt(n.top,b)+parseInt(o.y,b)}}function n(e){function n(e){const n=t(e);Y(`Moving to in page link (%c#${o}%c) at x: %c${n.x}%c y: %c${n.y}`,h,g,h,g,h),Nt(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,r=decodeURIComponent(o),i=document.getElementById(r)||document.getElementsByName(r)[0];void 0===i?(Y(`In page link (#${o}) not found in iFrame, so sending to parent`),Nt(0,0,"inPageLink",`#${o}`)):n(i)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&N(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function i(){N(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){Y("Setting up location.hash handlers"),r(),i(),a()}return Te.enable?1===Ae?ce("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):s():Y("In page linking not enabled"),{findTarget:n}}(),void 0===X&&(X=`${Q}px`),dt("margin",(n="margin",(r=X).includes("-")&&(le(`Negative CSS value ignored for ${n}`),r=""),r)),dt("background",_),dt("padding",oe),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),se||function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),Y("Set HTML & body height: %cauto !important",h)}(),!0!==U&&Y("Auto Resize disabled"),function(e){pt({method:e,eventType:"After Print",eventName:"afterprint"}),pt({method:e,eventType:"Before Print",eventName:"beforeprint"}),pt({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const r=t=>{K("Mutations observed:",t);for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},i=16,a=2,s=200;let l=1;function c(e){mt(),lt(e),e.forEach(zt),e.clear()}function u(){const d=performance.now(),f=d-o,m=i*l+++a;if(f>m&&f<s)return K("Backed off due to heavy workload on callStack"),Y(`Delay: %c${D(f)}ms %c> Delay limit: %c${m}ms`,h,g,h),setTimeout(u,i*l),void(o=d);l=1,t.forEach(r),t.length=0,e.size>0&&c(e),st(),it(),n=!1,Pt(x,"Mutation Observed")}function d(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(u))}function f(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[w,v],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return Y("Setup <body> MutationObserver"),e.observe(t,n),e}f()}(),Y("Setup ResizeObserver"),De=new ResizeObserver(bt),De.observe(document.body),vt.add(document.body),zt(document.body),de!==he&&(Y("Setup OverflowObserver"),Ne=(e=>{const t=e.side||$,n=e.onChange||W,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||W,i=(e=!1)=>n(e),a=(e,n)=>0===e||e>n[t],s=(e,t)=>e.toggleAttribute(z,t),l=new IntersectionObserver((function(e){for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,l=e[t],c=a(l,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);s(i,c)}var n;r(i)}),o),c=new WeakSet;return function(e){Y("Attached overflowObservers");for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=c.has(t);!n&&e?(l.observe(t),c.add(t)):ee(!n,"Node already observed",t)}}})({onChange:at,root:document.documentElement,side:de?$:S})),lt(St(document)()),rt(F(et)),Y("Initialization complete"),Pt(R,"Init message from host page",void 0,void 0,y),document.title&&""!==document.title&&Nt(0,0,"title",document.title)}function rt(e){"complete"===document.readyState?L(e):N(document,"readystatechange",(()=>rt(e)))}function it(){const e=document.querySelectorAll(`[${z}]`);qe=Array.from(e).filter((e=>!e.closest(`[${w}]`))),be=qe.length>0}function at(e){it(),(be||e)&&(be?K("Overflowed Elements:",...qe):K("Overflow removed"),Pt(C,"Overflow updated"))}function st(){Ve=document.querySelectorAll(`[${v}]`),ve=Ve.length>0,Y(`Tagged elements found: %c${ve}`,h)}function lt(e){ve||Ne(e)}let ct=0;function ut(){const n=document.querySelectorAll(`*[${w}]`);ye=n.length>0,ye&&n.length!==ct&&(function(n){const o=1===n.length?"":"s";le(`%c[${w}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),ct=n.length)}function dt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),K(`Set body ${e}: %c${t}`,h))}function ft(e,t,n){if(""!==n){Y(`${e}: %c${n}`,h);for(const e of document.querySelectorAll(n))Y(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function mt(){ft("sizeSelector",v,Ue),ft("ignoreSelector",w,$e)}function pt(e){({add(t){function n(){Pt(e.eventName,e.eventType)}i[t]=n,N(window,t,n,{passive:!0})},remove(e){const t=i[e];var n,o;delete i[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),Y(`${H(e.method)} event listener: %c${e.eventType}`,h)}function ht(e,t,n,o){return t!==e&&(e in n||(le(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&ce(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you ${p?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),Y(`Set ${o} calculation method: %c${e}`,h),e}function gt(){we=ht(we,a,jt,"height")}function yt(){Ye=ht(Ye,l,Tt,"width")}function bt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Pt(I,`Element resized <${V(t)}>`)}const vt=new WeakSet;function zt(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!vt.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(De.observe(e),vt.add(e),Y(`Attached resizeObserver: %c${V(e)}`,h))}const t=St(e)();for(const e of t){if(vt.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(De.observe(e),vt.add(e),Y(`Attached resizeObserver: %c${V(e)}`,h))}}function wt(e){performance.mark(ke);const t=H(e);let n=0,o=document.documentElement,r=ve?0:document.documentElement.getBoundingClientRect().bottom;const i=ve?Ve:be?qe:St(document)();for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return K(`${t} position calculated from:`,o),performance.mark(je,{detail:{hasTags:ve,len:i.length,logging:Ce,Side:t}}),r}const $t=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],St=e=>()=>{ut();const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return ye&&t.push(`not([${w}])`,`not([${w}] *)`),e.querySelectorAll(t.join(":"))},Ot={height:0,width:0},Et={height:0,width:0},Mt=[h,g,h];function kt(e){function t(){return Et[o]=r,Ot[o]=s,r}const n=e===jt,o=n?"height":"width",r=e.boundingClientRect(),i=Math.ceil(r),a=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),l=`HTML: %c${r}px %cPage: %c${s}px`;let c=0;switch(!0){case!e.enabled():return s;case ve:K("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!be&&0===Et[o]&&0===Ot[o]:K(`Initial page size values: ${l}`,...Mt),c=t();break;case Qe&&r===Et[o]&&s===Ot[o]:K(`Size unchanged: ${l}`,...Mt),c=Math.max(r,s);break;case 0===r:K(`Page is hidden: ${l}`,...Mt),c=s;break;case!be&&r!==Et[o]&&s<=Ot[o]:K(`New <html> size: ${l} `,...Mt),K(`Previous <html> size: %c${Et[o]}px`,h),c=t();break;case!n:c=e.taggedElement();break;case!be&&r<Et[o]:K(`<html> size decreased: ${l}`,...Mt),c=t();break;case s===a||s===i:K(`<html> size equals page size: ${l}`,...Mt),c=t();break;case r>s:K(`Page size < <html> size: ${l}`,...Mt),c=t();break;case be:K("Found element overflowing <html> "),c=e.taggedElement();break;default:K(`Using <html> size: ${l}`,...Mt),c=t()}return K(`Content ${o}: %c${c}px`,h),c+=function(e){const t=e.getOffset();return 0!==t&&K(`Page offsetSize: %c${t}px`,h),t}(e),c}const jt={enabled:()=>de,getOffset:()=>c,auto:()=>kt(jt),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,b)+parseInt(t.marginBottom,b)},bodyScroll:()=>document.body.scrollHeight,offset:()=>jt.bodyOffset(),custom:()=>o.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...$t(jt)),min:()=>Math.min(...$t(jt)),grow:()=>jt.max(),lowestElement:()=>wt($),taggedElement:()=>wt($)},Tt={enabled:()=>he,getOffset:()=>u,auto:()=>kt(Tt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>o.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...$t(Tt)),min:()=>Math.min(...$t(Tt)),rightMostElement:()=>wt(S),scroll:()=>Math.max(Tt.bodyScroll(),Tt.documentElementScroll()),taggedElement:()=>wt(S)},It=(e,t)=>!(Math.abs(e-t)<=_e);function Ct(e,t){const n=e[t]();return e.enabled()&&void 0!==q?function(e){const t=q(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);return t}(n):n}let xt=!1;const At=F((()=>ue(B(4)))),Pt=re(((e,t,n,o,r)=>{if(m=performance.now(),f=!0,ie(e),!0!==xt)return U||e in j?void(document.hidden?Y("Page hidden - Ignored resize request"):(xt=!0,requestAnimationFrame((()=>{xt=!1})),function(e,t,n,o,r){const i=n??Ct(jt,we),a=o??Ct(Tt,Ye),s=de&&It(ze,i)||he&&It(Ge,a)?E:e;switch(Y(`Resize event: %c${t}`,h),s){case R:case O:case E:ze=i,Ge=a;case T:Nt(ze,Ge,e,r);break;case I:case C:case x:Y(P);break;default:K(P)}f=!1}(e,t,n,o,r))):(K("Resizing disabled"),void ne())}));function Rt(e){ze=jt[we](),Ge=Tt[Ye](),Nt(ze,Ge,e)}const Nt=re((function(e,t,o,r,i){Ae<-1||(ie(o),void 0!==i?Y(`Message targetOrigin: %c${i}`,h):i=Je,function(){const a=`${Re}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(He)try{window.parent.iframeParentListener(s+a)}catch(e){if(1!==Ae)throw e;return void At()}else Ze.postMessage(s+a,i);f&&Y(function(){const e=D(performance.now()-m);return o===R?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),h),K(`Sending message to parent page via ${He?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}(),ne())})),qt=re((function(e){ie("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>t(n(e)),r=e=>Nt(0,0,`${e}Stop`),i={init:function(){if("loading"===document.readyState)return void Y("Page not ready, ignoring init message");const t=e.data.slice(13).split(":");Ze=e.source,d=e.origin,ot(t),ge=!1,setTimeout((()=>{Oe=!1}),128)},reset(){Oe?Y("Page reset ignored by init"):(Y("Page size reset by host page"),Rt("resetPage"))},resize(){Y("Resize requested by host page"),Pt(k,"Parent window requested size check")},moveToAnchor(){Te.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();Y("PageInfo received from parent:",o(e)),tt?L(tt,n(e)):r("pageInfo")},parentInfo(){const e=o(l());Y("ParentInfo received from parent:",e),nt?L(nt,e):r("parentInfo")},message(){const e=l();Y("onMessage called from parent:%c",h,o(e)),L(Ke,n(e))}},a=()=>e.data.split("]")[1].split(":")[0],l=()=>e.data.slice(e.data.indexOf(":")+1),c=()=>e.data.split(":")[2]in{true:1,false:1};function u(){const t=a();ie(t),t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||c()||le(`Unexpected message (${e.data})`)}s===`${e.data}`.slice(0,13)&&function(){if(!1!==ge)return c()?(ae(a()),ie(R),void i.init()):void Y(`Ignored message of type "${a()}". Received before initialization.`);u()}()}));function Bt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?le("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>qt({data:e,sameOrigin:!0}))),N(window,"message",qt),N(window,"readystatechange",Bt),Bt())}()}));
21
- //# sourceMappingURL=index.umd.js.map
20
+ !function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0},l=Object.assign(console);const{fromEntries:c,keys:u}=Object,d=e=>[e,l[e]],f=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>c(u(e).map(t));const p=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,h=p?"color: #A9C7FB;":"color: #135CD2;",g=p?"color: #E3E3E3;":"color: #1F1F1F;",y="5.4.7",b=10,v="data-iframe-size",z="data-iframe-overflowed",w="data-iframe-ignore",$="bottom",S="right",E="autoResizeEnabled",O=Symbol("sizeChanged"),j="manualResize",k="parentResize",M={[j]:1,[k]:1},T="setOffsetSize",C="resizeObserver",x="overflowObserver",A="mutationObserver",I="none",P="init",N=(e,t,n,o)=>e.addEventListener(t,n,o||!1),R=["<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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const B=e=>(e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(R[e]),q=(e,...t)=>setTimeout((()=>e(...t)),0),L=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},F=e=>e,W=e=>Math.round(1e3*e)/1e3,D=e=>e.charAt(0).toUpperCase()+e.slice(1),H=e=>""!=`${e}`&&void 0!==e;const U=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${D(t)}`)};let V=!0;const Z=(J=function(n={}){const c={},u={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function b(){delete h.event,y()}const v=()=>!!p.some((([e])=>e in i))||!!h.expand;function z(){if(0!==p.length){l[v()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?g:""}`,e,t,o);for(const[e,...t]of p)l.assert(e in l,`Unknown console method: ${e}`),e in l&&l[e](...t);l.groupEnd(),b()}else b()}function w(){""===g&&(g=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 $(e,...t){0===p.length&&(w(),queueMicrotask((()=>queueMicrotask(z)))),p.push([e,...t])}function S(e=r,...t){c[e]?$("log",`${e}: ${performance.now()-c[e]} ms`,...t):$("timeLog",e,...t)}return{...m(h,f(h)),...m(console,(e=>[e,(...t)=>$(e,...t)])),...m(s,d),assert:function(e,...t){e||$("assert",e,...t)},count:function(e=r){u[e]?u[e]+=1:u[e]=1,$("log",`${e}: ${u[e]}`)},countReset:function(e=r){delete u[e]},endAutoGroup:z,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;$("error",e)}return n},event:function(e){w(),h.event=e},purge:y,time:function(e=r){w(),c[e]=performance.now()},timeEnd:function(e=r){S(e),delete c[e]},timeLog:S,touch:w}},J?.__esModule?J.default:J);var J;const _=Z({label:"iframeResizer(child)"});var Q;const G=(Q="log",(...e)=>!V||_[Q](...e)),{assert:Y,debug:X,endAutoGroup:K,error:ee,errorBoundary:te,event:ne,label:oe,purge:re,warn:ie}=_,ae=e=>{return _.warn((t=F,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},se=ae,le=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,t)=>ae(t))),ce=le("Method"),ue=le("Method","replaced with"),de=le("Option"),fe=["min-height","min-width","max-height","max-width"],me=new Set,pe=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),he=(e,t)=>{return(n=pe(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function ge({href:e}){me.has(e)||me.add(e)}const ye=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){ge(n)}return{source:"cross-origin stylesheet",value:pe(e,t)}}(e,t),be=(e,t)=>{const{source:n,value:o}=ye(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);ae(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function ve(){for(const e of[document.documentElement,document.body])for(const t of fe)he(e,t)&&be(e,t)}const ze=e=>t=>void 0===t?void 0:e(t),we=ze((e=>"true"===e)),$e=ze(Number),Se="--ifr-start",Ee="--ifr-end",Oe=[],je=new WeakSet,ke=e=>"object"==typeof e&&je.add(e);let Me={},Te=0;const Ce=setInterval((()=>{if(Oe.length<10)return;if(Me.hasTags&&Me.len<25)return;Oe.sort();const e=Math.min(Oe.reduce(((e,t)=>e+t),0)/Oe.length,Oe[Math.floor(Oe.length/2)]),t=W(e);t>Te&&(Te=t,ne("performanceObserver")),e<=4||(clearInterval(Ce),ae(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${W(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${Me.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function xe(e){e.getEntries().forEach((e=>{if(e.name===Ee){const{duration:t}=performance.measure("--ifr-measure",Se,Ee);Me=e.detail,Oe.push(t),Oe.length>100&&Oe.shift()}}))}function Ae(){new PerformanceObserver(xe).observe({entryTypes:["mark"]}),ke(document.documentElement),ke(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",Ae):Ae());const Ie=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Pe=Ie("function"),Ne=Ie("number"),Re=Ie("string");"undefined"!=typeof window&&function(){const o={height:()=>(ie("Custom height calculation function not defined"),St.auto()),width:()=>(ie("Custom width calculation function not defined"),Et.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},i={},a="auto",s="[iFrameSizer]",l="scroll";let c,u,d,f,m,p=!0,R="",W=0,Z="",J="",Q=!1,X=!0,ee=!1,le=!0,fe=!1,me=!1,pe=!1,he=1,ge=a,ye="",be=!0,ze={},Oe=!0,je=!1,ke="",Me=0,Te=!1,Ce="",xe=F,Ae=[],Ie="child",Be=null,qe=!1,Le="",Fe=[],We=window.parent,De="*",He=0,Ue=!1,Ve=1,Ze=l,Je=window,_e=()=>{ie("onMessage function not defined")},Qe=()=>{},Ge=null,Ye=null;function Xe(e){var t,n,r;!function(e){Ce=e[0]??Ce,W=$e(e[1])??W,ee=we(e[2])??ee,je=we(e[3])??je,p=we(e[6])??p,Z=e[7]??Z,ge=e[8]??ge,R=e[9]??R,J=e[10]??J,He=$e(e[11])??He,ze.enable=we(e[12])??!1,Ie=e[13]??Ie,Ze=e[14]??Ze,Te=we(e[15])??Te,c=$e(e[16])??c,u=$e(e[17])??u,X=we(e[18])??X,ke=e[19]??ke,f=e[20]??f,Me=$e(e[21])??Me,Oe=we(e[23])??Oe}(e),t={id:Ce,enabled:je,expand:Oe},_.label(`${t.id}`),_.expand(t.expand),V=t.enabled,function(){function e(e){m=Pe(e,"onBeforeResize")??m,_e=Pe(e,"onMessage")??_e,Qe=Pe(e,"onReady")??Qe,"number"==typeof e?.offset&&(de("offset","offsetSize"),X&&(c=Ne(e,"offset")??c),ee&&(u=Ne(e,"offset")??u)),"number"==typeof e?.offsetSize&&(X&&(c=Ne(e,"offsetSize")??c),ee&&(u=Ne(e,"offsetSize")??u)),ye=Re(e,"ignoreSelector")??ye,Le=Re(e,"sizeSelector")??Le,De=Re(e,"targetOrigin")??De,ge=e?.heightCalculationMethod||ge,Ze=e?.widthCalculationMethod||Ze}function t(e,t){return"function"==typeof e&&(ae(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),o[t]=e,e="custom"),e}if(1===Me)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),ge=t(ge,"height"),Ze=t(Ze,"width"),G(`Set targetOrigin for parent: %c${De}`,h))}(),lt(),function(){try{qe=1===Me||"iframeParentListener"in window.parent}catch(e){}}(),ee===X&&(Q=!0),Me<0?se(`${B(Me+2)}${B(2)}`):f?.codePointAt(0)>4||Me<2&&se(B(3)),f&&""!==f&&"false"!==f?f!==y&&ae(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${f} - Child page: ${y}.\n`):ae("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n"),dt(),ft(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(v,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&ae("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),"BackCompat"===document.compatMode&&ae("<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n"),nt(),Q||ve(),1!==Me&&(Je.parentIframe=Object.freeze({autoResize:e=>(U(e,"boolean","parentIframe.autoResize(enable) enable"),!1===ee&&!1===X?(ne(E),ae(`Auto Resize can not be changed when <b>direction</> is set to '${I}'.`),!1):(!0===e&&!1===p?(p=!0,queueMicrotask((()=>Tt(E,"Auto Resize enabled")))):!1===e&&!0===p&&(p=!1),xt(0,0,"autoResize",JSON.stringify(p)),p)),close(){xt(0,0,"close")},getId:()=>Ce,getOrigin:()=>(ce("getOrigin()","getParentOrigin()"),d),getParentOrigin:()=>d,getPageInfo(e){if("function"==typeof e)return Ge=e,xt(0,0,"pageInfo"),void ue("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Ge=null,xt(0,0,"pageInfoStop")},getParentProps:e=>(U(e,"function","parentIframe.getParentProps(callback) callback"),Ye=e,xt(0,0,"parentInfo"),()=>{Ye=null,xt(0,0,"parentInfoStop")}),getParentProperties(e){ce("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){U(e,"string","parentIframe.moveToAnchor(anchor) anchor"),ze.findTarget(e)},reset(){!function(){const e=ge;ge=a,Ue||(Ue=!0,requestAnimationFrame((()=>{Ue=!1}))),Ct("reset"),ge=e}()},setOffsetSize(e){U(e,"number","parentIframe.setOffsetSize(offset) offset"),c=e,u=e,Tt(T,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){U(e,"number","parentIframe.scrollBy(x, y) x"),U(t,"number","parentIframe.scrollBy(x, y) y"),xt(t,e,"scrollBy")},scrollTo(e,t){U(e,"number","parentIframe.scrollTo(x, y) x"),U(t,"number","parentIframe.scrollTo(x, y) y"),xt(t,e,"scrollTo")},scrollToOffset(e,t){U(e,"number","parentIframe.scrollToOffset(x, y) x"),U(t,"number","parentIframe.scrollToOffset(x, y) y"),xt(t,e,"scrollToOffset")},sendMessage(e,t){t&&U(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),xt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){ge=e,dt()},setWidthCalculationMethod(e){Ze=e,ft()},setTargetOrigin(e){U(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),De=e},resize(e,t){e&&U(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&U(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),Tt(j,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ce("size()","resize()"),this.resize(e,t)}}),Je.parentIFrame=Je.parentIframe),function(){function e(e){xt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){N(window.document,t,e)}!0===Te&&(t("mouseenter"),t("mouseleave"))}(),ze=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function t(t){const n=t.getBoundingClientRect(),o=e();return{x:parseInt(n.left,b)+parseInt(o.x,b),y:parseInt(n.top,b)+parseInt(o.y,b)}}function n(e){function n(e){const n=t(e);xt(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,r=decodeURIComponent(o),i=document.getElementById(r)||document.getElementsByName(r)[0];void 0===i?xt(0,0,"inPageLink",`#${o}`):n(i)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&N(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function i(){N(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){r(),i(),a()}return ze.enable&&(1===Me?ae("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):s()),{findTarget:n}}(),void 0===Z&&(Z=`${W}px`),at("margin",(n="margin",(r=Z).includes("-")&&(ie(`Negative CSS value ignored for ${n}`),r=""),r)),at("background",R),at("padding",J),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),Q||function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),function(e){ct({method:e,eventType:"After Print",eventName:"afterprint"}),ct({method:e,eventType:"Before Print",eventName:"beforeprint"}),ct({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const r=t=>{G("Mutations observed:",t);for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},i=16,a=2,s=200;let l=1;function c(e){lt(),ot(e),e.forEach(ht),e.clear()}function u(){const d=performance.now(),f=d-o;if(f>i*l+++a&&f<s)return G("Backed off due to heavy workload on callStack"),setTimeout(u,i*l),void(o=d);l=1,t.forEach(r),t.length=0,e.size>0&&c(e),nt(),et(),n=!1,Tt(A,"Mutation Observed")}function d(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(u))}function f(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[w,v],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return e.observe(t,n),e}f()}(),Be=new ResizeObserver(mt),Be.observe(document.body),pt.add(document.body),ht(document.body),X!==ee&&(xe=(e=>{const t=e.side||$,n=e.onChange||F,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||F,i=(e=!1)=>n(e),a=(e,n)=>0===e||e>n[t],s=(e,t)=>e.toggleAttribute(z,t),l=new IntersectionObserver((function(e){for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,l=e[t],c=a(l,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);s(i,c)}var n;r(i)}),o),c=new WeakSet;return function(e){for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=c.has(t);!n&&e?(l.observe(t),c.add(t)):Y(!n,"Node already observed",t)}}})({onChange:tt,root:document.documentElement,side:X?$:S})),ot(bt(document)()),Ke(L(Qe)),Tt(P,"Init message from host page",void 0,void 0,y),document.title&&""!==document.title&&xt(0,0,"title",document.title)}function Ke(e){"complete"===document.readyState?q(e):N(document,"readystatechange",(()=>Ke(e)))}function et(){const e=document.querySelectorAll(`[${z}]`);Ae=Array.from(e).filter((e=>!e.closest(`[${w}]`))),me=Ae.length>0}function tt(e){et(),(me||e)&&(me?G("Overflowed Elements:",...Ae):G("Overflow removed"),Tt(x,"Overflow updated"))}function nt(){Fe=document.querySelectorAll(`[${v}]`),pe=Fe.length>0}function ot(e){pe||xe(e)}let rt=0;function it(){const n=document.querySelectorAll(`*[${w}]`);fe=n.length>0,fe&&n.length!==rt&&(function(n){const o=1===n.length?"":"s";ie(`%c[${w}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),rt=n.length)}function at(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),G(`Set body ${e}: %c${t}`,h))}function st(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function lt(){st(0,v,Le),st(0,w,ye)}function ct(e){({add(t){function n(){Tt(e.eventName,e.eventType)}i[t]=n,N(window,t,n,{passive:!0})},remove(e){const t=i[e];var n,o;delete i[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function ut(e,t,n,o){return t!==e&&(e in n||(ie(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&ae(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you ${f?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),e}function dt(){ge=ut(ge,a,St,"height")}function ft(){Ze=ut(Ze,l,Et,"width")}function mt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Tt(C,`Element resized <${function(e){switch(!0){case!H(e):return"";case H(e.id):return`${e.nodeName}#${e.id}`;case H(e.name):return`${e.nodeName} (${e.name}`;case H(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}const pt=new WeakSet;function ht(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!pt.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Be.observe(e),pt.add(e))}const t=bt(e)();for(const e of t){if(pt.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Be.observe(e),pt.add(e))}}function gt(e){performance.mark(Se);const t=D(e);let n=0,o=document.documentElement,r=pe?0:document.documentElement.getBoundingClientRect().bottom;const i=pe?Fe:me?Ae:bt(document)();for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return G(`${t} position calculated from:`,o),performance.mark(Ee,{detail:{hasTags:pe,len:i.length,logging:je,Side:t}}),r}const yt=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],bt=e=>()=>{it();const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return fe&&t.push(`not([${w}])`,`not([${w}] *)`),e.querySelectorAll(t.join(":"))},vt={height:0,width:0},zt={height:0,width:0},wt=[h,g,h];function $t(e){function t(){return zt[o]=r,vt[o]=s,r}const n=e===St,o=n?"height":"width",r=e.boundingClientRect(),i=Math.ceil(r),a=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),l=`HTML: %c${r}px %cPage: %c${s}px`;let c=0;switch(!0){case!e.enabled():return s;case pe:G("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!me&&0===zt[o]&&0===vt[o]:G(`Initial page size values: ${l}`,...wt),c=t();break;case Ue&&r===zt[o]&&s===vt[o]:G(`Size unchanged: ${l}`,...wt),c=Math.max(r,s);break;case 0===r:G(`Page is hidden: ${l}`,...wt),c=s;break;case!me&&r!==zt[o]&&s<=vt[o]:G(`New <html> size: ${l} `,...wt),G(`Previous <html> size: %c${zt[o]}px`,h),c=t();break;case!n:c=e.taggedElement();break;case!me&&r<zt[o]:G(`<html> size decreased: ${l}`,...wt),c=t();break;case s===a||s===i:G(`<html> size equals page size: ${l}`,...wt),c=t();break;case r>s:G(`Page size < <html> size: ${l}`,...wt),c=t();break;case me:G("Found element overflowing <html> "),c=e.taggedElement();break;default:G(`Using <html> size: ${l}`,...wt),c=t()}return G(`Content ${o}: %c${c}px`,h),c+=function(e){const t=e.getOffset();return 0!==t&&G(`Page offsetSize: %c${t}px`,h),t}(e),c}const St={enabled:()=>X,getOffset:()=>c,auto:()=>$t(St),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,b)+parseInt(t.marginBottom,b)},bodyScroll:()=>document.body.scrollHeight,offset:()=>St.bodyOffset(),custom:()=>o.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...yt(St)),min:()=>Math.min(...yt(St)),grow:()=>St.max(),lowestElement:()=>gt($),taggedElement:()=>gt($)},Et={enabled:()=>ee,getOffset:()=>u,auto:()=>$t(Et),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>o.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...yt(Et)),min:()=>Math.min(...yt(Et)),rightMostElement:()=>gt(S),scroll:()=>Math.max(Et.bodyScroll(),Et.documentElementScroll()),taggedElement:()=>gt(S)},Ot=(e,t)=>!(Math.abs(e-t)<=He);function jt(e,t){const n=e[t]();return e.enabled()&&void 0!==m?function(e){const t=m(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);return t}(n):n}let kt=!1;const Mt=L((()=>se(B(4)))),Tt=te(((e,t,n,o,r)=>{if(performance.now(),ne(e),!0!==kt)return p||e in M?void(document.hidden||(kt=!0,requestAnimationFrame((()=>{kt=!1})),function(e,t,n,o,r){const i=n??jt(St,ge),a=o??jt(Et,Ze);switch(X&&Ot(he,i)||ee&&Ot(Ve,a)?O:e){case P:case E:case O:he=i,Ve=a;case T:xt(he,Ve,e,r);break;case C:case x:case A:re();break;default:re(),G("No change in content size detected")}}(e,0,n,o,r))):(G("Resizing disabled"),void K())}));function Ct(e){he=St[ge](),Ve=Et[Ze](),xt(he,Ve,e)}const xt=te((function(e,t,o,r,i){Me<-1||(ne(o),void 0!==i||(i=De),function(){const a=`${Ce}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(qe)try{window.parent.iframeParentListener(s+a)}catch(e){if(1!==Me)throw e;return void Mt()}else We.postMessage(s+a,i);G(`Sending message to parent page via ${qe?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}(),K())})),At=te((function(e){ne("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>xt(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");We=e.source,d=e.origin,Xe(t),le=!1,setTimeout((()=>{be=!1}),128)},reset(){be||Ct("resetPage")},resize(){Tt(k,"Parent window requested size check")},moveToAnchor(){ze.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();Ge?q(Ge,n(e)):o("pageInfo")},parentInfo(){const e=(r=a(),t(n(r)));var r;Ye?q(Ye,e):o("parentInfo")},message(){const e=a();q(_e,n(e))}},i=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function c(){const t=i();ne(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||ie(`Unexpected message (${e.data})`)}s===`${e.data}`.slice(0,13)&&function(){if(!1!==le)return l()?(oe(i()),ne(P),void r.init()):void 0;c()}()}));function It(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?ie("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>At({data:e,sameOrigin:!0}))),N(window,"message",At),N(window,"readystatechange",It),It())}()}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iframe-resizer/child",
3
- "version": "5.4.7-beta.4",
3
+ "version": "5.4.7",
4
4
  "license": "GPL-3.0",
5
5
  "homepage": "https://iframe-resizer.com",
6
6
  "author": {