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