New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@iframe-resizer/child

Package Overview
Dependencies
Maintainers
0
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iframe-resizer/child - npm Package Compare versions

Comparing version 5.3.3-beta.3 to 5.3.3-beta.4

4

index.cjs.js
/*!
* @preserve
*
* @module iframe-resizer/child 5.3.3-beta.3 (cjs) - 2025-02-02
* @module iframe-resizer/child 5.3.3-beta.4 (cjs) - 2025-02-07
*

@@ -20,3 +20,3 @@ * @license GPL-3.0 for non-commercial use only.

"use strict";const e="5.3.3-beta.3",t=10,n="data-iframe-size",o="data-overflowed",i="bottom",r="right",a="resizeParent",l=(e,t,n,o)=>e.addEventListener(t,n,o||!1),s=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const d=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(s[e]),c=e=>e,u=1e5,m=e=>Math.round(e*u)/u;let f="",p=!1;const g=e=>{f=e.id,p=e.logging},h=e=>e.charAt(0).toUpperCase()+e.slice(1),y=e=>""!=`${e}`&&void 0!==e;function b(e){switch(!0){case!y(e):return"";case y(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case y(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(y(e.className)?`.${e.className}`:"")}}const v=(...e)=>[`[iframe-resizer][${f||"child"}]`,...e].join(" "),z=(...e)=>p&&console?.log(v(...e)),w=(...e)=>p&&console?.info(`%c[iframe-resizer][${f}]%c`,"font-weight: bold;","font-weight: normal;",...e),$=(...e)=>console?.warn(v(...e)),S=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(v)(...e)),M=e=>S(e),E=e=>{const t=e.side||i,n=e.onChange||c,r={root:e.root,rootMargin:"0px",threshold:1};function a(){const e=document.querySelectorAll(`[${o}]`);n(e)}const l=new IntersectionObserver((function(e){for(const n of e){const{boundingClientRect:e,rootBounds:i,target:r}=n,a=e[t],l=0===a||a>i[t];r.toggleAttribute(o,l)}requestAnimationFrame(a)}),r),s=new WeakSet;return function(e){for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}},T="--ifr-start",O="--ifr-end",j="--ifr-measure",P=[],C=new WeakSet,A=e=>"object"==typeof e&&C.add(e);let I=null,N={};const k=setInterval((()=>{if(P.length<10)return;if(N.hasTags&&N.len<25)return;P.sort();const e=Math.min(P.reduce(((e,t)=>e+t),0)/P.length,P[Math.floor(P.length/2)]);z("Max time:",Math.max(...P)),e<=4||(clearInterval(k),S(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${m(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${N.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function R(e){e.getEntries().forEach((e=>{if(e.name===O){const{duration:t}=performance.measure(j,T,O);!function(e,t){const{Side:n,len:o,hasTags:i,logging:r}=e;N=e,C.has(I)||i&&o<=1||(r||A(I),w(`\n ${n} position calculated from:`,I,`\n Parsed ${o} ${i?"tagged":"potentially overflowing"} elements in ${m(t)}ms`))}(e.detail,t),P.push(t),P.length>100&&P.shift()}}))}function x(){new PerformanceObserver(R).observe({entryTypes:["mark"]}),A(document.documentElement),A(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",x):x()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},s={height:()=>($("Custom height calculation function not defined"),De.auto()),width:()=>($("Custom width calculation function not defined"),We.auto())},u={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},f=128,p={},y="checkVisibility"in window,v="auto",w="[iFrameSizer]",j=w.length,P={max:1,min:1,bodyScroll:1,documentElementScroll:1},C="scroll";let A,N,k,R,x,L=!0,q="",B=0,D="",W="",U=!0,F=!1,H=!0,V=!1,J=!1,Z=1,_=v,Q=!0,X="",Y={},G=!1,K=0,ee=!1,te="",ne=c,oe=[],ie="child",re=null,ae=!1,le="",se=[],de=window.parent,ce="*",ue=0,me=!1,fe="",pe=1,ge=C,he=window,ye=()=>{$("onMessage function not defined")},be=()=>{},ve=null,ze=null;function we(){var o,c,u;!function(){const e=e=>"true"===e,t=X.slice(j).split(":");te=t[0],B=void 0===t[1]?B:Number(t[1]),F=void 0===t[2]?F:e(t[2]),G=void 0===t[3]?G:e(t[3]),L=void 0===t[6]?L:e(t[6]),D=t[7],_=void 0===t[8]?_:t[8],q=t[9],W=t[10],ue=void 0===t[11]?ue:Number(t[11]),Y.enable=void 0!==t[12]&&e(t[12]),ie=void 0===t[13]?ie:t[13],ge=void 0===t[14]?ge:t[14],ee=void 0===t[15]?ee:e(t[15]),A=void 0===t[16]?A:Number(t[16]),N=void 0===t[17]?N:Number(t[17]),U=void 0===t[18]?U:e(t[18]),t[19],fe=t[20]||fe,K=void 0===t[21]?K:Number(t[21])}(),g({id:te,logging:G}),z(`Initialising iframe v${e} (${window.location.href})`),function(){function e(e){z(`Reading data from page: ${JSON.stringify(e)}`),ye=e?.onMessage||ye,be=e?.onReady||be,"number"==typeof e?.offset&&(S("<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</>."),U&&(A=e?.offset),F&&(N=e?.offset)),"number"==typeof e?.offsetSize&&(U&&(A=e?.offsetSize),F&&(N=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(le=e.sizeSelector),ce=e?.targetOrigin||ce,_=e?.heightCalculationMethod||_,ge=e?.widthCalculationMethod||ge}function t(e,t){return"function"==typeof e&&(z(`Setup custom ${t}CalcMethod`),s[t]=e,e="custom"),e}if(1===K)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),_=t(_,"height"),ge=t(ge,"width"),z(`TargetOrigin for parent set to: ${ce}`))}(),function(){try{ae="iframeParentListener"in window.parent}catch(e){z("Cross domain iframe detected.")}}(),K<0?M(`${d(K+2)}${d(2)}`):fe.codePointAt(0)>4||K<2&&M(d(3)),fe&&""!==fe&&"false"!==fe?fe!==e&&S(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${fe} - Child page: ${e}.\n`):S("<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"),Pe(),Ce(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.toggleAttribute(n,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&S("<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</>.")}(),Se(),U!==F&&(ne=E({onChange:$e,root:document.documentElement,side:U?i:r})),1!==K&&(he.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===L?(L=!0,He("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===L&&(L=!1),_e(0,0,"autoResize",JSON.stringify(L)),L),close(){_e(0,0,"close")},getId:()=>te,getOrigin:()=>(S("<rb>Deprecated Method</>\n \nThe <b>getOrigin()</> method has been deprecated and replaced with <b>getParentOrigin()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),k),getParentOrigin:()=>k,getPageInfo(e){if("function"==typeof e)return ve=e,_e(0,0,"pageInfo"),void S("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ve=null,_e(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return ze=e,_e(0,0,"parentInfo"),()=>{ze=null,_e(0,0,"parentInfoStop")}},getParentProperties(e){S("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){Y.findTarget(e)},reset(){Ze("parentIframe.reset")},scrollBy(e,t){_e(t,e,"scrollBy")},scrollTo(e,t){_e(t,e,"scrollTo")},scrollToOffset(e,t){_e(t,e,"scrollToOffset")},sendMessage(e,t){_e(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){_=e,Pe()},setWidthCalculationMethod(e){ge=e,Ce()},setTargetOrigin(e){z(`Set targetOrigin: ${e}`),ce=e},resize(e,t){He(a,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){S("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),he.parentIFrame=he.parentIframe),function(){function e(e){_e(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){z(`Add event listener: ${n}`),l(window.document,t,e)}!0===ee&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),Y=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function o(e){function t(e){const t=n(e);z(`Moving to in page link (#${o}) at x: ${t.x}y: ${t.y}`),_e(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?(z(`In page link (#${o}) not found in iFrame, so sending to parent`),_e(0,0,"inPageLink",`#${o}`)):t(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&l(e,"click",(t=>{t.preventDefault(),o(e.getAttribute("href"))}))}function a(){l(window,"hashchange",i)}function s(){setTimeout(i,f)}function d(){z("Setting up location.hash handlers"),r(),a(),s()}return Y.enable?1===K?S("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):d():z("In page linking not enabled"),{findTarget:o}}(),Me(xe(document)()),void 0===D&&(D=`${B}px`),Ee("margin",(c="margin",(u=D).includes("-")&&($(`Negative CSS value ignored for ${c}`),u=""),u)),Ee("background",q),Ee("padding",W),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),z('HTML & body height set to "auto !important"')}(),Te(),He("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&_e(0,0,"title",document.title),!0!==L&&z("Auto Resize disabled"),Oe({method:o="add",eventType:"After Print",eventName:"afterprint"}),Oe({method:o,eventType:"Before Print",eventName:"beforeprint"}),Oe({method:o,eventType:"Ready State Change",eventName:"readystatechange"}),function(){const e=new Set;let t=!1,n=0,o=[];const i=t=>{for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},r=16,a=2,l=200;let s=1;function d(){z("MutationObserver: processMutations");const c=performance.now(),u=c-n,m=r*s+++a;if(u>m&&u<l)return z(`MutationObserver delay: ${u}ms > ${m}`),setTimeout(d,r*s),void(n=c);s=1,o.forEach(i),o=[],0!==e.size?(Te(),Se(),Me(e),e.forEach(Ne),e.clear(),t=!1):t=!1}function c(e){o.push(e),t||(n=performance.now(),t=!0,requestAnimationFrame(d))}function u(){const e=new window.MutationObserver(c),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return z("Create <body/> MutationObserver"),e.observe(t,n),e}u()}(),re=new ResizeObserver(Ae),re.observe(document.body),Ie.add(document.body),Ne(document.body),setTimeout(be),z("Initialization complete"),z("---")}function $e(e){z("Overflowed Elements:",e.length),oe=e,V=oe.length>0,He("overflowChanged","Overflow updated")}function Se(){se=document.querySelectorAll(`[${n}]`),J=se.length>0,z(`Tagged elements found: ${J}`)}function Me(e){J||ne(e)}function Ee(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),z(`Body ${e} set to "${t}"`))}function Te(){if(""!==le){z(`Applying sizeSelector: ${le}`);for(const e of document.querySelectorAll(le))z(`Applying data-iframe-size to: ${b(e)}`),e.dataset.iframeSize=!0}}function Oe(e){({add(t){function n(){He(e.eventName,e.eventType)}p[t]=n,l(window,t,n,{passive:!0})},remove(e){const t=p[e];var n,o;delete p[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),z(`${h(e.method)} event listener: ${e.eventType}`)}function je(e,t,n,o){return t!==e&&(e in n||($(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in u&&S(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`),z(`${o} calculation method set to "${e}"`)),e}function Pe(){_=je(_,v,De,"height")}function Ce(){ge=je(ge,C,We,"width")}function Ae(e){Array.isArray(e)&&0!==e.length&&He("resizeObserver",`Resize Observed: ${b(e[0].target)}`)}const Ie=new WeakSet;function Ne(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!Ie.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(re.observe(e),Ie.add(e),z(`Attached resizeObserver: ${b(e)}`))}const t=xe(e)();for(const e of t){if(Ie.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(re.observe(e),Ie.add(e),z(`Attached resizeObserver: ${b(e)}`))}}function ke(e){performance.mark(T);const t=h(e);let n=0,i=document.documentElement,r=J?0:document.documentElement.getBoundingClientRect().bottom;performance.mark(T);const a=J?se:V?oe:xe(document)();let l=a.length;for(const t of a)J||!y||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,i=t)):l-=1;return I=i,performance.mark(O,{detail:{Side:t,len:l,hasTags:J,logging:G}}),r}const Re=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],xe=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)"),Le={height:0,width:0},qe={height:0,width:0};function Be(e){function t(){return qe[o]=i,Le[o]=l,i}const n=e===De,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),s=`HTML: ${i} Page: ${l}`;switch(!0){case!e.enabled():return l;case J:return e.taggedElement();case!V&&0===qe[o]&&0===Le[o]:return z(`Initial page size values: ${s}`),t();case me&&i===qe[o]&&l===Le[o]:return z(`Size unchanged: ${s}`),Math.max(i,l);case 0===i:return z(`Page is hidden: ${s}`),l;case!V&&i!==qe[o]&&l<=Le[o]:return z(`New HTML bounding size: ${s}`,"Previous bounding size:",qe[o]),t();case!n:return e.taggedElement();case!V&&i<qe[o]:return z("HTML bounding size decreased:",s),t();case l===a||l===r:return z("HTML bounding size equals page size:",s),t();case i>l:return z(`Page size < HTML bounding size: ${s}`),t();default:z(`Content overflowing HTML element: ${s}`)}return Math.max(e.taggedElement(),t())}const De={enabled:()=>U,getOffset:()=>A,auto:()=>Be(De),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>De.bodyOffset(),custom:()=>s.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...Re(De)),min:()=>Math.min(...Re(De)),grow:()=>De.max(),lowestElement:()=>ke(i),taggedElement:()=>ke(i)},We={enabled:()=>F,getOffset:()=>N,auto:()=>Be(We),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>s.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...Re(We)),min:()=>Math.min(...Re(We)),rightMostElement:()=>ke(r),scroll:()=>Math.max(We.bodyScroll(),We.documentElementScroll()),taggedElement:()=>ke(r)},Ue=(e,t)=>!(Math.abs(e-t)<=ue);let Fe=!1;function He(e,t,n,o,i){x=performance.now(),L||e===a?document.hidden?z("Page hidden - Ignored resize request"):(Fe||(z(`Resize event: ${t}`),R=!0,function(e,t,n,o,i){const r=void 0===n?De[_]():n,l=void 0===o?We[ge]():o;U&&Ue(Z,r)||F&&Ue(pe,l)||"init"===e?(Ve(),Z=r,pe=l,_e(Z,pe,e,i)):!e!==a&&(U&&_ in P||F&&ge in P)?Ze(t):R=!1}(e,t,n,o,i),requestAnimationFrame((()=>{Fe=!1}))),Fe=!0):z("Resizing disabled")}function Ve(){me||(me=!0,z("Trigger event lock on"),requestAnimationFrame((()=>{me=!1,z("Trigger event lock off"),z("--")})))}function Je(e){Z=De[_](),pe=We[ge](),_e(Z,pe,e)}function Ze(e){const t=_;_=v,z(`Reset trigger event: ${e}`),Ve(),Je("reset"),_=t}function _e(e,t,n,o,i){K<-1||(void 0!==i?z(`Message targetOrigin: ${i}`):i=ce,function(){const r=`${te}:${e+(A||0)}:${t+(N||0)}:${n}${void 0===o?"":`:${o}`}`;G&&(console.group(`[iframe-resizer][${te}]`),console.info("Sending message to host page via "+(ae?"sameDomain":"postMessage")),console.info(`%c${r}`,"font-style: italic"),R&&console.info(function(){const e=m(performance.now()-x);return"init"===n?`Initialised iFrame in %c${e}ms`:`Content size recalculated in %c${e}ms`}(),"font-weight:bold;color:#777"),console.groupEnd()),R=!1,ae?window.parent.iframeParentListener(w+r):de.postMessage(w+r,i)}())}function Qe(e){const t={init:function(){X=e.data,de=e.source,k=e.origin,we(),H=!1,setTimeout((()=>{Q=!1}),f)},reset(){Q?z("Page reset ignored by init"):(z("Page size reset by host page"),Je("resetPage"))},resize(){He(a,"Parent window requested size check")},moveToAnchor(){Y.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();z(`PageInfo received from parent: ${e}`),ve?setTimeout((()=>ve(JSON.parse(e)))):_e(0,0,"pageInfoStop"),z(" --")},parentInfo(){const e=o();z(`ParentInfo received from parent: ${e}`),ze?setTimeout(ze(Object.freeze(JSON.parse(e)))):_e(0,0,"parentInfoStop"),z(" --")},message(){const e=o();z(`onMessage called from parent: ${e}`),ye(JSON.parse(e)),z(" --")}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};w===`${e.data}`.slice(0,j)&&(!1!==H?r()?t.init():z(`Ignored message of type "${n()}". Received before initialization.`):function(){const o=n();o in t?t[o]():i()||r()||$(`Unexpected message (${e.data})`)}())}function Xe(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?$("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>Qe({data:e}))),l(window,"message",Qe),l(window,"readystatechange",Xe),Xe())}();
"use strict";const e="5.3.3-beta.4",t=10,n="data-iframe-size",o="data-overflowed",i="bottom",r="right",a="resizeParent",l=(e,t,n,o)=>e.addEventListener(t,n,o||!1),s=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const d=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(s[e]),c=e=>e,u=1e5,m=e=>Math.round(e*u)/u;let f="",p=!1;const g=e=>{f=e.id,p=e.logging},h=e=>e.charAt(0).toUpperCase()+e.slice(1),y=e=>""!=`${e}`&&void 0!==e;function b(e){switch(!0){case!y(e):return"";case y(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case y(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(y(e.className)?`.${e.className}`:"")}}const v=(...e)=>[`[iframe-resizer][${f||"child"}]`,...e].join(" "),z=(...e)=>p&&console?.log(v(...e)),w=(...e)=>p&&console?.info(`%c[iframe-resizer][${f}]%c`,"font-weight: bold;","font-weight: normal;",...e),$=(...e)=>console?.warn(v(...e)),S=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(v)(...e)),M=e=>S(e),E=e=>{const t=e.side||i,n=e.onChange||c,r={root:e.root,rootMargin:"0px",threshold:1};function a(){const e=document.querySelectorAll(`[${o}]`);n(e)}const l=new IntersectionObserver((function(e){for(const n of e){const{boundingClientRect:e,rootBounds:i,target:r}=n,a=e[t],l=0===a||a>i[t];r.toggleAttribute(o,l)}requestAnimationFrame(a)}),r),s=new WeakSet;return function(e){for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}},T="--ifr-start",O="--ifr-end",j="--ifr-measure",P=[],C=new WeakSet,A=e=>"object"==typeof e&&C.add(e);let I=null,N={};const k=setInterval((()=>{if(P.length<10)return;if(N.hasTags&&N.len<25)return;P.sort();const e=Math.min(P.reduce(((e,t)=>e+t),0)/P.length,P[Math.floor(P.length/2)]);z("Max time:",Math.max(...P)),e<=4||(clearInterval(k),S(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${m(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${N.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function R(e){e.getEntries().forEach((e=>{if(e.name===O){const{duration:t}=performance.measure(j,T,O);!function(e,t){const{Side:n,len:o,hasTags:i,logging:r}=e;N=e,C.has(I)||i&&o<=1||(r||A(I),w(`\n ${n} position calculated from:`,I,`\n Parsed ${o} ${i?"tagged":"potentially overflowing"} elements in ${m(t)}ms`))}(e.detail,t),P.push(t),P.length>100&&P.shift()}}))}function x(){new PerformanceObserver(R).observe({entryTypes:["mark"]}),A(document.documentElement),A(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",x):x()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},s={height:()=>($("Custom height calculation function not defined"),De.auto()),width:()=>($("Custom width calculation function not defined"),We.auto())},u={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},f=128,p={},y="checkVisibility"in window,v="auto",w="[iFrameSizer]",j=w.length,P={max:1,min:1,bodyScroll:1,documentElementScroll:1},C="scroll";let A,N,k,R,x,L=!0,q="",B=0,D="",W="",U=!0,F=!1,H=!0,V=!1,J=!1,Z=1,_=v,Q=!0,X="",Y={},G=!1,K=0,ee=!1,te="",ne=c,oe=[],ie="child",re=null,ae=!1,le="",se=[],de=window.parent,ce="*",ue=0,me=!1,fe="",pe=1,ge=C,he=window,ye=()=>{$("onMessage function not defined")},be=()=>{},ve=null,ze=null;function we(){var o,c,u;!function(){const e=e=>"true"===e,t=X.slice(j).split(":");te=t[0],B=void 0===t[1]?B:Number(t[1]),F=void 0===t[2]?F:e(t[2]),G=void 0===t[3]?G:e(t[3]),L=void 0===t[6]?L:e(t[6]),D=t[7],_=void 0===t[8]?_:t[8],q=t[9],W=t[10],ue=void 0===t[11]?ue:Number(t[11]),Y.enable=void 0!==t[12]&&e(t[12]),ie=void 0===t[13]?ie:t[13],ge=void 0===t[14]?ge:t[14],ee=void 0===t[15]?ee:e(t[15]),A=void 0===t[16]?A:Number(t[16]),N=void 0===t[17]?N:Number(t[17]),U=void 0===t[18]?U:e(t[18]),t[19],fe=t[20]||fe,K=void 0===t[21]?K:Number(t[21])}(),g({id:te,logging:G}),z(`Initialising iframe v${e} (${window.location.href})`),function(){function e(e){z(`Reading data from page: ${JSON.stringify(e)}`),ye=e?.onMessage||ye,be=e?.onReady||be,"number"==typeof e?.offset&&(S("<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</>."),U&&(A=e?.offset),F&&(N=e?.offset)),"number"==typeof e?.offsetSize&&(U&&(A=e?.offsetSize),F&&(N=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(le=e.sizeSelector),ce=e?.targetOrigin||ce,_=e?.heightCalculationMethod||_,ge=e?.widthCalculationMethod||ge}function t(e,t){return"function"==typeof e&&(z(`Setup custom ${t}CalcMethod`),s[t]=e,e="custom"),e}if(1===K)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),_=t(_,"height"),ge=t(ge,"width"),z(`TargetOrigin for parent set to: ${ce}`))}(),function(){try{ae="iframeParentListener"in window.parent}catch(e){z("Cross domain iframe detected.")}}(),K<0?M(`${d(K+2)}${d(2)}`):fe.codePointAt(0)>4||K<2&&M(d(3)),fe&&""!==fe&&"false"!==fe?fe!==e&&S(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${fe} - Child page: ${e}.\n`):S("<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"),Pe(),Ce(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.toggleAttribute(n,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&S("<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</>.")}(),Se(),U!==F&&(ne=E({onChange:$e,root:document.documentElement,side:U?i:r})),1!==K&&(he.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===L?(L=!0,He("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===L&&(L=!1),_e(0,0,"autoResize",JSON.stringify(L)),L),close(){_e(0,0,"close")},getId:()=>te,getOrigin:()=>(S("<rb>Deprecated Method</>\n \nThe <b>getOrigin()</> method has been deprecated and replaced with <b>getParentOrigin()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),k),getParentOrigin:()=>k,getPageInfo(e){if("function"==typeof e)return ve=e,_e(0,0,"pageInfo"),void S("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ve=null,_e(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return ze=e,_e(0,0,"parentInfo"),()=>{ze=null,_e(0,0,"parentInfoStop")}},getParentProperties(e){S("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){Y.findTarget(e)},reset(){Ze("parentIframe.reset")},scrollBy(e,t){_e(t,e,"scrollBy")},scrollTo(e,t){_e(t,e,"scrollTo")},scrollToOffset(e,t){_e(t,e,"scrollToOffset")},sendMessage(e,t){_e(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){_=e,Pe()},setWidthCalculationMethod(e){ge=e,Ce()},setTargetOrigin(e){z(`Set targetOrigin: ${e}`),ce=e},resize(e,t){He(a,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){S("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),he.parentIFrame=he.parentIframe),function(){function e(e){_e(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){z(`Add event listener: ${n}`),l(window.document,t,e)}!0===ee&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),Y=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function o(e){function t(e){const t=n(e);z(`Moving to in page link (#${o}) at x: ${t.x}y: ${t.y}`),_e(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?(z(`In page link (#${o}) not found in iFrame, so sending to parent`),_e(0,0,"inPageLink",`#${o}`)):t(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&l(e,"click",(t=>{t.preventDefault(),o(e.getAttribute("href"))}))}function a(){l(window,"hashchange",i)}function s(){setTimeout(i,f)}function d(){z("Setting up location.hash handlers"),r(),a(),s()}return Y.enable?1===K?S("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):d():z("In page linking not enabled"),{findTarget:o}}(),Me(xe(document)()),void 0===D&&(D=`${B}px`),Ee("margin",(c="margin",(u=D).includes("-")&&($(`Negative CSS value ignored for ${c}`),u=""),u)),Ee("background",q),Ee("padding",W),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),z('HTML & body height set to "auto !important"')}(),Te(),He("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&_e(0,0,"title",document.title),!0!==L&&z("Auto Resize disabled"),Oe({method:o="add",eventType:"After Print",eventName:"afterprint"}),Oe({method:o,eventType:"Before Print",eventName:"beforeprint"}),Oe({method:o,eventType:"Ready State Change",eventName:"readystatechange"}),function(){const e=new Set;let t=!1,n=0,o=[];const i=t=>{for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},r=16,a=2,l=200;let s=1;function d(){z("MutationObserver: processMutations");const c=performance.now(),u=c-n,m=r*s+++a;if(u>m&&u<l)return z(`MutationObserver delay: ${u}ms > ${m}`),setTimeout(d,r*s),void(n=c);s=1,o.forEach(i),o=[],0!==e.size?(Te(),Se(),Me(e),e.forEach(Ne),e.clear(),t=!1):t=!1}function c(e){o.push(e),t||(n=performance.now(),t=!0,requestAnimationFrame(d))}function u(){const e=new window.MutationObserver(c),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return z("Create <body/> MutationObserver"),e.observe(t,n),e}u()}(),re=new ResizeObserver(Ae),re.observe(document.body),Ie.add(document.body),Ne(document.body),setTimeout(be),z("Initialization complete"),z("---")}function $e(e){z("Overflowed Elements:",e.length),oe=e,V=oe.length>0,He("overflowChanged","Overflow updated")}function Se(){se=document.querySelectorAll(`[${n}]`),J=se.length>0,z(`Tagged elements found: ${J}`)}function Me(e){J||ne(e)}function Ee(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),z(`Body ${e} set to "${t}"`))}function Te(){if(""!==le){z(`Applying sizeSelector: ${le}`);for(const e of document.querySelectorAll(le))z(`Applying data-iframe-size to: ${b(e)}`),e.dataset.iframeSize=!0}}function Oe(e){({add(t){function n(){He(e.eventName,e.eventType)}p[t]=n,l(window,t,n,{passive:!0})},remove(e){const t=p[e];var n,o;delete p[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),z(`${h(e.method)} event listener: ${e.eventType}`)}function je(e,t,n,o){return t!==e&&(e in n||($(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in u&&S(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`),z(`${o} calculation method set to "${e}"`)),e}function Pe(){_=je(_,v,De,"height")}function Ce(){ge=je(ge,C,We,"width")}function Ae(e){Array.isArray(e)&&0!==e.length&&He("resizeObserver",`Resize Observed: ${b(e[0].target)}`)}const Ie=new WeakSet;function Ne(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!Ie.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(re.observe(e),Ie.add(e),z(`Attached resizeObserver: ${b(e)}`))}const t=xe(e)();for(const e of t){if(Ie.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(re.observe(e),Ie.add(e),z(`Attached resizeObserver: ${b(e)}`))}}function ke(e){performance.mark(T);const t=h(e);let n=0,i=document.documentElement,r=J?0:document.documentElement.getBoundingClientRect().bottom;performance.mark(T);const a=J?se:V?oe:xe(document)();let l=a.length;for(const t of a)J||!y||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,i=t)):l-=1;return I=i,performance.mark(O,{detail:{Side:t,len:l,hasTags:J,logging:G}}),r}const Re=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],xe=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)"),Le={height:0,width:0},qe={height:0,width:0};function Be(e){function t(){return qe[o]=i,Le[o]=l,i}const n=e===De,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),s=`HTML: ${i} Page: ${l}`;switch(!0){case!e.enabled():return l;case J:return e.taggedElement();case!V&&0===qe[o]&&0===Le[o]:return z(`Initial page size values: ${s}`),t();case me&&i===qe[o]&&l===Le[o]:return z(`Size unchanged: ${s}`),Math.max(i,l);case 0===i:return z(`Page is hidden: ${s}`),l;case!V&&i!==qe[o]&&l<=Le[o]:return z(`New HTML bounding size: ${s}`,"Previous bounding size:",qe[o]),t();case!n:return e.taggedElement();case!V&&i<qe[o]:return z("HTML bounding size decreased:",s),t();case l===a||l===r:return z("HTML bounding size equals page size:",s),t();case i>l:return z(`Page size < HTML bounding size: ${s}`),t();default:z(`Content overflowing HTML element: ${s}`)}return Math.max(e.taggedElement(),t())}const De={enabled:()=>U,getOffset:()=>A,auto:()=>Be(De),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>De.bodyOffset(),custom:()=>s.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...Re(De)),min:()=>Math.min(...Re(De)),grow:()=>De.max(),lowestElement:()=>ke(i),taggedElement:()=>ke(i)},We={enabled:()=>F,getOffset:()=>N,auto:()=>Be(We),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>s.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...Re(We)),min:()=>Math.min(...Re(We)),rightMostElement:()=>ke(r),scroll:()=>Math.max(We.bodyScroll(),We.documentElementScroll()),taggedElement:()=>ke(r)},Ue=(e,t)=>!(Math.abs(e-t)<=ue);let Fe=!1;function He(e,t,n,o,i){x=performance.now(),L||e===a?document.hidden?z("Page hidden - Ignored resize request"):(Fe||(z(`Resize event: ${t}`),R=!0,function(e,t,n,o,i){const r=void 0===n?De[_]():n,l=void 0===o?We[ge]():o;U&&Ue(Z,r)||F&&Ue(pe,l)||"init"===e?(Ve(),Z=r,pe=l,_e(Z,pe,e,i)):!e!==a&&(U&&_ in P||F&&ge in P)?Ze(t):R=!1}(e,t,n,o,i),requestAnimationFrame((()=>{Fe=!1}))),Fe=!0):z("Resizing disabled")}function Ve(){me||(me=!0,z("Trigger event lock on"),requestAnimationFrame((()=>{me=!1,z("Trigger event lock off"),z("--")})))}function Je(e){Z=De[_](),pe=We[ge](),_e(Z,pe,e)}function Ze(e){const t=_;_=v,z(`Reset trigger event: ${e}`),Ve(),Je("reset"),_=t}function _e(e,t,n,o,i){K<-1||(void 0!==i?z(`Message targetOrigin: ${i}`):i=ce,function(){const r=`${te}:${e+(A||0)}:${t+(N||0)}:${n}${void 0===o?"":`:${o}`}`;G&&(console.group(`[iframe-resizer][${te}]`),console.info("Sending message to host page via "+(ae?"sameDomain":"postMessage")),console.info(`%c${r}`,"font-style: italic"),R&&console.info(function(){const e=m(performance.now()-x);return"init"===n?`Initialised iFrame in %c${e}ms`:`Content size recalculated in %c${e}ms`}(),"font-weight:bold;color:#777"),console.groupEnd()),R=!1,ae?window.parent.iframeParentListener(w+r):de.postMessage(w+r,i)}())}function Qe(e){const t={init:function(){X=e.data,de=e.source,k=e.origin,we(),H=!1,setTimeout((()=>{Q=!1}),f)},reset(){Q?z("Page reset ignored by init"):(z("Page size reset by host page"),Je("resetPage"))},resize(){He(a,"Parent window requested size check")},moveToAnchor(){Y.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();z(`PageInfo received from parent: ${e}`),ve?setTimeout((()=>ve(JSON.parse(e)))):_e(0,0,"pageInfoStop"),z(" --")},parentInfo(){const e=o();z(`ParentInfo received from parent: ${e}`),ze?setTimeout(ze(Object.freeze(JSON.parse(e)))):_e(0,0,"parentInfoStop"),z(" --")},message(){const e=o();z(`onMessage called from parent: ${e}`),ye(JSON.parse(e)),z(" --")}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};w===`${e.data}`.slice(0,j)&&(!1!==H?r()?t.init():z(`Ignored message of type "${n()}". Received before initialization.`):function(){const o=n();o in t?t[o]():i()||r()||$(`Unexpected message (${e.data})`)}())}function Xe(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?$("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>Qe({data:e}))),l(window,"message",Qe),l(window,"readystatechange",Xe),Xe())}();
//# sourceMappingURL=index.cjs.js.map
/*!
* @preserve
*
* @module iframe-resizer/child 5.3.3-beta.3 (esm) - 2025-02-02
* @module iframe-resizer/child 5.3.3-beta.4 (esm) - 2025-02-07
*

@@ -20,3 +20,3 @@ * @license GPL-3.0 for non-commercial use only.

const e="5.3.3-beta.3",t=10,n="data-iframe-size",o="data-overflowed",i="bottom",r="right",a="resizeParent",l=(e,t,n,o)=>e.addEventListener(t,n,o||!1),s=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const d=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(s[e]),c=e=>e,u=1e5,m=e=>Math.round(e*u)/u;let f="",p=!1;const g=e=>{f=e.id,p=e.logging},h=e=>e.charAt(0).toUpperCase()+e.slice(1),y=e=>""!=`${e}`&&void 0!==e;function b(e){switch(!0){case!y(e):return"";case y(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case y(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(y(e.className)?`.${e.className}`:"")}}const v=(...e)=>[`[iframe-resizer][${f||"child"}]`,...e].join(" "),z=(...e)=>p&&console?.log(v(...e)),w=(...e)=>p&&console?.info(`%c[iframe-resizer][${f}]%c`,"font-weight: bold;","font-weight: normal;",...e),$=(...e)=>console?.warn(v(...e)),S=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(v)(...e)),M=e=>S(e),E=e=>{const t=e.side||i,n=e.onChange||c,r={root:e.root,rootMargin:"0px",threshold:1};function a(){const e=document.querySelectorAll(`[${o}]`);n(e)}const l=new IntersectionObserver((function(e){for(const n of e){const{boundingClientRect:e,rootBounds:i,target:r}=n,a=e[t],l=0===a||a>i[t];r.toggleAttribute(o,l)}requestAnimationFrame(a)}),r),s=new WeakSet;return function(e){for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}},T="--ifr-start",O="--ifr-end",j="--ifr-measure",P=[],C=new WeakSet,A=e=>"object"==typeof e&&C.add(e);let I=null,N={};const k=setInterval((()=>{if(P.length<10)return;if(N.hasTags&&N.len<25)return;P.sort();const e=Math.min(P.reduce(((e,t)=>e+t),0)/P.length,P[Math.floor(P.length/2)]);z("Max time:",Math.max(...P)),e<=4||(clearInterval(k),S(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${m(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${N.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function R(e){e.getEntries().forEach((e=>{if(e.name===O){const{duration:t}=performance.measure(j,T,O);!function(e,t){const{Side:n,len:o,hasTags:i,logging:r}=e;N=e,C.has(I)||i&&o<=1||(r||A(I),w(`\n ${n} position calculated from:`,I,`\n Parsed ${o} ${i?"tagged":"potentially overflowing"} elements in ${m(t)}ms`))}(e.detail,t),P.push(t),P.length>100&&P.shift()}}))}function x(){new PerformanceObserver(R).observe({entryTypes:["mark"]}),A(document.documentElement),A(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",x):x()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},s={height:()=>($("Custom height calculation function not defined"),De.auto()),width:()=>($("Custom width calculation function not defined"),We.auto())},u={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},f=128,p={},y="checkVisibility"in window,v="auto",w="[iFrameSizer]",j=w.length,P={max:1,min:1,bodyScroll:1,documentElementScroll:1},C="scroll";let A,N,k,R,x,L=!0,q="",B=0,D="",W="",U=!0,F=!1,H=!0,V=!1,J=!1,Z=1,_=v,Q=!0,X="",Y={},G=!1,K=0,ee=!1,te="",ne=c,oe=[],ie="child",re=null,ae=!1,le="",se=[],de=window.parent,ce="*",ue=0,me=!1,fe="",pe=1,ge=C,he=window,ye=()=>{$("onMessage function not defined")},be=()=>{},ve=null,ze=null;function we(){var o,c,u;!function(){const e=e=>"true"===e,t=X.slice(j).split(":");te=t[0],B=void 0===t[1]?B:Number(t[1]),F=void 0===t[2]?F:e(t[2]),G=void 0===t[3]?G:e(t[3]),L=void 0===t[6]?L:e(t[6]),D=t[7],_=void 0===t[8]?_:t[8],q=t[9],W=t[10],ue=void 0===t[11]?ue:Number(t[11]),Y.enable=void 0!==t[12]&&e(t[12]),ie=void 0===t[13]?ie:t[13],ge=void 0===t[14]?ge:t[14],ee=void 0===t[15]?ee:e(t[15]),A=void 0===t[16]?A:Number(t[16]),N=void 0===t[17]?N:Number(t[17]),U=void 0===t[18]?U:e(t[18]),t[19],fe=t[20]||fe,K=void 0===t[21]?K:Number(t[21])}(),g({id:te,logging:G}),z(`Initialising iframe v${e} (${window.location.href})`),function(){function e(e){z(`Reading data from page: ${JSON.stringify(e)}`),ye=e?.onMessage||ye,be=e?.onReady||be,"number"==typeof e?.offset&&(S("<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</>."),U&&(A=e?.offset),F&&(N=e?.offset)),"number"==typeof e?.offsetSize&&(U&&(A=e?.offsetSize),F&&(N=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(le=e.sizeSelector),ce=e?.targetOrigin||ce,_=e?.heightCalculationMethod||_,ge=e?.widthCalculationMethod||ge}function t(e,t){return"function"==typeof e&&(z(`Setup custom ${t}CalcMethod`),s[t]=e,e="custom"),e}if(1===K)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),_=t(_,"height"),ge=t(ge,"width"),z(`TargetOrigin for parent set to: ${ce}`))}(),function(){try{ae="iframeParentListener"in window.parent}catch(e){z("Cross domain iframe detected.")}}(),K<0?M(`${d(K+2)}${d(2)}`):fe.codePointAt(0)>4||K<2&&M(d(3)),fe&&""!==fe&&"false"!==fe?fe!==e&&S(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${fe} - Child page: ${e}.\n`):S("<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"),Pe(),Ce(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.toggleAttribute(n,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&S("<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</>.")}(),Se(),U!==F&&(ne=E({onChange:$e,root:document.documentElement,side:U?i:r})),1!==K&&(he.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===L?(L=!0,He("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===L&&(L=!1),_e(0,0,"autoResize",JSON.stringify(L)),L),close(){_e(0,0,"close")},getId:()=>te,getOrigin:()=>(S("<rb>Deprecated Method</>\n \nThe <b>getOrigin()</> method has been deprecated and replaced with <b>getParentOrigin()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),k),getParentOrigin:()=>k,getPageInfo(e){if("function"==typeof e)return ve=e,_e(0,0,"pageInfo"),void S("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ve=null,_e(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return ze=e,_e(0,0,"parentInfo"),()=>{ze=null,_e(0,0,"parentInfoStop")}},getParentProperties(e){S("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){Y.findTarget(e)},reset(){Ze("parentIframe.reset")},scrollBy(e,t){_e(t,e,"scrollBy")},scrollTo(e,t){_e(t,e,"scrollTo")},scrollToOffset(e,t){_e(t,e,"scrollToOffset")},sendMessage(e,t){_e(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){_=e,Pe()},setWidthCalculationMethod(e){ge=e,Ce()},setTargetOrigin(e){z(`Set targetOrigin: ${e}`),ce=e},resize(e,t){He(a,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){S("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),he.parentIFrame=he.parentIframe),function(){function e(e){_e(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){z(`Add event listener: ${n}`),l(window.document,t,e)}!0===ee&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),Y=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function o(e){function t(e){const t=n(e);z(`Moving to in page link (#${o}) at x: ${t.x}y: ${t.y}`),_e(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?(z(`In page link (#${o}) not found in iFrame, so sending to parent`),_e(0,0,"inPageLink",`#${o}`)):t(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&l(e,"click",(t=>{t.preventDefault(),o(e.getAttribute("href"))}))}function a(){l(window,"hashchange",i)}function s(){setTimeout(i,f)}function d(){z("Setting up location.hash handlers"),r(),a(),s()}return Y.enable?1===K?S("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):d():z("In page linking not enabled"),{findTarget:o}}(),Me(xe(document)()),void 0===D&&(D=`${B}px`),Ee("margin",(c="margin",(u=D).includes("-")&&($(`Negative CSS value ignored for ${c}`),u=""),u)),Ee("background",q),Ee("padding",W),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),z('HTML & body height set to "auto !important"')}(),Te(),He("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&_e(0,0,"title",document.title),!0!==L&&z("Auto Resize disabled"),Oe({method:o="add",eventType:"After Print",eventName:"afterprint"}),Oe({method:o,eventType:"Before Print",eventName:"beforeprint"}),Oe({method:o,eventType:"Ready State Change",eventName:"readystatechange"}),function(){const e=new Set;let t=!1,n=0,o=[];const i=t=>{for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},r=16,a=2,l=200;let s=1;function d(){z("MutationObserver: processMutations");const c=performance.now(),u=c-n,m=r*s+++a;if(u>m&&u<l)return z(`MutationObserver delay: ${u}ms > ${m}`),setTimeout(d,r*s),void(n=c);s=1,o.forEach(i),o=[],0!==e.size?(Te(),Se(),Me(e),e.forEach(Ne),e.clear(),t=!1):t=!1}function c(e){o.push(e),t||(n=performance.now(),t=!0,requestAnimationFrame(d))}function u(){const e=new window.MutationObserver(c),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return z("Create <body/> MutationObserver"),e.observe(t,n),e}u()}(),re=new ResizeObserver(Ae),re.observe(document.body),Ie.add(document.body),Ne(document.body),setTimeout(be),z("Initialization complete"),z("---")}function $e(e){z("Overflowed Elements:",e.length),oe=e,V=oe.length>0,He("overflowChanged","Overflow updated")}function Se(){se=document.querySelectorAll(`[${n}]`),J=se.length>0,z(`Tagged elements found: ${J}`)}function Me(e){J||ne(e)}function Ee(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),z(`Body ${e} set to "${t}"`))}function Te(){if(""!==le){z(`Applying sizeSelector: ${le}`);for(const e of document.querySelectorAll(le))z(`Applying data-iframe-size to: ${b(e)}`),e.dataset.iframeSize=!0}}function Oe(e){({add(t){function n(){He(e.eventName,e.eventType)}p[t]=n,l(window,t,n,{passive:!0})},remove(e){const t=p[e];var n,o;delete p[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),z(`${h(e.method)} event listener: ${e.eventType}`)}function je(e,t,n,o){return t!==e&&(e in n||($(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in u&&S(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`),z(`${o} calculation method set to "${e}"`)),e}function Pe(){_=je(_,v,De,"height")}function Ce(){ge=je(ge,C,We,"width")}function Ae(e){Array.isArray(e)&&0!==e.length&&He("resizeObserver",`Resize Observed: ${b(e[0].target)}`)}const Ie=new WeakSet;function Ne(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!Ie.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(re.observe(e),Ie.add(e),z(`Attached resizeObserver: ${b(e)}`))}const t=xe(e)();for(const e of t){if(Ie.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(re.observe(e),Ie.add(e),z(`Attached resizeObserver: ${b(e)}`))}}function ke(e){performance.mark(T);const t=h(e);let n=0,i=document.documentElement,r=J?0:document.documentElement.getBoundingClientRect().bottom;performance.mark(T);const a=J?se:V?oe:xe(document)();let l=a.length;for(const t of a)J||!y||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,i=t)):l-=1;return I=i,performance.mark(O,{detail:{Side:t,len:l,hasTags:J,logging:G}}),r}const Re=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],xe=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)"),Le={height:0,width:0},qe={height:0,width:0};function Be(e){function t(){return qe[o]=i,Le[o]=l,i}const n=e===De,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),s=`HTML: ${i} Page: ${l}`;switch(!0){case!e.enabled():return l;case J:return e.taggedElement();case!V&&0===qe[o]&&0===Le[o]:return z(`Initial page size values: ${s}`),t();case me&&i===qe[o]&&l===Le[o]:return z(`Size unchanged: ${s}`),Math.max(i,l);case 0===i:return z(`Page is hidden: ${s}`),l;case!V&&i!==qe[o]&&l<=Le[o]:return z(`New HTML bounding size: ${s}`,"Previous bounding size:",qe[o]),t();case!n:return e.taggedElement();case!V&&i<qe[o]:return z("HTML bounding size decreased:",s),t();case l===a||l===r:return z("HTML bounding size equals page size:",s),t();case i>l:return z(`Page size < HTML bounding size: ${s}`),t();default:z(`Content overflowing HTML element: ${s}`)}return Math.max(e.taggedElement(),t())}const De={enabled:()=>U,getOffset:()=>A,auto:()=>Be(De),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>De.bodyOffset(),custom:()=>s.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...Re(De)),min:()=>Math.min(...Re(De)),grow:()=>De.max(),lowestElement:()=>ke(i),taggedElement:()=>ke(i)},We={enabled:()=>F,getOffset:()=>N,auto:()=>Be(We),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>s.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...Re(We)),min:()=>Math.min(...Re(We)),rightMostElement:()=>ke(r),scroll:()=>Math.max(We.bodyScroll(),We.documentElementScroll()),taggedElement:()=>ke(r)},Ue=(e,t)=>!(Math.abs(e-t)<=ue);let Fe=!1;function He(e,t,n,o,i){x=performance.now(),L||e===a?document.hidden?z("Page hidden - Ignored resize request"):(Fe||(z(`Resize event: ${t}`),R=!0,function(e,t,n,o,i){const r=void 0===n?De[_]():n,l=void 0===o?We[ge]():o;U&&Ue(Z,r)||F&&Ue(pe,l)||"init"===e?(Ve(),Z=r,pe=l,_e(Z,pe,e,i)):!e!==a&&(U&&_ in P||F&&ge in P)?Ze(t):R=!1}(e,t,n,o,i),requestAnimationFrame((()=>{Fe=!1}))),Fe=!0):z("Resizing disabled")}function Ve(){me||(me=!0,z("Trigger event lock on"),requestAnimationFrame((()=>{me=!1,z("Trigger event lock off"),z("--")})))}function Je(e){Z=De[_](),pe=We[ge](),_e(Z,pe,e)}function Ze(e){const t=_;_=v,z(`Reset trigger event: ${e}`),Ve(),Je("reset"),_=t}function _e(e,t,n,o,i){K<-1||(void 0!==i?z(`Message targetOrigin: ${i}`):i=ce,function(){const r=`${te}:${e+(A||0)}:${t+(N||0)}:${n}${void 0===o?"":`:${o}`}`;G&&(console.group(`[iframe-resizer][${te}]`),console.info("Sending message to host page via "+(ae?"sameDomain":"postMessage")),console.info(`%c${r}`,"font-style: italic"),R&&console.info(function(){const e=m(performance.now()-x);return"init"===n?`Initialised iFrame in %c${e}ms`:`Content size recalculated in %c${e}ms`}(),"font-weight:bold;color:#777"),console.groupEnd()),R=!1,ae?window.parent.iframeParentListener(w+r):de.postMessage(w+r,i)}())}function Qe(e){const t={init:function(){X=e.data,de=e.source,k=e.origin,we(),H=!1,setTimeout((()=>{Q=!1}),f)},reset(){Q?z("Page reset ignored by init"):(z("Page size reset by host page"),Je("resetPage"))},resize(){He(a,"Parent window requested size check")},moveToAnchor(){Y.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();z(`PageInfo received from parent: ${e}`),ve?setTimeout((()=>ve(JSON.parse(e)))):_e(0,0,"pageInfoStop"),z(" --")},parentInfo(){const e=o();z(`ParentInfo received from parent: ${e}`),ze?setTimeout(ze(Object.freeze(JSON.parse(e)))):_e(0,0,"parentInfoStop"),z(" --")},message(){const e=o();z(`onMessage called from parent: ${e}`),ye(JSON.parse(e)),z(" --")}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};w===`${e.data}`.slice(0,j)&&(!1!==H?r()?t.init():z(`Ignored message of type "${n()}". Received before initialization.`):function(){const o=n();o in t?t[o]():i()||r()||$(`Unexpected message (${e.data})`)}())}function Xe(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?$("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>Qe({data:e}))),l(window,"message",Qe),l(window,"readystatechange",Xe),Xe())}();
const e="5.3.3-beta.4",t=10,n="data-iframe-size",o="data-overflowed",i="bottom",r="right",a="resizeParent",l=(e,t,n,o)=>e.addEventListener(t,n,o||!1),s=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const d=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(s[e]),c=e=>e,u=1e5,m=e=>Math.round(e*u)/u;let f="",p=!1;const g=e=>{f=e.id,p=e.logging},h=e=>e.charAt(0).toUpperCase()+e.slice(1),y=e=>""!=`${e}`&&void 0!==e;function b(e){switch(!0){case!y(e):return"";case y(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case y(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(y(e.className)?`.${e.className}`:"")}}const v=(...e)=>[`[iframe-resizer][${f||"child"}]`,...e].join(" "),z=(...e)=>p&&console?.log(v(...e)),w=(...e)=>p&&console?.info(`%c[iframe-resizer][${f}]%c`,"font-weight: bold;","font-weight: normal;",...e),$=(...e)=>console?.warn(v(...e)),S=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(v)(...e)),M=e=>S(e),E=e=>{const t=e.side||i,n=e.onChange||c,r={root:e.root,rootMargin:"0px",threshold:1};function a(){const e=document.querySelectorAll(`[${o}]`);n(e)}const l=new IntersectionObserver((function(e){for(const n of e){const{boundingClientRect:e,rootBounds:i,target:r}=n,a=e[t],l=0===a||a>i[t];r.toggleAttribute(o,l)}requestAnimationFrame(a)}),r),s=new WeakSet;return function(e){for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}},T="--ifr-start",O="--ifr-end",j="--ifr-measure",P=[],C=new WeakSet,A=e=>"object"==typeof e&&C.add(e);let I=null,N={};const k=setInterval((()=>{if(P.length<10)return;if(N.hasTags&&N.len<25)return;P.sort();const e=Math.min(P.reduce(((e,t)=>e+t),0)/P.length,P[Math.floor(P.length/2)]);z("Max time:",Math.max(...P)),e<=4||(clearInterval(k),S(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${m(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${N.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function R(e){e.getEntries().forEach((e=>{if(e.name===O){const{duration:t}=performance.measure(j,T,O);!function(e,t){const{Side:n,len:o,hasTags:i,logging:r}=e;N=e,C.has(I)||i&&o<=1||(r||A(I),w(`\n ${n} position calculated from:`,I,`\n Parsed ${o} ${i?"tagged":"potentially overflowing"} elements in ${m(t)}ms`))}(e.detail,t),P.push(t),P.length>100&&P.shift()}}))}function x(){new PerformanceObserver(R).observe({entryTypes:["mark"]}),A(document.documentElement),A(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",x):x()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},s={height:()=>($("Custom height calculation function not defined"),De.auto()),width:()=>($("Custom width calculation function not defined"),We.auto())},u={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},f=128,p={},y="checkVisibility"in window,v="auto",w="[iFrameSizer]",j=w.length,P={max:1,min:1,bodyScroll:1,documentElementScroll:1},C="scroll";let A,N,k,R,x,L=!0,q="",B=0,D="",W="",U=!0,F=!1,H=!0,V=!1,J=!1,Z=1,_=v,Q=!0,X="",Y={},G=!1,K=0,ee=!1,te="",ne=c,oe=[],ie="child",re=null,ae=!1,le="",se=[],de=window.parent,ce="*",ue=0,me=!1,fe="",pe=1,ge=C,he=window,ye=()=>{$("onMessage function not defined")},be=()=>{},ve=null,ze=null;function we(){var o,c,u;!function(){const e=e=>"true"===e,t=X.slice(j).split(":");te=t[0],B=void 0===t[1]?B:Number(t[1]),F=void 0===t[2]?F:e(t[2]),G=void 0===t[3]?G:e(t[3]),L=void 0===t[6]?L:e(t[6]),D=t[7],_=void 0===t[8]?_:t[8],q=t[9],W=t[10],ue=void 0===t[11]?ue:Number(t[11]),Y.enable=void 0!==t[12]&&e(t[12]),ie=void 0===t[13]?ie:t[13],ge=void 0===t[14]?ge:t[14],ee=void 0===t[15]?ee:e(t[15]),A=void 0===t[16]?A:Number(t[16]),N=void 0===t[17]?N:Number(t[17]),U=void 0===t[18]?U:e(t[18]),t[19],fe=t[20]||fe,K=void 0===t[21]?K:Number(t[21])}(),g({id:te,logging:G}),z(`Initialising iframe v${e} (${window.location.href})`),function(){function e(e){z(`Reading data from page: ${JSON.stringify(e)}`),ye=e?.onMessage||ye,be=e?.onReady||be,"number"==typeof e?.offset&&(S("<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</>."),U&&(A=e?.offset),F&&(N=e?.offset)),"number"==typeof e?.offsetSize&&(U&&(A=e?.offsetSize),F&&(N=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(le=e.sizeSelector),ce=e?.targetOrigin||ce,_=e?.heightCalculationMethod||_,ge=e?.widthCalculationMethod||ge}function t(e,t){return"function"==typeof e&&(z(`Setup custom ${t}CalcMethod`),s[t]=e,e="custom"),e}if(1===K)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),_=t(_,"height"),ge=t(ge,"width"),z(`TargetOrigin for parent set to: ${ce}`))}(),function(){try{ae="iframeParentListener"in window.parent}catch(e){z("Cross domain iframe detected.")}}(),K<0?M(`${d(K+2)}${d(2)}`):fe.codePointAt(0)>4||K<2&&M(d(3)),fe&&""!==fe&&"false"!==fe?fe!==e&&S(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${fe} - Child page: ${e}.\n`):S("<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"),Pe(),Ce(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.toggleAttribute(n,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&S("<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</>.")}(),Se(),U!==F&&(ne=E({onChange:$e,root:document.documentElement,side:U?i:r})),1!==K&&(he.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===L?(L=!0,He("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===L&&(L=!1),_e(0,0,"autoResize",JSON.stringify(L)),L),close(){_e(0,0,"close")},getId:()=>te,getOrigin:()=>(S("<rb>Deprecated Method</>\n \nThe <b>getOrigin()</> method has been deprecated and replaced with <b>getParentOrigin()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),k),getParentOrigin:()=>k,getPageInfo(e){if("function"==typeof e)return ve=e,_e(0,0,"pageInfo"),void S("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ve=null,_e(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return ze=e,_e(0,0,"parentInfo"),()=>{ze=null,_e(0,0,"parentInfoStop")}},getParentProperties(e){S("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){Y.findTarget(e)},reset(){Ze("parentIframe.reset")},scrollBy(e,t){_e(t,e,"scrollBy")},scrollTo(e,t){_e(t,e,"scrollTo")},scrollToOffset(e,t){_e(t,e,"scrollToOffset")},sendMessage(e,t){_e(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){_=e,Pe()},setWidthCalculationMethod(e){ge=e,Ce()},setTargetOrigin(e){z(`Set targetOrigin: ${e}`),ce=e},resize(e,t){He(a,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){S("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),he.parentIFrame=he.parentIframe),function(){function e(e){_e(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){z(`Add event listener: ${n}`),l(window.document,t,e)}!0===ee&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),Y=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function o(e){function t(e){const t=n(e);z(`Moving to in page link (#${o}) at x: ${t.x}y: ${t.y}`),_e(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?(z(`In page link (#${o}) not found in iFrame, so sending to parent`),_e(0,0,"inPageLink",`#${o}`)):t(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&l(e,"click",(t=>{t.preventDefault(),o(e.getAttribute("href"))}))}function a(){l(window,"hashchange",i)}function s(){setTimeout(i,f)}function d(){z("Setting up location.hash handlers"),r(),a(),s()}return Y.enable?1===K?S("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):d():z("In page linking not enabled"),{findTarget:o}}(),Me(xe(document)()),void 0===D&&(D=`${B}px`),Ee("margin",(c="margin",(u=D).includes("-")&&($(`Negative CSS value ignored for ${c}`),u=""),u)),Ee("background",q),Ee("padding",W),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),z('HTML & body height set to "auto !important"')}(),Te(),He("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&_e(0,0,"title",document.title),!0!==L&&z("Auto Resize disabled"),Oe({method:o="add",eventType:"After Print",eventName:"afterprint"}),Oe({method:o,eventType:"Before Print",eventName:"beforeprint"}),Oe({method:o,eventType:"Ready State Change",eventName:"readystatechange"}),function(){const e=new Set;let t=!1,n=0,o=[];const i=t=>{for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},r=16,a=2,l=200;let s=1;function d(){z("MutationObserver: processMutations");const c=performance.now(),u=c-n,m=r*s+++a;if(u>m&&u<l)return z(`MutationObserver delay: ${u}ms > ${m}`),setTimeout(d,r*s),void(n=c);s=1,o.forEach(i),o=[],0!==e.size?(Te(),Se(),Me(e),e.forEach(Ne),e.clear(),t=!1):t=!1}function c(e){o.push(e),t||(n=performance.now(),t=!0,requestAnimationFrame(d))}function u(){const e=new window.MutationObserver(c),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return z("Create <body/> MutationObserver"),e.observe(t,n),e}u()}(),re=new ResizeObserver(Ae),re.observe(document.body),Ie.add(document.body),Ne(document.body),setTimeout(be),z("Initialization complete"),z("---")}function $e(e){z("Overflowed Elements:",e.length),oe=e,V=oe.length>0,He("overflowChanged","Overflow updated")}function Se(){se=document.querySelectorAll(`[${n}]`),J=se.length>0,z(`Tagged elements found: ${J}`)}function Me(e){J||ne(e)}function Ee(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),z(`Body ${e} set to "${t}"`))}function Te(){if(""!==le){z(`Applying sizeSelector: ${le}`);for(const e of document.querySelectorAll(le))z(`Applying data-iframe-size to: ${b(e)}`),e.dataset.iframeSize=!0}}function Oe(e){({add(t){function n(){He(e.eventName,e.eventType)}p[t]=n,l(window,t,n,{passive:!0})},remove(e){const t=p[e];var n,o;delete p[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),z(`${h(e.method)} event listener: ${e.eventType}`)}function je(e,t,n,o){return t!==e&&(e in n||($(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in u&&S(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`),z(`${o} calculation method set to "${e}"`)),e}function Pe(){_=je(_,v,De,"height")}function Ce(){ge=je(ge,C,We,"width")}function Ae(e){Array.isArray(e)&&0!==e.length&&He("resizeObserver",`Resize Observed: ${b(e[0].target)}`)}const Ie=new WeakSet;function Ne(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!Ie.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(re.observe(e),Ie.add(e),z(`Attached resizeObserver: ${b(e)}`))}const t=xe(e)();for(const e of t){if(Ie.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(re.observe(e),Ie.add(e),z(`Attached resizeObserver: ${b(e)}`))}}function ke(e){performance.mark(T);const t=h(e);let n=0,i=document.documentElement,r=J?0:document.documentElement.getBoundingClientRect().bottom;performance.mark(T);const a=J?se:V?oe:xe(document)();let l=a.length;for(const t of a)J||!y||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,i=t)):l-=1;return I=i,performance.mark(O,{detail:{Side:t,len:l,hasTags:J,logging:G}}),r}const Re=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],xe=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)"),Le={height:0,width:0},qe={height:0,width:0};function Be(e){function t(){return qe[o]=i,Le[o]=l,i}const n=e===De,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),s=`HTML: ${i} Page: ${l}`;switch(!0){case!e.enabled():return l;case J:return e.taggedElement();case!V&&0===qe[o]&&0===Le[o]:return z(`Initial page size values: ${s}`),t();case me&&i===qe[o]&&l===Le[o]:return z(`Size unchanged: ${s}`),Math.max(i,l);case 0===i:return z(`Page is hidden: ${s}`),l;case!V&&i!==qe[o]&&l<=Le[o]:return z(`New HTML bounding size: ${s}`,"Previous bounding size:",qe[o]),t();case!n:return e.taggedElement();case!V&&i<qe[o]:return z("HTML bounding size decreased:",s),t();case l===a||l===r:return z("HTML bounding size equals page size:",s),t();case i>l:return z(`Page size < HTML bounding size: ${s}`),t();default:z(`Content overflowing HTML element: ${s}`)}return Math.max(e.taggedElement(),t())}const De={enabled:()=>U,getOffset:()=>A,auto:()=>Be(De),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>De.bodyOffset(),custom:()=>s.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...Re(De)),min:()=>Math.min(...Re(De)),grow:()=>De.max(),lowestElement:()=>ke(i),taggedElement:()=>ke(i)},We={enabled:()=>F,getOffset:()=>N,auto:()=>Be(We),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>s.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...Re(We)),min:()=>Math.min(...Re(We)),rightMostElement:()=>ke(r),scroll:()=>Math.max(We.bodyScroll(),We.documentElementScroll()),taggedElement:()=>ke(r)},Ue=(e,t)=>!(Math.abs(e-t)<=ue);let Fe=!1;function He(e,t,n,o,i){x=performance.now(),L||e===a?document.hidden?z("Page hidden - Ignored resize request"):(Fe||(z(`Resize event: ${t}`),R=!0,function(e,t,n,o,i){const r=void 0===n?De[_]():n,l=void 0===o?We[ge]():o;U&&Ue(Z,r)||F&&Ue(pe,l)||"init"===e?(Ve(),Z=r,pe=l,_e(Z,pe,e,i)):!e!==a&&(U&&_ in P||F&&ge in P)?Ze(t):R=!1}(e,t,n,o,i),requestAnimationFrame((()=>{Fe=!1}))),Fe=!0):z("Resizing disabled")}function Ve(){me||(me=!0,z("Trigger event lock on"),requestAnimationFrame((()=>{me=!1,z("Trigger event lock off"),z("--")})))}function Je(e){Z=De[_](),pe=We[ge](),_e(Z,pe,e)}function Ze(e){const t=_;_=v,z(`Reset trigger event: ${e}`),Ve(),Je("reset"),_=t}function _e(e,t,n,o,i){K<-1||(void 0!==i?z(`Message targetOrigin: ${i}`):i=ce,function(){const r=`${te}:${e+(A||0)}:${t+(N||0)}:${n}${void 0===o?"":`:${o}`}`;G&&(console.group(`[iframe-resizer][${te}]`),console.info("Sending message to host page via "+(ae?"sameDomain":"postMessage")),console.info(`%c${r}`,"font-style: italic"),R&&console.info(function(){const e=m(performance.now()-x);return"init"===n?`Initialised iFrame in %c${e}ms`:`Content size recalculated in %c${e}ms`}(),"font-weight:bold;color:#777"),console.groupEnd()),R=!1,ae?window.parent.iframeParentListener(w+r):de.postMessage(w+r,i)}())}function Qe(e){const t={init:function(){X=e.data,de=e.source,k=e.origin,we(),H=!1,setTimeout((()=>{Q=!1}),f)},reset(){Q?z("Page reset ignored by init"):(z("Page size reset by host page"),Je("resetPage"))},resize(){He(a,"Parent window requested size check")},moveToAnchor(){Y.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();z(`PageInfo received from parent: ${e}`),ve?setTimeout((()=>ve(JSON.parse(e)))):_e(0,0,"pageInfoStop"),z(" --")},parentInfo(){const e=o();z(`ParentInfo received from parent: ${e}`),ze?setTimeout(ze(Object.freeze(JSON.parse(e)))):_e(0,0,"parentInfoStop"),z(" --")},message(){const e=o();z(`onMessage called from parent: ${e}`),ye(JSON.parse(e)),z(" --")}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};w===`${e.data}`.slice(0,j)&&(!1!==H?r()?t.init():z(`Ignored message of type "${n()}". Received before initialization.`):function(){const o=n();o in t?t[o]():i()||r()||$(`Unexpected message (${e.data})`)}())}function Xe(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?$("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>Qe({data:e}))),l(window,"message",Qe),l(window,"readystatechange",Xe),Xe())}();
//# sourceMappingURL=index.esm.js.map
/*!
* @preserve
*
* @module iframe-resizer/child 5.3.3-beta.3 (umd) - 2025-02-02
* @module iframe-resizer/child 5.3.3-beta.4 (umd) - 2025-02-07
*

@@ -20,3 +20,3 @@ * @license GPL-3.0 for non-commercial use only.

!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";const e="5.3.3-beta.3",t=10,n="data-iframe-size",o="data-overflowed",i="bottom",r="right",a="resizeParent",l=(e,t,n,o)=>e.addEventListener(t,n,o||!1),s=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const d=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(s[e]),c=e=>e,u=1e5,m=e=>Math.round(e*u)/u;let f="",p=!1;const g=e=>{f=e.id,p=e.logging},h=e=>e.charAt(0).toUpperCase()+e.slice(1),y=e=>""!=`${e}`&&void 0!==e;function b(e){switch(!0){case!y(e):return"";case y(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case y(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(y(e.className)?`.${e.className}`:"")}}const v=(...e)=>[`[iframe-resizer][${f||"child"}]`,...e].join(" "),z=(...e)=>p&&console?.log(v(...e)),w=(...e)=>p&&console?.info(`%c[iframe-resizer][${f}]%c`,"font-weight: bold;","font-weight: normal;",...e),$=(...e)=>console?.warn(v(...e)),S=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(v)(...e)),M=e=>S(e),E=e=>{const t=e.side||i,n=e.onChange||c,r={root:e.root,rootMargin:"0px",threshold:1};function a(){const e=document.querySelectorAll(`[${o}]`);n(e)}const l=new IntersectionObserver((function(e){for(const n of e){const{boundingClientRect:e,rootBounds:i,target:r}=n,a=e[t],l=0===a||a>i[t];r.toggleAttribute(o,l)}requestAnimationFrame(a)}),r),s=new WeakSet;return function(e){for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}},T="--ifr-start",O="--ifr-end",j="--ifr-measure",P=[],C=new WeakSet,A=e=>"object"==typeof e&&C.add(e);let I=null,N={};const k=setInterval((()=>{if(P.length<10)return;if(N.hasTags&&N.len<25)return;P.sort();const e=Math.min(P.reduce(((e,t)=>e+t),0)/P.length,P[Math.floor(P.length/2)]);z("Max time:",Math.max(...P)),e<=4||(clearInterval(k),S(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${m(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${N.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function R(e){e.getEntries().forEach((e=>{if(e.name===O){const{duration:t}=performance.measure(j,T,O);!function(e,t){const{Side:n,len:o,hasTags:i,logging:r}=e;N=e,C.has(I)||i&&o<=1||(r||A(I),w(`\n ${n} position calculated from:`,I,`\n Parsed ${o} ${i?"tagged":"potentially overflowing"} elements in ${m(t)}ms`))}(e.detail,t),P.push(t),P.length>100&&P.shift()}}))}function x(){new PerformanceObserver(R).observe({entryTypes:["mark"]}),A(document.documentElement),A(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",x):x()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},s={height:()=>($("Custom height calculation function not defined"),De.auto()),width:()=>($("Custom width calculation function not defined"),We.auto())},u={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},f=128,p={},y="checkVisibility"in window,v="auto",w="[iFrameSizer]",j=w.length,P={max:1,min:1,bodyScroll:1,documentElementScroll:1},C="scroll";let A,N,k,R,x,L=!0,q="",B=0,D="",W="",U=!0,F=!1,H=!0,V=!1,J=!1,Z=1,_=v,Q=!0,X="",Y={},G=!1,K=0,ee=!1,te="",ne=c,oe=[],ie="child",re=null,ae=!1,le="",se=[],de=window.parent,ce="*",ue=0,me=!1,fe="",pe=1,ge=C,he=window,ye=()=>{$("onMessage function not defined")},be=()=>{},ve=null,ze=null;function we(){var o,c,u;!function(){const e=e=>"true"===e,t=X.slice(j).split(":");te=t[0],B=void 0===t[1]?B:Number(t[1]),F=void 0===t[2]?F:e(t[2]),G=void 0===t[3]?G:e(t[3]),L=void 0===t[6]?L:e(t[6]),D=t[7],_=void 0===t[8]?_:t[8],q=t[9],W=t[10],ue=void 0===t[11]?ue:Number(t[11]),Y.enable=void 0!==t[12]&&e(t[12]),ie=void 0===t[13]?ie:t[13],ge=void 0===t[14]?ge:t[14],ee=void 0===t[15]?ee:e(t[15]),A=void 0===t[16]?A:Number(t[16]),N=void 0===t[17]?N:Number(t[17]),U=void 0===t[18]?U:e(t[18]),t[19],fe=t[20]||fe,K=void 0===t[21]?K:Number(t[21])}(),g({id:te,logging:G}),z(`Initialising iframe v${e} (${window.location.href})`),function(){function e(e){z(`Reading data from page: ${JSON.stringify(e)}`),ye=e?.onMessage||ye,be=e?.onReady||be,"number"==typeof e?.offset&&(S("<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</>."),U&&(A=e?.offset),F&&(N=e?.offset)),"number"==typeof e?.offsetSize&&(U&&(A=e?.offsetSize),F&&(N=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(le=e.sizeSelector),ce=e?.targetOrigin||ce,_=e?.heightCalculationMethod||_,ge=e?.widthCalculationMethod||ge}function t(e,t){return"function"==typeof e&&(z(`Setup custom ${t}CalcMethod`),s[t]=e,e="custom"),e}if(1===K)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),_=t(_,"height"),ge=t(ge,"width"),z(`TargetOrigin for parent set to: ${ce}`))}(),function(){try{ae="iframeParentListener"in window.parent}catch(e){z("Cross domain iframe detected.")}}(),K<0?M(`${d(K+2)}${d(2)}`):fe.codePointAt(0)>4||K<2&&M(d(3)),fe&&""!==fe&&"false"!==fe?fe!==e&&S(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${fe} - Child page: ${e}.\n`):S("<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"),Pe(),Ce(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.toggleAttribute(n,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&S("<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</>.")}(),Se(),U!==F&&(ne=E({onChange:$e,root:document.documentElement,side:U?i:r})),1!==K&&(he.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===L?(L=!0,He("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===L&&(L=!1),_e(0,0,"autoResize",JSON.stringify(L)),L),close(){_e(0,0,"close")},getId:()=>te,getOrigin:()=>(S("<rb>Deprecated Method</>\n \nThe <b>getOrigin()</> method has been deprecated and replaced with <b>getParentOrigin()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),k),getParentOrigin:()=>k,getPageInfo(e){if("function"==typeof e)return ve=e,_e(0,0,"pageInfo"),void S("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ve=null,_e(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return ze=e,_e(0,0,"parentInfo"),()=>{ze=null,_e(0,0,"parentInfoStop")}},getParentProperties(e){S("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){Y.findTarget(e)},reset(){Ze("parentIframe.reset")},scrollBy(e,t){_e(t,e,"scrollBy")},scrollTo(e,t){_e(t,e,"scrollTo")},scrollToOffset(e,t){_e(t,e,"scrollToOffset")},sendMessage(e,t){_e(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){_=e,Pe()},setWidthCalculationMethod(e){ge=e,Ce()},setTargetOrigin(e){z(`Set targetOrigin: ${e}`),ce=e},resize(e,t){He(a,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){S("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),he.parentIFrame=he.parentIframe),function(){function e(e){_e(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){z(`Add event listener: ${n}`),l(window.document,t,e)}!0===ee&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),Y=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function o(e){function t(e){const t=n(e);z(`Moving to in page link (#${o}) at x: ${t.x}y: ${t.y}`),_e(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?(z(`In page link (#${o}) not found in iFrame, so sending to parent`),_e(0,0,"inPageLink",`#${o}`)):t(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&l(e,"click",(t=>{t.preventDefault(),o(e.getAttribute("href"))}))}function a(){l(window,"hashchange",i)}function s(){setTimeout(i,f)}function d(){z("Setting up location.hash handlers"),r(),a(),s()}return Y.enable?1===K?S("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):d():z("In page linking not enabled"),{findTarget:o}}(),Me(xe(document)()),void 0===D&&(D=`${B}px`),Ee("margin",(c="margin",(u=D).includes("-")&&($(`Negative CSS value ignored for ${c}`),u=""),u)),Ee("background",q),Ee("padding",W),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),z('HTML & body height set to "auto !important"')}(),Te(),He("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&_e(0,0,"title",document.title),!0!==L&&z("Auto Resize disabled"),Oe({method:o="add",eventType:"After Print",eventName:"afterprint"}),Oe({method:o,eventType:"Before Print",eventName:"beforeprint"}),Oe({method:o,eventType:"Ready State Change",eventName:"readystatechange"}),function(){const e=new Set;let t=!1,n=0,o=[];const i=t=>{for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},r=16,a=2,l=200;let s=1;function d(){z("MutationObserver: processMutations");const c=performance.now(),u=c-n,m=r*s+++a;if(u>m&&u<l)return z(`MutationObserver delay: ${u}ms > ${m}`),setTimeout(d,r*s),void(n=c);s=1,o.forEach(i),o=[],0!==e.size?(Te(),Se(),Me(e),e.forEach(Ne),e.clear(),t=!1):t=!1}function c(e){o.push(e),t||(n=performance.now(),t=!0,requestAnimationFrame(d))}function u(){const e=new window.MutationObserver(c),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return z("Create <body/> MutationObserver"),e.observe(t,n),e}u()}(),re=new ResizeObserver(Ae),re.observe(document.body),Ie.add(document.body),Ne(document.body),setTimeout(be),z("Initialization complete"),z("---")}function $e(e){z("Overflowed Elements:",e.length),oe=e,V=oe.length>0,He("overflowChanged","Overflow updated")}function Se(){se=document.querySelectorAll(`[${n}]`),J=se.length>0,z(`Tagged elements found: ${J}`)}function Me(e){J||ne(e)}function Ee(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),z(`Body ${e} set to "${t}"`))}function Te(){if(""!==le){z(`Applying sizeSelector: ${le}`);for(const e of document.querySelectorAll(le))z(`Applying data-iframe-size to: ${b(e)}`),e.dataset.iframeSize=!0}}function Oe(e){({add(t){function n(){He(e.eventName,e.eventType)}p[t]=n,l(window,t,n,{passive:!0})},remove(e){const t=p[e];var n,o;delete p[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),z(`${h(e.method)} event listener: ${e.eventType}`)}function je(e,t,n,o){return t!==e&&(e in n||($(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in u&&S(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`),z(`${o} calculation method set to "${e}"`)),e}function Pe(){_=je(_,v,De,"height")}function Ce(){ge=je(ge,C,We,"width")}function Ae(e){Array.isArray(e)&&0!==e.length&&He("resizeObserver",`Resize Observed: ${b(e[0].target)}`)}const Ie=new WeakSet;function Ne(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!Ie.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(re.observe(e),Ie.add(e),z(`Attached resizeObserver: ${b(e)}`))}const t=xe(e)();for(const e of t){if(Ie.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(re.observe(e),Ie.add(e),z(`Attached resizeObserver: ${b(e)}`))}}function ke(e){performance.mark(T);const t=h(e);let n=0,i=document.documentElement,r=J?0:document.documentElement.getBoundingClientRect().bottom;performance.mark(T);const a=J?se:V?oe:xe(document)();let l=a.length;for(const t of a)J||!y||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,i=t)):l-=1;return I=i,performance.mark(O,{detail:{Side:t,len:l,hasTags:J,logging:G}}),r}const Re=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],xe=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)"),Le={height:0,width:0},qe={height:0,width:0};function Be(e){function t(){return qe[o]=i,Le[o]=l,i}const n=e===De,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),s=`HTML: ${i} Page: ${l}`;switch(!0){case!e.enabled():return l;case J:return e.taggedElement();case!V&&0===qe[o]&&0===Le[o]:return z(`Initial page size values: ${s}`),t();case me&&i===qe[o]&&l===Le[o]:return z(`Size unchanged: ${s}`),Math.max(i,l);case 0===i:return z(`Page is hidden: ${s}`),l;case!V&&i!==qe[o]&&l<=Le[o]:return z(`New HTML bounding size: ${s}`,"Previous bounding size:",qe[o]),t();case!n:return e.taggedElement();case!V&&i<qe[o]:return z("HTML bounding size decreased:",s),t();case l===a||l===r:return z("HTML bounding size equals page size:",s),t();case i>l:return z(`Page size < HTML bounding size: ${s}`),t();default:z(`Content overflowing HTML element: ${s}`)}return Math.max(e.taggedElement(),t())}const De={enabled:()=>U,getOffset:()=>A,auto:()=>Be(De),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>De.bodyOffset(),custom:()=>s.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...Re(De)),min:()=>Math.min(...Re(De)),grow:()=>De.max(),lowestElement:()=>ke(i),taggedElement:()=>ke(i)},We={enabled:()=>F,getOffset:()=>N,auto:()=>Be(We),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>s.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...Re(We)),min:()=>Math.min(...Re(We)),rightMostElement:()=>ke(r),scroll:()=>Math.max(We.bodyScroll(),We.documentElementScroll()),taggedElement:()=>ke(r)},Ue=(e,t)=>!(Math.abs(e-t)<=ue);let Fe=!1;function He(e,t,n,o,i){x=performance.now(),L||e===a?document.hidden?z("Page hidden - Ignored resize request"):(Fe||(z(`Resize event: ${t}`),R=!0,function(e,t,n,o,i){const r=void 0===n?De[_]():n,l=void 0===o?We[ge]():o;U&&Ue(Z,r)||F&&Ue(pe,l)||"init"===e?(Ve(),Z=r,pe=l,_e(Z,pe,e,i)):!e!==a&&(U&&_ in P||F&&ge in P)?Ze(t):R=!1}(e,t,n,o,i),requestAnimationFrame((()=>{Fe=!1}))),Fe=!0):z("Resizing disabled")}function Ve(){me||(me=!0,z("Trigger event lock on"),requestAnimationFrame((()=>{me=!1,z("Trigger event lock off"),z("--")})))}function Je(e){Z=De[_](),pe=We[ge](),_e(Z,pe,e)}function Ze(e){const t=_;_=v,z(`Reset trigger event: ${e}`),Ve(),Je("reset"),_=t}function _e(e,t,n,o,i){K<-1||(void 0!==i?z(`Message targetOrigin: ${i}`):i=ce,function(){const r=`${te}:${e+(A||0)}:${t+(N||0)}:${n}${void 0===o?"":`:${o}`}`;G&&(console.group(`[iframe-resizer][${te}]`),console.info("Sending message to host page via "+(ae?"sameDomain":"postMessage")),console.info(`%c${r}`,"font-style: italic"),R&&console.info(function(){const e=m(performance.now()-x);return"init"===n?`Initialised iFrame in %c${e}ms`:`Content size recalculated in %c${e}ms`}(),"font-weight:bold;color:#777"),console.groupEnd()),R=!1,ae?window.parent.iframeParentListener(w+r):de.postMessage(w+r,i)}())}function Qe(e){const t={init:function(){X=e.data,de=e.source,k=e.origin,we(),H=!1,setTimeout((()=>{Q=!1}),f)},reset(){Q?z("Page reset ignored by init"):(z("Page size reset by host page"),Je("resetPage"))},resize(){He(a,"Parent window requested size check")},moveToAnchor(){Y.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();z(`PageInfo received from parent: ${e}`),ve?setTimeout((()=>ve(JSON.parse(e)))):_e(0,0,"pageInfoStop"),z(" --")},parentInfo(){const e=o();z(`ParentInfo received from parent: ${e}`),ze?setTimeout(ze(Object.freeze(JSON.parse(e)))):_e(0,0,"parentInfoStop"),z(" --")},message(){const e=o();z(`onMessage called from parent: ${e}`),ye(JSON.parse(e)),z(" --")}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};w===`${e.data}`.slice(0,j)&&(!1!==H?r()?t.init():z(`Ignored message of type "${n()}". Received before initialization.`):function(){const o=n();o in t?t[o]():i()||r()||$(`Unexpected message (${e.data})`)}())}function Xe(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?$("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>Qe({data:e}))),l(window,"message",Qe),l(window,"readystatechange",Xe),Xe())}()}));
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";const e="5.3.3-beta.4",t=10,n="data-iframe-size",o="data-overflowed",i="bottom",r="right",a="resizeParent",l=(e,t,n,o)=>e.addEventListener(t,n,o||!1),s=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const d=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(s[e]),c=e=>e,u=1e5,m=e=>Math.round(e*u)/u;let f="",p=!1;const g=e=>{f=e.id,p=e.logging},h=e=>e.charAt(0).toUpperCase()+e.slice(1),y=e=>""!=`${e}`&&void 0!==e;function b(e){switch(!0){case!y(e):return"";case y(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case y(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(y(e.className)?`.${e.className}`:"")}}const v=(...e)=>[`[iframe-resizer][${f||"child"}]`,...e].join(" "),z=(...e)=>p&&console?.log(v(...e)),w=(...e)=>p&&console?.info(`%c[iframe-resizer][${f}]%c`,"font-weight: bold;","font-weight: normal;",...e),$=(...e)=>console?.warn(v(...e)),S=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(v)(...e)),M=e=>S(e),E=e=>{const t=e.side||i,n=e.onChange||c,r={root:e.root,rootMargin:"0px",threshold:1};function a(){const e=document.querySelectorAll(`[${o}]`);n(e)}const l=new IntersectionObserver((function(e){for(const n of e){const{boundingClientRect:e,rootBounds:i,target:r}=n,a=e[t],l=0===a||a>i[t];r.toggleAttribute(o,l)}requestAnimationFrame(a)}),r),s=new WeakSet;return function(e){for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}},T="--ifr-start",O="--ifr-end",j="--ifr-measure",P=[],C=new WeakSet,A=e=>"object"==typeof e&&C.add(e);let I=null,N={};const k=setInterval((()=>{if(P.length<10)return;if(N.hasTags&&N.len<25)return;P.sort();const e=Math.min(P.reduce(((e,t)=>e+t),0)/P.length,P[Math.floor(P.length/2)]);z("Max time:",Math.max(...P)),e<=4||(clearInterval(k),S(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${m(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${N.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function R(e){e.getEntries().forEach((e=>{if(e.name===O){const{duration:t}=performance.measure(j,T,O);!function(e,t){const{Side:n,len:o,hasTags:i,logging:r}=e;N=e,C.has(I)||i&&o<=1||(r||A(I),w(`\n ${n} position calculated from:`,I,`\n Parsed ${o} ${i?"tagged":"potentially overflowing"} elements in ${m(t)}ms`))}(e.detail,t),P.push(t),P.length>100&&P.shift()}}))}function x(){new PerformanceObserver(R).observe({entryTypes:["mark"]}),A(document.documentElement),A(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",x):x()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},s={height:()=>($("Custom height calculation function not defined"),De.auto()),width:()=>($("Custom width calculation function not defined"),We.auto())},u={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},f=128,p={},y="checkVisibility"in window,v="auto",w="[iFrameSizer]",j=w.length,P={max:1,min:1,bodyScroll:1,documentElementScroll:1},C="scroll";let A,N,k,R,x,L=!0,q="",B=0,D="",W="",U=!0,F=!1,H=!0,V=!1,J=!1,Z=1,_=v,Q=!0,X="",Y={},G=!1,K=0,ee=!1,te="",ne=c,oe=[],ie="child",re=null,ae=!1,le="",se=[],de=window.parent,ce="*",ue=0,me=!1,fe="",pe=1,ge=C,he=window,ye=()=>{$("onMessage function not defined")},be=()=>{},ve=null,ze=null;function we(){var o,c,u;!function(){const e=e=>"true"===e,t=X.slice(j).split(":");te=t[0],B=void 0===t[1]?B:Number(t[1]),F=void 0===t[2]?F:e(t[2]),G=void 0===t[3]?G:e(t[3]),L=void 0===t[6]?L:e(t[6]),D=t[7],_=void 0===t[8]?_:t[8],q=t[9],W=t[10],ue=void 0===t[11]?ue:Number(t[11]),Y.enable=void 0!==t[12]&&e(t[12]),ie=void 0===t[13]?ie:t[13],ge=void 0===t[14]?ge:t[14],ee=void 0===t[15]?ee:e(t[15]),A=void 0===t[16]?A:Number(t[16]),N=void 0===t[17]?N:Number(t[17]),U=void 0===t[18]?U:e(t[18]),t[19],fe=t[20]||fe,K=void 0===t[21]?K:Number(t[21])}(),g({id:te,logging:G}),z(`Initialising iframe v${e} (${window.location.href})`),function(){function e(e){z(`Reading data from page: ${JSON.stringify(e)}`),ye=e?.onMessage||ye,be=e?.onReady||be,"number"==typeof e?.offset&&(S("<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</>."),U&&(A=e?.offset),F&&(N=e?.offset)),"number"==typeof e?.offsetSize&&(U&&(A=e?.offsetSize),F&&(N=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(le=e.sizeSelector),ce=e?.targetOrigin||ce,_=e?.heightCalculationMethod||_,ge=e?.widthCalculationMethod||ge}function t(e,t){return"function"==typeof e&&(z(`Setup custom ${t}CalcMethod`),s[t]=e,e="custom"),e}if(1===K)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),_=t(_,"height"),ge=t(ge,"width"),z(`TargetOrigin for parent set to: ${ce}`))}(),function(){try{ae="iframeParentListener"in window.parent}catch(e){z("Cross domain iframe detected.")}}(),K<0?M(`${d(K+2)}${d(2)}`):fe.codePointAt(0)>4||K<2&&M(d(3)),fe&&""!==fe&&"false"!==fe?fe!==e&&S(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${fe} - Child page: ${e}.\n`):S("<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"),Pe(),Ce(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.toggleAttribute(n,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&S("<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</>.")}(),Se(),U!==F&&(ne=E({onChange:$e,root:document.documentElement,side:U?i:r})),1!==K&&(he.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===L?(L=!0,He("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===L&&(L=!1),_e(0,0,"autoResize",JSON.stringify(L)),L),close(){_e(0,0,"close")},getId:()=>te,getOrigin:()=>(S("<rb>Deprecated Method</>\n \nThe <b>getOrigin()</> method has been deprecated and replaced with <b>getParentOrigin()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),k),getParentOrigin:()=>k,getPageInfo(e){if("function"==typeof e)return ve=e,_e(0,0,"pageInfo"),void S("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ve=null,_e(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return ze=e,_e(0,0,"parentInfo"),()=>{ze=null,_e(0,0,"parentInfoStop")}},getParentProperties(e){S("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){Y.findTarget(e)},reset(){Ze("parentIframe.reset")},scrollBy(e,t){_e(t,e,"scrollBy")},scrollTo(e,t){_e(t,e,"scrollTo")},scrollToOffset(e,t){_e(t,e,"scrollToOffset")},sendMessage(e,t){_e(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){_=e,Pe()},setWidthCalculationMethod(e){ge=e,Ce()},setTargetOrigin(e){z(`Set targetOrigin: ${e}`),ce=e},resize(e,t){He(a,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){S("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),he.parentIFrame=he.parentIframe),function(){function e(e){_e(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){z(`Add event listener: ${n}`),l(window.document,t,e)}!0===ee&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),Y=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function o(e){function t(e){const t=n(e);z(`Moving to in page link (#${o}) at x: ${t.x}y: ${t.y}`),_e(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?(z(`In page link (#${o}) not found in iFrame, so sending to parent`),_e(0,0,"inPageLink",`#${o}`)):t(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&l(e,"click",(t=>{t.preventDefault(),o(e.getAttribute("href"))}))}function a(){l(window,"hashchange",i)}function s(){setTimeout(i,f)}function d(){z("Setting up location.hash handlers"),r(),a(),s()}return Y.enable?1===K?S("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):d():z("In page linking not enabled"),{findTarget:o}}(),Me(xe(document)()),void 0===D&&(D=`${B}px`),Ee("margin",(c="margin",(u=D).includes("-")&&($(`Negative CSS value ignored for ${c}`),u=""),u)),Ee("background",q),Ee("padding",W),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),z('HTML & body height set to "auto !important"')}(),Te(),He("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&_e(0,0,"title",document.title),!0!==L&&z("Auto Resize disabled"),Oe({method:o="add",eventType:"After Print",eventName:"afterprint"}),Oe({method:o,eventType:"Before Print",eventName:"beforeprint"}),Oe({method:o,eventType:"Ready State Change",eventName:"readystatechange"}),function(){const e=new Set;let t=!1,n=0,o=[];const i=t=>{for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},r=16,a=2,l=200;let s=1;function d(){z("MutationObserver: processMutations");const c=performance.now(),u=c-n,m=r*s+++a;if(u>m&&u<l)return z(`MutationObserver delay: ${u}ms > ${m}`),setTimeout(d,r*s),void(n=c);s=1,o.forEach(i),o=[],0!==e.size?(Te(),Se(),Me(e),e.forEach(Ne),e.clear(),t=!1):t=!1}function c(e){o.push(e),t||(n=performance.now(),t=!0,requestAnimationFrame(d))}function u(){const e=new window.MutationObserver(c),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return z("Create <body/> MutationObserver"),e.observe(t,n),e}u()}(),re=new ResizeObserver(Ae),re.observe(document.body),Ie.add(document.body),Ne(document.body),setTimeout(be),z("Initialization complete"),z("---")}function $e(e){z("Overflowed Elements:",e.length),oe=e,V=oe.length>0,He("overflowChanged","Overflow updated")}function Se(){se=document.querySelectorAll(`[${n}]`),J=se.length>0,z(`Tagged elements found: ${J}`)}function Me(e){J||ne(e)}function Ee(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),z(`Body ${e} set to "${t}"`))}function Te(){if(""!==le){z(`Applying sizeSelector: ${le}`);for(const e of document.querySelectorAll(le))z(`Applying data-iframe-size to: ${b(e)}`),e.dataset.iframeSize=!0}}function Oe(e){({add(t){function n(){He(e.eventName,e.eventType)}p[t]=n,l(window,t,n,{passive:!0})},remove(e){const t=p[e];var n,o;delete p[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),z(`${h(e.method)} event listener: ${e.eventType}`)}function je(e,t,n,o){return t!==e&&(e in n||($(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in u&&S(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`),z(`${o} calculation method set to "${e}"`)),e}function Pe(){_=je(_,v,De,"height")}function Ce(){ge=je(ge,C,We,"width")}function Ae(e){Array.isArray(e)&&0!==e.length&&He("resizeObserver",`Resize Observed: ${b(e[0].target)}`)}const Ie=new WeakSet;function Ne(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!Ie.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(re.observe(e),Ie.add(e),z(`Attached resizeObserver: ${b(e)}`))}const t=xe(e)();for(const e of t){if(Ie.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(re.observe(e),Ie.add(e),z(`Attached resizeObserver: ${b(e)}`))}}function ke(e){performance.mark(T);const t=h(e);let n=0,i=document.documentElement,r=J?0:document.documentElement.getBoundingClientRect().bottom;performance.mark(T);const a=J?se:V?oe:xe(document)();let l=a.length;for(const t of a)J||!y||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,i=t)):l-=1;return I=i,performance.mark(O,{detail:{Side:t,len:l,hasTags:J,logging:G}}),r}const Re=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],xe=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)"),Le={height:0,width:0},qe={height:0,width:0};function Be(e){function t(){return qe[o]=i,Le[o]=l,i}const n=e===De,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),s=`HTML: ${i} Page: ${l}`;switch(!0){case!e.enabled():return l;case J:return e.taggedElement();case!V&&0===qe[o]&&0===Le[o]:return z(`Initial page size values: ${s}`),t();case me&&i===qe[o]&&l===Le[o]:return z(`Size unchanged: ${s}`),Math.max(i,l);case 0===i:return z(`Page is hidden: ${s}`),l;case!V&&i!==qe[o]&&l<=Le[o]:return z(`New HTML bounding size: ${s}`,"Previous bounding size:",qe[o]),t();case!n:return e.taggedElement();case!V&&i<qe[o]:return z("HTML bounding size decreased:",s),t();case l===a||l===r:return z("HTML bounding size equals page size:",s),t();case i>l:return z(`Page size < HTML bounding size: ${s}`),t();default:z(`Content overflowing HTML element: ${s}`)}return Math.max(e.taggedElement(),t())}const De={enabled:()=>U,getOffset:()=>A,auto:()=>Be(De),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>De.bodyOffset(),custom:()=>s.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...Re(De)),min:()=>Math.min(...Re(De)),grow:()=>De.max(),lowestElement:()=>ke(i),taggedElement:()=>ke(i)},We={enabled:()=>F,getOffset:()=>N,auto:()=>Be(We),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>s.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...Re(We)),min:()=>Math.min(...Re(We)),rightMostElement:()=>ke(r),scroll:()=>Math.max(We.bodyScroll(),We.documentElementScroll()),taggedElement:()=>ke(r)},Ue=(e,t)=>!(Math.abs(e-t)<=ue);let Fe=!1;function He(e,t,n,o,i){x=performance.now(),L||e===a?document.hidden?z("Page hidden - Ignored resize request"):(Fe||(z(`Resize event: ${t}`),R=!0,function(e,t,n,o,i){const r=void 0===n?De[_]():n,l=void 0===o?We[ge]():o;U&&Ue(Z,r)||F&&Ue(pe,l)||"init"===e?(Ve(),Z=r,pe=l,_e(Z,pe,e,i)):!e!==a&&(U&&_ in P||F&&ge in P)?Ze(t):R=!1}(e,t,n,o,i),requestAnimationFrame((()=>{Fe=!1}))),Fe=!0):z("Resizing disabled")}function Ve(){me||(me=!0,z("Trigger event lock on"),requestAnimationFrame((()=>{me=!1,z("Trigger event lock off"),z("--")})))}function Je(e){Z=De[_](),pe=We[ge](),_e(Z,pe,e)}function Ze(e){const t=_;_=v,z(`Reset trigger event: ${e}`),Ve(),Je("reset"),_=t}function _e(e,t,n,o,i){K<-1||(void 0!==i?z(`Message targetOrigin: ${i}`):i=ce,function(){const r=`${te}:${e+(A||0)}:${t+(N||0)}:${n}${void 0===o?"":`:${o}`}`;G&&(console.group(`[iframe-resizer][${te}]`),console.info("Sending message to host page via "+(ae?"sameDomain":"postMessage")),console.info(`%c${r}`,"font-style: italic"),R&&console.info(function(){const e=m(performance.now()-x);return"init"===n?`Initialised iFrame in %c${e}ms`:`Content size recalculated in %c${e}ms`}(),"font-weight:bold;color:#777"),console.groupEnd()),R=!1,ae?window.parent.iframeParentListener(w+r):de.postMessage(w+r,i)}())}function Qe(e){const t={init:function(){X=e.data,de=e.source,k=e.origin,we(),H=!1,setTimeout((()=>{Q=!1}),f)},reset(){Q?z("Page reset ignored by init"):(z("Page size reset by host page"),Je("resetPage"))},resize(){He(a,"Parent window requested size check")},moveToAnchor(){Y.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();z(`PageInfo received from parent: ${e}`),ve?setTimeout((()=>ve(JSON.parse(e)))):_e(0,0,"pageInfoStop"),z(" --")},parentInfo(){const e=o();z(`ParentInfo received from parent: ${e}`),ze?setTimeout(ze(Object.freeze(JSON.parse(e)))):_e(0,0,"parentInfoStop"),z(" --")},message(){const e=o();z(`onMessage called from parent: ${e}`),ye(JSON.parse(e)),z(" --")}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};w===`${e.data}`.slice(0,j)&&(!1!==H?r()?t.init():z(`Ignored message of type "${n()}". Received before initialization.`):function(){const o=n();o in t?t[o]():i()||r()||$(`Unexpected message (${e.data})`)}())}function Xe(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?$("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>Qe({data:e}))),l(window,"message",Qe),l(window,"readystatechange",Xe),Xe())}()}));
//# sourceMappingURL=index.umd.js.map
{
"name": "@iframe-resizer/child",
"version": "5.3.3-beta.3",
"version": "5.3.3-beta.4",
"license": "GPL-3.0",

@@ -5,0 +5,0 @@ "homepage": "https://iframe-resizer.com",

@@ -25,2 +25,2 @@ [<img src="https://iframe-resizer.com/logo-full.svg" alt="" title="" style="margin-bottom: -20px">](https://iframe-resizer.com)

_iframe-resizer version 5.3.3-beta.3 2025-02-02 - 14:51:45.531Z_
_iframe-resizer version 5.3.3-beta.4 2025-02-07 - 13:27:11.691Z_
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc