iframe-resizer 5.4.7-beta.4 → 5.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +1 -1
- package/index.esm.js +1 -1
- package/js/iframeResizer.contentWindow.js +2 -3
- package/js/iframeResizer.contentWindow.min.js +2 -3
- package/js/iframeResizer.js +2 -3
- package/js/iframeResizer.min.js +2 -3
- package/package.json +4 -4
- package/js/iframeResizer.contentWindow.js.map +0 -1
- package/js/iframeResizer.contentWindow.min.js.map +0 -1
- package/js/iframeResizer.js.map +0 -1
- package/js/iframeResizer.min.js.map +0 -1
package/index.cjs.js
CHANGED
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/legacy (child) 5.4.7
|
|
4
|
+
* @module iframe-resizer/legacy (child) 5.4.7 (iife)
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 for non-commercial use only.
|
|
7
7
|
* For commercial use, you must purchase a license from
|
|
@@ -17,5 +17,4 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
!function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0},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.4.7-beta.4",b=10,v="data-iframe-size",z="data-iframe-overflowed",w="data-iframe-ignore",$="bottom",S="right",O="autoResizeEnabled",E=Symbol("sizeChanged"),M="manualResize",k="parentResize",j={[M]:1,[k]:1},T="setOffsetSize",I="resizeObserver",C="overflowObserver",x="mutationObserver",A="none",P="No change in content size detected",R="init",N=(e,t,n,o)=>e.addEventListener(t,n,o||!1),q=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const B=e=>(e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(q[e]),L=(e,...t)=>setTimeout((()=>e(...t)),0),F=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},W=e=>e,D=e=>Math.round(1e3*e)/1e3,H=e=>e.charAt(0).toUpperCase()+e.slice(1),U=e=>""!=`${e}`&&void 0!==e;function V(e){switch(!0){case!U(e):return"";case U(e.id):return`${e.nodeName}#${e.id}`;case U(e.name):return`${e.nodeName} (${e.name}`;case U(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}const Z=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${H(t)}`)};let J=!0;const _=(Q=function(n={}){const c={},u={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function b(){delete h.event,y()}const v=()=>!!p.some((([e])=>e in i))||!!h.expand;function z(){if(0!==p.length){l[v()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?g:""}`,e,t,o);for(const[e,...t]of p)l.assert(e in l,`Unknown console method: ${e}`),e in l&&l[e](...t);l.groupEnd(),b()}else b()}function w(){""===g&&(g=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function $(e,...t){0===p.length&&(w(),queueMicrotask((()=>queueMicrotask(z)))),p.push([e,...t])}function S(e=r,...t){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){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)}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}},Q?.__esModule?Q.default:Q);var Q;const G=_({label:"iframeResizer(child)"});const Y=(X="log",(...e)=>!J||G[X](...e));var X;const K=Y,{assert:ee,debug:te,endAutoGroup:ne,error:oe,errorBoundary:re,event:ie,label:ae,purge:se,warn:le}=G,ce=e=>{return G.warn((t=W,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},ue=ce,de=(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)=>ce(t))),fe=de("Method"),me=de("Method","replaced with"),pe=de("Option"),he=["min-height","min-width","max-height","max-width"],ge=new Set,ye=e=>e.tagName?e.tagName.toLowerCase():"unknown",be=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),ve=(e,t)=>{return(n=be(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function ze({href:e}){ge.has(e)||(Y("Unable to access stylesheet:",e),ge.add(e))}const we=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){ze(n)}return{source:"cross-origin stylesheet",value:be(e,t)}}(e,t),$e=(e,t)=>{const{source:n,value:o}=we(e,t),r=ye(e);ce(`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 Se(){for(const e of[document.documentElement,document.body])for(const t of he)Y(`Checking <${ye(e)}> for blocking CSS: ${t}`),ve(e,t)&&$e(e,t)}const Oe=e=>t=>void 0===t?void 0:e(t),Ee=Oe((e=>"true"===e)),Me=Oe(Number),ke="--ifr-start",je="--ifr-end",Te=[],Ie=new WeakSet,Ce=e=>"object"==typeof e&&Ie.add(e);let xe={},Ae=0;const Pe=setInterval((()=>{if(Te.length<10)return;if(xe.hasTags&&xe.len<25)return;Te.sort();const e=Math.min(Te.reduce(((e,t)=>e+t),0)/Te.length,Te[Math.floor(Te.length/2)]),t=D(e);t>Ae&&(Ae=t,ie("performanceObserver"),Y("Mean time:",D(Te[Math.floor(Te.length/2)])),Y("Median time:",D(Te.reduce(((e,t)=>e+t),0)/Te.length)),Y("Average time:",t),Y("Max time:",D(Math.max(...Te)))),e<=4||(clearInterval(Pe),ce(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${D(e)}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);function Re(e){e.getEntries().forEach((e=>{if(e.name===je){const{duration:t}=performance.measure("--ifr-measure",ke,je);xe=e.detail,Te.push(t),Te.length>100&&Te.shift()}}))}function Ne(){new PerformanceObserver(Re).observe({entryTypes:["mark"]}),Ce(document.documentElement),Ce(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",Ne):Ne());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}.`)}},Be=qe("function"),Le=qe("number"),Fe=qe("string");"undefined"!=typeof window&&function(){const o={height:()=>(le("Custom height calculation function not defined"),jt.auto()),width:()=>(le("Custom width calculation function not defined"),Tt.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},i={},a="auto",s="[iFrameSizer]",l="scroll";let c,u,d,f,m,p,q,U=!0,_="",Q=0,X="",oe="",se=!1,de=!0,he=!1,ge=!0,ye=!1,be=!1,ve=!1,ze=1,we=a,$e="",Oe=!0,Te={},Ie=!0,Ce=!1,xe="",Ae=0,Pe=!1,Re="",Ne=W,qe=[],We="child",De=null,He=!1,Ue="",Ve=[],Ze=window.parent,Je="*",_e=0,Qe=!1,Ge=1,Ye=l,Xe=window,Ke=()=>{le("onMessage function not defined")},et=()=>{},tt=null,nt=null;function ot(e){var t,n,r;!function(e){Re=e[0]??Re,Q=Me(e[1])??Q,he=Ee(e[2])??he,Ce=Ee(e[3])??Ce,U=Ee(e[6])??U,X=e[7]??X,we=e[8]??we,_=e[9]??_,oe=e[10]??oe,_e=Me(e[11])??_e,Te.enable=Ee(e[12])??!1,We=e[13]??We,Ye=e[14]??Ye,Pe=Ee(e[15])??Pe,c=Me(e[16])??c,u=Me(e[17])??u,de=Ee(e[18])??de,xe=e[19]??xe,p=e[20]??p,Ae=Me(e[21])??Ae,Ie=Ee(e[23])??Ie}(e),t={id:Re,enabled:Ce,expand:Ie},G.label(`${t.id}`),G.expand(t.expand),J=t.enabled,Y(`Initialising iframe v${y} ${window.location.href}`),function(){function e(e){Y("Reading data from page:",e),q=Be(e,"onBeforeResize")??q,Ke=Be(e,"onMessage")??Ke,et=Be(e,"onReady")??et,"number"==typeof e?.offset&&(pe("offset","offsetSize"),de&&(c=Le(e,"offset")??c),he&&(u=Le(e,"offset")??u)),"number"==typeof e?.offsetSize&&(de&&(c=Le(e,"offsetSize")??c),he&&(u=Le(e,"offsetSize")??u)),$e=Fe(e,"ignoreSelector")??$e,Ue=Fe(e,"sizeSelector")??Ue,Je=Fe(e,"targetOrigin")??Je,we=e?.heightCalculationMethod||we,Ye=e?.widthCalculationMethod||Ye}function t(e,t){return"function"==typeof e&&(ce(`<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===Ae)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),we=t(we,"height"),Ye=t(Ye,"width"),K(`Set targetOrigin for parent: %c${Je}`,h))}(),mt(),function(){try{He=1===Ae||"iframeParentListener"in window.parent}catch(e){Y("Cross domain iframe detected")}}(),he===de&&(se=!0),Ae<0?ue(`${B(Ae+2)}${B(2)}`):p?.codePointAt(0)>4||Ae<2&&ue(B(3)),p&&""!==p&&"false"!==p?p!==y&&ce(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${p} - Child page: ${y}.\n`):ce("<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"),gt(),yt(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(v,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&ce("<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&&ce("<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"),st(),se||Se(),1!==Ae&&(Xe.parentIframe=Object.freeze({autoResize:e=>(Z(e,"boolean","parentIframe.autoResize(enable) enable"),!1===he&&!1===de?(ie(O),ce(`Auto Resize can not be changed when <b>direction</> is set to '${A}'.`),!1):(!0===e&&!1===U?(U=!0,queueMicrotask((()=>Pt(O,"Auto Resize enabled")))):!1===e&&!0===U&&(U=!1),Nt(0,0,"autoResize",JSON.stringify(U)),U)),close(){Nt(0,0,"close")},getId:()=>Re,getOrigin:()=>(fe("getOrigin()","getParentOrigin()"),d),getParentOrigin:()=>d,getPageInfo(e){if("function"==typeof e)return tt=e,Nt(0,0,"pageInfo"),void me("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");tt=null,Nt(0,0,"pageInfoStop")},getParentProps:e=>(Z(e,"function","parentIframe.getParentProps(callback) callback"),nt=e,Nt(0,0,"parentInfo"),()=>{nt=null,Nt(0,0,"parentInfoStop")}),getParentProperties(e){fe("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){Z(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Te.findTarget(e)},reset(){!function(){const e=we;we=a,Y("Reset trigger event: %cparentIframe.reset",h),Qe?Y("TriggerLock blocked calculation"):(Qe=!0,te("Trigger event lock on"),requestAnimationFrame((()=>{Qe=!1,te("Trigger event lock off")}))),Rt("reset"),we=e}()},setOffsetSize(e){Z(e,"number","parentIframe.setOffsetSize(offset) offset"),c=e,u=e,Pt(T,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){Z(e,"number","parentIframe.scrollBy(x, y) x"),Z(t,"number","parentIframe.scrollBy(x, y) y"),Nt(t,e,"scrollBy")},scrollTo(e,t){Z(e,"number","parentIframe.scrollTo(x, y) x"),Z(t,"number","parentIframe.scrollTo(x, y) y"),Nt(t,e,"scrollTo")},scrollToOffset(e,t){Z(e,"number","parentIframe.scrollToOffset(x, y) x"),Z(t,"number","parentIframe.scrollToOffset(x, y) y"),Nt(t,e,"scrollToOffset")},sendMessage(e,t){t&&Z(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Nt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){we=e,gt()},setWidthCalculationMethod(e){Ye=e,yt()},setTargetOrigin(e){Z(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),Y(`Set targetOrigin: %c${e}`,h),Je=e},resize(e,t){e&&Z(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&Z(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),Pt(M,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){fe("size()","resize()"),this.resize(e,t)}}),Xe.parentIFrame=Xe.parentIframe),function(){function e(e){Nt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){Y(`Add event listener: %c${n}`,h),N(window.document,t,e)}!0===Pe&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),Te=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);Y(`Moving to in page link (%c#${o}%c) at x: %c${n.x}%c y: %c${n.y}`,h,g,h,g,h),Nt(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?(Y(`In page link (#${o}) not found in iFrame, so sending to parent`),Nt(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")&&N(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function i(){N(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){Y("Setting up location.hash handlers"),r(),i(),a()}return Te.enable?1===Ae?ce("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):s():Y("In page linking not enabled"),{findTarget:n}}(),void 0===X&&(X=`${Q}px`),dt("margin",(n="margin",(r=X).includes("-")&&(le(`Negative CSS value ignored for ${n}`),r=""),r)),dt("background",_),dt("padding",oe),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),se||function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),Y("Set HTML & body height: %cauto !important",h)}(),!0!==U&&Y("Auto Resize disabled"),function(e){pt({method:e,eventType:"After Print",eventName:"afterprint"}),pt({method:e,eventType:"Before Print",eventName:"beforeprint"}),pt({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const r=t=>{K("Mutations observed:",t);for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},i=16,a=2,s=200;let l=1;function c(e){mt(),lt(e),e.forEach(zt),e.clear()}function u(){const d=performance.now(),f=d-o,m=i*l+++a;if(f>m&&f<s)return K("Backed off due to heavy workload on callStack"),Y(`Delay: %c${D(f)}ms %c> Delay limit: %c${m}ms`,h,g,h),setTimeout(u,i*l),void(o=d);l=1,t.forEach(r),t.length=0,e.size>0&&c(e),st(),it(),n=!1,Pt(x,"Mutation Observed")}function d(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(u))}function f(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[w,v],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return Y("Setup <body> MutationObserver"),e.observe(t,n),e}f()}(),Y("Setup ResizeObserver"),De=new ResizeObserver(bt),De.observe(document.body),vt.add(document.body),zt(document.body),de!==he&&(Y("Setup OverflowObserver"),Ne=(e=>{const t=e.side||$,n=e.onChange||W,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||W,i=(e=!1)=>n(e),a=(e,n)=>0===e||e>n[t],s=(e,t)=>e.toggleAttribute(z,t),l=new IntersectionObserver((function(e){for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,l=e[t],c=a(l,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);s(i,c)}var n;r(i)}),o),c=new WeakSet;return function(e){Y("Attached overflowObservers");for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=c.has(t);!n&&e?(l.observe(t),c.add(t)):ee(!n,"Node already observed",t)}}})({onChange:at,root:document.documentElement,side:de?$:S})),lt(St(document)()),rt(F(et)),Y("Initialization complete"),Pt(R,"Init message from host page",void 0,void 0,y),document.title&&""!==document.title&&Nt(0,0,"title",document.title)}function rt(e){"complete"===document.readyState?L(e):N(document,"readystatechange",(()=>rt(e)))}function it(){const e=document.querySelectorAll(`[${z}]`);qe=Array.from(e).filter((e=>!e.closest(`[${w}]`))),be=qe.length>0}function at(e){it(),(be||e)&&(be?K("Overflowed Elements:",...qe):K("Overflow removed"),Pt(C,"Overflow updated"))}function st(){Ve=document.querySelectorAll(`[${v}]`),ve=Ve.length>0,Y(`Tagged elements found: %c${ve}`,h)}function lt(e){ve||Ne(e)}let ct=0;function ut(){const n=document.querySelectorAll(`*[${w}]`);ye=n.length>0,ye&&n.length!==ct&&(function(n){const o=1===n.length?"":"s";le(`%c[${w}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),ct=n.length)}function dt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),K(`Set body ${e}: %c${t}`,h))}function ft(e,t,n){if(""!==n){Y(`${e}: %c${n}`,h);for(const e of document.querySelectorAll(n))Y(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function mt(){ft("sizeSelector",v,Ue),ft("ignoreSelector",w,$e)}function pt(e){({add(t){function n(){Pt(e.eventName,e.eventType)}i[t]=n,N(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),Y(`${H(e.method)} event listener: %c${e.eventType}`,h)}function ht(e,t,n,o){return t!==e&&(e in n||(le(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&ce(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you ${p?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),Y(`Set ${o} calculation method: %c${e}`,h),e}function gt(){we=ht(we,a,jt,"height")}function yt(){Ye=ht(Ye,l,Tt,"width")}function bt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Pt(I,`Element resized <${V(t)}>`)}const vt=new WeakSet;function zt(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!vt.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(De.observe(e),vt.add(e),Y(`Attached resizeObserver: %c${V(e)}`,h))}const t=St(e)();for(const e of t){if(vt.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(De.observe(e),vt.add(e),Y(`Attached resizeObserver: %c${V(e)}`,h))}}function wt(e){performance.mark(ke);const t=H(e);let n=0,o=document.documentElement,r=ve?0:document.documentElement.getBoundingClientRect().bottom;const i=ve?Ve:be?qe:St(document)();for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return K(`${t} position calculated from:`,o),performance.mark(je,{detail:{hasTags:ve,len:i.length,logging:Ce,Side:t}}),r}const $t=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],St=e=>()=>{ut();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 ye&&t.push(`not([${w}])`,`not([${w}] *)`),e.querySelectorAll(t.join(":"))},Ot={height:0,width:0},Et={height:0,width:0},Mt=[h,g,h];function kt(e){function t(){return Et[o]=r,Ot[o]=s,r}const n=e===jt,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 ve:K("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!be&&0===Et[o]&&0===Ot[o]:K(`Initial page size values: ${l}`,...Mt),c=t();break;case Qe&&r===Et[o]&&s===Ot[o]:K(`Size unchanged: ${l}`,...Mt),c=Math.max(r,s);break;case 0===r:K(`Page is hidden: ${l}`,...Mt),c=s;break;case!be&&r!==Et[o]&&s<=Ot[o]:K(`New <html> size: ${l} `,...Mt),K(`Previous <html> size: %c${Et[o]}px`,h),c=t();break;case!n:c=e.taggedElement();break;case!be&&r<Et[o]:K(`<html> size decreased: ${l}`,...Mt),c=t();break;case s===a||s===i:K(`<html> size equals page size: ${l}`,...Mt),c=t();break;case r>s:K(`Page size < <html> size: ${l}`,...Mt),c=t();break;case be:K("Found element overflowing <html> "),c=e.taggedElement();break;default:K(`Using <html> size: ${l}`,...Mt),c=t()}return K(`Content ${o}: %c${c}px`,h),c+=function(e){const t=e.getOffset();return 0!==t&&K(`Page offsetSize: %c${t}px`,h),t}(e),c}const jt={enabled:()=>de,getOffset:()=>c,auto:()=>kt(jt),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,b)+parseInt(t.marginBottom,b)},bodyScroll:()=>document.body.scrollHeight,offset:()=>jt.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(...$t(jt)),min:()=>Math.min(...$t(jt)),grow:()=>jt.max(),lowestElement:()=>wt($),taggedElement:()=>wt($)},Tt={enabled:()=>he,getOffset:()=>u,auto:()=>kt(Tt),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(...$t(Tt)),min:()=>Math.min(...$t(Tt)),rightMostElement:()=>wt(S),scroll:()=>Math.max(Tt.bodyScroll(),Tt.documentElementScroll()),taggedElement:()=>wt(S)},It=(e,t)=>!(Math.abs(e-t)<=_e);function Ct(e,t){const n=e[t]();return e.enabled()&&void 0!==q?function(e){const t=q(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 xt=!1;const At=F((()=>ue(B(4)))),Pt=re(((e,t,n,o,r)=>{if(m=performance.now(),f=!0,ie(e),!0!==xt)return U||e in j?void(document.hidden?Y("Page hidden - Ignored resize request"):(xt=!0,requestAnimationFrame((()=>{xt=!1})),function(e,t,n,o,r){const i=n??Ct(jt,we),a=o??Ct(Tt,Ye),s=de&&It(ze,i)||he&&It(Ge,a)?E:e;switch(Y(`Resize event: %c${t}`,h),s){case R:case O:case E:ze=i,Ge=a;case T:Nt(ze,Ge,e,r);break;case I:case C:case x:Y(P);break;default:K(P)}f=!1}(e,t,n,o,r))):(K("Resizing disabled"),void ne())}));function Rt(e){ze=jt[we](),Ge=Tt[Ye](),Nt(ze,Ge,e)}const Nt=re((function(e,t,o,r,i){Ae<-1||(ie(o),void 0!==i?Y(`Message targetOrigin: %c${i}`,h):i=Je,function(){const a=`${Re}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(He)try{window.parent.iframeParentListener(s+a)}catch(e){if(1!==Ae)throw e;return void At()}else Ze.postMessage(s+a,i);f&&Y(function(){const e=D(performance.now()-m);return o===R?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),h),K(`Sending message to parent page via ${He?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}(),ne())})),qt=re((function(e){ie("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>t(n(e)),r=e=>Nt(0,0,`${e}Stop`),i={init:function(){if("loading"===document.readyState)return void Y("Page not ready, ignoring init message");const t=e.data.slice(13).split(":");Ze=e.source,d=e.origin,ot(t),ge=!1,setTimeout((()=>{Oe=!1}),128)},reset(){Oe?Y("Page reset ignored by init"):(Y("Page size reset by host page"),Rt("resetPage"))},resize(){Y("Resize requested by host page"),Pt(k,"Parent window requested size check")},moveToAnchor(){Te.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();Y("PageInfo received from parent:",o(e)),tt?L(tt,n(e)):r("pageInfo")},parentInfo(){const e=o(l());Y("ParentInfo received from parent:",e),nt?L(nt,e):r("parentInfo")},message(){const e=l();Y("onMessage called from parent:%c",h,o(e)),L(Ke,n(e))}},a=()=>e.data.split("]")[1].split(":")[0],l=()=>e.data.slice(e.data.indexOf(":")+1),c=()=>e.data.split(":")[2]in{true:1,false:1};function u(){const t=a();ie(t),t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||c()||le(`Unexpected message (${e.data})`)}s===`${e.data}`.slice(0,13)&&function(){if(!1!==ge)return c()?(ae(a()),ie(R),void i.init()):void Y(`Ignored message of type "${a()}". Received before initialization.`);u()}()}));function Bt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?le("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>qt({data:e,sameOrigin:!0}))),N(window,"message",qt),N(window,"readystatechange",Bt),Bt())}()}();
|
|
21
|
-
//# sourceMappingURL=iframeResizer.contentWindow.js.map
|
|
20
|
+
!function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0},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.4.7",b=10,v="data-iframe-size",z="data-iframe-overflowed",w="data-iframe-ignore",$="bottom",S="right",E="autoResizeEnabled",O=Symbol("sizeChanged"),j="manualResize",k="parentResize",M={[j]:1,[k]:1},T="setOffsetSize",C="resizeObserver",x="overflowObserver",A="mutationObserver",I="none",P="init",N=(e,t,n,o)=>e.addEventListener(t,n,o||!1),R=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const B=e=>(e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(R[e]),q=(e,...t)=>setTimeout((()=>e(...t)),0),L=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},F=e=>e,W=e=>Math.round(1e3*e)/1e3,D=e=>e.charAt(0).toUpperCase()+e.slice(1),H=e=>""!=`${e}`&&void 0!==e;const U=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${D(t)}`)};let V=!0;const Z=(J=function(n={}){const c={},u={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function b(){delete h.event,y()}const v=()=>!!p.some((([e])=>e in i))||!!h.expand;function z(){if(0!==p.length){l[v()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?g:""}`,e,t,o);for(const[e,...t]of p)l.assert(e in l,`Unknown console method: ${e}`),e in l&&l[e](...t);l.groupEnd(),b()}else b()}function w(){""===g&&(g=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function $(e,...t){0===p.length&&(w(),queueMicrotask((()=>queueMicrotask(z)))),p.push([e,...t])}function S(e=r,...t){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){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)}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}},J?.__esModule?J.default:J);var J;const _=Z({label:"iframeResizer(child)"});var Q;const G=(Q="log",(...e)=>!V||_[Q](...e)),{assert:Y,debug:X,endAutoGroup:K,error:ee,errorBoundary:te,event:ne,label:oe,purge:re,warn:ie}=_,ae=e=>{return _.warn((t=F,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},se=ae,le=(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)=>ae(t))),ce=le("Method"),ue=le("Method","replaced with"),de=le("Option"),fe=["min-height","min-width","max-height","max-width"],me=new Set,pe=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),he=(e,t)=>{return(n=pe(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function ge({href:e}){me.has(e)||me.add(e)}const ye=(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){ge(n)}return{source:"cross-origin stylesheet",value:pe(e,t)}}(e,t),be=(e,t)=>{const{source:n,value:o}=ye(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);ae(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function ve(){for(const e of[document.documentElement,document.body])for(const t of fe)he(e,t)&&be(e,t)}const ze=e=>t=>void 0===t?void 0:e(t),we=ze((e=>"true"===e)),$e=ze(Number),Se="--ifr-start",Ee="--ifr-end",Oe=[],je=new WeakSet,ke=e=>"object"==typeof e&&je.add(e);let Me={},Te=0;const Ce=setInterval((()=>{if(Oe.length<10)return;if(Me.hasTags&&Me.len<25)return;Oe.sort();const e=Math.min(Oe.reduce(((e,t)=>e+t),0)/Oe.length,Oe[Math.floor(Oe.length/2)]),t=W(e);t>Te&&(Te=t,ne("performanceObserver")),e<=4||(clearInterval(Ce),ae(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${W(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${Me.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function xe(e){e.getEntries().forEach((e=>{if(e.name===Ee){const{duration:t}=performance.measure("--ifr-measure",Se,Ee);Me=e.detail,Oe.push(t),Oe.length>100&&Oe.shift()}}))}function Ae(){new PerformanceObserver(xe).observe({entryTypes:["mark"]}),ke(document.documentElement),ke(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",Ae):Ae());const Ie=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Pe=Ie("function"),Ne=Ie("number"),Re=Ie("string");"undefined"!=typeof window&&function(){const o={height:()=>(ie("Custom height calculation function not defined"),St.auto()),width:()=>(ie("Custom width calculation function not defined"),Et.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},i={},a="auto",s="[iFrameSizer]",l="scroll";let c,u,d,f,m,p=!0,R="",W=0,Z="",J="",Q=!1,X=!0,ee=!1,le=!0,fe=!1,me=!1,pe=!1,he=1,ge=a,ye="",be=!0,ze={},Oe=!0,je=!1,ke="",Me=0,Te=!1,Ce="",xe=F,Ae=[],Ie="child",Be=null,qe=!1,Le="",Fe=[],We=window.parent,De="*",He=0,Ue=!1,Ve=1,Ze=l,Je=window,_e=()=>{ie("onMessage function not defined")},Qe=()=>{},Ge=null,Ye=null;function Xe(e){var t,n,r;!function(e){Ce=e[0]??Ce,W=$e(e[1])??W,ee=we(e[2])??ee,je=we(e[3])??je,p=we(e[6])??p,Z=e[7]??Z,ge=e[8]??ge,R=e[9]??R,J=e[10]??J,He=$e(e[11])??He,ze.enable=we(e[12])??!1,Ie=e[13]??Ie,Ze=e[14]??Ze,Te=we(e[15])??Te,c=$e(e[16])??c,u=$e(e[17])??u,X=we(e[18])??X,ke=e[19]??ke,f=e[20]??f,Me=$e(e[21])??Me,Oe=we(e[23])??Oe}(e),t={id:Ce,enabled:je,expand:Oe},_.label(`${t.id}`),_.expand(t.expand),V=t.enabled,function(){function e(e){m=Pe(e,"onBeforeResize")??m,_e=Pe(e,"onMessage")??_e,Qe=Pe(e,"onReady")??Qe,"number"==typeof e?.offset&&(de("offset","offsetSize"),X&&(c=Ne(e,"offset")??c),ee&&(u=Ne(e,"offset")??u)),"number"==typeof e?.offsetSize&&(X&&(c=Ne(e,"offsetSize")??c),ee&&(u=Ne(e,"offsetSize")??u)),ye=Re(e,"ignoreSelector")??ye,Le=Re(e,"sizeSelector")??Le,De=Re(e,"targetOrigin")??De,ge=e?.heightCalculationMethod||ge,Ze=e?.widthCalculationMethod||Ze}function t(e,t){return"function"==typeof e&&(ae(`<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===Me)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),ge=t(ge,"height"),Ze=t(Ze,"width"),G(`Set targetOrigin for parent: %c${De}`,h))}(),lt(),function(){try{qe=1===Me||"iframeParentListener"in window.parent}catch(e){}}(),ee===X&&(Q=!0),Me<0?se(`${B(Me+2)}${B(2)}`):f?.codePointAt(0)>4||Me<2&&se(B(3)),f&&""!==f&&"false"!==f?f!==y&&ae(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${f} - Child page: ${y}.\n`):ae("<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"),dt(),ft(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(v,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&ae("<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&&ae("<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"),nt(),Q||ve(),1!==Me&&(Je.parentIframe=Object.freeze({autoResize:e=>(U(e,"boolean","parentIframe.autoResize(enable) enable"),!1===ee&&!1===X?(ne(E),ae(`Auto Resize can not be changed when <b>direction</> is set to '${I}'.`),!1):(!0===e&&!1===p?(p=!0,queueMicrotask((()=>Tt(E,"Auto Resize enabled")))):!1===e&&!0===p&&(p=!1),xt(0,0,"autoResize",JSON.stringify(p)),p)),close(){xt(0,0,"close")},getId:()=>Ce,getOrigin:()=>(ce("getOrigin()","getParentOrigin()"),d),getParentOrigin:()=>d,getPageInfo(e){if("function"==typeof e)return Ge=e,xt(0,0,"pageInfo"),void ue("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Ge=null,xt(0,0,"pageInfoStop")},getParentProps:e=>(U(e,"function","parentIframe.getParentProps(callback) callback"),Ye=e,xt(0,0,"parentInfo"),()=>{Ye=null,xt(0,0,"parentInfoStop")}),getParentProperties(e){ce("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){U(e,"string","parentIframe.moveToAnchor(anchor) anchor"),ze.findTarget(e)},reset(){!function(){const e=ge;ge=a,Ue||(Ue=!0,requestAnimationFrame((()=>{Ue=!1}))),Ct("reset"),ge=e}()},setOffsetSize(e){U(e,"number","parentIframe.setOffsetSize(offset) offset"),c=e,u=e,Tt(T,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){U(e,"number","parentIframe.scrollBy(x, y) x"),U(t,"number","parentIframe.scrollBy(x, y) y"),xt(t,e,"scrollBy")},scrollTo(e,t){U(e,"number","parentIframe.scrollTo(x, y) x"),U(t,"number","parentIframe.scrollTo(x, y) y"),xt(t,e,"scrollTo")},scrollToOffset(e,t){U(e,"number","parentIframe.scrollToOffset(x, y) x"),U(t,"number","parentIframe.scrollToOffset(x, y) y"),xt(t,e,"scrollToOffset")},sendMessage(e,t){t&&U(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),xt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){ge=e,dt()},setWidthCalculationMethod(e){Ze=e,ft()},setTargetOrigin(e){U(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),De=e},resize(e,t){e&&U(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&U(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),Tt(j,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ce("size()","resize()"),this.resize(e,t)}}),Je.parentIFrame=Je.parentIframe),function(){function e(e){xt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){N(window.document,t,e)}!0===Te&&(t("mouseenter"),t("mouseleave"))}(),ze=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);xt(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?xt(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")&&N(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function i(){N(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){r(),i(),a()}return ze.enable&&(1===Me?ae("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===Z&&(Z=`${W}px`),at("margin",(n="margin",(r=Z).includes("-")&&(ie(`Negative CSS value ignored for ${n}`),r=""),r)),at("background",R),at("padding",J),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),Q||function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),function(e){ct({method:e,eventType:"After Print",eventName:"afterprint"}),ct({method:e,eventType:"Before Print",eventName:"beforeprint"}),ct({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const r=t=>{G("Mutations observed:",t);for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},i=16,a=2,s=200;let l=1;function c(e){lt(),ot(e),e.forEach(ht),e.clear()}function u(){const d=performance.now(),f=d-o;if(f>i*l+++a&&f<s)return G("Backed off due to heavy workload on callStack"),setTimeout(u,i*l),void(o=d);l=1,t.forEach(r),t.length=0,e.size>0&&c(e),nt(),et(),n=!1,Tt(A,"Mutation Observed")}function d(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(u))}function f(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[w,v],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return e.observe(t,n),e}f()}(),Be=new ResizeObserver(mt),Be.observe(document.body),pt.add(document.body),ht(document.body),X!==ee&&(xe=(e=>{const t=e.side||$,n=e.onChange||F,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||F,i=(e=!1)=>n(e),a=(e,n)=>0===e||e>n[t],s=(e,t)=>e.toggleAttribute(z,t),l=new IntersectionObserver((function(e){for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,l=e[t],c=a(l,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);s(i,c)}var n;r(i)}),o),c=new WeakSet;return function(e){for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=c.has(t);!n&&e?(l.observe(t),c.add(t)):Y(!n,"Node already observed",t)}}})({onChange:tt,root:document.documentElement,side:X?$:S})),ot(bt(document)()),Ke(L(Qe)),Tt(P,"Init message from host page",void 0,void 0,y),document.title&&""!==document.title&&xt(0,0,"title",document.title)}function Ke(e){"complete"===document.readyState?q(e):N(document,"readystatechange",(()=>Ke(e)))}function et(){const e=document.querySelectorAll(`[${z}]`);Ae=Array.from(e).filter((e=>!e.closest(`[${w}]`))),me=Ae.length>0}function tt(e){et(),(me||e)&&(me?G("Overflowed Elements:",...Ae):G("Overflow removed"),Tt(x,"Overflow updated"))}function nt(){Fe=document.querySelectorAll(`[${v}]`),pe=Fe.length>0}function ot(e){pe||xe(e)}let rt=0;function it(){const n=document.querySelectorAll(`*[${w}]`);fe=n.length>0,fe&&n.length!==rt&&(function(n){const o=1===n.length?"":"s";ie(`%c[${w}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),rt=n.length)}function at(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),G(`Set body ${e}: %c${t}`,h))}function st(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function lt(){st(0,v,Le),st(0,w,ye)}function ct(e){({add(t){function n(){Tt(e.eventName,e.eventType)}i[t]=n,N(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 ut(e,t,n,o){return t!==e&&(e in n||(ie(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&ae(`<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 ${f?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),e}function dt(){ge=ut(ge,a,St,"height")}function ft(){Ze=ut(Ze,l,Et,"width")}function mt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Tt(C,`Element resized <${function(e){switch(!0){case!H(e):return"";case H(e.id):return`${e.nodeName}#${e.id}`;case H(e.name):return`${e.nodeName} (${e.name}`;case H(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}const pt=new WeakSet;function ht(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!pt.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Be.observe(e),pt.add(e))}const t=bt(e)();for(const e of t){if(pt.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Be.observe(e),pt.add(e))}}function gt(e){performance.mark(Se);const t=D(e);let n=0,o=document.documentElement,r=pe?0:document.documentElement.getBoundingClientRect().bottom;const i=pe?Fe:me?Ae:bt(document)();for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return G(`${t} position calculated from:`,o),performance.mark(Ee,{detail:{hasTags:pe,len:i.length,logging:je,Side:t}}),r}const yt=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],bt=e=>()=>{it();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 fe&&t.push(`not([${w}])`,`not([${w}] *)`),e.querySelectorAll(t.join(":"))},vt={height:0,width:0},zt={height:0,width:0},wt=[h,g,h];function $t(e){function t(){return zt[o]=r,vt[o]=s,r}const n=e===St,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 pe:G("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!me&&0===zt[o]&&0===vt[o]:G(`Initial page size values: ${l}`,...wt),c=t();break;case Ue&&r===zt[o]&&s===vt[o]:G(`Size unchanged: ${l}`,...wt),c=Math.max(r,s);break;case 0===r:G(`Page is hidden: ${l}`,...wt),c=s;break;case!me&&r!==zt[o]&&s<=vt[o]:G(`New <html> size: ${l} `,...wt),G(`Previous <html> size: %c${zt[o]}px`,h),c=t();break;case!n:c=e.taggedElement();break;case!me&&r<zt[o]:G(`<html> size decreased: ${l}`,...wt),c=t();break;case s===a||s===i:G(`<html> size equals page size: ${l}`,...wt),c=t();break;case r>s:G(`Page size < <html> size: ${l}`,...wt),c=t();break;case me:G("Found element overflowing <html> "),c=e.taggedElement();break;default:G(`Using <html> size: ${l}`,...wt),c=t()}return G(`Content ${o}: %c${c}px`,h),c+=function(e){const t=e.getOffset();return 0!==t&&G(`Page offsetSize: %c${t}px`,h),t}(e),c}const St={enabled:()=>X,getOffset:()=>c,auto:()=>$t(St),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,b)+parseInt(t.marginBottom,b)},bodyScroll:()=>document.body.scrollHeight,offset:()=>St.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(...yt(St)),min:()=>Math.min(...yt(St)),grow:()=>St.max(),lowestElement:()=>gt($),taggedElement:()=>gt($)},Et={enabled:()=>ee,getOffset:()=>u,auto:()=>$t(Et),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(...yt(Et)),min:()=>Math.min(...yt(Et)),rightMostElement:()=>gt(S),scroll:()=>Math.max(Et.bodyScroll(),Et.documentElementScroll()),taggedElement:()=>gt(S)},Ot=(e,t)=>!(Math.abs(e-t)<=He);function jt(e,t){const n=e[t]();return e.enabled()&&void 0!==m?function(e){const t=m(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 kt=!1;const Mt=L((()=>se(B(4)))),Tt=te(((e,t,n,o,r)=>{if(performance.now(),ne(e),!0!==kt)return p||e in M?void(document.hidden||(kt=!0,requestAnimationFrame((()=>{kt=!1})),function(e,t,n,o,r){const i=n??jt(St,ge),a=o??jt(Et,Ze);switch(X&&Ot(he,i)||ee&&Ot(Ve,a)?O:e){case P:case E:case O:he=i,Ve=a;case T:xt(he,Ve,e,r);break;case C:case x:case A:re();break;default:re(),G("No change in content size detected")}}(e,0,n,o,r))):(G("Resizing disabled"),void K())}));function Ct(e){he=St[ge](),Ve=Et[Ze](),xt(he,Ve,e)}const xt=te((function(e,t,o,r,i){Me<-1||(ne(o),void 0!==i||(i=De),function(){const a=`${Ce}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(qe)try{window.parent.iframeParentListener(s+a)}catch(e){if(1!==Me)throw e;return void Mt()}else We.postMessage(s+a,i);G(`Sending message to parent page via ${qe?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}(),K())})),At=te((function(e){ne("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>xt(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");We=e.source,d=e.origin,Xe(t),le=!1,setTimeout((()=>{be=!1}),128)},reset(){be||Ct("resetPage")},resize(){Tt(k,"Parent window requested size check")},moveToAnchor(){ze.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();Ge?q(Ge,n(e)):o("pageInfo")},parentInfo(){const e=(r=a(),t(n(r)));var r;Ye?q(Ye,e):o("parentInfo")},message(){const e=a();q(_e,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();ne(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||ie(`Unexpected message (${e.data})`)}s===`${e.data}`.slice(0,13)&&function(){if(!1!==le)return l()?(oe(i()),ne(P),void r.init()):void 0;c()}()}));function It(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?ie("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>At({data:e,sameOrigin:!0}))),N(window,"message",At),N(window,"readystatechange",It),It())}()}();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/legacy (child) 5.4.7
|
|
4
|
+
* @module iframe-resizer/legacy (child) 5.4.7 (iife)
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 for non-commercial use only.
|
|
7
7
|
* For commercial use, you must purchase a license from
|
|
@@ -17,5 +17,4 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
!function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0},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.4.7-beta.4",b=10,v="data-iframe-size",z="data-iframe-overflowed",w="data-iframe-ignore",$="bottom",S="right",O="autoResizeEnabled",E=Symbol("sizeChanged"),M="manualResize",k="parentResize",j={[M]:1,[k]:1},T="setOffsetSize",I="resizeObserver",C="overflowObserver",x="mutationObserver",A="none",P="No change in content size detected",R="init",N=(e,t,n,o)=>e.addEventListener(t,n,o||!1),q=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const B=e=>(e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(q[e]),L=(e,...t)=>setTimeout((()=>e(...t)),0),F=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},W=e=>e,D=e=>Math.round(1e3*e)/1e3,H=e=>e.charAt(0).toUpperCase()+e.slice(1),U=e=>""!=`${e}`&&void 0!==e;function V(e){switch(!0){case!U(e):return"";case U(e.id):return`${e.nodeName}#${e.id}`;case U(e.name):return`${e.nodeName} (${e.name}`;case U(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}const Z=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${H(t)}`)};let J=!0;const _=(Q=function(n={}){const c={},u={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function b(){delete h.event,y()}const v=()=>!!p.some((([e])=>e in i))||!!h.expand;function z(){if(0!==p.length){l[v()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?g:""}`,e,t,o);for(const[e,...t]of p)l.assert(e in l,`Unknown console method: ${e}`),e in l&&l[e](...t);l.groupEnd(),b()}else b()}function w(){""===g&&(g=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function $(e,...t){0===p.length&&(w(),queueMicrotask((()=>queueMicrotask(z)))),p.push([e,...t])}function S(e=r,...t){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){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)}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}},Q?.__esModule?Q.default:Q);var Q;const G=_({label:"iframeResizer(child)"});const Y=(X="log",(...e)=>!J||G[X](...e));var X;const K=Y,{assert:ee,debug:te,endAutoGroup:ne,error:oe,errorBoundary:re,event:ie,label:ae,purge:se,warn:le}=G,ce=e=>{return G.warn((t=W,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},ue=ce,de=(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)=>ce(t))),fe=de("Method"),me=de("Method","replaced with"),pe=de("Option"),he=["min-height","min-width","max-height","max-width"],ge=new Set,ye=e=>e.tagName?e.tagName.toLowerCase():"unknown",be=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),ve=(e,t)=>{return(n=be(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function ze({href:e}){ge.has(e)||(Y("Unable to access stylesheet:",e),ge.add(e))}const we=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){ze(n)}return{source:"cross-origin stylesheet",value:be(e,t)}}(e,t),$e=(e,t)=>{const{source:n,value:o}=we(e,t),r=ye(e);ce(`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 Se(){for(const e of[document.documentElement,document.body])for(const t of he)Y(`Checking <${ye(e)}> for blocking CSS: ${t}`),ve(e,t)&&$e(e,t)}const Oe=e=>t=>void 0===t?void 0:e(t),Ee=Oe((e=>"true"===e)),Me=Oe(Number),ke="--ifr-start",je="--ifr-end",Te=[],Ie=new WeakSet,Ce=e=>"object"==typeof e&&Ie.add(e);let xe={},Ae=0;const Pe=setInterval((()=>{if(Te.length<10)return;if(xe.hasTags&&xe.len<25)return;Te.sort();const e=Math.min(Te.reduce(((e,t)=>e+t),0)/Te.length,Te[Math.floor(Te.length/2)]),t=D(e);t>Ae&&(Ae=t,ie("performanceObserver"),Y("Mean time:",D(Te[Math.floor(Te.length/2)])),Y("Median time:",D(Te.reduce(((e,t)=>e+t),0)/Te.length)),Y("Average time:",t),Y("Max time:",D(Math.max(...Te)))),e<=4||(clearInterval(Pe),ce(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${D(e)}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);function Re(e){e.getEntries().forEach((e=>{if(e.name===je){const{duration:t}=performance.measure("--ifr-measure",ke,je);xe=e.detail,Te.push(t),Te.length>100&&Te.shift()}}))}function Ne(){new PerformanceObserver(Re).observe({entryTypes:["mark"]}),Ce(document.documentElement),Ce(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",Ne):Ne());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}.`)}},Be=qe("function"),Le=qe("number"),Fe=qe("string");"undefined"!=typeof window&&function(){const o={height:()=>(le("Custom height calculation function not defined"),jt.auto()),width:()=>(le("Custom width calculation function not defined"),Tt.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},i={},a="auto",s="[iFrameSizer]",l="scroll";let c,u,d,f,m,p,q,U=!0,_="",Q=0,X="",oe="",se=!1,de=!0,he=!1,ge=!0,ye=!1,be=!1,ve=!1,ze=1,we=a,$e="",Oe=!0,Te={},Ie=!0,Ce=!1,xe="",Ae=0,Pe=!1,Re="",Ne=W,qe=[],We="child",De=null,He=!1,Ue="",Ve=[],Ze=window.parent,Je="*",_e=0,Qe=!1,Ge=1,Ye=l,Xe=window,Ke=()=>{le("onMessage function not defined")},et=()=>{},tt=null,nt=null;function ot(e){var t,n,r;!function(e){Re=e[0]??Re,Q=Me(e[1])??Q,he=Ee(e[2])??he,Ce=Ee(e[3])??Ce,U=Ee(e[6])??U,X=e[7]??X,we=e[8]??we,_=e[9]??_,oe=e[10]??oe,_e=Me(e[11])??_e,Te.enable=Ee(e[12])??!1,We=e[13]??We,Ye=e[14]??Ye,Pe=Ee(e[15])??Pe,c=Me(e[16])??c,u=Me(e[17])??u,de=Ee(e[18])??de,xe=e[19]??xe,p=e[20]??p,Ae=Me(e[21])??Ae,Ie=Ee(e[23])??Ie}(e),t={id:Re,enabled:Ce,expand:Ie},G.label(`${t.id}`),G.expand(t.expand),J=t.enabled,Y(`Initialising iframe v${y} ${window.location.href}`),function(){function e(e){Y("Reading data from page:",e),q=Be(e,"onBeforeResize")??q,Ke=Be(e,"onMessage")??Ke,et=Be(e,"onReady")??et,"number"==typeof e?.offset&&(pe("offset","offsetSize"),de&&(c=Le(e,"offset")??c),he&&(u=Le(e,"offset")??u)),"number"==typeof e?.offsetSize&&(de&&(c=Le(e,"offsetSize")??c),he&&(u=Le(e,"offsetSize")??u)),$e=Fe(e,"ignoreSelector")??$e,Ue=Fe(e,"sizeSelector")??Ue,Je=Fe(e,"targetOrigin")??Je,we=e?.heightCalculationMethod||we,Ye=e?.widthCalculationMethod||Ye}function t(e,t){return"function"==typeof e&&(ce(`<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===Ae)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),we=t(we,"height"),Ye=t(Ye,"width"),K(`Set targetOrigin for parent: %c${Je}`,h))}(),mt(),function(){try{He=1===Ae||"iframeParentListener"in window.parent}catch(e){Y("Cross domain iframe detected")}}(),he===de&&(se=!0),Ae<0?ue(`${B(Ae+2)}${B(2)}`):p?.codePointAt(0)>4||Ae<2&&ue(B(3)),p&&""!==p&&"false"!==p?p!==y&&ce(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${p} - Child page: ${y}.\n`):ce("<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"),gt(),yt(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(v,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&ce("<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&&ce("<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"),st(),se||Se(),1!==Ae&&(Xe.parentIframe=Object.freeze({autoResize:e=>(Z(e,"boolean","parentIframe.autoResize(enable) enable"),!1===he&&!1===de?(ie(O),ce(`Auto Resize can not be changed when <b>direction</> is set to '${A}'.`),!1):(!0===e&&!1===U?(U=!0,queueMicrotask((()=>Pt(O,"Auto Resize enabled")))):!1===e&&!0===U&&(U=!1),Nt(0,0,"autoResize",JSON.stringify(U)),U)),close(){Nt(0,0,"close")},getId:()=>Re,getOrigin:()=>(fe("getOrigin()","getParentOrigin()"),d),getParentOrigin:()=>d,getPageInfo(e){if("function"==typeof e)return tt=e,Nt(0,0,"pageInfo"),void me("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");tt=null,Nt(0,0,"pageInfoStop")},getParentProps:e=>(Z(e,"function","parentIframe.getParentProps(callback) callback"),nt=e,Nt(0,0,"parentInfo"),()=>{nt=null,Nt(0,0,"parentInfoStop")}),getParentProperties(e){fe("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){Z(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Te.findTarget(e)},reset(){!function(){const e=we;we=a,Y("Reset trigger event: %cparentIframe.reset",h),Qe?Y("TriggerLock blocked calculation"):(Qe=!0,te("Trigger event lock on"),requestAnimationFrame((()=>{Qe=!1,te("Trigger event lock off")}))),Rt("reset"),we=e}()},setOffsetSize(e){Z(e,"number","parentIframe.setOffsetSize(offset) offset"),c=e,u=e,Pt(T,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){Z(e,"number","parentIframe.scrollBy(x, y) x"),Z(t,"number","parentIframe.scrollBy(x, y) y"),Nt(t,e,"scrollBy")},scrollTo(e,t){Z(e,"number","parentIframe.scrollTo(x, y) x"),Z(t,"number","parentIframe.scrollTo(x, y) y"),Nt(t,e,"scrollTo")},scrollToOffset(e,t){Z(e,"number","parentIframe.scrollToOffset(x, y) x"),Z(t,"number","parentIframe.scrollToOffset(x, y) y"),Nt(t,e,"scrollToOffset")},sendMessage(e,t){t&&Z(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Nt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){we=e,gt()},setWidthCalculationMethod(e){Ye=e,yt()},setTargetOrigin(e){Z(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),Y(`Set targetOrigin: %c${e}`,h),Je=e},resize(e,t){e&&Z(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&Z(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),Pt(M,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){fe("size()","resize()"),this.resize(e,t)}}),Xe.parentIFrame=Xe.parentIframe),function(){function e(e){Nt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){Y(`Add event listener: %c${n}`,h),N(window.document,t,e)}!0===Pe&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),Te=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);Y(`Moving to in page link (%c#${o}%c) at x: %c${n.x}%c y: %c${n.y}`,h,g,h,g,h),Nt(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?(Y(`In page link (#${o}) not found in iFrame, so sending to parent`),Nt(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")&&N(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function i(){N(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){Y("Setting up location.hash handlers"),r(),i(),a()}return Te.enable?1===Ae?ce("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):s():Y("In page linking not enabled"),{findTarget:n}}(),void 0===X&&(X=`${Q}px`),dt("margin",(n="margin",(r=X).includes("-")&&(le(`Negative CSS value ignored for ${n}`),r=""),r)),dt("background",_),dt("padding",oe),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),se||function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),Y("Set HTML & body height: %cauto !important",h)}(),!0!==U&&Y("Auto Resize disabled"),function(e){pt({method:e,eventType:"After Print",eventName:"afterprint"}),pt({method:e,eventType:"Before Print",eventName:"beforeprint"}),pt({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const r=t=>{K("Mutations observed:",t);for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},i=16,a=2,s=200;let l=1;function c(e){mt(),lt(e),e.forEach(zt),e.clear()}function u(){const d=performance.now(),f=d-o,m=i*l+++a;if(f>m&&f<s)return K("Backed off due to heavy workload on callStack"),Y(`Delay: %c${D(f)}ms %c> Delay limit: %c${m}ms`,h,g,h),setTimeout(u,i*l),void(o=d);l=1,t.forEach(r),t.length=0,e.size>0&&c(e),st(),it(),n=!1,Pt(x,"Mutation Observed")}function d(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(u))}function f(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[w,v],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return Y("Setup <body> MutationObserver"),e.observe(t,n),e}f()}(),Y("Setup ResizeObserver"),De=new ResizeObserver(bt),De.observe(document.body),vt.add(document.body),zt(document.body),de!==he&&(Y("Setup OverflowObserver"),Ne=(e=>{const t=e.side||$,n=e.onChange||W,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||W,i=(e=!1)=>n(e),a=(e,n)=>0===e||e>n[t],s=(e,t)=>e.toggleAttribute(z,t),l=new IntersectionObserver((function(e){for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,l=e[t],c=a(l,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);s(i,c)}var n;r(i)}),o),c=new WeakSet;return function(e){Y("Attached overflowObservers");for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=c.has(t);!n&&e?(l.observe(t),c.add(t)):ee(!n,"Node already observed",t)}}})({onChange:at,root:document.documentElement,side:de?$:S})),lt(St(document)()),rt(F(et)),Y("Initialization complete"),Pt(R,"Init message from host page",void 0,void 0,y),document.title&&""!==document.title&&Nt(0,0,"title",document.title)}function rt(e){"complete"===document.readyState?L(e):N(document,"readystatechange",(()=>rt(e)))}function it(){const e=document.querySelectorAll(`[${z}]`);qe=Array.from(e).filter((e=>!e.closest(`[${w}]`))),be=qe.length>0}function at(e){it(),(be||e)&&(be?K("Overflowed Elements:",...qe):K("Overflow removed"),Pt(C,"Overflow updated"))}function st(){Ve=document.querySelectorAll(`[${v}]`),ve=Ve.length>0,Y(`Tagged elements found: %c${ve}`,h)}function lt(e){ve||Ne(e)}let ct=0;function ut(){const n=document.querySelectorAll(`*[${w}]`);ye=n.length>0,ye&&n.length!==ct&&(function(n){const o=1===n.length?"":"s";le(`%c[${w}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),ct=n.length)}function dt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),K(`Set body ${e}: %c${t}`,h))}function ft(e,t,n){if(""!==n){Y(`${e}: %c${n}`,h);for(const e of document.querySelectorAll(n))Y(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function mt(){ft("sizeSelector",v,Ue),ft("ignoreSelector",w,$e)}function pt(e){({add(t){function n(){Pt(e.eventName,e.eventType)}i[t]=n,N(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),Y(`${H(e.method)} event listener: %c${e.eventType}`,h)}function ht(e,t,n,o){return t!==e&&(e in n||(le(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&ce(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you ${p?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),Y(`Set ${o} calculation method: %c${e}`,h),e}function gt(){we=ht(we,a,jt,"height")}function yt(){Ye=ht(Ye,l,Tt,"width")}function bt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Pt(I,`Element resized <${V(t)}>`)}const vt=new WeakSet;function zt(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!vt.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(De.observe(e),vt.add(e),Y(`Attached resizeObserver: %c${V(e)}`,h))}const t=St(e)();for(const e of t){if(vt.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(De.observe(e),vt.add(e),Y(`Attached resizeObserver: %c${V(e)}`,h))}}function wt(e){performance.mark(ke);const t=H(e);let n=0,o=document.documentElement,r=ve?0:document.documentElement.getBoundingClientRect().bottom;const i=ve?Ve:be?qe:St(document)();for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return K(`${t} position calculated from:`,o),performance.mark(je,{detail:{hasTags:ve,len:i.length,logging:Ce,Side:t}}),r}const $t=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],St=e=>()=>{ut();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 ye&&t.push(`not([${w}])`,`not([${w}] *)`),e.querySelectorAll(t.join(":"))},Ot={height:0,width:0},Et={height:0,width:0},Mt=[h,g,h];function kt(e){function t(){return Et[o]=r,Ot[o]=s,r}const n=e===jt,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 ve:K("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!be&&0===Et[o]&&0===Ot[o]:K(`Initial page size values: ${l}`,...Mt),c=t();break;case Qe&&r===Et[o]&&s===Ot[o]:K(`Size unchanged: ${l}`,...Mt),c=Math.max(r,s);break;case 0===r:K(`Page is hidden: ${l}`,...Mt),c=s;break;case!be&&r!==Et[o]&&s<=Ot[o]:K(`New <html> size: ${l} `,...Mt),K(`Previous <html> size: %c${Et[o]}px`,h),c=t();break;case!n:c=e.taggedElement();break;case!be&&r<Et[o]:K(`<html> size decreased: ${l}`,...Mt),c=t();break;case s===a||s===i:K(`<html> size equals page size: ${l}`,...Mt),c=t();break;case r>s:K(`Page size < <html> size: ${l}`,...Mt),c=t();break;case be:K("Found element overflowing <html> "),c=e.taggedElement();break;default:K(`Using <html> size: ${l}`,...Mt),c=t()}return K(`Content ${o}: %c${c}px`,h),c+=function(e){const t=e.getOffset();return 0!==t&&K(`Page offsetSize: %c${t}px`,h),t}(e),c}const jt={enabled:()=>de,getOffset:()=>c,auto:()=>kt(jt),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,b)+parseInt(t.marginBottom,b)},bodyScroll:()=>document.body.scrollHeight,offset:()=>jt.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(...$t(jt)),min:()=>Math.min(...$t(jt)),grow:()=>jt.max(),lowestElement:()=>wt($),taggedElement:()=>wt($)},Tt={enabled:()=>he,getOffset:()=>u,auto:()=>kt(Tt),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(...$t(Tt)),min:()=>Math.min(...$t(Tt)),rightMostElement:()=>wt(S),scroll:()=>Math.max(Tt.bodyScroll(),Tt.documentElementScroll()),taggedElement:()=>wt(S)},It=(e,t)=>!(Math.abs(e-t)<=_e);function Ct(e,t){const n=e[t]();return e.enabled()&&void 0!==q?function(e){const t=q(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 xt=!1;const At=F((()=>ue(B(4)))),Pt=re(((e,t,n,o,r)=>{if(m=performance.now(),f=!0,ie(e),!0!==xt)return U||e in j?void(document.hidden?Y("Page hidden - Ignored resize request"):(xt=!0,requestAnimationFrame((()=>{xt=!1})),function(e,t,n,o,r){const i=n??Ct(jt,we),a=o??Ct(Tt,Ye),s=de&&It(ze,i)||he&&It(Ge,a)?E:e;switch(Y(`Resize event: %c${t}`,h),s){case R:case O:case E:ze=i,Ge=a;case T:Nt(ze,Ge,e,r);break;case I:case C:case x:Y(P);break;default:K(P)}f=!1}(e,t,n,o,r))):(K("Resizing disabled"),void ne())}));function Rt(e){ze=jt[we](),Ge=Tt[Ye](),Nt(ze,Ge,e)}const Nt=re((function(e,t,o,r,i){Ae<-1||(ie(o),void 0!==i?Y(`Message targetOrigin: %c${i}`,h):i=Je,function(){const a=`${Re}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(He)try{window.parent.iframeParentListener(s+a)}catch(e){if(1!==Ae)throw e;return void At()}else Ze.postMessage(s+a,i);f&&Y(function(){const e=D(performance.now()-m);return o===R?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),h),K(`Sending message to parent page via ${He?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}(),ne())})),qt=re((function(e){ie("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>t(n(e)),r=e=>Nt(0,0,`${e}Stop`),i={init:function(){if("loading"===document.readyState)return void Y("Page not ready, ignoring init message");const t=e.data.slice(13).split(":");Ze=e.source,d=e.origin,ot(t),ge=!1,setTimeout((()=>{Oe=!1}),128)},reset(){Oe?Y("Page reset ignored by init"):(Y("Page size reset by host page"),Rt("resetPage"))},resize(){Y("Resize requested by host page"),Pt(k,"Parent window requested size check")},moveToAnchor(){Te.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();Y("PageInfo received from parent:",o(e)),tt?L(tt,n(e)):r("pageInfo")},parentInfo(){const e=o(l());Y("ParentInfo received from parent:",e),nt?L(nt,e):r("parentInfo")},message(){const e=l();Y("onMessage called from parent:%c",h,o(e)),L(Ke,n(e))}},a=()=>e.data.split("]")[1].split(":")[0],l=()=>e.data.slice(e.data.indexOf(":")+1),c=()=>e.data.split(":")[2]in{true:1,false:1};function u(){const t=a();ie(t),t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||c()||le(`Unexpected message (${e.data})`)}s===`${e.data}`.slice(0,13)&&function(){if(!1!==ge)return c()?(ae(a()),ie(R),void i.init()):void Y(`Ignored message of type "${a()}". Received before initialization.`);u()}()}));function Bt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?le("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>qt({data:e,sameOrigin:!0}))),N(window,"message",qt),N(window,"readystatechange",Bt),Bt())}()}();
|
|
21
|
-
//# sourceMappingURL=iframeResizer.contentWindow.min.js.map
|
|
20
|
+
!function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0},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.4.7",b=10,v="data-iframe-size",z="data-iframe-overflowed",w="data-iframe-ignore",$="bottom",S="right",E="autoResizeEnabled",O=Symbol("sizeChanged"),j="manualResize",k="parentResize",M={[j]:1,[k]:1},T="setOffsetSize",C="resizeObserver",x="overflowObserver",A="mutationObserver",I="none",P="init",N=(e,t,n,o)=>e.addEventListener(t,n,o||!1),R=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const B=e=>(e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(R[e]),q=(e,...t)=>setTimeout((()=>e(...t)),0),L=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},F=e=>e,W=e=>Math.round(1e3*e)/1e3,D=e=>e.charAt(0).toUpperCase()+e.slice(1),H=e=>""!=`${e}`&&void 0!==e;const U=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${D(t)}`)};let V=!0;const Z=(J=function(n={}){const c={},u={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function b(){delete h.event,y()}const v=()=>!!p.some((([e])=>e in i))||!!h.expand;function z(){if(0!==p.length){l[v()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?g:""}`,e,t,o);for(const[e,...t]of p)l.assert(e in l,`Unknown console method: ${e}`),e in l&&l[e](...t);l.groupEnd(),b()}else b()}function w(){""===g&&(g=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function $(e,...t){0===p.length&&(w(),queueMicrotask((()=>queueMicrotask(z)))),p.push([e,...t])}function S(e=r,...t){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){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)}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}},J?.__esModule?J.default:J);var J;const _=Z({label:"iframeResizer(child)"});var Q;const G=(Q="log",(...e)=>!V||_[Q](...e)),{assert:Y,debug:X,endAutoGroup:K,error:ee,errorBoundary:te,event:ne,label:oe,purge:re,warn:ie}=_,ae=e=>{return _.warn((t=F,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},se=ae,le=(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)=>ae(t))),ce=le("Method"),ue=le("Method","replaced with"),de=le("Option"),fe=["min-height","min-width","max-height","max-width"],me=new Set,pe=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),he=(e,t)=>{return(n=pe(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function ge({href:e}){me.has(e)||me.add(e)}const ye=(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){ge(n)}return{source:"cross-origin stylesheet",value:pe(e,t)}}(e,t),be=(e,t)=>{const{source:n,value:o}=ye(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);ae(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function ve(){for(const e of[document.documentElement,document.body])for(const t of fe)he(e,t)&&be(e,t)}const ze=e=>t=>void 0===t?void 0:e(t),we=ze((e=>"true"===e)),$e=ze(Number),Se="--ifr-start",Ee="--ifr-end",Oe=[],je=new WeakSet,ke=e=>"object"==typeof e&&je.add(e);let Me={},Te=0;const Ce=setInterval((()=>{if(Oe.length<10)return;if(Me.hasTags&&Me.len<25)return;Oe.sort();const e=Math.min(Oe.reduce(((e,t)=>e+t),0)/Oe.length,Oe[Math.floor(Oe.length/2)]),t=W(e);t>Te&&(Te=t,ne("performanceObserver")),e<=4||(clearInterval(Ce),ae(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${W(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${Me.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function xe(e){e.getEntries().forEach((e=>{if(e.name===Ee){const{duration:t}=performance.measure("--ifr-measure",Se,Ee);Me=e.detail,Oe.push(t),Oe.length>100&&Oe.shift()}}))}function Ae(){new PerformanceObserver(xe).observe({entryTypes:["mark"]}),ke(document.documentElement),ke(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",Ae):Ae());const Ie=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Pe=Ie("function"),Ne=Ie("number"),Re=Ie("string");"undefined"!=typeof window&&function(){const o={height:()=>(ie("Custom height calculation function not defined"),St.auto()),width:()=>(ie("Custom width calculation function not defined"),Et.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},i={},a="auto",s="[iFrameSizer]",l="scroll";let c,u,d,f,m,p=!0,R="",W=0,Z="",J="",Q=!1,X=!0,ee=!1,le=!0,fe=!1,me=!1,pe=!1,he=1,ge=a,ye="",be=!0,ze={},Oe=!0,je=!1,ke="",Me=0,Te=!1,Ce="",xe=F,Ae=[],Ie="child",Be=null,qe=!1,Le="",Fe=[],We=window.parent,De="*",He=0,Ue=!1,Ve=1,Ze=l,Je=window,_e=()=>{ie("onMessage function not defined")},Qe=()=>{},Ge=null,Ye=null;function Xe(e){var t,n,r;!function(e){Ce=e[0]??Ce,W=$e(e[1])??W,ee=we(e[2])??ee,je=we(e[3])??je,p=we(e[6])??p,Z=e[7]??Z,ge=e[8]??ge,R=e[9]??R,J=e[10]??J,He=$e(e[11])??He,ze.enable=we(e[12])??!1,Ie=e[13]??Ie,Ze=e[14]??Ze,Te=we(e[15])??Te,c=$e(e[16])??c,u=$e(e[17])??u,X=we(e[18])??X,ke=e[19]??ke,f=e[20]??f,Me=$e(e[21])??Me,Oe=we(e[23])??Oe}(e),t={id:Ce,enabled:je,expand:Oe},_.label(`${t.id}`),_.expand(t.expand),V=t.enabled,function(){function e(e){m=Pe(e,"onBeforeResize")??m,_e=Pe(e,"onMessage")??_e,Qe=Pe(e,"onReady")??Qe,"number"==typeof e?.offset&&(de("offset","offsetSize"),X&&(c=Ne(e,"offset")??c),ee&&(u=Ne(e,"offset")??u)),"number"==typeof e?.offsetSize&&(X&&(c=Ne(e,"offsetSize")??c),ee&&(u=Ne(e,"offsetSize")??u)),ye=Re(e,"ignoreSelector")??ye,Le=Re(e,"sizeSelector")??Le,De=Re(e,"targetOrigin")??De,ge=e?.heightCalculationMethod||ge,Ze=e?.widthCalculationMethod||Ze}function t(e,t){return"function"==typeof e&&(ae(`<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===Me)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),ge=t(ge,"height"),Ze=t(Ze,"width"),G(`Set targetOrigin for parent: %c${De}`,h))}(),lt(),function(){try{qe=1===Me||"iframeParentListener"in window.parent}catch(e){}}(),ee===X&&(Q=!0),Me<0?se(`${B(Me+2)}${B(2)}`):f?.codePointAt(0)>4||Me<2&&se(B(3)),f&&""!==f&&"false"!==f?f!==y&&ae(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${f} - Child page: ${y}.\n`):ae("<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"),dt(),ft(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(v,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&ae("<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&&ae("<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"),nt(),Q||ve(),1!==Me&&(Je.parentIframe=Object.freeze({autoResize:e=>(U(e,"boolean","parentIframe.autoResize(enable) enable"),!1===ee&&!1===X?(ne(E),ae(`Auto Resize can not be changed when <b>direction</> is set to '${I}'.`),!1):(!0===e&&!1===p?(p=!0,queueMicrotask((()=>Tt(E,"Auto Resize enabled")))):!1===e&&!0===p&&(p=!1),xt(0,0,"autoResize",JSON.stringify(p)),p)),close(){xt(0,0,"close")},getId:()=>Ce,getOrigin:()=>(ce("getOrigin()","getParentOrigin()"),d),getParentOrigin:()=>d,getPageInfo(e){if("function"==typeof e)return Ge=e,xt(0,0,"pageInfo"),void ue("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Ge=null,xt(0,0,"pageInfoStop")},getParentProps:e=>(U(e,"function","parentIframe.getParentProps(callback) callback"),Ye=e,xt(0,0,"parentInfo"),()=>{Ye=null,xt(0,0,"parentInfoStop")}),getParentProperties(e){ce("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){U(e,"string","parentIframe.moveToAnchor(anchor) anchor"),ze.findTarget(e)},reset(){!function(){const e=ge;ge=a,Ue||(Ue=!0,requestAnimationFrame((()=>{Ue=!1}))),Ct("reset"),ge=e}()},setOffsetSize(e){U(e,"number","parentIframe.setOffsetSize(offset) offset"),c=e,u=e,Tt(T,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){U(e,"number","parentIframe.scrollBy(x, y) x"),U(t,"number","parentIframe.scrollBy(x, y) y"),xt(t,e,"scrollBy")},scrollTo(e,t){U(e,"number","parentIframe.scrollTo(x, y) x"),U(t,"number","parentIframe.scrollTo(x, y) y"),xt(t,e,"scrollTo")},scrollToOffset(e,t){U(e,"number","parentIframe.scrollToOffset(x, y) x"),U(t,"number","parentIframe.scrollToOffset(x, y) y"),xt(t,e,"scrollToOffset")},sendMessage(e,t){t&&U(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),xt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){ge=e,dt()},setWidthCalculationMethod(e){Ze=e,ft()},setTargetOrigin(e){U(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),De=e},resize(e,t){e&&U(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&U(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),Tt(j,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ce("size()","resize()"),this.resize(e,t)}}),Je.parentIFrame=Je.parentIframe),function(){function e(e){xt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){N(window.document,t,e)}!0===Te&&(t("mouseenter"),t("mouseleave"))}(),ze=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);xt(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?xt(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")&&N(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function i(){N(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){r(),i(),a()}return ze.enable&&(1===Me?ae("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===Z&&(Z=`${W}px`),at("margin",(n="margin",(r=Z).includes("-")&&(ie(`Negative CSS value ignored for ${n}`),r=""),r)),at("background",R),at("padding",J),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),Q||function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),function(e){ct({method:e,eventType:"After Print",eventName:"afterprint"}),ct({method:e,eventType:"Before Print",eventName:"beforeprint"}),ct({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const r=t=>{G("Mutations observed:",t);for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},i=16,a=2,s=200;let l=1;function c(e){lt(),ot(e),e.forEach(ht),e.clear()}function u(){const d=performance.now(),f=d-o;if(f>i*l+++a&&f<s)return G("Backed off due to heavy workload on callStack"),setTimeout(u,i*l),void(o=d);l=1,t.forEach(r),t.length=0,e.size>0&&c(e),nt(),et(),n=!1,Tt(A,"Mutation Observed")}function d(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(u))}function f(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[w,v],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return e.observe(t,n),e}f()}(),Be=new ResizeObserver(mt),Be.observe(document.body),pt.add(document.body),ht(document.body),X!==ee&&(xe=(e=>{const t=e.side||$,n=e.onChange||F,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||F,i=(e=!1)=>n(e),a=(e,n)=>0===e||e>n[t],s=(e,t)=>e.toggleAttribute(z,t),l=new IntersectionObserver((function(e){for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,l=e[t],c=a(l,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);s(i,c)}var n;r(i)}),o),c=new WeakSet;return function(e){for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=c.has(t);!n&&e?(l.observe(t),c.add(t)):Y(!n,"Node already observed",t)}}})({onChange:tt,root:document.documentElement,side:X?$:S})),ot(bt(document)()),Ke(L(Qe)),Tt(P,"Init message from host page",void 0,void 0,y),document.title&&""!==document.title&&xt(0,0,"title",document.title)}function Ke(e){"complete"===document.readyState?q(e):N(document,"readystatechange",(()=>Ke(e)))}function et(){const e=document.querySelectorAll(`[${z}]`);Ae=Array.from(e).filter((e=>!e.closest(`[${w}]`))),me=Ae.length>0}function tt(e){et(),(me||e)&&(me?G("Overflowed Elements:",...Ae):G("Overflow removed"),Tt(x,"Overflow updated"))}function nt(){Fe=document.querySelectorAll(`[${v}]`),pe=Fe.length>0}function ot(e){pe||xe(e)}let rt=0;function it(){const n=document.querySelectorAll(`*[${w}]`);fe=n.length>0,fe&&n.length!==rt&&(function(n){const o=1===n.length?"":"s";ie(`%c[${w}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),rt=n.length)}function at(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),G(`Set body ${e}: %c${t}`,h))}function st(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function lt(){st(0,v,Le),st(0,w,ye)}function ct(e){({add(t){function n(){Tt(e.eventName,e.eventType)}i[t]=n,N(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 ut(e,t,n,o){return t!==e&&(e in n||(ie(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&ae(`<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 ${f?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),e}function dt(){ge=ut(ge,a,St,"height")}function ft(){Ze=ut(Ze,l,Et,"width")}function mt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Tt(C,`Element resized <${function(e){switch(!0){case!H(e):return"";case H(e.id):return`${e.nodeName}#${e.id}`;case H(e.name):return`${e.nodeName} (${e.name}`;case H(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}const pt=new WeakSet;function ht(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!pt.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Be.observe(e),pt.add(e))}const t=bt(e)();for(const e of t){if(pt.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Be.observe(e),pt.add(e))}}function gt(e){performance.mark(Se);const t=D(e);let n=0,o=document.documentElement,r=pe?0:document.documentElement.getBoundingClientRect().bottom;const i=pe?Fe:me?Ae:bt(document)();for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return G(`${t} position calculated from:`,o),performance.mark(Ee,{detail:{hasTags:pe,len:i.length,logging:je,Side:t}}),r}const yt=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],bt=e=>()=>{it();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 fe&&t.push(`not([${w}])`,`not([${w}] *)`),e.querySelectorAll(t.join(":"))},vt={height:0,width:0},zt={height:0,width:0},wt=[h,g,h];function $t(e){function t(){return zt[o]=r,vt[o]=s,r}const n=e===St,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 pe:G("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!me&&0===zt[o]&&0===vt[o]:G(`Initial page size values: ${l}`,...wt),c=t();break;case Ue&&r===zt[o]&&s===vt[o]:G(`Size unchanged: ${l}`,...wt),c=Math.max(r,s);break;case 0===r:G(`Page is hidden: ${l}`,...wt),c=s;break;case!me&&r!==zt[o]&&s<=vt[o]:G(`New <html> size: ${l} `,...wt),G(`Previous <html> size: %c${zt[o]}px`,h),c=t();break;case!n:c=e.taggedElement();break;case!me&&r<zt[o]:G(`<html> size decreased: ${l}`,...wt),c=t();break;case s===a||s===i:G(`<html> size equals page size: ${l}`,...wt),c=t();break;case r>s:G(`Page size < <html> size: ${l}`,...wt),c=t();break;case me:G("Found element overflowing <html> "),c=e.taggedElement();break;default:G(`Using <html> size: ${l}`,...wt),c=t()}return G(`Content ${o}: %c${c}px`,h),c+=function(e){const t=e.getOffset();return 0!==t&&G(`Page offsetSize: %c${t}px`,h),t}(e),c}const St={enabled:()=>X,getOffset:()=>c,auto:()=>$t(St),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,b)+parseInt(t.marginBottom,b)},bodyScroll:()=>document.body.scrollHeight,offset:()=>St.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(...yt(St)),min:()=>Math.min(...yt(St)),grow:()=>St.max(),lowestElement:()=>gt($),taggedElement:()=>gt($)},Et={enabled:()=>ee,getOffset:()=>u,auto:()=>$t(Et),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(...yt(Et)),min:()=>Math.min(...yt(Et)),rightMostElement:()=>gt(S),scroll:()=>Math.max(Et.bodyScroll(),Et.documentElementScroll()),taggedElement:()=>gt(S)},Ot=(e,t)=>!(Math.abs(e-t)<=He);function jt(e,t){const n=e[t]();return e.enabled()&&void 0!==m?function(e){const t=m(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 kt=!1;const Mt=L((()=>se(B(4)))),Tt=te(((e,t,n,o,r)=>{if(performance.now(),ne(e),!0!==kt)return p||e in M?void(document.hidden||(kt=!0,requestAnimationFrame((()=>{kt=!1})),function(e,t,n,o,r){const i=n??jt(St,ge),a=o??jt(Et,Ze);switch(X&&Ot(he,i)||ee&&Ot(Ve,a)?O:e){case P:case E:case O:he=i,Ve=a;case T:xt(he,Ve,e,r);break;case C:case x:case A:re();break;default:re(),G("No change in content size detected")}}(e,0,n,o,r))):(G("Resizing disabled"),void K())}));function Ct(e){he=St[ge](),Ve=Et[Ze](),xt(he,Ve,e)}const xt=te((function(e,t,o,r,i){Me<-1||(ne(o),void 0!==i||(i=De),function(){const a=`${Ce}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(qe)try{window.parent.iframeParentListener(s+a)}catch(e){if(1!==Me)throw e;return void Mt()}else We.postMessage(s+a,i);G(`Sending message to parent page via ${qe?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}(),K())})),At=te((function(e){ne("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>xt(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");We=e.source,d=e.origin,Xe(t),le=!1,setTimeout((()=>{be=!1}),128)},reset(){be||Ct("resetPage")},resize(){Tt(k,"Parent window requested size check")},moveToAnchor(){ze.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();Ge?q(Ge,n(e)):o("pageInfo")},parentInfo(){const e=(r=a(),t(n(r)));var r;Ye?q(Ye,e):o("parentInfo")},message(){const e=a();q(_e,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();ne(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||ie(`Unexpected message (${e.data})`)}s===`${e.data}`.slice(0,13)&&function(){if(!1!==le)return l()?(oe(i()),ne(P),void r.init()):void 0;c()}()}));function It(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?ie("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>At({data:e,sameOrigin:!0}))),N(window,"message",At),N(window,"readystatechange",It),It())}()}();
|
package/js/iframeResizer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/legacy (parent) 5.4.7
|
|
4
|
+
* @module iframe-resizer/legacy (parent) 5.4.7 (umd) - 2025-07-08
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 for non-commercial use only.
|
|
7
7
|
* For commercial use, you must purchase a license from
|
|
@@ -17,5 +17,4 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,(function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="font-weight: normal;",t=e+"font-style: italic;",n="default",o=Object.freeze({assert:!0,error:!0,warn:!0}),i={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},a=Object.assign(console);const{fromEntries:s,keys:l}=Object,c=e=>[e,a[e]],d=e=>t=>[t,function(n){e[t]=n}],u=(e,t)=>s(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",h=f?"color: #E3E3E3;":"color: #1F1F1F;",m="5.4.7-beta.4",g="iframeResizer",y="none",w="vertical",b="horizontal",v="[iFrameSizer]",z=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),$="onload",j="init",k=Object.freeze({[$]:1,[j]:1}),T="expanded",x="collapsed",M=Object.freeze({[T]:1,[x]:1}),E=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),R=e=>e,O=(I=function(s={}){const l={},f={},p=[],h={...i,expand:!s.collapsed||i.expanded,...s};let m="";function g(){p.length=0,m=""}function y(){delete h.event,g()}const w=()=>!!p.some((([e])=>e in o))||!!h.expand;function b(){if(0!==p.length){a[w()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?m:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)a.assert(e in a,`Unknown console method: ${e}`),e in a&&a[e](...t);a.groupEnd(),y()}else y()}function v(){""===m&&(m=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 z(e,...t){0===p.length&&(v(),queueMicrotask((()=>queueMicrotask(b)))),p.push([e,...t])}function $(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...u(h,d(h)),...u(console,(e=>[e,(...t)=>z(e,...t)])),...u(r,c),assert:function(e,...t){e||z("assert",e,...t)},count:function(e=n){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=n){delete f[e]},endAutoGroup:b,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e)}return n},event:function(e){v(),h.event=e},purge:g,time:function(e=n){v(),l[e]=performance.now()},timeEnd:function(e=n){$(e),delete l[e]},timeLog:$,touch:v}},I?.__esModule?I.default:I);var I;let S={},C=!1;const A=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const W=e=>(t,...n)=>S[t]?.console[e](...n),F=(L="log",(e,...t)=>!0===(e=>S[e]?S[e].log:C)(e)?W(L)(e,...t):null);var L;const N=F,P=W("warn"),H=W("error"),B=W("event"),q=W("purge"),D=W("errorBoundary");const U=(e,...t)=>S[e]?S[e].console.warn(E(R)(...t)):queueMicrotask((()=>console?.warn(E((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t)))),J=(e=>(t,n="renamed to")=>(o,i,r="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(U),V=J("Function"),Z=J("Option"),G=(e,t,n,o)=>e.addEventListener(t,n,o||!1),X=(e,t,n)=>e.removeEventListener(t,n,!1),Y=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,i=0;i<e.length;i++)o=e.codePointAt(i),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))),Q=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<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."],K=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],ee=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),te=e=>_(Q[e]),ne=e=>{const t=e[_("spjluzl")];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=Y(_(e));return n in ee&&(t=ee[n]),t}(n[0]);return 0===o||(e=>e[2]===Y(e[0]+e[1]))(n)||(o=-2),o},oe={},ie=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:w,inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof oe[e.id].onInit&&(Z("init()","onReady()","",e.id),oe[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),re={position:null,version:m};function ae(e){function t(){he(T),fe(x),$("onResized",T)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function o(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const i=e=>k.slice(k.indexOf(":")+7+e);const r=(e,t)=>(n,o)=>{const i={};var r,a;r=function(){ge(`${n} (${e})`,`${e}:${t()}`,o)},i[a=o]||(r(),i[a]=requestAnimationFrame((()=>{i[a]=null})))},a=(e,t)=>()=>{let n=!1;const o=t=>()=>{oe[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame((()=>{n=!1}))):s()},i=o("scroll"),r=o("resize window");function a(e,n){F(l,`${e}listeners for send${t}`),n(window,"scroll",i),n(window,"resize",r)}function s(){B(l,`stop${t}`),a("Remove ",X),c.disconnect(),d.disconnect(),X(oe[l].iframe,"load",s)}const l=x,c=new ResizeObserver(o("pageObserver")),d=new ResizeObserver(o("iframeObserver"));oe[l]&&(oe[l][`stop${t}`]=s,G(oe[l].iframe,"load",s),a("Add ",G),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(oe[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},s=e=>()=>{e in oe[x]&&(oe[x][e](),delete oe[x][e])},l=r("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=T.iframe.getBoundingClientRect(),{scrollY:n,scrollX:o,innerHeight:i,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,i||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:o,documentHeight:a,documentWidth:s,windowHeight:i,windowWidth:r})})),c=r("parentInfo",(function(){const{iframe:e}=T,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),d=a(l,"PageInfo"),u=a(c,"ParentInfo"),f=s("stopPageInfo"),g=s("stopParentInfo");function y(e){const t=e.getBoundingClientRect();return de(x),{x:Number(t.left)+Number(re.position.x),y:Number(t.top)+Number(re.position.y)}}function w(e){const t=e?y(T.iframe):{x:0,y:0};N(x,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,h,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(T,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(o,n):function(e){re.position=e,b(x)}(n)}function b(e){const{x:t,y:n}=re.position,o=oe[e]?.iframe;!1!==$("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?fe(e):ue()}function z(e){let t={};if(0===T.width&&0===T.height){const e=i(9).split(":");t={x:e[1],y:e[0]}}else t={x:T.width,y:T.height};$(e,{iframe:T.iframe,screenX:Number(t.x),screenY:Number(t.y),type:T.type})}const $=(e,t)=>se(x,e,t);function j(){const{height:e,iframe:n,msg:o,type:r,width:a}=T;switch(oe[x]?.firstRun&&oe[x]&&(oe[x].firstRun=!1),r){case"close":ce(n);break;case"message":l=i(6),F(x,`onMessage passed: {iframe: %c${T.iframe.id}%c, message: %c${l}%c}`,p,h,p,h),$("onMessage",{iframe:T.iframe,message:JSON.parse(l)});break;case"mouseenter":z("onMouseEnter");break;case"mouseleave":z("onMouseLeave");break;case"autoResize":oe[x].autoResize=JSON.parse(i(9));break;case"scrollBy":!function(){const e=T.width,t=T.height,n=window.parentIframe||window.parentIFrame||window;N(x,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),n.scrollBy(e,t)}();break;case"scrollTo":w(!1);break;case"scrollToOffset":w(!0);break;case"pageInfo":d();break;case"parentInfo":u();break;case"pageInfoStop":f();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let o=document.getElementById(n)||document.getElementsByName(n)[0];o?function(){const e=y(o);N(x,`Moving to in page link: %c#${t}`,p),re.position={x:e.x,y:e.y},b(x),window.location.hash=t}():window.top!==window.self?function(){const e=window.parentIframe||window.parentIFrame;e?e.moveToAnchor(t):F(x,`In page link #${t} not found and window.parentIframe not found`)}():F(x,`In page link #${t} not found`)}(i(9));break;case"title":!function(e,t){oe[t]?.syncTitle&&(oe[t].iframe.title=e,N(t,`Set iframe title attribute: %c${e}`,p))}(o,x);break;case"reset":pe(T);break;case"init":t(),function(e){try{oe[e].sameOrigin=!!oe[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){oe[e].sameOrigin=!1}F(e,`sameOrigin: %c${oe[e].sameOrigin}`,p)}(x),(s=o)!==m&&(void 0!==s?F(x,`Version mismatch (Child: %c${s}%c !== Parent: %c${m})`,p,h,p):U(x,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),be=!0,$("onReady",n);break;default:if(0===a&&0===e)return void P(x,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===a||0===e)return void F(x,"Ignoring message with 0 height or width");if(document.hidden)return void F(x,"Page hidden - ignored resize request");t()}var s,l}let k=e.data,T={},x=null;"[iFrameResizerChild]Ready"!==k?v===`${k}`.slice(0,13)&&k.slice(13).split(":")[0]in oe?(T=function(){const e=k.slice(13).split(":"),t=e[1]?Number(e[1]):0,i=oe[e[0]]?.iframe,r=getComputedStyle(i);return{iframe:i,id:e[0],height:t+n(r)+o(r),width:Number(e[2]),type:e[3],msg:e[4]}}(),x=T.id,x?(B(x,T.type),D(x,(function(){!function(e){if(!oe[e])throw new Error(`${T.type} No settings for ${e}. Message was: ${k}`)}(x),function(){const e=T.type in{true:1,false:1,undefined:1};return e&&F(x,"Ignoring init message from meta parent page"),e}()||(F(x,`Received: %c${k}`,p),oe[x].loaded=!0,(null!==T.iframe||(P(x,`The iframe (${T.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let o=oe[x]?.checkOrigin;if(o&&"null"!=`${t}`&&!(o.constructor===Array?function(){let e=0,n=!1;for(F(x,`Checking connection is from allowed list of origins: %c${o}`,p);e<o.length;e++)if(o[e]===t){n=!0;break}return n}():function(){const e=oe[x]?.remoteHost;return F(x,`Checking connection is from: %c${e}`,p),t===e}()))throw new Error(`Unexpected message received from: ${t} for ${T.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&j())}))()):P("","iframeResizer received messageData without id, message was: ",k)):null!==x&&F(x,"Ignored:",k):Object.keys(oe).forEach((e=>{oe[e].mode>=0&&ge("iFrame requested init",ye(e),e)}))}function se(e,t,n){let o=null,i=null;if(oe[e]){if(o=oe[e][t],"function"!=typeof o)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onClose"===t||"onScroll"===t)try{i=o(n)}catch(n){console.error(n),P(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout((()=>e(...t)),0)})(o,n)}return i}function le(e){const{id:t}=e;F(t,"Disconnected from iframe"),delete oe[t],delete e.iframeResizer}function ce(e){const{id:t}=e;if(!1!==se(t,"onClose",t)){F(t,`Removing iFrame: %c${t}`,p);try{e.parentNode&&e.remove()}catch(e){P(t,e)}se(t,"onClosed",t),le(e)}else F(t,"Close iframe cancelled by onClose event")}function de(e){null===re.position&&(re.position={x:window.scrollX,y:window.scrollY},F(e,`Get page position: %c${re.position.x}%c, %c${re.position.y}`,p,h,p))}function ue(){re.position=null}function fe(e){null!==re.position&&(window.scrollTo(re.position.x,re.position.y),N(e,`Set page position: %c${re.position.x}%c, %c${re.position.y}`,p,h,p),ue())}function pe(e){F(e.id,"Size reset requested by "+("init"===e.type?"parent page":"child page")),de(e.id),he(e),ge("reset","reset",e.id)}function he(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,N(n,`Set ${t}: %c${o}`,p)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=oe[n];o&&t("height"),i&&t("width")}S=oe;const me=e=>e.split(":").filter(((e,t)=>19!==t)).join(":");function ge(e,t,n,o){function i(o){const i=e in k?me(t):t;N(n,o,p,h,p),N(n,`Message data: %c${i}`,p)}B(n,e),oe[n]&&(oe[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:o,sameOrigin:r,targetOrigin:a}=oe[n];if(r)try{return e.contentWindow.iframeChildListener(v+t),void i(`Sending message to iframe %c${n}%c via sameOrigin`)}catch(e){F(n,"Same domain connection failed. Trying cross domain%c")}i(`Sending message to iframe: %c${n}%c targetOrigin: %c${a}`),o.postMessage(v+t,a)}():P(n,`Iframe(${n}) not found`),o&&oe[n]?.warningTimeout&&(oe[n].msgTimeout=setTimeout((function(){if(void 0===oe[n])return;const{iframe:e,loaded:t,loadErrorShown:o,waitForLoad:i}=oe[n],{sandbox:r}=e,a="object"==typeof r&&r.length>0;t||o||(oe[n].loadErrorShown=!0,U(n,`<rb>No response from iFrame</>\n \nThe iframe (<i>${n}</>) has not responded within ${oe[n].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${i?"\nThe <b>waitForLoad</> option is currently set to <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"} \n${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"}This message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`))}),oe[n].warningTimeout)))}function ye(e){const t=oe[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,re.version,t.mode,"",t.logExpand].join(":")}let we=0,be=!1,ve=!1;const ze=t=>n=>{function o(){if(oe[u]){const{iframe:e}=oe[u],t={close:ce.bind(null,e),disconnect:le.bind(null,e),removeListeners(){U(u,"<rb>Deprecated Method Name</>\n\nThe [removeListeners()</> method has been renamed to [disconnect()</>.\n"),this.disconnect()},resize(){U(u,"<rb>Deprecated Method</>\n \nUse of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As their are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code."),ge.bind(null,"Window resize","resize",u)},moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${o=t,o.charAt(0).toUpperCase()+o.slice(1)}`);var o})(e,"string","moveToAnchor(anchor) anchor"),ge("Move to anchor",`moveToAnchor:${e}`,u)},sendMessage(e){ge("message",`message:${e=JSON.stringify(e)}`,u)}};e.iframeResizer=t,e.iFrameResizer=t}}function i(e){const{id:t}=n,{mode:o,waitForLoad:i}=oe[t];-1!==o&&-2!==o&&(G(n,"load",(function(){ge($,`${e}:${be}`,t,!0),function(){const e=oe[u]?.firstRun,t=oe[u]?.heightCalculationMethod in z;!e&&t&&pe({iframe:n,height:0,width:0,type:"init"})}()})),!1===i&&ge(j,`${e}:${be}`,t,!0))}function r(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&U(u,`<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"${w}"</>, <i>"${b}"</> or <i>"${y}"</>.\n`),e):{}}function a(){const{mode:n}=oe[u];if(n<0)throw U("Parent",`${te(n+2)}${te(2)}`),q(u),te(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");ve||n>0&&t.vInfoDisable||function(t,n){queueMicrotask((()=>console.info(`%ciframe-resizer ${t}`,C||n<1?"font-weight: bold;":e)))}(`v${m} (${(e=>_(K[e]))(n)})`,n),!ve&&n<1&&U("Parent",te(3)),ve=!0}function s(e){const t=oe[e]?.iframe?.title;return""===t||void 0===t}const l=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function c(e){var t,o;oe[u]={...oe[u],iframe:n,firstRun:!0,remoteHost:n?.src.split("/").slice(0,3).join("/"),...ie,...r(e),mouseEvents:l(e),mode:ne(e),syncTitle:s(u)},B(u,"setup"),function(){const{direction:e}=oe[u];switch(e){case w:break;case b:oe[u].sizeHeight=!1;case"both":oe[u].sizeWidth=!0;break;case y:oe[u].sizeWidth=!1,oe[u].sizeHeight=!1,oe[u].autoResize=!1;break;default:throw new TypeError(u,`Direction value of "${e}" is not valid`)}F(u,`Direction: %c${e}`,p)}(),(t=e?.offsetSize||e?.offset)&&(oe[u].direction===w?(oe[u].offsetHeight=t,F(u,`Offset height: %c${t}`,p)):(oe[u].offsetWidth=t,F(u,`Offset width: %c${t}`,p))),e?.offset&&U(u,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>."),null===oe[u].postMessageTarget&&(oe[u].postMessageTarget=n.contentWindow),oe[u].targetOrigin=!0===oe[u].checkOrigin?""===(o=oe[u].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}const d=()=>"iframeResizer"in n,u=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=t?.id||ie.id+we++;return null!==document.getElementById(e)&&(e+=we++),e}(),n.id=e,F(e,`Added missing iframe ID: ${e} (${n.src})`)),e}(n.id);if("object"!=typeof t)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=T,e.logExpand=!t.includes("ifrlog=collapsed"))}(t),function(e,t){const n=Object.hasOwn(t,"log"),o="string"==typeof t.log,i=n?!!o||t.log:ie.log;Object.hasOwn(t,"logExpand")||(t.logExpand=n&&o?t.log===T:ie.logExpand),function(e){-1===e?.log&&(e.log=!1,e.vInfoDisable=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const o=O({expand:t,label:A(n)});C=e,S[n]||(S[n]={console:o})}({enabled:i,expand:t.logExpand,iframeId:e}),o&&!(t.log in M)&&H(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=i}(u,t),D(u,(function(e){d()?P(u,`Ignored iframe (${u}), already setup.`):(c(e),a(),je(),function(){switch(F(u,`Iframe scrolling ${oe[u]?.scrolling?"enabled":"disabled"} for ${u}`),n.style.overflow=!1===oe[u]?.scrolling?"hidden":"auto",oe[u]?.scrolling){case"omit":break;case!0:n.scrolling="yes";break;case!1:n.scrolling="no";break;default:n.scrolling=oe[u]?oe[u].scrolling:"no"}}(),function(){const{bodyMargin:e}=oe[u];"number"!=typeof e&&"0"!==e||(oe[u].bodyMargin=`${e}px`)}(),i(ye(u)),o(),F(u,"Setup complete"))}))(t),n?.iFrameResizer};function $e(){!1===document.hidden&&(F("document","Trigger event: Visibility change"),function(e,t){const n=e=>oe[e]?.autoResize&&!oe[e]?.firstRun;Object.keys(oe).forEach((function(o){n(o)&&ge(e,t,o)}))}("Tab Visible","resize"))}const je=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{G(window,"message",ae),G(document,"visibilitychange",$e),window.iframeParentListener=e=>setTimeout((()=>ae({data:e,sameOrigin:!0})))})),ke=`[${g}] `;const Te=function(){function e(e){switch(!0){case!e:throw new TypeError(`${ke}iframe is not defined`);case!e.tagName:throw new TypeError(`${ke}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${ke}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(o,i){if("undefined"==typeof window)return[];switch(t=ze(o),n=[],typeof i){case"undefined":case"string":document.querySelectorAll(i||"iframe").forEach(e);break;case"object":e(i);break;default:throw new TypeError(`${ke}Unexpected data type (${typeof i})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){V("iFrameResize()","iframeResize()","","parent"),Te(...e)}),Te}));
|
|
21
|
-
//# sourceMappingURL=iframeResizer.js.map
|
|
20
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,(function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="font-weight: normal;",t=e+"font-style: italic;",n="default",o=Object.freeze({assert:!0,error:!0,warn:!0}),i={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},a=Object.assign(console);const{fromEntries:s,keys:l}=Object,c=e=>[e,a[e]],u=e=>t=>[t,function(n){e[t]=n}],d=(e,t)=>s(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",h=f?"color: #E3E3E3;":"color: #1F1F1F;",m="5.4.7",g="iframeResizer",y="none",w="vertical",b="horizontal",v="[iFrameSizer]",z=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),$="onload",j="init",k=Object.freeze({[$]:1,[j]:1}),T="expanded",x="collapsed",E=Object.freeze({[T]:1,[x]:1}),M=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),R=e=>e,O=(S=function(s={}){const l={},f={},p=[],h={...i,expand:!s.collapsed||i.expanded,...s};let m="";function g(){p.length=0,m=""}function y(){delete h.event,g()}const w=()=>!!p.some((([e])=>e in o))||!!h.expand;function b(){if(0!==p.length){a[w()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?m:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)a.assert(e in a,`Unknown console method: ${e}`),e in a&&a[e](...t);a.groupEnd(),y()}else y()}function v(){""===m&&(m=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 z(e,...t){0===p.length&&(v(),queueMicrotask((()=>queueMicrotask(b)))),p.push([e,...t])}function $(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...d(h,u(h)),...d(console,(e=>[e,(...t)=>z(e,...t)])),...d(r,c),assert:function(e,...t){e||z("assert",e,...t)},count:function(e=n){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=n){delete f[e]},endAutoGroup:b,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e)}return n},event:function(e){v(),h.event=e},purge:g,time:function(e=n){v(),l[e]=performance.now()},timeEnd:function(e=n){$(e),delete l[e]},timeLog:$,touch:v}},S?.__esModule?S.default:S);var S;let I={},A=!1;const C=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const W=e=>(t,...n)=>I[t]?.console[e](...n);var L;const F=(L="log",(e,...t)=>!0===(e=>I[e]?I[e].log:A)(e)?W(L)(e,...t):null),N=W("warn"),H=W("error"),P=W("event"),B=W("purge"),q=W("errorBoundary");const D=(e,...t)=>I[e]?I[e].console.warn(M(R)(...t)):queueMicrotask((()=>console?.warn(M((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t)))),U=(e=>(t,n="renamed to")=>(o,i,r="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(D),J=U("Function"),Z=U("Option"),V=(e,t,n,o)=>e.addEventListener(t,n,o||!1),G=(e,t,n)=>e.removeEventListener(t,n,!1),X=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,i=0;i<e.length;i++)o=e.codePointAt(i),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)},Y=e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),_=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<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."],Q=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],K=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),ee=e=>Y(_[e]),te=e=>{const t=e[Y("spjluzl")];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=X(Y(e));return n in K&&(t=K[n]),t}(n[0]);return 0===o||(e=>e[2]===X(e[0]+e[1]))(n)||(o=-2),o},ne={},oe=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:w,inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof ne[e.id].onInit&&(Z("init()","onReady()","",e.id),ne[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),ie={position:null,version:m};function re(e){function t(){pe(T),de(x),$("onResized",T)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function o(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const i=e=>k.slice(k.indexOf(":")+7+e);const r=(e,t)=>(n,o)=>{const i={};var r,a;r=function(){me(`${n} (${e})`,`${e}:${t()}`,o)},i[a=o]||(r(),i[a]=requestAnimationFrame((()=>{i[a]=null})))},a=(e,t)=>()=>{let n=!1;const o=t=>()=>{ne[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame((()=>{n=!1}))):s()},i=o("scroll"),r=o("resize window");function a(e,t){t(window,"scroll",i),t(window,"resize",r)}function s(){P(l,`stop${t}`),a(0,G),c.disconnect(),u.disconnect(),G(ne[l].iframe,"load",s)}const l=x,c=new ResizeObserver(o("pageObserver")),u=new ResizeObserver(o("iframeObserver"));ne[l]&&(ne[l][`stop${t}`]=s,V(ne[l].iframe,"load",s),a(0,V),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),u.observe(ne[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},s=e=>()=>{e in ne[x]&&(ne[x][e](),delete ne[x][e])},l=r("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=T.iframe.getBoundingClientRect(),{scrollY:n,scrollX:o,innerHeight:i,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,i||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:o,documentHeight:a,documentWidth:s,windowHeight:i,windowWidth:r})})),c=r("parentInfo",(function(){const{iframe:e}=T,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),u=a(l,"PageInfo"),d=a(c,"ParentInfo"),f=s("stopPageInfo"),g=s("stopParentInfo");function y(e){const t=e.getBoundingClientRect();return ce(),{x:Number(t.left)+Number(ie.position.x),y:Number(t.top)+Number(ie.position.y)}}function w(e){const t=e?y(T.iframe):{x:0,y:0};F(x,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,h,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(T,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(o,n):function(e){ie.position=e,b(x)}(n)}function b(e){const{x:t,y:n}=ie.position,o=ne[e]?.iframe;!1!==$("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?de(e):ue()}function z(e){let t={};if(0===T.width&&0===T.height){const e=i(9).split(":");t={x:e[1],y:e[0]}}else t={x:T.width,y:T.height};$(e,{iframe:T.iframe,screenX:Number(t.x),screenY:Number(t.y),type:T.type})}const $=(e,t)=>ae(x,e,t);function j(){const{height:e,iframe:n,msg:o,type:r,width:a}=T;switch(ne[x]?.firstRun&&ne[x]&&(ne[x].firstRun=!1),r){case"close":le(n);break;case"message":l=i(6),$("onMessage",{iframe:T.iframe,message:JSON.parse(l)});break;case"mouseenter":z("onMouseEnter");break;case"mouseleave":z("onMouseLeave");break;case"autoResize":ne[x].autoResize=JSON.parse(i(9));break;case"scrollBy":!function(){const e=T.width,t=T.height,n=window.parentIframe||window.parentIFrame||window;F(x,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),n.scrollBy(e,t)}();break;case"scrollTo":w(!1);break;case"scrollToOffset":w(!0);break;case"pageInfo":u();break;case"parentInfo":d();break;case"pageInfoStop":f();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let o=document.getElementById(n)||document.getElementsByName(n)[0];o?function(){const e=y(o);F(x,`Moving to in page link: %c#${t}`,p),ie.position={x:e.x,y:e.y},b(x),window.location.hash=t}():window.top!==window.self&&function(){const e=window.parentIframe||window.parentIFrame;e&&e.moveToAnchor(t)}()}(i(9));break;case"title":!function(e,t){ne[t]?.syncTitle&&(ne[t].iframe.title=e,F(t,`Set iframe title attribute: %c${e}`,p))}(o,x);break;case"reset":fe(T);break;case"init":t(),function(e){try{ne[e].sameOrigin=!!ne[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){ne[e].sameOrigin=!1}}(x),(s=o)!==m&&(void 0!==s||D(x,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),we=!0,$("onReady",n);break;default:if(0===a&&0===e)return void N(x,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===a||0===e)return;if(document.hidden)return;t()}var s,l}let k=e.data,T={},x=null;"[iFrameResizerChild]Ready"!==k?v===`${k}`.slice(0,13)&&k.slice(13).split(":")[0]in ne&&(T=function(){const e=k.slice(13).split(":"),t=e[1]?Number(e[1]):0,i=ne[e[0]]?.iframe,r=getComputedStyle(i);return{iframe:i,id:e[0],height:t+n(r)+o(r),width:Number(e[2]),type:e[3],msg:e[4]}}(),x=T.id,x?(P(x,T.type),q(x,(function(){!function(e){if(!ne[e])throw new Error(`${T.type} No settings for ${e}. Message was: ${k}`)}(x),T.type in{true:1,false:1,undefined:1}||(ne[x].loaded=!0,(null!==T.iframe||(N(x,`The iframe (${T.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let o=ne[x]?.checkOrigin;if(o&&"null"!=`${t}`&&!(o.constructor===Array?function(){let e=0,n=!1;for(;e<o.length;e++)if(o[e]===t){n=!0;break}return n}():function(){const e=ne[x]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${T.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&j())}))()):N("","iframeResizer received messageData without id, message was: ",k)):Object.keys(ne).forEach((e=>{ne[e].mode>=0&&me("iFrame requested init",ge(e),e)}))}function ae(e,t,n){let o=null,i=null;if(ne[e]){if(o=ne[e][t],"function"!=typeof o)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onClose"===t||"onScroll"===t)try{i=o(n)}catch(n){console.error(n),N(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout((()=>e(...t)),0)})(o,n)}return i}function se(e){const{id:t}=e;delete ne[t],delete e.iframeResizer}function le(e){const{id:t}=e;if(!1!==ae(t,"onClose",t)){try{e.parentNode&&e.remove()}catch(e){N(t,e)}ae(t,"onClosed",t),se(e)}}function ce(e){null===ie.position&&(ie.position={x:window.scrollX,y:window.scrollY})}function ue(){ie.position=null}function de(e){null!==ie.position&&(window.scrollTo(ie.position.x,ie.position.y),F(e,`Set page position: %c${ie.position.x}%c, %c${ie.position.y}`,p,h,p),ue())}function fe(e){ce(e.id),pe(e),me("reset","reset",e.id)}function pe(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,F(n,`Set ${t}: %c${o}`,p)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=ne[n];o&&t("height"),i&&t("width")}I=ne;const he=e=>e.split(":").filter(((e,t)=>19!==t)).join(":");function me(e,t,n,o){function i(o){const i=e in k?he(t):t;F(n,o,p,h,p),F(n,`Message data: %c${i}`,p)}P(n,e),ne[n]&&(ne[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:o,sameOrigin:r,targetOrigin:a}=ne[n];if(r)try{return e.contentWindow.iframeChildListener(v+t),void i(`Sending message to iframe %c${n}%c via sameOrigin`)}catch(e){}i(`Sending message to iframe: %c${n}%c targetOrigin: %c${a}`),o.postMessage(v+t,a)}():N(n,`Iframe(${n}) not found`),o&&ne[n]?.warningTimeout&&(ne[n].msgTimeout=setTimeout((function(){if(void 0===ne[n])return;const{iframe:e,loaded:t,loadErrorShown:o,waitForLoad:i}=ne[n],{sandbox:r}=e,a="object"==typeof r&&r.length>0;t||o||(ne[n].loadErrorShown=!0,D(n,`<rb>No response from iFrame</>\n \nThe iframe (<i>${n}</>) has not responded within ${ne[n].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${i?"\nThe <b>waitForLoad</> option is currently set to <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"} \n${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"}This message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`))}),ne[n].warningTimeout)))}function ge(e){const t=ne[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,ie.version,t.mode,"",t.logExpand].join(":")}let ye=0,we=!1,be=!1;const ve=t=>n=>{function o(){if(ne[d]){const{iframe:e}=ne[d],t={close:le.bind(null,e),disconnect:se.bind(null,e),removeListeners(){D(d,"<rb>Deprecated Method Name</>\n\nThe [removeListeners()</> method has been renamed to [disconnect()</>.\n"),this.disconnect()},resize(){D(d,"<rb>Deprecated Method</>\n \nUse of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As their are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code."),me.bind(null,"Window resize","resize",d)},moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${o=t,o.charAt(0).toUpperCase()+o.slice(1)}`);var o})(e,"string","moveToAnchor(anchor) anchor"),me("Move to anchor",`moveToAnchor:${e}`,d)},sendMessage(e){me("message",`message:${e=JSON.stringify(e)}`,d)}};e.iframeResizer=t,e.iFrameResizer=t}}function i(e){const{id:t}=n,{mode:o,waitForLoad:i}=ne[t];-1!==o&&-2!==o&&(V(n,"load",(function(){me($,`${e}:${we}`,t,!0),function(){const e=ne[d]?.firstRun,t=ne[d]?.heightCalculationMethod in z;!e&&t&&fe({iframe:n,height:0,width:0,type:"init"})}()})),!1===i&&me(j,`${e}:${we}`,t,!0))}function r(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&D(d,`<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"${w}"</>, <i>"${b}"</> or <i>"${y}"</>.\n`),e):{}}function a(){const{mode:n}=ne[d];if(n<0)throw D("Parent",`${ee(n+2)}${ee(2)}`),B(d),ee(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");be||n>0&&t.vInfoDisable||function(t,n){queueMicrotask((()=>console.info(`%ciframe-resizer ${t}`,A||n<1?"font-weight: bold;":e)))}(`v${m} (${(e=>Y(Q[e]))(n)})`,n),!be&&n<1&&D("Parent",ee(3)),be=!0}function s(e){const t=ne[e]?.iframe?.title;return""===t||void 0===t}const l=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function c(e){var t,o;ne[d]={...ne[d],iframe:n,firstRun:!0,remoteHost:n?.src.split("/").slice(0,3).join("/"),...oe,...r(e),mouseEvents:l(e),mode:te(e),syncTitle:s(d)},P(d,"setup"),function(){const{direction:e}=ne[d];switch(e){case w:break;case b:ne[d].sizeHeight=!1;case"both":ne[d].sizeWidth=!0;break;case y:ne[d].sizeWidth=!1,ne[d].sizeHeight=!1,ne[d].autoResize=!1;break;default:throw new TypeError(d,`Direction value of "${e}" is not valid`)}}(),(t=e?.offsetSize||e?.offset)&&(ne[d].direction===w?ne[d].offsetHeight=t:ne[d].offsetWidth=t),e?.offset&&D(d,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>."),null===ne[d].postMessageTarget&&(ne[d].postMessageTarget=n.contentWindow),ne[d].targetOrigin=!0===ne[d].checkOrigin?""===(o=ne[d].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}const u=()=>"iframeResizer"in n,d=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=t?.id||oe.id+ye++;return null!==document.getElementById(e)&&(e+=ye++),e}(),n.id=e),e}(n.id);if("object"!=typeof t)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=T,e.logExpand=!t.includes("ifrlog=collapsed"))}(t),function(e,t){const n=Object.hasOwn(t,"log"),o="string"==typeof t.log,i=n?!!o||t.log:oe.log;Object.hasOwn(t,"logExpand")||(t.logExpand=n&&o?t.log===T:oe.logExpand),function(e){-1===e?.log&&(e.log=!1,e.vInfoDisable=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const o=O({expand:t,label:C(n)});A=e,I[n]||(I[n]={console:o})}({enabled:i,expand:t.logExpand,iframeId:e}),o&&!(t.log in E)&&H(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=i}(d,t),q(d,(function(e){u()?N(d,`Ignored iframe (${d}), already setup.`):(c(e),a(),$e(),function(){switch(n.style.overflow=!1===ne[d]?.scrolling?"hidden":"auto",ne[d]?.scrolling){case"omit":break;case!0:n.scrolling="yes";break;case!1:n.scrolling="no";break;default:n.scrolling=ne[d]?ne[d].scrolling:"no"}}(),function(){const{bodyMargin:e}=ne[d];"number"!=typeof e&&"0"!==e||(ne[d].bodyMargin=`${e}px`)}(),i(ge(d)),o())}))(t),n?.iFrameResizer};function ze(){!1===document.hidden&&function(e,t){const n=e=>ne[e]?.autoResize&&!ne[e]?.firstRun;Object.keys(ne).forEach((function(o){n(o)&&me(e,t,o)}))}("Tab Visible","resize")}const $e=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{V(window,"message",re),V(document,"visibilitychange",ze),window.iframeParentListener=e=>setTimeout((()=>re({data:e,sameOrigin:!0})))})),je=`[${g}] `;const ke=function(){function e(e){switch(!0){case!e:throw new TypeError(`${je}iframe is not defined`);case!e.tagName:throw new TypeError(`${je}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${je}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(o,i){if("undefined"==typeof window)return[];switch(t=ve(o),n=[],typeof i){case"undefined":case"string":document.querySelectorAll(i||"iframe").forEach(e);break;case"object":e(i);break;default:throw new TypeError(`${je}Unexpected data type (${typeof i})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){J("iFrameResize()","iframeResize()","","parent"),ke(...e)}),ke}));
|