iframe-resizer 5.4.5-beta.12 → 5.4.5-beta.13

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/index.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy 5.4.5-beta.12 (cjs) - 2025-04-15
4
+ * @module iframe-resizer/legacy 5.4.5-beta.13 (cjs) - 2025-04-15
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
package/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy 5.4.5-beta.12 (esm) - 2025-04-15
4
+ * @module iframe-resizer/legacy 5.4.5-beta.13 (esm) - 2025-04-15
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (child) 5.4.5-beta.12 (iife)
4
+ * @module iframe-resizer/legacy (child) 5.4.5-beta.13 (iife)
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -17,5 +17,5 @@
17
17
  */
18
18
 
19
19
 
20
- !function(){"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:d}=Object,u=e=>[e,l[e]],m=e=>t=>[t,function(n){e[t]=n}],f=(e,t)=>c(d(e).map(t));const p=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,g=p?"color: #A9C7FB;":"color: #135CD2;",h=p?"color: #E3E3E3;":"color: #1F1F1F;",y="5.4.5-beta.12",v=10,b="data-iframe-size",z="data-iframe-overflowed",w="data-iframe-ignore",$="bottom",S="right",O="resizeParent",M="setOffsetSize",E="resizeObserver",k="overflowObserver",j="mutationObserver",I="No change in content size detected",P=(e,t,n,o)=>e.addEventListener(t,n,o||!1),A=["<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 T=e=>(e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(A[e]),x=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},C=e=>e,N=e=>Math.round(1e3*e)/1e3,R=e=>e.charAt(0).toUpperCase()+e.slice(1),q=e=>""!=`${e}`&&void 0!==e;function L(e){switch(!0){case!q(e):return"";case q(e.id):return`${e.nodeName}#${e.id}`;case q(e.name):return`${e.nodeName} (${e.name}`;case q(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}const B=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${R(t)}`)};let F=!0;const W=(D=function(n={}){const c={},d={},p=[],g={...a,expand:!n.collapsed||a.expanded,...n};let h="";function y(){p.length=0,h=""}function v(){delete g.event,y()}const b=()=>!!p.some((([e])=>e in i))||!!g.expand;function z(){if(0!==p.length){l[b()?"group":"groupCollapsed"](`%c${g.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(g)} %c${g.showTime?h:""}`,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(),v()}else v()}function w(){""===h&&(h=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function $(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{...f(g,m(g)),...f(console,(e=>[e,(...t)=>$(e,...t)])),...f(s,u),assert:function(e,...t){e||$("assert",e,...t)},count:function(e=r){d[e]?d[e]+=1:d[e]=1,$("log",`${e}: ${d[e]}`)},countReset:function(e=r){delete d[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(),g.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}},D?.__esModule?D.default:D);var D;const H=W({label:"iframeResizer(child)"});const V=(U="log",(...e)=>!F||H[U](...e));var U;const Z=V,{assert:J,debug:_,endAutoGroup:Q,error:G,errorBoundary:X,event:Y,purge:K,warn:ee}=H,te=e=>{return H.warn((t=C,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},ne=te,oe=(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)=>te(t))),re=oe("Method"),ie=oe("Method","replaced with"),ae=oe("Option"),se="--ifr-start",le="--ifr-end",ce=[],de=new WeakSet,ue=e=>"object"==typeof e&&de.add(e);let me={},fe=0;const pe=setInterval((()=>{if(ce.length<10)return;if(me.hasTags&&me.len<25)return;ce.sort();const e=Math.min(ce.reduce(((e,t)=>e+t),0)/ce.length,ce[Math.floor(ce.length/2)]),t=N(e);t>fe&&(fe=t,Y("performanceObserver"),V("Mean time:",N(ce[Math.floor(ce.length/2)])),V("Median time:",N(ce.reduce(((e,t)=>e+t),0)/ce.length)),V("Average time:",t),V("Max time:",N(Math.max(...ce)))),e<=4||(clearInterval(pe),te(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${N(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 ge(e){e.getEntries().forEach((e=>{if(e.name===le){const{duration:t}=performance.measure("--ifr-measure",se,le);me=e.detail,ce.push(t),ce.length>100&&ce.shift()}}))}function he(){new PerformanceObserver(ge).observe({entryTypes:["mark"]}),ue(document.documentElement),ue(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",he):he()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},r={height:()=>(ee("Custom height calculation function not defined"),pt.auto()),width:()=>(ee("Custom width calculation function not defined"),gt.auto())},i={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},s="checkVisibility"in window,l="auto",c="[iFrameSizer]",d={max:1,min:1,bodyScroll:1,documentElementScroll:1},u="scroll";let m,f,p,A,q,W=!0,D="",U=0,G="",K="",oe=!0,ce=!1,de=!0,ue=!1,me=!1,fe=!1,pe=1,ge=l,he="",ye=!0,ve="",be={},ze=!0,we=!1,$e=0,Se=!1,Oe="",Me=C,Ee=[],ke="child",je=null,Ie=!1,Pe="",Ae=[],Te=window.parent,xe="*",Ce=0,Ne=!1,Re="",qe=1,Le=u,Be=window,Fe=()=>{ee("onMessage function not defined")},We=()=>{},De=null,He=null;function Ve(){if("loading"===document.readyState)return ee("Document not ready, current state: %c%s",g,document.readyState),void P(document,"readystatechange",Ve);var e,t,n;!function(){const e=e=>"true"===e,t=ve.slice(13).split(":");Oe=t[0],U=void 0===t[1]?U:Number(t[1]),ce=void 0===t[2]?ce:e(t[2]),we=void 0===t[3]?we:e(t[3]),W=void 0===t[6]?W:e(t[6]),G=t[7],ge=void 0===t[8]?ge:t[8],D=t[9],K=t[10],Ce=void 0===t[11]?Ce:Number(t[11]),be.enable=void 0!==t[12]&&e(t[12]),ke=void 0===t[13]?ke:t[13],Le=void 0===t[14]?Le:t[14],Se=void 0===t[15]?Se:e(t[15]),m=void 0===t[16]?m:Number(t[16]),f=void 0===t[17]?f:Number(t[17]),oe=void 0===t[18]?oe:e(t[18]),t[19],Re=t[20]||Re,$e=void 0===t[21]?$e:Number(t[21]),ze=void 0===t[23]?ze:e(t[23])}(),e={id:Oe,enabled:we,expand:ze},H.label(`${e.id}`),H.expand(e.expand),F=e.enabled,V(`Initialising iframe v${y} ${window.location.href}`),function(){function e(e){V("Reading data from page:",e),Fe=e?.onMessage||Fe,We=e?.onReady||We,"number"==typeof e?.offset&&(ae("offset","offsetSize"),oe&&(m=e?.offset),ce&&(f=e?.offset)),"number"==typeof e?.offsetSize&&(oe&&(m=e?.offsetSize),ce&&(f=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(Pe=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(he=e.ignoreSelector),xe=e?.targetOrigin||xe,ge=e?.heightCalculationMethod||ge,Le=e?.widthCalculationMethod||Le}function t(e,t){return"function"==typeof e&&(V(`Setup custom ${t}CalcMethod`),r[t]=e,e="custom"),e}if(1===$e)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),ge=t(ge,"height"),Le=t(Le,"width"),Z(`Set targetOrigin for parent: %c${xe}`,g))}(),Ke(),function(){try{Ie=1===$e||"iframeParentListener"in window.parent}catch(e){V("Cross domain iframe detected")}}(),$e<0?ne(`${T($e+2)}${T(2)}`):Re.codePointAt(0)>4||$e<2&&ne(T(3)),Re&&""!==Re&&"false"!==Re?Re!==y&&te(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Re} - Child page: ${y}.\n`):te("<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"),nt(),ot(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(b,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&te("<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&&te("<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"),Je(),1!==$e&&(Be.parentIframe=Object.freeze({autoResize:e=>(B(e,"boolean","parentIframe.autoResize(enable) enable"),!0===e&&!1===W?(W=!0,zt("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===W&&(W=!1),St(0,0,"autoResize",JSON.stringify(W)),W),close(){St(0,0,"close")},getId:()=>Oe,getOrigin:()=>(re("getOrigin()","getParentOrigin()"),p),getParentOrigin:()=>p,getPageInfo(e){if("function"==typeof e)return De=e,St(0,0,"pageInfo"),void ie("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");De=null,St(0,0,"pageInfoStop")},getParentProps:e=>(B(e,"function","parentIframe.getParentProps(callback) callback"),He=e,St(0,0,"parentInfo"),()=>{He=null,St(0,0,"parentInfoStop")}),getParentProperties(e){re("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){B(e,"string","parentIframe.moveToAnchor(anchor) anchor"),be.findTarget(e)},reset(){$t("parentIframe.reset")},setOffsetSize(e){B(e,"number","parentIframe.setOffsetSize(offset) offset"),m=e,f=e,zt(M,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){B(e,"number","parentIframe.scrollBy(x, y) x"),B(t,"number","parentIframe.scrollBy(x, y) y"),St(t,e,"scrollBy")},scrollTo(e,t){B(e,"number","parentIframe.scrollTo(x, y) x"),B(t,"number","parentIframe.scrollTo(x, y) y"),St(t,e,"scrollTo")},scrollToOffset(e,t){B(e,"number","parentIframe.scrollToOffset(x, y) x"),B(t,"number","parentIframe.scrollToOffset(x, y) y"),St(t,e,"scrollToOffset")},sendMessage(e,t){t&&B(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),St(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){ge=e,nt()},setWidthCalculationMethod(e){Le=e,ot()},setTargetOrigin(e){B(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),V(`Set targetOrigin: %c${e}`,g),xe=e},resize(e,t){e&&B(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&B(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),zt("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){re("size()","resize()"),this.resize(e,t)}}),Be.parentIFrame=Be.parentIframe),function(){function e(e){St(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){V(`Add event listener: %c${n}`,g),P(window.document,t,e)}!0===Se&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),be=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,v)+parseInt(o.x,v),y:parseInt(n.top,v)+parseInt(o.y,v)}}function n(e){function n(e){const n=t(e);V(`Moving to in page link (%c#${o}%c) at x: %c${n.x}%c y: %c${n.y}`,g,h,g,h,g),St(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?(V(`In page link (#${o}) not found in iFrame, so sending to parent`),St(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")&&P(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function i(){P(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){V("Setting up location.hash handlers"),r(),i(),a()}return be.enable?1===$e?te("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):s():V("In page linking not enabled"),{findTarget:n}}(),void 0===G&&(G=`${U}px`),Xe("margin",(t="margin",(n=G).includes("-")&&(ee(`Negative CSS value ignored for ${t}`),n=""),n)),Xe("background",D),Xe("padding",K),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),V("Set HTML & body height: %cauto !important",g)}(),!0!==W&&V("Auto Resize disabled"),function(e){et({method:e,eventType:"After Print",eventName:"afterprint"}),et({method:e,eventType:"Before Print",eventName:"beforeprint"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const r=t=>{Z("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){Ke(),_e(e),e.forEach(at),e.clear()}function d(){const u=performance.now(),m=u-o,f=i*l+++a;if(m>f&&m<s)return Z("Backed off due to heavy workload on callStack"),V(`Delay: %c${N(m)}ms %c> Delay limit: %c${f}ms`,g,h,g),setTimeout(d,i*l),void(o=u);l=1,t.forEach(r),t.length=0,e.size>0&&c(e),Je(),Ue(),n=!1,zt(j,"Mutation Observed")}function u(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(d))}function m(){const e=new window.MutationObserver(u),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[w,b],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return V("Setup <body> MutationObserver"),e.observe(t,n),e}m()}(),V("Setup ResizeObserver"),je=new ResizeObserver(rt),je.observe(document.body),it.add(document.body),at(document.body),oe!==ce&&(V("Setup OverflowObserver"),Me=(e=>{const t=e.side||$,n=e.onChange||C,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||C,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){Y("observation");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),c&&V("Overflowed:",i)}var n;r(i)}),o),c=new WeakSet;return function(e){V("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)):J(!n,"Node already observed",t)}}})({onChange:Ze,root:document.documentElement,side:oe?$:S})),_e(ct(document)()),queueMicrotask(We),V("Initialization complete"),zt("init","Init message from host page",void 0,void 0,y),document.title&&""!==document.title&&St(0,0,"title",document.title)}function Ue(){Ee=document.querySelectorAll(`[${z}]:not([${w}]):not([${w}] *)`),me=Ee.length>0}function Ze(e){Ue(),(me||e)&&(V("Observed Elements:",Ee.length),zt(k,"Overflow updated"))}function Je(){Ae=document.querySelectorAll(`[${b}]`),fe=Ae.length>0,V(`Tagged elements found: %c${fe}`,g)}function _e(e){fe||Me(e)}let Qe=0;function Ge(){const n=document.querySelectorAll(`*[${w}]`);ue=n.length>0,ue&&n.length!==Qe&&(function(n){const o=1===n.length?"":"s";ee(`%c[${w}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),Qe=n.length)}function Xe(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),Z(`Set body ${e}: %c${t}`,g))}function Ye(e,t,n){if(""!==n){V(`${e}: %c${n}`,g);for(const e of document.querySelectorAll(n))V(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Ke(){Ye("sizeSelector",b,Pe),Ye("ignoreSelector",w,he)}function et(e){({add(t){function n(){zt(e.eventName,e.eventType)}a[t]=n,P(window,t,n,{passive:!0})},remove(e){const t=a[e];var n,o;delete a[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),V(`${R(e.method)} event listener: %c${e.eventType}`,g)}function tt(e,t,n,o){return t!==e&&(e in n||(ee(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in i&&te(`<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 remove this option.`),V(`Set ${o} calculation method: %c${e}`,g)),e}function nt(){ge=tt(ge,l,pt,"height")}function ot(){Le=tt(Le,u,gt,"width")}function rt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;zt(E,`Element resized <${L(t)}>`)}const it=new WeakSet;function at(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!it.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(je.observe(e),it.add(e),V(`Attached resizeObserver: %c${L(e)}`,g))}const t=ct(e)();for(const e of t){if(it.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(je.observe(e),it.add(e),V(`Attached resizeObserver: %c${L(e)}`,g))}}function st(e){performance.mark(se);const t=R(e);let n=0,r=document.documentElement,i=fe?0:document.documentElement.getBoundingClientRect().bottom;const a=fe?Ae:me?Ee:ct(document)();let l=a.length;for(const t of a)fe||!s||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>i&&(i=n,r=t)):l-=1;return Z(`${t} position calculated from:`,r),performance.mark(le,{detail:{Side:t,len:l,hasTags:fe,logging:we}}),i}const lt=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],ct=e=>()=>{Ge();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 ue&&t.push(`not([${w}])`,`not([${w}] *)`),e.querySelectorAll(t.join(":"))},dt={height:0,width:0},ut={height:0,width:0},mt=[g,h,g];function ft(e){function t(){return ut[o]=r,dt[o]=s,r}const n=e===pt,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 fe:Z("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!me&&0===ut[o]&&0===dt[o]:Z(`Initial page size values: ${l}`,...mt),c=t();break;case Ne&&r===ut[o]&&s===dt[o]:Z(`Size unchanged: ${l}`,...mt),c=Math.max(r,s);break;case 0===r:Z(`Page is hidden: ${l}`,...mt),c=s;break;case!me&&r!==ut[o]&&s<=dt[o]:Z(`New <html> size: ${l} `,...mt),Z(`Previous <html> size: %c${ut[o]}px`,g),c=t();break;case!n:c=e.taggedElement();break;case!me&&r<ut[o]:Z(`<html> size decreased: ${l}`,...mt),c=t();break;case s===a||s===i:Z(`<html> size equals page size: ${l}`,...mt),c=t();break;case r>s:Z(`Page size < <html> size: ${l}`,...mt),c=t();break;case me:Z("Found element overflowing <html> "),c=e.taggedElement();break;default:Z(`Using <html> size: ${l}`,...mt),c=t()}return Z(`Content ${o}: %c${c}px`,g),c+=function(e){const t=e.getOffset();return 0!==t&&Z(`Page offsetSize: %c${t}px`,g),t}(e),c}const pt={enabled:()=>oe,getOffset:()=>m,auto:()=>ft(pt),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,v)+parseInt(t.marginBottom,v)},bodyScroll:()=>document.body.scrollHeight,offset:()=>pt.bodyOffset(),custom:()=>r.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...lt(pt)),min:()=>Math.min(...lt(pt)),grow:()=>pt.max(),lowestElement:()=>st($),taggedElement:()=>st($)},gt={enabled:()=>ce,getOffset:()=>f,auto:()=>ft(gt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>r.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...lt(gt)),min:()=>Math.min(...lt(gt)),rightMostElement:()=>st(S),scroll:()=>Math.max(gt.bodyScroll(),gt.documentElementScroll()),taggedElement:()=>st(S)},ht=(e,t)=>!(Math.abs(e-t)<=Ce);function yt(e,t,n,o,r){const i=void 0===n?pt[ge]():n,a=void 0===o?gt[Le]():o;switch(!0){case oe&&ht(pe,i)||ce&&ht(qe,a)||"init"===e:pe=i,qe=a;case e===M:St(pe,qe,e,r);break;case!e!==O&&(oe&&ge in d||ce&&Le in d):$t(t);break;case e===E:case e===k:case e===j:V(I);break;default:Z(I)}A=!1}let vt=!1;const bt=x((()=>ne(T(4)))),zt=X(((e,t,n,o,r)=>{Y(e),q=performance.now(),W||e===O?document.hidden?V("Page hidden - Ignored resize request"):(vt||(V(`Resize event: %c${t}`,g),A=!0,yt(e,t,n,o,r),requestAnimationFrame((()=>{vt=!1}))),vt=!0):Z("Resizing disabled")}));function wt(e){pe=pt[ge](),qe=gt[Le](),St(pe,qe,e)}function $t(e){const t=ge;ge=l,V(`Reset trigger event: %c${e}`,g),Ne?V("TriggerLock blocked calculation"):(Ne=!0,_("Trigger event lock on"),requestAnimationFrame((()=>{Ne=!1,_("Trigger event lock off")}))),wt("reset"),ge=t}const St=X((function(e,t,o,r,i){$e<-1||(Y(o),void 0!==i?V(`Message targetOrigin: %c${i}`,g):i=xe,function(){const a=`${Oe}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(Ie)try{window.parent.iframeParentListener(c+a)}catch(e){if(1!==$e)throw e;return void bt()}else Te.postMessage(c+a,i);A&&V(function(){const e=N(performance.now()-q);return"init"===o?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),g),Z(`Sending message to parent page via ${Ie?"sameOrigin":"postMessage"}: %c%c${a}`,n,g)}(),Q())})),Ot=X((function(e){Y("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>t(n(e)),r=e=>St(0,0,`${e}Stop`),i={init:function(){ve=e.data,Te=e.source,p=e.origin,Ve(),de=!1,setTimeout((()=>{ye=!1}),128)},reset(){ye?V("Page reset ignored by init"):(V("Page size reset by host page"),wt("resetPage"))},resize(){zt(O,"Parent window requested size check")},moveToAnchor(){be.findTarget(s())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=s();V("PageInfo received from parent:",o(e)),De?setTimeout((()=>De(n(e)))):r("pageInfo")},parentInfo(){const e=o(s());V("ParentInfo received from parent:",e),He?setTimeout((()=>He(e))):r("parentInfo")},message(){const e=s();V("onMessage called from parent:%c",g,o(e)),setTimeout((()=>Fe(n(e))))}},a=()=>e.data.split("]")[1].split(":")[0],s=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function d(){const t=a();t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||ee(`Unexpected message (${e.data})`)}c===`${e.data}`.slice(0,13)&&(Y(a()),!1!==de?l()?i.init():V(`Ignored message of type "${a()}". Received before initialization.`):d())}));function Mt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?ee("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>Ot({data:e,sameOrigin:!0}))),P(window,"message",Ot),P(window,"readystatechange",Mt),Mt())}()}();
20
+ !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:d}=Object,u=e=>[e,l[e]],m=e=>t=>[t,function(n){e[t]=n}],f=(e,t)=>c(d(e).map(t));const p=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,g=p?"color: #A9C7FB;":"color: #135CD2;",h=p?"color: #E3E3E3;":"color: #1F1F1F;",y="5.4.5-beta.13",v=10,b="data-iframe-size",z="data-iframe-overflowed",w="data-iframe-ignore",$="bottom",S="right",O="resizeParent",M="setOffsetSize",E="resizeObserver",k="overflowObserver",j="mutationObserver",I="No change in content size detected",P=(e,t,n,o)=>e.addEventListener(t,n,o||!1),A=["<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 T=e=>(e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(A[e]),x=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},C=e=>e,N=e=>Math.round(1e3*e)/1e3,R=e=>e.charAt(0).toUpperCase()+e.slice(1),q=e=>""!=`${e}`&&void 0!==e;function L(e){switch(!0){case!q(e):return"";case q(e.id):return`${e.nodeName}#${e.id}`;case q(e.name):return`${e.nodeName} (${e.name}`;case q(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}const B=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${R(t)}`)};let F=!0;const W=(D=function(n={}){const c={},d={},p=[],g={...a,expand:!n.collapsed||a.expanded,...n};let h="";function y(){p.length=0,h=""}function v(){delete g.event,y()}const b=()=>!!p.some((([e])=>e in i))||!!g.expand;function z(){if(0!==p.length){l[b()?"group":"groupCollapsed"](`%c${g.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(g)} %c${g.showTime?h:""}`,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(),v()}else v()}function w(){""===h&&(h=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function $(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{...f(g,m(g)),...f(console,(e=>[e,(...t)=>$(e,...t)])),...f(s,u),assert:function(e,...t){e||$("assert",e,...t)},count:function(e=r){d[e]?d[e]+=1:d[e]=1,$("log",`${e}: ${d[e]}`)},countReset:function(e=r){delete d[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(),g.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}},D?.__esModule?D.default:D);var D;const H=W({label:"iframeResizer(child)"});const V=(U="log",(...e)=>!F||H[U](...e));var U;const Z=V,{assert:J,debug:_,endAutoGroup:Q,error:G,errorBoundary:X,event:Y,purge:K,warn:ee}=H,te=e=>{return H.warn((t=C,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},ne=te,oe=(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)=>te(t))),re=oe("Method"),ie=oe("Method","replaced with"),ae=oe("Option"),se="--ifr-start",le="--ifr-end",ce=[],de=new WeakSet,ue=e=>"object"==typeof e&&de.add(e);let me={},fe=0;const pe=setInterval((()=>{if(ce.length<10)return;if(me.hasTags&&me.len<25)return;ce.sort();const e=Math.min(ce.reduce(((e,t)=>e+t),0)/ce.length,ce[Math.floor(ce.length/2)]),t=N(e);t>fe&&(fe=t,Y("performanceObserver"),V("Mean time:",N(ce[Math.floor(ce.length/2)])),V("Median time:",N(ce.reduce(((e,t)=>e+t),0)/ce.length)),V("Average time:",t),V("Max time:",N(Math.max(...ce)))),e<=4||(clearInterval(pe),te(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${N(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 ge(e){e.getEntries().forEach((e=>{if(e.name===le){const{duration:t}=performance.measure("--ifr-measure",se,le);me=e.detail,ce.push(t),ce.length>100&&ce.shift()}}))}function he(){new PerformanceObserver(ge).observe({entryTypes:["mark"]}),ue(document.documentElement),ue(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",he):he()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},r={height:()=>(ee("Custom height calculation function not defined"),pt.auto()),width:()=>(ee("Custom width calculation function not defined"),gt.auto())},i={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},s="checkVisibility"in window,l="auto",c="[iFrameSizer]",d={max:1,min:1,bodyScroll:1,documentElementScroll:1},u="scroll";let m,f,p,A,q,W=!0,D="",U=0,G="",K="",oe=!0,ce=!1,de=!0,ue=!1,me=!1,fe=!1,pe=1,ge=l,he="",ye=!0,ve="",be={},ze=!0,we=!1,$e=0,Se=!1,Oe="",Me=C,Ee=[],ke="child",je=null,Ie=!1,Pe="",Ae=[],Te=window.parent,xe="*",Ce=0,Ne=!1,Re="",qe=1,Le=u,Be=window,Fe=()=>{ee("onMessage function not defined")},We=()=>{},De=null,He=null;function Ve(){if("loading"===document.readyState)return ee("Document not ready, current state: %c%s",g,document.readyState),void P(document,"readystatechange",Ve);var e,t,n;!function(){const e=e=>"true"===e,t=ve.slice(13).split(":");Oe=t[0],U=void 0===t[1]?U:Number(t[1]),ce=void 0===t[2]?ce:e(t[2]),we=void 0===t[3]?we:e(t[3]),W=void 0===t[6]?W:e(t[6]),G=t[7],ge=void 0===t[8]?ge:t[8],D=t[9],K=t[10],Ce=void 0===t[11]?Ce:Number(t[11]),be.enable=void 0!==t[12]&&e(t[12]),ke=void 0===t[13]?ke:t[13],Le=void 0===t[14]?Le:t[14],Se=void 0===t[15]?Se:e(t[15]),m=void 0===t[16]?m:Number(t[16]),f=void 0===t[17]?f:Number(t[17]),oe=void 0===t[18]?oe:e(t[18]),t[19],Re=t[20]||Re,$e=void 0===t[21]?$e:Number(t[21]),ze=void 0===t[23]?ze:e(t[23])}(),e={id:Oe,enabled:we,expand:ze},H.label(`${e.id}`),H.expand(e.expand),F=e.enabled,V(`Initialising iframe v${y} ${window.location.href}`),function(){function e(e){V("Reading data from page:",e),Fe=e?.onMessage||Fe,We=e?.onReady||We,"number"==typeof e?.offset&&(ae("offset","offsetSize"),oe&&(m=e?.offset),ce&&(f=e?.offset)),"number"==typeof e?.offsetSize&&(oe&&(m=e?.offsetSize),ce&&(f=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(Pe=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(he=e.ignoreSelector),xe=e?.targetOrigin||xe,ge=e?.heightCalculationMethod||ge,Le=e?.widthCalculationMethod||Le}function t(e,t){return"function"==typeof e&&(V(`Setup custom ${t}CalcMethod`),r[t]=e,e="custom"),e}if(1===$e)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),ge=t(ge,"height"),Le=t(Le,"width"),Z(`Set targetOrigin for parent: %c${xe}`,g))}(),Ke(),function(){try{Ie=1===$e||"iframeParentListener"in window.parent}catch(e){V("Cross domain iframe detected")}}(),$e<0?ne(`${T($e+2)}${T(2)}`):Re.codePointAt(0)>4||$e<2&&ne(T(3)),Re&&""!==Re&&"false"!==Re?Re!==y&&te(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Re} - Child page: ${y}.\n`):te("<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"),nt(),ot(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(b,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&te("<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&&te("<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"),Je(),1!==$e&&(Be.parentIframe=Object.freeze({autoResize:e=>(B(e,"boolean","parentIframe.autoResize(enable) enable"),!0===e&&!1===W?(W=!0,zt("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===W&&(W=!1),St(0,0,"autoResize",JSON.stringify(W)),W),close(){St(0,0,"close")},getId:()=>Oe,getOrigin:()=>(re("getOrigin()","getParentOrigin()"),p),getParentOrigin:()=>p,getPageInfo(e){if("function"==typeof e)return De=e,St(0,0,"pageInfo"),void ie("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");De=null,St(0,0,"pageInfoStop")},getParentProps:e=>(B(e,"function","parentIframe.getParentProps(callback) callback"),He=e,St(0,0,"parentInfo"),()=>{He=null,St(0,0,"parentInfoStop")}),getParentProperties(e){re("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){B(e,"string","parentIframe.moveToAnchor(anchor) anchor"),be.findTarget(e)},reset(){$t("parentIframe.reset")},setOffsetSize(e){B(e,"number","parentIframe.setOffsetSize(offset) offset"),m=e,f=e,zt(M,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){B(e,"number","parentIframe.scrollBy(x, y) x"),B(t,"number","parentIframe.scrollBy(x, y) y"),St(t,e,"scrollBy")},scrollTo(e,t){B(e,"number","parentIframe.scrollTo(x, y) x"),B(t,"number","parentIframe.scrollTo(x, y) y"),St(t,e,"scrollTo")},scrollToOffset(e,t){B(e,"number","parentIframe.scrollToOffset(x, y) x"),B(t,"number","parentIframe.scrollToOffset(x, y) y"),St(t,e,"scrollToOffset")},sendMessage(e,t){t&&B(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),St(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){ge=e,nt()},setWidthCalculationMethod(e){Le=e,ot()},setTargetOrigin(e){B(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),V(`Set targetOrigin: %c${e}`,g),xe=e},resize(e,t){e&&B(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&B(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),zt("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){re("size()","resize()"),this.resize(e,t)}}),Be.parentIFrame=Be.parentIframe),function(){function e(e){St(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){V(`Add event listener: %c${n}`,g),P(window.document,t,e)}!0===Se&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),be=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,v)+parseInt(o.x,v),y:parseInt(n.top,v)+parseInt(o.y,v)}}function n(e){function n(e){const n=t(e);V(`Moving to in page link (%c#${o}%c) at x: %c${n.x}%c y: %c${n.y}`,g,h,g,h,g),St(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?(V(`In page link (#${o}) not found in iFrame, so sending to parent`),St(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")&&P(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function i(){P(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){V("Setting up location.hash handlers"),r(),i(),a()}return be.enable?1===$e?te("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):s():V("In page linking not enabled"),{findTarget:n}}(),void 0===G&&(G=`${U}px`),Xe("margin",(t="margin",(n=G).includes("-")&&(ee(`Negative CSS value ignored for ${t}`),n=""),n)),Xe("background",D),Xe("padding",K),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),V("Set HTML & body height: %cauto !important",g)}(),!0!==W&&V("Auto Resize disabled"),function(e){et({method:e,eventType:"After Print",eventName:"afterprint"}),et({method:e,eventType:"Before Print",eventName:"beforeprint"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const r=t=>{Z("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){Ke(),_e(e),e.forEach(at),e.clear()}function d(){const u=performance.now(),m=u-o,f=i*l+++a;if(m>f&&m<s)return Z("Backed off due to heavy workload on callStack"),V(`Delay: %c${N(m)}ms %c> Delay limit: %c${f}ms`,g,h,g),setTimeout(d,i*l),void(o=u);l=1,t.forEach(r),t.length=0,e.size>0&&c(e),Je(),Ue(),n=!1,zt(j,"Mutation Observed")}function u(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(d))}function m(){const e=new window.MutationObserver(u),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[w,b],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return V("Setup <body> MutationObserver"),e.observe(t,n),e}m()}(),V("Setup ResizeObserver"),je=new ResizeObserver(rt),je.observe(document.body),it.add(document.body),at(document.body),oe!==ce&&(V("Setup OverflowObserver"),Me=(e=>{const t=e.side||$,n=e.onChange||C,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||C,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){Y("observation");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),c&&V("Overflowed:",i)}var n;r(i)}),o),c=new WeakSet;return function(e){V("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)):J(!n,"Node already observed",t)}}})({onChange:Ze,root:document.documentElement,side:oe?$:S})),_e(ct(document)()),queueMicrotask(We),V("Initialization complete"),zt("init","Init message from host page",void 0,void 0,y),document.title&&""!==document.title&&St(0,0,"title",document.title)}function Ue(){Ee=document.querySelectorAll(`[${z}]:not([${w}]):not([${w}] *)`),me=Ee.length>0}function Ze(e){Ue(),(me||e)&&(V("Observed Elements:",Ee.length),zt(k,"Overflow updated"))}function Je(){Ae=document.querySelectorAll(`[${b}]`),fe=Ae.length>0,V(`Tagged elements found: %c${fe}`,g)}function _e(e){fe||Me(e)}let Qe=0;function Ge(){const n=document.querySelectorAll(`*[${w}]`);ue=n.length>0,ue&&n.length!==Qe&&(function(n){const o=1===n.length?"":"s";ee(`%c[${w}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),Qe=n.length)}function Xe(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),Z(`Set body ${e}: %c${t}`,g))}function Ye(e,t,n){if(""!==n){V(`${e}: %c${n}`,g);for(const e of document.querySelectorAll(n))V(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Ke(){Ye("sizeSelector",b,Pe),Ye("ignoreSelector",w,he)}function et(e){({add(t){function n(){zt(e.eventName,e.eventType)}a[t]=n,P(window,t,n,{passive:!0})},remove(e){const t=a[e];var n,o;delete a[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),V(`${R(e.method)} event listener: %c${e.eventType}`,g)}function tt(e,t,n,o){return t!==e&&(e in n||(ee(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in i&&te(`<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 remove this option.`),V(`Set ${o} calculation method: %c${e}`,g)),e}function nt(){ge=tt(ge,l,pt,"height")}function ot(){Le=tt(Le,u,gt,"width")}function rt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;zt(E,`Element resized <${L(t)}>`)}const it=new WeakSet;function at(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!it.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(je.observe(e),it.add(e),V(`Attached resizeObserver: %c${L(e)}`,g))}const t=ct(e)();for(const e of t){if(it.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(je.observe(e),it.add(e),V(`Attached resizeObserver: %c${L(e)}`,g))}}function st(e){performance.mark(se);const t=R(e);let n=0,r=document.documentElement,i=fe?0:document.documentElement.getBoundingClientRect().bottom;const a=fe?Ae:me?Ee:ct(document)();let l=a.length;for(const t of a)fe||!s||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>i&&(i=n,r=t)):l-=1;return Z(`${t} position calculated from:`,r),performance.mark(le,{detail:{Side:t,len:l,hasTags:fe,logging:we}}),i}const lt=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],ct=e=>()=>{Ge();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 ue&&t.push(`not([${w}])`,`not([${w}] *)`),e.querySelectorAll(t.join(":"))},dt={height:0,width:0},ut={height:0,width:0},mt=[g,h,g];function ft(e){function t(){return ut[o]=r,dt[o]=s,r}const n=e===pt,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 fe:Z("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!me&&0===ut[o]&&0===dt[o]:Z(`Initial page size values: ${l}`,...mt),c=t();break;case Ne&&r===ut[o]&&s===dt[o]:Z(`Size unchanged: ${l}`,...mt),c=Math.max(r,s);break;case 0===r:Z(`Page is hidden: ${l}`,...mt),c=s;break;case!me&&r!==ut[o]&&s<=dt[o]:Z(`New <html> size: ${l} `,...mt),Z(`Previous <html> size: %c${ut[o]}px`,g),c=t();break;case!n:c=e.taggedElement();break;case!me&&r<ut[o]:Z(`<html> size decreased: ${l}`,...mt),c=t();break;case s===a||s===i:Z(`<html> size equals page size: ${l}`,...mt),c=t();break;case r>s:Z(`Page size < <html> size: ${l}`,...mt),c=t();break;case me:Z("Found element overflowing <html> "),c=e.taggedElement();break;default:Z(`Using <html> size: ${l}`,...mt),c=t()}return Z(`Content ${o}: %c${c}px`,g),c+=function(e){const t=e.getOffset();return 0!==t&&Z(`Page offsetSize: %c${t}px`,g),t}(e),c}const pt={enabled:()=>oe,getOffset:()=>m,auto:()=>ft(pt),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,v)+parseInt(t.marginBottom,v)},bodyScroll:()=>document.body.scrollHeight,offset:()=>pt.bodyOffset(),custom:()=>r.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...lt(pt)),min:()=>Math.min(...lt(pt)),grow:()=>pt.max(),lowestElement:()=>st($),taggedElement:()=>st($)},gt={enabled:()=>ce,getOffset:()=>f,auto:()=>ft(gt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>r.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...lt(gt)),min:()=>Math.min(...lt(gt)),rightMostElement:()=>st(S),scroll:()=>Math.max(gt.bodyScroll(),gt.documentElementScroll()),taggedElement:()=>st(S)},ht=(e,t)=>!(Math.abs(e-t)<=Ce);function yt(e,t,n,o,r){const i=void 0===n?pt[ge]():n,a=void 0===o?gt[Le]():o;switch(!0){case oe&&ht(pe,i)||ce&&ht(qe,a)||"init"===e:pe=i,qe=a;case e===M:St(pe,qe,e,r);break;case!e!==O&&(oe&&ge in d||ce&&Le in d):$t(t);break;case e===E:case e===k:case e===j:V(I);break;default:Z(I)}A=!1}let vt=!1;const bt=x((()=>ne(T(4)))),zt=X(((e,t,n,o,r)=>{Y(e),q=performance.now(),W||e===O?document.hidden?V("Page hidden - Ignored resize request"):(vt||(V(`Resize event: %c${t}`,g),A=!0,yt(e,t,n,o,r),requestAnimationFrame((()=>{vt=!1}))),vt=!0):Z("Resizing disabled")}));function wt(e){pe=pt[ge](),qe=gt[Le](),St(pe,qe,e)}function $t(e){const t=ge;ge=l,V(`Reset trigger event: %c${e}`,g),Ne?V("TriggerLock blocked calculation"):(Ne=!0,_("Trigger event lock on"),requestAnimationFrame((()=>{Ne=!1,_("Trigger event lock off")}))),wt("reset"),ge=t}const St=X((function(e,t,o,r,i){$e<-1||(Y(o),void 0!==i?V(`Message targetOrigin: %c${i}`,g):i=xe,function(){const a=`${Oe}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(Ie)try{window.parent.iframeParentListener(c+a)}catch(e){if(1!==$e)throw e;return void bt()}else Te.postMessage(c+a,i);A&&V(function(){const e=N(performance.now()-q);return"init"===o?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),g),Z(`Sending message to parent page via ${Ie?"sameOrigin":"postMessage"}: %c%c${a}`,n,g)}(),Q())})),Ot=X((function(e){Y("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>t(n(e)),r=e=>St(0,0,`${e}Stop`),i={init:function(){ve=e.data,Te=e.source,p=e.origin,Ve(),de=!1,setTimeout((()=>{ye=!1}),128)},reset(){ye?V("Page reset ignored by init"):(V("Page size reset by host page"),wt("resetPage"))},resize(){zt(O,"Parent window requested size check")},moveToAnchor(){be.findTarget(s())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=s();V("PageInfo received from parent:",o(e)),De?setTimeout((()=>De(n(e)))):r("pageInfo")},parentInfo(){const e=o(s());V("ParentInfo received from parent:",e),He?setTimeout((()=>He(e))):r("parentInfo")},message(){const e=s();V("onMessage called from parent:%c",g,o(e)),setTimeout((()=>Fe(n(e))))}},a=()=>e.data.split("]")[1].split(":")[0],s=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function d(){const t=a();t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||ee(`Unexpected message (${e.data})`)}c===`${e.data}`.slice(0,13)&&(Y(a()),!1!==de?l()?i.init():V(`Ignored message of type "${a()}". Received before initialization.`):d())}));function Mt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?ee("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>Ot({data:e,sameOrigin:!0}))),P(window,"message",Ot),P(window,"readystatechange",Mt),Mt())}()}();
21
21
  //# sourceMappingURL=iframeResizer.contentWindow.js.map
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (child) 5.4.5-beta.12 (iife)
4
+ * @module iframe-resizer/legacy (child) 5.4.5-beta.13 (iife)
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -17,5 +17,5 @@
17
17
  */
18
18
 
19
19
 
20
- !function(){"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:d}=Object,u=e=>[e,l[e]],m=e=>t=>[t,function(n){e[t]=n}],f=(e,t)=>c(d(e).map(t));const p=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,g=p?"color: #A9C7FB;":"color: #135CD2;",h=p?"color: #E3E3E3;":"color: #1F1F1F;",y="5.4.5-beta.12",v=10,b="data-iframe-size",z="data-iframe-overflowed",w="data-iframe-ignore",$="bottom",S="right",O="resizeParent",M="setOffsetSize",E="resizeObserver",k="overflowObserver",j="mutationObserver",I="No change in content size detected",P=(e,t,n,o)=>e.addEventListener(t,n,o||!1),A=["<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 T=e=>(e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(A[e]),x=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},C=e=>e,N=e=>Math.round(1e3*e)/1e3,R=e=>e.charAt(0).toUpperCase()+e.slice(1),q=e=>""!=`${e}`&&void 0!==e;function L(e){switch(!0){case!q(e):return"";case q(e.id):return`${e.nodeName}#${e.id}`;case q(e.name):return`${e.nodeName} (${e.name}`;case q(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}const B=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${R(t)}`)};let F=!0;const W=(D=function(n={}){const c={},d={},p=[],g={...a,expand:!n.collapsed||a.expanded,...n};let h="";function y(){p.length=0,h=""}function v(){delete g.event,y()}const b=()=>!!p.some((([e])=>e in i))||!!g.expand;function z(){if(0!==p.length){l[b()?"group":"groupCollapsed"](`%c${g.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(g)} %c${g.showTime?h:""}`,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(),v()}else v()}function w(){""===h&&(h=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function $(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{...f(g,m(g)),...f(console,(e=>[e,(...t)=>$(e,...t)])),...f(s,u),assert:function(e,...t){e||$("assert",e,...t)},count:function(e=r){d[e]?d[e]+=1:d[e]=1,$("log",`${e}: ${d[e]}`)},countReset:function(e=r){delete d[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(),g.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}},D?.__esModule?D.default:D);var D;const H=W({label:"iframeResizer(child)"});const V=(U="log",(...e)=>!F||H[U](...e));var U;const Z=V,{assert:J,debug:_,endAutoGroup:Q,error:G,errorBoundary:X,event:Y,purge:K,warn:ee}=H,te=e=>{return H.warn((t=C,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},ne=te,oe=(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)=>te(t))),re=oe("Method"),ie=oe("Method","replaced with"),ae=oe("Option"),se="--ifr-start",le="--ifr-end",ce=[],de=new WeakSet,ue=e=>"object"==typeof e&&de.add(e);let me={},fe=0;const pe=setInterval((()=>{if(ce.length<10)return;if(me.hasTags&&me.len<25)return;ce.sort();const e=Math.min(ce.reduce(((e,t)=>e+t),0)/ce.length,ce[Math.floor(ce.length/2)]),t=N(e);t>fe&&(fe=t,Y("performanceObserver"),V("Mean time:",N(ce[Math.floor(ce.length/2)])),V("Median time:",N(ce.reduce(((e,t)=>e+t),0)/ce.length)),V("Average time:",t),V("Max time:",N(Math.max(...ce)))),e<=4||(clearInterval(pe),te(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${N(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 ge(e){e.getEntries().forEach((e=>{if(e.name===le){const{duration:t}=performance.measure("--ifr-measure",se,le);me=e.detail,ce.push(t),ce.length>100&&ce.shift()}}))}function he(){new PerformanceObserver(ge).observe({entryTypes:["mark"]}),ue(document.documentElement),ue(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",he):he()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},r={height:()=>(ee("Custom height calculation function not defined"),pt.auto()),width:()=>(ee("Custom width calculation function not defined"),gt.auto())},i={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},s="checkVisibility"in window,l="auto",c="[iFrameSizer]",d={max:1,min:1,bodyScroll:1,documentElementScroll:1},u="scroll";let m,f,p,A,q,W=!0,D="",U=0,G="",K="",oe=!0,ce=!1,de=!0,ue=!1,me=!1,fe=!1,pe=1,ge=l,he="",ye=!0,ve="",be={},ze=!0,we=!1,$e=0,Se=!1,Oe="",Me=C,Ee=[],ke="child",je=null,Ie=!1,Pe="",Ae=[],Te=window.parent,xe="*",Ce=0,Ne=!1,Re="",qe=1,Le=u,Be=window,Fe=()=>{ee("onMessage function not defined")},We=()=>{},De=null,He=null;function Ve(){if("loading"===document.readyState)return ee("Document not ready, current state: %c%s",g,document.readyState),void P(document,"readystatechange",Ve);var e,t,n;!function(){const e=e=>"true"===e,t=ve.slice(13).split(":");Oe=t[0],U=void 0===t[1]?U:Number(t[1]),ce=void 0===t[2]?ce:e(t[2]),we=void 0===t[3]?we:e(t[3]),W=void 0===t[6]?W:e(t[6]),G=t[7],ge=void 0===t[8]?ge:t[8],D=t[9],K=t[10],Ce=void 0===t[11]?Ce:Number(t[11]),be.enable=void 0!==t[12]&&e(t[12]),ke=void 0===t[13]?ke:t[13],Le=void 0===t[14]?Le:t[14],Se=void 0===t[15]?Se:e(t[15]),m=void 0===t[16]?m:Number(t[16]),f=void 0===t[17]?f:Number(t[17]),oe=void 0===t[18]?oe:e(t[18]),t[19],Re=t[20]||Re,$e=void 0===t[21]?$e:Number(t[21]),ze=void 0===t[23]?ze:e(t[23])}(),e={id:Oe,enabled:we,expand:ze},H.label(`${e.id}`),H.expand(e.expand),F=e.enabled,V(`Initialising iframe v${y} ${window.location.href}`),function(){function e(e){V("Reading data from page:",e),Fe=e?.onMessage||Fe,We=e?.onReady||We,"number"==typeof e?.offset&&(ae("offset","offsetSize"),oe&&(m=e?.offset),ce&&(f=e?.offset)),"number"==typeof e?.offsetSize&&(oe&&(m=e?.offsetSize),ce&&(f=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(Pe=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(he=e.ignoreSelector),xe=e?.targetOrigin||xe,ge=e?.heightCalculationMethod||ge,Le=e?.widthCalculationMethod||Le}function t(e,t){return"function"==typeof e&&(V(`Setup custom ${t}CalcMethod`),r[t]=e,e="custom"),e}if(1===$e)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),ge=t(ge,"height"),Le=t(Le,"width"),Z(`Set targetOrigin for parent: %c${xe}`,g))}(),Ke(),function(){try{Ie=1===$e||"iframeParentListener"in window.parent}catch(e){V("Cross domain iframe detected")}}(),$e<0?ne(`${T($e+2)}${T(2)}`):Re.codePointAt(0)>4||$e<2&&ne(T(3)),Re&&""!==Re&&"false"!==Re?Re!==y&&te(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Re} - Child page: ${y}.\n`):te("<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"),nt(),ot(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(b,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&te("<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&&te("<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"),Je(),1!==$e&&(Be.parentIframe=Object.freeze({autoResize:e=>(B(e,"boolean","parentIframe.autoResize(enable) enable"),!0===e&&!1===W?(W=!0,zt("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===W&&(W=!1),St(0,0,"autoResize",JSON.stringify(W)),W),close(){St(0,0,"close")},getId:()=>Oe,getOrigin:()=>(re("getOrigin()","getParentOrigin()"),p),getParentOrigin:()=>p,getPageInfo(e){if("function"==typeof e)return De=e,St(0,0,"pageInfo"),void ie("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");De=null,St(0,0,"pageInfoStop")},getParentProps:e=>(B(e,"function","parentIframe.getParentProps(callback) callback"),He=e,St(0,0,"parentInfo"),()=>{He=null,St(0,0,"parentInfoStop")}),getParentProperties(e){re("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){B(e,"string","parentIframe.moveToAnchor(anchor) anchor"),be.findTarget(e)},reset(){$t("parentIframe.reset")},setOffsetSize(e){B(e,"number","parentIframe.setOffsetSize(offset) offset"),m=e,f=e,zt(M,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){B(e,"number","parentIframe.scrollBy(x, y) x"),B(t,"number","parentIframe.scrollBy(x, y) y"),St(t,e,"scrollBy")},scrollTo(e,t){B(e,"number","parentIframe.scrollTo(x, y) x"),B(t,"number","parentIframe.scrollTo(x, y) y"),St(t,e,"scrollTo")},scrollToOffset(e,t){B(e,"number","parentIframe.scrollToOffset(x, y) x"),B(t,"number","parentIframe.scrollToOffset(x, y) y"),St(t,e,"scrollToOffset")},sendMessage(e,t){t&&B(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),St(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){ge=e,nt()},setWidthCalculationMethod(e){Le=e,ot()},setTargetOrigin(e){B(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),V(`Set targetOrigin: %c${e}`,g),xe=e},resize(e,t){e&&B(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&B(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),zt("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){re("size()","resize()"),this.resize(e,t)}}),Be.parentIFrame=Be.parentIframe),function(){function e(e){St(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){V(`Add event listener: %c${n}`,g),P(window.document,t,e)}!0===Se&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),be=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,v)+parseInt(o.x,v),y:parseInt(n.top,v)+parseInt(o.y,v)}}function n(e){function n(e){const n=t(e);V(`Moving to in page link (%c#${o}%c) at x: %c${n.x}%c y: %c${n.y}`,g,h,g,h,g),St(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?(V(`In page link (#${o}) not found in iFrame, so sending to parent`),St(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")&&P(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function i(){P(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){V("Setting up location.hash handlers"),r(),i(),a()}return be.enable?1===$e?te("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):s():V("In page linking not enabled"),{findTarget:n}}(),void 0===G&&(G=`${U}px`),Xe("margin",(t="margin",(n=G).includes("-")&&(ee(`Negative CSS value ignored for ${t}`),n=""),n)),Xe("background",D),Xe("padding",K),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),V("Set HTML & body height: %cauto !important",g)}(),!0!==W&&V("Auto Resize disabled"),function(e){et({method:e,eventType:"After Print",eventName:"afterprint"}),et({method:e,eventType:"Before Print",eventName:"beforeprint"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const r=t=>{Z("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){Ke(),_e(e),e.forEach(at),e.clear()}function d(){const u=performance.now(),m=u-o,f=i*l+++a;if(m>f&&m<s)return Z("Backed off due to heavy workload on callStack"),V(`Delay: %c${N(m)}ms %c> Delay limit: %c${f}ms`,g,h,g),setTimeout(d,i*l),void(o=u);l=1,t.forEach(r),t.length=0,e.size>0&&c(e),Je(),Ue(),n=!1,zt(j,"Mutation Observed")}function u(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(d))}function m(){const e=new window.MutationObserver(u),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[w,b],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return V("Setup <body> MutationObserver"),e.observe(t,n),e}m()}(),V("Setup ResizeObserver"),je=new ResizeObserver(rt),je.observe(document.body),it.add(document.body),at(document.body),oe!==ce&&(V("Setup OverflowObserver"),Me=(e=>{const t=e.side||$,n=e.onChange||C,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||C,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){Y("observation");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),c&&V("Overflowed:",i)}var n;r(i)}),o),c=new WeakSet;return function(e){V("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)):J(!n,"Node already observed",t)}}})({onChange:Ze,root:document.documentElement,side:oe?$:S})),_e(ct(document)()),queueMicrotask(We),V("Initialization complete"),zt("init","Init message from host page",void 0,void 0,y),document.title&&""!==document.title&&St(0,0,"title",document.title)}function Ue(){Ee=document.querySelectorAll(`[${z}]:not([${w}]):not([${w}] *)`),me=Ee.length>0}function Ze(e){Ue(),(me||e)&&(V("Observed Elements:",Ee.length),zt(k,"Overflow updated"))}function Je(){Ae=document.querySelectorAll(`[${b}]`),fe=Ae.length>0,V(`Tagged elements found: %c${fe}`,g)}function _e(e){fe||Me(e)}let Qe=0;function Ge(){const n=document.querySelectorAll(`*[${w}]`);ue=n.length>0,ue&&n.length!==Qe&&(function(n){const o=1===n.length?"":"s";ee(`%c[${w}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),Qe=n.length)}function Xe(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),Z(`Set body ${e}: %c${t}`,g))}function Ye(e,t,n){if(""!==n){V(`${e}: %c${n}`,g);for(const e of document.querySelectorAll(n))V(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Ke(){Ye("sizeSelector",b,Pe),Ye("ignoreSelector",w,he)}function et(e){({add(t){function n(){zt(e.eventName,e.eventType)}a[t]=n,P(window,t,n,{passive:!0})},remove(e){const t=a[e];var n,o;delete a[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),V(`${R(e.method)} event listener: %c${e.eventType}`,g)}function tt(e,t,n,o){return t!==e&&(e in n||(ee(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in i&&te(`<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 remove this option.`),V(`Set ${o} calculation method: %c${e}`,g)),e}function nt(){ge=tt(ge,l,pt,"height")}function ot(){Le=tt(Le,u,gt,"width")}function rt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;zt(E,`Element resized <${L(t)}>`)}const it=new WeakSet;function at(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!it.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(je.observe(e),it.add(e),V(`Attached resizeObserver: %c${L(e)}`,g))}const t=ct(e)();for(const e of t){if(it.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(je.observe(e),it.add(e),V(`Attached resizeObserver: %c${L(e)}`,g))}}function st(e){performance.mark(se);const t=R(e);let n=0,r=document.documentElement,i=fe?0:document.documentElement.getBoundingClientRect().bottom;const a=fe?Ae:me?Ee:ct(document)();let l=a.length;for(const t of a)fe||!s||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>i&&(i=n,r=t)):l-=1;return Z(`${t} position calculated from:`,r),performance.mark(le,{detail:{Side:t,len:l,hasTags:fe,logging:we}}),i}const lt=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],ct=e=>()=>{Ge();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 ue&&t.push(`not([${w}])`,`not([${w}] *)`),e.querySelectorAll(t.join(":"))},dt={height:0,width:0},ut={height:0,width:0},mt=[g,h,g];function ft(e){function t(){return ut[o]=r,dt[o]=s,r}const n=e===pt,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 fe:Z("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!me&&0===ut[o]&&0===dt[o]:Z(`Initial page size values: ${l}`,...mt),c=t();break;case Ne&&r===ut[o]&&s===dt[o]:Z(`Size unchanged: ${l}`,...mt),c=Math.max(r,s);break;case 0===r:Z(`Page is hidden: ${l}`,...mt),c=s;break;case!me&&r!==ut[o]&&s<=dt[o]:Z(`New <html> size: ${l} `,...mt),Z(`Previous <html> size: %c${ut[o]}px`,g),c=t();break;case!n:c=e.taggedElement();break;case!me&&r<ut[o]:Z(`<html> size decreased: ${l}`,...mt),c=t();break;case s===a||s===i:Z(`<html> size equals page size: ${l}`,...mt),c=t();break;case r>s:Z(`Page size < <html> size: ${l}`,...mt),c=t();break;case me:Z("Found element overflowing <html> "),c=e.taggedElement();break;default:Z(`Using <html> size: ${l}`,...mt),c=t()}return Z(`Content ${o}: %c${c}px`,g),c+=function(e){const t=e.getOffset();return 0!==t&&Z(`Page offsetSize: %c${t}px`,g),t}(e),c}const pt={enabled:()=>oe,getOffset:()=>m,auto:()=>ft(pt),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,v)+parseInt(t.marginBottom,v)},bodyScroll:()=>document.body.scrollHeight,offset:()=>pt.bodyOffset(),custom:()=>r.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...lt(pt)),min:()=>Math.min(...lt(pt)),grow:()=>pt.max(),lowestElement:()=>st($),taggedElement:()=>st($)},gt={enabled:()=>ce,getOffset:()=>f,auto:()=>ft(gt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>r.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...lt(gt)),min:()=>Math.min(...lt(gt)),rightMostElement:()=>st(S),scroll:()=>Math.max(gt.bodyScroll(),gt.documentElementScroll()),taggedElement:()=>st(S)},ht=(e,t)=>!(Math.abs(e-t)<=Ce);function yt(e,t,n,o,r){const i=void 0===n?pt[ge]():n,a=void 0===o?gt[Le]():o;switch(!0){case oe&&ht(pe,i)||ce&&ht(qe,a)||"init"===e:pe=i,qe=a;case e===M:St(pe,qe,e,r);break;case!e!==O&&(oe&&ge in d||ce&&Le in d):$t(t);break;case e===E:case e===k:case e===j:V(I);break;default:Z(I)}A=!1}let vt=!1;const bt=x((()=>ne(T(4)))),zt=X(((e,t,n,o,r)=>{Y(e),q=performance.now(),W||e===O?document.hidden?V("Page hidden - Ignored resize request"):(vt||(V(`Resize event: %c${t}`,g),A=!0,yt(e,t,n,o,r),requestAnimationFrame((()=>{vt=!1}))),vt=!0):Z("Resizing disabled")}));function wt(e){pe=pt[ge](),qe=gt[Le](),St(pe,qe,e)}function $t(e){const t=ge;ge=l,V(`Reset trigger event: %c${e}`,g),Ne?V("TriggerLock blocked calculation"):(Ne=!0,_("Trigger event lock on"),requestAnimationFrame((()=>{Ne=!1,_("Trigger event lock off")}))),wt("reset"),ge=t}const St=X((function(e,t,o,r,i){$e<-1||(Y(o),void 0!==i?V(`Message targetOrigin: %c${i}`,g):i=xe,function(){const a=`${Oe}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(Ie)try{window.parent.iframeParentListener(c+a)}catch(e){if(1!==$e)throw e;return void bt()}else Te.postMessage(c+a,i);A&&V(function(){const e=N(performance.now()-q);return"init"===o?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),g),Z(`Sending message to parent page via ${Ie?"sameOrigin":"postMessage"}: %c%c${a}`,n,g)}(),Q())})),Ot=X((function(e){Y("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>t(n(e)),r=e=>St(0,0,`${e}Stop`),i={init:function(){ve=e.data,Te=e.source,p=e.origin,Ve(),de=!1,setTimeout((()=>{ye=!1}),128)},reset(){ye?V("Page reset ignored by init"):(V("Page size reset by host page"),wt("resetPage"))},resize(){zt(O,"Parent window requested size check")},moveToAnchor(){be.findTarget(s())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=s();V("PageInfo received from parent:",o(e)),De?setTimeout((()=>De(n(e)))):r("pageInfo")},parentInfo(){const e=o(s());V("ParentInfo received from parent:",e),He?setTimeout((()=>He(e))):r("parentInfo")},message(){const e=s();V("onMessage called from parent:%c",g,o(e)),setTimeout((()=>Fe(n(e))))}},a=()=>e.data.split("]")[1].split(":")[0],s=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function d(){const t=a();t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||ee(`Unexpected message (${e.data})`)}c===`${e.data}`.slice(0,13)&&(Y(a()),!1!==de?l()?i.init():V(`Ignored message of type "${a()}". Received before initialization.`):d())}));function Mt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?ee("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>Ot({data:e,sameOrigin:!0}))),P(window,"message",Ot),P(window,"readystatechange",Mt),Mt())}()}();
20
+ !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:d}=Object,u=e=>[e,l[e]],m=e=>t=>[t,function(n){e[t]=n}],f=(e,t)=>c(d(e).map(t));const p=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,g=p?"color: #A9C7FB;":"color: #135CD2;",h=p?"color: #E3E3E3;":"color: #1F1F1F;",y="5.4.5-beta.13",v=10,b="data-iframe-size",z="data-iframe-overflowed",w="data-iframe-ignore",$="bottom",S="right",O="resizeParent",M="setOffsetSize",E="resizeObserver",k="overflowObserver",j="mutationObserver",I="No change in content size detected",P=(e,t,n,o)=>e.addEventListener(t,n,o||!1),A=["<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 T=e=>(e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(A[e]),x=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},C=e=>e,N=e=>Math.round(1e3*e)/1e3,R=e=>e.charAt(0).toUpperCase()+e.slice(1),q=e=>""!=`${e}`&&void 0!==e;function L(e){switch(!0){case!q(e):return"";case q(e.id):return`${e.nodeName}#${e.id}`;case q(e.name):return`${e.nodeName} (${e.name}`;case q(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}const B=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${R(t)}`)};let F=!0;const W=(D=function(n={}){const c={},d={},p=[],g={...a,expand:!n.collapsed||a.expanded,...n};let h="";function y(){p.length=0,h=""}function v(){delete g.event,y()}const b=()=>!!p.some((([e])=>e in i))||!!g.expand;function z(){if(0!==p.length){l[b()?"group":"groupCollapsed"](`%c${g.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(g)} %c${g.showTime?h:""}`,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(),v()}else v()}function w(){""===h&&(h=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function $(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{...f(g,m(g)),...f(console,(e=>[e,(...t)=>$(e,...t)])),...f(s,u),assert:function(e,...t){e||$("assert",e,...t)},count:function(e=r){d[e]?d[e]+=1:d[e]=1,$("log",`${e}: ${d[e]}`)},countReset:function(e=r){delete d[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(),g.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}},D?.__esModule?D.default:D);var D;const H=W({label:"iframeResizer(child)"});const V=(U="log",(...e)=>!F||H[U](...e));var U;const Z=V,{assert:J,debug:_,endAutoGroup:Q,error:G,errorBoundary:X,event:Y,purge:K,warn:ee}=H,te=e=>{return H.warn((t=C,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},ne=te,oe=(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)=>te(t))),re=oe("Method"),ie=oe("Method","replaced with"),ae=oe("Option"),se="--ifr-start",le="--ifr-end",ce=[],de=new WeakSet,ue=e=>"object"==typeof e&&de.add(e);let me={},fe=0;const pe=setInterval((()=>{if(ce.length<10)return;if(me.hasTags&&me.len<25)return;ce.sort();const e=Math.min(ce.reduce(((e,t)=>e+t),0)/ce.length,ce[Math.floor(ce.length/2)]),t=N(e);t>fe&&(fe=t,Y("performanceObserver"),V("Mean time:",N(ce[Math.floor(ce.length/2)])),V("Median time:",N(ce.reduce(((e,t)=>e+t),0)/ce.length)),V("Average time:",t),V("Max time:",N(Math.max(...ce)))),e<=4||(clearInterval(pe),te(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${N(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 ge(e){e.getEntries().forEach((e=>{if(e.name===le){const{duration:t}=performance.measure("--ifr-measure",se,le);me=e.detail,ce.push(t),ce.length>100&&ce.shift()}}))}function he(){new PerformanceObserver(ge).observe({entryTypes:["mark"]}),ue(document.documentElement),ue(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",he):he()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},r={height:()=>(ee("Custom height calculation function not defined"),pt.auto()),width:()=>(ee("Custom width calculation function not defined"),gt.auto())},i={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},s="checkVisibility"in window,l="auto",c="[iFrameSizer]",d={max:1,min:1,bodyScroll:1,documentElementScroll:1},u="scroll";let m,f,p,A,q,W=!0,D="",U=0,G="",K="",oe=!0,ce=!1,de=!0,ue=!1,me=!1,fe=!1,pe=1,ge=l,he="",ye=!0,ve="",be={},ze=!0,we=!1,$e=0,Se=!1,Oe="",Me=C,Ee=[],ke="child",je=null,Ie=!1,Pe="",Ae=[],Te=window.parent,xe="*",Ce=0,Ne=!1,Re="",qe=1,Le=u,Be=window,Fe=()=>{ee("onMessage function not defined")},We=()=>{},De=null,He=null;function Ve(){if("loading"===document.readyState)return ee("Document not ready, current state: %c%s",g,document.readyState),void P(document,"readystatechange",Ve);var e,t,n;!function(){const e=e=>"true"===e,t=ve.slice(13).split(":");Oe=t[0],U=void 0===t[1]?U:Number(t[1]),ce=void 0===t[2]?ce:e(t[2]),we=void 0===t[3]?we:e(t[3]),W=void 0===t[6]?W:e(t[6]),G=t[7],ge=void 0===t[8]?ge:t[8],D=t[9],K=t[10],Ce=void 0===t[11]?Ce:Number(t[11]),be.enable=void 0!==t[12]&&e(t[12]),ke=void 0===t[13]?ke:t[13],Le=void 0===t[14]?Le:t[14],Se=void 0===t[15]?Se:e(t[15]),m=void 0===t[16]?m:Number(t[16]),f=void 0===t[17]?f:Number(t[17]),oe=void 0===t[18]?oe:e(t[18]),t[19],Re=t[20]||Re,$e=void 0===t[21]?$e:Number(t[21]),ze=void 0===t[23]?ze:e(t[23])}(),e={id:Oe,enabled:we,expand:ze},H.label(`${e.id}`),H.expand(e.expand),F=e.enabled,V(`Initialising iframe v${y} ${window.location.href}`),function(){function e(e){V("Reading data from page:",e),Fe=e?.onMessage||Fe,We=e?.onReady||We,"number"==typeof e?.offset&&(ae("offset","offsetSize"),oe&&(m=e?.offset),ce&&(f=e?.offset)),"number"==typeof e?.offsetSize&&(oe&&(m=e?.offsetSize),ce&&(f=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(Pe=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(he=e.ignoreSelector),xe=e?.targetOrigin||xe,ge=e?.heightCalculationMethod||ge,Le=e?.widthCalculationMethod||Le}function t(e,t){return"function"==typeof e&&(V(`Setup custom ${t}CalcMethod`),r[t]=e,e="custom"),e}if(1===$e)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),ge=t(ge,"height"),Le=t(Le,"width"),Z(`Set targetOrigin for parent: %c${xe}`,g))}(),Ke(),function(){try{Ie=1===$e||"iframeParentListener"in window.parent}catch(e){V("Cross domain iframe detected")}}(),$e<0?ne(`${T($e+2)}${T(2)}`):Re.codePointAt(0)>4||$e<2&&ne(T(3)),Re&&""!==Re&&"false"!==Re?Re!==y&&te(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Re} - Child page: ${y}.\n`):te("<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"),nt(),ot(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(b,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&te("<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&&te("<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"),Je(),1!==$e&&(Be.parentIframe=Object.freeze({autoResize:e=>(B(e,"boolean","parentIframe.autoResize(enable) enable"),!0===e&&!1===W?(W=!0,zt("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===W&&(W=!1),St(0,0,"autoResize",JSON.stringify(W)),W),close(){St(0,0,"close")},getId:()=>Oe,getOrigin:()=>(re("getOrigin()","getParentOrigin()"),p),getParentOrigin:()=>p,getPageInfo(e){if("function"==typeof e)return De=e,St(0,0,"pageInfo"),void ie("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");De=null,St(0,0,"pageInfoStop")},getParentProps:e=>(B(e,"function","parentIframe.getParentProps(callback) callback"),He=e,St(0,0,"parentInfo"),()=>{He=null,St(0,0,"parentInfoStop")}),getParentProperties(e){re("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){B(e,"string","parentIframe.moveToAnchor(anchor) anchor"),be.findTarget(e)},reset(){$t("parentIframe.reset")},setOffsetSize(e){B(e,"number","parentIframe.setOffsetSize(offset) offset"),m=e,f=e,zt(M,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){B(e,"number","parentIframe.scrollBy(x, y) x"),B(t,"number","parentIframe.scrollBy(x, y) y"),St(t,e,"scrollBy")},scrollTo(e,t){B(e,"number","parentIframe.scrollTo(x, y) x"),B(t,"number","parentIframe.scrollTo(x, y) y"),St(t,e,"scrollTo")},scrollToOffset(e,t){B(e,"number","parentIframe.scrollToOffset(x, y) x"),B(t,"number","parentIframe.scrollToOffset(x, y) y"),St(t,e,"scrollToOffset")},sendMessage(e,t){t&&B(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),St(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){ge=e,nt()},setWidthCalculationMethod(e){Le=e,ot()},setTargetOrigin(e){B(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),V(`Set targetOrigin: %c${e}`,g),xe=e},resize(e,t){e&&B(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&B(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),zt("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){re("size()","resize()"),this.resize(e,t)}}),Be.parentIFrame=Be.parentIframe),function(){function e(e){St(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){V(`Add event listener: %c${n}`,g),P(window.document,t,e)}!0===Se&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),be=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,v)+parseInt(o.x,v),y:parseInt(n.top,v)+parseInt(o.y,v)}}function n(e){function n(e){const n=t(e);V(`Moving to in page link (%c#${o}%c) at x: %c${n.x}%c y: %c${n.y}`,g,h,g,h,g),St(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?(V(`In page link (#${o}) not found in iFrame, so sending to parent`),St(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")&&P(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function i(){P(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){V("Setting up location.hash handlers"),r(),i(),a()}return be.enable?1===$e?te("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):s():V("In page linking not enabled"),{findTarget:n}}(),void 0===G&&(G=`${U}px`),Xe("margin",(t="margin",(n=G).includes("-")&&(ee(`Negative CSS value ignored for ${t}`),n=""),n)),Xe("background",D),Xe("padding",K),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),V("Set HTML & body height: %cauto !important",g)}(),!0!==W&&V("Auto Resize disabled"),function(e){et({method:e,eventType:"After Print",eventName:"afterprint"}),et({method:e,eventType:"Before Print",eventName:"beforeprint"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const r=t=>{Z("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){Ke(),_e(e),e.forEach(at),e.clear()}function d(){const u=performance.now(),m=u-o,f=i*l+++a;if(m>f&&m<s)return Z("Backed off due to heavy workload on callStack"),V(`Delay: %c${N(m)}ms %c> Delay limit: %c${f}ms`,g,h,g),setTimeout(d,i*l),void(o=u);l=1,t.forEach(r),t.length=0,e.size>0&&c(e),Je(),Ue(),n=!1,zt(j,"Mutation Observed")}function u(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(d))}function m(){const e=new window.MutationObserver(u),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[w,b],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return V("Setup <body> MutationObserver"),e.observe(t,n),e}m()}(),V("Setup ResizeObserver"),je=new ResizeObserver(rt),je.observe(document.body),it.add(document.body),at(document.body),oe!==ce&&(V("Setup OverflowObserver"),Me=(e=>{const t=e.side||$,n=e.onChange||C,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||C,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){Y("observation");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),c&&V("Overflowed:",i)}var n;r(i)}),o),c=new WeakSet;return function(e){V("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)):J(!n,"Node already observed",t)}}})({onChange:Ze,root:document.documentElement,side:oe?$:S})),_e(ct(document)()),queueMicrotask(We),V("Initialization complete"),zt("init","Init message from host page",void 0,void 0,y),document.title&&""!==document.title&&St(0,0,"title",document.title)}function Ue(){Ee=document.querySelectorAll(`[${z}]:not([${w}]):not([${w}] *)`),me=Ee.length>0}function Ze(e){Ue(),(me||e)&&(V("Observed Elements:",Ee.length),zt(k,"Overflow updated"))}function Je(){Ae=document.querySelectorAll(`[${b}]`),fe=Ae.length>0,V(`Tagged elements found: %c${fe}`,g)}function _e(e){fe||Me(e)}let Qe=0;function Ge(){const n=document.querySelectorAll(`*[${w}]`);ue=n.length>0,ue&&n.length!==Qe&&(function(n){const o=1===n.length?"":"s";ee(`%c[${w}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),Qe=n.length)}function Xe(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),Z(`Set body ${e}: %c${t}`,g))}function Ye(e,t,n){if(""!==n){V(`${e}: %c${n}`,g);for(const e of document.querySelectorAll(n))V(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Ke(){Ye("sizeSelector",b,Pe),Ye("ignoreSelector",w,he)}function et(e){({add(t){function n(){zt(e.eventName,e.eventType)}a[t]=n,P(window,t,n,{passive:!0})},remove(e){const t=a[e];var n,o;delete a[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),V(`${R(e.method)} event listener: %c${e.eventType}`,g)}function tt(e,t,n,o){return t!==e&&(e in n||(ee(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in i&&te(`<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 remove this option.`),V(`Set ${o} calculation method: %c${e}`,g)),e}function nt(){ge=tt(ge,l,pt,"height")}function ot(){Le=tt(Le,u,gt,"width")}function rt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;zt(E,`Element resized <${L(t)}>`)}const it=new WeakSet;function at(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!it.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(je.observe(e),it.add(e),V(`Attached resizeObserver: %c${L(e)}`,g))}const t=ct(e)();for(const e of t){if(it.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(je.observe(e),it.add(e),V(`Attached resizeObserver: %c${L(e)}`,g))}}function st(e){performance.mark(se);const t=R(e);let n=0,r=document.documentElement,i=fe?0:document.documentElement.getBoundingClientRect().bottom;const a=fe?Ae:me?Ee:ct(document)();let l=a.length;for(const t of a)fe||!s||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>i&&(i=n,r=t)):l-=1;return Z(`${t} position calculated from:`,r),performance.mark(le,{detail:{Side:t,len:l,hasTags:fe,logging:we}}),i}const lt=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],ct=e=>()=>{Ge();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 ue&&t.push(`not([${w}])`,`not([${w}] *)`),e.querySelectorAll(t.join(":"))},dt={height:0,width:0},ut={height:0,width:0},mt=[g,h,g];function ft(e){function t(){return ut[o]=r,dt[o]=s,r}const n=e===pt,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 fe:Z("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!me&&0===ut[o]&&0===dt[o]:Z(`Initial page size values: ${l}`,...mt),c=t();break;case Ne&&r===ut[o]&&s===dt[o]:Z(`Size unchanged: ${l}`,...mt),c=Math.max(r,s);break;case 0===r:Z(`Page is hidden: ${l}`,...mt),c=s;break;case!me&&r!==ut[o]&&s<=dt[o]:Z(`New <html> size: ${l} `,...mt),Z(`Previous <html> size: %c${ut[o]}px`,g),c=t();break;case!n:c=e.taggedElement();break;case!me&&r<ut[o]:Z(`<html> size decreased: ${l}`,...mt),c=t();break;case s===a||s===i:Z(`<html> size equals page size: ${l}`,...mt),c=t();break;case r>s:Z(`Page size < <html> size: ${l}`,...mt),c=t();break;case me:Z("Found element overflowing <html> "),c=e.taggedElement();break;default:Z(`Using <html> size: ${l}`,...mt),c=t()}return Z(`Content ${o}: %c${c}px`,g),c+=function(e){const t=e.getOffset();return 0!==t&&Z(`Page offsetSize: %c${t}px`,g),t}(e),c}const pt={enabled:()=>oe,getOffset:()=>m,auto:()=>ft(pt),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,v)+parseInt(t.marginBottom,v)},bodyScroll:()=>document.body.scrollHeight,offset:()=>pt.bodyOffset(),custom:()=>r.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...lt(pt)),min:()=>Math.min(...lt(pt)),grow:()=>pt.max(),lowestElement:()=>st($),taggedElement:()=>st($)},gt={enabled:()=>ce,getOffset:()=>f,auto:()=>ft(gt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>r.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...lt(gt)),min:()=>Math.min(...lt(gt)),rightMostElement:()=>st(S),scroll:()=>Math.max(gt.bodyScroll(),gt.documentElementScroll()),taggedElement:()=>st(S)},ht=(e,t)=>!(Math.abs(e-t)<=Ce);function yt(e,t,n,o,r){const i=void 0===n?pt[ge]():n,a=void 0===o?gt[Le]():o;switch(!0){case oe&&ht(pe,i)||ce&&ht(qe,a)||"init"===e:pe=i,qe=a;case e===M:St(pe,qe,e,r);break;case!e!==O&&(oe&&ge in d||ce&&Le in d):$t(t);break;case e===E:case e===k:case e===j:V(I);break;default:Z(I)}A=!1}let vt=!1;const bt=x((()=>ne(T(4)))),zt=X(((e,t,n,o,r)=>{Y(e),q=performance.now(),W||e===O?document.hidden?V("Page hidden - Ignored resize request"):(vt||(V(`Resize event: %c${t}`,g),A=!0,yt(e,t,n,o,r),requestAnimationFrame((()=>{vt=!1}))),vt=!0):Z("Resizing disabled")}));function wt(e){pe=pt[ge](),qe=gt[Le](),St(pe,qe,e)}function $t(e){const t=ge;ge=l,V(`Reset trigger event: %c${e}`,g),Ne?V("TriggerLock blocked calculation"):(Ne=!0,_("Trigger event lock on"),requestAnimationFrame((()=>{Ne=!1,_("Trigger event lock off")}))),wt("reset"),ge=t}const St=X((function(e,t,o,r,i){$e<-1||(Y(o),void 0!==i?V(`Message targetOrigin: %c${i}`,g):i=xe,function(){const a=`${Oe}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(Ie)try{window.parent.iframeParentListener(c+a)}catch(e){if(1!==$e)throw e;return void bt()}else Te.postMessage(c+a,i);A&&V(function(){const e=N(performance.now()-q);return"init"===o?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),g),Z(`Sending message to parent page via ${Ie?"sameOrigin":"postMessage"}: %c%c${a}`,n,g)}(),Q())})),Ot=X((function(e){Y("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>t(n(e)),r=e=>St(0,0,`${e}Stop`),i={init:function(){ve=e.data,Te=e.source,p=e.origin,Ve(),de=!1,setTimeout((()=>{ye=!1}),128)},reset(){ye?V("Page reset ignored by init"):(V("Page size reset by host page"),wt("resetPage"))},resize(){zt(O,"Parent window requested size check")},moveToAnchor(){be.findTarget(s())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=s();V("PageInfo received from parent:",o(e)),De?setTimeout((()=>De(n(e)))):r("pageInfo")},parentInfo(){const e=o(s());V("ParentInfo received from parent:",e),He?setTimeout((()=>He(e))):r("parentInfo")},message(){const e=s();V("onMessage called from parent:%c",g,o(e)),setTimeout((()=>Fe(n(e))))}},a=()=>e.data.split("]")[1].split(":")[0],s=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function d(){const t=a();t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||ee(`Unexpected message (${e.data})`)}c===`${e.data}`.slice(0,13)&&(Y(a()),!1!==de?l()?i.init():V(`Ignored message of type "${a()}". Received before initialization.`):d())}));function Mt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?ee("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>Ot({data:e,sameOrigin:!0}))),P(window,"message",Ot),P(window,"readystatechange",Mt),Mt())}()}();
21
21
  //# sourceMappingURL=iframeResizer.contentWindow.min.js.map
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (parent) 5.4.5-beta.12 (umd) - 2025-04-15
4
+ * @module iframe-resizer/legacy (parent) 5.4.5-beta.13 (umd) - 2025-04-15
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -17,5 +17,5 @@
17
17
  */
18
18
 
19
19
 
20
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,(function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="font-weight: normal;",t=e+"font-style: italic;",n="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),o={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},a=Object.assign(console);const{fromEntries:s,keys:l}=Object,c=e=>[e,a[e]],d=e=>t=>[t,function(n){e[t]=n}],u=(e,t)=>s(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",h=f?"color: #E3E3E3;":"color: #1F1F1F;",m="5.4.5-beta.12",g="iframeResizer",y="[iFrameSizer]",w=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),b="onload",v="init",z=Object.freeze({[b]:1,[v]:1}),$="expanded",j="collapsed",k=Object.freeze({[$]:1,[j]:1}),T=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),x=e=>e,E=(M=function(s={}){const l={},f={},p=[],h={...o,expand:!s.collapsed||o.expanded,...s};let m="";function g(){p.length=0,m=""}function y(){delete h.event,g()}const w=()=>!!p.some((([e])=>e in i))||!!h.expand;function b(){if(0!==p.length){a[w()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?m:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)a.assert(e in a,`Unknown console method: ${e}`),e in a&&a[e](...t);a.groupEnd(),y()}else y()}function v(){""===m&&(m=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function z(e,...t){0===p.length&&(v(),queueMicrotask((()=>queueMicrotask(b)))),p.push([e,...t])}function $(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...u(h,d(h)),...u(console,(e=>[e,(...t)=>z(e,...t)])),...u(r,c),assert:function(e,...t){e||z("assert",e,...t)},count:function(e=n){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=n){delete f[e]},endAutoGroup:b,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e)}return n},event:function(e){v(),h.event=e},purge:g,time:function(e=n){v(),l[e]=performance.now()},timeEnd:function(e=n){$(e),delete l[e]},timeLog:$,touch:v}},M?.__esModule?M.default:M);var M;let R={},O=!1;const I=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const S=e=>(t,...n)=>R[t]?.console[e](...n),C=(A="log",(e,...t)=>!0===(e=>R[e]?R[e].log:O)(e)?S(A)(e,...t):null);var A;const W=C,F=S("warn"),L=S("error"),N=S("event"),P=S("purge"),H=S("errorBoundary");const B=(e,...t)=>R[e]?R[e].console.warn(T(x)(...t)):queueMicrotask((()=>console?.warn(T((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t)))),D=(e=>(t,n="renamed to")=>(i,o,r="",a="")=>e(a,`<rb>Deprecated ${t}(${i.replace("()","")})</>\n\nThe <b>${i}</> ${t.toLowerCase()} has been ${n} <b>${o}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(B),q=D("Function"),U=D("Option"),J=(e,t,n,i)=>e.addEventListener(t,n,i||!1),V=(e,t,n)=>e.removeEventListener(t,n,!1),Z=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let i,o=0;o<e.length;o++)i=e.codePointAt(o),t=Math.imul(t^i,2246822519),n=Math.imul(n^i,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},G=e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),X=["<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."],Y=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],_=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),Q=e=>G(X[e]),K=e=>{const t=e[G("spjluzl")];if(!t)return-1;const n=t.split("-");let i=function(e=""){let t=-2;const n=Z(G(e));return n in _&&(t=_[n]),t}(n[0]);return 0===i||(e=>e[2]===Z(e[0]+e[1]))(n)||(i=-2),i},ee={},te=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof ee[e.id].onInit&&(U("init()","onReady()","",e.id),ee[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),ne={position:null,version:m};function ie(e){function t(){ue(T),ce(x),$("onResized",T)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function i(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const o=e=>k.slice(k.indexOf(":")+7+e);const r=(e,t)=>(n,i)=>{const o={};var r,a;r=function(){pe(`${n} (${e})`,`${e}:${t()}`,i)},o[a=i]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},a=(e,t)=>()=>{let n=!1;const i=t=>()=>{ee[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame((()=>{n=!1}))):s()},o=i("scroll"),r=i("resize window");function a(e,n){C(l,`${e}listeners for send${t}`),n(window,"scroll",o),n(window,"resize",r)}function s(){N(l,`stop${t}`),a("Remove ",V),c.disconnect(),d.disconnect(),V(ee[l].iframe,"load",s)}const l=x,c=new ResizeObserver(i("pageObserver")),d=new ResizeObserver(i("iframeObserver"));ee[l]&&(ee[l][`stop${t}`]=s,J(ee[l].iframe,"load",s),a("Add ",J),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(ee[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},s=e=>()=>{e in ee[x]&&(ee[x][e](),delete ee[x][e])},l=r("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=T.iframe.getBoundingClientRect(),{scrollY:n,scrollX:i,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:i,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),c=r("parentInfo",(function(){const{iframe:e}=T,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),d=a(l,"PageInfo"),u=a(c,"ParentInfo"),f=s("stopPageInfo"),g=s("stopParentInfo");function w(e){const t=e.getBoundingClientRect();return se(x),{x:Number(t.left)+Number(ne.position.x),y:Number(t.top)+Number(ne.position.y)}}function b(e){const t=e?w(T.iframe):{x:0,y:0};W(x,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,h,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(T,t),i=window.parentIframe||window.parentIFrame;i?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(i,n):function(e){ne.position=e,v(x)}(n)}function v(e){const{x:t,y:n}=ne.position,i=ee[e]?.iframe;!1!==$("onScroll",{iframe:i,top:n,left:t,x:t,y:n})?ce(e):le()}function z(e){let t={};if(0===T.width&&0===T.height){const e=o(9).split(":");t={x:e[1],y:e[0]}}else t={x:T.width,y:T.height};$(e,{iframe:T.iframe,screenX:Number(t.x),screenY:Number(t.y),type:T.type})}const $=(e,t)=>oe(x,e,t);function j(){const{height:e,iframe:n,msg:i,type:r,width:a}=T;switch(ee[x]?.firstRun&&ee[x]&&(ee[x].firstRun=!1),r){case"close":ae(n);break;case"message":l=o(6),C(x,`onMessage passed: {iframe: %c${T.iframe.id}%c, message: %c${l}%c}`,p,h,p,h),$("onMessage",{iframe:T.iframe,message:JSON.parse(l)});break;case"mouseenter":z("onMouseEnter");break;case"mouseleave":z("onMouseLeave");break;case"autoResize":ee[x].autoResize=JSON.parse(o(9));break;case"scrollBy":!function(){const e=T.width,t=T.height,n=window.parentIframe||window.parentIFrame||window;W(x,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),n.scrollBy(e,t)}();break;case"scrollTo":b(!1);break;case"scrollToOffset":b(!0);break;case"pageInfo":d();break;case"parentInfo":u();break;case"pageInfoStop":f();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let i=document.getElementById(n)||document.getElementsByName(n)[0];i?function(){const e=w(i);W(x,`Moving to in page link: %c#${t}`,p),ne.position={x:e.x,y:e.y},v(x),window.location.hash=t}():window.top!==window.self?function(){const e=window.parentIframe||window.parentIFrame;e?e.moveToAnchor(t):C(x,`In page link #${t} not found and window.parentIframe not found`)}():C(x,`In page link #${t} not found`)}(o(9));break;case"title":!function(e,t){ee[t]?.syncTitle&&(ee[t].iframe.title=e,W(t,`Set iframe title attribute: %c${e}`,p))}(i,x);break;case"reset":de(T);break;case"init":t(),function(e){try{ee[e].sameOrigin=!!ee[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){ee[e].sameOrigin=!1}C(e,`sameOrigin: %c${ee[e].sameOrigin}`,p)}(x),(s=i)!==m&&(void 0!==s?C(x,`Version mismatch (Child: %c${s}%c !== Parent: %c${m})`,p,h,p):B(x,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),ge=!0,$("onReady",n);break;default:if(0===a&&0===e)return void F(x,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===a||0===e)return void C(x,"Ignoring message with 0 height or width");if(document.hidden)return void C(x,"Page hidden - ignored resize request");t()}var s,l}let k=e.data,T={},x=null;"[iFrameResizerChild]Ready"!==k?y===`${k}`.slice(0,13)&&k.slice(13).split(":")[0]in ee?(T=function(){const e=k.slice(13).split(":"),t=e[1]?Number(e[1]):0,o=ee[e[0]]?.iframe,r=getComputedStyle(o);return{iframe:o,id:e[0],height:t+n(r)+i(r),width:Number(e[2]),type:e[3],msg:e[4]}}(),x=T.id,x?(N(x,T.type),H(x,(function(){!function(e){if(!ee[e])throw new Error(`${T.type} No settings for ${e}. Message was: ${k}`)}(x),function(){const e=T.type in{true:1,false:1,undefined:1};return e&&C(x,"Ignoring init message from meta parent page"),e}()||(C(x,`Received: %c${k}`,p),ee[x].loaded=!0,(null!==T.iframe||(F(x,`The iframe (${T.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let i=ee[x]?.checkOrigin;if(i&&"null"!=`${t}`&&!(i.constructor===Array?function(){let e=0,n=!1;for(C(x,`Checking connection is from allowed list of origins: %c${i}`,p);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():function(){const e=ee[x]?.remoteHost;return C(x,`Checking connection is from: %c${e}`,p),t===e}()))throw new Error(`Unexpected message received from: ${t} for ${T.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&j())}))()):F("","iframeResizer received messageData without id, message was: ",k)):null!==x&&C(x,"Ignored:",k):Object.keys(ee).forEach((e=>{ee[e].mode>=0&&pe("iFrame requested init",he(e),e)}))}function oe(e,t,n){let i=null,o=null;if(ee[e]){if(i=ee[e][t],"function"!=typeof i)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onClose"===t||"onScroll"===t)try{o=i(n)}catch(n){console.error(n),F(e,`Error in ${t} callback`)}else setTimeout((()=>i(n)))}return o}function re(e){const{id:t}=e;C(t,"Disconnected from iframe"),delete ee[t],delete e.iframeResizer}function ae(e){const{id:t}=e;if(!1!==oe(t,"onClose",t)){C(t,`Removing iFrame: %c${t}`,p);try{e.parentNode&&e.remove()}catch(e){F(t,e)}oe(t,"onClosed",t),re(e)}else C(t,"Close iframe cancelled by onClose event")}function se(e){null===ne.position&&(ne.position={x:window.scrollX,y:window.scrollY},C(e,`Get page position: %c${ne.position.x}%c, %c${ne.position.y}`,p,h,p))}function le(){ne.position=null}function ce(e){null!==ne.position&&(window.scrollTo(ne.position.x,ne.position.y),W(e,`Set page position: %c${ne.position.x}%c, %c${ne.position.y}`,p,h,p),le())}function de(e){C(e.id,"Size reset requested by "+("init"===e.type?"parent page":"child page")),se(e.id),ue(e),pe("reset","reset",e.id)}function ue(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i,W(n,`Set ${t}: %c${i}`,p)}const{id:n}=e,{sizeHeight:i,sizeWidth:o}=ee[n];i&&t("height"),o&&t("width")}R=ee;const fe=e=>e.split(":").filter(((e,t)=>19!==t)).join(":");function pe(e,t,n,i){function o(i){const o=e in z?fe(t):t;W(n,i,p,h,p),W(n,`Message data: %c${o}`,p)}N(n,e),ee[n]&&(ee[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:i,sameOrigin:r,targetOrigin:a}=ee[n];if(r)try{return e.contentWindow.iframeChildListener(y+t),void o(`Sending message to iframe %c${n}%c via sameOrigin`)}catch(e){C(n,"Same domain connection failed. Trying cross domain%c")}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${a}`),i.postMessage(y+t,a)}():F(n,`Iframe(${n}) not found`),i&&ee[n]?.warningTimeout&&(ee[n].msgTimeout=setTimeout((function(){if(void 0===ee[n])return;const{iframe:e,loaded:t,loadErrorShown:i,waitForLoad:o}=ee[n],{sandbox:r}=e,a="object"==typeof r&&r.length>0;t||i||(ee[n].loadErrorShown=!0,B(n,`<rb>No response from iFrame</>\n \nThe iframe (<i>${n}</>) has not responded within ${ee[n].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"} \n${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"}This message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`))}),ee[n].warningTimeout)))}function he(e){const t=ee[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,ne.version,t.mode,"",t.logExpand].join(":")}let me=0,ge=!1,ye=!1;const we=t=>n=>{function i(){if(ee[u]){const{iframe:e}=ee[u],t={close:ae.bind(null,e),disconnect:re.bind(null,e),removeListeners(){B(u,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:pe.bind(null,"Window resize","resize",u),moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${i=t,i.charAt(0).toUpperCase()+i.slice(1)}`);var i})(e,"string","moveToAnchor(anchor) anchor"),pe("Move to anchor",`moveToAnchor:${e}`,u)},sendMessage(e){pe("message",`message:${e=JSON.stringify(e)}`,u)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e){const{id:t}=n,{mode:i,waitForLoad:o}=ee[t];-1!==i&&-2!==i&&(J(n,"load",(function(){pe(b,`${e}:${ge}`,t,!0),function(){const e=ee[u]?.firstRun,t=ee[u]?.heightCalculationMethod in w;!e&&t&&de({iframe:n,height:0,width:0,type:"init"})}()})),!1===o&&pe(v,`${e}:${ge}`,t,!0))}function r(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&B(u,'<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e):{}}function a(){const{mode:n}=ee[u];if(n<0)throw B("Parent",`${Q(n+2)}${Q(2)}`),P(u),Q(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");ye||n>0&&t.vInfoDisable||(ye=!0,function(t,n){queueMicrotask((()=>console.info(`%ciframe-resizer ${t}`,O||n<1?"font-weight: bold;":e)))}(`v${m} (${(e=>G(Y[e]))(n)})`,n)),n<1&&B("Parent",Q(3))}function s(e){const t=ee[e]?.iframe?.title;return""===t||void 0===t}const l=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function c(e){var t,i;ee[u]={...ee[u],iframe:n,firstRun:!0,remoteHost:n?.src.split("/").slice(0,3).join("/"),...te,...r(e),mouseEvents:l(e),mode:K(e),syncTitle:s(u)},N(u,"setup"),function(){const{direction:e}=ee[u];if("horizontal"===e)return ee[u].sizeWidth=!0,ee[u].sizeHeight=!1,void C(u,"Direction: %chorizontal",p);if("none"===e)return ee[u].sizeWidth=!1,ee[u].sizeHeight=!1,ee[u].autoResize=!1,void C(u,"Direction: %cnone",p);if("vertical"!==e)throw new TypeError(u,`Direction value of "${e}" is not valid`);C(u,"Direction: %cvertical",p)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===ee[u].direction?(ee[u].offsetHeight=t,C(u,`Offset height: %c${t}`,p)):(ee[u].offsetWidth=t,C(u,`Offset width: %c${t}`,p))),e?.offset&&B(u,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>."),null===ee[u].postMessageTarget&&(ee[u].postMessageTarget=n.contentWindow),ee[u].targetOrigin=!0===ee[u].checkOrigin?""===(i=ee[u].remoteHost)||null!==i.match(/^(about:blank|javascript:|file:\/\/)/)?"*":i:"*"}const d=()=>"iframeResizer"in n,u=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=t?.id||te.id+me++;return null!==document.getElementById(e)&&(e+=me++),e}(),n.id=e,C(e,`Added missing iframe ID: ${e} (${n.src})`)),e}(n.id);if("object"!=typeof t)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=$,e.logExpand=!t.includes("ifrlog=collapsed"))}(t),function(e,t){const n=Object.hasOwn(t,"log"),i="string"==typeof t.log,o=n?!!i||t.log:te.log;Object.hasOwn(t,"logExpand")||(t.logExpand=n&&i?t.log===$:te.logExpand),function(e){-1===e?.log&&(e.log=!1,e.vInfoDisable=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const i=E({expand:t,label:I(n)});O=e,R[n]||(R[n]={console:i})}({enabled:o,expand:t.logExpand,iframeId:e}),i&&!(t.log in k)&&L(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=o}(u,t),H(u,(function(e){d()?F(u,`Ignored iframe (${u}), already setup.`):(c(e),a(),ve(),function(){switch(C(u,`Iframe scrolling ${ee[u]?.scrolling?"enabled":"disabled"} for ${u}`),n.style.overflow=!1===ee[u]?.scrolling?"hidden":"auto",ee[u]?.scrolling){case"omit":break;case!0:n.scrolling="yes";break;case!1:n.scrolling="no";break;default:n.scrolling=ee[u]?ee[u].scrolling:"no"}}(),function(){const{bodyMargin:e}=ee[u];"number"!=typeof e&&"0"!==e||(ee[u].bodyMargin=`${e}px`)}(),o(he(u)),i(),C(u,"Setup complete"))}))(t),n?.iFrameResizer};function be(){!1===document.hidden&&(C("document","Trigger event: Visibility change"),function(e,t){const n=e=>ee[e]?.autoResize&&!ee[e]?.firstRun;Object.keys(ee).forEach((function(i){n(i)&&pe(e,t,i)}))}("Tab Visible","resize"))}const ve=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{J(window,"message",ie),J(document,"visibilitychange",be),window.iframeParentListener=e=>setTimeout((()=>ie({data:e,sameOrigin:!0})))})),ze=`[${g}] `;const $e=function(){function e(e){switch(!0){case!e:throw new TypeError(`${ze}iframe is not defined`);case!e.tagName:throw new TypeError(`${ze}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${ze}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(i,o){if("undefined"==typeof window)return[];switch(t=we(i),n=[],typeof o){case"undefined":case"string":document.querySelectorAll(o||"iframe").forEach(e);break;case"object":e(o);break;default:throw new TypeError(`${ze}Unexpected data type (${typeof o})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){q("iFrameResize()","iframeResize()","","parent"),$e(...e)}),$e}));
20
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,(function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="font-weight: normal;",t=e+"font-style: italic;",n="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),o={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},a=Object.assign(console);const{fromEntries:s,keys:l}=Object,c=e=>[e,a[e]],d=e=>t=>[t,function(n){e[t]=n}],u=(e,t)=>s(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",h=f?"color: #E3E3E3;":"color: #1F1F1F;",m="5.4.5-beta.13",g="iframeResizer",y="[iFrameSizer]",w=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),b="onload",v="init",z=Object.freeze({[b]:1,[v]:1}),$="expanded",j="collapsed",k=Object.freeze({[$]:1,[j]:1}),T=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),x=e=>e,E=(M=function(s={}){const l={},f={},p=[],h={...o,expand:!s.collapsed||o.expanded,...s};let m="";function g(){p.length=0,m=""}function y(){delete h.event,g()}const w=()=>!!p.some((([e])=>e in i))||!!h.expand;function b(){if(0!==p.length){a[w()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?m:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)a.assert(e in a,`Unknown console method: ${e}`),e in a&&a[e](...t);a.groupEnd(),y()}else y()}function v(){""===m&&(m=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function z(e,...t){0===p.length&&(v(),queueMicrotask((()=>queueMicrotask(b)))),p.push([e,...t])}function $(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...u(h,d(h)),...u(console,(e=>[e,(...t)=>z(e,...t)])),...u(r,c),assert:function(e,...t){e||z("assert",e,...t)},count:function(e=n){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=n){delete f[e]},endAutoGroup:b,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e)}return n},event:function(e){v(),h.event=e},purge:g,time:function(e=n){v(),l[e]=performance.now()},timeEnd:function(e=n){$(e),delete l[e]},timeLog:$,touch:v}},M?.__esModule?M.default:M);var M;let R={},O=!1;const I=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const S=e=>(t,...n)=>R[t]?.console[e](...n),C=(A="log",(e,...t)=>!0===(e=>R[e]?R[e].log:O)(e)?S(A)(e,...t):null);var A;const W=C,F=S("warn"),L=S("error"),N=S("event"),P=S("purge"),H=S("errorBoundary");const B=(e,...t)=>R[e]?R[e].console.warn(T(x)(...t)):queueMicrotask((()=>console?.warn(T((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t)))),D=(e=>(t,n="renamed to")=>(i,o,r="",a="")=>e(a,`<rb>Deprecated ${t}(${i.replace("()","")})</>\n\nThe <b>${i}</> ${t.toLowerCase()} has been ${n} <b>${o}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(B),q=D("Function"),U=D("Option"),J=(e,t,n,i)=>e.addEventListener(t,n,i||!1),V=(e,t,n)=>e.removeEventListener(t,n,!1),Z=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let i,o=0;o<e.length;o++)i=e.codePointAt(o),t=Math.imul(t^i,2246822519),n=Math.imul(n^i,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},G=e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),X=["<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."],Y=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],_=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),Q=e=>G(X[e]),K=e=>{const t=e[G("spjluzl")];if(!t)return-1;const n=t.split("-");let i=function(e=""){let t=-2;const n=Z(G(e));return n in _&&(t=_[n]),t}(n[0]);return 0===i||(e=>e[2]===Z(e[0]+e[1]))(n)||(i=-2),i},ee={},te=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof ee[e.id].onInit&&(U("init()","onReady()","",e.id),ee[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),ne={position:null,version:m};function ie(e){function t(){ue(T),ce(x),$("onResized",T)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function i(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const o=e=>k.slice(k.indexOf(":")+7+e);const r=(e,t)=>(n,i)=>{const o={};var r,a;r=function(){pe(`${n} (${e})`,`${e}:${t()}`,i)},o[a=i]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},a=(e,t)=>()=>{let n=!1;const i=t=>()=>{ee[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame((()=>{n=!1}))):s()},o=i("scroll"),r=i("resize window");function a(e,n){C(l,`${e}listeners for send${t}`),n(window,"scroll",o),n(window,"resize",r)}function s(){N(l,`stop${t}`),a("Remove ",V),c.disconnect(),d.disconnect(),V(ee[l].iframe,"load",s)}const l=x,c=new ResizeObserver(i("pageObserver")),d=new ResizeObserver(i("iframeObserver"));ee[l]&&(ee[l][`stop${t}`]=s,J(ee[l].iframe,"load",s),a("Add ",J),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(ee[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},s=e=>()=>{e in ee[x]&&(ee[x][e](),delete ee[x][e])},l=r("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=T.iframe.getBoundingClientRect(),{scrollY:n,scrollX:i,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:i,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),c=r("parentInfo",(function(){const{iframe:e}=T,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),d=a(l,"PageInfo"),u=a(c,"ParentInfo"),f=s("stopPageInfo"),g=s("stopParentInfo");function w(e){const t=e.getBoundingClientRect();return se(x),{x:Number(t.left)+Number(ne.position.x),y:Number(t.top)+Number(ne.position.y)}}function b(e){const t=e?w(T.iframe):{x:0,y:0};W(x,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,h,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(T,t),i=window.parentIframe||window.parentIFrame;i?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(i,n):function(e){ne.position=e,v(x)}(n)}function v(e){const{x:t,y:n}=ne.position,i=ee[e]?.iframe;!1!==$("onScroll",{iframe:i,top:n,left:t,x:t,y:n})?ce(e):le()}function z(e){let t={};if(0===T.width&&0===T.height){const e=o(9).split(":");t={x:e[1],y:e[0]}}else t={x:T.width,y:T.height};$(e,{iframe:T.iframe,screenX:Number(t.x),screenY:Number(t.y),type:T.type})}const $=(e,t)=>oe(x,e,t);function j(){const{height:e,iframe:n,msg:i,type:r,width:a}=T;switch(ee[x]?.firstRun&&ee[x]&&(ee[x].firstRun=!1),r){case"close":ae(n);break;case"message":l=o(6),C(x,`onMessage passed: {iframe: %c${T.iframe.id}%c, message: %c${l}%c}`,p,h,p,h),$("onMessage",{iframe:T.iframe,message:JSON.parse(l)});break;case"mouseenter":z("onMouseEnter");break;case"mouseleave":z("onMouseLeave");break;case"autoResize":ee[x].autoResize=JSON.parse(o(9));break;case"scrollBy":!function(){const e=T.width,t=T.height,n=window.parentIframe||window.parentIFrame||window;W(x,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),n.scrollBy(e,t)}();break;case"scrollTo":b(!1);break;case"scrollToOffset":b(!0);break;case"pageInfo":d();break;case"parentInfo":u();break;case"pageInfoStop":f();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let i=document.getElementById(n)||document.getElementsByName(n)[0];i?function(){const e=w(i);W(x,`Moving to in page link: %c#${t}`,p),ne.position={x:e.x,y:e.y},v(x),window.location.hash=t}():window.top!==window.self?function(){const e=window.parentIframe||window.parentIFrame;e?e.moveToAnchor(t):C(x,`In page link #${t} not found and window.parentIframe not found`)}():C(x,`In page link #${t} not found`)}(o(9));break;case"title":!function(e,t){ee[t]?.syncTitle&&(ee[t].iframe.title=e,W(t,`Set iframe title attribute: %c${e}`,p))}(i,x);break;case"reset":de(T);break;case"init":t(),function(e){try{ee[e].sameOrigin=!!ee[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){ee[e].sameOrigin=!1}C(e,`sameOrigin: %c${ee[e].sameOrigin}`,p)}(x),(s=i)!==m&&(void 0!==s?C(x,`Version mismatch (Child: %c${s}%c !== Parent: %c${m})`,p,h,p):B(x,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),ge=!0,$("onReady",n);break;default:if(0===a&&0===e)return void F(x,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===a||0===e)return void C(x,"Ignoring message with 0 height or width");if(document.hidden)return void C(x,"Page hidden - ignored resize request");t()}var s,l}let k=e.data,T={},x=null;"[iFrameResizerChild]Ready"!==k?y===`${k}`.slice(0,13)&&k.slice(13).split(":")[0]in ee?(T=function(){const e=k.slice(13).split(":"),t=e[1]?Number(e[1]):0,o=ee[e[0]]?.iframe,r=getComputedStyle(o);return{iframe:o,id:e[0],height:t+n(r)+i(r),width:Number(e[2]),type:e[3],msg:e[4]}}(),x=T.id,x?(N(x,T.type),H(x,(function(){!function(e){if(!ee[e])throw new Error(`${T.type} No settings for ${e}. Message was: ${k}`)}(x),function(){const e=T.type in{true:1,false:1,undefined:1};return e&&C(x,"Ignoring init message from meta parent page"),e}()||(C(x,`Received: %c${k}`,p),ee[x].loaded=!0,(null!==T.iframe||(F(x,`The iframe (${T.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let i=ee[x]?.checkOrigin;if(i&&"null"!=`${t}`&&!(i.constructor===Array?function(){let e=0,n=!1;for(C(x,`Checking connection is from allowed list of origins: %c${i}`,p);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():function(){const e=ee[x]?.remoteHost;return C(x,`Checking connection is from: %c${e}`,p),t===e}()))throw new Error(`Unexpected message received from: ${t} for ${T.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&j())}))()):F("","iframeResizer received messageData without id, message was: ",k)):null!==x&&C(x,"Ignored:",k):Object.keys(ee).forEach((e=>{ee[e].mode>=0&&pe("iFrame requested init",he(e),e)}))}function oe(e,t,n){let i=null,o=null;if(ee[e]){if(i=ee[e][t],"function"!=typeof i)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onClose"===t||"onScroll"===t)try{o=i(n)}catch(n){console.error(n),F(e,`Error in ${t} callback`)}else setTimeout((()=>i(n)))}return o}function re(e){const{id:t}=e;C(t,"Disconnected from iframe"),delete ee[t],delete e.iframeResizer}function ae(e){const{id:t}=e;if(!1!==oe(t,"onClose",t)){C(t,`Removing iFrame: %c${t}`,p);try{e.parentNode&&e.remove()}catch(e){F(t,e)}oe(t,"onClosed",t),re(e)}else C(t,"Close iframe cancelled by onClose event")}function se(e){null===ne.position&&(ne.position={x:window.scrollX,y:window.scrollY},C(e,`Get page position: %c${ne.position.x}%c, %c${ne.position.y}`,p,h,p))}function le(){ne.position=null}function ce(e){null!==ne.position&&(window.scrollTo(ne.position.x,ne.position.y),W(e,`Set page position: %c${ne.position.x}%c, %c${ne.position.y}`,p,h,p),le())}function de(e){C(e.id,"Size reset requested by "+("init"===e.type?"parent page":"child page")),se(e.id),ue(e),pe("reset","reset",e.id)}function ue(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i,W(n,`Set ${t}: %c${i}`,p)}const{id:n}=e,{sizeHeight:i,sizeWidth:o}=ee[n];i&&t("height"),o&&t("width")}R=ee;const fe=e=>e.split(":").filter(((e,t)=>19!==t)).join(":");function pe(e,t,n,i){function o(i){const o=e in z?fe(t):t;W(n,i,p,h,p),W(n,`Message data: %c${o}`,p)}N(n,e),ee[n]&&(ee[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:i,sameOrigin:r,targetOrigin:a}=ee[n];if(r)try{return e.contentWindow.iframeChildListener(y+t),void o(`Sending message to iframe %c${n}%c via sameOrigin`)}catch(e){C(n,"Same domain connection failed. Trying cross domain%c")}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${a}`),i.postMessage(y+t,a)}():F(n,`Iframe(${n}) not found`),i&&ee[n]?.warningTimeout&&(ee[n].msgTimeout=setTimeout((function(){if(void 0===ee[n])return;const{iframe:e,loaded:t,loadErrorShown:i,waitForLoad:o}=ee[n],{sandbox:r}=e,a="object"==typeof r&&r.length>0;t||i||(ee[n].loadErrorShown=!0,B(n,`<rb>No response from iFrame</>\n \nThe iframe (<i>${n}</>) has not responded within ${ee[n].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"} \n${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"}This message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`))}),ee[n].warningTimeout)))}function he(e){const t=ee[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,ne.version,t.mode,"",t.logExpand].join(":")}let me=0,ge=!1,ye=!1;const we=t=>n=>{function i(){if(ee[u]){const{iframe:e}=ee[u],t={close:ae.bind(null,e),disconnect:re.bind(null,e),removeListeners(){B(u,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:pe.bind(null,"Window resize","resize",u),moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${i=t,i.charAt(0).toUpperCase()+i.slice(1)}`);var i})(e,"string","moveToAnchor(anchor) anchor"),pe("Move to anchor",`moveToAnchor:${e}`,u)},sendMessage(e){pe("message",`message:${e=JSON.stringify(e)}`,u)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e){const{id:t}=n,{mode:i,waitForLoad:o}=ee[t];-1!==i&&-2!==i&&(J(n,"load",(function(){pe(b,`${e}:${ge}`,t,!0),function(){const e=ee[u]?.firstRun,t=ee[u]?.heightCalculationMethod in w;!e&&t&&de({iframe:n,height:0,width:0,type:"init"})}()})),!1===o&&pe(v,`${e}:${ge}`,t,!0))}function r(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&B(u,'<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e):{}}function a(){const{mode:n}=ee[u];if(n<0)throw B("Parent",`${Q(n+2)}${Q(2)}`),P(u),Q(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");ye||n>0&&t.vInfoDisable||(ye=!0,function(t,n){queueMicrotask((()=>console.info(`%ciframe-resizer ${t}`,O||n<1?"font-weight: bold;":e)))}(`v${m} (${(e=>G(Y[e]))(n)})`,n)),n<1&&B("Parent",Q(3))}function s(e){const t=ee[e]?.iframe?.title;return""===t||void 0===t}const l=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function c(e){var t,i;ee[u]={...ee[u],iframe:n,firstRun:!0,remoteHost:n?.src.split("/").slice(0,3).join("/"),...te,...r(e),mouseEvents:l(e),mode:K(e),syncTitle:s(u)},N(u,"setup"),function(){const{direction:e}=ee[u];if("horizontal"===e)return ee[u].sizeWidth=!0,ee[u].sizeHeight=!1,void C(u,"Direction: %chorizontal",p);if("none"===e)return ee[u].sizeWidth=!1,ee[u].sizeHeight=!1,ee[u].autoResize=!1,void C(u,"Direction: %cnone",p);if("vertical"!==e)throw new TypeError(u,`Direction value of "${e}" is not valid`);C(u,"Direction: %cvertical",p)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===ee[u].direction?(ee[u].offsetHeight=t,C(u,`Offset height: %c${t}`,p)):(ee[u].offsetWidth=t,C(u,`Offset width: %c${t}`,p))),e?.offset&&B(u,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>."),null===ee[u].postMessageTarget&&(ee[u].postMessageTarget=n.contentWindow),ee[u].targetOrigin=!0===ee[u].checkOrigin?""===(i=ee[u].remoteHost)||null!==i.match(/^(about:blank|javascript:|file:\/\/)/)?"*":i:"*"}const d=()=>"iframeResizer"in n,u=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=t?.id||te.id+me++;return null!==document.getElementById(e)&&(e+=me++),e}(),n.id=e,C(e,`Added missing iframe ID: ${e} (${n.src})`)),e}(n.id);if("object"!=typeof t)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=$,e.logExpand=!t.includes("ifrlog=collapsed"))}(t),function(e,t){const n=Object.hasOwn(t,"log"),i="string"==typeof t.log,o=n?!!i||t.log:te.log;Object.hasOwn(t,"logExpand")||(t.logExpand=n&&i?t.log===$:te.logExpand),function(e){-1===e?.log&&(e.log=!1,e.vInfoDisable=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const i=E({expand:t,label:I(n)});O=e,R[n]||(R[n]={console:i})}({enabled:o,expand:t.logExpand,iframeId:e}),i&&!(t.log in k)&&L(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=o}(u,t),H(u,(function(e){d()?F(u,`Ignored iframe (${u}), already setup.`):(c(e),a(),ve(),function(){switch(C(u,`Iframe scrolling ${ee[u]?.scrolling?"enabled":"disabled"} for ${u}`),n.style.overflow=!1===ee[u]?.scrolling?"hidden":"auto",ee[u]?.scrolling){case"omit":break;case!0:n.scrolling="yes";break;case!1:n.scrolling="no";break;default:n.scrolling=ee[u]?ee[u].scrolling:"no"}}(),function(){const{bodyMargin:e}=ee[u];"number"!=typeof e&&"0"!==e||(ee[u].bodyMargin=`${e}px`)}(),o(he(u)),i(),C(u,"Setup complete"))}))(t),n?.iFrameResizer};function be(){!1===document.hidden&&(C("document","Trigger event: Visibility change"),function(e,t){const n=e=>ee[e]?.autoResize&&!ee[e]?.firstRun;Object.keys(ee).forEach((function(i){n(i)&&pe(e,t,i)}))}("Tab Visible","resize"))}const ve=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{J(window,"message",ie),J(document,"visibilitychange",be),window.iframeParentListener=e=>setTimeout((()=>ie({data:e,sameOrigin:!0})))})),ze=`[${g}] `;const $e=function(){function e(e){switch(!0){case!e:throw new TypeError(`${ze}iframe is not defined`);case!e.tagName:throw new TypeError(`${ze}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${ze}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(i,o){if("undefined"==typeof window)return[];switch(t=we(i),n=[],typeof o){case"undefined":case"string":document.querySelectorAll(o||"iframe").forEach(e);break;case"object":e(o);break;default:throw new TypeError(`${ze}Unexpected data type (${typeof o})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){q("iFrameResize()","iframeResize()","","parent"),$e(...e)}),$e}));
21
21
  //# sourceMappingURL=iframeResizer.js.map
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (parent) 5.4.5-beta.12 (umd) - 2025-04-15
4
+ * @module iframe-resizer/legacy (parent) 5.4.5-beta.13 (umd) - 2025-04-15
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -17,5 +17,5 @@
17
17
  */
18
18
 
19
19
 
20
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,(function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="font-weight: normal;",t=e+"font-style: italic;",n="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),o={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},a=Object.assign(console);const{fromEntries:s,keys:l}=Object,c=e=>[e,a[e]],d=e=>t=>[t,function(n){e[t]=n}],u=(e,t)=>s(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",h=f?"color: #E3E3E3;":"color: #1F1F1F;",m="5.4.5-beta.12",g="iframeResizer",y="[iFrameSizer]",w=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),b="onload",v="init",z=Object.freeze({[b]:1,[v]:1}),$="expanded",j="collapsed",k=Object.freeze({[$]:1,[j]:1}),T=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),x=e=>e,E=(M=function(s={}){const l={},f={},p=[],h={...o,expand:!s.collapsed||o.expanded,...s};let m="";function g(){p.length=0,m=""}function y(){delete h.event,g()}const w=()=>!!p.some((([e])=>e in i))||!!h.expand;function b(){if(0!==p.length){a[w()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?m:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)a.assert(e in a,`Unknown console method: ${e}`),e in a&&a[e](...t);a.groupEnd(),y()}else y()}function v(){""===m&&(m=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function z(e,...t){0===p.length&&(v(),queueMicrotask((()=>queueMicrotask(b)))),p.push([e,...t])}function $(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...u(h,d(h)),...u(console,(e=>[e,(...t)=>z(e,...t)])),...u(r,c),assert:function(e,...t){e||z("assert",e,...t)},count:function(e=n){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=n){delete f[e]},endAutoGroup:b,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e)}return n},event:function(e){v(),h.event=e},purge:g,time:function(e=n){v(),l[e]=performance.now()},timeEnd:function(e=n){$(e),delete l[e]},timeLog:$,touch:v}},M?.__esModule?M.default:M);var M;let R={},O=!1;const I=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const S=e=>(t,...n)=>R[t]?.console[e](...n),C=(A="log",(e,...t)=>!0===(e=>R[e]?R[e].log:O)(e)?S(A)(e,...t):null);var A;const W=C,F=S("warn"),L=S("error"),N=S("event"),P=S("purge"),H=S("errorBoundary");const B=(e,...t)=>R[e]?R[e].console.warn(T(x)(...t)):queueMicrotask((()=>console?.warn(T((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t)))),D=(e=>(t,n="renamed to")=>(i,o,r="",a="")=>e(a,`<rb>Deprecated ${t}(${i.replace("()","")})</>\n\nThe <b>${i}</> ${t.toLowerCase()} has been ${n} <b>${o}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(B),q=D("Function"),U=D("Option"),J=(e,t,n,i)=>e.addEventListener(t,n,i||!1),V=(e,t,n)=>e.removeEventListener(t,n,!1),Z=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let i,o=0;o<e.length;o++)i=e.codePointAt(o),t=Math.imul(t^i,2246822519),n=Math.imul(n^i,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},G=e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),X=["<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."],Y=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],_=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),Q=e=>G(X[e]),K=e=>{const t=e[G("spjluzl")];if(!t)return-1;const n=t.split("-");let i=function(e=""){let t=-2;const n=Z(G(e));return n in _&&(t=_[n]),t}(n[0]);return 0===i||(e=>e[2]===Z(e[0]+e[1]))(n)||(i=-2),i},ee={},te=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof ee[e.id].onInit&&(U("init()","onReady()","",e.id),ee[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),ne={position:null,version:m};function ie(e){function t(){ue(T),ce(x),$("onResized",T)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function i(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const o=e=>k.slice(k.indexOf(":")+7+e);const r=(e,t)=>(n,i)=>{const o={};var r,a;r=function(){pe(`${n} (${e})`,`${e}:${t()}`,i)},o[a=i]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},a=(e,t)=>()=>{let n=!1;const i=t=>()=>{ee[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame((()=>{n=!1}))):s()},o=i("scroll"),r=i("resize window");function a(e,n){C(l,`${e}listeners for send${t}`),n(window,"scroll",o),n(window,"resize",r)}function s(){N(l,`stop${t}`),a("Remove ",V),c.disconnect(),d.disconnect(),V(ee[l].iframe,"load",s)}const l=x,c=new ResizeObserver(i("pageObserver")),d=new ResizeObserver(i("iframeObserver"));ee[l]&&(ee[l][`stop${t}`]=s,J(ee[l].iframe,"load",s),a("Add ",J),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(ee[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},s=e=>()=>{e in ee[x]&&(ee[x][e](),delete ee[x][e])},l=r("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=T.iframe.getBoundingClientRect(),{scrollY:n,scrollX:i,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:i,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),c=r("parentInfo",(function(){const{iframe:e}=T,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),d=a(l,"PageInfo"),u=a(c,"ParentInfo"),f=s("stopPageInfo"),g=s("stopParentInfo");function w(e){const t=e.getBoundingClientRect();return se(x),{x:Number(t.left)+Number(ne.position.x),y:Number(t.top)+Number(ne.position.y)}}function b(e){const t=e?w(T.iframe):{x:0,y:0};W(x,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,h,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(T,t),i=window.parentIframe||window.parentIFrame;i?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(i,n):function(e){ne.position=e,v(x)}(n)}function v(e){const{x:t,y:n}=ne.position,i=ee[e]?.iframe;!1!==$("onScroll",{iframe:i,top:n,left:t,x:t,y:n})?ce(e):le()}function z(e){let t={};if(0===T.width&&0===T.height){const e=o(9).split(":");t={x:e[1],y:e[0]}}else t={x:T.width,y:T.height};$(e,{iframe:T.iframe,screenX:Number(t.x),screenY:Number(t.y),type:T.type})}const $=(e,t)=>oe(x,e,t);function j(){const{height:e,iframe:n,msg:i,type:r,width:a}=T;switch(ee[x]?.firstRun&&ee[x]&&(ee[x].firstRun=!1),r){case"close":ae(n);break;case"message":l=o(6),C(x,`onMessage passed: {iframe: %c${T.iframe.id}%c, message: %c${l}%c}`,p,h,p,h),$("onMessage",{iframe:T.iframe,message:JSON.parse(l)});break;case"mouseenter":z("onMouseEnter");break;case"mouseleave":z("onMouseLeave");break;case"autoResize":ee[x].autoResize=JSON.parse(o(9));break;case"scrollBy":!function(){const e=T.width,t=T.height,n=window.parentIframe||window.parentIFrame||window;W(x,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),n.scrollBy(e,t)}();break;case"scrollTo":b(!1);break;case"scrollToOffset":b(!0);break;case"pageInfo":d();break;case"parentInfo":u();break;case"pageInfoStop":f();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let i=document.getElementById(n)||document.getElementsByName(n)[0];i?function(){const e=w(i);W(x,`Moving to in page link: %c#${t}`,p),ne.position={x:e.x,y:e.y},v(x),window.location.hash=t}():window.top!==window.self?function(){const e=window.parentIframe||window.parentIFrame;e?e.moveToAnchor(t):C(x,`In page link #${t} not found and window.parentIframe not found`)}():C(x,`In page link #${t} not found`)}(o(9));break;case"title":!function(e,t){ee[t]?.syncTitle&&(ee[t].iframe.title=e,W(t,`Set iframe title attribute: %c${e}`,p))}(i,x);break;case"reset":de(T);break;case"init":t(),function(e){try{ee[e].sameOrigin=!!ee[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){ee[e].sameOrigin=!1}C(e,`sameOrigin: %c${ee[e].sameOrigin}`,p)}(x),(s=i)!==m&&(void 0!==s?C(x,`Version mismatch (Child: %c${s}%c !== Parent: %c${m})`,p,h,p):B(x,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),ge=!0,$("onReady",n);break;default:if(0===a&&0===e)return void F(x,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===a||0===e)return void C(x,"Ignoring message with 0 height or width");if(document.hidden)return void C(x,"Page hidden - ignored resize request");t()}var s,l}let k=e.data,T={},x=null;"[iFrameResizerChild]Ready"!==k?y===`${k}`.slice(0,13)&&k.slice(13).split(":")[0]in ee?(T=function(){const e=k.slice(13).split(":"),t=e[1]?Number(e[1]):0,o=ee[e[0]]?.iframe,r=getComputedStyle(o);return{iframe:o,id:e[0],height:t+n(r)+i(r),width:Number(e[2]),type:e[3],msg:e[4]}}(),x=T.id,x?(N(x,T.type),H(x,(function(){!function(e){if(!ee[e])throw new Error(`${T.type} No settings for ${e}. Message was: ${k}`)}(x),function(){const e=T.type in{true:1,false:1,undefined:1};return e&&C(x,"Ignoring init message from meta parent page"),e}()||(C(x,`Received: %c${k}`,p),ee[x].loaded=!0,(null!==T.iframe||(F(x,`The iframe (${T.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let i=ee[x]?.checkOrigin;if(i&&"null"!=`${t}`&&!(i.constructor===Array?function(){let e=0,n=!1;for(C(x,`Checking connection is from allowed list of origins: %c${i}`,p);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():function(){const e=ee[x]?.remoteHost;return C(x,`Checking connection is from: %c${e}`,p),t===e}()))throw new Error(`Unexpected message received from: ${t} for ${T.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&j())}))()):F("","iframeResizer received messageData without id, message was: ",k)):null!==x&&C(x,"Ignored:",k):Object.keys(ee).forEach((e=>{ee[e].mode>=0&&pe("iFrame requested init",he(e),e)}))}function oe(e,t,n){let i=null,o=null;if(ee[e]){if(i=ee[e][t],"function"!=typeof i)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onClose"===t||"onScroll"===t)try{o=i(n)}catch(n){console.error(n),F(e,`Error in ${t} callback`)}else setTimeout((()=>i(n)))}return o}function re(e){const{id:t}=e;C(t,"Disconnected from iframe"),delete ee[t],delete e.iframeResizer}function ae(e){const{id:t}=e;if(!1!==oe(t,"onClose",t)){C(t,`Removing iFrame: %c${t}`,p);try{e.parentNode&&e.remove()}catch(e){F(t,e)}oe(t,"onClosed",t),re(e)}else C(t,"Close iframe cancelled by onClose event")}function se(e){null===ne.position&&(ne.position={x:window.scrollX,y:window.scrollY},C(e,`Get page position: %c${ne.position.x}%c, %c${ne.position.y}`,p,h,p))}function le(){ne.position=null}function ce(e){null!==ne.position&&(window.scrollTo(ne.position.x,ne.position.y),W(e,`Set page position: %c${ne.position.x}%c, %c${ne.position.y}`,p,h,p),le())}function de(e){C(e.id,"Size reset requested by "+("init"===e.type?"parent page":"child page")),se(e.id),ue(e),pe("reset","reset",e.id)}function ue(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i,W(n,`Set ${t}: %c${i}`,p)}const{id:n}=e,{sizeHeight:i,sizeWidth:o}=ee[n];i&&t("height"),o&&t("width")}R=ee;const fe=e=>e.split(":").filter(((e,t)=>19!==t)).join(":");function pe(e,t,n,i){function o(i){const o=e in z?fe(t):t;W(n,i,p,h,p),W(n,`Message data: %c${o}`,p)}N(n,e),ee[n]&&(ee[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:i,sameOrigin:r,targetOrigin:a}=ee[n];if(r)try{return e.contentWindow.iframeChildListener(y+t),void o(`Sending message to iframe %c${n}%c via sameOrigin`)}catch(e){C(n,"Same domain connection failed. Trying cross domain%c")}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${a}`),i.postMessage(y+t,a)}():F(n,`Iframe(${n}) not found`),i&&ee[n]?.warningTimeout&&(ee[n].msgTimeout=setTimeout((function(){if(void 0===ee[n])return;const{iframe:e,loaded:t,loadErrorShown:i,waitForLoad:o}=ee[n],{sandbox:r}=e,a="object"==typeof r&&r.length>0;t||i||(ee[n].loadErrorShown=!0,B(n,`<rb>No response from iFrame</>\n \nThe iframe (<i>${n}</>) has not responded within ${ee[n].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"} \n${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"}This message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`))}),ee[n].warningTimeout)))}function he(e){const t=ee[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,ne.version,t.mode,"",t.logExpand].join(":")}let me=0,ge=!1,ye=!1;const we=t=>n=>{function i(){if(ee[u]){const{iframe:e}=ee[u],t={close:ae.bind(null,e),disconnect:re.bind(null,e),removeListeners(){B(u,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:pe.bind(null,"Window resize","resize",u),moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${i=t,i.charAt(0).toUpperCase()+i.slice(1)}`);var i})(e,"string","moveToAnchor(anchor) anchor"),pe("Move to anchor",`moveToAnchor:${e}`,u)},sendMessage(e){pe("message",`message:${e=JSON.stringify(e)}`,u)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e){const{id:t}=n,{mode:i,waitForLoad:o}=ee[t];-1!==i&&-2!==i&&(J(n,"load",(function(){pe(b,`${e}:${ge}`,t,!0),function(){const e=ee[u]?.firstRun,t=ee[u]?.heightCalculationMethod in w;!e&&t&&de({iframe:n,height:0,width:0,type:"init"})}()})),!1===o&&pe(v,`${e}:${ge}`,t,!0))}function r(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&B(u,'<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e):{}}function a(){const{mode:n}=ee[u];if(n<0)throw B("Parent",`${Q(n+2)}${Q(2)}`),P(u),Q(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");ye||n>0&&t.vInfoDisable||(ye=!0,function(t,n){queueMicrotask((()=>console.info(`%ciframe-resizer ${t}`,O||n<1?"font-weight: bold;":e)))}(`v${m} (${(e=>G(Y[e]))(n)})`,n)),n<1&&B("Parent",Q(3))}function s(e){const t=ee[e]?.iframe?.title;return""===t||void 0===t}const l=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function c(e){var t,i;ee[u]={...ee[u],iframe:n,firstRun:!0,remoteHost:n?.src.split("/").slice(0,3).join("/"),...te,...r(e),mouseEvents:l(e),mode:K(e),syncTitle:s(u)},N(u,"setup"),function(){const{direction:e}=ee[u];if("horizontal"===e)return ee[u].sizeWidth=!0,ee[u].sizeHeight=!1,void C(u,"Direction: %chorizontal",p);if("none"===e)return ee[u].sizeWidth=!1,ee[u].sizeHeight=!1,ee[u].autoResize=!1,void C(u,"Direction: %cnone",p);if("vertical"!==e)throw new TypeError(u,`Direction value of "${e}" is not valid`);C(u,"Direction: %cvertical",p)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===ee[u].direction?(ee[u].offsetHeight=t,C(u,`Offset height: %c${t}`,p)):(ee[u].offsetWidth=t,C(u,`Offset width: %c${t}`,p))),e?.offset&&B(u,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>."),null===ee[u].postMessageTarget&&(ee[u].postMessageTarget=n.contentWindow),ee[u].targetOrigin=!0===ee[u].checkOrigin?""===(i=ee[u].remoteHost)||null!==i.match(/^(about:blank|javascript:|file:\/\/)/)?"*":i:"*"}const d=()=>"iframeResizer"in n,u=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=t?.id||te.id+me++;return null!==document.getElementById(e)&&(e+=me++),e}(),n.id=e,C(e,`Added missing iframe ID: ${e} (${n.src})`)),e}(n.id);if("object"!=typeof t)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=$,e.logExpand=!t.includes("ifrlog=collapsed"))}(t),function(e,t){const n=Object.hasOwn(t,"log"),i="string"==typeof t.log,o=n?!!i||t.log:te.log;Object.hasOwn(t,"logExpand")||(t.logExpand=n&&i?t.log===$:te.logExpand),function(e){-1===e?.log&&(e.log=!1,e.vInfoDisable=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const i=E({expand:t,label:I(n)});O=e,R[n]||(R[n]={console:i})}({enabled:o,expand:t.logExpand,iframeId:e}),i&&!(t.log in k)&&L(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=o}(u,t),H(u,(function(e){d()?F(u,`Ignored iframe (${u}), already setup.`):(c(e),a(),ve(),function(){switch(C(u,`Iframe scrolling ${ee[u]?.scrolling?"enabled":"disabled"} for ${u}`),n.style.overflow=!1===ee[u]?.scrolling?"hidden":"auto",ee[u]?.scrolling){case"omit":break;case!0:n.scrolling="yes";break;case!1:n.scrolling="no";break;default:n.scrolling=ee[u]?ee[u].scrolling:"no"}}(),function(){const{bodyMargin:e}=ee[u];"number"!=typeof e&&"0"!==e||(ee[u].bodyMargin=`${e}px`)}(),o(he(u)),i(),C(u,"Setup complete"))}))(t),n?.iFrameResizer};function be(){!1===document.hidden&&(C("document","Trigger event: Visibility change"),function(e,t){const n=e=>ee[e]?.autoResize&&!ee[e]?.firstRun;Object.keys(ee).forEach((function(i){n(i)&&pe(e,t,i)}))}("Tab Visible","resize"))}const ve=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{J(window,"message",ie),J(document,"visibilitychange",be),window.iframeParentListener=e=>setTimeout((()=>ie({data:e,sameOrigin:!0})))})),ze=`[${g}] `;const $e=function(){function e(e){switch(!0){case!e:throw new TypeError(`${ze}iframe is not defined`);case!e.tagName:throw new TypeError(`${ze}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${ze}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(i,o){if("undefined"==typeof window)return[];switch(t=we(i),n=[],typeof o){case"undefined":case"string":document.querySelectorAll(o||"iframe").forEach(e);break;case"object":e(o);break;default:throw new TypeError(`${ze}Unexpected data type (${typeof o})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){q("iFrameResize()","iframeResize()","","parent"),$e(...e)}),$e}));
20
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,(function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="font-weight: normal;",t=e+"font-style: italic;",n="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),o={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},a=Object.assign(console);const{fromEntries:s,keys:l}=Object,c=e=>[e,a[e]],d=e=>t=>[t,function(n){e[t]=n}],u=(e,t)=>s(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",h=f?"color: #E3E3E3;":"color: #1F1F1F;",m="5.4.5-beta.13",g="iframeResizer",y="[iFrameSizer]",w=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),b="onload",v="init",z=Object.freeze({[b]:1,[v]:1}),$="expanded",j="collapsed",k=Object.freeze({[$]:1,[j]:1}),T=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),x=e=>e,E=(M=function(s={}){const l={},f={},p=[],h={...o,expand:!s.collapsed||o.expanded,...s};let m="";function g(){p.length=0,m=""}function y(){delete h.event,g()}const w=()=>!!p.some((([e])=>e in i))||!!h.expand;function b(){if(0!==p.length){a[w()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?m:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)a.assert(e in a,`Unknown console method: ${e}`),e in a&&a[e](...t);a.groupEnd(),y()}else y()}function v(){""===m&&(m=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function z(e,...t){0===p.length&&(v(),queueMicrotask((()=>queueMicrotask(b)))),p.push([e,...t])}function $(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...u(h,d(h)),...u(console,(e=>[e,(...t)=>z(e,...t)])),...u(r,c),assert:function(e,...t){e||z("assert",e,...t)},count:function(e=n){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=n){delete f[e]},endAutoGroup:b,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e)}return n},event:function(e){v(),h.event=e},purge:g,time:function(e=n){v(),l[e]=performance.now()},timeEnd:function(e=n){$(e),delete l[e]},timeLog:$,touch:v}},M?.__esModule?M.default:M);var M;let R={},O=!1;const I=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const S=e=>(t,...n)=>R[t]?.console[e](...n),C=(A="log",(e,...t)=>!0===(e=>R[e]?R[e].log:O)(e)?S(A)(e,...t):null);var A;const W=C,F=S("warn"),L=S("error"),N=S("event"),P=S("purge"),H=S("errorBoundary");const B=(e,...t)=>R[e]?R[e].console.warn(T(x)(...t)):queueMicrotask((()=>console?.warn(T((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t)))),D=(e=>(t,n="renamed to")=>(i,o,r="",a="")=>e(a,`<rb>Deprecated ${t}(${i.replace("()","")})</>\n\nThe <b>${i}</> ${t.toLowerCase()} has been ${n} <b>${o}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(B),q=D("Function"),U=D("Option"),J=(e,t,n,i)=>e.addEventListener(t,n,i||!1),V=(e,t,n)=>e.removeEventListener(t,n,!1),Z=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let i,o=0;o<e.length;o++)i=e.codePointAt(o),t=Math.imul(t^i,2246822519),n=Math.imul(n^i,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},G=e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),X=["<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."],Y=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],_=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),Q=e=>G(X[e]),K=e=>{const t=e[G("spjluzl")];if(!t)return-1;const n=t.split("-");let i=function(e=""){let t=-2;const n=Z(G(e));return n in _&&(t=_[n]),t}(n[0]);return 0===i||(e=>e[2]===Z(e[0]+e[1]))(n)||(i=-2),i},ee={},te=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof ee[e.id].onInit&&(U("init()","onReady()","",e.id),ee[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),ne={position:null,version:m};function ie(e){function t(){ue(T),ce(x),$("onResized",T)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function i(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const o=e=>k.slice(k.indexOf(":")+7+e);const r=(e,t)=>(n,i)=>{const o={};var r,a;r=function(){pe(`${n} (${e})`,`${e}:${t()}`,i)},o[a=i]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},a=(e,t)=>()=>{let n=!1;const i=t=>()=>{ee[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame((()=>{n=!1}))):s()},o=i("scroll"),r=i("resize window");function a(e,n){C(l,`${e}listeners for send${t}`),n(window,"scroll",o),n(window,"resize",r)}function s(){N(l,`stop${t}`),a("Remove ",V),c.disconnect(),d.disconnect(),V(ee[l].iframe,"load",s)}const l=x,c=new ResizeObserver(i("pageObserver")),d=new ResizeObserver(i("iframeObserver"));ee[l]&&(ee[l][`stop${t}`]=s,J(ee[l].iframe,"load",s),a("Add ",J),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(ee[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},s=e=>()=>{e in ee[x]&&(ee[x][e](),delete ee[x][e])},l=r("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=T.iframe.getBoundingClientRect(),{scrollY:n,scrollX:i,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:i,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),c=r("parentInfo",(function(){const{iframe:e}=T,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),d=a(l,"PageInfo"),u=a(c,"ParentInfo"),f=s("stopPageInfo"),g=s("stopParentInfo");function w(e){const t=e.getBoundingClientRect();return se(x),{x:Number(t.left)+Number(ne.position.x),y:Number(t.top)+Number(ne.position.y)}}function b(e){const t=e?w(T.iframe):{x:0,y:0};W(x,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,h,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(T,t),i=window.parentIframe||window.parentIFrame;i?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(i,n):function(e){ne.position=e,v(x)}(n)}function v(e){const{x:t,y:n}=ne.position,i=ee[e]?.iframe;!1!==$("onScroll",{iframe:i,top:n,left:t,x:t,y:n})?ce(e):le()}function z(e){let t={};if(0===T.width&&0===T.height){const e=o(9).split(":");t={x:e[1],y:e[0]}}else t={x:T.width,y:T.height};$(e,{iframe:T.iframe,screenX:Number(t.x),screenY:Number(t.y),type:T.type})}const $=(e,t)=>oe(x,e,t);function j(){const{height:e,iframe:n,msg:i,type:r,width:a}=T;switch(ee[x]?.firstRun&&ee[x]&&(ee[x].firstRun=!1),r){case"close":ae(n);break;case"message":l=o(6),C(x,`onMessage passed: {iframe: %c${T.iframe.id}%c, message: %c${l}%c}`,p,h,p,h),$("onMessage",{iframe:T.iframe,message:JSON.parse(l)});break;case"mouseenter":z("onMouseEnter");break;case"mouseleave":z("onMouseLeave");break;case"autoResize":ee[x].autoResize=JSON.parse(o(9));break;case"scrollBy":!function(){const e=T.width,t=T.height,n=window.parentIframe||window.parentIFrame||window;W(x,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),n.scrollBy(e,t)}();break;case"scrollTo":b(!1);break;case"scrollToOffset":b(!0);break;case"pageInfo":d();break;case"parentInfo":u();break;case"pageInfoStop":f();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let i=document.getElementById(n)||document.getElementsByName(n)[0];i?function(){const e=w(i);W(x,`Moving to in page link: %c#${t}`,p),ne.position={x:e.x,y:e.y},v(x),window.location.hash=t}():window.top!==window.self?function(){const e=window.parentIframe||window.parentIFrame;e?e.moveToAnchor(t):C(x,`In page link #${t} not found and window.parentIframe not found`)}():C(x,`In page link #${t} not found`)}(o(9));break;case"title":!function(e,t){ee[t]?.syncTitle&&(ee[t].iframe.title=e,W(t,`Set iframe title attribute: %c${e}`,p))}(i,x);break;case"reset":de(T);break;case"init":t(),function(e){try{ee[e].sameOrigin=!!ee[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){ee[e].sameOrigin=!1}C(e,`sameOrigin: %c${ee[e].sameOrigin}`,p)}(x),(s=i)!==m&&(void 0!==s?C(x,`Version mismatch (Child: %c${s}%c !== Parent: %c${m})`,p,h,p):B(x,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),ge=!0,$("onReady",n);break;default:if(0===a&&0===e)return void F(x,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===a||0===e)return void C(x,"Ignoring message with 0 height or width");if(document.hidden)return void C(x,"Page hidden - ignored resize request");t()}var s,l}let k=e.data,T={},x=null;"[iFrameResizerChild]Ready"!==k?y===`${k}`.slice(0,13)&&k.slice(13).split(":")[0]in ee?(T=function(){const e=k.slice(13).split(":"),t=e[1]?Number(e[1]):0,o=ee[e[0]]?.iframe,r=getComputedStyle(o);return{iframe:o,id:e[0],height:t+n(r)+i(r),width:Number(e[2]),type:e[3],msg:e[4]}}(),x=T.id,x?(N(x,T.type),H(x,(function(){!function(e){if(!ee[e])throw new Error(`${T.type} No settings for ${e}. Message was: ${k}`)}(x),function(){const e=T.type in{true:1,false:1,undefined:1};return e&&C(x,"Ignoring init message from meta parent page"),e}()||(C(x,`Received: %c${k}`,p),ee[x].loaded=!0,(null!==T.iframe||(F(x,`The iframe (${T.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let i=ee[x]?.checkOrigin;if(i&&"null"!=`${t}`&&!(i.constructor===Array?function(){let e=0,n=!1;for(C(x,`Checking connection is from allowed list of origins: %c${i}`,p);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():function(){const e=ee[x]?.remoteHost;return C(x,`Checking connection is from: %c${e}`,p),t===e}()))throw new Error(`Unexpected message received from: ${t} for ${T.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&j())}))()):F("","iframeResizer received messageData without id, message was: ",k)):null!==x&&C(x,"Ignored:",k):Object.keys(ee).forEach((e=>{ee[e].mode>=0&&pe("iFrame requested init",he(e),e)}))}function oe(e,t,n){let i=null,o=null;if(ee[e]){if(i=ee[e][t],"function"!=typeof i)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onClose"===t||"onScroll"===t)try{o=i(n)}catch(n){console.error(n),F(e,`Error in ${t} callback`)}else setTimeout((()=>i(n)))}return o}function re(e){const{id:t}=e;C(t,"Disconnected from iframe"),delete ee[t],delete e.iframeResizer}function ae(e){const{id:t}=e;if(!1!==oe(t,"onClose",t)){C(t,`Removing iFrame: %c${t}`,p);try{e.parentNode&&e.remove()}catch(e){F(t,e)}oe(t,"onClosed",t),re(e)}else C(t,"Close iframe cancelled by onClose event")}function se(e){null===ne.position&&(ne.position={x:window.scrollX,y:window.scrollY},C(e,`Get page position: %c${ne.position.x}%c, %c${ne.position.y}`,p,h,p))}function le(){ne.position=null}function ce(e){null!==ne.position&&(window.scrollTo(ne.position.x,ne.position.y),W(e,`Set page position: %c${ne.position.x}%c, %c${ne.position.y}`,p,h,p),le())}function de(e){C(e.id,"Size reset requested by "+("init"===e.type?"parent page":"child page")),se(e.id),ue(e),pe("reset","reset",e.id)}function ue(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i,W(n,`Set ${t}: %c${i}`,p)}const{id:n}=e,{sizeHeight:i,sizeWidth:o}=ee[n];i&&t("height"),o&&t("width")}R=ee;const fe=e=>e.split(":").filter(((e,t)=>19!==t)).join(":");function pe(e,t,n,i){function o(i){const o=e in z?fe(t):t;W(n,i,p,h,p),W(n,`Message data: %c${o}`,p)}N(n,e),ee[n]&&(ee[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:i,sameOrigin:r,targetOrigin:a}=ee[n];if(r)try{return e.contentWindow.iframeChildListener(y+t),void o(`Sending message to iframe %c${n}%c via sameOrigin`)}catch(e){C(n,"Same domain connection failed. Trying cross domain%c")}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${a}`),i.postMessage(y+t,a)}():F(n,`Iframe(${n}) not found`),i&&ee[n]?.warningTimeout&&(ee[n].msgTimeout=setTimeout((function(){if(void 0===ee[n])return;const{iframe:e,loaded:t,loadErrorShown:i,waitForLoad:o}=ee[n],{sandbox:r}=e,a="object"==typeof r&&r.length>0;t||i||(ee[n].loadErrorShown=!0,B(n,`<rb>No response from iFrame</>\n \nThe iframe (<i>${n}</>) has not responded within ${ee[n].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"} \n${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"}This message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`))}),ee[n].warningTimeout)))}function he(e){const t=ee[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,ne.version,t.mode,"",t.logExpand].join(":")}let me=0,ge=!1,ye=!1;const we=t=>n=>{function i(){if(ee[u]){const{iframe:e}=ee[u],t={close:ae.bind(null,e),disconnect:re.bind(null,e),removeListeners(){B(u,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:pe.bind(null,"Window resize","resize",u),moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${i=t,i.charAt(0).toUpperCase()+i.slice(1)}`);var i})(e,"string","moveToAnchor(anchor) anchor"),pe("Move to anchor",`moveToAnchor:${e}`,u)},sendMessage(e){pe("message",`message:${e=JSON.stringify(e)}`,u)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e){const{id:t}=n,{mode:i,waitForLoad:o}=ee[t];-1!==i&&-2!==i&&(J(n,"load",(function(){pe(b,`${e}:${ge}`,t,!0),function(){const e=ee[u]?.firstRun,t=ee[u]?.heightCalculationMethod in w;!e&&t&&de({iframe:n,height:0,width:0,type:"init"})}()})),!1===o&&pe(v,`${e}:${ge}`,t,!0))}function r(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&B(u,'<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e):{}}function a(){const{mode:n}=ee[u];if(n<0)throw B("Parent",`${Q(n+2)}${Q(2)}`),P(u),Q(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");ye||n>0&&t.vInfoDisable||(ye=!0,function(t,n){queueMicrotask((()=>console.info(`%ciframe-resizer ${t}`,O||n<1?"font-weight: bold;":e)))}(`v${m} (${(e=>G(Y[e]))(n)})`,n)),n<1&&B("Parent",Q(3))}function s(e){const t=ee[e]?.iframe?.title;return""===t||void 0===t}const l=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function c(e){var t,i;ee[u]={...ee[u],iframe:n,firstRun:!0,remoteHost:n?.src.split("/").slice(0,3).join("/"),...te,...r(e),mouseEvents:l(e),mode:K(e),syncTitle:s(u)},N(u,"setup"),function(){const{direction:e}=ee[u];if("horizontal"===e)return ee[u].sizeWidth=!0,ee[u].sizeHeight=!1,void C(u,"Direction: %chorizontal",p);if("none"===e)return ee[u].sizeWidth=!1,ee[u].sizeHeight=!1,ee[u].autoResize=!1,void C(u,"Direction: %cnone",p);if("vertical"!==e)throw new TypeError(u,`Direction value of "${e}" is not valid`);C(u,"Direction: %cvertical",p)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===ee[u].direction?(ee[u].offsetHeight=t,C(u,`Offset height: %c${t}`,p)):(ee[u].offsetWidth=t,C(u,`Offset width: %c${t}`,p))),e?.offset&&B(u,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>."),null===ee[u].postMessageTarget&&(ee[u].postMessageTarget=n.contentWindow),ee[u].targetOrigin=!0===ee[u].checkOrigin?""===(i=ee[u].remoteHost)||null!==i.match(/^(about:blank|javascript:|file:\/\/)/)?"*":i:"*"}const d=()=>"iframeResizer"in n,u=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=t?.id||te.id+me++;return null!==document.getElementById(e)&&(e+=me++),e}(),n.id=e,C(e,`Added missing iframe ID: ${e} (${n.src})`)),e}(n.id);if("object"!=typeof t)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=$,e.logExpand=!t.includes("ifrlog=collapsed"))}(t),function(e,t){const n=Object.hasOwn(t,"log"),i="string"==typeof t.log,o=n?!!i||t.log:te.log;Object.hasOwn(t,"logExpand")||(t.logExpand=n&&i?t.log===$:te.logExpand),function(e){-1===e?.log&&(e.log=!1,e.vInfoDisable=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const i=E({expand:t,label:I(n)});O=e,R[n]||(R[n]={console:i})}({enabled:o,expand:t.logExpand,iframeId:e}),i&&!(t.log in k)&&L(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=o}(u,t),H(u,(function(e){d()?F(u,`Ignored iframe (${u}), already setup.`):(c(e),a(),ve(),function(){switch(C(u,`Iframe scrolling ${ee[u]?.scrolling?"enabled":"disabled"} for ${u}`),n.style.overflow=!1===ee[u]?.scrolling?"hidden":"auto",ee[u]?.scrolling){case"omit":break;case!0:n.scrolling="yes";break;case!1:n.scrolling="no";break;default:n.scrolling=ee[u]?ee[u].scrolling:"no"}}(),function(){const{bodyMargin:e}=ee[u];"number"!=typeof e&&"0"!==e||(ee[u].bodyMargin=`${e}px`)}(),o(he(u)),i(),C(u,"Setup complete"))}))(t),n?.iFrameResizer};function be(){!1===document.hidden&&(C("document","Trigger event: Visibility change"),function(e,t){const n=e=>ee[e]?.autoResize&&!ee[e]?.firstRun;Object.keys(ee).forEach((function(i){n(i)&&pe(e,t,i)}))}("Tab Visible","resize"))}const ve=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{J(window,"message",ie),J(document,"visibilitychange",be),window.iframeParentListener=e=>setTimeout((()=>ie({data:e,sameOrigin:!0})))})),ze=`[${g}] `;const $e=function(){function e(e){switch(!0){case!e:throw new TypeError(`${ze}iframe is not defined`);case!e.tagName:throw new TypeError(`${ze}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${ze}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(i,o){if("undefined"==typeof window)return[];switch(t=we(i),n=[],typeof o){case"undefined":case"string":document.querySelectorAll(o||"iframe").forEach(e);break;case"object":e(o);break;default:throw new TypeError(`${ze}Unexpected data type (${typeof o})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){q("iFrameResize()","iframeResize()","","parent"),$e(...e)}),$e}));
21
21
  //# sourceMappingURL=iframeResizer.min.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iframe-resizer",
3
- "version": "5.4.5-beta.12",
3
+ "version": "5.4.5-beta.13",
4
4
  "license": "GPL-3.0",
5
5
  "homepage": "https://iframe-resizer.com",
6
6
  "author": {
@@ -38,8 +38,8 @@
38
38
  "legacy"
39
39
  ],
40
40
  "dependencies": {
41
- "@iframe-resizer/child": "5.4.5-beta.12",
42
- "@iframe-resizer/jquery": "5.4.5-beta.12",
43
- "@iframe-resizer/parent": "5.4.5-beta.12"
41
+ "@iframe-resizer/child": "5.4.5-beta.13",
42
+ "@iframe-resizer/jquery": "5.4.5-beta.13",
43
+ "@iframe-resizer/parent": "5.4.5-beta.13"
44
44
  }
45
45
  }