@iframe-resizer/child 5.5.7-beta.1 → 5.5.8-beta.1

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.umd.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/child 5.5.7-beta.1 (umd) - 2025-09-21
4
+ * @module iframe-resizer/child 5.5.8-beta.1 (umd) - 2026-01-22
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -13,9 +13,9 @@
13
13
  *
14
14
  * @see {@link https://iframe-resizer.com}
15
15
  *
16
- * @copyright (c) 2013 - 2025, David J. Bradshaw. All rights reserved.
16
+ * @copyright (c) 2013 - 2026, David J. Bradshaw. All rights reserved.
17
17
  */
18
18
 
19
19
 
20
- !function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!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:d}=Object,u=e=>[e,c[e]],f=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(d(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.7-beta.1",v="iframeResizer",b=":",z="init",w="message",$="pageHide",S="pageInfo",O="parentInfo",M="scrollToOffset",E="title",k=10,j="data-iframe-size",x="data-iframe-overflowed",T="data-iframe-ignore",I="height",A="width",C="offset",P="offsetSize",N="string",R="number",q="object",L="function",B="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="No change in content size detected",ee="[iFrameSizer]",te=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),ne=(e,t,n,o)=>e.addEventListener(t,n,o||!1),oe=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)},re=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),ie=["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."],se=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],ce=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),le=e=>re(ae[e]),de=e=>{const t=e[re(ie[0])]||e[re(ie[1])]||e[re(ie[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=oe(re(e));return n in ce&&(t=ce[n]),t}(n[0]);return 0===o||(e=>e[2]===oe(e[0]+e[1]))(n)||(o=-2),o},ue=(e,...t)=>setTimeout(()=>e(...t),0),fe=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},me=e=>e,pe=e=>Math.round(1e3*e)/1e3,he=e=>e.charAt(0).toUpperCase()+e.slice(1),ge=e=>""!=`${e}`&&void 0!==e,ye=e=>e();const ve=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${he(t)}`)};let be=!0,ze=v;const we=($e=function(n={}){const l={},d={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function v(){delete h.event,y()}const b=()=>!!p.some(([e])=>e in i)||!!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?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(),v()}else v()}function w(){""===g&&(g=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function $(e,...t){0===p.length&&(w(),queueMicrotask(()=>queueMicrotask(z))),p.push([e,...t])}function S(e=r,...t){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,u),assert:function(e,...t){!0!==e&&$("assert",e,...t)},count:function(e=r){d[e]?d[e]+=1:d[e]=1,$("log",`${e}: ${d[e]}`)},countReset:function(e=r){delete d[e]},endAutoGroup:z,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;$("error",e),z()}return n},event:function(e){w(),h.event=e},purge:y,time:function(e=r){w(),l[e]=performance.now()},timeEnd:function(e=r){S(e),delete l[e]},timeLog:S,touch:w}},$e?.__esModule?$e.default:$e);var $e;const Se=we({label:`${v}(child)`,expand:!1});const Oe=e=>(...t)=>!be||Se[e](...t),Me=Oe("log"),Ee=Me,ke=Oe("debug");const{assert:je,endAutoGroup:xe,error:Te,errorBoundary:Ie,event:Ae,label:Ce,purge:Pe,warn:Ne}=Se,Re=e=>{return Se.warn((t=me,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},qe=(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)=>Re(t)),Le=qe("Method"),Be=qe("Method","replaced with"),De=qe("Option"),Fe=["min-height","min-width","max-height","max-width"],We=new Set,He=e=>e.tagName?e.tagName.toLowerCase():"unknown",Ue=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Ve=(e,t)=>{return(n=Ue(e,t))&&"0px"!==n&&n!==B&&"none"!==n;var n};function Ze({href:e}){We.has(e)||(Me("Unable to access stylesheet:",e),We.add(e))}const Je=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){Ze(n)}return{source:"cross-origin stylesheet",value:Ue(e,t)}}(e,t),_e=(e,t)=>{const{source:n,value:o}=Je(e,t),r=He(e);Re(`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 Qe(){for(const e of[document.documentElement,document.body])for(const t of Fe)Me(`Checking <${He(e)}> for blocking CSS: ${t}`),Ve(e,t)&&_e(e,t)}const Ge=e=>t=>void 0===t?void 0:e(t),Ye=Ge(e=>"true"===e),Xe=Ge(Number),Ke=(e="")=>t=>n=>{n.size>0&&ke(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))},et=Ke("attached to"),tt=((e="")=>t=>n=>{n.size>0&&Te(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),nt=Ke("detached from"),ot=(t,n=!0)=>o=>{o>0&&Ee(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},rt=(e,t,n,o)=>{const r=nt(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()}},it="Mutation",at=new Set,st=new Set,ct=new Set,lt=[],dt={attributes:!0,attributeFilter:[T,j],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let ut,ft=1,mt=!1,pt=0;const ht=Ke("added")(it),gt=Ke("removed (page)")(it),yt=Ke("removed (added)")(it),vt=e=>e.nodeType!==Node.ELEMENT_NODE||te.has(e.tagName.toLowerCase());function bt(e){const t=e.addedNodes;for(const e of t)vt(e)||at.add(e)}function zt(e){const t=e.removedNodes;for(const e of t)vt(e)||(at.has(e)?(at.delete(e),ct.add(e)):st.add(e))}const wt=e=>{Ee("Mutations:",e);for(const t of e)bt(t),zt(t);ht(at),gt(st),yt(ct),ct.clear()};const $t=e=>()=>{const t=performance.now(),n=t-pt,o=16*ft+++2;if(n>o&&n<200)return Ae("mutationThrottled"),Ee("Update delayed due to heavy workload on the callStack"),Ee(`EventLoop busy time: %c${pe(n)}ms %c> Max wait: %c${o-2}ms`,h,g,h),setTimeout(ut,16*ft),void(pt=t);ft=1,lt.forEach(wt),lt.length=0,mt=!1,st.size>0&&Me(`Detected %c${st.size} %cremoved element${st.size>1?"s":""}`,h,g),at.size>0&&Me(`Found %c${at.size} %cnew element${at.size>1?"s":""}`,h,g),e({addedNodes:at,removedNodes:st}),at.clear(),st.clear()};function St(e){lt.push(e),mt||(pt=performance.now(),mt=!0,requestAnimationFrame(ut))}function Ot(e){const t=new window.MutationObserver(St),n=document.body||document.documentElement;return ut=$t(e),t.observe(n,dt),Ee("Attached MutationObserver to body"),{...t,disconnect:()=>{at.clear(),st.clear(),lt.length=0,t.disconnect(),Ee("Detached MutationObserver")}}}const Mt="Overflow",Et=ot(Mt),kt=ot(Mt,!1),jt=et(Mt),xt=tt(Mt),Tt=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,It=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||me,i=(t=!1)=>e(t),a=(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 i=e[n],c=a(i,o)&&!Tt(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));xt(t),jt(n),Et(o),n.clear(),t.clear()},detachObservers:rt(Mt,c,l,kt),disconnect:()=>{c.disconnect(),Ee("Detached OverflowObserver")}}},At="--ifr-start",Ct="--ifr-end",Pt="--ifr-measure",Nt=[];let Rt,qt={},Lt=0;function Bt(){try{performance.clearMarks(At),performance.clearMarks(Ct),performance.clearMeasures(Pt)}catch{}}function Dt(e){e.getEntries().forEach(e=>{if(e.name===Ct)try{const{duration:t}=performance.measure(Pt,At,Ct);qt=e.detail,Nt.push(t),Nt.length>100&&Nt.shift()}catch{}})}function Ft(){Ee("Attached PerformanceObserver to page");const e=new PerformanceObserver(Dt);return e.observe({entryTypes:["mark"]}),Rt=setInterval(()=>{if(Nt.length<10)return;if(qt.hasTags&&qt.len<25)return;Nt.sort();const e=Math.min(Nt.reduce((e,t)=>e+t,0)/Nt.length,Nt[Math.floor(Nt.length/2)]),t=pe(e);t>Lt&&(Lt=t,Ae("performanceObserver"),Me("Mean time:",pe(Nt[Math.floor(Nt.length/2)])),Me("Median time:",pe(Nt.reduce((e,t)=>e+t,0)/Nt.length)),Me("Average time:",t),Me("Max time:",pe(Math.max(...Nt)))),Bt(),e<=4||(clearInterval(Rt),Re(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${pe(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${qt.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{Bt(),clearInterval(Rt),e.disconnect(),Ee("Detached PerformanceObserver")}}}const Wt="Resize",Ht=ot(Wt),Ut=ot(Wt,!1),Vt=et(Wt),Zt=tt(Wt),Jt=new WeakSet,_t=new Set,Qt=new Set;let Gt;function Yt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(Jt.has(n)?_t.add(n):(Gt.observe(n),Jt.add(n),Qt.add(n),t+=1))}Zt(_t),Vt(Qt),Ht(t),Qt.clear(),_t.clear()}function Xt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),Ee("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),Ee("Detached VisibilityObserver")}}}const Kt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},en=Kt(L),tn=Kt(R),nn=Kt(N);"undefined"!=typeof window&&function(){const o={height:()=>(Ne("Custom height calculation function not defined"),qn.auto()),width:()=>(Ne("Custom width calculation function not defined"),Ln.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},i={},a=B,s=[],c="scroll";let l,d,u,f,m,p,oe,ae,ce,we=!0,$e="",Oe=0,Pe="",qe="",Fe=!1,We=!0,He=!1,Ue=!0,Ve=!1,Ze=!1,Je=!0,_e=!1,Ge=1,Ke=a,et="",tt=!0,nt={},ot=!1,it=!1,at=!1,st=0,ct=!1,lt=0,dt=0,ut=new Set,ft="",mt="child",pt=!1,ht="",gt=[],yt=window.parent,vt="*",bt=0,zt=!1,wt=1,$t=c,St=window,Mt=()=>{Ne("onMessage function not defined")},Et=()=>{},kt=null,jt=null;function xt(e){var t;!function(e){ft=e[0]??ft,Oe=Xe(e[1])??Oe,He=Ye(e[2])??He,at=Ye(e[3])??at,we=Ye(e[6])??we,Pe=e[7]??Pe,Ke=e[8]??Ke,$e=e[9]??$e,qe=e[10]??qe,bt=Xe(e[11])??bt,nt.enable=Ye(e[12])??!1,mt=e[13]??mt,$t=e[14]??$t,ct=Ye(e[15])??ct,lt=Xe(e[16])??lt,dt=Xe(e[17])??dt,We=Ye(e[18])??We,l=e[19]??l,ae=e[20]??ae,st=Xe(e[21])??st,it=Ye(e[23])??it}(e),ze=(t={id:ft,enabled:at,expand:it}).id||v,Se.label(`${ze}`),Se.expand(t.expand),be=t.enabled,Me(`Initialising iframe v${y} ${window.location.href}`),function(){function e(e){Me("Reading data from page:",Object.keys(e)),ce=en(e,"onBeforeResize")??ce,Mt=en(e,"onMessage")??Mt,Et=en(e,"onReady")??Et,typeof e?.offset===R&&(De(C,P),We&&(lt=tn(e,C)??lt),He&&(dt=tn(e,C)??dt)),typeof e?.offsetSize===R&&(We&&(lt=tn(e,P)??lt),He&&(dt=tn(e,P)??dt)),d=nn(e,re(ie[0]))??d,et=nn(e,"ignoreSelector")??et,ht=nn(e,"sizeSelector")??ht,vt=nn(e,"targetOrigin")??vt,Ke=e?.heightCalculationMethod||Ke,$t=e?.widthCalculationMethod||$t}function t(e,t){return typeof e===L&&(Re(`<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===st)return;const n=window.iframeResizer||window.iFrameResizer;typeof n===q&&(e(n),Ke=t(Ke,I),$t=t($t,A),Ee(`Set targetOrigin for parent: %c${vt}`,h))}(),[Dt,Vt,un,Lt,Ht,ln,dn,sn,Bt,Rt,Fe?me:Qe,Qt,gn,hn,pn,Kt,()=>Zt("background",$e),()=>Zt("padding",qe),Fe?me:on,mn,fn,jn,Pt].forEach(e=>{try{e()}catch(e){if(st<0)throw e;Re("<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</>"),Te(e)}}),Nt(fe(Et)),Me("Initialization complete"),Vn(z,"Init message from host page",void 0,void 0,`${y}:${st}`),document.title&&""!==document.title&&_n(0,0,E,document.title)}function Tt({persisted:e}){e||_n(0,0,"beforeUnload"),Ae($),Ee("Page persisted:",e),e||s.forEach(ye)}const Pt=()=>ne(window,$.toLowerCase(),Tt);function Nt(e){"complete"===document.readyState?ue(e):ne(document,D,()=>Nt(e))}function Rt(){gt=document.querySelectorAll(`[${j}]`),_e=gt.length>0,Me(`Tagged elements found: %c${_e}`,h)}let qt=0;function Lt(){const n=document.querySelectorAll(`*[${T}]`);return Ve=n.length>0,Ve&&n.length!==qt&&(function(n){const o=1===n.length?"":"s";Ne(`%c[${T}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),qt=n.length),Ve}function Bt(){"BackCompat"===document.compatMode&&Re("<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 Dt(){ae&&""!==ae&&"false"!==ae?ae!==y&&Re(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ae} - Child page: ${y}.\n`):Re("<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 Ht(){try{pt=1===st||"iframeParentListener"in window.parent}catch(e){Me("Cross domain iframe detected")}}function Vt(){He===We&&(Fe=!0)}function Zt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),Ee(`Set body ${e}: %c${t}`,h))}function _t(e,t,n){if(""!==n){Me(`${e}: %c${n}`,h);for(const e of document.querySelectorAll(n))Me(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Qt(){_t("sizeSelector",j,ht),_t("ignoreSelector",T,et)}function Kt(){var e,t;void 0===Pe&&(Pe=`${Oe}px`),Zt("margin",(e="margin",(t=Pe).includes("-")&&(Ne(`Negative CSS value ignored for ${e}`),t=""),t))}function on(){const e=e=>e.style.setProperty(I,B,"important");e(document.documentElement),e(document.body),Me("Set HTML & body height: %cauto !important",h)}function rn(e){({add(t){function n(){Vn(e.eventName,e.eventType)}i[t]=n,ne(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),Me(`${he(e.method)} event listener: %c${e.eventType}`,h)}function an(e){rn({method:e,eventType:"After Print",eventName:"afterprint"}),rn({method:e,eventType:"Before Print",eventName:"beforeprint"}),rn({method:e,eventType:"Ready State Change",eventName:D})}function sn(){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&&Re("<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 cn(e,t,n){const{label:o}=n;return t!==e&&(e in n||(Ne(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&Re(`<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 ${ae?"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`),Me(`Set ${o} calculation method: %c${e}`,h),e}function ln(){Ke=cn(Ke,a,qn)}function dn(){$t=cn($t,c,Ln)}function un(){const t=st,n=de({key:l}),o=de({key:d});if(st=Math.max(n,o),st<0){if(st=Math.min(n,o),Re(`${le(st+2)}${le(2)}`),ge(ae))throw le(st+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!ge(ae)||t>-1&&st>t)&&(sessionStorage.getItem("ifr")!==y&&function(t,n){console.info(`${ze} %ciframe-resizer ${t}`,be||n<1?"font-weight: bold;":e)}(`v${y} (${(e=>re(se[e]))(st)})`,st),st<2&&Re(le(3)),sessionStorage.setItem("ifr",y))}function fn(){!0!==we&&Me("Auto Resize disabled"),an("add"),s.push(()=>an("remove"))}function mn(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function pn(){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?(Me(`In page link (#${n}) not found in iframe, so sending to parent`),_n(0,0,"inPageLink",`#${n}`)):function(t){const o=e(t);Me(`Moving to in page link (%c#${n}%c) at x: %c${o.x}%c y: %c${o.y}`,h,g,h,g,h),_n(o.y,o.x,M)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}const{enable:o}=nt;o?1===st?Re(le(5)):(Me("Setting up location.hash handlers"),function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&ne(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),ne(window,"hashchange",n),setTimeout(n,128)):Me("In page linking not enabled"),nt={...nt,findTarget:t}}function hn(){function e(e){_n(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){Me(`Add event listener: %c${n}`,h),ne(window.document,t,e)}!0===ct&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}function gn(){1!==st&&(St.parentIframe=Object.freeze({autoResize:e=>(ve(e,"boolean","parentIframe.autoResize(enable) enable"),!1===He&&!1===We?(Ae(H),Re("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===we?(we=!0,queueMicrotask(()=>Vn(H,"Auto Resize enabled"))):!1===e&&!0===we&&(we=!1),_n(0,0,"autoResize",JSON.stringify(we)),we)),close(){_n(0,0,"close")},getId:()=>ft,getOrigin:()=>(Ae("getOrigin"),Le("getOrigin()","getParentOrigin()"),u),getParentOrigin:()=>u,getPageInfo(e){if(typeof e===L)return kt=e,_n(0,0,S),void Be("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");kt=null,_n(0,0,"pageInfoStop")},getParentProps:e=>(ve(e,L,"parentIframe.getParentProps(callback) callback"),jt=e,_n(0,0,O),()=>{jt=null,_n(0,0,"parentInfoStop")}),getParentProperties(e){Le("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){ve(e,N,"parentIframe.moveToAnchor(anchor) anchor"),nt.findTarget(e)},reset(){!function(){const e=Ke;Ke=a,Me(`Reset trigger event: %c${"parentIframe.reset"}`,h),zt?Me("TriggerLock blocked calculation"):(zt=!0,ke("Trigger event lock on"),requestAnimationFrame(()=>{zt=!1,ke("Trigger event lock off")})),Zn("reset"),Ke=e}()},setOffsetSize(e){ve(e,R,"parentIframe.setOffsetSize(offset) offset"),lt=e,dt=e,Vn(_,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){ve(e,R,"parentIframe.scrollBy(x, y) x"),ve(t,R,"parentIframe.scrollBy(x, y) y"),_n(t,e,"scrollBy")},scrollTo(e,t){ve(e,R,"parentIframe.scrollTo(x, y) x"),ve(t,R,"parentIframe.scrollTo(x, y) y"),_n(t,e,"scrollTo")},scrollToOffset(e,t){ve(e,R,"parentIframe.scrollToOffset(x, y) x"),ve(t,R,"parentIframe.scrollToOffset(x, y) y"),_n(t,e,M)},sendMessage(e,t){t&&ve(t,N,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),_n(0,0,w,JSON.stringify(e),t)},setHeightCalculationMethod(e){Ke=e,ln()},setWidthCalculationMethod(e){$t=e,dn()},setTargetOrigin(e){ve(e,N,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),Me(`Set targetOrigin: %c${e}`,h),vt=e},resize(e,t){void 0!==e&&ve(e,R,"parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&ve(t,R,"parentIframe.resize(customHeight, customWidth) customWidth"),Vn(V,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){Le("size()","resize()"),this.resize(e,t)}}),St.parentIFrame=St.parentIframe)}let yn=new Set;function vn(){const e=document.querySelectorAll(`[${x}]`);ut=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(()=>{Ae("overflowIgnored"),Ee("Ignoring elements with [data-iframe-ignore] > *:\n",n),xe()}),t}(e),Ze=ut.size>0,typeof Set.prototype.symmetricDifference===L&&(Je=ut.symmetricDifference(yn).size>0),yn=ut}function bn(){switch(vn(),!0){case!Je:return;case ut.size>1:Ee("Overflowed Elements:",ut);break;case Ze:break;default:Ee("No overflow detected")}Vn(G,"Overflow updated")}function zn(e){const t={root:document.documentElement,side:We?F:W};return f=It(bn,t),f.attachObservers(e),f}function wn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Vn(Q,`Element resized <${function(e){switch(!0){case!ge(e):return"";case ge(e.id):return`${e.nodeName}#${e.id}`;case ge(e.name):return`${e.nodeName} (${e.name}`;case ge(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function $n(e){return Gt=new ResizeObserver(wn),Gt.observe(document.body),Jt.add(document.body),Ee("Attached ResizeObserver to body"),m={attachObserverToNonStaticElements:Yt,detachObservers:rt(Wt,Gt,Jt,Ut),disconnect:()=>{Gt.disconnect(),Ee("Detached ResizeObserver")}},m.attachObserverToNonStaticElements(e),m}function Sn(e){Me(`Visible: %c${e}`,h),ot=!e,Vn(X,"Visibility changed")}const On=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of An(n))t.add(e)}return Ee("Inspecting:\n",t),t},Mn=e=>{if(0===e.size)return;Ae("addObservers");const t=On(e);f.attachObservers(t),m.attachObserverToNonStaticElements(t),xe()},En=e=>{if(0===e.size)return;Ae("removeObservers");const t=On(e);f.detachObservers(t),m.detachObservers(t),xe()};function kn(e){!function({addedNodes:e,removedNodes:t}){Ae("contentMutated"),Qt(),Rt(),vn(),xe(),En(t),Mn(e)}(e),Vn(Y,"Mutation Observed")}function jn(){const e=An(document.documentElement);var t;Me("Attaching Observers"),t=[Ot(kn),zn(e),Ft(),$n(e),Xt(Sn)],s.push(...t.map(e=>e.disconnect))}function xn(e){performance.mark(At);const t=he(e);let n=1,o=document.documentElement,r=_e?0:document.documentElement.getBoundingClientRect().bottom;const i=_e?gt:Ze?Array.from(ut):An(document.documentElement);for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return Ee(`${t} position calculated from:`,o),Ee(`Checked %c${i.length}%c elements`,h,g),performance.mark(Ct,{detail:{hasTags:_e,len:i.length,logging:at,Side:t}}),r}const Tn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],In=`* ${Array.from(te).map(e=>`:not(${e})`).join("")}`,An=e=>e.querySelectorAll(In),Cn={height:0,width:0},Pn={height:0,width:0},Nn=[h,g,h];function Rn(e){function t(){return Pn[o]=r,Cn[o]=s,Math.max(r,1)}const n=e===qn,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 _e:Ee("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!Ze&&Ue&&0===Pn[o]&&0===Cn[o]:Ee(`Initial page size values: ${c}`,...Nn),l=t();break;case zt&&r===Pn[o]&&s===Cn[o]:Ee(`Size unchanged: ${c}`,...Nn),l=Math.max(r,s);break;case 0===r&&0!==s:Ee(`Page is hidden: ${c}`,...Nn),l=s;break;case!Ze&&r!==Pn[o]&&s<=Cn[o]:Ee(`New <html> size: ${c} `,...Nn),Ee(`Previous <html> size: %c${Pn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!Ze&&r<Pn[o]:Ee(`<html> size decreased: ${c}`,...Nn),l=t();break;case s===a||s===i:Ee(`<html> size equals page size: ${c}`,...Nn),l=t();break;case r>s:Ee(`Page size < <html> size: ${c}`,...Nn),l=t();break;case Ze:Ee("Found elements possibly overflowing <html> "),l=e.taggedElement();break;default:Ee(`Using <html> size: ${c}`,...Nn),l=t()}return Ee(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&Ee(`Page offsetSize: %c${t}px`,h),t}(e),Math.max(l,1)}const qn={label:I,enabled:()=>We,getOffset:()=>lt,auto:()=>Rn(qn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,k)+parseInt(t.marginBottom,k)},bodyScroll:()=>document.body.scrollHeight,offset:()=>qn.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(...Tn(qn)),min:()=>Math.min(...Tn(qn)),grow:()=>qn.max(),lowestElement:()=>xn(F),taggedElement:()=>xn(F)},Ln={label:A,enabled:()=>He,getOffset:()=>dt,auto:()=>Rn(Ln),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(...Tn(Ln)),min:()=>Math.min(...Tn(Ln)),rightMostElement:()=>xn(W),scroll:()=>Math.max(Ln.bodyScroll(),Ln.documentElementScroll()),taggedElement:()=>xn(W)},Bn=(e,t)=>!(Math.abs(e-t)<=bt);function Dn(e,t){const n=e[t](),o=e.enabled()&&void 0!==ce?function(e){const t=ce(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 je(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let Fn=!1;const Wn=fe(()=>Re(le(4)));let Hn,Un=!1;const Vn=Ie((e,t,n,o,r)=>{switch(Ae(e),!0){case!0===ot:if(!0===Un)break;Me("Iframe hidden - Ignored resize request"),Un=!0,Fn=!1,cancelAnimationFrame(Hn);break;case!0===Fn&&e!==G:Me("Resize already pending - Ignored resize request");break;case!we&&!(e in J):Ee("Resizing disabled");break;default:Un=!1,Fn=!0,oe=performance.now(),p=!0,Hn=requestAnimationFrame(()=>{Fn=!1,Ae("requestAnimationFrame"),ke(`Reset sendPending: %c${e}`,h)}),function(e,t,n,o,r){const i=n??Dn(qn,Ke),a=o??Dn(Ln,$t),s=We&&Bn(Ge,i)||He&&Bn(wt,a)?U:e;switch(Me(`Resize event: %c${t}`,h),s){case z:case H:case U:Ge=i,wt=a;case _:Jn(Ge,wt,e,r);break;case G:case Y:case Q:case X:Me(K);break;default:Ee(K)}p=!1}(e,t,n,o,r)}xe()});function Zn(e){Ge=qn[Ke](),wt=Ln[$t](),_n(Ge,wt,e)}function Jn(e,t,o,r,i){st<-1||(void 0!==i?Me(`Message targetOrigin: %c${i}`,h):i=vt,function(){const a=`${ft}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(pt)try{window.parent.iframeParentListener(ee+a)}catch(e){if(1!==st)throw e;return void Wn()}else yt.postMessage(ee+a,i);p&&Me(function(){const e=pe(performance.now()-oe);return o===z?`Initialised iframe in %c${e}ms`:`Size calculated in %c${e}ms`}(),h),Ee(`Sending message to parent page via ${pt?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}())}const _n=Ie((e,t,n,o,r)=>{Ae(n),Jn(e,t,n,o,r),xe()}),Qn=Ie(function(e){Ae("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>t(n(e)),r=e=>_n(0,0,`${e}Stop`),i={init:function(){if("loading"===document.readyState)return void Me("Page not ready, ignoring init message");const t=e.data.slice(13).split(b);yt=e.source,u=e.origin,xt(t),Ue=!1,setTimeout(()=>{tt=!1},128)},reset(){tt?Me("Page reset ignored by init"):(Me("Page size reset by host page"),Zn("resetPage"))},resize(){Me("Resize requested by host page"),Vn(Z,"Parent window requested size check")},moveToAnchor(){nt.findTarget(s())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=s();Me("PageInfo received from parent:",o(e)),kt?ue(kt,n(e)):r(S)},parentInfo(){const e=o(s());Me("ParentInfo received from parent:",e),jt?ue(jt,e):r(O)},message(){const e=s();Me("onMessage called from parent:%c",h,o(e)),ue(Mt,n(e))}},a=()=>e.data.split("]")[1].split(b)[0],s=()=>e.data.slice(e.data.indexOf(b)+1),c=()=>e.data.split(b)[2]in{true:1,false:1};function l(){const t=a();Ae(t),t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||c()||Ne(`Unexpected message (${e.data})`)}ee===`${e.data}`.slice(0,13)&&function(){if(!1!==Ue)return c()?(Ce(a()),Ae(z),void i.init()):void Me(`Ignored message of type "${a()}". Received before initialization.`);l()}()});let Gn=!1;const Yn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function Xn(){if("loading"===document.readyState||!Ue||Gn)return;const{parent:e,top:t}=window;Ae("ready"),Me("Sending%c ready%c to parent from",h,g,window.location.href),Yn(e),e!==t&&Yn(t),Gn=!0}"iframeChildListener"in window?Ne("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Qn({data:e,sameOrigin:!0})),ne(window,w,Qn),ne(document,D,Xn),Xn())}()});
20
+ !function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!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:d}=Object,u=e=>[e,c[e]],f=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(d(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.8-beta.1",b="iframeResizer",v=":",z="init",w="message",$="pageHide",S="pageInfo",O="parentInfo",M="scrollToOffset",E="title",k=10,j="data-iframe-size",x="data-iframe-overflowed",I="data-iframe-ignore",T="height",A="width",C="offset",P="offsetSize",R="string",N="number",q="object",L="function",B="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="No change in content size detected",ee="[iFrameSizer]",te=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),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"],ie=["<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."],ae=["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(ie[e]),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},de=(e,...t)=>setTimeout(()=>e(...t),0),ue=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,ge=e=>e();const ye=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${pe(t)}`)},be={br:"\n",rb:"",bb:"",b:"",i:"",u:"","/":""},ve=Object.keys(be),ze=new RegExp(`<(${ve.join("|")})>`,"gi"),we=(e,t)=>be[t]??"";let $e=!0,Se=b;const Oe=(Me=function(n={}){const l={},d={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function b(){delete h.event,y()}const v=()=>!!p.some(([e])=>e in i)||!!h.expand;function z(){if(0!==p.length){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 w(){""===g&&(g=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function $(e,...t){0===p.length&&(w(),queueMicrotask(()=>queueMicrotask(z))),p.push([e,...t])}function S(e=r,...t){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,u),assert:function(e,...t){!0!==e&&$("assert",e,...t)},count:function(e=r){d[e]?d[e]+=1:d[e]=1,$("log",`${e}: ${d[e]}`)},countReset:function(e=r){delete d[e]},endAutoGroup:z,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;$("error",e),z()}return n},event:function(e){w(),h.event=e},purge:y,time:function(e=r){w(),l[e]=performance.now()},timeEnd:function(e=r){S(e),delete l[e]},timeLog:S,touch:w}},Me?.__esModule?Me.default:Me);var Me;const Ee=Oe({label:`${b}(child)`,expand:!1});const ke=e=>(...t)=>!$e||Ee[e](...t),je=ke("log"),xe=je,Ie=ke("debug");const{assert:Te,endAutoGroup:Ae,error:Ce,errorBoundary:Pe,event:Re,label:Ne,purge:qe,warn:Le}=Ee,Be=(De=fe,e=>De(typeof e===R?window.chrome?e.replace(ze,we):(e=>e.replaceAll("<br>","\n").replaceAll(/<\/?[^>]+>/gi,""))(e):e));var De;const Fe=(...e)=>Ee.warn(...e.map(Be)),We=(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)=>Fe(t)),He=We("Method"),Ue=We("Method","replaced with"),Ve=We("Option"),Ze=["min-height","min-width","max-height","max-width"],Je=new Set,_e=e=>e.tagName?e.tagName.toLowerCase():"unknown",Qe=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Ge=(e,t)=>{return(n=Qe(e,t))&&"0px"!==n&&n!==B&&"none"!==n;var n};function Ye({href:e}){Je.has(e)||(je("Unable to access stylesheet:",e),Je.add(e))}const Xe=(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){Ye(n)}return{source:"cross-origin stylesheet",value:Qe(e,t)}}(e,t),Ke=(e,t)=>{const{source:n,value:o}=Xe(e,t),r=_e(e);Fe(`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 et(){for(const e of[document.documentElement,document.body])for(const t of Ze)je(`Checking <${_e(e)}> for blocking CSS: ${t}`),Ge(e,t)&&Ke(e,t)}const tt=e=>t=>void 0===t?void 0:e(t),nt=tt(e=>"true"===e),ot=tt(Number),rt=[];function it(e,t){je(`${e} event listener: %c${t}`,h)}const at=(e,t,n,o)=>{e.removeEventListener(t,n,o),it("Removed",t)},st=(e,t,n,o=!1)=>{e.addEventListener(t,n,o),rt.push(()=>at(e,t,n,o)),it("Added",t)},ct=(e="")=>t=>n=>{n.size>0&&Ie(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))},lt=ct("attached to"),dt=((e="")=>t=>n=>{n.size>0&&Ce(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),ut=ct("detached from"),ft=(t,n=!0)=>o=>{o>0&&xe(`${n?"At":"De"}tached %c${t}Observer%c ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e,h,e)},mt=(e,t,n,o)=>{const r=ut(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()}},pt="Mutation",ht=new Set,gt=new Set,yt=new Set,bt=[],vt={attributes:!0,attributeFilter:[I,j],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let zt,wt=1,$t=!1,St=0;const Ot=ct("added")(pt),Mt=ct("removed (page)")(pt),Et=ct("removed (added)")(pt),kt=e=>e.nodeType!==Node.ELEMENT_NODE||te.has(e.tagName.toLowerCase());function jt(e){const t=e.addedNodes;for(const e of t)kt(e)||ht.add(e)}function xt(e){const t=e.removedNodes;for(const e of t)kt(e)||(ht.has(e)?(ht.delete(e),yt.add(e)):gt.add(e))}const It=e=>{xe("Mutations:",e);for(const t of e)jt(t),xt(t);Ot(ht),Mt(gt),Et(yt),yt.clear()};const Tt=e=>()=>{const t=performance.now(),n=t-St,o=16*wt+++2;if(n>o&&n<200)return Re("mutationThrottled"),xe("Update delayed due to heavy workload on the callStack"),xe(`EventLoop busy time: %c${me(n)}ms %c> Max wait: %c${o-2}ms`,h,g,h),setTimeout(zt,16*wt),void(St=t);wt=1,bt.forEach(It),bt.length=0,$t=!1,gt.size>0&&je(`Detected %c${gt.size} %cremoved element${gt.size>1?"s":""}`,h,g),ht.size>0&&je(`Found %c${ht.size} %cnew element${ht.size>1?"s":""}`,h,g),e({addedNodes:ht,removedNodes:gt}),ht.clear(),gt.clear()};function At(e){bt.push(e),$t||(St=performance.now(),$t=!0,requestAnimationFrame(zt))}function Ct(e){const t=new window.MutationObserver(At),n=document.body||document.documentElement;return zt=Tt(e),t.observe(n,vt),xe("Attached%c MutationObserver%c to body",h,g),{...t,disconnect:()=>{ht.clear(),gt.clear(),bt.length=0,t.disconnect(),xe("Detached%c MutationObserver",h)}}}const Pt="Overflow",Rt=ft(Pt),Nt=ft(Pt,!1),qt=lt(Pt),Lt=dt(Pt),Bt=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,Dt=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||fe,i=(t=!1)=>e(t),a=(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 i=e[n],c=a(i,o)&&!Bt(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));Lt(t),qt(n),Rt(o),n.clear(),t.clear()},detachObservers:mt(Pt,c,l,Nt),disconnect:()=>{c.disconnect(),xe("Detached%c OverflowObserver",h)}}},Ft="--ifr-start",Wt="--ifr-end",Ht="--ifr-measure",Ut=[];let Vt,Zt={},Jt=0;function _t(){try{performance.clearMarks(Ft),performance.clearMarks(Wt),performance.clearMeasures(Ht)}catch{}}function Qt(e){e.getEntries().forEach(e=>{if(e.name===Wt)try{const{duration:t}=performance.measure(Ht,Ft,Wt);Zt=e.detail,Ut.push(t),Ut.length>100&&Ut.shift()}catch{}})}function Gt(){xe("Attached%c PerformanceObserver%c to page",h,g);const e=new PerformanceObserver(Qt);return e.observe({entryTypes:["mark"]}),Vt=setInterval(()=>{if(Ut.length<10)return;if(Zt.hasTags&&Zt.len<25)return;Ut.sort();const e=Math.min(Ut.reduce((e,t)=>e+t,0)/Ut.length,Ut[Math.floor(Ut.length/2)]),t=me(e);t>Jt&&(Jt=t,Re("performanceObserver"),je("Mean time:",me(Ut[Math.floor(Ut.length/2)])),je("Median time:",me(Ut.reduce((e,t)=>e+t,0)/Ut.length)),je("Average time:",t),je("Max time:",me(Math.max(...Ut)))),_t(),e<=4||(clearInterval(Vt),Fe(`<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 ${Zt.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{_t(),clearInterval(Vt),e.disconnect(),xe("Detached%c PerformanceObserver",h)}}}const Yt="Resize",Xt=ft(Yt),Kt=ft(Yt,!1),en=lt(Yt),tn=dt(Yt),nn=new WeakSet,on=new Set,rn=new Set;let an;function sn(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(nn.has(n)?on.add(n):(an.observe(n),nn.add(n),rn.add(n),t+=1))}tn(on),en(rn),Xt(t),rn.clear(),on.clear()}function cn(e){const t=new IntersectionObserver(t=>e(t.at(-1).isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),xe("Attached%c VisibilityObserver%c to page",h,g),{disconnect:()=>{t.disconnect(),xe("Detached%c VisibilityObserver",h)}}}const ln=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},dn=ln(L),un=ln(N),fn=ln(R);"undefined"!=typeof window&&function(){const o={height:()=>(Le("Custom height calculation function not defined"),Ln.auto()),width:()=>(Le("Custom width calculation function not defined"),Bn.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},i={},a=B,s="scroll";let c,l,d,u,f,m,p,ne,ie,se=!0,be="",ve=0,ze="",we="",Oe=!1,Me=!0,ke=!1,qe=!0,Be=!1,De=!1,We=!0,Ze=!1,Je=1,_e=a,Qe="",Ge=!0,Ye={},Xe=!1,Ke=!1,tt=!1,it=0,ct=!1,lt=0,dt=0,ut=new Set,ft="",pt="child",ht=!1,gt="",yt=[],bt=window.parent,vt="*",zt=0,wt=!1,$t=1,St=s,Ot=window,Mt=()=>{Le("onMessage function not defined")},Et=()=>{},kt=null,jt=null;function xt(e){var t;!function(e){ft=e[0]??ft,ve=ot(e[1])??ve,ke=nt(e[2])??ke,tt=nt(e[3])??tt,se=nt(e[6])??se,ze=e[7]??ze,_e=e[8]??_e,be=e[9]??be,we=e[10]??we,zt=ot(e[11])??zt,Ye.enable=nt(e[12])??!1,pt=e[13]??pt,St=e[14]??St,ct=nt(e[15])??ct,lt=ot(e[16])??lt,dt=ot(e[17])??dt,Me=nt(e[18])??Me,c=e[19]??c,ne=e[20]??ne,it=ot(e[21])??it,Ke=nt(e[23])??Ke}(e),Se=(t={id:ft,enabled:tt,expand:Ke}).id||b,Ee.label(`${Se}`),Ee.expand(t.expand),$e=t.enabled,Re("initReceived"),je(`Initialising iframe v${y} ${window.location.href}`),function(){function e(e){je("Reading data from page:",Object.keys(e)),ie=dn(e,"onBeforeResize")??ie,Mt=dn(e,"onMessage")??Mt,Et=dn(e,"onReady")??Et,typeof e?.offset===N&&(Ve(C,P),Me&&(lt=un(e,C)??lt),ke&&(dt=un(e,C)??dt)),typeof e?.offsetSize===N&&(Me&&(lt=un(e,P)??lt),ke&&(dt=un(e,P)??dt)),l=fn(e,oe(re[0]))??l,Qe=fn(e,"ignoreSelector")??Qe,gt=fn(e,"sizeSelector")??gt,vt=fn(e,"targetOrigin")??vt,_e=e?.heightCalculationMethod||_e,St=e?.widthCalculationMethod||St}function t(e,t){return typeof e===L&&(Fe(`<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===it)return;const n=window.iframeResizer||window.iFrameResizer;typeof n===q&&(e(n),_e=t(_e,T),St=t(St,A),xe(`Set targetOrigin for parent: %c${vt}`,h))}(),[Bt,Ut,ln,qt,Ht,on,rn,en,Lt,Rt,Oe?fe:et,_t,()=>Vt("background",be),()=>Vt("padding",we),Oe?fe:Qt,pn,Jt,xn,hn,mn,gn,Tt,yn].forEach(e=>{try{e()}catch(e){if(it<0)throw e;Fe("<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</>"),Ce(e)}}),Pt(ue(Et)),je("Initialization complete"),Ae(),Zn(z,"Init message from host page",void 0,void 0,`${y}:${it}`),document.title&&""!==document.title&&Qn(0,0,E,document.title)}function It({persisted:e}){e||Qn(0,0,"beforeUnload"),Re($),xe("Page persisted:",e),e||rt.forEach(ge)}const Tt=()=>st(window,$.toLowerCase(),It);let At=!1;function Pt(e){"complete"===document.readyState?de(e):At||st(document,D,()=>Pt(e)),At=!0}function Rt(){yt=document.querySelectorAll(`[${j}]`),Ze=yt.length>0,je(`Tagged elements found: %c${Ze}`,h)}let Nt=0;function qt(){const n=document.querySelectorAll(`*[${I}]`);return Be=n.length>0,Be&&n.length!==Nt&&(function(n){const o=1===n.length?"":"s";Le(`%c[${I}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),Nt=n.length),Be}function Lt(){"BackCompat"===document.compatMode&&Fe("<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(){ne&&""!==ne&&"false"!==ne?ne!==y&&Fe(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ne} - Child page: ${y}.\n`):Fe("<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 Ht(){try{ht=1===it||"iframeParentListener"in window.parent}catch(e){je("Cross domain iframe detected")}}function Ut(){ke===Me&&(Oe=!0)}function Vt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),xe(`Set body ${e}: %c${t}`,h))}function Zt(e,t,n){if(""!==n){je(`${e}: %c${n}`,h);for(const e of document.querySelectorAll(n))je(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Jt(){Zt("sizeSelector",j,gt),Zt("ignoreSelector",I,Qe)}function _t(){var e,t;void 0===ze&&(ze=`${ve}px`),Vt("margin",(e="margin",(t=ze).includes("-")&&(Le(`Negative CSS value ignored for ${e}`),t=""),t))}function Qt(){const e=e=>e.style.setProperty(T,B,"important");e(document.documentElement),e(document.body),je("Set HTML & body height: %cauto !important",h)}function Xt(e){({add(t){function n(){Zn(e.eventName,e.eventType)}i[t]=n,st(window,t,n,{passive:!0})},remove(e){const t=i[e];delete i[e],at(window,e,t)}})[e.method](e.eventName)}function en(){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&&Fe("<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 tn(e,t,n){const{label:o}=n;return t!==e&&(e in n||(Le(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&Fe(`<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 ${ne?"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`),je(`Set ${o} calculation method: %c${e}`,h),e}function on(){_e=tn(_e,a,Ln)}function rn(){St=tn(St,s,Bn)}function ln(){const t=it,n=le({key:c}),o=le({key:l});if(it=Math.max(n,o),it<0){if(it=Math.min(n,o),Fe(`${ce(it+2)}${ce(2)}`),he(ne))throw ce(it+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!he(ne)||t>-1&&it>t)&&(sessionStorage.getItem("ifr")!==y&&function(t,n){console.info(`${Se} %ciframe-resizer ${t}`,$e||n<1?"font-weight: bold;":e)}(`v${y} (${(e=>oe(ae[e]))(it)})`,it),it<2&&Fe(ce(3)),sessionStorage.setItem("ifr",y))}function mn(){var e;!0!==se&&je("Auto Resize disabled"),Xt({method:e="add",eventType:"After Print",eventName:"afterprint"}),Xt({method:e,eventType:"Before Print",eventName:"beforeprint"})}function pn(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function hn(){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?(je(`In page link (#${n}) not found in iframe, so sending to parent`),Qn(0,0,"inPageLink",`#${n}`)):function(t){const o=e(t);je(`Moving to in page link (%c#${n}%c) at x: %c${o.x}%c y: %c${o.y}`,h,g,h,g,h),Qn(o.y,o.x,M)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}const{enable:o}=Ye;o?1===it?Fe(ce(5)):(je("Setting up location.hash handlers"),function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&st(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),st(window,"hashchange",n),setTimeout(n,128)):je("In page linking not enabled"),Ye={...Ye,findTarget:t}}function gn(){function e(e){Qn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){je(`Add event listener: %c${n}`,h),st(window.document,t,e)}!0===ct&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}function yn(){1!==it&&(Ot.parentIframe=Object.freeze({autoResize:e=>(ye(e,"boolean","parentIframe.autoResize(enable) enable"),!1===ke&&!1===Me?(Re(H),Fe("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===se?(se=!0,queueMicrotask(()=>Zn(H,"Auto Resize enabled"))):!1===e&&!0===se&&(se=!1),Qn(0,0,"autoResize",JSON.stringify(se)),se)),close(){Qn(0,0,"close")},getId:()=>ft,getOrigin:()=>(Re("getOrigin"),He("getOrigin()","getParentOrigin()"),d),getParentOrigin:()=>d,getPageInfo(e){if(typeof e===L)return kt=e,Qn(0,0,S),void Ue("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");kt=null,Qn(0,0,"pageInfoStop")},getParentProps:e=>(ye(e,L,"parentIframe.getParentProps(callback) callback"),jt=e,Qn(0,0,O),()=>{jt=null,Qn(0,0,"parentInfoStop")}),getParentProperties(e){He("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){ye(e,R,"parentIframe.moveToAnchor(anchor) anchor"),Ye.findTarget(e)},reset(){!function(){const e=_e;_e=a,je(`Reset trigger event: %c${"parentIframe.reset"}`,h),wt?je("TriggerLock blocked calculation"):(wt=!0,Ie("Trigger event lock on"),requestAnimationFrame(()=>{wt=!1,Ie("Trigger event lock off")})),Jn("reset"),_e=e}()},setOffsetSize(e){ye(e,N,"parentIframe.setOffsetSize(offset) offset"),lt=e,dt=e,Zn(_,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){ye(e,N,"parentIframe.scrollBy(x, y) x"),ye(t,N,"parentIframe.scrollBy(x, y) y"),Qn(t,e,"scrollBy")},scrollTo(e,t){ye(e,N,"parentIframe.scrollTo(x, y) x"),ye(t,N,"parentIframe.scrollTo(x, y) y"),Qn(t,e,"scrollTo")},scrollToOffset(e,t){ye(e,N,"parentIframe.scrollToOffset(x, y) x"),ye(t,N,"parentIframe.scrollToOffset(x, y) y"),Qn(t,e,M)},sendMessage(e,t){t&&ye(t,R,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Qn(0,0,w,JSON.stringify(e),t)},setHeightCalculationMethod(e){_e=e,on()},setWidthCalculationMethod(e){St=e,rn()},setTargetOrigin(e){ye(e,R,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),je(`Set targetOrigin: %c${e}`,h),vt=e},resize(e,t){void 0!==e&&ye(e,N,"parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&ye(t,N,"parentIframe.resize(customHeight, customWidth) customWidth"),Zn(V,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){He("size()","resize()"),this.resize(e,t)}}),Ot.parentIFrame=Ot.parentIframe)}let bn=new Set;function vn(){const e=document.querySelectorAll(`[${x}]`);ut=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${I}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{Re("overflowIgnored"),xe("Ignoring elements with [data-iframe-ignore] > *:\n",n),Ae()}),t}(e),De=ut.size>0,typeof Set.prototype.symmetricDifference===L&&(We=ut.symmetricDifference(bn).size>0),bn=ut}function zn(){switch(vn(),!0){case!We:return;case ut.size>1:xe("Overflowed Elements:",ut);break;case De:break;default:xe("No overflow detected")}Zn(G,"Overflow updated")}function wn(e){const t={root:document.documentElement,side:Me?F:W};return u=Dt(zn,t),u.attachObservers(e),u}function $n(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Zn(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 Sn(e){return an=new ResizeObserver($n),an.observe(document.body),nn.add(document.body),xe("Attached%c ResizeObserver%c to body",h,g),f={attachObserverToNonStaticElements:sn,detachObservers:mt(Yt,an,nn,Kt),disconnect:()=>{an.disconnect(),xe("Detached%c ResizeObserver",h)}},f.attachObserverToNonStaticElements(e),f}function On(e){je(`Visible: %c${e}`,h),Xe=!e,Zn(X,"Visibility changed")}const Mn=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of Cn(n))t.add(e)}return xe("Inspecting:\n",t),t},En=e=>{if(0===e.size)return;Re("addObservers");const t=Mn(e);u.attachObservers(t),f.attachObserverToNonStaticElements(t),Ae()},kn=e=>{if(0===e.size)return;Re("removeObservers");const t=Mn(e);u.detachObservers(t),f.detachObservers(t),Ae()};function jn(e){!function({addedNodes:e,removedNodes:t}){Re("contentMutated"),Jt(),Rt(),vn(),Ae(),kn(t),En(e)}(e),Zn(Y,"Mutation Observed")}function xn(){const e=Cn(document.documentElement);var t;t=[Ct(jn),wn(e),Gt(),Sn(e),cn(On)],rt.push(...t.map(e=>e.disconnect))}function In(e){performance.mark(Ft);const t=pe(e);let n=1,o=document.documentElement,r=Ze?0:document.documentElement.getBoundingClientRect().bottom;const i=Ze?yt:De?Array.from(ut):Cn(document.documentElement);for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return xe(`${t} position calculated from:`,o),xe(`Checked %c${i.length}%c elements`,h,g),performance.mark(Wt,{detail:{hasTags:Ze,len:i.length,logging:tt,Side:t}}),r}const Tn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],An=`* ${Array.from(te).map(e=>`:not(${e})`).join("")}`,Cn=e=>e.querySelectorAll(An),Pn={height:0,width:0},Rn={height:0,width:0},Nn=[h,g,h];function qn(e){function t(){return Rn[o]=r,Pn[o]=s,Math.max(r,1)}const n=e===Ln,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 Ze:xe("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!De&&qe&&0===Rn[o]&&0===Pn[o]:xe(`Initial page size values: ${c}`,...Nn),l=t();break;case wt&&r===Rn[o]&&s===Pn[o]:xe(`Size unchanged: ${c}`,...Nn),l=Math.max(r,s);break;case 0===r&&0!==s:xe(`Page is hidden: ${c}`,...Nn),l=s;break;case!De&&r!==Rn[o]&&s<=Pn[o]:xe(`New <html> size: ${c} `,...Nn),xe(`Previous <html> size: %c${Rn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!De&&r<Rn[o]:xe(`<html> size decreased: ${c}`,...Nn),l=t();break;case s===a||s===i:xe(`<html> size equals page size: ${c}`,...Nn),l=t();break;case r>s:xe(`Page size < <html> size: ${c}`,...Nn),l=t();break;case De:xe("Found elements possibly overflowing <html> "),l=e.taggedElement();break;default:xe(`Using <html> size: ${c}`,...Nn),l=t()}return xe(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&xe(`Page offsetSize: %c${t}px`,h),t}(e),Math.max(l,1)}const Ln={label:T,enabled:()=>Me,getOffset:()=>lt,auto:()=>qn(Ln),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,k)+parseInt(t.marginBottom,k)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Ln.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(...Tn(Ln)),min:()=>Math.min(...Tn(Ln)),grow:()=>Ln.max(),lowestElement:()=>In(F),taggedElement:()=>In(F)},Bn={label:A,enabled:()=>ke,getOffset:()=>dt,auto:()=>qn(Bn),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(...Tn(Bn)),min:()=>Math.min(...Tn(Bn)),rightMostElement:()=>In(W),scroll:()=>Math.max(Bn.bodyScroll(),Bn.documentElementScroll()),taggedElement:()=>In(W)},Dn=(e,t)=>!(Math.abs(e-t)<=zt);function Fn(e,t){const n=e[t](),o=e.enabled()&&void 0!==ie?function(e){const t=ie(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 Te(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let Wn=!1;const Hn=ue(()=>Fe(ce(4)));let Un,Vn=!1;const Zn=Pe((e,t,n,o,r)=>{switch(Re(e),!0){case!0===Xe:if(!0===Vn)break;je("Iframe hidden - Ignored resize request"),Vn=!0,Wn=!1,cancelAnimationFrame(Un);break;case!0===Wn&&e!==G:je("Resize already pending - Ignored resize request");break;case!se&&!(e in J):xe("Resizing disabled");break;default:Vn=!1,Wn=!0,p=performance.now(),m=!0,Un||(Un=requestAnimationFrame(()=>{Wn=!1,Un=null,Re("requestAnimationFrame"),Ie(`Reset sendPending: %c${e}`,h)})),function(e,t,n,o,r){const i=n??Fn(Ln,_e),a=o??Fn(Bn,St),s=Me&&Dn(Je,i)||ke&&Dn($t,a)?U:e;switch(je(`Resize event: %c${t}`,h),s){case z:case H:case U:Je=i,$t=a;case _:_n(Je,$t,e,r);break;case G:case Y:case Q:case X:je(K);break;default:xe(K)}m=!1}(e,t,n,o,r)}Ae()});function Jn(e){Je=Ln[_e](),$t=Bn[St](),Qn(Je,$t,e)}function _n(e,t,o,r,i){it<-1||(void 0!==i?je(`Message targetOrigin: %c${i}`,h):i=vt,function(){const a=`${ft}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(ht)try{window.parent.iframeParentListener(ee+a)}catch(e){if(1!==it)throw e;return void Hn()}else bt.postMessage(ee+a,i);m&&je(function(){const e=me(performance.now()-p);return o===z?`Initialised iframe in %c${e}ms`:`Size calculated in %c${e}ms`}(),h),xe(`Sending message to parent page via ${ht?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}())}const Qn=Pe((e,t,n,o,r)=>{Re(n),_n(e,t,n,o,r),Ae()}),Gn=Pe(function(e){Re("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>t(n(e)),r=e=>Qn(0,0,`${e}Stop`),i={init:function(){if("loading"===document.readyState)return void je("Page not ready, ignoring init message");const t=e.data.slice(13).split(v);bt=e.source,d=e.origin,xt(t),qe=!1,setTimeout(()=>{Ge=!1},128)},reset(){Ge?je("Page reset ignored by init"):(je("Page size reset by host page"),Jn("resetPage"))},resize(){je("Resize requested by host page"),Zn(Z,"Parent window requested size check")},moveToAnchor(){Ye.findTarget(s())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=s();je("PageInfo received from parent:",o(e)),kt?de(kt,n(e)):r(S)},parentInfo(){const e=o(s());je("ParentInfo received from parent:",e),jt?de(jt,e):r(O)},message(){const e=s();je("onMessage called from parent:%c",h,o(e)),de(Mt,n(e))}},a=()=>e.data.split("]")[1].split(v)[0],s=()=>e.data.slice(e.data.indexOf(v)+1),c=()=>e.data.split(v)[2]in{true:1,false:1};function l(){const t=a();Re(t),t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||c()||Le(`Unexpected message (${e.data})`)}ee===`${e.data}`.slice(0,13)&&function(){if(!1!==qe)return c()?(Ne(a()),Re(z),void i.init()):void je(`Ignored message of type "${a()}". Received before initialization.`);l()}()});let Yn=!1;const Xn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function Kn(){if("loading"===document.readyState||!qe||Yn)return;const{parent:e,top:t}=window;Re("ready"),je("Sending%c ready%c to parent from",h,g,window.location.href),Xn(e),e!==t&&Xn(t),Yn=!0}"iframeChildListener"in window?Le("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Gn({data:e,sameOrigin:!0})),Re("listen"),st(window,w,Gn),st(document,D,Kn),Kn())}()});
21
21
  //# sourceMappingURL=index.umd.js.map