@iframe-resizer/child 5.5.0-beta.3 → 5.5.0-beta.4
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 -2
- package/index.cjs.js.map +1 -1
- package/index.esm.js +2 -2
- package/index.esm.js.map +1 -1
- package/index.umd.js +2 -2
- package/index.umd.js.map +1 -1
- package/package.json +1 -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.0-beta.
|
|
4
|
+
* @module iframe-resizer/child 5.5.0-beta.4 (cjs) - 2025-07-29
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 for non-commercial use only.
|
|
7
7
|
* For commercial use, you must purchase a license from
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
"use strict";const e=require("auto-console-group"),t="5.5.0-beta.3",n="iframeResizer",o=10,r="data-iframe-size",i="data-iframe-overflowed",a="data-iframe-ignore",s="bottom",l="right",c="autoResizeEnabled",u=Symbol("sizeChanged"),d="manualResize",f={},m="setOffsetSize",p="resizeObserver",h="overflowObserver",g="mutationObserver",y="visibilityObserver",b="none",v="No change in content size detected",z="init",w=(e,t,n,o)=>e.addEventListener(t,n,o||!1),$=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},I=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),O=["spjluzl","rlf","clyzpvu"],S=["<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."],H=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],T=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),M=e=>I(S[e]),k=e=>{const t=e[I(O[0])]||e[I(O[1])]||e[I(O[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=$(I(e));return n in T&&(t=T[n]),t}(n[0]);return 0===o||(e=>e[2]===$(e[0]+e[1]))(n)||(o=-2),o},j=(e,...t)=>setTimeout(()=>e(...t),0),E=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},A=e=>e,R=e=>Math.round(1e3*e)/1e3,G=e=>e.charAt(0).toUpperCase()+e.slice(1),L=e=>""!=`${e}`&&void 0!==e;const N=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${G(t)}`)};let x=!0,P=n;var C;const B=(C=e,C?.__esModule?C.default:C)({label:`${n}(child)`});const q=(D="log",(...e)=>!x||B[D](...e));var D;const F=q;const{assert:W,debug:U,endAutoGroup:V,error:Z,errorBoundary:J,event:Q,label:_,purge:Y,warn:X}=B,K=e=>{return B.warn((t=A,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},ee=K,te=(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)=>K(t)),ne=te("Method"),oe=te("Method","replaced with"),re=te("Option"),ie=["min-height","min-width","max-height","max-width"],ae=new Set,se=e=>e.tagName?e.tagName.toLowerCase():"unknown",le=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),ce=(e,t)=>{return(n=le(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function ue({href:e}){ae.has(e)||(q("Unable to access stylesheet:",e),ae.add(e))}const de=(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){ue(n)}return{source:"cross-origin stylesheet",value:le(e,t)}}(e,t),fe=(e,t)=>{const{source:n,value:o}=de(e,t),r=se(e);K(`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 me(){for(const e of[document.documentElement,document.body])for(const t of ie)q(`Checking <${se(e)}> for blocking CSS: ${t}`),ce(e,t)&&fe(e,t)}const pe=e=>t=>void 0===t?void 0:e(t),he=pe(e=>"true"===e),ge=pe(Number),ye=new Set,be=new Set,ve=[];let ze,we=1,$e=!1,Ie=0;const Oe=e=>{q("Mutations:",e);for(const t of e){const{addedNodes:e,removedNodes:n}=t;for(const t of e)ye.add(t);for(const e of n)ye.has(e)?ye.delete(e):be.add(e)}};function Se(e){ve.push(e),$e||(Ie=performance.now(),$e=!0,requestAnimationFrame(ze))}function He(t){const n=new window.MutationObserver(Se),o=document.querySelector("body"),i={attributes:!0,attributeFilter:[a,r],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return ze=(t=>()=>{const n=performance.now(),o=n-Ie,r=16*we+++2;if(o>r&&o<200)return F("Backed off due to heavy workload on callStack"),q(`Delay: %c${R(o)}ms %c> Delay limit: %c${r}ms`,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT),setTimeout(ze,16*we),void(Ie=n);we=1,ve.forEach(Oe),ve.length=0,t({addedMutations:ye,removedMutations:be}),$e=!1,ye.clear(),be.clear()})(t),n.observe(o,i),F("Attached MutationObserver to body"),n}const Te=(t,n=!0)=>o=>{o>0&&F(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,e.HIGHLIGHT,e.NORMAL)},Me=(e,t,n)=>e=>{let o=0;for(const r of e)n.has(r)&&(t.unobserve(r),n.delete(r),o+=1);return o},ke=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,je=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||A,a=(t=!1)=>e(t),s=(e,t)=>0===e||e>t[n],l=(e,t)=>e.toggleAttribute(i,t);const c=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t,i=e[n],a=s(i,o)&&!ke(r);l(r,a)}r(a)},o),u=new WeakSet;return{attachObservers:function(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=u.has(n);e&&(W(!o,"Node already observed for overflow",n),o||(c.observe(n),u.add(n),t+=1))}return t},detachObservers:Me(0,c,u)}},Ee="--ifr-start",Ae="--ifr-end",Re=[],Ge=new WeakSet,Le=e=>"object"==typeof e&&Ge.add(e);let Ne={},xe=0;function Pe(e){e.getEntries().forEach(e=>{if(e.name===Ae){const{duration:t}=performance.measure("--ifr-measure",Ee,Ae);Ne=e.detail,Re.push(t),Re.length>100&&Re.shift()}})}function Ce(){F("Attached PerformanceObserver to page");new PerformanceObserver(Pe).observe({entryTypes:["mark"]}),Le(document.documentElement),Le(document.body),function(){const e=setInterval(()=>{if(Re.length<10)return;if(Ne.hasTags&&Ne.len<25)return;Re.sort();const t=Math.min(Re.reduce((e,t)=>e+t,0)/Re.length,Re[Math.floor(Re.length/2)]),n=R(t);n>xe&&(xe=n,Q("performanceObserver"),q("Mean time:",R(Re[Math.floor(Re.length/2)])),q("Median time:",R(Re.reduce((e,t)=>e+t,0)/Re.length)),q("Average time:",n),q("Max time:",R(Math.max(...Re)))),t<=4||(clearInterval(e),K(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${R(t)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${Ne.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3)}()}const Be=Te("Resize"),qe=new WeakSet;let De;function Fe(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=qe.has(n);if(!e)continue;const r=getComputedStyle(n)?.position;""!==r&&"static"!==r&&(W(!o,"Node already observed for resize",n),o||(De.observe(n),qe.add(n),t+=1))}Be(t)}const We=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Ue=We("function"),Ve=We("number"),Ze=We("string");"undefined"!=typeof window&&function(){const $={height:()=>(X("Custom height calculation function not defined"),Bt.auto()),width:()=>(X("Custom width calculation function not defined"),qt.auto())},S={},T={},A="auto",C="[iFrameSizer]",D="scroll";let W,Z,Y,te,ie,ae,se,le,ce,ue,de,fe=!0,pe="",ye=0,be="",ve="",ze=!1,we=!0,$e=!1,Ie=!0,Oe=!1,Se=!1,ke=!1,Re=1,Ge=A,Le="",Ne=!0,xe={},Pe=!1,Be=!0,We=!1,Je=0,Qe=!1,_e=[],Ye="",Xe="child",Ke=!1,et="",tt=[],nt=window.parent,ot="*",rt=0,it=!1,at=1,st=D,lt=window,ct=()=>{X("onMessage function not defined")},ut=()=>{},dt=null,ft=null;function mt(i){var a,u,f;!function(e){Ye=e[0]??Ye,ye=ge(e[1])??ye,$e=he(e[2])??$e,We=he(e[3])??We,fe=he(e[6])??fe,be=e[7]??be,Ge=e[8]??Ge,pe=e[9]??pe,ve=e[10]??ve,rt=ge(e[11])??rt,xe.enable=he(e[12])??!1,Xe=e[13]??Xe,st=e[14]??st,Qe=he(e[15])??Qe,Y=ge(e[16])??Y,te=ge(e[17])??te,we=he(e[18])??we,W=e[19]??W,ue=e[20]??ue,Je=ge(e[21])??Je,Be=he(e[23])??Be}(i),P=(a={id:Ye,enabled:We,expand:Be}).id||n,B.label(`${P}`),B.expand(a.expand),x=a.enabled,q(`Initialising iframe v${t} ${window.location.href}`),function(){function t(e){q("Reading data from page:",Object.keys(e)),de=Ue(e,"onBeforeResize")??de,ct=Ue(e,"onMessage")??ct,ut=Ue(e,"onReady")??ut,"number"==typeof e?.offset&&(re("offset","offsetSize"),we&&(Y=Ve(e,"offset")??Y),$e&&(te=Ve(e,"offset")??te)),"number"==typeof e?.offsetSize&&(we&&(Y=Ve(e,"offsetSize")??Y),$e&&(te=Ve(e,"offsetSize")??te)),Z=Ze(e,I(O[0]))??Z,Le=Ze(e,"ignoreSelector")??Le,et=Ze(e,"sizeSelector")??et,ot=Ze(e,"targetOrigin")??ot,Ge=e?.heightCalculationMethod||Ge,st=e?.widthCalculationMethod||st}function n(e,t){return"function"==typeof e&&(K(`<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.`),$[t]=e,e="custom"),e}if(1===Je)return;const o=window.iframeResizer||window.iFrameResizer;"object"==typeof o&&(t(o),Ge=n(Ge,"height"),st=n(st,"width"),F(`Set targetOrigin for parent: %c${ot}`,e.HIGHLIGHT))}(),zt(),function(){try{Ke=1===Je||"iframeParentListener"in window.parent}catch(e){q("Cross domain iframe detected")}}(),$e===we&&(ze=!0),function(){const n=Je,o=k({key:W}),r=k({key:Z});if(Je=Math.max(o,r),Je<0){if(Je=Math.min(o,r),K(`${M(Je+2)}${M(2)}`),L(ue))throw M(Je+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!L(ue)||n>-1&&Je>n)&&(sessionStorage.getItem("ifr")!==t&&function(t,n){console.info(`${P} %ciframe-resizer ${t}`,x||n<1?"font-weight: bold;":e.NORMAL)}(`v${t} (${(e=>I(H[e]))(Je)})`,Je),Je<2&&ee(M(3)),sessionStorage.setItem("ifr",t))}(),ue&&""!==ue&&"false"!==ue?ue!==t&&K(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ue} - Child page: ${t}.\n`):K("<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"),It(),Ot(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(r,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&K("<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</>.")}(),"BackCompat"===document.compatMode&&K("<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"),ht(),ze||me(),1!==Je&&(lt.parentIframe=Object.freeze({autoResize:e=>(N(e,"boolean","parentIframe.autoResize(enable) enable"),!1===$e&&!1===we?(Q(c),K(`Auto Resize can not be changed when <b>direction</> is set to '${b}'.`),!1):(!0===e&&!1===fe?(fe=!0,queueMicrotask(()=>Zt(c,"Auto Resize enabled"))):!1===e&&!0===fe&&(fe=!1),Qt(0,0,"autoResize",JSON.stringify(fe)),fe)),close(){Qt(0,0,"close")},getId:()=>Ye,getOrigin:()=>(ne("getOrigin()","getParentOrigin()"),ie),getParentOrigin:()=>ie,getPageInfo(e){if("function"==typeof e)return dt=e,Qt(0,0,"pageInfo"),void oe("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");dt=null,Qt(0,0,"pageInfoStop")},getParentProps:e=>(N(e,"function","parentIframe.getParentProps(callback) callback"),ft=e,Qt(0,0,"parentInfo"),()=>{ft=null,Qt(0,0,"parentInfoStop")}),getParentProperties(e){ne("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){N(e,"string","parentIframe.moveToAnchor(anchor) anchor"),xe.findTarget(e)},reset(){!function(){const t=Ge;Ge=A,q("Reset trigger event: %cparentIframe.reset",e.HIGHLIGHT),it?q("TriggerLock blocked calculation"):(it=!0,U("Trigger event lock on"),requestAnimationFrame(()=>{it=!1,U("Trigger event lock off")})),Jt("reset"),Ge=t}()},setOffsetSize(e){N(e,"number","parentIframe.setOffsetSize(offset) offset"),Y=e,te=e,Zt(m,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){N(e,"number","parentIframe.scrollBy(x, y) x"),N(t,"number","parentIframe.scrollBy(x, y) y"),Qt(t,e,"scrollBy")},scrollTo(e,t){N(e,"number","parentIframe.scrollTo(x, y) x"),N(t,"number","parentIframe.scrollTo(x, y) y"),Qt(t,e,"scrollTo")},scrollToOffset(e,t){N(e,"number","parentIframe.scrollToOffset(x, y) x"),N(t,"number","parentIframe.scrollToOffset(x, y) y"),Qt(t,e,"scrollToOffset")},sendMessage(e,t){t&&N(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Qt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Ge=e,It()},setWidthCalculationMethod(e){st=e,Ot()},setTargetOrigin(t){N(t,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),q(`Set targetOrigin: %c${t}`,e.HIGHLIGHT),ot=t},resize(e,t){e&&N(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&N(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),Zt(d,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ne("size()","resize()"),this.resize(e,t)}}),lt.parentIFrame=lt.parentIframe),function(){function t(e){Qt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function n(n,o){q(`Add event listener: %c${o}`,e.HIGHLIGHT),w(window.document,n,t)}!0===Qe&&(n("mouseenter","Mouse Enter"),n("mouseleave","Mouse Leave"))}(),xe=function(){const t=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(e){const n=e.getBoundingClientRect(),r=t();return{x:parseInt(n.left,o)+parseInt(r.x,o),y:parseInt(n.top,o)+parseInt(r.y,o)}}function r(t){function o(t){const o=n(t);q(`Moving to in page link (%c#${r}%c) at x: %c${o.x}%c y: %c${o.y}`,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT),Qt(o.y,o.x,"scrollToOffset")}const r=t.split("#")[1]||t,i=decodeURIComponent(r),a=document.getElementById(i)||document.getElementsByName(i)[0];void 0===a?(q(`In page link (#${r}) not found in iFrame, so sending to parent`),Qt(0,0,"inPageLink",`#${r}`)):o(a)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&r(t)}function a(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&w(e,"click",t=>{t.preventDefault(),r(e.getAttribute("href"))})}function s(){w(window,"hashchange",i)}function l(){setTimeout(i,128)}function c(){q("Setting up location.hash handlers"),a(),s(),l()}return xe.enable?1===Je?K("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):c():q("In page linking not enabled"),{findTarget:r}}(),void 0===be&&(be=`${ye}px`),bt("margin",(u="margin",(f=be).includes("-")&&(X(`Negative CSS value ignored for ${u}`),f=""),f)),bt("background",pe),bt("padding",ve),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),ze||function(){const t=e=>e.style.setProperty("height","auto","important");t(document.documentElement),t(document.body),q("Set HTML & body height: %cauto !important",e.HIGHLIGHT)}(),!0!==fe&&q("Auto Resize disabled"),function(e){wt({method:e,eventType:"After Print",eventName:"afterprint"}),wt({method:e,eventType:"Before Print",eventName:"beforeprint"}),wt({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=Lt(document)();q("Attaching Observers"),He(At),function(e){const t={root:document.documentElement,side:we?s:l};ae=je(St,t),ae.attachObservers(e)}(e),Ce(),function(e){De=new ResizeObserver(Ht),De.observe(document.body),qe.add(document.body),F("Attached ResizeObserver to body"),se={attachObserverToNonStaticElements:Fe,detachObservers:Me(0,De,qe)},se.attachObserverToNonStaticElements(e)}(e),function(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;t.observe(n),F("Attached VisibilityObserver to page")}(Tt)}(),pt(E(ut)),q("Initialization complete"),Zt(z,"Init message from host page",void 0,void 0,`${t}:${Je}`),document.title&&""!==document.title&&Qt(0,0,"title",document.title)}function pt(e){"complete"===document.readyState?j(e):w(document,"readystatechange",()=>pt(e))}function ht(){tt=document.querySelectorAll(`[${r}]`),ke=tt.length>0,q(`Tagged elements found: %c${ke}`,e.HIGHLIGHT)}let gt=0;function yt(){const t=document.querySelectorAll(`*[${a}]`);Oe=t.length>0,Oe&&t.length!==gt&&(function(t){const n=1===t.length?"":"s";X(`%c[${a}]%c found on %c${t.length}%c element${n}`,e.BOLD,e.NORMAL,e.BOLD,e.NORMAL)}(t),gt=t.length)}function bt(t,n){void 0!==n&&""!==n&&"null"!==n&&(document.body.style.setProperty(t,n),F(`Set body ${t}: %c${n}`,e.HIGHLIGHT))}function vt(t,n,o){if(""!==o){q(`${t}: %c${o}`,e.HIGHLIGHT);for(const e of document.querySelectorAll(o))q(`Applying ${n} to:`,e),e.toggleAttribute(n,!0)}}function zt(){vt("sizeSelector",r,et),vt("ignoreSelector",a,Le)}function wt(t){({add(e){function n(){Zt(t.eventName,t.eventType)}T[e]=n,w(window,e,n,{passive:!0})},remove(e){const t=T[e];var n,o;delete T[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[t.method](t.eventName),q(`${G(t.method)} event listener: %c${t.eventType}`,e.HIGHLIGHT)}function $t(t,n,o,r){return n!==t&&(t in o||(X(`${t} is not a valid option for ${r}CalculationMethod.`),t=n),t in S)&&K(`<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 ${ue?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),q(`Set ${r} calculation method: %c${t}`,e.HIGHLIGHT),t}function It(){Ge=$t(Ge,A,Bt,"height")}function Ot(){st=$t(st,D,qt,"width")}function St(e){!function(){const e=document.querySelectorAll(`[${i}]`);_e=Array.from(e).filter(e=>!e.closest(`[${a}]`)),Se=_e.length>0}(),(Se||e)&&(_e.length>1?F("Overflowed Elements:",..._e):Se||F("Overflow removed"),Zt(h,"Overflow updated"))}function Ht(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Zt(p,`Element resized <${function(e){switch(!0){case!L(e):return"";case L(e.id):return`${e.nodeName}#${e.id}`;case L(e.name):return`${e.nodeName} (${e.name}`;case L(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function Tt(t){q(`Visible: %c${t}`,e.HIGHLIGHT),Pe=!t,Zt(y,"Visibility changed")}const Mt=Te("Overflow"),kt=Te("Overflow",!1),jt=Te("Resize"),Et=Te("Resize",!1);function At(e){!function({addedMutations:e,removedMutations:t}){Q("contentMutated"),zt(),ht();let n=0,o=0,r=0,i=0;for(const e of t){const t=Lt(e)();o+=ae.detachObservers(t),i+=se.detachObservers(t)}for(const t of e){const e=Lt(t)();n+=ae.attachObservers(e),r+=se.attachObserverToNonStaticElements(e)}kt(o),Et(i),Mt(n),jt(r),V()}(e),Zt(g,"Mutation Observed")}function Rt(e){performance.mark(Ee);const t=G(e);let n=0,o=document.documentElement,r=ke?0:document.documentElement.getBoundingClientRect().bottom;const i=ke?tt:Se?_e:Lt(document)();for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return F(`${t} position calculated from:`,o),performance.mark(Ae,{detail:{hasTags:ke,len:i.length,logging:We,Side:t}}),r}const Gt=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],Lt=e=>()=>{const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return yt(),Oe&&t.push(`not([${a}])`,`not([${a}] *)`),[e,...e.querySelectorAll(t.join(":"))]},Nt={height:0,width:0},xt={height:0,width:0},Pt=[e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT];function Ct(t){function n(){return xt[r]=i,Nt[r]=l,i}const o=t===Bt,r=o?"height":"width",i=t.boundingClientRect(),a=Math.ceil(i),s=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(t),c=`HTML: %c${i}px %cPage: %c${l}px`;let u=0;switch(!0){case!t.enabled():return l;case ke:F("Found element with data-iframe-size attribute"),u=t.taggedElement();break;case!Se&&0===xt[r]&&0===Nt[r]:F(`Initial page size values: ${c}`,...Pt),u=n();break;case it&&i===xt[r]&&l===Nt[r]:F(`Size unchanged: ${c}`,...Pt),u=Math.max(i,l);break;case 0===i:F(`Page is hidden: ${c}`,...Pt),u=l;break;case!Se&&i!==xt[r]&&l<=Nt[r]:F(`New <html> size: ${c} `,...Pt),F(`Previous <html> size: %c${xt[r]}px`,e.HIGHLIGHT),u=n();break;case!o:u=t.taggedElement();break;case!Se&&i<xt[r]:F(`<html> size decreased: ${c}`,...Pt),u=n();break;case l===s||l===a:F(`<html> size equals page size: ${c}`,...Pt),u=n();break;case i>l:F(`Page size < <html> size: ${c}`,...Pt),u=n();break;case Se:F("Found element overflowing <html> "),u=t.taggedElement();break;default:F(`Using <html> size: ${c}`,...Pt),u=n()}return F(`Content ${r}: %c${u}px`,e.HIGHLIGHT),u+=function(t){const n=t.getOffset();return 0!==n&&F(`Page offsetSize: %c${n}px`,e.HIGHLIGHT),n}(t),u}const Bt={enabled:()=>we,getOffset:()=>Y,auto:()=>Ct(Bt),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,o)+parseInt(t.marginBottom,o)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Bt.bodyOffset(),custom:()=>$.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...Gt(Bt)),min:()=>Math.min(...Gt(Bt)),grow:()=>Bt.max(),lowestElement:()=>Rt(s),taggedElement:()=>Rt(s)},qt={enabled:()=>$e,getOffset:()=>te,auto:()=>Ct(qt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>$.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...Gt(qt)),min:()=>Math.min(...Gt(qt)),rightMostElement:()=>Rt(l),scroll:()=>Math.max(qt.bodyScroll(),qt.documentElementScroll()),taggedElement:()=>Rt(l)},Dt=(e,t)=>!(Math.abs(e-t)<=rt);function Ft(e,t){const n=e[t]();return e.enabled()&&void 0!==de?function(e){const t=de(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`);return t}(n):n}let Wt=!1;const Ut=E(()=>ee(M(4)));let Vt=!1;const Zt=J((t,n,o,r,i)=>{if(ce=performance.now(),le=!0,Q(t),!0!==Wt){if(!fe&&!(t in f))return F("Resizing disabled"),void V();if(Pe){if(!0===Vt)return;return q("Iframe hidden - Ignored resize request"),void(Vt=!0)}Vt=!1,Wt=!0,requestAnimationFrame(()=>{Wt=!1}),function(t,n,o,r,i){const a=o??Ft(Bt,Ge),s=r??Ft(qt,st),l=we&&Dt(Re,a)||$e&&Dt(at,s)?u:t;switch(q(`Resize event: %c${n}`,e.HIGHLIGHT),l){case z:case c:case u:Re=a,at=s;case m:Qt(Re,at,t,i);break;case h:case g:case p:case y:q(v);break;default:F(v)}le=!1}(t,n,o,r,i)}});function Jt(e){Re=Bt[Ge](),at=qt[st](),Qt(Re,at,e)}const Qt=J(function(t,n,o,r,i){Je<-1||(Q(o),void 0!==i?q(`Message targetOrigin: %c${i}`,e.HIGHLIGHT):i=ot,function(){const a=`${Ye}:${t}:${n}:${o}${void 0===r?"":`:${r}`}`;if(Ke)try{window.parent.iframeParentListener(C+a)}catch(e){if(1!==Je)throw e;return void Ut()}else nt.postMessage(C+a,i);le&&q(function(){const e=R(performance.now()-ce);return o===z?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),e.HIGHLIGHT),F(`Sending message to parent page via ${Ke?"sameOrigin":"postMessage"}: %c%c${a}`,e.ITALIC,e.HIGHLIGHT)}(),V())}),_t=J(function(t){Q("onMessage");const{freeze:n}=Object,{parse:o}=JSON,r=e=>n(o(e)),i=e=>Qt(0,0,`${e}Stop`),a={init:function(){if("loading"===document.readyState)return void q("Page not ready, ignoring init message");const e=t.data.slice(13).split(":");nt=t.source,ie=t.origin,mt(e),Ie=!1,setTimeout(()=>{Ne=!1},128)},reset(){Ne?q("Page reset ignored by init"):(q("Page size reset by host page"),Jt("resetPage"))},resize(){q("Resize requested by host page"),Zt("parentResize","Parent window requested size check")},moveToAnchor(){xe.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();q("PageInfo received from parent:",r(e)),dt?j(dt,o(e)):i("pageInfo")},parentInfo(){const e=r(l());q("ParentInfo received from parent:",e),ft?j(ft,e):i("parentInfo")},message(){const t=l();q("onMessage called from parent:%c",e.HIGHLIGHT,r(t)),j(ct,o(t))}},s=()=>t.data.split("]")[1].split(":")[0],l=()=>t.data.slice(t.data.indexOf(":")+1),c=()=>t.data.split(":")[2]in{true:1,false:1};function u(){const e=s();Q(e),e in a?a[e]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||c()||X(`Unexpected message (${t.data})`)}C===`${t.data}`.slice(0,13)&&function(){if(!1!==Ie)return c()?(_(s()),Q(z),void a.init()):void q(`Ignored message of type "${s()}". Received before initialization.`);u()}()});function Yt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?X("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>_t({data:e,sameOrigin:!0})),w(window,"message",_t),w(window,"readystatechange",Yt),Yt())}();
|
|
20
|
+
"use strict";const e=require("auto-console-group"),t="5.5.0-beta.4",n="iframeResizer",o=10,r="data-iframe-size",i="data-iframe-overflowed",a="data-iframe-ignore",s="bottom",l="right",c="autoResizeEnabled",u=Symbol("sizeChanged"),d="manualResize",f={},m="setOffsetSize",p="resizeObserver",h="overflowObserver",g="mutationObserver",y="visibilityObserver",b="none",v="No change in content size detected",z="init",w=(e,t,n,o)=>e.addEventListener(t,n,o||!1),$=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},I=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),O=["spjluzl","rlf","clyzpvu"],S=["<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."],T=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],H=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),M=e=>I(S[e]),k=e=>{const t=e[I(O[0])]||e[I(O[1])]||e[I(O[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=$(I(e));return n in H&&(t=H[n]),t}(n[0]);return 0===o||(e=>e[2]===$(e[0]+e[1]))(n)||(o=-2),o},j=(e,...t)=>setTimeout(()=>e(...t),0),E=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},A=e=>e,R=e=>Math.round(1e3*e)/1e3,L=e=>e.charAt(0).toUpperCase()+e.slice(1),N=e=>""!=`${e}`&&void 0!==e;const x=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${L(t)}`)};let G=!0,P=n;var C;const q=(C=e,C?.__esModule?C.default:C)({label:`${n}(child)`});const B=(F="log",(...e)=>!G||q[F](...e));var F;const W=B;const{assert:D,debug:U,endAutoGroup:V,error:Z,errorBoundary:J,event:Q,label:_,purge:Y,warn:X}=q,K=e=>{return q.warn((t=A,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},ee=K,te=(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)=>K(t)),ne=te("Method"),oe=te("Method","replaced with"),re=te("Option"),ie=["min-height","min-width","max-height","max-width"],ae=new Set,se=e=>e.tagName?e.tagName.toLowerCase():"unknown",le=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),ce=(e,t)=>{return(n=le(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function ue({href:e}){ae.has(e)||(B("Unable to access stylesheet:",e),ae.add(e))}const de=(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){ue(n)}return{source:"cross-origin stylesheet",value:le(e,t)}}(e,t),fe=(e,t)=>{const{source:n,value:o}=de(e,t),r=se(e);K(`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 me(){for(const e of[document.documentElement,document.body])for(const t of ie)B(`Checking <${se(e)}> for blocking CSS: ${t}`),ce(e,t)&&fe(e,t)}const pe=e=>t=>void 0===t?void 0:e(t),he=pe(e=>"true"===e),ge=pe(Number),ye=new Set,be=new Set,ve=[];let ze,we=1,$e=!1,Ie=0;const Oe=e=>{B("Mutations:",e);for(const t of e){const{addedNodes:e,removedNodes:n}=t;for(const t of e)ye.add(t);for(const e of n)ye.has(e)?ye.delete(e):be.add(e)}};function Se(e){ve.push(e),$e||(Ie=performance.now(),$e=!0,requestAnimationFrame(ze))}function Te(e){const t=new window.MutationObserver(Se),n=document.querySelector("body"),o={attributes:!0,attributeFilter:[a,r],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return ze=(e=>()=>{const t=performance.now(),n=t-Ie,o=16*we+++2;if(n>o&&n<200)return Q("MutationObserver"),K(`<rb>Update Delayed</> \n<i>iframe-resizer</> has delayed updating the page due heavy workload on callStack\n \nEventLoop busy time: ${R(n)}ms > limit: ${o}ms`),setTimeout(ze,16*we),void(Ie=t);we=1,ve.forEach(Oe),ve.length=0,e({addedMutations:ye,removedMutations:be}),$e=!1,ye.clear(),be.clear()})(e),t.observe(n,o),W("Attached MutationObserver to body"),t}const He=(t,n=!0)=>o=>{o>0&&W(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,e.HIGHLIGHT,e.NORMAL)},Me=(e,t,n)=>e=>{let o=0;for(const r of e)n.has(r)&&(t.unobserve(r),n.delete(r),o+=1);return o},ke=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,je=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||A,a=(t=!1)=>e(t),s=(e,t)=>0===e||e>t[n],l=(e,t)=>e.toggleAttribute(i,t);const c=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t,i=e[n],a=s(i,o)&&!ke(r);l(r,a)}r(a)},o),u=new WeakSet;return{attachObservers:function(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=u.has(n);e&&(D(!o,"Node already observed for overflow",n),o||(c.observe(n),u.add(n),t+=1))}return t},detachObservers:Me(0,c,u)}},Ee="--ifr-start",Ae="--ifr-end",Re=[],Le=new WeakSet,Ne=e=>"object"==typeof e&&Le.add(e);let xe={},Ge=0;function Pe(e){e.getEntries().forEach(e=>{if(e.name===Ae){const{duration:t}=performance.measure("--ifr-measure",Ee,Ae);xe=e.detail,Re.push(t),Re.length>100&&Re.shift()}})}function Ce(){W("Attached PerformanceObserver to page");new PerformanceObserver(Pe).observe({entryTypes:["mark"]}),Ne(document.documentElement),Ne(document.body),function(){const e=setInterval(()=>{if(Re.length<10)return;if(xe.hasTags&&xe.len<25)return;Re.sort();const t=Math.min(Re.reduce((e,t)=>e+t,0)/Re.length,Re[Math.floor(Re.length/2)]),n=R(t);n>Ge&&(Ge=n,Q("performanceObserver"),B("Mean time:",R(Re[Math.floor(Re.length/2)])),B("Median time:",R(Re.reduce((e,t)=>e+t,0)/Re.length)),B("Average time:",n),B("Max time:",R(Math.max(...Re)))),t<=4||(clearInterval(e),K(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${R(t)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${xe.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3)}()}const qe=He("Resize"),Be=new WeakSet;let Fe;function We(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=Be.has(n);if(!e)continue;const r=getComputedStyle(n)?.position;""!==r&&"static"!==r&&(D(!o,"Node already observed for resize",n),o||(Fe.observe(n),Be.add(n),t+=1))}qe(t)}const De=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Ue=De("function"),Ve=De("number"),Ze=De("string");"undefined"!=typeof window&&function(){const $={height:()=>(X("Custom height calculation function not defined"),qt.auto()),width:()=>(X("Custom width calculation function not defined"),Bt.auto())},S={},H={},A="auto",C="[iFrameSizer]",F="scroll";let D,Z,Y,te,ie,ae,se,le,ce,ue,de,fe=!0,pe="",ye=0,be="",ve="",ze=!1,we=!0,$e=!1,Ie=!0,Oe=!1,Se=!1,ke=!1,Re=1,Le=A,Ne="",xe=!0,Ge={},Pe=!1,qe=!0,De=!1,Je=0,Qe=!1,_e=[],Ye="",Xe="child",Ke=!1,et="",tt=[],nt=window.parent,ot="*",rt=0,it=!1,at=1,st=F,lt=window,ct=()=>{X("onMessage function not defined")},ut=()=>{},dt=null,ft=null;function mt(i){var a,u,f;!function(e){Ye=e[0]??Ye,ye=ge(e[1])??ye,$e=he(e[2])??$e,De=he(e[3])??De,fe=he(e[6])??fe,be=e[7]??be,Le=e[8]??Le,pe=e[9]??pe,ve=e[10]??ve,rt=ge(e[11])??rt,Ge.enable=he(e[12])??!1,Xe=e[13]??Xe,st=e[14]??st,Qe=he(e[15])??Qe,Y=ge(e[16])??Y,te=ge(e[17])??te,we=he(e[18])??we,D=e[19]??D,ue=e[20]??ue,Je=ge(e[21])??Je,qe=he(e[23])??qe}(i),P=(a={id:Ye,enabled:De,expand:qe}).id||n,q.label(`${P}`),q.expand(a.expand),G=a.enabled,B(`Initialising iframe v${t} ${window.location.href}`),function(){function t(e){B("Reading data from page:",Object.keys(e)),de=Ue(e,"onBeforeResize")??de,ct=Ue(e,"onMessage")??ct,ut=Ue(e,"onReady")??ut,"number"==typeof e?.offset&&(re("offset","offsetSize"),we&&(Y=Ve(e,"offset")??Y),$e&&(te=Ve(e,"offset")??te)),"number"==typeof e?.offsetSize&&(we&&(Y=Ve(e,"offsetSize")??Y),$e&&(te=Ve(e,"offsetSize")??te)),Z=Ze(e,I(O[0]))??Z,Ne=Ze(e,"ignoreSelector")??Ne,et=Ze(e,"sizeSelector")??et,ot=Ze(e,"targetOrigin")??ot,Le=e?.heightCalculationMethod||Le,st=e?.widthCalculationMethod||st}function n(e,t){return"function"==typeof e&&(K(`<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.`),$[t]=e,e="custom"),e}if(1===Je)return;const o=window.iframeResizer||window.iFrameResizer;"object"==typeof o&&(t(o),Le=n(Le,"height"),st=n(st,"width"),W(`Set targetOrigin for parent: %c${ot}`,e.HIGHLIGHT))}(),zt(),function(){try{Ke=1===Je||"iframeParentListener"in window.parent}catch(e){B("Cross domain iframe detected")}}(),$e===we&&(ze=!0),function(){const n=Je,o=k({key:D}),r=k({key:Z});if(Je=Math.max(o,r),Je<0){if(Je=Math.min(o,r),K(`${M(Je+2)}${M(2)}`),N(ue))throw M(Je+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!N(ue)||n>-1&&Je>n)&&(sessionStorage.getItem("ifr")!==t&&function(t,n){console.info(`${P} %ciframe-resizer ${t}`,G||n<1?"font-weight: bold;":e.NORMAL)}(`v${t} (${(e=>I(T[e]))(Je)})`,Je),Je<2&&ee(M(3)),sessionStorage.setItem("ifr",t))}(),ue&&""!==ue&&"false"!==ue?ue!==t&&K(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ue} - Child page: ${t}.\n`):K("<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"),It(),Ot(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(r,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&K("<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</>.")}(),"BackCompat"===document.compatMode&&K("<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"),ht(),ze||me(),1!==Je&&(lt.parentIframe=Object.freeze({autoResize:e=>(x(e,"boolean","parentIframe.autoResize(enable) enable"),!1===$e&&!1===we?(Q(c),K(`Auto Resize can not be changed when <b>direction</> is set to '${b}'.`),!1):(!0===e&&!1===fe?(fe=!0,queueMicrotask(()=>Zt(c,"Auto Resize enabled"))):!1===e&&!0===fe&&(fe=!1),Qt(0,0,"autoResize",JSON.stringify(fe)),fe)),close(){Qt(0,0,"close")},getId:()=>Ye,getOrigin:()=>(ne("getOrigin()","getParentOrigin()"),ie),getParentOrigin:()=>ie,getPageInfo(e){if("function"==typeof e)return dt=e,Qt(0,0,"pageInfo"),void oe("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");dt=null,Qt(0,0,"pageInfoStop")},getParentProps:e=>(x(e,"function","parentIframe.getParentProps(callback) callback"),ft=e,Qt(0,0,"parentInfo"),()=>{ft=null,Qt(0,0,"parentInfoStop")}),getParentProperties(e){ne("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){x(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Ge.findTarget(e)},reset(){!function(){const t=Le;Le=A,B("Reset trigger event: %cparentIframe.reset",e.HIGHLIGHT),it?B("TriggerLock blocked calculation"):(it=!0,U("Trigger event lock on"),requestAnimationFrame(()=>{it=!1,U("Trigger event lock off")})),Jt("reset"),Le=t}()},setOffsetSize(e){x(e,"number","parentIframe.setOffsetSize(offset) offset"),Y=e,te=e,Zt(m,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){x(e,"number","parentIframe.scrollBy(x, y) x"),x(t,"number","parentIframe.scrollBy(x, y) y"),Qt(t,e,"scrollBy")},scrollTo(e,t){x(e,"number","parentIframe.scrollTo(x, y) x"),x(t,"number","parentIframe.scrollTo(x, y) y"),Qt(t,e,"scrollTo")},scrollToOffset(e,t){x(e,"number","parentIframe.scrollToOffset(x, y) x"),x(t,"number","parentIframe.scrollToOffset(x, y) y"),Qt(t,e,"scrollToOffset")},sendMessage(e,t){t&&x(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Qt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Le=e,It()},setWidthCalculationMethod(e){st=e,Ot()},setTargetOrigin(t){x(t,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),B(`Set targetOrigin: %c${t}`,e.HIGHLIGHT),ot=t},resize(e,t){e&&x(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&x(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),Zt(d,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ne("size()","resize()"),this.resize(e,t)}}),lt.parentIFrame=lt.parentIframe),function(){function t(e){Qt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function n(n,o){B(`Add event listener: %c${o}`,e.HIGHLIGHT),w(window.document,n,t)}!0===Qe&&(n("mouseenter","Mouse Enter"),n("mouseleave","Mouse Leave"))}(),Ge=function(){const t=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(e){const n=e.getBoundingClientRect(),r=t();return{x:parseInt(n.left,o)+parseInt(r.x,o),y:parseInt(n.top,o)+parseInt(r.y,o)}}function r(t){function o(t){const o=n(t);B(`Moving to in page link (%c#${r}%c) at x: %c${o.x}%c y: %c${o.y}`,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT),Qt(o.y,o.x,"scrollToOffset")}const r=t.split("#")[1]||t,i=decodeURIComponent(r),a=document.getElementById(i)||document.getElementsByName(i)[0];void 0===a?(B(`In page link (#${r}) not found in iFrame, so sending to parent`),Qt(0,0,"inPageLink",`#${r}`)):o(a)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&r(t)}function a(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&w(e,"click",t=>{t.preventDefault(),r(e.getAttribute("href"))})}function s(){w(window,"hashchange",i)}function l(){setTimeout(i,128)}function c(){B("Setting up location.hash handlers"),a(),s(),l()}return Ge.enable?1===Je?K("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):c():B("In page linking not enabled"),{findTarget:r}}(),void 0===be&&(be=`${ye}px`),bt("margin",(u="margin",(f=be).includes("-")&&(X(`Negative CSS value ignored for ${u}`),f=""),f)),bt("background",pe),bt("padding",ve),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),ze||function(){const t=e=>e.style.setProperty("height","auto","important");t(document.documentElement),t(document.body),B("Set HTML & body height: %cauto !important",e.HIGHLIGHT)}(),!0!==fe&&B("Auto Resize disabled"),function(e){wt({method:e,eventType:"After Print",eventName:"afterprint"}),wt({method:e,eventType:"Before Print",eventName:"beforeprint"}),wt({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=Nt(document)();B("Attaching Observers"),Te(At),function(e){const t={root:document.documentElement,side:we?s:l};ae=je(St,t),ae.attachObservers(e)}(e),Ce(),function(e){Fe=new ResizeObserver(Tt),Fe.observe(document.body),Be.add(document.body),W("Attached ResizeObserver to body"),se={attachObserverToNonStaticElements:We,detachObservers:Me(0,Fe,Be)},se.attachObserverToNonStaticElements(e)}(e),function(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;t.observe(n),W("Attached VisibilityObserver to page")}(Ht)}(),pt(E(ut)),B("Initialization complete"),Zt(z,"Init message from host page",void 0,void 0,`${t}:${Je}`),document.title&&""!==document.title&&Qt(0,0,"title",document.title)}function pt(e){"complete"===document.readyState?j(e):w(document,"readystatechange",()=>pt(e))}function ht(){tt=document.querySelectorAll(`[${r}]`),ke=tt.length>0,B(`Tagged elements found: %c${ke}`,e.HIGHLIGHT)}let gt=0;function yt(){const t=document.querySelectorAll(`*[${a}]`);Oe=t.length>0,Oe&&t.length!==gt&&(function(t){const n=1===t.length?"":"s";X(`%c[${a}]%c found on %c${t.length}%c element${n}`,e.BOLD,e.NORMAL,e.BOLD,e.NORMAL)}(t),gt=t.length)}function bt(t,n){void 0!==n&&""!==n&&"null"!==n&&(document.body.style.setProperty(t,n),W(`Set body ${t}: %c${n}`,e.HIGHLIGHT))}function vt(t,n,o){if(""!==o){B(`${t}: %c${o}`,e.HIGHLIGHT);for(const e of document.querySelectorAll(o))B(`Applying ${n} to:`,e),e.toggleAttribute(n,!0)}}function zt(){vt("sizeSelector",r,et),vt("ignoreSelector",a,Ne)}function wt(t){({add(e){function n(){Zt(t.eventName,t.eventType)}H[e]=n,w(window,e,n,{passive:!0})},remove(e){const t=H[e];var n,o;delete H[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[t.method](t.eventName),B(`${L(t.method)} event listener: %c${t.eventType}`,e.HIGHLIGHT)}function $t(t,n,o,r){return n!==t&&(t in o||(X(`${t} is not a valid option for ${r}CalculationMethod.`),t=n),t in S)&&K(`<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 ${ue?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),B(`Set ${r} calculation method: %c${t}`,e.HIGHLIGHT),t}function It(){Le=$t(Le,A,qt,"height")}function Ot(){st=$t(st,F,Bt,"width")}function St(e){!function(){const e=document.querySelectorAll(`[${i}]`);_e=Array.from(e).filter(e=>!e.closest(`[${a}]`)),Se=_e.length>0}(),(Se||e)&&(_e.length>1?W("Overflowed Elements:",..._e):Se||W("Overflow removed"),Zt(h,"Overflow updated"))}function Tt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Zt(p,`Element resized <${function(e){switch(!0){case!N(e):return"";case N(e.id):return`${e.nodeName}#${e.id}`;case N(e.name):return`${e.nodeName} (${e.name}`;case N(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function Ht(t){B(`Visible: %c${t}`,e.HIGHLIGHT),Pe=!t,Zt(y,"Visibility changed")}const Mt=He("Overflow"),kt=He("Overflow",!1),jt=He("Resize"),Et=He("Resize",!1);function At(e){!function({addedMutations:e,removedMutations:t}){Q("contentMutated"),zt(),ht();let n=0,o=0,r=0,i=0;for(const e of t){const t=Nt(e)();o+=ae.detachObservers(t),i+=se.detachObservers(t)}for(const t of e){const e=Nt(t)();n+=ae.attachObservers(e),r+=se.attachObserverToNonStaticElements(e)}kt(o),Et(i),Mt(n),jt(r),V()}(e),Zt(g,"Mutation Observed")}function Rt(e){performance.mark(Ee);const t=L(e);let n=0,o=document.documentElement,r=ke?0:document.documentElement.getBoundingClientRect().bottom;const i=ke?tt:Se?_e:Nt(document)();for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return W(`${t} position calculated from:`,o),performance.mark(Ae,{detail:{hasTags:ke,len:i.length,logging:De,Side:t}}),r}const Lt=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],Nt=e=>()=>{const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return yt(),Oe&&t.push(`not([${a}])`,`not([${a}] *)`),[e,...e.querySelectorAll(t.join(":"))]},xt={height:0,width:0},Gt={height:0,width:0},Pt=[e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT];function Ct(t){function n(){return Gt[r]=i,xt[r]=l,i}const o=t===qt,r=o?"height":"width",i=t.boundingClientRect(),a=Math.ceil(i),s=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(t),c=`HTML: %c${i}px %cPage: %c${l}px`;let u=0;switch(!0){case!t.enabled():return l;case ke:W("Found element with data-iframe-size attribute"),u=t.taggedElement();break;case!Se&&0===Gt[r]&&0===xt[r]:W(`Initial page size values: ${c}`,...Pt),u=n();break;case it&&i===Gt[r]&&l===xt[r]:W(`Size unchanged: ${c}`,...Pt),u=Math.max(i,l);break;case 0===i:W(`Page is hidden: ${c}`,...Pt),u=l;break;case!Se&&i!==Gt[r]&&l<=xt[r]:W(`New <html> size: ${c} `,...Pt),W(`Previous <html> size: %c${Gt[r]}px`,e.HIGHLIGHT),u=n();break;case!o:u=t.taggedElement();break;case!Se&&i<Gt[r]:W(`<html> size decreased: ${c}`,...Pt),u=n();break;case l===s||l===a:W(`<html> size equals page size: ${c}`,...Pt),u=n();break;case i>l:W(`Page size < <html> size: ${c}`,...Pt),u=n();break;case Se:W("Found element overflowing <html> "),u=t.taggedElement();break;default:W(`Using <html> size: ${c}`,...Pt),u=n()}return W(`Content ${r}: %c${u}px`,e.HIGHLIGHT),u+=function(t){const n=t.getOffset();return 0!==n&&W(`Page offsetSize: %c${n}px`,e.HIGHLIGHT),n}(t),u}const qt={enabled:()=>we,getOffset:()=>Y,auto:()=>Ct(qt),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,o)+parseInt(t.marginBottom,o)},bodyScroll:()=>document.body.scrollHeight,offset:()=>qt.bodyOffset(),custom:()=>$.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...Lt(qt)),min:()=>Math.min(...Lt(qt)),grow:()=>qt.max(),lowestElement:()=>Rt(s),taggedElement:()=>Rt(s)},Bt={enabled:()=>$e,getOffset:()=>te,auto:()=>Ct(Bt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>$.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...Lt(Bt)),min:()=>Math.min(...Lt(Bt)),rightMostElement:()=>Rt(l),scroll:()=>Math.max(Bt.bodyScroll(),Bt.documentElementScroll()),taggedElement:()=>Rt(l)},Ft=(e,t)=>!(Math.abs(e-t)<=rt);function Wt(e,t){const n=e[t]();return e.enabled()&&void 0!==de?function(e){const t=de(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`);return t}(n):n}let Dt=!1;const Ut=E(()=>ee(M(4)));let Vt=!1;const Zt=J((t,n,o,r,i)=>{if(ce=performance.now(),le=!0,Q(t),!0!==Dt){if(!fe&&!(t in f))return W("Resizing disabled"),void V();if(Pe){if(!0===Vt)return;return B("Iframe hidden - Ignored resize request"),void(Vt=!0)}Vt=!1,Dt=!0,requestAnimationFrame(()=>{Dt=!1}),function(t,n,o,r,i){const a=o??Wt(qt,Le),s=r??Wt(Bt,st),l=we&&Ft(Re,a)||$e&&Ft(at,s)?u:t;switch(B(`Resize event: %c${n}`,e.HIGHLIGHT),l){case z:case c:case u:Re=a,at=s;case m:Qt(Re,at,t,i);break;case h:case g:case p:case y:B(v);break;default:W(v)}le=!1}(t,n,o,r,i)}});function Jt(e){Re=qt[Le](),at=Bt[st](),Qt(Re,at,e)}const Qt=J(function(t,n,o,r,i){Je<-1||(Q(o),void 0!==i?B(`Message targetOrigin: %c${i}`,e.HIGHLIGHT):i=ot,function(){const a=`${Ye}:${t}:${n}:${o}${void 0===r?"":`:${r}`}`;if(Ke)try{window.parent.iframeParentListener(C+a)}catch(e){if(1!==Je)throw e;return void Ut()}else nt.postMessage(C+a,i);le&&B(function(){const e=R(performance.now()-ce);return o===z?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),e.HIGHLIGHT),W(`Sending message to parent page via ${Ke?"sameOrigin":"postMessage"}: %c%c${a}`,e.ITALIC,e.HIGHLIGHT)}(),V())}),_t=J(function(t){Q("onMessage");const{freeze:n}=Object,{parse:o}=JSON,r=e=>n(o(e)),i=e=>Qt(0,0,`${e}Stop`),a={init:function(){if("loading"===document.readyState)return void B("Page not ready, ignoring init message");const e=t.data.slice(13).split(":");nt=t.source,ie=t.origin,mt(e),Ie=!1,setTimeout(()=>{xe=!1},128)},reset(){xe?B("Page reset ignored by init"):(B("Page size reset by host page"),Jt("resetPage"))},resize(){B("Resize requested by host page"),Zt("parentResize","Parent window requested size check")},moveToAnchor(){Ge.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();B("PageInfo received from parent:",r(e)),dt?j(dt,o(e)):i("pageInfo")},parentInfo(){const e=r(l());B("ParentInfo received from parent:",e),ft?j(ft,e):i("parentInfo")},message(){const t=l();B("onMessage called from parent:%c",e.HIGHLIGHT,r(t)),j(ct,o(t))}},s=()=>t.data.split("]")[1].split(":")[0],l=()=>t.data.slice(t.data.indexOf(":")+1),c=()=>t.data.split(":")[2]in{true:1,false:1};function u(){const e=s();Q(e),e in a?a[e]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||c()||X(`Unexpected message (${t.data})`)}C===`${t.data}`.slice(0,13)&&function(){if(!1!==Ie)return c()?(_(s()),Q(z),void a.init()):void B(`Ignored message of type "${s()}". Received before initialization.`);u()}()});function Yt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?X("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>_t({data:e,sameOrigin:!0})),w(window,"message",_t),w(window,"readystatechange",Yt),Yt())}();
|
|
21
21
|
//# sourceMappingURL=index.cjs.js.map
|