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