iframe-resizer 5.5.4-beta.1 → 5.5.4-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy 5.5.4-beta.1 (cjs) - 2025-08-26
4
+ * @module iframe-resizer/legacy 5.5.4-beta.2 (cjs) - 2025-08-26
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
package/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy 5.5.4-beta.1 (esm) - 2025-08-26
4
+ * @module iframe-resizer/legacy 5.5.4-beta.2 (esm) - 2025-08-26
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (child) 5.5.4-beta.1 (iife)
4
+ * @module iframe-resizer/legacy (child) 5.5.4-beta.2 (iife)
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -17,5 +17,5 @@
17
17
  */
18
18
 
19
19
 
20
- !function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0},c=Object.assign(console);const{fromEntries:l,keys:d}=Object,u=e=>[e,c[e]],f=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(d(e).map(t));const p=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,h=p?"color: #A9C7FB;":"color: #135CD2;",g=p?"color: #E3E3E3;":"color: #1F1F1F;",y="5.5.4-beta.1",b="iframeResizer",v=10,z="data-iframe-size",w="data-iframe-overflowed",$="data-iframe-ignore",S="bottom",O="right",M="autoResizeEnabled",E=Symbol("sizeChanged"),k="manualResize",T="parentResize",I={[k]:1,[T]:1},j="setOffsetSize",x="resizeObserver",A="overflowObserver",C="mutationObserver",P="visibilityObserver",N="No change in content size detected",R="init",q=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),B=(e,t,n,o)=>e.addEventListener(t,n,o||!1),L=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},F=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),D=["spjluzl","rlf","clyzpvu"],W=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],V=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],H=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),U=e=>F(W[e]);var Z=e=>{const t=e[F(D[0])]||e[F(D[1])]||e[F(D[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=L(F(e));return n in H&&(t=H[n]),t}(n[0]);return 0===o||(e=>e[2]===L(e[0]+e[1]))(n)||(o=-2),o};const J=(e,...t)=>setTimeout(()=>e(...t),0),_=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},Q=e=>e,G=e=>Math.round(1e3*e)/1e3,Y=e=>e.charAt(0).toUpperCase()+e.slice(1),X=e=>""!=`${e}`&&void 0!==e;const K=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${Y(t)}`)};let ee=!0,te=b;const ne=(oe=function(n={}){const l={},d={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function b(){delete h.event,y()}const v=()=>!!p.some(([e])=>e in i)||!!h.expand;function z(){if(0!==p.length){c[v()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?g:""}`,e,t,o);for(const[e,...t]of p)c.assert(e in c,`Unknown console method: ${e}`),e in c&&c[e](...t);c.groupEnd(),b()}else b()}function w(){""===g&&(g=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function $(e,...t){0===p.length&&(w(),queueMicrotask(()=>queueMicrotask(z))),p.push([e,...t])}function S(e=r,...t){l[e]?$("log",`${e}: ${performance.now()-l[e]} ms`,...t):$("timeLog",e,...t)}return{...m(h,f(h)),...m(console,e=>[e,(...t)=>$(e,...t)]),...m(s,u),assert:function(e,...t){!0!==e&&$("assert",e,...t)},count:function(e=r){d[e]?d[e]+=1:d[e]=1,$("log",`${e}: ${d[e]}`)},countReset:function(e=r){delete d[e]},endAutoGroup:z,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;$("error",e),z()}return n},event:function(e){w(),h.event=e},purge:y,time:function(e=r){w(),l[e]=performance.now()},timeEnd:function(e=r){S(e),delete l[e]},timeLog:S,touch:w}},oe?.__esModule?oe.default:oe);var oe;const re=ne({label:`${b}(child)`});const ie=e=>(...t)=>!ee||re[e](...t),ae=ie("log"),se=ae,ce=ie("debug");const{assert:le,endAutoGroup:de,error:ue,errorBoundary:fe,event:me,label:pe,purge:he,warn:ge}=re,ye=e=>{return re.warn((t=Q,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},be=ye,ve=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>ye(t)),ze=ve("Method"),we=ve("Method","replaced with"),$e=ve("Option"),Se=["min-height","min-width","max-height","max-width"],Oe=new Set,Me=e=>e.tagName?e.tagName.toLowerCase():"unknown",Ee=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),ke=(e,t)=>{return(n=Ee(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function Te({href:e}){Oe.has(e)||(ae("Unable to access stylesheet:",e),Oe.add(e))}const Ie=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){Te(n)}return{source:"cross-origin stylesheet",value:Ee(e,t)}}(e,t),je=(e,t)=>{const{source:n,value:o}=Ie(e,t),r=Me(e);ye(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function xe(){for(const e of[document.documentElement,document.body])for(const t of Se)ae(`Checking <${Me(e)}> for blocking CSS: ${t}`),ke(e,t)&&je(e,t)}const Ae=e=>t=>void 0===t?void 0:e(t),Ce=Ae(e=>"true"===e),Pe=Ae(Number),Ne=(e="")=>t=>n=>{n.size>0&&ce(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))},Re=Ne("attached to"),qe=((e="")=>t=>n=>{n.size>0&&ue(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Be=Ne("detached from"),Le=(t,n=!0)=>o=>{o>0&&se(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},Fe=(e,t,n,o)=>{const r=Be(e);return e=>{const i=new Set;let a=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),i.add(o),a+=1);r(i),o(a),i.clear()}},De="Mutation",We=new Set,Ve=new Set,He=new Set,Ue=[],Ze={attributes:!0,attributeFilter:[$,z],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Je,_e=1,Qe=!1,Ge=0;const Ye=Ne("added")(De),Xe=Ne("removed (page)")(De),Ke=Ne("removed (added)")(De),et=e=>e.nodeType!==Node.ELEMENT_NODE||q.has(e.tagName.toLowerCase());function tt(e){const t=e.addedNodes;for(const e of t)et(e)||We.add(e)}function nt(e){const t=e.removedNodes;for(const e of t)et(e)||(We.has(e)?(We.delete(e),He.add(e)):Ve.add(e))}const ot=e=>{se("Mutations:",e);for(const t of e)tt(t),nt(t);Ye(We),Xe(Ve),Ke(He),He.clear()};const rt=e=>()=>{const t=performance.now(),n=t-Ge,o=16*_e+++2;if(n>o&&n<200)return me("mutationThrottled"),se("Update delayed due to heavy workload on the callStack"),se(`EventLoop busy time: %c${G(n)}ms %c> Max wait: %c${o-2}ms`,h,g,h),setTimeout(Je,16*_e),void(Ge=t);_e=1,Ue.forEach(ot),Ue.length=0,Qe=!1,Ve.size>0&&ae(`Detected %c${Ve.size} %cremoved element${Ve.size>1?"s":""}`,h,g),We.size>0&&ae(`Found %c${We.size} %cnew element${We.size>1?"s":""}`,h,g),e({addedNodes:We,removedNodes:Ve}),We.clear(),Ve.clear()};function it(e){Ue.push(e),Qe||(Ge=performance.now(),Qe=!0,requestAnimationFrame(Je))}function at(e){const t=new window.MutationObserver(it),n=document.body||document.documentElement;return Je=rt(e),t.observe(n,Ze),se("Attached MutationObserver to body"),{...t,disconnect:()=>{We.clear(),Ve.clear(),Ue.length=0,t.disconnect(),se("Detached MutationObserver")}}}const st="Overflow",ct=Le(st),lt=Le(st,!1),dt=Re(st),ut=qe(st),ft=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,mt=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||Q,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(w,t);const c=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t;if(!o)continue;const i=e[n],c=a(i,o)&&!ft(r);s(r,c)}r(i)},o),l=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(l.has(r)?t.add(r):(c.observe(r),l.add(r),n.add(r),o+=1));ut(t),dt(n),ct(o),n.clear(),t.clear()},detachObservers:Fe(st,c,l,lt),disconnect:()=>{c.disconnect(),se("Detached OverflowObserver")}}},pt="--ifr-start",ht="--ifr-end",gt="--ifr-measure",yt=[];let bt,vt={},zt=0;function wt(){try{performance.clearMarks(pt),performance.clearMarks(ht),performance.clearMeasures(gt)}catch{}}function $t(e){e.getEntries().forEach(e=>{if(e.name===ht)try{const{duration:t}=performance.measure(gt,pt,ht);vt=e.detail,yt.push(t),yt.length>100&&yt.shift()}catch{}})}function St(){se("Attached PerformanceObserver to page");const e=new PerformanceObserver($t);return e.observe({entryTypes:["mark"]}),bt=setInterval(()=>{if(yt.length<10)return;if(vt.hasTags&&vt.len<25)return;yt.sort();const e=Math.min(yt.reduce((e,t)=>e+t,0)/yt.length,yt[Math.floor(yt.length/2)]),t=G(e);t>zt&&(zt=t,me("performanceObserver"),ae("Mean time:",G(yt[Math.floor(yt.length/2)])),ae("Median time:",G(yt.reduce((e,t)=>e+t,0)/yt.length)),ae("Average time:",t),ae("Max time:",G(Math.max(...yt)))),wt(),e<=4||(clearInterval(bt),ye(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${G(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${vt.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{wt(),clearInterval(bt),e.disconnect(),se("Detached PerformanceObserver")}}}const Ot="Resize",Mt=Le(Ot),Et=Le(Ot,!1),kt=Re(Ot),Tt=qe(Ot),It=new WeakSet,jt=new Set,xt=new Set;let At;function Ct(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(It.has(n)?jt.add(n):(At.observe(n),It.add(n),xt.add(n),t+=1))}Tt(jt),kt(xt),Mt(t),xt.clear(),jt.clear()}function Pt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),se("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),se("Detached VisibilityObserver")}}}const Nt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Rt=Nt("function"),qt=Nt("number"),Bt=Nt("string");"undefined"!=typeof window&&function(){const o={height:()=>(ge("Custom height calculation function not defined"),vn.auto()),width:()=>(ge("Custom width calculation function not defined"),zn.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},i={},a="auto",s="[iFrameSizer]",c=[],l="scroll";let d,u,f,m,p,L,W,H,ne,oe=!0,ie="",he=0,ve="",Se="",Oe=!1,Me=!0,Ee=!1,ke=!0,Te=!1,Ie=!1,je=!0,Ae=!1,Ne=1,Re=a,qe="",Be=!0,Le={},De=!1,We=!1,Ve=!1,He=0,Ue=!1,Ze=0,Je=0,_e=new Set,Qe="",Ge="child",Ye=!1,Xe="",Ke=[],et=window.parent,tt="*",nt=0,ot=!1,rt=1,it=l,st=window,ct=()=>{ge("onMessage function not defined")},lt=()=>{},dt=null,ut=null;function ft(e){var t;!function(e){Qe=e[0]??Qe,he=Pe(e[1])??he,Ee=Ce(e[2])??Ee,Ve=Ce(e[3])??Ve,oe=Ce(e[6])??oe,ve=e[7]??ve,Re=e[8]??Re,ie=e[9]??ie,Se=e[10]??Se,nt=Pe(e[11])??nt,Le.enable=Ce(e[12])??!1,Ge=e[13]??Ge,it=e[14]??it,Ue=Ce(e[15])??Ue,Ze=Pe(e[16])??Ze,Je=Pe(e[17])??Je,Me=Ce(e[18])??Me,d=e[19]??d,H=e[20]??H,He=Pe(e[21])??He,We=Ce(e[23])??We}(e),te=(t={id:Qe,enabled:Ve,expand:We}).id||b,re.label(`${te}`),re.expand(t.expand),ee=t.enabled,ae(`Initialising iframe v${y} ${window.location.href}`),function(){function e(e){ae("Reading data from page:",Object.keys(e)),ne=Rt(e,"onBeforeResize")??ne,ct=Rt(e,"onMessage")??ct,lt=Rt(e,"onReady")??lt,"number"==typeof e?.offset&&($e("offset","offsetSize"),Me&&(Ze=qt(e,"offset")??Ze),Ee&&(Je=qt(e,"offset")??Je)),"number"==typeof e?.offsetSize&&(Me&&(Ze=qt(e,"offsetSize")??Ze),Ee&&(Je=qt(e,"offsetSize")??Je)),u=Bt(e,F(D[0]))??u,qe=Bt(e,"ignoreSelector")??qe,Xe=Bt(e,"sizeSelector")??Xe,tt=Bt(e,"targetOrigin")??tt,Re=e?.heightCalculationMethod||Re,it=e?.widthCalculationMethod||it}function t(e,t){return"function"==typeof e&&(ye(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),o[t]=e,e="custom"),e}if(1===He)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),Re=t(Re,"height"),it=t(it,"width"),se(`Set targetOrigin for parent: %c${tt}`,h))}(),[$t,kt,Zt,zt,Mt,Ht,Ut,Wt,wt,bt,Oe?Q:xe,xt,Yt,Gt,Qt,Nt,()=>Tt("background",ie),()=>Tt("padding",Se),Oe?Q:Lt,_t,Jt,dn,gt].forEach(e=>{try{e()}catch(e){if(He<0)throw e;ye("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),ue(e)}}),yt(_(lt)),ae("Initialization complete"),kn(R,"Init message from host page",void 0,void 0,`${y}:${He}`),document.title&&""!==document.title&&jn(0,0,"title",document.title)}function gt(){B(window,"beforeunload",()=>{c.forEach(e=>e()),jn(0,0,"beforeUnload")})}function yt(e){"complete"===document.readyState?J(e):B(document,"readystatechange",()=>yt(e))}function bt(){Ke=document.querySelectorAll(`[${z}]`),Ae=Ke.length>0,ae(`Tagged elements found: %c${Ae}`,h)}let vt=0;function zt(){const n=document.querySelectorAll(`*[${$}]`);return Te=n.length>0,Te&&n.length!==vt&&(function(n){const o=1===n.length?"":"s";ge(`%c[${$}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),vt=n.length),Te}function wt(){"BackCompat"===document.compatMode&&ye("<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n")}function $t(){H&&""!==H&&"false"!==H?H!==y&&ye(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${H} - Child page: ${y}.\n`):ye("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n")}function Mt(){try{Ye=1===He||"iframeParentListener"in window.parent}catch(e){ae("Cross domain iframe detected")}}function kt(){Ee===Me&&(Oe=!0)}function Tt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),se(`Set body ${e}: %c${t}`,h))}function jt(e,t,n){if(""!==n){ae(`${e}: %c${n}`,h);for(const e of document.querySelectorAll(n))ae(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function xt(){jt("sizeSelector",z,Xe),jt("ignoreSelector",$,qe)}function Nt(){var e,t;void 0===ve&&(ve=`${he}px`),Tt("margin",(e="margin",(t=ve).includes("-")&&(ge(`Negative CSS value ignored for ${e}`),t=""),t))}function Lt(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),ae("Set HTML & body height: %cauto !important",h)}function Ft(e){({add(t){function n(){kn(e.eventName,e.eventType)}i[t]=n,B(window,t,n,{passive:!0})},remove(e){const t=i[e];var n,o;delete i[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),ae(`${Y(e.method)} event listener: %c${e.eventType}`,h)}function Dt(e){Ft({method:e,eventType:"After Print",eventName:"afterprint"}),Ft({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ft({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function Wt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(z,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&ye("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}function Vt(e,t,n){const{label:o}=n;return t!==e&&(e in n||(ge(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&ye(`<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 ${H?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${o}CalculationMethod: 'auto',\n}\n`}\n`),ae(`Set ${o} calculation method: %c${e}`,h),e}function Ht(){Re=Vt(Re,a,vn)}function Ut(){it=Vt(it,l,zn)}function Zt(){const t=He,n=Z({key:d}),o=Z({key:u});if(He=Math.max(n,o),He<0){if(He=Math.min(n,o),ye(`${U(He+2)}${U(2)}`),X(H))throw U(He+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!X(H)||t>-1&&He>t)&&(sessionStorage.getItem("ifr")!==y&&function(t,n){console.info(`${te} %ciframe-resizer ${t}`,ee||n<1?"font-weight: bold;":e)}(`v${y} (${(e=>F(V[e]))(He)})`,He),He<2&&be(U(3)),sessionStorage.setItem("ifr",y))}function Jt(){!0!==oe&&ae("Auto Resize disabled"),Dt("add"),c.push(()=>Dt("remove"))}function _t(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Qt(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,v)+parseInt(n.x,v),y:parseInt(t.top,v)+parseInt(n.y,v)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?(ae(`In page link (#${n}) not found in iFrame, so sending to parent`),jn(0,0,"inPageLink",`#${n}`)):function(t){const o=e(t);ae(`Moving to in page link (%c#${n}%c) at x: %c${o.x}%c y: %c${o.y}`,h,g,h,g,h),jn(o.y,o.x,"scrollToOffset")}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}Le.enable?1===He?ye("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):(ae("Setting up location.hash handlers"),function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&B(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),B(window,"hashchange",n),setTimeout(n,128)):ae("In page linking not enabled"),Le={findTarget:t}}function Gt(){function e(e){jn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){ae(`Add event listener: %c${n}`,h),B(window.document,t,e)}!0===Ue&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}function Yt(){1!==He&&(st.parentIframe=Object.freeze({autoResize:e=>(K(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Ee&&!1===Me?(me(M),ye("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===oe?(oe=!0,queueMicrotask(()=>kn(M,"Auto Resize enabled"))):!1===e&&!0===oe&&(oe=!1),jn(0,0,"autoResize",JSON.stringify(oe)),oe)),close(){jn(0,0,"close")},getId:()=>Qe,getOrigin:()=>(ze("getOrigin()","getParentOrigin()"),f),getParentOrigin:()=>f,getPageInfo(e){if("function"==typeof e)return dt=e,jn(0,0,"pageInfo"),void we("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");dt=null,jn(0,0,"pageInfoStop")},getParentProps:e=>(K(e,"function","parentIframe.getParentProps(callback) callback"),ut=e,jn(0,0,"parentInfo"),()=>{ut=null,jn(0,0,"parentInfoStop")}),getParentProperties(e){ze("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){K(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Le.findTarget(e)},reset(){!function(){const e=Re;Re=a,ae(`Reset trigger event: %c${"parentIframe.reset"}`,h),ot?ae("TriggerLock blocked calculation"):(ot=!0,ce("Trigger event lock on"),requestAnimationFrame(()=>{ot=!1,ce("Trigger event lock off")})),Tn("reset"),Re=e}()},setOffsetSize(e){K(e,"number","parentIframe.setOffsetSize(offset) offset"),Ze=e,Je=e,kn(j,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){K(e,"number","parentIframe.scrollBy(x, y) x"),K(t,"number","parentIframe.scrollBy(x, y) y"),jn(t,e,"scrollBy")},scrollTo(e,t){K(e,"number","parentIframe.scrollTo(x, y) x"),K(t,"number","parentIframe.scrollTo(x, y) y"),jn(t,e,"scrollTo")},scrollToOffset(e,t){K(e,"number","parentIframe.scrollToOffset(x, y) x"),K(t,"number","parentIframe.scrollToOffset(x, y) y"),jn(t,e,"scrollToOffset")},sendMessage(e,t){t&&K(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),jn(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Re=e,Ht()},setWidthCalculationMethod(e){it=e,Ut()},setTargetOrigin(e){K(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),ae(`Set targetOrigin: %c${e}`,h),tt=e},resize(e,t){void 0!==e&&K(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&K(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),kn(k,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ze("size()","resize()"),this.resize(e,t)}}),st.parentIFrame=st.parentIframe)}let Xt=new Set;function Kt(){const e=document.querySelectorAll(`[${w}]`);_e=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${$}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{me("overflowIgnored"),se("Ignoring elements with [data-iframe-ignore] > *:\n",n),de()}),t}(e),Ie=_e.size>0,"function"==typeof Set.prototype.symmetricDifference&&(je=_e.symmetricDifference(Xt).size>0),Xt=_e}function en(){switch(Kt(),!0){case!je:return;case _e.size>1:se("Overflowed Elements:",_e);break;case Ie:break;default:se("No overflow detected")}kn(A,"Overflow updated")}function tn(e){const t={root:document.documentElement,side:Me?S:O};return m=mt(en,t),m.attachObservers(e),m}function nn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;kn(x,`Element resized <${function(e){switch(!0){case!X(e):return"";case X(e.id):return`${e.nodeName}#${e.id}`;case X(e.name):return`${e.nodeName} (${e.name}`;case X(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function on(e){return At=new ResizeObserver(nn),At.observe(document.body),It.add(document.body),se("Attached ResizeObserver to body"),p={attachObserverToNonStaticElements:Ct,detachObservers:Fe(Ot,At,It,Et),disconnect:()=>{At.disconnect(),se("Detached ResizeObserver")}},p.attachObserverToNonStaticElements(e),p}function rn(e){ae(`Visible: %c${e}`,h),De=!e,kn(P,"Visibility changed")}const an=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of pn(n))t.add(e)}return se("Inspecting:\n",t),t},sn=e=>{if(0===e.size)return;me("addObservers");const t=an(e);m.attachObservers(t),p.attachObserverToNonStaticElements(t),de()},cn=e=>{if(0===e.size)return;me("removeObservers");const t=an(e);m.detachObservers(t),p.detachObservers(t),de()};function ln(e){!function({addedNodes:e,removedNodes:t}){me("contentMutated"),xt(),bt(),Kt(),de(),cn(t),sn(e)}(e),kn(C,"Mutation Observed")}function dn(){const e=pn(document.documentElement);var t;ae("Attaching Observers"),t=[at(ln),tn(e),St(),on(e),Pt(rn)],c.push(...t.map(e=>e.disconnect))}function un(e){performance.mark(pt);const t=Y(e);let n=1,o=document.documentElement,r=Ae?0:document.documentElement.getBoundingClientRect().bottom;const i=Ae?Ke:Ie?Array.from(_e):pn(document.documentElement);for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return se(`${t} position calculated from:`,o),se(`Checked %c${i.length}%c elements`,h,g),performance.mark(ht,{detail:{hasTags:Ae,len:i.length,logging:Ve,Side:t}}),r}const fn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],mn=`* ${Array.from(q).map(e=>`:not(${e})`).join("")}`,pn=e=>e.querySelectorAll(mn),hn={height:0,width:0},gn={height:0,width:0},yn=[h,g,h];function bn(e){function t(){return gn[o]=r,hn[o]=s,Math.max(r,1)}const n=e===vn,o=e.label,r=e.boundingClientRect(),i=Math.ceil(r),a=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: %c${r}px %cPage: %c${s}px`;let l=0;switch(!0){case!e.enabled():return Math.max(s,1);case Ae:se("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!Ie&&ke&&0===gn[o]&&0===hn[o]:se(`Initial page size values: ${c}`,...yn),l=t();break;case ot&&r===gn[o]&&s===hn[o]:se(`Size unchanged: ${c}`,...yn),l=Math.max(r,s);break;case 0===r&&0!==s:se(`Page is hidden: ${c}`,...yn),l=s;break;case!Ie&&r!==gn[o]&&s<=hn[o]:se(`New <html> size: ${c} `,...yn),se(`Previous <html> size: %c${gn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!Ie&&r<gn[o]:se(`<html> size decreased: ${c}`,...yn),l=t();break;case s===a||s===i:se(`<html> size equals page size: ${c}`,...yn),l=t();break;case r>s:se(`Page size < <html> size: ${c}`,...yn),l=t();break;case Ie:se("Found elements possibly overflowing <html> "),l=e.taggedElement();break;default:se(`Using <html> size: ${c}`,...yn),l=t()}return se(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&se(`Page offsetSize: %c${t}px`,h),t}(e),l}const vn={label:"height",enabled:()=>Me,getOffset:()=>Ze,auto:()=>bn(vn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,v)+parseInt(t.marginBottom,v)},bodyScroll:()=>document.body.scrollHeight,offset:()=>vn.bodyOffset(),custom:()=>o.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...fn(vn)),min:()=>Math.min(...fn(vn)),grow:()=>vn.max(),lowestElement:()=>un(S),taggedElement:()=>un(S)},zn={label:"width",enabled:()=>Ee,getOffset:()=>Je,auto:()=>bn(zn),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>o.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...fn(zn)),min:()=>Math.min(...fn(zn)),rightMostElement:()=>un(O),scroll:()=>Math.max(zn.bodyScroll(),zn.documentElementScroll()),taggedElement:()=>un(O)},wn=(e,t)=>!(Math.abs(e-t)<=nt);function $n(e,t){const n=e[t](),o=e.enabled()&&void 0!==ne?function(e){const t=ne(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);if(t<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${t}, must be at least 1`);return t}(n):n;return le(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let Sn=!1;const On=_(()=>be(U(4)));let Mn,En=!1;const kn=fe((e,t,n,o,r)=>{switch(me(e),!0){case!0===De:if(!0===En)break;ae("Iframe hidden - Ignored resize request"),En=!0,Sn=!1,cancelAnimationFrame(Mn);break;case!0===Sn:break;case!oe&&!(e in I):se("Resizing disabled");break;default:En=!1,Sn=!0,W=performance.now(),L=!0,Mn=requestAnimationFrame(()=>{Sn=!1,me("requestAnimationFrame"),ce(`Reset sendPending: %c${e}`,h)}),function(e,t,n,o,r){const i=n??$n(vn,Re),a=o??$n(zn,it),s=Me&&wn(Ne,i)||Ee&&wn(rt,a)?E:e;switch(ae(`Resize event: %c${t}`,h),s){case R:case M:case E:Ne=i,rt=a;case j:In(Ne,rt,e,r);break;case A:case C:case x:case P:ae(N);break;default:se(N)}L=!1}(e,t,n,o,r)}de()});function Tn(e){Ne=vn[Re](),rt=zn[it](),jn(Ne,rt,e)}function In(e,t,o,r,i){He<-1||(void 0!==i?ae(`Message targetOrigin: %c${i}`,h):i=tt,function(){const a=`${Qe}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(Ye)try{window.parent.iframeParentListener(s+a)}catch(e){if(1!==He)throw e;return void On()}else et.postMessage(s+a,i);L&&ae(function(){const e=G(performance.now()-W);return o===R?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),h),se(`Sending message to parent page via ${Ye?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}())}const jn=fe((e,t,n,o,r)=>{me(n),In(e,t,n,o,r),de()}),xn=fe(function(e){me("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>t(n(e)),r=e=>jn(0,0,`${e}Stop`),i={init:function(){if("loading"===document.readyState)return void ae("Page not ready, ignoring init message");const t=e.data.slice(13).split(":");et=e.source,f=e.origin,ft(t),ke=!1,setTimeout(()=>{Be=!1},128)},reset(){Be?ae("Page reset ignored by init"):(ae("Page size reset by host page"),Tn("resetPage"))},resize(){ae("Resize requested by host page"),kn(T,"Parent window requested size check")},moveToAnchor(){Le.findTarget(c())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=c();ae("PageInfo received from parent:",o(e)),dt?J(dt,n(e)):r("pageInfo")},parentInfo(){const e=o(c());ae("ParentInfo received from parent:",e),ut?J(ut,e):r("parentInfo")},message(){const e=c();ae("onMessage called from parent:%c",h,o(e)),J(ct,n(e))}},a=()=>e.data.split("]")[1].split(":")[0],c=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function d(){const t=a();me(t),t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||ge(`Unexpected message (${e.data})`)}s===`${e.data}`.slice(0,13)&&function(){if(!1!==ke)return l()?(pe(a()),me(R),void i.init()):void ae(`Ignored message of type "${a()}". Received before initialization.`);d()}()});function An(){"loading"===document.readyState||ke||(ae("[iFrameResizerChild]Ready"),window.parent.postMessage("[iFrameResizerChild]Ready","*"))}"iframeChildListener"in window?ge("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>xn({data:e,sameOrigin:!0})),B(window,"message",xn),B(document,"readystatechange",An),setTimeout(An))}()}();
20
+ !function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0},c=Object.assign(console);const{fromEntries:l,keys:d}=Object,u=e=>[e,c[e]],f=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(d(e).map(t));const p=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,h=p?"color: #A9C7FB;":"color: #135CD2;",g=p?"color: #E3E3E3;":"color: #1F1F1F;",y="5.5.4-beta.2",b="iframeResizer",v=10,z="data-iframe-size",w="data-iframe-overflowed",$="data-iframe-ignore",S="bottom",O="right",M="autoResizeEnabled",E=Symbol("sizeChanged"),k="manualResize",T="parentResize",I={[k]:1,[T]:1},j="setOffsetSize",x="resizeObserver",A="overflowObserver",C="mutationObserver",P="visibilityObserver",N="No change in content size detected",R="init",q=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),B=(e,t,n,o)=>e.addEventListener(t,n,o||!1),L=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},F=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),D=["spjluzl","rlf","clyzpvu"],W=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],V=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],H=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),U=e=>F(W[e]);var Z=e=>{const t=e[F(D[0])]||e[F(D[1])]||e[F(D[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=L(F(e));return n in H&&(t=H[n]),t}(n[0]);return 0===o||(e=>e[2]===L(e[0]+e[1]))(n)||(o=-2),o};const J=(e,...t)=>setTimeout(()=>e(...t),0),_=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},Q=e=>e,G=e=>Math.round(1e3*e)/1e3,Y=e=>e.charAt(0).toUpperCase()+e.slice(1),X=e=>""!=`${e}`&&void 0!==e;const K=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${Y(t)}`)};let ee=!0,te=b;const ne=(oe=function(n={}){const l={},d={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function b(){delete h.event,y()}const v=()=>!!p.some(([e])=>e in i)||!!h.expand;function z(){if(0!==p.length){c[v()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?g:""}`,e,t,o);for(const[e,...t]of p)c.assert(e in c,`Unknown console method: ${e}`),e in c&&c[e](...t);c.groupEnd(),b()}else b()}function w(){""===g&&(g=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function $(e,...t){0===p.length&&(w(),queueMicrotask(()=>queueMicrotask(z))),p.push([e,...t])}function S(e=r,...t){l[e]?$("log",`${e}: ${performance.now()-l[e]} ms`,...t):$("timeLog",e,...t)}return{...m(h,f(h)),...m(console,e=>[e,(...t)=>$(e,...t)]),...m(s,u),assert:function(e,...t){!0!==e&&$("assert",e,...t)},count:function(e=r){d[e]?d[e]+=1:d[e]=1,$("log",`${e}: ${d[e]}`)},countReset:function(e=r){delete d[e]},endAutoGroup:z,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;$("error",e),z()}return n},event:function(e){w(),h.event=e},purge:y,time:function(e=r){w(),l[e]=performance.now()},timeEnd:function(e=r){S(e),delete l[e]},timeLog:S,touch:w}},oe?.__esModule?oe.default:oe);var oe;const re=ne({label:`${b}(child)`});const ie=e=>(...t)=>!ee||re[e](...t),ae=ie("log"),se=ae,ce=ie("debug");const{assert:le,endAutoGroup:de,error:ue,errorBoundary:fe,event:me,label:pe,purge:he,warn:ge}=re,ye=e=>{return re.warn((t=Q,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},be=ye,ve=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>ye(t)),ze=ve("Method"),we=ve("Method","replaced with"),$e=ve("Option"),Se=["min-height","min-width","max-height","max-width"],Oe=new Set,Me=e=>e.tagName?e.tagName.toLowerCase():"unknown",Ee=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),ke=(e,t)=>{return(n=Ee(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function Te({href:e}){Oe.has(e)||(ae("Unable to access stylesheet:",e),Oe.add(e))}const Ie=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){Te(n)}return{source:"cross-origin stylesheet",value:Ee(e,t)}}(e,t),je=(e,t)=>{const{source:n,value:o}=Ie(e,t),r=Me(e);ye(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function xe(){for(const e of[document.documentElement,document.body])for(const t of Se)ae(`Checking <${Me(e)}> for blocking CSS: ${t}`),ke(e,t)&&je(e,t)}const Ae=e=>t=>void 0===t?void 0:e(t),Ce=Ae(e=>"true"===e),Pe=Ae(Number),Ne=(e="")=>t=>n=>{n.size>0&&ce(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))},Re=Ne("attached to"),qe=((e="")=>t=>n=>{n.size>0&&ue(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Be=Ne("detached from"),Le=(t,n=!0)=>o=>{o>0&&se(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},Fe=(e,t,n,o)=>{const r=Be(e);return e=>{const i=new Set;let a=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),i.add(o),a+=1);r(i),o(a),i.clear()}},De="Mutation",We=new Set,Ve=new Set,He=new Set,Ue=[],Ze={attributes:!0,attributeFilter:[$,z],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Je,_e=1,Qe=!1,Ge=0;const Ye=Ne("added")(De),Xe=Ne("removed (page)")(De),Ke=Ne("removed (added)")(De),et=e=>e.nodeType!==Node.ELEMENT_NODE||q.has(e.tagName.toLowerCase());function tt(e){const t=e.addedNodes;for(const e of t)et(e)||We.add(e)}function nt(e){const t=e.removedNodes;for(const e of t)et(e)||(We.has(e)?(We.delete(e),He.add(e)):Ve.add(e))}const ot=e=>{se("Mutations:",e);for(const t of e)tt(t),nt(t);Ye(We),Xe(Ve),Ke(He),He.clear()};const rt=e=>()=>{const t=performance.now(),n=t-Ge,o=16*_e+++2;if(n>o&&n<200)return me("mutationThrottled"),se("Update delayed due to heavy workload on the callStack"),se(`EventLoop busy time: %c${G(n)}ms %c> Max wait: %c${o-2}ms`,h,g,h),setTimeout(Je,16*_e),void(Ge=t);_e=1,Ue.forEach(ot),Ue.length=0,Qe=!1,Ve.size>0&&ae(`Detected %c${Ve.size} %cremoved element${Ve.size>1?"s":""}`,h,g),We.size>0&&ae(`Found %c${We.size} %cnew element${We.size>1?"s":""}`,h,g),e({addedNodes:We,removedNodes:Ve}),We.clear(),Ve.clear()};function it(e){Ue.push(e),Qe||(Ge=performance.now(),Qe=!0,requestAnimationFrame(Je))}function at(e){const t=new window.MutationObserver(it),n=document.body||document.documentElement;return Je=rt(e),t.observe(n,Ze),se("Attached MutationObserver to body"),{...t,disconnect:()=>{We.clear(),Ve.clear(),Ue.length=0,t.disconnect(),se("Detached MutationObserver")}}}const st="Overflow",ct=Le(st),lt=Le(st,!1),dt=Re(st),ut=qe(st),ft=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,mt=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||Q,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(w,t);const c=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t;if(!o)continue;const i=e[n],c=a(i,o)&&!ft(r);s(r,c)}r(i)},o),l=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(l.has(r)?t.add(r):(c.observe(r),l.add(r),n.add(r),o+=1));ut(t),dt(n),ct(o),n.clear(),t.clear()},detachObservers:Fe(st,c,l,lt),disconnect:()=>{c.disconnect(),se("Detached OverflowObserver")}}},pt="--ifr-start",ht="--ifr-end",gt="--ifr-measure",yt=[];let bt,vt={},zt=0;function wt(){try{performance.clearMarks(pt),performance.clearMarks(ht),performance.clearMeasures(gt)}catch{}}function $t(e){e.getEntries().forEach(e=>{if(e.name===ht)try{const{duration:t}=performance.measure(gt,pt,ht);vt=e.detail,yt.push(t),yt.length>100&&yt.shift()}catch{}})}function St(){se("Attached PerformanceObserver to page");const e=new PerformanceObserver($t);return e.observe({entryTypes:["mark"]}),bt=setInterval(()=>{if(yt.length<10)return;if(vt.hasTags&&vt.len<25)return;yt.sort();const e=Math.min(yt.reduce((e,t)=>e+t,0)/yt.length,yt[Math.floor(yt.length/2)]),t=G(e);t>zt&&(zt=t,me("performanceObserver"),ae("Mean time:",G(yt[Math.floor(yt.length/2)])),ae("Median time:",G(yt.reduce((e,t)=>e+t,0)/yt.length)),ae("Average time:",t),ae("Max time:",G(Math.max(...yt)))),wt(),e<=4||(clearInterval(bt),ye(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${G(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${vt.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{wt(),clearInterval(bt),e.disconnect(),se("Detached PerformanceObserver")}}}const Ot="Resize",Mt=Le(Ot),Et=Le(Ot,!1),kt=Re(Ot),Tt=qe(Ot),It=new WeakSet,jt=new Set,xt=new Set;let At;function Ct(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(It.has(n)?jt.add(n):(At.observe(n),It.add(n),xt.add(n),t+=1))}Tt(jt),kt(xt),Mt(t),xt.clear(),jt.clear()}function Pt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),se("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),se("Detached VisibilityObserver")}}}const Nt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Rt=Nt("function"),qt=Nt("number"),Bt=Nt("string");"undefined"!=typeof window&&function(){const o={height:()=>(ge("Custom height calculation function not defined"),vn.auto()),width:()=>(ge("Custom width calculation function not defined"),zn.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},i={},a="auto",s="[iFrameSizer]",c=[],l="scroll";let d,u,f,m,p,L,W,H,ne,oe=!0,ie="",he=0,ve="",Se="",Oe=!1,Me=!0,Ee=!1,ke=!0,Te=!1,Ie=!1,je=!0,Ae=!1,Ne=1,Re=a,qe="",Be=!0,Le={},De=!1,We=!1,Ve=!1,He=0,Ue=!1,Ze=0,Je=0,_e=new Set,Qe="",Ge="child",Ye=!1,Xe="",Ke=[],et=window.parent,tt="*",nt=0,ot=!1,rt=1,it=l,st=window,ct=()=>{ge("onMessage function not defined")},lt=()=>{},dt=null,ut=null;function ft(e){var t;!function(e){Qe=e[0]??Qe,he=Pe(e[1])??he,Ee=Ce(e[2])??Ee,Ve=Ce(e[3])??Ve,oe=Ce(e[6])??oe,ve=e[7]??ve,Re=e[8]??Re,ie=e[9]??ie,Se=e[10]??Se,nt=Pe(e[11])??nt,Le.enable=Ce(e[12])??!1,Ge=e[13]??Ge,it=e[14]??it,Ue=Ce(e[15])??Ue,Ze=Pe(e[16])??Ze,Je=Pe(e[17])??Je,Me=Ce(e[18])??Me,d=e[19]??d,H=e[20]??H,He=Pe(e[21])??He,We=Ce(e[23])??We}(e),te=(t={id:Qe,enabled:Ve,expand:We}).id||b,re.label(`${te}`),re.expand(t.expand),ee=t.enabled,ae(`Initialising iframe v${y} ${window.location.href}`),function(){function e(e){ae("Reading data from page:",Object.keys(e)),ne=Rt(e,"onBeforeResize")??ne,ct=Rt(e,"onMessage")??ct,lt=Rt(e,"onReady")??lt,"number"==typeof e?.offset&&($e("offset","offsetSize"),Me&&(Ze=qt(e,"offset")??Ze),Ee&&(Je=qt(e,"offset")??Je)),"number"==typeof e?.offsetSize&&(Me&&(Ze=qt(e,"offsetSize")??Ze),Ee&&(Je=qt(e,"offsetSize")??Je)),u=Bt(e,F(D[0]))??u,qe=Bt(e,"ignoreSelector")??qe,Xe=Bt(e,"sizeSelector")??Xe,tt=Bt(e,"targetOrigin")??tt,Re=e?.heightCalculationMethod||Re,it=e?.widthCalculationMethod||it}function t(e,t){return"function"==typeof e&&(ye(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),o[t]=e,e="custom"),e}if(1===He)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),Re=t(Re,"height"),it=t(it,"width"),se(`Set targetOrigin for parent: %c${tt}`,h))}(),[$t,kt,Zt,zt,Mt,Ht,Ut,Wt,wt,bt,Oe?Q:xe,xt,Yt,Gt,Qt,Nt,()=>Tt("background",ie),()=>Tt("padding",Se),Oe?Q:Lt,_t,Jt,dn,gt].forEach(e=>{try{e()}catch(e){if(He<0)throw e;ye("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),ue(e)}}),yt(_(lt)),ae("Initialization complete"),kn(R,"Init message from host page",void 0,void 0,`${y}:${He}`),document.title&&""!==document.title&&jn(0,0,"title",document.title)}function gt(){B(window,"beforeunload",()=>{c.forEach(e=>e()),jn(0,0,"beforeUnload")})}function yt(e){"complete"===document.readyState?J(e):B(document,"readystatechange",()=>yt(e))}function bt(){Ke=document.querySelectorAll(`[${z}]`),Ae=Ke.length>0,ae(`Tagged elements found: %c${Ae}`,h)}let vt=0;function zt(){const n=document.querySelectorAll(`*[${$}]`);return Te=n.length>0,Te&&n.length!==vt&&(function(n){const o=1===n.length?"":"s";ge(`%c[${$}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),vt=n.length),Te}function wt(){"BackCompat"===document.compatMode&&ye("<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n")}function $t(){H&&""!==H&&"false"!==H?H!==y&&ye(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${H} - Child page: ${y}.\n`):ye("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n")}function Mt(){try{Ye=1===He||"iframeParentListener"in window.parent}catch(e){ae("Cross domain iframe detected")}}function kt(){Ee===Me&&(Oe=!0)}function Tt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),se(`Set body ${e}: %c${t}`,h))}function jt(e,t,n){if(""!==n){ae(`${e}: %c${n}`,h);for(const e of document.querySelectorAll(n))ae(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function xt(){jt("sizeSelector",z,Xe),jt("ignoreSelector",$,qe)}function Nt(){var e,t;void 0===ve&&(ve=`${he}px`),Tt("margin",(e="margin",(t=ve).includes("-")&&(ge(`Negative CSS value ignored for ${e}`),t=""),t))}function Lt(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),ae("Set HTML & body height: %cauto !important",h)}function Ft(e){({add(t){function n(){kn(e.eventName,e.eventType)}i[t]=n,B(window,t,n,{passive:!0})},remove(e){const t=i[e];var n,o;delete i[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),ae(`${Y(e.method)} event listener: %c${e.eventType}`,h)}function Dt(e){Ft({method:e,eventType:"After Print",eventName:"afterprint"}),Ft({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ft({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function Wt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(z,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&ye("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}function Vt(e,t,n){const{label:o}=n;return t!==e&&(e in n||(ge(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&ye(`<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 ${H?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${o}CalculationMethod: 'auto',\n}\n`}\n`),ae(`Set ${o} calculation method: %c${e}`,h),e}function Ht(){Re=Vt(Re,a,vn)}function Ut(){it=Vt(it,l,zn)}function Zt(){const t=He,n=Z({key:d}),o=Z({key:u});if(He=Math.max(n,o),He<0){if(He=Math.min(n,o),ye(`${U(He+2)}${U(2)}`),X(H))throw U(He+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!X(H)||t>-1&&He>t)&&(sessionStorage.getItem("ifr")!==y&&function(t,n){console.info(`${te} %ciframe-resizer ${t}`,ee||n<1?"font-weight: bold;":e)}(`v${y} (${(e=>F(V[e]))(He)})`,He),He<2&&be(U(3)),sessionStorage.setItem("ifr",y))}function Jt(){!0!==oe&&ae("Auto Resize disabled"),Dt("add"),c.push(()=>Dt("remove"))}function _t(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Qt(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,v)+parseInt(n.x,v),y:parseInt(t.top,v)+parseInt(n.y,v)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?(ae(`In page link (#${n}) not found in iFrame, so sending to parent`),jn(0,0,"inPageLink",`#${n}`)):function(t){const o=e(t);ae(`Moving to in page link (%c#${n}%c) at x: %c${o.x}%c y: %c${o.y}`,h,g,h,g,h),jn(o.y,o.x,"scrollToOffset")}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}Le.enable?1===He?ye("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):(ae("Setting up location.hash handlers"),function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&B(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),B(window,"hashchange",n),setTimeout(n,128)):ae("In page linking not enabled"),Le={findTarget:t}}function Gt(){function e(e){jn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){ae(`Add event listener: %c${n}`,h),B(window.document,t,e)}!0===Ue&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}function Yt(){1!==He&&(st.parentIframe=Object.freeze({autoResize:e=>(K(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Ee&&!1===Me?(me(M),ye("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===oe?(oe=!0,queueMicrotask(()=>kn(M,"Auto Resize enabled"))):!1===e&&!0===oe&&(oe=!1),jn(0,0,"autoResize",JSON.stringify(oe)),oe)),close(){jn(0,0,"close")},getId:()=>Qe,getOrigin:()=>(ze("getOrigin()","getParentOrigin()"),f),getParentOrigin:()=>f,getPageInfo(e){if("function"==typeof e)return dt=e,jn(0,0,"pageInfo"),void we("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");dt=null,jn(0,0,"pageInfoStop")},getParentProps:e=>(K(e,"function","parentIframe.getParentProps(callback) callback"),ut=e,jn(0,0,"parentInfo"),()=>{ut=null,jn(0,0,"parentInfoStop")}),getParentProperties(e){ze("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){K(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Le.findTarget(e)},reset(){!function(){const e=Re;Re=a,ae(`Reset trigger event: %c${"parentIframe.reset"}`,h),ot?ae("TriggerLock blocked calculation"):(ot=!0,ce("Trigger event lock on"),requestAnimationFrame(()=>{ot=!1,ce("Trigger event lock off")})),Tn("reset"),Re=e}()},setOffsetSize(e){K(e,"number","parentIframe.setOffsetSize(offset) offset"),Ze=e,Je=e,kn(j,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){K(e,"number","parentIframe.scrollBy(x, y) x"),K(t,"number","parentIframe.scrollBy(x, y) y"),jn(t,e,"scrollBy")},scrollTo(e,t){K(e,"number","parentIframe.scrollTo(x, y) x"),K(t,"number","parentIframe.scrollTo(x, y) y"),jn(t,e,"scrollTo")},scrollToOffset(e,t){K(e,"number","parentIframe.scrollToOffset(x, y) x"),K(t,"number","parentIframe.scrollToOffset(x, y) y"),jn(t,e,"scrollToOffset")},sendMessage(e,t){t&&K(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),jn(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Re=e,Ht()},setWidthCalculationMethod(e){it=e,Ut()},setTargetOrigin(e){K(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),ae(`Set targetOrigin: %c${e}`,h),tt=e},resize(e,t){void 0!==e&&K(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&K(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),kn(k,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ze("size()","resize()"),this.resize(e,t)}}),st.parentIFrame=st.parentIframe)}let Xt=new Set;function Kt(){const e=document.querySelectorAll(`[${w}]`);_e=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${$}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{me("overflowIgnored"),se("Ignoring elements with [data-iframe-ignore] > *:\n",n),de()}),t}(e),Ie=_e.size>0,"function"==typeof Set.prototype.symmetricDifference&&(je=_e.symmetricDifference(Xt).size>0),Xt=_e}function en(){switch(Kt(),!0){case!je:return;case _e.size>1:se("Overflowed Elements:",_e);break;case Ie:break;default:se("No overflow detected")}kn(A,"Overflow updated")}function tn(e){const t={root:document.documentElement,side:Me?S:O};return m=mt(en,t),m.attachObservers(e),m}function nn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;kn(x,`Element resized <${function(e){switch(!0){case!X(e):return"";case X(e.id):return`${e.nodeName}#${e.id}`;case X(e.name):return`${e.nodeName} (${e.name}`;case X(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function on(e){return At=new ResizeObserver(nn),At.observe(document.body),It.add(document.body),se("Attached ResizeObserver to body"),p={attachObserverToNonStaticElements:Ct,detachObservers:Fe(Ot,At,It,Et),disconnect:()=>{At.disconnect(),se("Detached ResizeObserver")}},p.attachObserverToNonStaticElements(e),p}function rn(e){ae(`Visible: %c${e}`,h),De=!e,kn(P,"Visibility changed")}const an=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of pn(n))t.add(e)}return se("Inspecting:\n",t),t},sn=e=>{if(0===e.size)return;me("addObservers");const t=an(e);m.attachObservers(t),p.attachObserverToNonStaticElements(t),de()},cn=e=>{if(0===e.size)return;me("removeObservers");const t=an(e);m.detachObservers(t),p.detachObservers(t),de()};function ln(e){!function({addedNodes:e,removedNodes:t}){me("contentMutated"),xt(),bt(),Kt(),de(),cn(t),sn(e)}(e),kn(C,"Mutation Observed")}function dn(){const e=pn(document.documentElement);var t;ae("Attaching Observers"),t=[at(ln),tn(e),St(),on(e),Pt(rn)],c.push(...t.map(e=>e.disconnect))}function un(e){performance.mark(pt);const t=Y(e);let n=1,o=document.documentElement,r=Ae?0:document.documentElement.getBoundingClientRect().bottom;const i=Ae?Ke:Ie?Array.from(_e):pn(document.documentElement);for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return se(`${t} position calculated from:`,o),se(`Checked %c${i.length}%c elements`,h,g),performance.mark(ht,{detail:{hasTags:Ae,len:i.length,logging:Ve,Side:t}}),r}const fn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],mn=`* ${Array.from(q).map(e=>`:not(${e})`).join("")}`,pn=e=>e.querySelectorAll(mn),hn={height:0,width:0},gn={height:0,width:0},yn=[h,g,h];function bn(e){function t(){return gn[o]=r,hn[o]=s,Math.max(r,1)}const n=e===vn,o=e.label,r=e.boundingClientRect(),i=Math.ceil(r),a=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: %c${r}px %cPage: %c${s}px`;let l=0;switch(!0){case!e.enabled():return Math.max(s,1);case Ae:se("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!Ie&&ke&&0===gn[o]&&0===hn[o]:se(`Initial page size values: ${c}`,...yn),l=t();break;case ot&&r===gn[o]&&s===hn[o]:se(`Size unchanged: ${c}`,...yn),l=Math.max(r,s);break;case 0===r&&0!==s:se(`Page is hidden: ${c}`,...yn),l=s;break;case!Ie&&r!==gn[o]&&s<=hn[o]:se(`New <html> size: ${c} `,...yn),se(`Previous <html> size: %c${gn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!Ie&&r<gn[o]:se(`<html> size decreased: ${c}`,...yn),l=t();break;case s===a||s===i:se(`<html> size equals page size: ${c}`,...yn),l=t();break;case r>s:se(`Page size < <html> size: ${c}`,...yn),l=t();break;case Ie:se("Found elements possibly overflowing <html> "),l=e.taggedElement();break;default:se(`Using <html> size: ${c}`,...yn),l=t()}return se(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&se(`Page offsetSize: %c${t}px`,h),t}(e),l}const vn={label:"height",enabled:()=>Me,getOffset:()=>Ze,auto:()=>bn(vn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,v)+parseInt(t.marginBottom,v)},bodyScroll:()=>document.body.scrollHeight,offset:()=>vn.bodyOffset(),custom:()=>o.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...fn(vn)),min:()=>Math.min(...fn(vn)),grow:()=>vn.max(),lowestElement:()=>un(S),taggedElement:()=>un(S)},zn={label:"width",enabled:()=>Ee,getOffset:()=>Je,auto:()=>bn(zn),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>o.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...fn(zn)),min:()=>Math.min(...fn(zn)),rightMostElement:()=>un(O),scroll:()=>Math.max(zn.bodyScroll(),zn.documentElementScroll()),taggedElement:()=>un(O)},wn=(e,t)=>!(Math.abs(e-t)<=nt);function $n(e,t){const n=e[t](),o=e.enabled()&&void 0!==ne?function(e){const t=ne(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);if(t<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${t}, must be at least 1`);return t}(n):n;return le(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let Sn=!1;const On=_(()=>be(U(4)));let Mn,En=!1;const kn=fe((e,t,n,o,r)=>{switch(me(e),!0){case!0===De:if(!0===En)break;ae("Iframe hidden - Ignored resize request"),En=!0,Sn=!1,cancelAnimationFrame(Mn);break;case!0===Sn:break;case!oe&&!(e in I):se("Resizing disabled");break;default:En=!1,Sn=!0,W=performance.now(),L=!0,Mn=requestAnimationFrame(()=>{Sn=!1,me("requestAnimationFrame"),ce(`Reset sendPending: %c${e}`,h)}),function(e,t,n,o,r){const i=n??$n(vn,Re),a=o??$n(zn,it),s=Me&&wn(Ne,i)||Ee&&wn(rt,a)?E:e;switch(ae(`Resize event: %c${t}`,h),s){case R:case M:case E:Ne=i,rt=a;case j:In(Ne,rt,e,r);break;case A:case C:case x:case P:ae(N);break;default:se(N)}L=!1}(e,t,n,o,r)}de()});function Tn(e){Ne=vn[Re](),rt=zn[it](),jn(Ne,rt,e)}function In(e,t,o,r,i){He<-1||(void 0!==i?ae(`Message targetOrigin: %c${i}`,h):i=tt,function(){const a=`${Qe}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(Ye)try{window.parent.iframeParentListener(s+a)}catch(e){if(1!==He)throw e;return void On()}else et.postMessage(s+a,i);L&&ae(function(){const e=G(performance.now()-W);return o===R?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),h),se(`Sending message to parent page via ${Ye?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}())}const jn=fe((e,t,n,o,r)=>{me(n),In(e,t,n,o,r),de()}),xn=fe(function(e){me("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>t(n(e)),r=e=>jn(0,0,`${e}Stop`),i={init:function(){if("loading"===document.readyState)return void ae("Page not ready, ignoring init message");const t=e.data.slice(13).split(":");et=e.source,f=e.origin,ft(t),ke=!1,setTimeout(()=>{Be=!1},128)},reset(){Be?ae("Page reset ignored by init"):(ae("Page size reset by host page"),Tn("resetPage"))},resize(){ae("Resize requested by host page"),kn(T,"Parent window requested size check")},moveToAnchor(){Le.findTarget(c())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=c();ae("PageInfo received from parent:",o(e)),dt?J(dt,n(e)):r("pageInfo")},parentInfo(){const e=o(c());ae("ParentInfo received from parent:",e),ut?J(ut,e):r("parentInfo")},message(){const e=c();ae("onMessage called from parent:%c",h,o(e)),J(ct,n(e))}},a=()=>e.data.split("]")[1].split(":")[0],c=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function d(){const t=a();me(t),t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||ge(`Unexpected message (${e.data})`)}s===`${e.data}`.slice(0,13)&&function(){if(!1!==ke)return l()?(pe(a()),me(R),void i.init()):void ae(`Ignored message of type "${a()}". Received before initialization.`);d()}()});let An=!1;const Cn=e=>e.postMessage("[iFrameResizerChild]Ready","*");function Pn(){if("loading"===document.readyState||!ke||An)return;const{parent:e,top:t}=window;ae("[iFrameResizerChild]Ready"),Cn(e),e!==t&&Cn(t),An=!0}"iframeChildListener"in window?ge("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>xn({data:e,sameOrigin:!0})),B(window,"message",xn),B(document,"readystatechange",Pn),setTimeout(Pn))}()}();
21
21
  //# sourceMappingURL=iframeResizer.contentWindow.js.map