iframe-resizer 5.5.6 → 5.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy 5.5.6 (cjs) - 2025-09-10
4
+ * @module iframe-resizer/legacy 5.5.7 (cjs) - 2025-09-23
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.5.6 (esm) - 2025-09-10
4
+ * @module iframe-resizer/legacy 5.5.7 (esm) - 2025-09-23
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.5.6 (iife)
4
+ * @module iframe-resizer/legacy (child) 5.5.7 (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,4 +17,4 @@
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:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0},c=Object.assign(console);const{fromEntries:l,keys:u}=Object,d=e=>[e,c[e]],f=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(u(e).map(t));const p=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,h=p?"color: #A9C7FB;":"color: #135CD2;",g=p?"color: #E3E3E3;":"color: #1F1F1F;",y="5.5.6",b="iframeResizer",v="beforeUnload",w="init",z="message",$="pageInfo",S="parentInfo",O="scrollToOffset",E="title",M=10,k="data-iframe-size",j="data-iframe-overflowed",x="data-iframe-ignore",T="height",A="width",C="readystatechange",I="bottom",N="right",P="autoResizeEnabled",R=Symbol("sizeChanged"),B="manualResize",q="parentResize",L={[B]:1,[q]:1},D="setOffsetSize",F="resizeObserver",W="overflowObserver",V="mutationObserver",H="visibilityObserver",U="[iFrameSizer]",Z=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),J=(e,t,n,o)=>e.addEventListener(t,n,o||!1),_=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},Q=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),G=["spjluzl","rlf","clyzpvu"],Y=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],X=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],K=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),ee=e=>Q(Y[e]);var te=e=>{const t=e[Q(G[0])]||e[Q(G[1])]||e[Q(G[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=_(Q(e));return n in K&&(t=K[n]),t}(n[0]);return 0===o||(e=>e[2]===_(e[0]+e[1]))(n)||(o=-2),o};const ne=(e,...t)=>setTimeout(()=>e(...t),0),oe=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},re=e=>e,ie=e=>Math.round(1e3*e)/1e3,ae=e=>e.charAt(0).toUpperCase()+e.slice(1),se=e=>""!=`${e}`&&void 0!==e;const ce=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${ae(t)}`)};let le=!0,ue=b;const de=(fe=function(n={}){const l={},u={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function b(){delete h.event,y()}const v=()=>!!p.some(([e])=>e in i)||!!h.expand;function w(){if(0!==p.length){c[v()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?g:""}`,e,t,o);for(const[e,...t]of p)c.assert(e in c,`Unknown console method: ${e}`),e in c&&c[e](...t);c.groupEnd(),b()}else b()}function z(){""===g&&(g=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function $(e,...t){0===p.length&&(z(),queueMicrotask(()=>queueMicrotask(w))),p.push([e,...t])}function S(e=r,...t){l[e]?$("log",`${e}: ${performance.now()-l[e]} ms`,...t):$("timeLog",e,...t)}return{...m(h,f(h)),...m(console,e=>[e,(...t)=>$(e,...t)]),...m(s,d),assert:function(e,...t){!0!==e&&$("assert",e,...t)},count:function(e=r){u[e]?u[e]+=1:u[e]=1,$("log",`${e}: ${u[e]}`)},countReset:function(e=r){delete u[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;$("error",e),w()}return n},event:function(e){z(),h.event=e},purge:y,time:function(e=r){z(),l[e]=performance.now()},timeEnd:function(e=r){S(e),delete l[e]},timeLog:S,touch:z}},fe?.__esModule?fe.default:fe);var fe;const me=de({label:`${b}(child)`,expand:!1});var pe;const he=(pe="log",(...e)=>!le||me[pe](...e));const{assert:ge,endAutoGroup:ye,error:be,errorBoundary:ve,event:we,label:ze,purge:$e,warn:Se}=me,Oe=e=>{return me.warn((t=re,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},Ee=Oe,Me=(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)=>Oe(t)),ke=Me("Method"),je=Me("Method","replaced with"),xe=Me("Option"),Te=["min-height","min-width","max-height","max-width"],Ae=new Set,Ce=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Ie=(e,t)=>{return(n=Ce(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function Ne({href:e}){Ae.has(e)||Ae.add(e)}const Pe=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){Ne(n)}return{source:"cross-origin stylesheet",value:Ce(e,t)}}(e,t),Re=(e,t)=>{const{source:n,value:o}=Pe(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);Oe(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function Be(){for(const e of[document.documentElement,document.body])for(const t of Te)Ie(e,t)&&Re(e,t)}const qe=e=>t=>void 0===t?void 0:e(t),Le=qe(e=>"true"===e),De=qe(Number),Fe=e=>e=>{e.size},We=((e="")=>t=>n=>{n.size>0&&be(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Ve=e=>e=>{e.size},He=(t,n=!0)=>o=>{o>0&&he(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},Ue=(e,t,n,o)=>{const r=Ve(e);return e=>{const i=new Set;let a=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),i.add(o),a+=1);r(i),o(a),i.clear()}},Ze=new Set,Je=new Set,_e=new Set,Qe=[],Ge={attributes:!0,attributeFilter:[x,k],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Ye,Xe=1,Ke=!1,et=0;const tt=e=>{e.size},nt=e=>{e.size},ot=e=>{e.size},rt=e=>e.nodeType!==Node.ELEMENT_NODE||Z.has(e.tagName.toLowerCase());function it(e){const t=e.addedNodes;for(const e of t)rt(e)||Ze.add(e)}function at(e){const t=e.removedNodes;for(const e of t)rt(e)||(Ze.has(e)?(Ze.delete(e),_e.add(e)):Je.add(e))}const st=e=>{he("Mutations:",e);for(const t of e)it(t),at(t);tt(Ze),nt(Je),ot(_e),_e.clear()};const ct=e=>()=>{const t=performance.now(),n=t-et,o=16*Xe+++2;if(n>o&&n<200)return we("mutationThrottled"),he("Update delayed due to heavy workload on the callStack"),he(`EventLoop busy time: %c${ie(n)}ms %c> Max wait: %c${o-2}ms`,h,g,h),setTimeout(Ye,16*Xe),void(et=t);Xe=1,Qe.forEach(st),Qe.length=0,Ke=!1,Je.size,Ze.size,e({addedNodes:Ze,removedNodes:Je}),Ze.clear(),Je.clear()};function lt(e){Qe.push(e),Ke||(et=performance.now(),Ke=!0,requestAnimationFrame(Ye))}function ut(e){const t=new window.MutationObserver(lt),n=document.body||document.documentElement;return Ye=ct(e),t.observe(n,Ge),he("Attached MutationObserver to body"),{...t,disconnect:()=>{Ze.clear(),Je.clear(),Qe.length=0,t.disconnect(),he("Detached MutationObserver")}}}const dt="Overflow",ft=He(dt),mt=He(dt,!1),pt=Fe(dt),ht=We(dt),gt=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,yt=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||re,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(j,t);const c=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t;if(!o)continue;const i=e[n],c=a(i,o)&&!gt(r);s(r,c)}r(i)},o),l=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(l.has(r)?t.add(r):(c.observe(r),l.add(r),n.add(r),o+=1));ht(t),pt(n),ft(o),n.clear(),t.clear()},detachObservers:Ue(dt,c,l,mt),disconnect:()=>{c.disconnect(),he("Detached OverflowObserver")}}},bt="--ifr-start",vt="--ifr-end",wt="--ifr-measure",zt=[];let $t,St={},Ot=0;function Et(){try{performance.clearMarks(bt),performance.clearMarks(vt),performance.clearMeasures(wt)}catch{}}function Mt(e){e.getEntries().forEach(e=>{if(e.name===vt)try{const{duration:t}=performance.measure(wt,bt,vt);St=e.detail,zt.push(t),zt.length>100&&zt.shift()}catch{}})}function kt(){he("Attached PerformanceObserver to page");const e=new PerformanceObserver(Mt);return e.observe({entryTypes:["mark"]}),$t=setInterval(()=>{if(zt.length<10)return;if(St.hasTags&&St.len<25)return;zt.sort();const e=Math.min(zt.reduce((e,t)=>e+t,0)/zt.length,zt[Math.floor(zt.length/2)]),t=ie(e);t>Ot&&(Ot=t,we("performanceObserver")),Et(),e<=4||(clearInterval($t),Oe(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${ie(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${St.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{Et(),clearInterval($t),e.disconnect(),he("Detached PerformanceObserver")}}}const jt="Resize",xt=He(jt),Tt=He(jt,!1),At=Fe(jt),Ct=We(jt),It=new WeakSet,Nt=new Set,Pt=new Set;let Rt;function Bt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(It.has(n)?Nt.add(n):(Rt.observe(n),It.add(n),Pt.add(n),t+=1))}Ct(Nt),At(Pt),xt(t),Pt.clear(),Nt.clear()}function qt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),he("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),he("Detached VisibilityObserver")}}}const Lt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Dt=Lt("function"),Ft=Lt("number"),Wt=Lt("string");"undefined"!=typeof window&&function(){const o={height:()=>(Se("Custom height calculation function not defined"),Sn.auto()),width:()=>(Se("Custom width calculation function not defined"),On.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},i={},a="auto",s=[],c="scroll";let l,u,d,f,m,p,_,Y=!0,K="",ie=0,de="",fe="",pe=!1,Me=!0,Te=!1,Ae=!0,Ce=!1,Ie=!1,Ne=!0,Pe=!1,Re=1,qe=a,Fe="",We=!0,Ve={},He=!1,Ze=!1,Je=!1,_e=0,Qe=!1,Ge=0,Ye=0,Xe=new Set,Ke="",et="child",tt=!1,nt="",ot=[],rt=window.parent,it="*",at=0,st=!1,ct=1,lt=c,dt=window,ft=()=>{Se("onMessage function not defined")},mt=()=>{},pt=null,ht=null;function gt(e){var t;!function(e){Ke=e[0]??Ke,ie=De(e[1])??ie,Te=Le(e[2])??Te,Je=Le(e[3])??Je,Y=Le(e[6])??Y,de=e[7]??de,qe=e[8]??qe,K=e[9]??K,fe=e[10]??fe,at=De(e[11])??at,Ve.enable=Le(e[12])??!1,et=e[13]??et,lt=e[14]??lt,Qe=Le(e[15])??Qe,Ge=De(e[16])??Ge,Ye=De(e[17])??Ye,Me=Le(e[18])??Me,l=e[19]??l,p=e[20]??p,_e=De(e[21])??_e,Ze=Le(e[23])??Ze}(e),ue=(t={id:Ke,enabled:Je,expand:Ze}).id||b,me.label(`${ue}`),me.expand(t.expand),le=t.enabled,function(){function e(e){_=Dt(e,"onBeforeResize")??_,ft=Dt(e,"onMessage")??ft,mt=Dt(e,"onReady")??mt,"number"==typeof e?.offset&&(xe("offset","offsetSize"),Me&&(Ge=Ft(e,"offset")??Ge),Te&&(Ye=Ft(e,"offset")??Ye)),"number"==typeof e?.offsetSize&&(Me&&(Ge=Ft(e,"offsetSize")??Ge),Te&&(Ye=Ft(e,"offsetSize")??Ye)),u=Wt(e,Q(G[0]))??u,Fe=Wt(e,"ignoreSelector")??Fe,nt=Wt(e,"sizeSelector")??nt,it=Wt(e,"targetOrigin")??it,qe=e?.heightCalculationMethod||qe,lt=e?.widthCalculationMethod||lt}function t(e,t){return"function"==typeof e&&(Oe(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),o[t]=e,e="custom"),e}if(1===_e)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),qe=t(qe,T),lt=t(lt,A),he(`Set targetOrigin for parent: %c${it}`,h))}(),[Mt,At,Gt,Ot,xt,_t,Qt,Zt,Et,$t,pe?re:Be,Pt,tn,en,Kt,Lt,()=>Ct("background",K),()=>Ct("padding",fe),pe?re:Vt,Xt,Yt,pn,wt].forEach(e=>{try{e()}catch(e){if(_e<0)throw e;Oe("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),be(e)}}),zt(oe(mt)),An(w,"Init message from host page",void 0,void 0,`${y}:${_e}`),document.title&&""!==document.title&&Nn(0,0,E,document.title)}function wt(){J(window,v.toLowerCase(),()=>{s.forEach(e=>e()),Nn(0,0,v)})}function zt(e){"complete"===document.readyState?ne(e):J(document,C,()=>zt(e))}function $t(){ot=document.querySelectorAll(`[${k}]`),Pe=ot.length>0}let St=0;function Ot(){const n=document.querySelectorAll(`*[${x}]`);return Ce=n.length>0,Ce&&n.length!==St&&(function(n){const o=1===n.length?"":"s";Se(`%c[${x}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),St=n.length),Ce}function Et(){"BackCompat"===document.compatMode&&Oe("<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")}function Mt(){p&&""!==p&&"false"!==p?p!==y&&Oe(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${p} - Child page: ${y}.\n`):Oe("<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")}function xt(){try{tt=1===_e||"iframeParentListener"in window.parent}catch(e){}}function At(){Te===Me&&(pe=!0)}function Ct(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),he(`Set body ${e}: %c${t}`,h))}function Nt(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Pt(){Nt(0,k,nt),Nt(0,x,Fe)}function Lt(){var e,t;void 0===de&&(de=`${ie}px`),Ct("margin",(e="margin",(t=de).includes("-")&&(Se(`Negative CSS value ignored for ${e}`),t=""),t))}function Vt(){const e=e=>e.style.setProperty(T,"auto","important");e(document.documentElement),e(document.body)}function Ht(e){({add(t){function n(){An(e.eventName,e.eventType)}i[t]=n,J(window,t,n,{passive:!0})},remove(e){const t=i[e];var n,o;delete i[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function Ut(e){Ht({method:e,eventType:"After Print",eventName:"afterprint"}),Ht({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ht({method:e,eventType:"Ready State Change",eventName:C})}function Zt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(k,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&Oe("<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</>.")}function Jt(e,t,n){const{label:o}=n;return t!==e&&(e in n||(Se(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&Oe(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you ${p?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${o}CalculationMethod: 'auto',\n}\n`}\n`),e}function _t(){qe=Jt(qe,a,Sn)}function Qt(){lt=Jt(lt,c,On)}function Gt(){const t=_e,n=te({key:l}),o=te({key:u});if(_e=Math.max(n,o),_e<0){if(_e=Math.min(n,o),$e(),Oe(`${ee(_e+2)}${ee(2)}`),se(p))throw ee(_e+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!se(p)||t>-1&&_e>t)&&(sessionStorage.getItem("ifr")!==y&&function(t,n){console.info(`${ue} %ciframe-resizer ${t}`,le||n<1?"font-weight: bold;":e)}(`v${y} (${(e=>Q(X[e]))(_e)})`,_e),_e<2&&Ee(ee(3)),sessionStorage.setItem("ifr",y))}function Yt(){Ut("add"),s.push(()=>Ut("remove"))}function Xt(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Kt(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,M)+parseInt(n.x,M),y:parseInt(t.top,M)+parseInt(n.y,M)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Nn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Nn(n.y,n.x,O)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}Ve.enable&&(1===_e?Oe("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&J(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),J(window,"hashchange",n),setTimeout(n,128))),Ve={findTarget:t}}function en(){function e(e){Nn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){J(window.document,t,e)}!0===Qe&&(t("mouseenter"),t("mouseleave"))}function tn(){1!==_e&&(dt.parentIframe=Object.freeze({autoResize:e=>(ce(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Te&&!1===Me?(we(P),Oe("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===Y?(Y=!0,queueMicrotask(()=>An(P,"Auto Resize enabled"))):!1===e&&!0===Y&&(Y=!1),Nn(0,0,"autoResize",JSON.stringify(Y)),Y)),close(){Nn(0,0,"close")},getId:()=>Ke,getOrigin:()=>(we("getOrigin"),ke("getOrigin()","getParentOrigin()"),d),getParentOrigin:()=>d,getPageInfo(e){if("function"==typeof e)return pt=e,Nn(0,0,$),void je("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");pt=null,Nn(0,0,"pageInfoStop")},getParentProps:e=>(ce(e,"function","parentIframe.getParentProps(callback) callback"),ht=e,Nn(0,0,S),()=>{ht=null,Nn(0,0,"parentInfoStop")}),getParentProperties(e){ke("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){ce(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Ve.findTarget(e)},reset(){!function(){const e=qe;qe=a,st||(st=!0,requestAnimationFrame(()=>{st=!1})),Cn("reset"),qe=e}()},setOffsetSize(e){ce(e,"number","parentIframe.setOffsetSize(offset) offset"),Ge=e,Ye=e,An(D,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){ce(e,"number","parentIframe.scrollBy(x, y) x"),ce(t,"number","parentIframe.scrollBy(x, y) y"),Nn(t,e,"scrollBy")},scrollTo(e,t){ce(e,"number","parentIframe.scrollTo(x, y) x"),ce(t,"number","parentIframe.scrollTo(x, y) y"),Nn(t,e,"scrollTo")},scrollToOffset(e,t){ce(e,"number","parentIframe.scrollToOffset(x, y) x"),ce(t,"number","parentIframe.scrollToOffset(x, y) y"),Nn(t,e,O)},sendMessage(e,t){t&&ce(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Nn(0,0,z,JSON.stringify(e),t)},setHeightCalculationMethod(e){qe=e,_t()},setWidthCalculationMethod(e){lt=e,Qt()},setTargetOrigin(e){ce(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),it=e},resize(e,t){void 0!==e&&ce(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&ce(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),An(B,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ke("size()","resize()"),this.resize(e,t)}}),dt.parentIFrame=dt.parentIframe)}let nn=new Set;function on(){const e=document.querySelectorAll(`[${j}]`);Xe=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${x}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{we("overflowIgnored"),he("Ignoring elements with [data-iframe-ignore] > *:\n",n),ye()}),t}(e),Ie=Xe.size>0,"function"==typeof Set.prototype.symmetricDifference&&(Ne=Xe.symmetricDifference(nn).size>0),nn=Xe}function rn(){switch(on(),!0){case!Ne:return;case Xe.size>1:he("Overflowed Elements:",Xe);break;case Ie:break;default:he("No overflow detected")}An(W,"Overflow updated")}function an(e){const t={root:document.documentElement,side:Me?I:N};return f=yt(rn,t),f.attachObservers(e),f}function sn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;An(F,`Element resized <${function(e){switch(!0){case!se(e):return"";case se(e.id):return`${e.nodeName}#${e.id}`;case se(e.name):return`${e.nodeName} (${e.name}`;case se(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function cn(e){return Rt=new ResizeObserver(sn),Rt.observe(document.body),It.add(document.body),he("Attached ResizeObserver to body"),m={attachObserverToNonStaticElements:Bt,detachObservers:Ue(jt,Rt,It,Tt),disconnect:()=>{Rt.disconnect(),he("Detached ResizeObserver")}},m.attachObserverToNonStaticElements(e),m}function ln(e){He=!e,An(H,"Visibility changed")}const un=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of bn(n))t.add(e)}return he("Inspecting:\n",t),t},dn=e=>{if(0===e.size)return;we("addObservers");const t=un(e);f.attachObservers(t),m.attachObserverToNonStaticElements(t),ye()},fn=e=>{if(0===e.size)return;we("removeObservers");const t=un(e);f.detachObservers(t),m.detachObservers(t),ye()};function mn(e){!function({addedNodes:e,removedNodes:t}){we("contentMutated"),Pt(),$t(),on(),ye(),fn(t),dn(e)}(e),An(V,"Mutation Observed")}function pn(){const e=bn(document.documentElement);var t;t=[ut(mn),an(e),kt(),cn(e),qt(ln)],s.push(...t.map(e=>e.disconnect))}function hn(e){performance.mark(bt);const t=ae(e);let n=1,o=document.documentElement,r=Pe?0:document.documentElement.getBoundingClientRect().bottom;const i=Pe?ot:Ie?Array.from(Xe):bn(document.documentElement);for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return he(`${t} position calculated from:`,o),he(`Checked %c${i.length}%c elements`,h,g),performance.mark(vt,{detail:{hasTags:Pe,len:i.length,logging:Je,Side:t}}),r}const gn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],yn=`* ${Array.from(Z).map(e=>`:not(${e})`).join("")}`,bn=e=>e.querySelectorAll(yn),vn={height:0,width:0},wn={height:0,width:0},zn=[h,g,h];function $n(e){function t(){return wn[o]=r,vn[o]=s,Math.max(r,1)}const n=e===Sn,o=e.label,r=e.boundingClientRect(),i=Math.ceil(r),a=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: %c${r}px %cPage: %c${s}px`;let l=1;switch(!0){case!e.enabled():return Math.max(s,1);case Pe:he("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!Ie&&Ae&&0===wn[o]&&0===vn[o]:he(`Initial page size values: ${c}`,...zn),l=t();break;case st&&r===wn[o]&&s===vn[o]:he(`Size unchanged: ${c}`,...zn),l=Math.max(r,s);break;case 0===r&&0!==s:he(`Page is hidden: ${c}`,...zn),l=s;break;case!Ie&&r!==wn[o]&&s<=vn[o]:he(`New <html> size: ${c} `,...zn),he(`Previous <html> size: %c${wn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!Ie&&r<wn[o]:he(`<html> size decreased: ${c}`,...zn),l=t();break;case s===a||s===i:he(`<html> size equals page size: ${c}`,...zn),l=t();break;case r>s:he(`Page size < <html> size: ${c}`,...zn),l=t();break;case Ie:he("Found elements possibly overflowing <html> "),l=e.taggedElement();break;default:he(`Using <html> size: ${c}`,...zn),l=t()}return he(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&he(`Page offsetSize: %c${t}px`,h),t}(e),Math.max(l,1)}const Sn={label:T,enabled:()=>Me,getOffset:()=>Ge,auto:()=>$n(Sn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,M)+parseInt(t.marginBottom,M)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Sn.bodyOffset(),custom:()=>o.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...gn(Sn)),min:()=>Math.min(...gn(Sn)),grow:()=>Sn.max(),lowestElement:()=>hn(I),taggedElement:()=>hn(I)},On={label:A,enabled:()=>Te,getOffset:()=>Ye,auto:()=>$n(On),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>o.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...gn(On)),min:()=>Math.min(...gn(On)),rightMostElement:()=>hn(N),scroll:()=>Math.max(On.bodyScroll(),On.documentElementScroll()),taggedElement:()=>hn(N)},En=(e,t)=>!(Math.abs(e-t)<=at);function Mn(e,t){const n=e[t](),o=e.enabled()&&void 0!==_?function(e){const t=_(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);if(t<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${t}, must be at least 1`);return t}(n):n;return ge(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let kn=!1;const jn=oe(()=>Ee(ee(4)));let xn,Tn=!1;const An=ve((e,t,n,o,r)=>{switch(we(e),!0){case!0===He:if(!0===Tn)break;Tn=!0,kn=!1,cancelAnimationFrame(xn);break;case!0===kn&&e!==W:$e();break;case!Y&&!(e in L):he("Resizing disabled");break;default:Tn=!1,kn=!0,performance.now(),xn=requestAnimationFrame(()=>{kn=!1,we("requestAnimationFrame")}),function(e,t,n,o,r){const i=n??Mn(Sn,qe),a=o??Mn(On,lt);switch(Me&&En(Re,i)||Te&&En(ct,a)?R:e){case w:case P:case R:Re=i,ct=a;case D:In(Re,ct,e,r);break;case W:case V:case F:case H:$e();break;default:$e(),he("No change in content size detected")}}(e,0,n,o,r)}ye()});function Cn(e){Re=Sn[qe](),ct=On[lt](),Nn(Re,ct,e)}function In(e,t,o,r,i){_e<-1||(void 0!==i||(i=it),function(){const a=`${Ke}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(tt)try{window.parent.iframeParentListener(U+a)}catch(e){if(1!==_e)throw e;return void jn()}else rt.postMessage(U+a,i);he(`Sending message to parent page via ${tt?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}())}const Nn=ve((e,t,n,o,r)=>{we(n),In(e,t,n,o,r),ye()}),Pn=ve(function(e){we("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Nn(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");rt=e.source,d=e.origin,gt(t),Ae=!1,setTimeout(()=>{We=!1},128)},reset(){We||Cn("resetPage")},resize(){An(q,"Parent window requested size check")},moveToAnchor(){Ve.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();pt?ne(pt,n(e)):o($)},parentInfo(){const e=(r=a(),t(n(r)));var r;ht?ne(ht,e):o(S)},message(){const e=a();ne(ft,n(e))}},i=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),s=()=>e.data.split(":")[2]in{true:1,false:1};function c(){const t=i();we(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||Se(`Unexpected message (${e.data})`)}U===`${e.data}`.slice(0,13)&&function(){if(!1!==Ae)return s()?(ze(i()),we(w),void r.init()):void 0;c()}()});let Rn=!1;const Bn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function qn(){if("loading"===document.readyState||!Ae||Rn)return;const{parent:e,top:t}=window;we("ready"),Bn(e),e!==t&&Bn(t),Rn=!0}"iframeChildListener"in window?Se("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Pn({data:e,sameOrigin:!0})),J(window,z,Pn),J(document,C,qn),qn())}()}();
20
+ !function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",a=Object.freeze({assert:!0,error:!0,warn:!0}),i={expand:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0},c=Object.assign(console);const{fromEntries:l,keys:u}=Object,d=e=>[e,c[e]],f=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(u(e).map(t));const p=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,h=p?"color: #A9C7FB;":"color: #135CD2;",y=p?"color: #E3E3E3;":"color: #1F1F1F;",g="5.5.7",v="iframeResizer",b=":",z="init",w="message",$="pageHide",S="pageInfo",O="parentInfo",E="scrollToOffset",M="title",k=10,j="data-iframe-size",x="data-iframe-overflowed",T="data-iframe-ignore",A="height",C="width",I="offset",N="offsetSize",P="string",R="number",B="object",q="function",L="auto",D="readystatechange",F="bottom",W="right",H="autoResizeEnabled",U=Symbol("sizeChanged"),V="manualResize",Z="parentResize",J={[V]:1,[Z]:1},_="setOffsetSize",Q="resizeObserver",G="overflowObserver",Y="mutationObserver",X="visibilityObserver",K="[iFrameSizer]",ee=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),te=(e,t,n,o)=>e.addEventListener(t,n,o||!1),ne=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},oe=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),re=["spjluzl","rlf","clyzpvu"],ae=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt.","Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz."],ie=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],se=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),ce=e=>oe(ae[e]);var le=e=>{const t=e[oe(re[0])]||e[oe(re[1])]||e[oe(re[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=ne(oe(e));return n in se&&(t=se[n]),t}(n[0]);return 0===o||(e=>e[2]===ne(e[0]+e[1]))(n)||(o=-2),o};const ue=(e,...t)=>setTimeout(()=>e(...t),0),de=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},fe=e=>e,me=e=>Math.round(1e3*e)/1e3,pe=e=>e.charAt(0).toUpperCase()+e.slice(1),he=e=>""!=`${e}`&&void 0!==e,ye=e=>e();const ge=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${pe(t)}`)};let ve=!0,be=v;const ze=(we=function(n={}){const l={},u={},p=[],h={...i,expand:!n.collapsed||i.expanded,...n};let y="";function g(){p.length=0,y=""}function v(){delete h.event,g()}const b=()=>!!p.some(([e])=>e in a)||!!h.expand;function z(){if(0!==p.length){c[b()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?y:""}`,e,t,o);for(const[e,...t]of p)c.assert(e in c,`Unknown console method: ${e}`),e in c&&c[e](...t);c.groupEnd(),v()}else v()}function w(){""===y&&(y=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){l[e]?$("log",`${e}: ${performance.now()-l[e]} ms`,...t):$("timeLog",e,...t)}return{...m(h,f(h)),...m(console,e=>[e,(...t)=>$(e,...t)]),...m(s,d),assert:function(e,...t){!0!==e&&$("assert",e,...t)},count:function(e=r){u[e]?u[e]+=1:u[e]=1,$("log",`${e}: ${u[e]}`)},countReset:function(e=r){delete u[e]},endAutoGroup:z,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;$("error",e),z()}return n},event:function(e){w(),h.event=e},purge:g,time:function(e=r){w(),l[e]=performance.now()},timeEnd:function(e=r){S(e),delete l[e]},timeLog:S,touch:w}},we?.__esModule?we.default:we);var we;const $e=ze({label:`${v}(child)`,expand:!1});var Se;const Oe=(Se="log",(...e)=>!ve||$e[Se](...e));const{assert:Ee,endAutoGroup:Me,error:ke,errorBoundary:je,event:xe,label:Te,purge:Ae,warn:Ce}=$e,Ie=e=>{return $e.warn((t=fe,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=(e=>(t,n="renamed to")=>(o,r,a="",i="")=>e(i,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${a}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>Ie(t)),Pe=Ne("Method"),Re=Ne("Method","replaced with"),Be=Ne("Option"),qe=["min-height","min-width","max-height","max-width"],Le=new Set,De=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Fe=(e,t)=>{return(n=De(e,t))&&"0px"!==n&&n!==L&&"none"!==n;var n};function We({href:e}){Le.has(e)||Le.add(e)}const He=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){We(n)}return{source:"cross-origin stylesheet",value:De(e,t)}}(e,t),Ue=(e,t)=>{const{source:n,value:o}=He(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);Ie(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function Ve(){for(const e of[document.documentElement,document.body])for(const t of qe)Fe(e,t)&&Ue(e,t)}const Ze=e=>t=>void 0===t?void 0:e(t),Je=Ze(e=>"true"===e),_e=Ze(Number),Qe=e=>e=>{e.size},Ge=((e="")=>t=>n=>{n.size>0&&ke(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Ye=e=>e=>{e.size},Xe=(t,n=!0)=>o=>{o>0&&Oe(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},Ke=(e,t,n,o)=>{const r=Ye(e);return e=>{const a=new Set;let i=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),a.add(o),i+=1);r(a),o(i),a.clear()}},et=new Set,tt=new Set,nt=new Set,ot=[],rt={attributes:!0,attributeFilter:[T,j],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let at,it=1,st=!1,ct=0;const lt=e=>{e.size},ut=e=>{e.size},dt=e=>{e.size},ft=e=>e.nodeType!==Node.ELEMENT_NODE||ee.has(e.tagName.toLowerCase());function mt(e){const t=e.addedNodes;for(const e of t)ft(e)||et.add(e)}function pt(e){const t=e.removedNodes;for(const e of t)ft(e)||(et.has(e)?(et.delete(e),nt.add(e)):tt.add(e))}const ht=e=>{Oe("Mutations:",e);for(const t of e)mt(t),pt(t);lt(et),ut(tt),dt(nt),nt.clear()};const yt=e=>()=>{const t=performance.now(),n=t-ct,o=16*it+++2;if(n>o&&n<200)return xe("mutationThrottled"),Oe("Update delayed due to heavy workload on the callStack"),Oe(`EventLoop busy time: %c${me(n)}ms %c> Max wait: %c${o-2}ms`,h,y,h),setTimeout(at,16*it),void(ct=t);it=1,ot.forEach(ht),ot.length=0,st=!1,tt.size,et.size,e({addedNodes:et,removedNodes:tt}),et.clear(),tt.clear()};function gt(e){ot.push(e),st||(ct=performance.now(),st=!0,requestAnimationFrame(at))}function vt(e){const t=new window.MutationObserver(gt),n=document.body||document.documentElement;return at=yt(e),t.observe(n,rt),Oe("Attached MutationObserver to body"),{...t,disconnect:()=>{et.clear(),tt.clear(),ot.length=0,t.disconnect(),Oe("Detached MutationObserver")}}}const bt="Overflow",zt=Xe(bt),wt=Xe(bt,!1),$t=Qe(bt),St=Ge(bt),Ot=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,Et=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||fe,a=(t=!1)=>e(t),i=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(x,t);const c=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t;if(!o)continue;const a=e[n],c=i(a,o)&&!Ot(r);s(r,c)}r(a)},o),l=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(l.has(r)?t.add(r):(c.observe(r),l.add(r),n.add(r),o+=1));St(t),$t(n),zt(o),n.clear(),t.clear()},detachObservers:Ke(bt,c,l,wt),disconnect:()=>{c.disconnect(),Oe("Detached OverflowObserver")}}},Mt="--ifr-start",kt="--ifr-end",jt="--ifr-measure",xt=[];let Tt,At={},Ct=0;function It(){try{performance.clearMarks(Mt),performance.clearMarks(kt),performance.clearMeasures(jt)}catch{}}function Nt(e){e.getEntries().forEach(e=>{if(e.name===kt)try{const{duration:t}=performance.measure(jt,Mt,kt);At=e.detail,xt.push(t),xt.length>100&&xt.shift()}catch{}})}function Pt(){Oe("Attached PerformanceObserver to page");const e=new PerformanceObserver(Nt);return e.observe({entryTypes:["mark"]}),Tt=setInterval(()=>{if(xt.length<10)return;if(At.hasTags&&At.len<25)return;xt.sort();const e=Math.min(xt.reduce((e,t)=>e+t,0)/xt.length,xt[Math.floor(xt.length/2)]),t=me(e);t>Ct&&(Ct=t,xe("performanceObserver")),It(),e<=4||(clearInterval(Tt),Ie(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${me(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${At.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{It(),clearInterval(Tt),e.disconnect(),Oe("Detached PerformanceObserver")}}}const Rt="Resize",Bt=Xe(Rt),qt=Xe(Rt,!1),Lt=Qe(Rt),Dt=Ge(Rt),Ft=new WeakSet,Wt=new Set,Ht=new Set;let Ut;function Vt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(Ft.has(n)?Wt.add(n):(Ut.observe(n),Ft.add(n),Ht.add(n),t+=1))}Dt(Wt),Lt(Ht),Bt(t),Ht.clear(),Wt.clear()}function Zt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),Oe("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),Oe("Detached VisibilityObserver")}}}const Jt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},_t=Jt(q),Qt=Jt(R),Gt=Jt(P);"undefined"!=typeof window&&function(){const o={height:()=>(Ce("Custom height calculation function not defined"),Cn.auto()),width:()=>(Ce("Custom width calculation function not defined"),In.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},i=L,s=[],c="scroll";let l,u,d,f,m,p,ne,ae=!0,se="",me=0,ze="",we="",Se=!1,Ne=!0,qe=!1,Le=!0,De=!1,Fe=!1,We=!0,He=!1,Ue=1,Ze=i,Qe="",Ge=!0,Ye={},Xe=!1,et=!1,tt=!1,nt=0,ot=!1,rt=0,at=0,it=new Set,st="",ct="child",lt=!1,ut="",dt=[],ft=window.parent,mt="*",pt=0,ht=!1,yt=1,gt=c,bt=window,zt=()=>{Ce("onMessage function not defined")},wt=()=>{},$t=null,St=null;function Ot(e){var t;!function(e){st=e[0]??st,me=_e(e[1])??me,qe=Je(e[2])??qe,tt=Je(e[3])??tt,ae=Je(e[6])??ae,ze=e[7]??ze,Ze=e[8]??Ze,se=e[9]??se,we=e[10]??we,pt=_e(e[11])??pt,Ye.enable=Je(e[12])??!1,ct=e[13]??ct,gt=e[14]??gt,ot=Je(e[15])??ot,rt=_e(e[16])??rt,at=_e(e[17])??at,Ne=Je(e[18])??Ne,l=e[19]??l,p=e[20]??p,nt=_e(e[21])??nt,et=Je(e[23])??et}(e),be=(t={id:st,enabled:tt,expand:et}).id||v,$e.label(`${be}`),$e.expand(t.expand),ve=t.enabled,function(){function e(e){ne=_t(e,"onBeforeResize")??ne,zt=_t(e,"onMessage")??zt,wt=_t(e,"onReady")??wt,typeof e?.offset===R&&(Be(I,N),Ne&&(rt=Qt(e,I)??rt),qe&&(at=Qt(e,I)??at)),typeof e?.offsetSize===R&&(Ne&&(rt=Qt(e,N)??rt),qe&&(at=Qt(e,N)??at)),u=Gt(e,oe(re[0]))??u,Qe=Gt(e,"ignoreSelector")??Qe,ut=Gt(e,"sizeSelector")??ut,mt=Gt(e,"targetOrigin")??mt,Ze=e?.heightCalculationMethod||Ze,gt=e?.widthCalculationMethod||gt}function t(e,t){return typeof e===q&&(Ie(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),o[t]=e,e="custom"),e}if(1===nt)return;const n=window.iframeResizer||window.iFrameResizer;typeof n===B&&(e(n),Ze=t(Ze,A),gt=t(gt,C),Oe(`Set targetOrigin for parent: %c${mt}`,h))}(),[Bt,Dt,an,It,Lt,on,rn,tn,Nt,At,Se?fe:Ve,Jt,dn,un,ln,Yt,()=>Wt("background",se),()=>Wt("padding",we),Se?fe:Xt,cn,sn,Sn,xt].forEach(e=>{try{e()}catch(e){if(nt<0)throw e;Ie("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),ke(e)}}),Tt(de(wt)),Dn(z,"Init message from host page",void 0,void 0,`${g}:${nt}`),document.title&&""!==document.title&&Hn(0,0,M,document.title)}function jt({persisted:e}){e||Hn(0,0,"beforeUnload"),xe($),Oe("Page persisted:",e),e||s.forEach(ye)}const xt=()=>te(window,$.toLowerCase(),jt);function Tt(e){"complete"===document.readyState?ue(e):te(document,D,()=>Tt(e))}function At(){dt=document.querySelectorAll(`[${j}]`),He=dt.length>0}let Ct=0;function It(){const n=document.querySelectorAll(`*[${T}]`);return De=n.length>0,De&&n.length!==Ct&&(function(n){const o=1===n.length?"":"s";Ce(`%c[${T}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),Ct=n.length),De}function Nt(){"BackCompat"===document.compatMode&&Ie("<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")}function Bt(){p&&""!==p&&"false"!==p?p!==g&&Ie(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${p} - Child page: ${g}.\n`):Ie("<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")}function Lt(){try{lt=1===nt||"iframeParentListener"in window.parent}catch(e){}}function Dt(){qe===Ne&&(Se=!0)}function Wt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),Oe(`Set body ${e}: %c${t}`,h))}function Ht(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Jt(){Ht(0,j,ut),Ht(0,T,Qe)}function Yt(){var e,t;void 0===ze&&(ze=`${me}px`),Wt("margin",(e="margin",(t=ze).includes("-")&&(Ce(`Negative CSS value ignored for ${e}`),t=""),t))}function Xt(){const e=e=>e.style.setProperty(A,L,"important");e(document.documentElement),e(document.body)}function Kt(e){({add(t){function n(){Dn(e.eventName,e.eventType)}a[t]=n,te(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)}function en(e){Kt({method:e,eventType:"After Print",eventName:"afterprint"}),Kt({method:e,eventType:"Before Print",eventName:"beforeprint"}),Kt({method:e,eventType:"Ready State Change",eventName:D})}function tn(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(j,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&Ie("<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</>.")}function nn(e,t,n){const{label:o}=n;return t!==e&&(e in n||(Ce(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&Ie(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you ${p?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${o}CalculationMethod: AUTO,\n}\n`}\n`),e}function on(){Ze=nn(Ze,i,Cn)}function rn(){gt=nn(gt,c,In)}function an(){const t=nt,n=le({key:l}),o=le({key:u});if(nt=Math.max(n,o),nt<0){if(nt=Math.min(n,o),Ae(),Ie(`${ce(nt+2)}${ce(2)}`),he(p))throw ce(nt+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!he(p)||t>-1&&nt>t)&&(sessionStorage.getItem("ifr")!==g&&function(t,n){console.info(`${be} %ciframe-resizer ${t}`,ve||n<1?"font-weight: bold;":e)}(`v${g} (${(e=>oe(ie[e]))(nt)})`,nt),nt<2&&Ie(ce(3)),sessionStorage.setItem("ifr",g))}function sn(){en("add"),s.push(()=>en("remove"))}function cn(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function ln(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,k)+parseInt(n.x,k),y:parseInt(t.top,k)+parseInt(n.y,k)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Hn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Hn(n.y,n.x,E)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}const{enable:o}=Ye;o&&(1===nt?Ie(ce(5)):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&te(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),te(window,"hashchange",n),setTimeout(n,128))),Ye={...Ye,findTarget:t}}function un(){function e(e){Hn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){te(window.document,t,e)}!0===ot&&(t("mouseenter"),t("mouseleave"))}function dn(){1!==nt&&(bt.parentIframe=Object.freeze({autoResize:e=>(ge(e,"boolean","parentIframe.autoResize(enable) enable"),!1===qe&&!1===Ne?(xe(H),Ie("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===ae?(ae=!0,queueMicrotask(()=>Dn(H,"Auto Resize enabled"))):!1===e&&!0===ae&&(ae=!1),Hn(0,0,"autoResize",JSON.stringify(ae)),ae)),close(){Hn(0,0,"close")},getId:()=>st,getOrigin:()=>(xe("getOrigin"),Pe("getOrigin()","getParentOrigin()"),d),getParentOrigin:()=>d,getPageInfo(e){if(typeof e===q)return $t=e,Hn(0,0,S),void Re("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");$t=null,Hn(0,0,"pageInfoStop")},getParentProps:e=>(ge(e,q,"parentIframe.getParentProps(callback) callback"),St=e,Hn(0,0,O),()=>{St=null,Hn(0,0,"parentInfoStop")}),getParentProperties(e){Pe("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){ge(e,P,"parentIframe.moveToAnchor(anchor) anchor"),Ye.findTarget(e)},reset(){!function(){const e=Ze;Ze=i,ht||(ht=!0,requestAnimationFrame(()=>{ht=!1})),Fn("reset"),Ze=e}()},setOffsetSize(e){ge(e,R,"parentIframe.setOffsetSize(offset) offset"),rt=e,at=e,Dn(_,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){ge(e,R,"parentIframe.scrollBy(x, y) x"),ge(t,R,"parentIframe.scrollBy(x, y) y"),Hn(t,e,"scrollBy")},scrollTo(e,t){ge(e,R,"parentIframe.scrollTo(x, y) x"),ge(t,R,"parentIframe.scrollTo(x, y) y"),Hn(t,e,"scrollTo")},scrollToOffset(e,t){ge(e,R,"parentIframe.scrollToOffset(x, y) x"),ge(t,R,"parentIframe.scrollToOffset(x, y) y"),Hn(t,e,E)},sendMessage(e,t){t&&ge(t,P,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Hn(0,0,w,JSON.stringify(e),t)},setHeightCalculationMethod(e){Ze=e,on()},setWidthCalculationMethod(e){gt=e,rn()},setTargetOrigin(e){ge(e,P,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),mt=e},resize(e,t){void 0!==e&&ge(e,R,"parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&ge(t,R,"parentIframe.resize(customHeight, customWidth) customWidth"),Dn(V,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){Pe("size()","resize()"),this.resize(e,t)}}),bt.parentIFrame=bt.parentIframe)}let fn=new Set;function mn(){const e=document.querySelectorAll(`[${x}]`);it=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${T}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{xe("overflowIgnored"),Oe("Ignoring elements with [data-iframe-ignore] > *:\n",n),Me()}),t}(e),Fe=it.size>0,typeof Set.prototype.symmetricDifference===q&&(We=it.symmetricDifference(fn).size>0),fn=it}function pn(){switch(mn(),!0){case!We:return;case it.size>1:Oe("Overflowed Elements:",it);break;case Fe:break;default:Oe("No overflow detected")}Dn(G,"Overflow updated")}function hn(e){const t={root:document.documentElement,side:Ne?F:W};return f=Et(pn,t),f.attachObservers(e),f}function yn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Dn(Q,`Element resized <${function(e){switch(!0){case!he(e):return"";case he(e.id):return`${e.nodeName}#${e.id}`;case he(e.name):return`${e.nodeName} (${e.name}`;case he(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function gn(e){return Ut=new ResizeObserver(yn),Ut.observe(document.body),Ft.add(document.body),Oe("Attached ResizeObserver to body"),m={attachObserverToNonStaticElements:Vt,detachObservers:Ke(Rt,Ut,Ft,qt),disconnect:()=>{Ut.disconnect(),Oe("Detached ResizeObserver")}},m.attachObserverToNonStaticElements(e),m}function vn(e){Xe=!e,Dn(X,"Visibility changed")}const bn=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of kn(n))t.add(e)}return Oe("Inspecting:\n",t),t},zn=e=>{if(0===e.size)return;xe("addObservers");const t=bn(e);f.attachObservers(t),m.attachObserverToNonStaticElements(t),Me()},wn=e=>{if(0===e.size)return;xe("removeObservers");const t=bn(e);f.detachObservers(t),m.detachObservers(t),Me()};function $n(e){!function({addedNodes:e,removedNodes:t}){xe("contentMutated"),Jt(),At(),mn(),Me(),wn(t),zn(e)}(e),Dn(Y,"Mutation Observed")}function Sn(){const e=kn(document.documentElement);var t;t=[vt($n),hn(e),Pt(),gn(e),Zt(vn)],s.push(...t.map(e=>e.disconnect))}function On(e){performance.mark(Mt);const t=pe(e);let n=1,o=document.documentElement,r=He?0:document.documentElement.getBoundingClientRect().bottom;const a=He?dt:Fe?Array.from(it):kn(document.documentElement);for(const t of a)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return Oe(`${t} position calculated from:`,o),Oe(`Checked %c${a.length}%c elements`,h,y),performance.mark(kt,{detail:{hasTags:He,len:a.length,logging:tt,Side:t}}),r}const En=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],Mn=`* ${Array.from(ee).map(e=>`:not(${e})`).join("")}`,kn=e=>e.querySelectorAll(Mn),jn={height:0,width:0},xn={height:0,width:0},Tn=[h,y,h];function An(e){function t(){return xn[o]=r,jn[o]=s,Math.max(r,1)}const n=e===Cn,o=e.label,r=e.boundingClientRect(),a=Math.ceil(r),i=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: %c${r}px %cPage: %c${s}px`;let l=1;switch(!0){case!e.enabled():return Math.max(s,1);case He:Oe("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!Fe&&Le&&0===xn[o]&&0===jn[o]:Oe(`Initial page size values: ${c}`,...Tn),l=t();break;case ht&&r===xn[o]&&s===jn[o]:Oe(`Size unchanged: ${c}`,...Tn),l=Math.max(r,s);break;case 0===r&&0!==s:Oe(`Page is hidden: ${c}`,...Tn),l=s;break;case!Fe&&r!==xn[o]&&s<=jn[o]:Oe(`New <html> size: ${c} `,...Tn),Oe(`Previous <html> size: %c${xn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!Fe&&r<xn[o]:Oe(`<html> size decreased: ${c}`,...Tn),l=t();break;case s===i||s===a:Oe(`<html> size equals page size: ${c}`,...Tn),l=t();break;case r>s:Oe(`Page size < <html> size: ${c}`,...Tn),l=t();break;case Fe:Oe("Found elements possibly overflowing <html> "),l=e.taggedElement();break;default:Oe(`Using <html> size: ${c}`,...Tn),l=t()}return Oe(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&Oe(`Page offsetSize: %c${t}px`,h),t}(e),Math.max(l,1)}const Cn={label:A,enabled:()=>Ne,getOffset:()=>rt,auto:()=>An(Cn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,k)+parseInt(t.marginBottom,k)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Cn.bodyOffset(),custom:()=>o.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...En(Cn)),min:()=>Math.min(...En(Cn)),grow:()=>Cn.max(),lowestElement:()=>On(F),taggedElement:()=>On(F)},In={label:C,enabled:()=>qe,getOffset:()=>at,auto:()=>An(In),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>o.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...En(In)),min:()=>Math.min(...En(In)),rightMostElement:()=>On(W),scroll:()=>Math.max(In.bodyScroll(),In.documentElementScroll()),taggedElement:()=>On(W)},Nn=(e,t)=>!(Math.abs(e-t)<=pt);function Pn(e,t){const n=e[t](),o=e.enabled()&&void 0!==ne?function(e){const t=ne(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);if(t<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${t}, must be at least 1`);return t}(n):n;return Ee(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let Rn=!1;const Bn=de(()=>Ie(ce(4)));let qn,Ln=!1;const Dn=je((e,t,n,o,r)=>{switch(xe(e),!0){case!0===Xe:if(!0===Ln)break;Ln=!0,Rn=!1,cancelAnimationFrame(qn);break;case!0===Rn&&e!==G:Ae();break;case!ae&&!(e in J):Oe("Resizing disabled");break;default:Ln=!1,Rn=!0,performance.now(),qn=requestAnimationFrame(()=>{Rn=!1,xe("requestAnimationFrame")}),function(e,t,n,o,r){const a=n??Pn(Cn,Ze),i=o??Pn(In,gt);switch(Ne&&Nn(Ue,a)||qe&&Nn(yt,i)?U:e){case z:case H:case U:Ue=a,yt=i;case _:Wn(Ue,yt,e,r);break;case G:case Y:case Q:case X:Ae();break;default:Ae(),Oe("No change in content size detected")}}(e,0,n,o,r)}Me()});function Fn(e){Ue=Cn[Ze](),yt=In[gt](),Hn(Ue,yt,e)}function Wn(e,t,o,r,a){nt<-1||(void 0!==a||(a=mt),function(){const i=`${st}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(lt)try{window.parent.iframeParentListener(K+i)}catch(e){if(1!==nt)throw e;return void Bn()}else ft.postMessage(K+i,a);Oe(`Sending message to parent page via ${lt?"sameOrigin":"postMessage"}: %c%c${i}`,n,h)}())}const Hn=je((e,t,n,o,r)=>{xe(n),Wn(e,t,n,o,r),Me()}),Un=je(function(e){xe("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Hn(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(b);ft=e.source,d=e.origin,Ot(t),Le=!1,setTimeout(()=>{Ge=!1},128)},reset(){Ge||Fn("resetPage")},resize(){Dn(Z,"Parent window requested size check")},moveToAnchor(){Ye.findTarget(i())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=i();$t?ue($t,n(e)):o(S)},parentInfo(){const e=(r=i(),t(n(r)));var r;St?ue(St,e):o(O)},message(){const e=i();ue(zt,n(e))}},a=()=>e.data.split("]")[1].split(b)[0],i=()=>e.data.slice(e.data.indexOf(b)+1),s=()=>e.data.split(b)[2]in{true:1,false:1};function c(){const t=a();xe(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||Ce(`Unexpected message (${e.data})`)}K===`${e.data}`.slice(0,13)&&function(){if(!1!==Le)return s()?(Te(a()),xe(z),void r.init()):void 0;c()}()});let Vn=!1;const Zn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function Jn(){if("loading"===document.readyState||!Le||Vn)return;const{parent:e,top:t}=window;xe("ready"),Zn(e),e!==t&&Zn(t),Vn=!0}"iframeChildListener"in window?Ce("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Un({data:e,sameOrigin:!0})),te(window,w,Un),te(document,D,Jn),Jn())}()}();
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (child) 5.5.6 (iife)
4
+ * @module iframe-resizer/legacy (child) 5.5.7 (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,4 +17,4 @@
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:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0},c=Object.assign(console);const{fromEntries:l,keys:u}=Object,d=e=>[e,c[e]],f=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(u(e).map(t));const p=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,h=p?"color: #A9C7FB;":"color: #135CD2;",g=p?"color: #E3E3E3;":"color: #1F1F1F;",y="5.5.6",b="iframeResizer",v="beforeUnload",w="init",z="message",$="pageInfo",S="parentInfo",O="scrollToOffset",E="title",M=10,k="data-iframe-size",j="data-iframe-overflowed",x="data-iframe-ignore",T="height",A="width",C="readystatechange",I="bottom",N="right",P="autoResizeEnabled",R=Symbol("sizeChanged"),B="manualResize",q="parentResize",L={[B]:1,[q]:1},D="setOffsetSize",F="resizeObserver",W="overflowObserver",V="mutationObserver",H="visibilityObserver",U="[iFrameSizer]",Z=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),J=(e,t,n,o)=>e.addEventListener(t,n,o||!1),_=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},Q=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),G=["spjluzl","rlf","clyzpvu"],Y=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],X=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],K=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),ee=e=>Q(Y[e]);var te=e=>{const t=e[Q(G[0])]||e[Q(G[1])]||e[Q(G[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=_(Q(e));return n in K&&(t=K[n]),t}(n[0]);return 0===o||(e=>e[2]===_(e[0]+e[1]))(n)||(o=-2),o};const ne=(e,...t)=>setTimeout(()=>e(...t),0),oe=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},re=e=>e,ie=e=>Math.round(1e3*e)/1e3,ae=e=>e.charAt(0).toUpperCase()+e.slice(1),se=e=>""!=`${e}`&&void 0!==e;const ce=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${ae(t)}`)};let le=!0,ue=b;const de=(fe=function(n={}){const l={},u={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function b(){delete h.event,y()}const v=()=>!!p.some(([e])=>e in i)||!!h.expand;function w(){if(0!==p.length){c[v()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?g:""}`,e,t,o);for(const[e,...t]of p)c.assert(e in c,`Unknown console method: ${e}`),e in c&&c[e](...t);c.groupEnd(),b()}else b()}function z(){""===g&&(g=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function $(e,...t){0===p.length&&(z(),queueMicrotask(()=>queueMicrotask(w))),p.push([e,...t])}function S(e=r,...t){l[e]?$("log",`${e}: ${performance.now()-l[e]} ms`,...t):$("timeLog",e,...t)}return{...m(h,f(h)),...m(console,e=>[e,(...t)=>$(e,...t)]),...m(s,d),assert:function(e,...t){!0!==e&&$("assert",e,...t)},count:function(e=r){u[e]?u[e]+=1:u[e]=1,$("log",`${e}: ${u[e]}`)},countReset:function(e=r){delete u[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;$("error",e),w()}return n},event:function(e){z(),h.event=e},purge:y,time:function(e=r){z(),l[e]=performance.now()},timeEnd:function(e=r){S(e),delete l[e]},timeLog:S,touch:z}},fe?.__esModule?fe.default:fe);var fe;const me=de({label:`${b}(child)`,expand:!1});var pe;const he=(pe="log",(...e)=>!le||me[pe](...e));const{assert:ge,endAutoGroup:ye,error:be,errorBoundary:ve,event:we,label:ze,purge:$e,warn:Se}=me,Oe=e=>{return me.warn((t=re,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},Ee=Oe,Me=(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)=>Oe(t)),ke=Me("Method"),je=Me("Method","replaced with"),xe=Me("Option"),Te=["min-height","min-width","max-height","max-width"],Ae=new Set,Ce=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Ie=(e,t)=>{return(n=Ce(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function Ne({href:e}){Ae.has(e)||Ae.add(e)}const Pe=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){Ne(n)}return{source:"cross-origin stylesheet",value:Ce(e,t)}}(e,t),Re=(e,t)=>{const{source:n,value:o}=Pe(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);Oe(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function Be(){for(const e of[document.documentElement,document.body])for(const t of Te)Ie(e,t)&&Re(e,t)}const qe=e=>t=>void 0===t?void 0:e(t),Le=qe(e=>"true"===e),De=qe(Number),Fe=e=>e=>{e.size},We=((e="")=>t=>n=>{n.size>0&&be(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Ve=e=>e=>{e.size},He=(t,n=!0)=>o=>{o>0&&he(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},Ue=(e,t,n,o)=>{const r=Ve(e);return e=>{const i=new Set;let a=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),i.add(o),a+=1);r(i),o(a),i.clear()}},Ze=new Set,Je=new Set,_e=new Set,Qe=[],Ge={attributes:!0,attributeFilter:[x,k],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Ye,Xe=1,Ke=!1,et=0;const tt=e=>{e.size},nt=e=>{e.size},ot=e=>{e.size},rt=e=>e.nodeType!==Node.ELEMENT_NODE||Z.has(e.tagName.toLowerCase());function it(e){const t=e.addedNodes;for(const e of t)rt(e)||Ze.add(e)}function at(e){const t=e.removedNodes;for(const e of t)rt(e)||(Ze.has(e)?(Ze.delete(e),_e.add(e)):Je.add(e))}const st=e=>{he("Mutations:",e);for(const t of e)it(t),at(t);tt(Ze),nt(Je),ot(_e),_e.clear()};const ct=e=>()=>{const t=performance.now(),n=t-et,o=16*Xe+++2;if(n>o&&n<200)return we("mutationThrottled"),he("Update delayed due to heavy workload on the callStack"),he(`EventLoop busy time: %c${ie(n)}ms %c> Max wait: %c${o-2}ms`,h,g,h),setTimeout(Ye,16*Xe),void(et=t);Xe=1,Qe.forEach(st),Qe.length=0,Ke=!1,Je.size,Ze.size,e({addedNodes:Ze,removedNodes:Je}),Ze.clear(),Je.clear()};function lt(e){Qe.push(e),Ke||(et=performance.now(),Ke=!0,requestAnimationFrame(Ye))}function ut(e){const t=new window.MutationObserver(lt),n=document.body||document.documentElement;return Ye=ct(e),t.observe(n,Ge),he("Attached MutationObserver to body"),{...t,disconnect:()=>{Ze.clear(),Je.clear(),Qe.length=0,t.disconnect(),he("Detached MutationObserver")}}}const dt="Overflow",ft=He(dt),mt=He(dt,!1),pt=Fe(dt),ht=We(dt),gt=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,yt=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||re,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(j,t);const c=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t;if(!o)continue;const i=e[n],c=a(i,o)&&!gt(r);s(r,c)}r(i)},o),l=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(l.has(r)?t.add(r):(c.observe(r),l.add(r),n.add(r),o+=1));ht(t),pt(n),ft(o),n.clear(),t.clear()},detachObservers:Ue(dt,c,l,mt),disconnect:()=>{c.disconnect(),he("Detached OverflowObserver")}}},bt="--ifr-start",vt="--ifr-end",wt="--ifr-measure",zt=[];let $t,St={},Ot=0;function Et(){try{performance.clearMarks(bt),performance.clearMarks(vt),performance.clearMeasures(wt)}catch{}}function Mt(e){e.getEntries().forEach(e=>{if(e.name===vt)try{const{duration:t}=performance.measure(wt,bt,vt);St=e.detail,zt.push(t),zt.length>100&&zt.shift()}catch{}})}function kt(){he("Attached PerformanceObserver to page");const e=new PerformanceObserver(Mt);return e.observe({entryTypes:["mark"]}),$t=setInterval(()=>{if(zt.length<10)return;if(St.hasTags&&St.len<25)return;zt.sort();const e=Math.min(zt.reduce((e,t)=>e+t,0)/zt.length,zt[Math.floor(zt.length/2)]),t=ie(e);t>Ot&&(Ot=t,we("performanceObserver")),Et(),e<=4||(clearInterval($t),Oe(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${ie(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${St.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{Et(),clearInterval($t),e.disconnect(),he("Detached PerformanceObserver")}}}const jt="Resize",xt=He(jt),Tt=He(jt,!1),At=Fe(jt),Ct=We(jt),It=new WeakSet,Nt=new Set,Pt=new Set;let Rt;function Bt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(It.has(n)?Nt.add(n):(Rt.observe(n),It.add(n),Pt.add(n),t+=1))}Ct(Nt),At(Pt),xt(t),Pt.clear(),Nt.clear()}function qt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),he("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),he("Detached VisibilityObserver")}}}const Lt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Dt=Lt("function"),Ft=Lt("number"),Wt=Lt("string");"undefined"!=typeof window&&function(){const o={height:()=>(Se("Custom height calculation function not defined"),Sn.auto()),width:()=>(Se("Custom width calculation function not defined"),On.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},i={},a="auto",s=[],c="scroll";let l,u,d,f,m,p,_,Y=!0,K="",ie=0,de="",fe="",pe=!1,Me=!0,Te=!1,Ae=!0,Ce=!1,Ie=!1,Ne=!0,Pe=!1,Re=1,qe=a,Fe="",We=!0,Ve={},He=!1,Ze=!1,Je=!1,_e=0,Qe=!1,Ge=0,Ye=0,Xe=new Set,Ke="",et="child",tt=!1,nt="",ot=[],rt=window.parent,it="*",at=0,st=!1,ct=1,lt=c,dt=window,ft=()=>{Se("onMessage function not defined")},mt=()=>{},pt=null,ht=null;function gt(e){var t;!function(e){Ke=e[0]??Ke,ie=De(e[1])??ie,Te=Le(e[2])??Te,Je=Le(e[3])??Je,Y=Le(e[6])??Y,de=e[7]??de,qe=e[8]??qe,K=e[9]??K,fe=e[10]??fe,at=De(e[11])??at,Ve.enable=Le(e[12])??!1,et=e[13]??et,lt=e[14]??lt,Qe=Le(e[15])??Qe,Ge=De(e[16])??Ge,Ye=De(e[17])??Ye,Me=Le(e[18])??Me,l=e[19]??l,p=e[20]??p,_e=De(e[21])??_e,Ze=Le(e[23])??Ze}(e),ue=(t={id:Ke,enabled:Je,expand:Ze}).id||b,me.label(`${ue}`),me.expand(t.expand),le=t.enabled,function(){function e(e){_=Dt(e,"onBeforeResize")??_,ft=Dt(e,"onMessage")??ft,mt=Dt(e,"onReady")??mt,"number"==typeof e?.offset&&(xe("offset","offsetSize"),Me&&(Ge=Ft(e,"offset")??Ge),Te&&(Ye=Ft(e,"offset")??Ye)),"number"==typeof e?.offsetSize&&(Me&&(Ge=Ft(e,"offsetSize")??Ge),Te&&(Ye=Ft(e,"offsetSize")??Ye)),u=Wt(e,Q(G[0]))??u,Fe=Wt(e,"ignoreSelector")??Fe,nt=Wt(e,"sizeSelector")??nt,it=Wt(e,"targetOrigin")??it,qe=e?.heightCalculationMethod||qe,lt=e?.widthCalculationMethod||lt}function t(e,t){return"function"==typeof e&&(Oe(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),o[t]=e,e="custom"),e}if(1===_e)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),qe=t(qe,T),lt=t(lt,A),he(`Set targetOrigin for parent: %c${it}`,h))}(),[Mt,At,Gt,Ot,xt,_t,Qt,Zt,Et,$t,pe?re:Be,Pt,tn,en,Kt,Lt,()=>Ct("background",K),()=>Ct("padding",fe),pe?re:Vt,Xt,Yt,pn,wt].forEach(e=>{try{e()}catch(e){if(_e<0)throw e;Oe("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),be(e)}}),zt(oe(mt)),An(w,"Init message from host page",void 0,void 0,`${y}:${_e}`),document.title&&""!==document.title&&Nn(0,0,E,document.title)}function wt(){J(window,v.toLowerCase(),()=>{s.forEach(e=>e()),Nn(0,0,v)})}function zt(e){"complete"===document.readyState?ne(e):J(document,C,()=>zt(e))}function $t(){ot=document.querySelectorAll(`[${k}]`),Pe=ot.length>0}let St=0;function Ot(){const n=document.querySelectorAll(`*[${x}]`);return Ce=n.length>0,Ce&&n.length!==St&&(function(n){const o=1===n.length?"":"s";Se(`%c[${x}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),St=n.length),Ce}function Et(){"BackCompat"===document.compatMode&&Oe("<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")}function Mt(){p&&""!==p&&"false"!==p?p!==y&&Oe(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${p} - Child page: ${y}.\n`):Oe("<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")}function xt(){try{tt=1===_e||"iframeParentListener"in window.parent}catch(e){}}function At(){Te===Me&&(pe=!0)}function Ct(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),he(`Set body ${e}: %c${t}`,h))}function Nt(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Pt(){Nt(0,k,nt),Nt(0,x,Fe)}function Lt(){var e,t;void 0===de&&(de=`${ie}px`),Ct("margin",(e="margin",(t=de).includes("-")&&(Se(`Negative CSS value ignored for ${e}`),t=""),t))}function Vt(){const e=e=>e.style.setProperty(T,"auto","important");e(document.documentElement),e(document.body)}function Ht(e){({add(t){function n(){An(e.eventName,e.eventType)}i[t]=n,J(window,t,n,{passive:!0})},remove(e){const t=i[e];var n,o;delete i[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function Ut(e){Ht({method:e,eventType:"After Print",eventName:"afterprint"}),Ht({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ht({method:e,eventType:"Ready State Change",eventName:C})}function Zt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(k,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&Oe("<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</>.")}function Jt(e,t,n){const{label:o}=n;return t!==e&&(e in n||(Se(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&Oe(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you ${p?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${o}CalculationMethod: 'auto',\n}\n`}\n`),e}function _t(){qe=Jt(qe,a,Sn)}function Qt(){lt=Jt(lt,c,On)}function Gt(){const t=_e,n=te({key:l}),o=te({key:u});if(_e=Math.max(n,o),_e<0){if(_e=Math.min(n,o),$e(),Oe(`${ee(_e+2)}${ee(2)}`),se(p))throw ee(_e+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!se(p)||t>-1&&_e>t)&&(sessionStorage.getItem("ifr")!==y&&function(t,n){console.info(`${ue} %ciframe-resizer ${t}`,le||n<1?"font-weight: bold;":e)}(`v${y} (${(e=>Q(X[e]))(_e)})`,_e),_e<2&&Ee(ee(3)),sessionStorage.setItem("ifr",y))}function Yt(){Ut("add"),s.push(()=>Ut("remove"))}function Xt(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Kt(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,M)+parseInt(n.x,M),y:parseInt(t.top,M)+parseInt(n.y,M)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Nn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Nn(n.y,n.x,O)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}Ve.enable&&(1===_e?Oe("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&J(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),J(window,"hashchange",n),setTimeout(n,128))),Ve={findTarget:t}}function en(){function e(e){Nn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){J(window.document,t,e)}!0===Qe&&(t("mouseenter"),t("mouseleave"))}function tn(){1!==_e&&(dt.parentIframe=Object.freeze({autoResize:e=>(ce(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Te&&!1===Me?(we(P),Oe("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===Y?(Y=!0,queueMicrotask(()=>An(P,"Auto Resize enabled"))):!1===e&&!0===Y&&(Y=!1),Nn(0,0,"autoResize",JSON.stringify(Y)),Y)),close(){Nn(0,0,"close")},getId:()=>Ke,getOrigin:()=>(we("getOrigin"),ke("getOrigin()","getParentOrigin()"),d),getParentOrigin:()=>d,getPageInfo(e){if("function"==typeof e)return pt=e,Nn(0,0,$),void je("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");pt=null,Nn(0,0,"pageInfoStop")},getParentProps:e=>(ce(e,"function","parentIframe.getParentProps(callback) callback"),ht=e,Nn(0,0,S),()=>{ht=null,Nn(0,0,"parentInfoStop")}),getParentProperties(e){ke("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){ce(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Ve.findTarget(e)},reset(){!function(){const e=qe;qe=a,st||(st=!0,requestAnimationFrame(()=>{st=!1})),Cn("reset"),qe=e}()},setOffsetSize(e){ce(e,"number","parentIframe.setOffsetSize(offset) offset"),Ge=e,Ye=e,An(D,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){ce(e,"number","parentIframe.scrollBy(x, y) x"),ce(t,"number","parentIframe.scrollBy(x, y) y"),Nn(t,e,"scrollBy")},scrollTo(e,t){ce(e,"number","parentIframe.scrollTo(x, y) x"),ce(t,"number","parentIframe.scrollTo(x, y) y"),Nn(t,e,"scrollTo")},scrollToOffset(e,t){ce(e,"number","parentIframe.scrollToOffset(x, y) x"),ce(t,"number","parentIframe.scrollToOffset(x, y) y"),Nn(t,e,O)},sendMessage(e,t){t&&ce(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Nn(0,0,z,JSON.stringify(e),t)},setHeightCalculationMethod(e){qe=e,_t()},setWidthCalculationMethod(e){lt=e,Qt()},setTargetOrigin(e){ce(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),it=e},resize(e,t){void 0!==e&&ce(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&ce(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),An(B,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ke("size()","resize()"),this.resize(e,t)}}),dt.parentIFrame=dt.parentIframe)}let nn=new Set;function on(){const e=document.querySelectorAll(`[${j}]`);Xe=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${x}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{we("overflowIgnored"),he("Ignoring elements with [data-iframe-ignore] > *:\n",n),ye()}),t}(e),Ie=Xe.size>0,"function"==typeof Set.prototype.symmetricDifference&&(Ne=Xe.symmetricDifference(nn).size>0),nn=Xe}function rn(){switch(on(),!0){case!Ne:return;case Xe.size>1:he("Overflowed Elements:",Xe);break;case Ie:break;default:he("No overflow detected")}An(W,"Overflow updated")}function an(e){const t={root:document.documentElement,side:Me?I:N};return f=yt(rn,t),f.attachObservers(e),f}function sn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;An(F,`Element resized <${function(e){switch(!0){case!se(e):return"";case se(e.id):return`${e.nodeName}#${e.id}`;case se(e.name):return`${e.nodeName} (${e.name}`;case se(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function cn(e){return Rt=new ResizeObserver(sn),Rt.observe(document.body),It.add(document.body),he("Attached ResizeObserver to body"),m={attachObserverToNonStaticElements:Bt,detachObservers:Ue(jt,Rt,It,Tt),disconnect:()=>{Rt.disconnect(),he("Detached ResizeObserver")}},m.attachObserverToNonStaticElements(e),m}function ln(e){He=!e,An(H,"Visibility changed")}const un=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of bn(n))t.add(e)}return he("Inspecting:\n",t),t},dn=e=>{if(0===e.size)return;we("addObservers");const t=un(e);f.attachObservers(t),m.attachObserverToNonStaticElements(t),ye()},fn=e=>{if(0===e.size)return;we("removeObservers");const t=un(e);f.detachObservers(t),m.detachObservers(t),ye()};function mn(e){!function({addedNodes:e,removedNodes:t}){we("contentMutated"),Pt(),$t(),on(),ye(),fn(t),dn(e)}(e),An(V,"Mutation Observed")}function pn(){const e=bn(document.documentElement);var t;t=[ut(mn),an(e),kt(),cn(e),qt(ln)],s.push(...t.map(e=>e.disconnect))}function hn(e){performance.mark(bt);const t=ae(e);let n=1,o=document.documentElement,r=Pe?0:document.documentElement.getBoundingClientRect().bottom;const i=Pe?ot:Ie?Array.from(Xe):bn(document.documentElement);for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return he(`${t} position calculated from:`,o),he(`Checked %c${i.length}%c elements`,h,g),performance.mark(vt,{detail:{hasTags:Pe,len:i.length,logging:Je,Side:t}}),r}const gn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],yn=`* ${Array.from(Z).map(e=>`:not(${e})`).join("")}`,bn=e=>e.querySelectorAll(yn),vn={height:0,width:0},wn={height:0,width:0},zn=[h,g,h];function $n(e){function t(){return wn[o]=r,vn[o]=s,Math.max(r,1)}const n=e===Sn,o=e.label,r=e.boundingClientRect(),i=Math.ceil(r),a=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: %c${r}px %cPage: %c${s}px`;let l=1;switch(!0){case!e.enabled():return Math.max(s,1);case Pe:he("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!Ie&&Ae&&0===wn[o]&&0===vn[o]:he(`Initial page size values: ${c}`,...zn),l=t();break;case st&&r===wn[o]&&s===vn[o]:he(`Size unchanged: ${c}`,...zn),l=Math.max(r,s);break;case 0===r&&0!==s:he(`Page is hidden: ${c}`,...zn),l=s;break;case!Ie&&r!==wn[o]&&s<=vn[o]:he(`New <html> size: ${c} `,...zn),he(`Previous <html> size: %c${wn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!Ie&&r<wn[o]:he(`<html> size decreased: ${c}`,...zn),l=t();break;case s===a||s===i:he(`<html> size equals page size: ${c}`,...zn),l=t();break;case r>s:he(`Page size < <html> size: ${c}`,...zn),l=t();break;case Ie:he("Found elements possibly overflowing <html> "),l=e.taggedElement();break;default:he(`Using <html> size: ${c}`,...zn),l=t()}return he(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&he(`Page offsetSize: %c${t}px`,h),t}(e),Math.max(l,1)}const Sn={label:T,enabled:()=>Me,getOffset:()=>Ge,auto:()=>$n(Sn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,M)+parseInt(t.marginBottom,M)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Sn.bodyOffset(),custom:()=>o.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...gn(Sn)),min:()=>Math.min(...gn(Sn)),grow:()=>Sn.max(),lowestElement:()=>hn(I),taggedElement:()=>hn(I)},On={label:A,enabled:()=>Te,getOffset:()=>Ye,auto:()=>$n(On),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>o.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...gn(On)),min:()=>Math.min(...gn(On)),rightMostElement:()=>hn(N),scroll:()=>Math.max(On.bodyScroll(),On.documentElementScroll()),taggedElement:()=>hn(N)},En=(e,t)=>!(Math.abs(e-t)<=at);function Mn(e,t){const n=e[t](),o=e.enabled()&&void 0!==_?function(e){const t=_(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);if(t<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${t}, must be at least 1`);return t}(n):n;return ge(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let kn=!1;const jn=oe(()=>Ee(ee(4)));let xn,Tn=!1;const An=ve((e,t,n,o,r)=>{switch(we(e),!0){case!0===He:if(!0===Tn)break;Tn=!0,kn=!1,cancelAnimationFrame(xn);break;case!0===kn&&e!==W:$e();break;case!Y&&!(e in L):he("Resizing disabled");break;default:Tn=!1,kn=!0,performance.now(),xn=requestAnimationFrame(()=>{kn=!1,we("requestAnimationFrame")}),function(e,t,n,o,r){const i=n??Mn(Sn,qe),a=o??Mn(On,lt);switch(Me&&En(Re,i)||Te&&En(ct,a)?R:e){case w:case P:case R:Re=i,ct=a;case D:In(Re,ct,e,r);break;case W:case V:case F:case H:$e();break;default:$e(),he("No change in content size detected")}}(e,0,n,o,r)}ye()});function Cn(e){Re=Sn[qe](),ct=On[lt](),Nn(Re,ct,e)}function In(e,t,o,r,i){_e<-1||(void 0!==i||(i=it),function(){const a=`${Ke}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(tt)try{window.parent.iframeParentListener(U+a)}catch(e){if(1!==_e)throw e;return void jn()}else rt.postMessage(U+a,i);he(`Sending message to parent page via ${tt?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}())}const Nn=ve((e,t,n,o,r)=>{we(n),In(e,t,n,o,r),ye()}),Pn=ve(function(e){we("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Nn(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");rt=e.source,d=e.origin,gt(t),Ae=!1,setTimeout(()=>{We=!1},128)},reset(){We||Cn("resetPage")},resize(){An(q,"Parent window requested size check")},moveToAnchor(){Ve.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();pt?ne(pt,n(e)):o($)},parentInfo(){const e=(r=a(),t(n(r)));var r;ht?ne(ht,e):o(S)},message(){const e=a();ne(ft,n(e))}},i=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),s=()=>e.data.split(":")[2]in{true:1,false:1};function c(){const t=i();we(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||Se(`Unexpected message (${e.data})`)}U===`${e.data}`.slice(0,13)&&function(){if(!1!==Ae)return s()?(ze(i()),we(w),void r.init()):void 0;c()}()});let Rn=!1;const Bn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function qn(){if("loading"===document.readyState||!Ae||Rn)return;const{parent:e,top:t}=window;we("ready"),Bn(e),e!==t&&Bn(t),Rn=!0}"iframeChildListener"in window?Se("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Pn({data:e,sameOrigin:!0})),J(window,z,Pn),J(document,C,qn),qn())}()}();
20
+ !function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",a=Object.freeze({assert:!0,error:!0,warn:!0}),i={expand:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0},c=Object.assign(console);const{fromEntries:l,keys:u}=Object,d=e=>[e,c[e]],f=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(u(e).map(t));const p=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,h=p?"color: #A9C7FB;":"color: #135CD2;",y=p?"color: #E3E3E3;":"color: #1F1F1F;",g="5.5.7",v="iframeResizer",b=":",z="init",w="message",$="pageHide",S="pageInfo",O="parentInfo",E="scrollToOffset",M="title",k=10,j="data-iframe-size",x="data-iframe-overflowed",T="data-iframe-ignore",A="height",C="width",I="offset",N="offsetSize",P="string",R="number",B="object",q="function",L="auto",D="readystatechange",F="bottom",W="right",H="autoResizeEnabled",U=Symbol("sizeChanged"),V="manualResize",Z="parentResize",J={[V]:1,[Z]:1},_="setOffsetSize",Q="resizeObserver",G="overflowObserver",Y="mutationObserver",X="visibilityObserver",K="[iFrameSizer]",ee=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),te=(e,t,n,o)=>e.addEventListener(t,n,o||!1),ne=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},oe=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),re=["spjluzl","rlf","clyzpvu"],ae=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt.","Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz."],ie=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],se=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),ce=e=>oe(ae[e]);var le=e=>{const t=e[oe(re[0])]||e[oe(re[1])]||e[oe(re[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=ne(oe(e));return n in se&&(t=se[n]),t}(n[0]);return 0===o||(e=>e[2]===ne(e[0]+e[1]))(n)||(o=-2),o};const ue=(e,...t)=>setTimeout(()=>e(...t),0),de=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},fe=e=>e,me=e=>Math.round(1e3*e)/1e3,pe=e=>e.charAt(0).toUpperCase()+e.slice(1),he=e=>""!=`${e}`&&void 0!==e,ye=e=>e();const ge=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${pe(t)}`)};let ve=!0,be=v;const ze=(we=function(n={}){const l={},u={},p=[],h={...i,expand:!n.collapsed||i.expanded,...n};let y="";function g(){p.length=0,y=""}function v(){delete h.event,g()}const b=()=>!!p.some(([e])=>e in a)||!!h.expand;function z(){if(0!==p.length){c[b()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?y:""}`,e,t,o);for(const[e,...t]of p)c.assert(e in c,`Unknown console method: ${e}`),e in c&&c[e](...t);c.groupEnd(),v()}else v()}function w(){""===y&&(y=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){l[e]?$("log",`${e}: ${performance.now()-l[e]} ms`,...t):$("timeLog",e,...t)}return{...m(h,f(h)),...m(console,e=>[e,(...t)=>$(e,...t)]),...m(s,d),assert:function(e,...t){!0!==e&&$("assert",e,...t)},count:function(e=r){u[e]?u[e]+=1:u[e]=1,$("log",`${e}: ${u[e]}`)},countReset:function(e=r){delete u[e]},endAutoGroup:z,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;$("error",e),z()}return n},event:function(e){w(),h.event=e},purge:g,time:function(e=r){w(),l[e]=performance.now()},timeEnd:function(e=r){S(e),delete l[e]},timeLog:S,touch:w}},we?.__esModule?we.default:we);var we;const $e=ze({label:`${v}(child)`,expand:!1});var Se;const Oe=(Se="log",(...e)=>!ve||$e[Se](...e));const{assert:Ee,endAutoGroup:Me,error:ke,errorBoundary:je,event:xe,label:Te,purge:Ae,warn:Ce}=$e,Ie=e=>{return $e.warn((t=fe,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=(e=>(t,n="renamed to")=>(o,r,a="",i="")=>e(i,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${a}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>Ie(t)),Pe=Ne("Method"),Re=Ne("Method","replaced with"),Be=Ne("Option"),qe=["min-height","min-width","max-height","max-width"],Le=new Set,De=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Fe=(e,t)=>{return(n=De(e,t))&&"0px"!==n&&n!==L&&"none"!==n;var n};function We({href:e}){Le.has(e)||Le.add(e)}const He=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){We(n)}return{source:"cross-origin stylesheet",value:De(e,t)}}(e,t),Ue=(e,t)=>{const{source:n,value:o}=He(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);Ie(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function Ve(){for(const e of[document.documentElement,document.body])for(const t of qe)Fe(e,t)&&Ue(e,t)}const Ze=e=>t=>void 0===t?void 0:e(t),Je=Ze(e=>"true"===e),_e=Ze(Number),Qe=e=>e=>{e.size},Ge=((e="")=>t=>n=>{n.size>0&&ke(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Ye=e=>e=>{e.size},Xe=(t,n=!0)=>o=>{o>0&&Oe(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},Ke=(e,t,n,o)=>{const r=Ye(e);return e=>{const a=new Set;let i=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),a.add(o),i+=1);r(a),o(i),a.clear()}},et=new Set,tt=new Set,nt=new Set,ot=[],rt={attributes:!0,attributeFilter:[T,j],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let at,it=1,st=!1,ct=0;const lt=e=>{e.size},ut=e=>{e.size},dt=e=>{e.size},ft=e=>e.nodeType!==Node.ELEMENT_NODE||ee.has(e.tagName.toLowerCase());function mt(e){const t=e.addedNodes;for(const e of t)ft(e)||et.add(e)}function pt(e){const t=e.removedNodes;for(const e of t)ft(e)||(et.has(e)?(et.delete(e),nt.add(e)):tt.add(e))}const ht=e=>{Oe("Mutations:",e);for(const t of e)mt(t),pt(t);lt(et),ut(tt),dt(nt),nt.clear()};const yt=e=>()=>{const t=performance.now(),n=t-ct,o=16*it+++2;if(n>o&&n<200)return xe("mutationThrottled"),Oe("Update delayed due to heavy workload on the callStack"),Oe(`EventLoop busy time: %c${me(n)}ms %c> Max wait: %c${o-2}ms`,h,y,h),setTimeout(at,16*it),void(ct=t);it=1,ot.forEach(ht),ot.length=0,st=!1,tt.size,et.size,e({addedNodes:et,removedNodes:tt}),et.clear(),tt.clear()};function gt(e){ot.push(e),st||(ct=performance.now(),st=!0,requestAnimationFrame(at))}function vt(e){const t=new window.MutationObserver(gt),n=document.body||document.documentElement;return at=yt(e),t.observe(n,rt),Oe("Attached MutationObserver to body"),{...t,disconnect:()=>{et.clear(),tt.clear(),ot.length=0,t.disconnect(),Oe("Detached MutationObserver")}}}const bt="Overflow",zt=Xe(bt),wt=Xe(bt,!1),$t=Qe(bt),St=Ge(bt),Ot=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,Et=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||fe,a=(t=!1)=>e(t),i=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(x,t);const c=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t;if(!o)continue;const a=e[n],c=i(a,o)&&!Ot(r);s(r,c)}r(a)},o),l=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(l.has(r)?t.add(r):(c.observe(r),l.add(r),n.add(r),o+=1));St(t),$t(n),zt(o),n.clear(),t.clear()},detachObservers:Ke(bt,c,l,wt),disconnect:()=>{c.disconnect(),Oe("Detached OverflowObserver")}}},Mt="--ifr-start",kt="--ifr-end",jt="--ifr-measure",xt=[];let Tt,At={},Ct=0;function It(){try{performance.clearMarks(Mt),performance.clearMarks(kt),performance.clearMeasures(jt)}catch{}}function Nt(e){e.getEntries().forEach(e=>{if(e.name===kt)try{const{duration:t}=performance.measure(jt,Mt,kt);At=e.detail,xt.push(t),xt.length>100&&xt.shift()}catch{}})}function Pt(){Oe("Attached PerformanceObserver to page");const e=new PerformanceObserver(Nt);return e.observe({entryTypes:["mark"]}),Tt=setInterval(()=>{if(xt.length<10)return;if(At.hasTags&&At.len<25)return;xt.sort();const e=Math.min(xt.reduce((e,t)=>e+t,0)/xt.length,xt[Math.floor(xt.length/2)]),t=me(e);t>Ct&&(Ct=t,xe("performanceObserver")),It(),e<=4||(clearInterval(Tt),Ie(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${me(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${At.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{It(),clearInterval(Tt),e.disconnect(),Oe("Detached PerformanceObserver")}}}const Rt="Resize",Bt=Xe(Rt),qt=Xe(Rt,!1),Lt=Qe(Rt),Dt=Ge(Rt),Ft=new WeakSet,Wt=new Set,Ht=new Set;let Ut;function Vt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(Ft.has(n)?Wt.add(n):(Ut.observe(n),Ft.add(n),Ht.add(n),t+=1))}Dt(Wt),Lt(Ht),Bt(t),Ht.clear(),Wt.clear()}function Zt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),Oe("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),Oe("Detached VisibilityObserver")}}}const Jt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},_t=Jt(q),Qt=Jt(R),Gt=Jt(P);"undefined"!=typeof window&&function(){const o={height:()=>(Ce("Custom height calculation function not defined"),Cn.auto()),width:()=>(Ce("Custom width calculation function not defined"),In.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},i=L,s=[],c="scroll";let l,u,d,f,m,p,ne,ae=!0,se="",me=0,ze="",we="",Se=!1,Ne=!0,qe=!1,Le=!0,De=!1,Fe=!1,We=!0,He=!1,Ue=1,Ze=i,Qe="",Ge=!0,Ye={},Xe=!1,et=!1,tt=!1,nt=0,ot=!1,rt=0,at=0,it=new Set,st="",ct="child",lt=!1,ut="",dt=[],ft=window.parent,mt="*",pt=0,ht=!1,yt=1,gt=c,bt=window,zt=()=>{Ce("onMessage function not defined")},wt=()=>{},$t=null,St=null;function Ot(e){var t;!function(e){st=e[0]??st,me=_e(e[1])??me,qe=Je(e[2])??qe,tt=Je(e[3])??tt,ae=Je(e[6])??ae,ze=e[7]??ze,Ze=e[8]??Ze,se=e[9]??se,we=e[10]??we,pt=_e(e[11])??pt,Ye.enable=Je(e[12])??!1,ct=e[13]??ct,gt=e[14]??gt,ot=Je(e[15])??ot,rt=_e(e[16])??rt,at=_e(e[17])??at,Ne=Je(e[18])??Ne,l=e[19]??l,p=e[20]??p,nt=_e(e[21])??nt,et=Je(e[23])??et}(e),be=(t={id:st,enabled:tt,expand:et}).id||v,$e.label(`${be}`),$e.expand(t.expand),ve=t.enabled,function(){function e(e){ne=_t(e,"onBeforeResize")??ne,zt=_t(e,"onMessage")??zt,wt=_t(e,"onReady")??wt,typeof e?.offset===R&&(Be(I,N),Ne&&(rt=Qt(e,I)??rt),qe&&(at=Qt(e,I)??at)),typeof e?.offsetSize===R&&(Ne&&(rt=Qt(e,N)??rt),qe&&(at=Qt(e,N)??at)),u=Gt(e,oe(re[0]))??u,Qe=Gt(e,"ignoreSelector")??Qe,ut=Gt(e,"sizeSelector")??ut,mt=Gt(e,"targetOrigin")??mt,Ze=e?.heightCalculationMethod||Ze,gt=e?.widthCalculationMethod||gt}function t(e,t){return typeof e===q&&(Ie(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),o[t]=e,e="custom"),e}if(1===nt)return;const n=window.iframeResizer||window.iFrameResizer;typeof n===B&&(e(n),Ze=t(Ze,A),gt=t(gt,C),Oe(`Set targetOrigin for parent: %c${mt}`,h))}(),[Bt,Dt,an,It,Lt,on,rn,tn,Nt,At,Se?fe:Ve,Jt,dn,un,ln,Yt,()=>Wt("background",se),()=>Wt("padding",we),Se?fe:Xt,cn,sn,Sn,xt].forEach(e=>{try{e()}catch(e){if(nt<0)throw e;Ie("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),ke(e)}}),Tt(de(wt)),Dn(z,"Init message from host page",void 0,void 0,`${g}:${nt}`),document.title&&""!==document.title&&Hn(0,0,M,document.title)}function jt({persisted:e}){e||Hn(0,0,"beforeUnload"),xe($),Oe("Page persisted:",e),e||s.forEach(ye)}const xt=()=>te(window,$.toLowerCase(),jt);function Tt(e){"complete"===document.readyState?ue(e):te(document,D,()=>Tt(e))}function At(){dt=document.querySelectorAll(`[${j}]`),He=dt.length>0}let Ct=0;function It(){const n=document.querySelectorAll(`*[${T}]`);return De=n.length>0,De&&n.length!==Ct&&(function(n){const o=1===n.length?"":"s";Ce(`%c[${T}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),Ct=n.length),De}function Nt(){"BackCompat"===document.compatMode&&Ie("<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")}function Bt(){p&&""!==p&&"false"!==p?p!==g&&Ie(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${p} - Child page: ${g}.\n`):Ie("<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")}function Lt(){try{lt=1===nt||"iframeParentListener"in window.parent}catch(e){}}function Dt(){qe===Ne&&(Se=!0)}function Wt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),Oe(`Set body ${e}: %c${t}`,h))}function Ht(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Jt(){Ht(0,j,ut),Ht(0,T,Qe)}function Yt(){var e,t;void 0===ze&&(ze=`${me}px`),Wt("margin",(e="margin",(t=ze).includes("-")&&(Ce(`Negative CSS value ignored for ${e}`),t=""),t))}function Xt(){const e=e=>e.style.setProperty(A,L,"important");e(document.documentElement),e(document.body)}function Kt(e){({add(t){function n(){Dn(e.eventName,e.eventType)}a[t]=n,te(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)}function en(e){Kt({method:e,eventType:"After Print",eventName:"afterprint"}),Kt({method:e,eventType:"Before Print",eventName:"beforeprint"}),Kt({method:e,eventType:"Ready State Change",eventName:D})}function tn(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(j,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&Ie("<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</>.")}function nn(e,t,n){const{label:o}=n;return t!==e&&(e in n||(Ce(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&Ie(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you ${p?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${o}CalculationMethod: AUTO,\n}\n`}\n`),e}function on(){Ze=nn(Ze,i,Cn)}function rn(){gt=nn(gt,c,In)}function an(){const t=nt,n=le({key:l}),o=le({key:u});if(nt=Math.max(n,o),nt<0){if(nt=Math.min(n,o),Ae(),Ie(`${ce(nt+2)}${ce(2)}`),he(p))throw ce(nt+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!he(p)||t>-1&&nt>t)&&(sessionStorage.getItem("ifr")!==g&&function(t,n){console.info(`${be} %ciframe-resizer ${t}`,ve||n<1?"font-weight: bold;":e)}(`v${g} (${(e=>oe(ie[e]))(nt)})`,nt),nt<2&&Ie(ce(3)),sessionStorage.setItem("ifr",g))}function sn(){en("add"),s.push(()=>en("remove"))}function cn(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function ln(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,k)+parseInt(n.x,k),y:parseInt(t.top,k)+parseInt(n.y,k)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Hn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Hn(n.y,n.x,E)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}const{enable:o}=Ye;o&&(1===nt?Ie(ce(5)):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&te(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),te(window,"hashchange",n),setTimeout(n,128))),Ye={...Ye,findTarget:t}}function un(){function e(e){Hn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){te(window.document,t,e)}!0===ot&&(t("mouseenter"),t("mouseleave"))}function dn(){1!==nt&&(bt.parentIframe=Object.freeze({autoResize:e=>(ge(e,"boolean","parentIframe.autoResize(enable) enable"),!1===qe&&!1===Ne?(xe(H),Ie("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===ae?(ae=!0,queueMicrotask(()=>Dn(H,"Auto Resize enabled"))):!1===e&&!0===ae&&(ae=!1),Hn(0,0,"autoResize",JSON.stringify(ae)),ae)),close(){Hn(0,0,"close")},getId:()=>st,getOrigin:()=>(xe("getOrigin"),Pe("getOrigin()","getParentOrigin()"),d),getParentOrigin:()=>d,getPageInfo(e){if(typeof e===q)return $t=e,Hn(0,0,S),void Re("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");$t=null,Hn(0,0,"pageInfoStop")},getParentProps:e=>(ge(e,q,"parentIframe.getParentProps(callback) callback"),St=e,Hn(0,0,O),()=>{St=null,Hn(0,0,"parentInfoStop")}),getParentProperties(e){Pe("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){ge(e,P,"parentIframe.moveToAnchor(anchor) anchor"),Ye.findTarget(e)},reset(){!function(){const e=Ze;Ze=i,ht||(ht=!0,requestAnimationFrame(()=>{ht=!1})),Fn("reset"),Ze=e}()},setOffsetSize(e){ge(e,R,"parentIframe.setOffsetSize(offset) offset"),rt=e,at=e,Dn(_,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){ge(e,R,"parentIframe.scrollBy(x, y) x"),ge(t,R,"parentIframe.scrollBy(x, y) y"),Hn(t,e,"scrollBy")},scrollTo(e,t){ge(e,R,"parentIframe.scrollTo(x, y) x"),ge(t,R,"parentIframe.scrollTo(x, y) y"),Hn(t,e,"scrollTo")},scrollToOffset(e,t){ge(e,R,"parentIframe.scrollToOffset(x, y) x"),ge(t,R,"parentIframe.scrollToOffset(x, y) y"),Hn(t,e,E)},sendMessage(e,t){t&&ge(t,P,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Hn(0,0,w,JSON.stringify(e),t)},setHeightCalculationMethod(e){Ze=e,on()},setWidthCalculationMethod(e){gt=e,rn()},setTargetOrigin(e){ge(e,P,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),mt=e},resize(e,t){void 0!==e&&ge(e,R,"parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&ge(t,R,"parentIframe.resize(customHeight, customWidth) customWidth"),Dn(V,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){Pe("size()","resize()"),this.resize(e,t)}}),bt.parentIFrame=bt.parentIframe)}let fn=new Set;function mn(){const e=document.querySelectorAll(`[${x}]`);it=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${T}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{xe("overflowIgnored"),Oe("Ignoring elements with [data-iframe-ignore] > *:\n",n),Me()}),t}(e),Fe=it.size>0,typeof Set.prototype.symmetricDifference===q&&(We=it.symmetricDifference(fn).size>0),fn=it}function pn(){switch(mn(),!0){case!We:return;case it.size>1:Oe("Overflowed Elements:",it);break;case Fe:break;default:Oe("No overflow detected")}Dn(G,"Overflow updated")}function hn(e){const t={root:document.documentElement,side:Ne?F:W};return f=Et(pn,t),f.attachObservers(e),f}function yn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Dn(Q,`Element resized <${function(e){switch(!0){case!he(e):return"";case he(e.id):return`${e.nodeName}#${e.id}`;case he(e.name):return`${e.nodeName} (${e.name}`;case he(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function gn(e){return Ut=new ResizeObserver(yn),Ut.observe(document.body),Ft.add(document.body),Oe("Attached ResizeObserver to body"),m={attachObserverToNonStaticElements:Vt,detachObservers:Ke(Rt,Ut,Ft,qt),disconnect:()=>{Ut.disconnect(),Oe("Detached ResizeObserver")}},m.attachObserverToNonStaticElements(e),m}function vn(e){Xe=!e,Dn(X,"Visibility changed")}const bn=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of kn(n))t.add(e)}return Oe("Inspecting:\n",t),t},zn=e=>{if(0===e.size)return;xe("addObservers");const t=bn(e);f.attachObservers(t),m.attachObserverToNonStaticElements(t),Me()},wn=e=>{if(0===e.size)return;xe("removeObservers");const t=bn(e);f.detachObservers(t),m.detachObservers(t),Me()};function $n(e){!function({addedNodes:e,removedNodes:t}){xe("contentMutated"),Jt(),At(),mn(),Me(),wn(t),zn(e)}(e),Dn(Y,"Mutation Observed")}function Sn(){const e=kn(document.documentElement);var t;t=[vt($n),hn(e),Pt(),gn(e),Zt(vn)],s.push(...t.map(e=>e.disconnect))}function On(e){performance.mark(Mt);const t=pe(e);let n=1,o=document.documentElement,r=He?0:document.documentElement.getBoundingClientRect().bottom;const a=He?dt:Fe?Array.from(it):kn(document.documentElement);for(const t of a)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return Oe(`${t} position calculated from:`,o),Oe(`Checked %c${a.length}%c elements`,h,y),performance.mark(kt,{detail:{hasTags:He,len:a.length,logging:tt,Side:t}}),r}const En=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],Mn=`* ${Array.from(ee).map(e=>`:not(${e})`).join("")}`,kn=e=>e.querySelectorAll(Mn),jn={height:0,width:0},xn={height:0,width:0},Tn=[h,y,h];function An(e){function t(){return xn[o]=r,jn[o]=s,Math.max(r,1)}const n=e===Cn,o=e.label,r=e.boundingClientRect(),a=Math.ceil(r),i=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: %c${r}px %cPage: %c${s}px`;let l=1;switch(!0){case!e.enabled():return Math.max(s,1);case He:Oe("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!Fe&&Le&&0===xn[o]&&0===jn[o]:Oe(`Initial page size values: ${c}`,...Tn),l=t();break;case ht&&r===xn[o]&&s===jn[o]:Oe(`Size unchanged: ${c}`,...Tn),l=Math.max(r,s);break;case 0===r&&0!==s:Oe(`Page is hidden: ${c}`,...Tn),l=s;break;case!Fe&&r!==xn[o]&&s<=jn[o]:Oe(`New <html> size: ${c} `,...Tn),Oe(`Previous <html> size: %c${xn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!Fe&&r<xn[o]:Oe(`<html> size decreased: ${c}`,...Tn),l=t();break;case s===i||s===a:Oe(`<html> size equals page size: ${c}`,...Tn),l=t();break;case r>s:Oe(`Page size < <html> size: ${c}`,...Tn),l=t();break;case Fe:Oe("Found elements possibly overflowing <html> "),l=e.taggedElement();break;default:Oe(`Using <html> size: ${c}`,...Tn),l=t()}return Oe(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&Oe(`Page offsetSize: %c${t}px`,h),t}(e),Math.max(l,1)}const Cn={label:A,enabled:()=>Ne,getOffset:()=>rt,auto:()=>An(Cn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,k)+parseInt(t.marginBottom,k)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Cn.bodyOffset(),custom:()=>o.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...En(Cn)),min:()=>Math.min(...En(Cn)),grow:()=>Cn.max(),lowestElement:()=>On(F),taggedElement:()=>On(F)},In={label:C,enabled:()=>qe,getOffset:()=>at,auto:()=>An(In),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>o.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...En(In)),min:()=>Math.min(...En(In)),rightMostElement:()=>On(W),scroll:()=>Math.max(In.bodyScroll(),In.documentElementScroll()),taggedElement:()=>On(W)},Nn=(e,t)=>!(Math.abs(e-t)<=pt);function Pn(e,t){const n=e[t](),o=e.enabled()&&void 0!==ne?function(e){const t=ne(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);if(t<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${t}, must be at least 1`);return t}(n):n;return Ee(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let Rn=!1;const Bn=de(()=>Ie(ce(4)));let qn,Ln=!1;const Dn=je((e,t,n,o,r)=>{switch(xe(e),!0){case!0===Xe:if(!0===Ln)break;Ln=!0,Rn=!1,cancelAnimationFrame(qn);break;case!0===Rn&&e!==G:Ae();break;case!ae&&!(e in J):Oe("Resizing disabled");break;default:Ln=!1,Rn=!0,performance.now(),qn=requestAnimationFrame(()=>{Rn=!1,xe("requestAnimationFrame")}),function(e,t,n,o,r){const a=n??Pn(Cn,Ze),i=o??Pn(In,gt);switch(Ne&&Nn(Ue,a)||qe&&Nn(yt,i)?U:e){case z:case H:case U:Ue=a,yt=i;case _:Wn(Ue,yt,e,r);break;case G:case Y:case Q:case X:Ae();break;default:Ae(),Oe("No change in content size detected")}}(e,0,n,o,r)}Me()});function Fn(e){Ue=Cn[Ze](),yt=In[gt](),Hn(Ue,yt,e)}function Wn(e,t,o,r,a){nt<-1||(void 0!==a||(a=mt),function(){const i=`${st}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(lt)try{window.parent.iframeParentListener(K+i)}catch(e){if(1!==nt)throw e;return void Bn()}else ft.postMessage(K+i,a);Oe(`Sending message to parent page via ${lt?"sameOrigin":"postMessage"}: %c%c${i}`,n,h)}())}const Hn=je((e,t,n,o,r)=>{xe(n),Wn(e,t,n,o,r),Me()}),Un=je(function(e){xe("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Hn(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(b);ft=e.source,d=e.origin,Ot(t),Le=!1,setTimeout(()=>{Ge=!1},128)},reset(){Ge||Fn("resetPage")},resize(){Dn(Z,"Parent window requested size check")},moveToAnchor(){Ye.findTarget(i())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=i();$t?ue($t,n(e)):o(S)},parentInfo(){const e=(r=i(),t(n(r)));var r;St?ue(St,e):o(O)},message(){const e=i();ue(zt,n(e))}},a=()=>e.data.split("]")[1].split(b)[0],i=()=>e.data.slice(e.data.indexOf(b)+1),s=()=>e.data.split(b)[2]in{true:1,false:1};function c(){const t=a();xe(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||Ce(`Unexpected message (${e.data})`)}K===`${e.data}`.slice(0,13)&&function(){if(!1!==Le)return s()?(Te(a()),xe(z),void r.init()):void 0;c()}()});let Vn=!1;const Zn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function Jn(){if("loading"===document.readyState||!Le||Vn)return;const{parent:e,top:t}=window;xe("ready"),Zn(e),e!==t&&Zn(t),Vn=!0}"iframeChildListener"in window?Ce("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Un({data:e,sameOrigin:!0})),te(window,w,Un),te(document,D,Jn),Jn())}()}();
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (parent) 5.5.6 (umd) - 2025-09-10
4
+ * @module iframe-resizer/legacy (parent) 5.5.7 (umd) - 2025-09-23
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,4 +17,4 @@
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",o=Object.freeze({assert:!0,error:!0,warn:!0}),i={expand:!1,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.5.6",g="iframeResizer",y="autoResize",b="init",w="iframeReady",v="load",z="message",$="onload",j="pageInfo",k="parentInfo",T="reset",x="resize",M="scroll",E="none",R="vertical",S="horizontal",O="[iFrameSizer]",C=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),I=Object.freeze({[$]:1,[b]:1,[w]:1}),A="expanded",W="collapsed",L=Object.freeze({[A]:1,[W]:1}),N=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)),F=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),B=e=>e,P={},H=(q=function(s={}){const l={},f={},p=[],h={...i,expand:!s.collapsed||i.expanded,...s};let m="";function g(){p.length=0,m=""}function y(){delete h.event,g()}const b=()=>!!p.some(([e])=>e in o)||!!h.expand;function w(){if(0!==p.length){a[b()?"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(w))),p.push([e,...t])}function $(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...u(h,d(h)),...u(console,e=>[e,(...t)=>z(e,...t)]),...u(r,c),assert:function(e,...t){!0!==e&&z("assert",e,...t)},count:function(e=n){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=n){delete f[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e),w()}return n},event:function(e){v(),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}},q?.__esModule?q.default:q);var q;let D=!0;const U=H({expand:!1,label:"parent"}),J=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const Z=e=>(t,...n)=>P[t]?P[t].console[e](...n):U[e](...n);var V;const G=(V="log",(e,...t)=>!0===(e=>P[e]?P[e].log:D)(e)?Z(V)(e,...t):null),X=Z("warn"),Y=Z("error"),_=Z("event"),Q=Z("purge"),K=Z("errorBoundary");const ee=(e,...t)=>P[e]?P[e].console.warn(N(B)(...t)):queueMicrotask(()=>console?.warn(N((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t))),te=(e=>(t,n="renamed to")=>(o,i,r="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(ee),ne=te("Function"),oe=te("Option"),ie=(e,t,n,o)=>e.addEventListener(t,n,o||!1),re=(e,t,n)=>e.removeEventListener(t,n,!1),ae=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,i=0;i<e.length;i++)o=e.codePointAt(i),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},se=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),le=["spjluzl","rlf","clyzpvu"],ce=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],de=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],ue=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),fe=e=>se(ce[e]),pe=e=>{const t=e[se(le[0])]||e[se(le[1])]||e[se(le[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=ae(se(e));return n in ue&&(t=ue[n]),t}(n[0]);return 0===o||(e=>e[2]===ae(e[0]+e[1]))(n)||(o=-2),o};function he(e,t){const{msgTimeout:n,warningTimeout:o}=t[e];o&&(n&&clearTimeout(n),t[e].msgTimeout=setTimeout(function(){if(void 0===t[e])return;const{initialised:n,loadErrorShown:o}=t[e];t[e].msgTimeout=void 0,n||o||(t[e].loadErrorShown=!0,function(e,t){const{iframe:n,waitForLoad:o}=t[e],{sandbox:i}=n,r="object"==typeof i&&i.length>0&&!(i.contains("allow-scripts")&&i.contains("allow-same-origin"));_(e,"noResponse"),ee(e,`<rb>No response from iframe</>\n \nThe iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <b>'true'</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <b>'false'</>. \n":""}${r?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n":""}\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`)}(e,t))},o))}const me=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:R,firstRun:!0,inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof P[e.id].onInit&&(oe("init()","onReady()","",e.id),P[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),ge={position:null,version:m};function ye(e){function t(){Te(L),je(B),S("onResized",L)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function o(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const i=e=>A.slice(A.indexOf(":")+7+e);const r=(e,t)=>(n,o)=>{const i={};var r,a;r=function(){Me(`${n} (${e})`,`${e}:${t()}`,o)},i[a=o]||(r(),i[a]=requestAnimationFrame(()=>{i[a]=null}))},a=(e,t)=>()=>{let n=!1;const o=t=>()=>{P[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame(()=>{n=!1})):s()},i=o(M),r=o("resize window");function a(e,t){t(window,M,i),t(window,x,r)}function s(){_(l,`stop${t}`),a(0,re),c.disconnect(),d.disconnect(),re(P[l].iframe,v,s)}const l=B,c=new ResizeObserver(o("pageObserver")),d=new ResizeObserver(o("iframeObserver"));P[l]&&(P[l][`stop${t}`]=s,ie(P[l].iframe,v,s),a(0,ie),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(P[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},s=e=>()=>{e in P[B]&&(P[B][e](),delete P[B][e])},l=r(j,function(){const e=document.body.getBoundingClientRect(),t=L.iframe.getBoundingClientRect(),{scrollY:n,scrollX:o,innerHeight:i,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,i||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:o,documentHeight:a,documentWidth:s,windowHeight:i,windowWidth:r})}),c=r(k,function(){const{iframe:e}=L,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:o,height:i,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:o,height:i,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 ze(),{x:Number(t.left)+Number(ge.position.x),y:Number(t.top)+Number(ge.position.y)}}function $(e){const t=e?w(L.iframe):{x:0,y:0};G(B,`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}))(L,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){setTimeout(()=>t["scrollTo"+(e?"Offset":"")](n.x,n.y))}(o,n):function(e){ge.position=e,E(B)}(n)}function E(e){const{x:t,y:n}=ge.position,o=P[e]?.iframe;!1!==S("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?je(e):$e()}function R(e){let t={};if(0===L.width&&0===L.height){const e=i(9).split(":");t={x:e[1],y:e[0]}}else t={x:L.width,y:L.height};S(e,{iframe:L.iframe,screenX:Number(t.x),screenY:Number(t.y),type:L.type})}const S=(e,t)=>be(B,e,t);function C(){const{height:e,iframe:n,msg:o,type:r,width:a}=L;switch(P[B]?.firstRun&&function(){if(!P[B])return;Oe(B,L.mode),P[B].firstRun=!1}(),r){case"close":ve(n);break;case z:l=i(6),S("onMessage",{iframe:L.iframe,message:JSON.parse(l)});break;case"mouseenter":R("onMouseEnter");break;case"mouseleave":R("onMouseLeave");break;case"beforeUnload":G(B,"Ready state reset"),P[B].initialised=!1;break;case y:P[B].autoResize=JSON.parse(i(9));break;case"scrollBy":!function(){const e=L.width,t=L.height,n=window.parentIframe||window.parentIFrame||window;G(B,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),n.scrollBy(e,t)}();break;case"scrollTo":$(!1);break;case"scrollToOffset":$(!0);break;case j:d();break;case k:u();break;case"pageInfoStop":f();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let o=document.getElementById(n)||document.getElementsByName(n)[0];o?function(){const e=w(o);G(B,`Moving to in page link: %c#${t}`,p),ge.position={x:e.x,y:e.y},E(B),window.location.hash=t}():window.top!==window.self&&function(){const e=window.parentIframe||window.parentIFrame;e&&e.moveToAnchor(t)}()}(i(9));break;case"title":!function(e,t){P[t]?.syncTitle&&(P[t].iframe.title=e,G(t,`Set iframe title attribute: %c${e}`,p))}(o,B);break;case T:ke(L);break;case b:t(),function(e){try{P[e].sameOrigin=!!P[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){P[e].sameOrigin=!1}}(B),(s=o)!==m&&(void 0!==s||ee(B,"<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")),P[B].initialised=!0,S("onReady",n);break;default:if(0===a&&0===e)return void X(B,`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;if(document.hidden)return;t()}var s,l}function I(e){if(!P[e])throw new Error(`${L.type} No settings for ${e}. Message was: ${A}`)}let A=e.data;if("[iFrameResizerChild]Ready"===A)return W=e.source,void Object.values(P).forEach((e=>({initChild:t,initialised:n,postMessageTarget:o})=>{n||e!==o||t()})(W));var W;if(!(e=>O===`${e}`.slice(0,13)&&e.slice(13).split(":")[0]in P)(A)){if("string"!=typeof A)return;return void _("parent","ignoredMessage")}const L=function(e){const t=e.slice(13).split(":"),i=t[1]?Number(t[1]):0,r=P[t[0]]?.iframe,a=getComputedStyle(r),s={iframe:r,id:t[0],height:i+n(a)+o(a),width:Number(t[2]),type:t[3],msg:t[4]};return t[5]&&(s.mode=t[5]),s}(A),{id:N,type:F}=L,B=N;B?(_(B,F),K(B,function(t){I(B),L.type in{true:1,false:1,undefined:1}||(null!==L.iframe||(X(B,`The iframe (${L.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let o=P[B]?.checkOrigin;if(o&&"null"!=`${t}`&&!(o.constructor===Array?function(){let e=0,n=!1;for(;e<o.length;e++)if(o[e]===t){n=!0;break}return n}():function(){const e=P[B]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${L.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}()&&C()})(A)):X("","iframeResizer received messageData without id, message was: ",A)}function be(e,t,n){let o=null,i=null;if(P[e]){if(o=P[e][t],"function"!=typeof o)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{i=o(n)}catch(n){console.error(n),X(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(o,n)}return i}function we(e){const{id:t}=e;delete P[t],delete e.iframeResizer}function ve(e){const{id:t}=e;if(!1!==be(t,"onBeforeClose",t)){try{e.parentNode&&e.remove()}catch(e){X(t,e)}be(t,"onAfterClose",t),we(e)}}function ze(e){null===ge.position&&(ge.position={x:window.scrollX,y:window.scrollY})}function $e(){ge.position=null}function je(e){null!==ge.position&&(window.scrollTo(ge.position.x,ge.position.y),G(e,`Set page position: %c${ge.position.x}%c, %c${ge.position.y}`,p,h,p),$e())}function ke(e){ze(e.id),Te(e),Me(T,T,e.id)}function Te(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,G(n,`Set ${t}: %c${o}`,p)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=P[n];o&&t("height"),i&&t("width")}const xe=e=>e.split(":").filter((e,t)=>19!==t).join(":");function Me(e,t,n){function o(o){const i=e in I?xe(t):t;G(n,o,p,h,p),G(n,`Message data: %c${i}`,p)}_(n,e),P[n]&&(P[n]?.postMessageTarget?function(){const{iframe:i,postMessageTarget:r,sameOrigin:a,targetOrigin:s}=P[n];if(a)try{return i.contentWindow.iframeChildListener(O+t),void o(`Sending message to iframe %c${n}%c via same origin%c`)}catch(t){e in I?P[n].sameOrigin=!1:X(n,"Same origin messaging failed, falling back to postMessage")}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${s}`),r.postMessage(O+t,s)}():X(n,`Iframe(${n}) not found`))}let Ee=0,Re=!1,Se=!1;function Oe(t,n=-3){if(Re)return;const o=Math.max(P[t].mode,n);if(o>P[t].mode&&(P[t].mode=o),o<0)throw Q(t),P[t].vAdvised||ee(t||"Parent",`${fe(o+2)}${fe(2)}`),P[t].vAdvised=!0,fe(o+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");o>0&&Se||function(t,n){queueMicrotask(()=>console.info(`%ciframe-resizer ${t}`,D||n<1?"font-weight: bold;":e))}(`v${m} (${(e=>se(de[e]))(o)})`,o),o<1&&ee("Parent",fe(3)),Re=!0}const Ce=e=>t=>{function n(){if(P[d]){const{iframe:e}=P[d],t={close:ve.bind(null,e),disconnect:we.bind(null,e),removeListeners(){ee(d,"<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize(){ee(d,"<rb>Deprecated Method</>\n \nUse of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As their are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code."),Me.bind(null,"Window resize",x,d)},moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${o=t,o.charAt(0).toUpperCase()+o.slice(1)}`);var o})(e,"string","moveToAnchor(anchor) anchor"),Me("Move to anchor",`moveToAnchor:${e}`,d)},sendMessage(e){e=JSON.stringify(e),Me(z,`${z}:${e}`,d)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e,n){const{waitForLoad:o}=P[e],i=o=>()=>{P[e]&&!0!==P[e].initialised&&(Me(o,n,e),he(e,P),P[e].firstRun||P[d]?.heightCalculationMethod in C&&ke({iframe:t,height:1,width:1,type:b}))},r=i($);ie(t,v,()=>setTimeout(r,1)),P[e].initChild=i(w),!0!==o&&((e=>{const{src:t,srcdoc:n}=e;return!n&&(null==t||""===t||"about:blank"===t)})(t)?setTimeout(()=>{_(e,"noContent"),G(e,"No content detected in the iframe, delaying initialisation")}):setTimeout(i(b)))}function i(e){return e?(("sizeWidth"in e||"sizeHeight"in e||y in e)&&ee(d,`<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"${R}"</>, <i>"${S}"</> or <i>"${E}"</>.\n`),e):{}}function r(e){const t=P[e]?.iframe?.title;return""===t||void 0===t}function a(e,t){F(P[d],e)&&(ee(d,`<rb>Deprecated option</>\n\nThe <b>${e}</> option has been renamed to <b>${t}</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.`),P[d][t]=P[d][e],delete P[d][e])}const s=e=>F(e,"onMouseEnter")||F(e,"onMouseLeave");function l(e){var n,o;P[d]={...P[d],iframe:t,remoteHost:t?.src.split("/").slice(0,3).join("/"),...me,...i(e),mouseEvents:s(e),mode:pe(e),syncTitle:r(d)},a("offset","offsetSize"),a("onClose","onBeforeClose"),a("onClosed","onAfterClose"),_(d,"setup"),function(){const{direction:e}=P[d];switch(e){case R:break;case S:P[d].sizeHeight=!1;case"both":P[d].sizeWidth=!0;break;case E:P[d].sizeWidth=!1,P[d].sizeHeight=!1,P[d].autoResize=!1;break;default:throw new TypeError(d,`Direction value of "${e}" is not valid`)}}(),(n=e?.offsetSize||e?.offset)&&(P[d].direction===R?P[d].offsetHeight=n:P[d].offsetWidth=n),function(e){e?.offset&&ee(d,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.")}(e),P[d].warningTimeout||G(d,"warningTimeout:%c disabled",p),null===P[d].postMessageTarget&&(P[d].postMessageTarget=t.contentWindow),P[d].targetOrigin=!0===P[d].checkOrigin?""===(o=P[d].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}const c=()=>g in t,d=function(n){if(n&&"string"!=typeof n)throw new TypeError("Invalid id for iFrame. Expected String");return""!==n&&n||(n=function(){let t=e?.id||me.id+Ee++;return null!==document.getElementById(t)&&(t+=Ee++),t}(),t.id=n,_(n,"assignId")),n}(t.id);if("object"!=typeof e)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=W,e.logExpand=t.includes("ifrlog=expanded"))}(e),function(e,t){const n=F(t,"log"),o="string"==typeof t.log,i=n?!!o||t.log:me.log;F(t,"logExpand")||(t.logExpand=n&&o?t.log===A:me.logExpand),function(e){-1===e?.log&&(e.log=!1,Se=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const o=H({expand:t,label:J(n)});D=e,P[n]||(P[n]={console:o})}({enabled:i,expand:t.logExpand,iframeId:e}),o&&!(t.log in L)&&Y(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=i}(d,e),K(d,function(e){c()?X(d,`Ignored iframe (${d}), already setup.`):(l(e),function(){if(Re)return;const{mode:e}=P[d];-1!==e&&Oe(d,e)}(),Ae(),function(){switch(t.style.overflow=!1===P[d]?.scrolling?"hidden":"auto",P[d]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=P[d]?P[d].scrolling:"no"}}(),function(){const{bodyMargin:e}=P[d];"number"!=typeof e&&"0"!==e||(P[d].bodyMargin=`${e}px`)}(),o(d,function(e){const t=P[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,ge.version,t.mode,"",t.logExpand].join(":")}(d)),n())})(e),t?.iframeResizer};function Ie(){!0!==document.hidden&&((e,t)=>{Object.values(P).filter(({autoResize:e,firstRun:t})=>e&&!t).forEach(({iframe:n})=>Me(e,t,n.id))})("tabVisible",x)}const Ae=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{ie(window,z,ye),ie(document,"visibilitychange",Ie),window.iframeParentListener=e=>setTimeout(()=>ye({data:e,sameOrigin:!0}))}),We=`[${g}] `;const Le=function(){function e(e){switch(!0){case!e:throw new TypeError(`${We}iframe is not defined`);case!e.tagName:throw new TypeError(`${We}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${We}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(o,i){if("undefined"==typeof window)return[];switch(t=Ce(o),n=[],typeof i){case"undefined":case"string":document.querySelectorAll(i||"iframe").forEach(e);break;case"object":e(i);break;default:throw new TypeError(`${We}Unexpected data type (${typeof i})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){ne("iFrameResize()","iframeResize()","","parent"),Le(...e)}),Le});
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="5.5.7",t="iframeResizer",n=":",o="autoResize",i="init",r="iframeReady",a="load",s="message",l="onload",c="pageInfo",u="parentInfo",d="reset",f="resize",p="scroll",h="child",m="parent",g="string",y="object",b="function",w="undefined",v="auto",z="none",$="vertical",j="horizontal",k="[iFrameSizer]",T=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),x=Object.freeze({[l]:1,[i]:1,[r]:1}),M="expanded",E="collapsed",R=Object.freeze({[M]:1,[E]:1}),S="font-weight: normal;",O=S+"font-style: italic;",C="default",I=Object.freeze({assert:!0,error:!0,warn:!0}),A={expand:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},W={profile:0,profileEnd:0,timeStamp:0,trace:0},L=Object.assign(console);const{fromEntries:N,keys:F}=Object,B=e=>[e,L[e]],P=e=>t=>[t,function(n){e[t]=n}],H=(e,t)=>N(F(e).map(t));const q=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,D=q?"color: #A9C7FB;":"color: #135CD2;",U=q?"color: #E3E3E3;":"color: #1F1F1F;",J=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),Z=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),V=e=>e,G={},X=(Y=function(e={}){const t={},n={},o=[],i={...A,expand:!e.collapsed||A.expanded,...e};let r="";function a(){o.length=0,r=""}function s(){delete i.event,a()}const l=()=>!!o.some(([e])=>e in I)||!!i.expand;function c(){if(0!==o.length){L[l()?"group":"groupCollapsed"](`%c${i.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(i)} %c${i.showTime?r:""}`,S,"font-weight: bold;",O);for(const[e,...t]of o)L.assert(e in L,`Unknown console method: ${e}`),e in L&&L[e](...t);L.groupEnd(),s()}else s()}function u(){""===r&&(r=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 d(e,...t){0===o.length&&(u(),queueMicrotask(()=>queueMicrotask(c))),o.push([e,...t])}function f(e=C,...n){t[e]?d("log",`${e}: ${performance.now()-t[e]} ms`,...n):d("timeLog",e,...n)}return{...H(i,P(i)),...H(console,e=>[e,(...t)=>d(e,...t)]),...H(W,B),assert:function(e,...t){!0!==e&&d("assert",e,...t)},count:function(e=C){n[e]?n[e]+=1:n[e]=1,d("log",`${e}: ${n[e]}`)},countReset:function(e=C){delete n[e]},endAutoGroup:c,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;d("error",e),c()}return n},event:function(e){u(),i.event=e},purge:a,time:function(e=C){u(),t[e]=performance.now()},timeEnd:function(e=C){f(e),delete t[e]},timeLog:f,touch:u}},Y?.__esModule?Y.default:Y);var Y;let _=!0;const Q=X({expand:!1,label:m}),K=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const ee=e=>(t,...n)=>G[t]?G[t].console[e](...n):Q[e](...n);var te;const ne=(te="log",(e,...t)=>!0===(e=>G[e]?G[e].log:_)(e)?ee(te)(e,...t):null),oe=ee("warn"),ie=ee("error"),re=ee("event"),ae=ee("purge"),se=ee("errorBoundary");const le=(e,...n)=>G[e]?G[e].console.warn(J(V)(...n)):queueMicrotask(()=>console?.warn(J((e=>(...n)=>[`${t}(${e})`,...n].join(" "))(e))(...n))),ce=(e=>(t,n="renamed to")=>(o,i,r="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(le),ue=ce("Function"),de=ce("Option"),fe=(e,t,n,o)=>e.addEventListener(t,n,o||!1),pe=(e,t,n)=>e.removeEventListener(t,n,!1),he=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,i=0;i<e.length;i++)o=e.codePointAt(i),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},me=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),ge=["spjluzl","rlf","clyzpvu"],ye=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt.","Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz."],be=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],we=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),ve=e=>me(ye[e]),ze=e=>{const t=e[me(ge[0])]||e[me(ge[1])]||e[me(ge[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=he(me(e));return n in we&&(t=we[n]),t}(n[0]);return 0===o||(e=>e[2]===he(e[0]+e[1]))(n)||(o=-2),o};function $e(e,t){const{msgTimeout:n,warningTimeout:o}=t[e];o&&(n&&clearTimeout(n),t[e].msgTimeout=setTimeout(function(){if(void 0===t[e])return;const{initialised:n,loadErrorShown:o}=t[e];t[e].msgTimeout=void 0,n||o||(t[e].loadErrorShown=!0,function(e,t){const{iframe:n,waitForLoad:o}=t[e],{sandbox:i}=n,r=typeof i===y&&i.length>0&&!(i.contains("allow-scripts")&&i.contains("allow-same-origin"));re(e,"noResponse"),le(e,`<rb>No response from iframe</>\n \nThe iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <b>'true'</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <b>'false'</>. \n":""}${r?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n":""}\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`)}(e,t))},o))}const je=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:$,firstRun:!0,inPageLinks:!1,heightCalculationMethod:v,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:v,onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{typeof G[e.id].onInit===b&&(de("init()","onReady()","",e.id),G[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),ke={position:null,version:e};function Te(t){function r(){Ie(N),Oe(P),C("onResized",N)}function l(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function h(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const y=e=>W.slice(W.indexOf(n)+7+e);const b=(e,t)=>(n,o)=>{const i={};var r,a;r=function(){We(`${n} (${e})`,`${e}:${t()}`,o)},i[a=o]||(r(),i[a]=requestAnimationFrame(()=>{i[a]=null}))},w=(e,t)=>()=>{let n=!1;const o=t=>()=>{G[c]?n&&n!==t||(e(t,c),n=t,requestAnimationFrame(()=>{n=!1})):l()},i=o(p),r=o("resize window");function s(e,t){t(window,p,i),t(window,f,r)}function l(){re(c,`stop${t}`),s(0,pe),u.disconnect(),d.disconnect(),pe(G[c].iframe,a,l)}const c=P,u=new ResizeObserver(o("pageObserver")),d=new ResizeObserver(o("iframeObserver"));G[c]&&(G[c][`stop${t}`]=l,fe(G[c].iframe,a,l),s(0,fe),u.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(G[c].iframe,{attributes:!0,childList:!1,subtree:!1}))},v=e=>()=>{e in G[P]&&(G[P][e](),delete G[P][e])},z=b(c,function(){const e=document.body.getBoundingClientRect(),t=N.iframe.getBoundingClientRect(),{scrollY:n,scrollX:o,innerHeight:i,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,i||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:o,documentHeight:a,documentWidth:s,windowHeight:i,windowWidth:r})}),$=b(u,function(){const{iframe:e}=N,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:o,height:i,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:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})}),j=w(z,"PageInfo"),T=w($,"ParentInfo"),x=v("stopPageInfo"),M=v("stopParentInfo");function E(e){const t=e.getBoundingClientRect();return Re(),{x:Number(t.left)+Number(ke.position.x),y:Number(t.top)+Number(ke.position.y)}}function R(e){const t=e?E(N.iframe):{x:0,y:0};ne(P,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,D,U,D);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(N,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){setTimeout(()=>t["scrollTo"+(e?"Offset":"")](n.x,n.y))}(o,n):function(e){ke.position=e,S(P)}(n)}function S(e){const{x:t,y:n}=ke.position,o=G[e]?.iframe;!1!==C("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?Oe(e):Se()}function O(e){let t={};if(0===N.width&&0===N.height){const e=y(9).split(n);t={x:e[1],y:e[0]}}else t={x:N.width,y:N.height};C(e,{iframe:N.iframe,screenX:Number(t.x),screenY:Number(t.y),type:N.type})}const C=(e,t)=>xe(P,e,t);function I(){const{height:t,iframe:n,msg:a,type:l,width:f}=N;switch(G[P]?.firstRun&&function(){if(!G[P])return;Be(P,N.mode),G[P].firstRun=!1}(),l){case"close":Ee(n);break;case s:h=y(6),C("onMessage",{iframe:N.iframe,message:JSON.parse(h)});break;case"mouseenter":O("onMouseEnter");break;case"mouseleave":O("onMouseLeave");break;case"beforeUnload":ne(P,"Ready state reset"),G[P].initialised=!1;break;case o:G[P].autoResize=JSON.parse(y(9));break;case"scrollBy":!function(){const e=N.width,t=N.height,n=window.parentIframe||window.parentIFrame||window;ne(P,`scrollBy: x: %c${e}%c y: %c${t}`,D,U,D),n.scrollBy(e,t)}();break;case"scrollTo":R(!1);break;case"scrollToOffset":R(!0);break;case c:j();break;case u:T();break;case"pageInfoStop":x();break;case"parentInfoStop":M();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let o=document.getElementById(n)||document.getElementsByName(n)[0];o?function(){const e=E(o);ne(P,`Moving to in page link: %c#${t}`,D),ke.position={x:e.x,y:e.y},S(P),window.location.hash=t}():window.top!==window.self&&function(){const e=window.parentIframe||window.parentIFrame;e&&e.moveToAnchor(t)}()}(y(9));break;case"title":!function(e,t){G[t]?.syncTitle&&(G[t].iframe.title=e,ne(t,`Set iframe title attribute: %c${e}`,D))}(a,P);break;case d:Ce(N);break;case i:r(),function(e){try{G[e].sameOrigin=!!G[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){G[e].sameOrigin=!1}}(P),(p=a)!==e&&(void 0!==p||le(P,"<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")),G[P].initialised=!0,C("onReady",n);break;default:if(0===f&&0===t)return void oe(P,`Unsupported message received (${l}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===f||0===t)return;if(document.hidden)return;r()}var p,h}function A(e){if(!G[e])throw new Error(`${N.type} No settings for ${e}. Message was: ${W}`)}let W=t.data;if("[iFrameResizerChild]Ready"===W)return L=t.source,void Object.values(G).forEach((e=>({initChild:t,postMessageTarget:n})=>{e===n&&t()})(L));var L;if(!(e=>k===`${e}`.slice(0,13)&&e.slice(13).split(n)[0]in G)(W)){if(typeof W!==g)return;return void re(m,"ignoredMessage")}const N=function(e){const t=e.slice(13).split(n),o=t[1]?Number(t[1]):0,i=G[t[0]]?.iframe,r=getComputedStyle(i),a={iframe:i,id:t[0],height:o+l(r)+h(r),width:Number(t[2]),type:t[3],msg:t[4]};return t[5]&&(a.mode=t[5]),a}(W),{id:F,type:B}=N,P=F;P?(re(P,B),se(P,function(e){A(P),N.type in{true:1,false:1,undefined:1}||(null!==N.iframe||(oe(P,`The iframe (${N.id}) was not found.`),0))&&function(){const{origin:e,sameOrigin:n}=t;if(n)return!0;let o=G[P]?.checkOrigin;if(o&&"null"!=`${e}`&&!(o.constructor===Array?function(){let t=0,n=!1;for(;t<o.length;t++)if(o[t]===e){n=!0;break}return n}():function(){const t=G[P]?.remoteHost;return e===t}()))throw new Error(`Unexpected message received from: ${e} for ${N.iframe.id}. Message was: ${t.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&I()})(W)):oe("","iframeResizer received messageData without id, message was: ",W)}function xe(e,t,n){let o=null,i=null;if(G[e]){if(o=G[e][t],typeof o!==b)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{i=o(n)}catch(n){console.error(n),oe(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(o,n)}return i}function Me(e){const{id:t}=e;delete G[t],delete e.iframeResizer}function Ee(e){const{id:t}=e;if(!1!==xe(t,"onBeforeClose",t)){try{e.parentNode&&e.remove()}catch(e){oe(t,e)}xe(t,"onAfterClose",t),Me(e)}}function Re(e){null===ke.position&&(ke.position={x:window.scrollX,y:window.scrollY})}function Se(){ke.position=null}function Oe(e){null!==ke.position&&(window.scrollTo(ke.position.x,ke.position.y),ne(e,`Set page position: %c${ke.position.x}%c, %c${ke.position.y}`,D,U,D),Se())}function Ce(e){Re(e.id),Ie(e),We(d,d,e.id)}function Ie(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,ne(n,`Set ${t}: %c${o}`,D)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=G[n];o&&t("height"),i&&t("width")}const Ae=e=>e.split(n).filter((e,t)=>19!==t).join(n);function We(e,t,n){function o(o){const i=e in x?Ae(t):t;ne(n,o,D,U,D),ne(n,`Message data: %c${i}`,D)}re(n,e),G[n]&&(G[n]?.postMessageTarget?function(){const{iframe:i,postMessageTarget:r,sameOrigin:a,targetOrigin:s}=G[n];if(a)try{return i.contentWindow.iframeChildListener(k+t),void o(`Sending message to iframe %c${n}%c via same origin%c`)}catch(t){e in x?G[n].sameOrigin=!1:oe(n,"Same origin messaging failed, falling back to postMessage")}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${s}`),r.postMessage(k+t,s)}():oe(n,`Iframe(${n}) not found`))}let Le=0,Ne=!1,Fe=!1;function Be(t,n=-3){if(Ne)return;const o=Math.max(G[t].mode,n);if(o>G[t].mode&&(G[t].mode=o),o<0)throw ae(t),G[t].vAdvised||le(t||"Parent",`${ve(o+2)}${ve(2)}`),G[t].vAdvised=!0,ve(o+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");o>0&&Fe||function(e,t){queueMicrotask(()=>console.info(`%ciframe-resizer ${e}`,_||t<1?"font-weight: bold;":S))}(`v${e} (${(e=>me(be[e]))(o)})`,o),o<1&&le("Parent",ve(3)),Ne=!0}const Pe=e=>c=>{function u(){G[O]?.heightCalculationMethod in T&&Ce({iframe:c,height:1,width:1,type:i})}function d(){if(G[O]){const{iframe:e}=G[O],t={close:Ee.bind(null,e),disconnect:Me.bind(null,e),removeListeners(){le(O,"<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize(){le(O,"<rb>Deprecated Method</>\n \nUse of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As their are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code."),We.bind(null,"Window resize",f,O)},moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${o=t,o.charAt(0).toUpperCase()+o.slice(1)}`);var o})(e,g,"moveToAnchor(anchor) anchor"),We("Move to anchor",`moveToAnchor:${e}`,O)},sendMessage(e){e=JSON.stringify(e),We(s,`${s}:${e}`,O)}};e.iframeResizer=t,e.iFrameResizer=t}}function p(e,t){const n=n=>()=>{if(!G[e])return;const{firstRun:o,iframe:r}=G[e];We(n,t,e),(e=>e===i)(n)&&(e=>"lazy"===e.loading)(r)||$e(e,G),o||u()},{iframe:o}=G[e];G[e].initChild=n(r),function(e,t){fe(e,a,()=>setTimeout(t,1))}(o,n(l)),function(e,t){const{iframe:n,waitForLoad:o}=G[e];!0!==o&&((e=>{const{src:t,srcdoc:n}=e;return!n&&(null==t||""===t||"about:blank"===t)})(n)?setTimeout(()=>{re(e,"noContent"),ne(e,"No content detected in the iframe, delaying initialisation")}):setTimeout(t))}(e,n(i))}function m(e){return e?(("sizeWidth"in e||"sizeHeight"in e||o in e)&&le(O,`<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>"${$}"</>, <i>"${j}"</> or <i>"${z}"</>.\n`),e):{}}function b(e){const t=G[e]?.iframe?.title;return""===t||void 0===t}function w(e,t){Z(G[O],e)&&(le(O,`<rb>Deprecated option</>\n\nThe <b>${e}</> option has been renamed to <b>${t}</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.`),G[O][t]=G[O][e],delete G[O][e])}const k=e=>Z(e,"onMouseEnter")||Z(e,"onMouseLeave");function x(e){var t,n;G[O]={...G[O],iframe:c,remoteHost:c?.src.split("/").slice(0,3).join("/"),...je,...m(e),mouseEvents:k(e),mode:ze(e),syncTitle:b(O)},w("offset","offsetSize"),w("onClose","onBeforeClose"),w("onClosed","onAfterClose"),re(O,"setup"),function(){const{direction:e}=G[O];switch(e){case $:break;case j:G[O].sizeHeight=!1;case"both":G[O].sizeWidth=!0;break;case z:G[O].sizeWidth=!1,G[O].sizeHeight=!1,G[O].autoResize=!1;break;default:throw new TypeError(O,`Direction value of "${e}" is not valid`)}}(),(t=e?.offsetSize||e?.offset)&&(G[O].direction===$?G[O].offsetHeight=t:G[O].offsetWidth=t),function(e){e?.offset&&le(O,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.")}(e),G[O].warningTimeout||ne(O,"warningTimeout:%c disabled",D),null===G[O].postMessageTarget&&(G[O].postMessageTarget=c.contentWindow),G[O].targetOrigin=!0===G[O].checkOrigin?""===(n=G[O].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*"}const S=()=>t in c,O=function(t){if(t&&typeof t!==g)throw new TypeError("Invalid id for iFrame. Expected String");return""!==t&&t||(t=function(){let t=e?.id||je.id+Le++;return null!==document.getElementById(t)&&(t+=Le++),t}(),c.id=t,re(t,"assignId")),t}(c.id);if(typeof e!==y)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=E,e.logExpand=t.includes("ifrlog=expanded"))}(e),function(e,t){const n=Z(t,"log"),o=typeof t.log===g,i=n?!!o||t.log:je.log;Z(t,"logExpand")||(t.logExpand=n&&o?t.log===M:je.logExpand),function(e){-1===e?.log&&(e.log=!1,Fe=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const o=X({expand:t,label:K(n)});_=e,G[n]||(G[n]={console:o})}({enabled:i,expand:t.logExpand,iframeId:e}),o&&!(t.log in R)&&ie(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=i}(O,e),se(O,function(e){S()?oe(O,`Ignored iframe (${O}), already setup.`):(x(e),function(){if(Ne)return;const{mode:e}=G[O];-1!==e&&Be(O,e)}(),qe(),function(){switch(c.style.overflow=!1===G[O]?.scrolling?"hidden":v,G[O]?.scrolling){case"omit":break;case!0:c.scrolling="yes";break;case!1:c.scrolling="no";break;default:c.scrolling=G[O]?G[O].scrolling:"no"}}(),function(){const{bodyMargin:e}=G[O];"number"!=typeof e&&"0"!==e||(G[O].bodyMargin=`${e}px`)}(),p(O,function(e){const{autoResize:t,bodyBackground:o,bodyMargin:i,bodyPadding:r,heightCalculationMethod:a,inPageLinks:s,license:l,log:c,logExpand:u,mouseEvents:d,offsetHeight:f,offsetWidth:p,mode:m,sizeHeight:g,sizeWidth:y,tolerance:b,widthCalculationMethod:w}=G[e];return[e,"8",y,c,"32",!0,t,i,a,o,r,b,s,h,w,d,f,p,g,l,ke.version,m,"",u].join(n)}(O)),d())})(e),c?.iframeResizer};function He(){!0!==document.hidden&&((e,t)=>{Object.values(G).filter(({autoResize:e,firstRun:t})=>e&&!t).forEach(({iframe:n})=>We(e,t,n.id))})("tabVisible",f)}const qe=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{fe(window,s,Te),fe(document,"visibilitychange",He),window.iframeParentListener=e=>setTimeout(()=>Te({data:e,sameOrigin:!0}))}),De=`[${t}] `;const Ue=function(){function e(e){switch(!0){case!e:throw new TypeError(`${De}iframe is not defined`);case!e.tagName:throw new TypeError(`${De}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${De}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(o,i){if(typeof window===w)return[];switch(t=Pe(o),n=[],typeof i){case w:case g:document.querySelectorAll(i||"iframe").forEach(e);break;case y:e(i);break;default:throw new TypeError(`${De}Unexpected data type (${typeof i})`)}return Object.freeze(n)}}();return typeof window!==w&&(window.iFrameResize=window.iFrameResize||function(...e){ue("iFrameResize()","iframeResize()","",m),Ue(...e)}),Ue});
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (parent) 5.5.6 (umd) - 2025-09-10
4
+ * @module iframe-resizer/legacy (parent) 5.5.7 (umd) - 2025-09-23
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,4 +17,4 @@
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",o=Object.freeze({assert:!0,error:!0,warn:!0}),i={expand:!1,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.5.6",g="iframeResizer",y="autoResize",b="init",w="iframeReady",v="load",z="message",$="onload",j="pageInfo",k="parentInfo",T="reset",x="resize",M="scroll",E="none",R="vertical",S="horizontal",O="[iFrameSizer]",C=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),I=Object.freeze({[$]:1,[b]:1,[w]:1}),A="expanded",W="collapsed",L=Object.freeze({[A]:1,[W]:1}),N=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)),F=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),B=e=>e,P={},H=(q=function(s={}){const l={},f={},p=[],h={...i,expand:!s.collapsed||i.expanded,...s};let m="";function g(){p.length=0,m=""}function y(){delete h.event,g()}const b=()=>!!p.some(([e])=>e in o)||!!h.expand;function w(){if(0!==p.length){a[b()?"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(w))),p.push([e,...t])}function $(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...u(h,d(h)),...u(console,e=>[e,(...t)=>z(e,...t)]),...u(r,c),assert:function(e,...t){!0!==e&&z("assert",e,...t)},count:function(e=n){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=n){delete f[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e),w()}return n},event:function(e){v(),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}},q?.__esModule?q.default:q);var q;let D=!0;const U=H({expand:!1,label:"parent"}),J=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const Z=e=>(t,...n)=>P[t]?P[t].console[e](...n):U[e](...n);var V;const G=(V="log",(e,...t)=>!0===(e=>P[e]?P[e].log:D)(e)?Z(V)(e,...t):null),X=Z("warn"),Y=Z("error"),_=Z("event"),Q=Z("purge"),K=Z("errorBoundary");const ee=(e,...t)=>P[e]?P[e].console.warn(N(B)(...t)):queueMicrotask(()=>console?.warn(N((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t))),te=(e=>(t,n="renamed to")=>(o,i,r="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(ee),ne=te("Function"),oe=te("Option"),ie=(e,t,n,o)=>e.addEventListener(t,n,o||!1),re=(e,t,n)=>e.removeEventListener(t,n,!1),ae=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,i=0;i<e.length;i++)o=e.codePointAt(i),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},se=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),le=["spjluzl","rlf","clyzpvu"],ce=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],de=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],ue=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),fe=e=>se(ce[e]),pe=e=>{const t=e[se(le[0])]||e[se(le[1])]||e[se(le[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=ae(se(e));return n in ue&&(t=ue[n]),t}(n[0]);return 0===o||(e=>e[2]===ae(e[0]+e[1]))(n)||(o=-2),o};function he(e,t){const{msgTimeout:n,warningTimeout:o}=t[e];o&&(n&&clearTimeout(n),t[e].msgTimeout=setTimeout(function(){if(void 0===t[e])return;const{initialised:n,loadErrorShown:o}=t[e];t[e].msgTimeout=void 0,n||o||(t[e].loadErrorShown=!0,function(e,t){const{iframe:n,waitForLoad:o}=t[e],{sandbox:i}=n,r="object"==typeof i&&i.length>0&&!(i.contains("allow-scripts")&&i.contains("allow-same-origin"));_(e,"noResponse"),ee(e,`<rb>No response from iframe</>\n \nThe iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <b>'true'</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <b>'false'</>. \n":""}${r?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n":""}\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`)}(e,t))},o))}const me=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:R,firstRun:!0,inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof P[e.id].onInit&&(oe("init()","onReady()","",e.id),P[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),ge={position:null,version:m};function ye(e){function t(){Te(L),je(B),S("onResized",L)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function o(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const i=e=>A.slice(A.indexOf(":")+7+e);const r=(e,t)=>(n,o)=>{const i={};var r,a;r=function(){Me(`${n} (${e})`,`${e}:${t()}`,o)},i[a=o]||(r(),i[a]=requestAnimationFrame(()=>{i[a]=null}))},a=(e,t)=>()=>{let n=!1;const o=t=>()=>{P[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame(()=>{n=!1})):s()},i=o(M),r=o("resize window");function a(e,t){t(window,M,i),t(window,x,r)}function s(){_(l,`stop${t}`),a(0,re),c.disconnect(),d.disconnect(),re(P[l].iframe,v,s)}const l=B,c=new ResizeObserver(o("pageObserver")),d=new ResizeObserver(o("iframeObserver"));P[l]&&(P[l][`stop${t}`]=s,ie(P[l].iframe,v,s),a(0,ie),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(P[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},s=e=>()=>{e in P[B]&&(P[B][e](),delete P[B][e])},l=r(j,function(){const e=document.body.getBoundingClientRect(),t=L.iframe.getBoundingClientRect(),{scrollY:n,scrollX:o,innerHeight:i,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,i||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:o,documentHeight:a,documentWidth:s,windowHeight:i,windowWidth:r})}),c=r(k,function(){const{iframe:e}=L,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:o,height:i,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:o,height:i,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 ze(),{x:Number(t.left)+Number(ge.position.x),y:Number(t.top)+Number(ge.position.y)}}function $(e){const t=e?w(L.iframe):{x:0,y:0};G(B,`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}))(L,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){setTimeout(()=>t["scrollTo"+(e?"Offset":"")](n.x,n.y))}(o,n):function(e){ge.position=e,E(B)}(n)}function E(e){const{x:t,y:n}=ge.position,o=P[e]?.iframe;!1!==S("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?je(e):$e()}function R(e){let t={};if(0===L.width&&0===L.height){const e=i(9).split(":");t={x:e[1],y:e[0]}}else t={x:L.width,y:L.height};S(e,{iframe:L.iframe,screenX:Number(t.x),screenY:Number(t.y),type:L.type})}const S=(e,t)=>be(B,e,t);function C(){const{height:e,iframe:n,msg:o,type:r,width:a}=L;switch(P[B]?.firstRun&&function(){if(!P[B])return;Oe(B,L.mode),P[B].firstRun=!1}(),r){case"close":ve(n);break;case z:l=i(6),S("onMessage",{iframe:L.iframe,message:JSON.parse(l)});break;case"mouseenter":R("onMouseEnter");break;case"mouseleave":R("onMouseLeave");break;case"beforeUnload":G(B,"Ready state reset"),P[B].initialised=!1;break;case y:P[B].autoResize=JSON.parse(i(9));break;case"scrollBy":!function(){const e=L.width,t=L.height,n=window.parentIframe||window.parentIFrame||window;G(B,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),n.scrollBy(e,t)}();break;case"scrollTo":$(!1);break;case"scrollToOffset":$(!0);break;case j:d();break;case k:u();break;case"pageInfoStop":f();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let o=document.getElementById(n)||document.getElementsByName(n)[0];o?function(){const e=w(o);G(B,`Moving to in page link: %c#${t}`,p),ge.position={x:e.x,y:e.y},E(B),window.location.hash=t}():window.top!==window.self&&function(){const e=window.parentIframe||window.parentIFrame;e&&e.moveToAnchor(t)}()}(i(9));break;case"title":!function(e,t){P[t]?.syncTitle&&(P[t].iframe.title=e,G(t,`Set iframe title attribute: %c${e}`,p))}(o,B);break;case T:ke(L);break;case b:t(),function(e){try{P[e].sameOrigin=!!P[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){P[e].sameOrigin=!1}}(B),(s=o)!==m&&(void 0!==s||ee(B,"<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")),P[B].initialised=!0,S("onReady",n);break;default:if(0===a&&0===e)return void X(B,`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;if(document.hidden)return;t()}var s,l}function I(e){if(!P[e])throw new Error(`${L.type} No settings for ${e}. Message was: ${A}`)}let A=e.data;if("[iFrameResizerChild]Ready"===A)return W=e.source,void Object.values(P).forEach((e=>({initChild:t,initialised:n,postMessageTarget:o})=>{n||e!==o||t()})(W));var W;if(!(e=>O===`${e}`.slice(0,13)&&e.slice(13).split(":")[0]in P)(A)){if("string"!=typeof A)return;return void _("parent","ignoredMessage")}const L=function(e){const t=e.slice(13).split(":"),i=t[1]?Number(t[1]):0,r=P[t[0]]?.iframe,a=getComputedStyle(r),s={iframe:r,id:t[0],height:i+n(a)+o(a),width:Number(t[2]),type:t[3],msg:t[4]};return t[5]&&(s.mode=t[5]),s}(A),{id:N,type:F}=L,B=N;B?(_(B,F),K(B,function(t){I(B),L.type in{true:1,false:1,undefined:1}||(null!==L.iframe||(X(B,`The iframe (${L.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let o=P[B]?.checkOrigin;if(o&&"null"!=`${t}`&&!(o.constructor===Array?function(){let e=0,n=!1;for(;e<o.length;e++)if(o[e]===t){n=!0;break}return n}():function(){const e=P[B]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${L.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}()&&C()})(A)):X("","iframeResizer received messageData without id, message was: ",A)}function be(e,t,n){let o=null,i=null;if(P[e]){if(o=P[e][t],"function"!=typeof o)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{i=o(n)}catch(n){console.error(n),X(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(o,n)}return i}function we(e){const{id:t}=e;delete P[t],delete e.iframeResizer}function ve(e){const{id:t}=e;if(!1!==be(t,"onBeforeClose",t)){try{e.parentNode&&e.remove()}catch(e){X(t,e)}be(t,"onAfterClose",t),we(e)}}function ze(e){null===ge.position&&(ge.position={x:window.scrollX,y:window.scrollY})}function $e(){ge.position=null}function je(e){null!==ge.position&&(window.scrollTo(ge.position.x,ge.position.y),G(e,`Set page position: %c${ge.position.x}%c, %c${ge.position.y}`,p,h,p),$e())}function ke(e){ze(e.id),Te(e),Me(T,T,e.id)}function Te(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,G(n,`Set ${t}: %c${o}`,p)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=P[n];o&&t("height"),i&&t("width")}const xe=e=>e.split(":").filter((e,t)=>19!==t).join(":");function Me(e,t,n){function o(o){const i=e in I?xe(t):t;G(n,o,p,h,p),G(n,`Message data: %c${i}`,p)}_(n,e),P[n]&&(P[n]?.postMessageTarget?function(){const{iframe:i,postMessageTarget:r,sameOrigin:a,targetOrigin:s}=P[n];if(a)try{return i.contentWindow.iframeChildListener(O+t),void o(`Sending message to iframe %c${n}%c via same origin%c`)}catch(t){e in I?P[n].sameOrigin=!1:X(n,"Same origin messaging failed, falling back to postMessage")}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${s}`),r.postMessage(O+t,s)}():X(n,`Iframe(${n}) not found`))}let Ee=0,Re=!1,Se=!1;function Oe(t,n=-3){if(Re)return;const o=Math.max(P[t].mode,n);if(o>P[t].mode&&(P[t].mode=o),o<0)throw Q(t),P[t].vAdvised||ee(t||"Parent",`${fe(o+2)}${fe(2)}`),P[t].vAdvised=!0,fe(o+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");o>0&&Se||function(t,n){queueMicrotask(()=>console.info(`%ciframe-resizer ${t}`,D||n<1?"font-weight: bold;":e))}(`v${m} (${(e=>se(de[e]))(o)})`,o),o<1&&ee("Parent",fe(3)),Re=!0}const Ce=e=>t=>{function n(){if(P[d]){const{iframe:e}=P[d],t={close:ve.bind(null,e),disconnect:we.bind(null,e),removeListeners(){ee(d,"<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize(){ee(d,"<rb>Deprecated Method</>\n \nUse of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As their are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code."),Me.bind(null,"Window resize",x,d)},moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${o=t,o.charAt(0).toUpperCase()+o.slice(1)}`);var o})(e,"string","moveToAnchor(anchor) anchor"),Me("Move to anchor",`moveToAnchor:${e}`,d)},sendMessage(e){e=JSON.stringify(e),Me(z,`${z}:${e}`,d)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e,n){const{waitForLoad:o}=P[e],i=o=>()=>{P[e]&&!0!==P[e].initialised&&(Me(o,n,e),he(e,P),P[e].firstRun||P[d]?.heightCalculationMethod in C&&ke({iframe:t,height:1,width:1,type:b}))},r=i($);ie(t,v,()=>setTimeout(r,1)),P[e].initChild=i(w),!0!==o&&((e=>{const{src:t,srcdoc:n}=e;return!n&&(null==t||""===t||"about:blank"===t)})(t)?setTimeout(()=>{_(e,"noContent"),G(e,"No content detected in the iframe, delaying initialisation")}):setTimeout(i(b)))}function i(e){return e?(("sizeWidth"in e||"sizeHeight"in e||y in e)&&ee(d,`<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"${R}"</>, <i>"${S}"</> or <i>"${E}"</>.\n`),e):{}}function r(e){const t=P[e]?.iframe?.title;return""===t||void 0===t}function a(e,t){F(P[d],e)&&(ee(d,`<rb>Deprecated option</>\n\nThe <b>${e}</> option has been renamed to <b>${t}</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.`),P[d][t]=P[d][e],delete P[d][e])}const s=e=>F(e,"onMouseEnter")||F(e,"onMouseLeave");function l(e){var n,o;P[d]={...P[d],iframe:t,remoteHost:t?.src.split("/").slice(0,3).join("/"),...me,...i(e),mouseEvents:s(e),mode:pe(e),syncTitle:r(d)},a("offset","offsetSize"),a("onClose","onBeforeClose"),a("onClosed","onAfterClose"),_(d,"setup"),function(){const{direction:e}=P[d];switch(e){case R:break;case S:P[d].sizeHeight=!1;case"both":P[d].sizeWidth=!0;break;case E:P[d].sizeWidth=!1,P[d].sizeHeight=!1,P[d].autoResize=!1;break;default:throw new TypeError(d,`Direction value of "${e}" is not valid`)}}(),(n=e?.offsetSize||e?.offset)&&(P[d].direction===R?P[d].offsetHeight=n:P[d].offsetWidth=n),function(e){e?.offset&&ee(d,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.")}(e),P[d].warningTimeout||G(d,"warningTimeout:%c disabled",p),null===P[d].postMessageTarget&&(P[d].postMessageTarget=t.contentWindow),P[d].targetOrigin=!0===P[d].checkOrigin?""===(o=P[d].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}const c=()=>g in t,d=function(n){if(n&&"string"!=typeof n)throw new TypeError("Invalid id for iFrame. Expected String");return""!==n&&n||(n=function(){let t=e?.id||me.id+Ee++;return null!==document.getElementById(t)&&(t+=Ee++),t}(),t.id=n,_(n,"assignId")),n}(t.id);if("object"!=typeof e)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=W,e.logExpand=t.includes("ifrlog=expanded"))}(e),function(e,t){const n=F(t,"log"),o="string"==typeof t.log,i=n?!!o||t.log:me.log;F(t,"logExpand")||(t.logExpand=n&&o?t.log===A:me.logExpand),function(e){-1===e?.log&&(e.log=!1,Se=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const o=H({expand:t,label:J(n)});D=e,P[n]||(P[n]={console:o})}({enabled:i,expand:t.logExpand,iframeId:e}),o&&!(t.log in L)&&Y(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=i}(d,e),K(d,function(e){c()?X(d,`Ignored iframe (${d}), already setup.`):(l(e),function(){if(Re)return;const{mode:e}=P[d];-1!==e&&Oe(d,e)}(),Ae(),function(){switch(t.style.overflow=!1===P[d]?.scrolling?"hidden":"auto",P[d]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=P[d]?P[d].scrolling:"no"}}(),function(){const{bodyMargin:e}=P[d];"number"!=typeof e&&"0"!==e||(P[d].bodyMargin=`${e}px`)}(),o(d,function(e){const t=P[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,ge.version,t.mode,"",t.logExpand].join(":")}(d)),n())})(e),t?.iframeResizer};function Ie(){!0!==document.hidden&&((e,t)=>{Object.values(P).filter(({autoResize:e,firstRun:t})=>e&&!t).forEach(({iframe:n})=>Me(e,t,n.id))})("tabVisible",x)}const Ae=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{ie(window,z,ye),ie(document,"visibilitychange",Ie),window.iframeParentListener=e=>setTimeout(()=>ye({data:e,sameOrigin:!0}))}),We=`[${g}] `;const Le=function(){function e(e){switch(!0){case!e:throw new TypeError(`${We}iframe is not defined`);case!e.tagName:throw new TypeError(`${We}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${We}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(o,i){if("undefined"==typeof window)return[];switch(t=Ce(o),n=[],typeof i){case"undefined":case"string":document.querySelectorAll(i||"iframe").forEach(e);break;case"object":e(i);break;default:throw new TypeError(`${We}Unexpected data type (${typeof i})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){ne("iFrameResize()","iframeResize()","","parent"),Le(...e)}),Le});
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="5.5.7",t="iframeResizer",n=":",o="autoResize",i="init",r="iframeReady",a="load",s="message",l="onload",c="pageInfo",u="parentInfo",d="reset",f="resize",p="scroll",h="child",m="parent",g="string",y="object",b="function",w="undefined",v="auto",z="none",$="vertical",j="horizontal",k="[iFrameSizer]",T=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),x=Object.freeze({[l]:1,[i]:1,[r]:1}),M="expanded",E="collapsed",R=Object.freeze({[M]:1,[E]:1}),S="font-weight: normal;",O=S+"font-style: italic;",C="default",I=Object.freeze({assert:!0,error:!0,warn:!0}),A={expand:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},W={profile:0,profileEnd:0,timeStamp:0,trace:0},L=Object.assign(console);const{fromEntries:N,keys:F}=Object,B=e=>[e,L[e]],P=e=>t=>[t,function(n){e[t]=n}],H=(e,t)=>N(F(e).map(t));const q=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,D=q?"color: #A9C7FB;":"color: #135CD2;",U=q?"color: #E3E3E3;":"color: #1F1F1F;",J=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),Z=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),V=e=>e,G={},X=(Y=function(e={}){const t={},n={},o=[],i={...A,expand:!e.collapsed||A.expanded,...e};let r="";function a(){o.length=0,r=""}function s(){delete i.event,a()}const l=()=>!!o.some(([e])=>e in I)||!!i.expand;function c(){if(0!==o.length){L[l()?"group":"groupCollapsed"](`%c${i.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(i)} %c${i.showTime?r:""}`,S,"font-weight: bold;",O);for(const[e,...t]of o)L.assert(e in L,`Unknown console method: ${e}`),e in L&&L[e](...t);L.groupEnd(),s()}else s()}function u(){""===r&&(r=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 d(e,...t){0===o.length&&(u(),queueMicrotask(()=>queueMicrotask(c))),o.push([e,...t])}function f(e=C,...n){t[e]?d("log",`${e}: ${performance.now()-t[e]} ms`,...n):d("timeLog",e,...n)}return{...H(i,P(i)),...H(console,e=>[e,(...t)=>d(e,...t)]),...H(W,B),assert:function(e,...t){!0!==e&&d("assert",e,...t)},count:function(e=C){n[e]?n[e]+=1:n[e]=1,d("log",`${e}: ${n[e]}`)},countReset:function(e=C){delete n[e]},endAutoGroup:c,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;d("error",e),c()}return n},event:function(e){u(),i.event=e},purge:a,time:function(e=C){u(),t[e]=performance.now()},timeEnd:function(e=C){f(e),delete t[e]},timeLog:f,touch:u}},Y?.__esModule?Y.default:Y);var Y;let _=!0;const Q=X({expand:!1,label:m}),K=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const ee=e=>(t,...n)=>G[t]?G[t].console[e](...n):Q[e](...n);var te;const ne=(te="log",(e,...t)=>!0===(e=>G[e]?G[e].log:_)(e)?ee(te)(e,...t):null),oe=ee("warn"),ie=ee("error"),re=ee("event"),ae=ee("purge"),se=ee("errorBoundary");const le=(e,...n)=>G[e]?G[e].console.warn(J(V)(...n)):queueMicrotask(()=>console?.warn(J((e=>(...n)=>[`${t}(${e})`,...n].join(" "))(e))(...n))),ce=(e=>(t,n="renamed to")=>(o,i,r="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(le),ue=ce("Function"),de=ce("Option"),fe=(e,t,n,o)=>e.addEventListener(t,n,o||!1),pe=(e,t,n)=>e.removeEventListener(t,n,!1),he=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,i=0;i<e.length;i++)o=e.codePointAt(i),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},me=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),ge=["spjluzl","rlf","clyzpvu"],ye=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt.","Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz."],be=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],we=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),ve=e=>me(ye[e]),ze=e=>{const t=e[me(ge[0])]||e[me(ge[1])]||e[me(ge[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=he(me(e));return n in we&&(t=we[n]),t}(n[0]);return 0===o||(e=>e[2]===he(e[0]+e[1]))(n)||(o=-2),o};function $e(e,t){const{msgTimeout:n,warningTimeout:o}=t[e];o&&(n&&clearTimeout(n),t[e].msgTimeout=setTimeout(function(){if(void 0===t[e])return;const{initialised:n,loadErrorShown:o}=t[e];t[e].msgTimeout=void 0,n||o||(t[e].loadErrorShown=!0,function(e,t){const{iframe:n,waitForLoad:o}=t[e],{sandbox:i}=n,r=typeof i===y&&i.length>0&&!(i.contains("allow-scripts")&&i.contains("allow-same-origin"));re(e,"noResponse"),le(e,`<rb>No response from iframe</>\n \nThe iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <b>'true'</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <b>'false'</>. \n":""}${r?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n":""}\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`)}(e,t))},o))}const je=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:$,firstRun:!0,inPageLinks:!1,heightCalculationMethod:v,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:v,onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{typeof G[e.id].onInit===b&&(de("init()","onReady()","",e.id),G[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),ke={position:null,version:e};function Te(t){function r(){Ie(N),Oe(P),C("onResized",N)}function l(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function h(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const y=e=>W.slice(W.indexOf(n)+7+e);const b=(e,t)=>(n,o)=>{const i={};var r,a;r=function(){We(`${n} (${e})`,`${e}:${t()}`,o)},i[a=o]||(r(),i[a]=requestAnimationFrame(()=>{i[a]=null}))},w=(e,t)=>()=>{let n=!1;const o=t=>()=>{G[c]?n&&n!==t||(e(t,c),n=t,requestAnimationFrame(()=>{n=!1})):l()},i=o(p),r=o("resize window");function s(e,t){t(window,p,i),t(window,f,r)}function l(){re(c,`stop${t}`),s(0,pe),u.disconnect(),d.disconnect(),pe(G[c].iframe,a,l)}const c=P,u=new ResizeObserver(o("pageObserver")),d=new ResizeObserver(o("iframeObserver"));G[c]&&(G[c][`stop${t}`]=l,fe(G[c].iframe,a,l),s(0,fe),u.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(G[c].iframe,{attributes:!0,childList:!1,subtree:!1}))},v=e=>()=>{e in G[P]&&(G[P][e](),delete G[P][e])},z=b(c,function(){const e=document.body.getBoundingClientRect(),t=N.iframe.getBoundingClientRect(),{scrollY:n,scrollX:o,innerHeight:i,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,i||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:o,documentHeight:a,documentWidth:s,windowHeight:i,windowWidth:r})}),$=b(u,function(){const{iframe:e}=N,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:o,height:i,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:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})}),j=w(z,"PageInfo"),T=w($,"ParentInfo"),x=v("stopPageInfo"),M=v("stopParentInfo");function E(e){const t=e.getBoundingClientRect();return Re(),{x:Number(t.left)+Number(ke.position.x),y:Number(t.top)+Number(ke.position.y)}}function R(e){const t=e?E(N.iframe):{x:0,y:0};ne(P,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,D,U,D);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(N,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){setTimeout(()=>t["scrollTo"+(e?"Offset":"")](n.x,n.y))}(o,n):function(e){ke.position=e,S(P)}(n)}function S(e){const{x:t,y:n}=ke.position,o=G[e]?.iframe;!1!==C("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?Oe(e):Se()}function O(e){let t={};if(0===N.width&&0===N.height){const e=y(9).split(n);t={x:e[1],y:e[0]}}else t={x:N.width,y:N.height};C(e,{iframe:N.iframe,screenX:Number(t.x),screenY:Number(t.y),type:N.type})}const C=(e,t)=>xe(P,e,t);function I(){const{height:t,iframe:n,msg:a,type:l,width:f}=N;switch(G[P]?.firstRun&&function(){if(!G[P])return;Be(P,N.mode),G[P].firstRun=!1}(),l){case"close":Ee(n);break;case s:h=y(6),C("onMessage",{iframe:N.iframe,message:JSON.parse(h)});break;case"mouseenter":O("onMouseEnter");break;case"mouseleave":O("onMouseLeave");break;case"beforeUnload":ne(P,"Ready state reset"),G[P].initialised=!1;break;case o:G[P].autoResize=JSON.parse(y(9));break;case"scrollBy":!function(){const e=N.width,t=N.height,n=window.parentIframe||window.parentIFrame||window;ne(P,`scrollBy: x: %c${e}%c y: %c${t}`,D,U,D),n.scrollBy(e,t)}();break;case"scrollTo":R(!1);break;case"scrollToOffset":R(!0);break;case c:j();break;case u:T();break;case"pageInfoStop":x();break;case"parentInfoStop":M();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let o=document.getElementById(n)||document.getElementsByName(n)[0];o?function(){const e=E(o);ne(P,`Moving to in page link: %c#${t}`,D),ke.position={x:e.x,y:e.y},S(P),window.location.hash=t}():window.top!==window.self&&function(){const e=window.parentIframe||window.parentIFrame;e&&e.moveToAnchor(t)}()}(y(9));break;case"title":!function(e,t){G[t]?.syncTitle&&(G[t].iframe.title=e,ne(t,`Set iframe title attribute: %c${e}`,D))}(a,P);break;case d:Ce(N);break;case i:r(),function(e){try{G[e].sameOrigin=!!G[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){G[e].sameOrigin=!1}}(P),(p=a)!==e&&(void 0!==p||le(P,"<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")),G[P].initialised=!0,C("onReady",n);break;default:if(0===f&&0===t)return void oe(P,`Unsupported message received (${l}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===f||0===t)return;if(document.hidden)return;r()}var p,h}function A(e){if(!G[e])throw new Error(`${N.type} No settings for ${e}. Message was: ${W}`)}let W=t.data;if("[iFrameResizerChild]Ready"===W)return L=t.source,void Object.values(G).forEach((e=>({initChild:t,postMessageTarget:n})=>{e===n&&t()})(L));var L;if(!(e=>k===`${e}`.slice(0,13)&&e.slice(13).split(n)[0]in G)(W)){if(typeof W!==g)return;return void re(m,"ignoredMessage")}const N=function(e){const t=e.slice(13).split(n),o=t[1]?Number(t[1]):0,i=G[t[0]]?.iframe,r=getComputedStyle(i),a={iframe:i,id:t[0],height:o+l(r)+h(r),width:Number(t[2]),type:t[3],msg:t[4]};return t[5]&&(a.mode=t[5]),a}(W),{id:F,type:B}=N,P=F;P?(re(P,B),se(P,function(e){A(P),N.type in{true:1,false:1,undefined:1}||(null!==N.iframe||(oe(P,`The iframe (${N.id}) was not found.`),0))&&function(){const{origin:e,sameOrigin:n}=t;if(n)return!0;let o=G[P]?.checkOrigin;if(o&&"null"!=`${e}`&&!(o.constructor===Array?function(){let t=0,n=!1;for(;t<o.length;t++)if(o[t]===e){n=!0;break}return n}():function(){const t=G[P]?.remoteHost;return e===t}()))throw new Error(`Unexpected message received from: ${e} for ${N.iframe.id}. Message was: ${t.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&I()})(W)):oe("","iframeResizer received messageData without id, message was: ",W)}function xe(e,t,n){let o=null,i=null;if(G[e]){if(o=G[e][t],typeof o!==b)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{i=o(n)}catch(n){console.error(n),oe(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(o,n)}return i}function Me(e){const{id:t}=e;delete G[t],delete e.iframeResizer}function Ee(e){const{id:t}=e;if(!1!==xe(t,"onBeforeClose",t)){try{e.parentNode&&e.remove()}catch(e){oe(t,e)}xe(t,"onAfterClose",t),Me(e)}}function Re(e){null===ke.position&&(ke.position={x:window.scrollX,y:window.scrollY})}function Se(){ke.position=null}function Oe(e){null!==ke.position&&(window.scrollTo(ke.position.x,ke.position.y),ne(e,`Set page position: %c${ke.position.x}%c, %c${ke.position.y}`,D,U,D),Se())}function Ce(e){Re(e.id),Ie(e),We(d,d,e.id)}function Ie(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,ne(n,`Set ${t}: %c${o}`,D)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=G[n];o&&t("height"),i&&t("width")}const Ae=e=>e.split(n).filter((e,t)=>19!==t).join(n);function We(e,t,n){function o(o){const i=e in x?Ae(t):t;ne(n,o,D,U,D),ne(n,`Message data: %c${i}`,D)}re(n,e),G[n]&&(G[n]?.postMessageTarget?function(){const{iframe:i,postMessageTarget:r,sameOrigin:a,targetOrigin:s}=G[n];if(a)try{return i.contentWindow.iframeChildListener(k+t),void o(`Sending message to iframe %c${n}%c via same origin%c`)}catch(t){e in x?G[n].sameOrigin=!1:oe(n,"Same origin messaging failed, falling back to postMessage")}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${s}`),r.postMessage(k+t,s)}():oe(n,`Iframe(${n}) not found`))}let Le=0,Ne=!1,Fe=!1;function Be(t,n=-3){if(Ne)return;const o=Math.max(G[t].mode,n);if(o>G[t].mode&&(G[t].mode=o),o<0)throw ae(t),G[t].vAdvised||le(t||"Parent",`${ve(o+2)}${ve(2)}`),G[t].vAdvised=!0,ve(o+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");o>0&&Fe||function(e,t){queueMicrotask(()=>console.info(`%ciframe-resizer ${e}`,_||t<1?"font-weight: bold;":S))}(`v${e} (${(e=>me(be[e]))(o)})`,o),o<1&&le("Parent",ve(3)),Ne=!0}const Pe=e=>c=>{function u(){G[O]?.heightCalculationMethod in T&&Ce({iframe:c,height:1,width:1,type:i})}function d(){if(G[O]){const{iframe:e}=G[O],t={close:Ee.bind(null,e),disconnect:Me.bind(null,e),removeListeners(){le(O,"<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize(){le(O,"<rb>Deprecated Method</>\n \nUse of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As their are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code."),We.bind(null,"Window resize",f,O)},moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${o=t,o.charAt(0).toUpperCase()+o.slice(1)}`);var o})(e,g,"moveToAnchor(anchor) anchor"),We("Move to anchor",`moveToAnchor:${e}`,O)},sendMessage(e){e=JSON.stringify(e),We(s,`${s}:${e}`,O)}};e.iframeResizer=t,e.iFrameResizer=t}}function p(e,t){const n=n=>()=>{if(!G[e])return;const{firstRun:o,iframe:r}=G[e];We(n,t,e),(e=>e===i)(n)&&(e=>"lazy"===e.loading)(r)||$e(e,G),o||u()},{iframe:o}=G[e];G[e].initChild=n(r),function(e,t){fe(e,a,()=>setTimeout(t,1))}(o,n(l)),function(e,t){const{iframe:n,waitForLoad:o}=G[e];!0!==o&&((e=>{const{src:t,srcdoc:n}=e;return!n&&(null==t||""===t||"about:blank"===t)})(n)?setTimeout(()=>{re(e,"noContent"),ne(e,"No content detected in the iframe, delaying initialisation")}):setTimeout(t))}(e,n(i))}function m(e){return e?(("sizeWidth"in e||"sizeHeight"in e||o in e)&&le(O,`<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>"${$}"</>, <i>"${j}"</> or <i>"${z}"</>.\n`),e):{}}function b(e){const t=G[e]?.iframe?.title;return""===t||void 0===t}function w(e,t){Z(G[O],e)&&(le(O,`<rb>Deprecated option</>\n\nThe <b>${e}</> option has been renamed to <b>${t}</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.`),G[O][t]=G[O][e],delete G[O][e])}const k=e=>Z(e,"onMouseEnter")||Z(e,"onMouseLeave");function x(e){var t,n;G[O]={...G[O],iframe:c,remoteHost:c?.src.split("/").slice(0,3).join("/"),...je,...m(e),mouseEvents:k(e),mode:ze(e),syncTitle:b(O)},w("offset","offsetSize"),w("onClose","onBeforeClose"),w("onClosed","onAfterClose"),re(O,"setup"),function(){const{direction:e}=G[O];switch(e){case $:break;case j:G[O].sizeHeight=!1;case"both":G[O].sizeWidth=!0;break;case z:G[O].sizeWidth=!1,G[O].sizeHeight=!1,G[O].autoResize=!1;break;default:throw new TypeError(O,`Direction value of "${e}" is not valid`)}}(),(t=e?.offsetSize||e?.offset)&&(G[O].direction===$?G[O].offsetHeight=t:G[O].offsetWidth=t),function(e){e?.offset&&le(O,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.")}(e),G[O].warningTimeout||ne(O,"warningTimeout:%c disabled",D),null===G[O].postMessageTarget&&(G[O].postMessageTarget=c.contentWindow),G[O].targetOrigin=!0===G[O].checkOrigin?""===(n=G[O].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*"}const S=()=>t in c,O=function(t){if(t&&typeof t!==g)throw new TypeError("Invalid id for iFrame. Expected String");return""!==t&&t||(t=function(){let t=e?.id||je.id+Le++;return null!==document.getElementById(t)&&(t+=Le++),t}(),c.id=t,re(t,"assignId")),t}(c.id);if(typeof e!==y)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=E,e.logExpand=t.includes("ifrlog=expanded"))}(e),function(e,t){const n=Z(t,"log"),o=typeof t.log===g,i=n?!!o||t.log:je.log;Z(t,"logExpand")||(t.logExpand=n&&o?t.log===M:je.logExpand),function(e){-1===e?.log&&(e.log=!1,Fe=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const o=X({expand:t,label:K(n)});_=e,G[n]||(G[n]={console:o})}({enabled:i,expand:t.logExpand,iframeId:e}),o&&!(t.log in R)&&ie(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=i}(O,e),se(O,function(e){S()?oe(O,`Ignored iframe (${O}), already setup.`):(x(e),function(){if(Ne)return;const{mode:e}=G[O];-1!==e&&Be(O,e)}(),qe(),function(){switch(c.style.overflow=!1===G[O]?.scrolling?"hidden":v,G[O]?.scrolling){case"omit":break;case!0:c.scrolling="yes";break;case!1:c.scrolling="no";break;default:c.scrolling=G[O]?G[O].scrolling:"no"}}(),function(){const{bodyMargin:e}=G[O];"number"!=typeof e&&"0"!==e||(G[O].bodyMargin=`${e}px`)}(),p(O,function(e){const{autoResize:t,bodyBackground:o,bodyMargin:i,bodyPadding:r,heightCalculationMethod:a,inPageLinks:s,license:l,log:c,logExpand:u,mouseEvents:d,offsetHeight:f,offsetWidth:p,mode:m,sizeHeight:g,sizeWidth:y,tolerance:b,widthCalculationMethod:w}=G[e];return[e,"8",y,c,"32",!0,t,i,a,o,r,b,s,h,w,d,f,p,g,l,ke.version,m,"",u].join(n)}(O)),d())})(e),c?.iframeResizer};function He(){!0!==document.hidden&&((e,t)=>{Object.values(G).filter(({autoResize:e,firstRun:t})=>e&&!t).forEach(({iframe:n})=>We(e,t,n.id))})("tabVisible",f)}const qe=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{fe(window,s,Te),fe(document,"visibilitychange",He),window.iframeParentListener=e=>setTimeout(()=>Te({data:e,sameOrigin:!0}))}),De=`[${t}] `;const Ue=function(){function e(e){switch(!0){case!e:throw new TypeError(`${De}iframe is not defined`);case!e.tagName:throw new TypeError(`${De}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${De}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(o,i){if(typeof window===w)return[];switch(t=Pe(o),n=[],typeof i){case w:case g:document.querySelectorAll(i||"iframe").forEach(e);break;case y:e(i);break;default:throw new TypeError(`${De}Unexpected data type (${typeof i})`)}return Object.freeze(n)}}();return typeof window!==w&&(window.iFrameResize=window.iFrameResize||function(...e){ue("iFrameResize()","iframeResize()","",m),Ue(...e)}),Ue});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iframe-resizer",
3
- "version": "5.5.6",
3
+ "version": "5.5.7",
4
4
  "license": "GPL-3.0",
5
5
  "homepage": "https://iframe-resizer.com",
6
6
  "author": {
@@ -33,8 +33,8 @@
33
33
  "legacy"
34
34
  ],
35
35
  "dependencies": {
36
- "@iframe-resizer/child": "5.5.6",
37
- "@iframe-resizer/jquery": "5.5.6",
38
- "@iframe-resizer/parent": "5.5.6"
36
+ "@iframe-resizer/child": "5.5.7",
37
+ "@iframe-resizer/jquery": "5.5.7",
38
+ "@iframe-resizer/parent": "5.5.7"
39
39
  }
40
40
  }