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