iframe-resizer 5.5.7-beta.1 → 5.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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.5.7
|
|
4
|
+
* @module iframe-resizer/legacy (child) 5.5.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:!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
|
-
//# 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",a=Object.freeze({assert:!0,error:!0,warn:!0}),i={expand:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0},c=Object.assign(console);const{fromEntries:l,keys:u}=Object,d=e=>[e,c[e]],f=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(u(e).map(t));const p=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,h=p?"color: #A9C7FB;":"color: #135CD2;",y=p?"color: #E3E3E3;":"color: #1F1F1F;",g="5.5.7",v="iframeResizer",b=":",z="init",w="message",$="pageHide",S="pageInfo",O="parentInfo",E="scrollToOffset",M="title",k=10,j="data-iframe-size",x="data-iframe-overflowed",T="data-iframe-ignore",A="height",C="width",I="offset",N="offsetSize",P="string",R="number",B="object",q="function",L="auto",D="readystatechange",F="bottom",W="right",H="autoResizeEnabled",U=Symbol("sizeChanged"),V="manualResize",Z="parentResize",J={[V]:1,[Z]:1},_="setOffsetSize",Q="resizeObserver",G="overflowObserver",Y="mutationObserver",X="visibilityObserver",K="[iFrameSizer]",ee=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),te=(e,t,n,o)=>e.addEventListener(t,n,o||!1),ne=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},oe=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),re=["spjluzl","rlf","clyzpvu"],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."],ie=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],se=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),ce=e=>oe(ae[e]);var le=e=>{const t=e[oe(re[0])]||e[oe(re[1])]||e[oe(re[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=ne(oe(e));return n in se&&(t=se[n]),t}(n[0]);return 0===o||(e=>e[2]===ne(e[0]+e[1]))(n)||(o=-2),o};const ue=(e,...t)=>setTimeout(()=>e(...t),0),de=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},fe=e=>e,me=e=>Math.round(1e3*e)/1e3,pe=e=>e.charAt(0).toUpperCase()+e.slice(1),he=e=>""!=`${e}`&&void 0!==e,ye=e=>e();const ge=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${pe(t)}`)};let ve=!0,be=v;const ze=(we=function(n={}){const l={},u={},p=[],h={...i,expand:!n.collapsed||i.expanded,...n};let y="";function g(){p.length=0,y=""}function v(){delete h.event,g()}const b=()=>!!p.some(([e])=>e in a)||!!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?y:""}`,e,t,o);for(const[e,...t]of p)c.assert(e in c,`Unknown console method: ${e}`),e in c&&c[e](...t);c.groupEnd(),v()}else v()}function w(){""===y&&(y=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function $(e,...t){0===p.length&&(w(),queueMicrotask(()=>queueMicrotask(z))),p.push([e,...t])}function S(e=r,...t){l[e]?$("log",`${e}: ${performance.now()-l[e]} ms`,...t):$("timeLog",e,...t)}return{...m(h,f(h)),...m(console,e=>[e,(...t)=>$(e,...t)]),...m(s,d),assert:function(e,...t){!0!==e&&$("assert",e,...t)},count:function(e=r){u[e]?u[e]+=1:u[e]=1,$("log",`${e}: ${u[e]}`)},countReset:function(e=r){delete u[e]},endAutoGroup:z,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;$("error",e),z()}return n},event:function(e){w(),h.event=e},purge:g,time:function(e=r){w(),l[e]=performance.now()},timeEnd:function(e=r){S(e),delete l[e]},timeLog:S,touch:w}},we?.__esModule?we.default:we);var we;const $e=ze({label:`${v}(child)`,expand:!1});var Se;const Oe=(Se="log",(...e)=>!ve||$e[Se](...e));const{assert:Ee,endAutoGroup:Me,error:ke,errorBoundary:je,event:xe,label:Te,purge:Ae,warn:Ce}=$e,Ie=e=>{return $e.warn((t=fe,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},Ne=(e=>(t,n="renamed to")=>(o,r,a="",i="")=>e(i,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${a}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>Ie(t)),Pe=Ne("Method"),Re=Ne("Method","replaced with"),Be=Ne("Option"),qe=["min-height","min-width","max-height","max-width"],Le=new Set,De=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Fe=(e,t)=>{return(n=De(e,t))&&"0px"!==n&&n!==L&&"none"!==n;var n};function We({href:e}){Le.has(e)||Le.add(e)}const He=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){We(n)}return{source:"cross-origin stylesheet",value:De(e,t)}}(e,t),Ue=(e,t)=>{const{source:n,value:o}=He(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);Ie(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function Ve(){for(const e of[document.documentElement,document.body])for(const t of qe)Fe(e,t)&&Ue(e,t)}const Ze=e=>t=>void 0===t?void 0:e(t),Je=Ze(e=>"true"===e),_e=Ze(Number),Qe=e=>e=>{e.size},Ge=((e="")=>t=>n=>{n.size>0&&ke(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Ye=e=>e=>{e.size},Xe=(t,n=!0)=>o=>{o>0&&Oe(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},Ke=(e,t,n,o)=>{const r=Ye(e);return e=>{const a=new Set;let i=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),a.add(o),i+=1);r(a),o(i),a.clear()}},et=new Set,tt=new Set,nt=new Set,ot=[],rt={attributes:!0,attributeFilter:[T,j],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let at,it=1,st=!1,ct=0;const lt=e=>{e.size},ut=e=>{e.size},dt=e=>{e.size},ft=e=>e.nodeType!==Node.ELEMENT_NODE||ee.has(e.tagName.toLowerCase());function mt(e){const t=e.addedNodes;for(const e of t)ft(e)||et.add(e)}function pt(e){const t=e.removedNodes;for(const e of t)ft(e)||(et.has(e)?(et.delete(e),nt.add(e)):tt.add(e))}const ht=e=>{Oe("Mutations:",e);for(const t of e)mt(t),pt(t);lt(et),ut(tt),dt(nt),nt.clear()};const yt=e=>()=>{const t=performance.now(),n=t-ct,o=16*it+++2;if(n>o&&n<200)return xe("mutationThrottled"),Oe("Update delayed due to heavy workload on the callStack"),Oe(`EventLoop busy time: %c${me(n)}ms %c> Max wait: %c${o-2}ms`,h,y,h),setTimeout(at,16*it),void(ct=t);it=1,ot.forEach(ht),ot.length=0,st=!1,tt.size,et.size,e({addedNodes:et,removedNodes:tt}),et.clear(),tt.clear()};function gt(e){ot.push(e),st||(ct=performance.now(),st=!0,requestAnimationFrame(at))}function vt(e){const t=new window.MutationObserver(gt),n=document.body||document.documentElement;return at=yt(e),t.observe(n,rt),Oe("Attached MutationObserver to body"),{...t,disconnect:()=>{et.clear(),tt.clear(),ot.length=0,t.disconnect(),Oe("Detached MutationObserver")}}}const bt="Overflow",zt=Xe(bt),wt=Xe(bt,!1),$t=Qe(bt),St=Ge(bt),Ot=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,Et=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||fe,a=(t=!1)=>e(t),i=(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 a=e[n],c=i(a,o)&&!Ot(r);s(r,c)}r(a)},o),l=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(l.has(r)?t.add(r):(c.observe(r),l.add(r),n.add(r),o+=1));St(t),$t(n),zt(o),n.clear(),t.clear()},detachObservers:Ke(bt,c,l,wt),disconnect:()=>{c.disconnect(),Oe("Detached OverflowObserver")}}},Mt="--ifr-start",kt="--ifr-end",jt="--ifr-measure",xt=[];let Tt,At={},Ct=0;function It(){try{performance.clearMarks(Mt),performance.clearMarks(kt),performance.clearMeasures(jt)}catch{}}function Nt(e){e.getEntries().forEach(e=>{if(e.name===kt)try{const{duration:t}=performance.measure(jt,Mt,kt);At=e.detail,xt.push(t),xt.length>100&&xt.shift()}catch{}})}function Pt(){Oe("Attached PerformanceObserver to page");const e=new PerformanceObserver(Nt);return e.observe({entryTypes:["mark"]}),Tt=setInterval(()=>{if(xt.length<10)return;if(At.hasTags&&At.len<25)return;xt.sort();const e=Math.min(xt.reduce((e,t)=>e+t,0)/xt.length,xt[Math.floor(xt.length/2)]),t=me(e);t>Ct&&(Ct=t,xe("performanceObserver")),It(),e<=4||(clearInterval(Tt),Ie(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${me(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${At.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{It(),clearInterval(Tt),e.disconnect(),Oe("Detached PerformanceObserver")}}}const Rt="Resize",Bt=Xe(Rt),qt=Xe(Rt,!1),Lt=Qe(Rt),Dt=Ge(Rt),Ft=new WeakSet,Wt=new Set,Ht=new Set;let Ut;function Vt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(Ft.has(n)?Wt.add(n):(Ut.observe(n),Ft.add(n),Ht.add(n),t+=1))}Dt(Wt),Lt(Ht),Bt(t),Ht.clear(),Wt.clear()}function Zt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),Oe("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),Oe("Detached VisibilityObserver")}}}const Jt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},_t=Jt(q),Qt=Jt(R),Gt=Jt(P);"undefined"!=typeof window&&function(){const o={height:()=>(Ce("Custom height calculation function not defined"),Cn.auto()),width:()=>(Ce("Custom width calculation function not defined"),In.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},i=L,s=[],c="scroll";let l,u,d,f,m,p,ne,ae=!0,se="",me=0,ze="",we="",Se=!1,Ne=!0,qe=!1,Le=!0,De=!1,Fe=!1,We=!0,He=!1,Ue=1,Ze=i,Qe="",Ge=!0,Ye={},Xe=!1,et=!1,tt=!1,nt=0,ot=!1,rt=0,at=0,it=new Set,st="",ct="child",lt=!1,ut="",dt=[],ft=window.parent,mt="*",pt=0,ht=!1,yt=1,gt=c,bt=window,zt=()=>{Ce("onMessage function not defined")},wt=()=>{},$t=null,St=null;function Ot(e){var t;!function(e){st=e[0]??st,me=_e(e[1])??me,qe=Je(e[2])??qe,tt=Je(e[3])??tt,ae=Je(e[6])??ae,ze=e[7]??ze,Ze=e[8]??Ze,se=e[9]??se,we=e[10]??we,pt=_e(e[11])??pt,Ye.enable=Je(e[12])??!1,ct=e[13]??ct,gt=e[14]??gt,ot=Je(e[15])??ot,rt=_e(e[16])??rt,at=_e(e[17])??at,Ne=Je(e[18])??Ne,l=e[19]??l,p=e[20]??p,nt=_e(e[21])??nt,et=Je(e[23])??et}(e),be=(t={id:st,enabled:tt,expand:et}).id||v,$e.label(`${be}`),$e.expand(t.expand),ve=t.enabled,function(){function e(e){ne=_t(e,"onBeforeResize")??ne,zt=_t(e,"onMessage")??zt,wt=_t(e,"onReady")??wt,typeof e?.offset===R&&(Be(I,N),Ne&&(rt=Qt(e,I)??rt),qe&&(at=Qt(e,I)??at)),typeof e?.offsetSize===R&&(Ne&&(rt=Qt(e,N)??rt),qe&&(at=Qt(e,N)??at)),u=Gt(e,oe(re[0]))??u,Qe=Gt(e,"ignoreSelector")??Qe,ut=Gt(e,"sizeSelector")??ut,mt=Gt(e,"targetOrigin")??mt,Ze=e?.heightCalculationMethod||Ze,gt=e?.widthCalculationMethod||gt}function t(e,t){return typeof e===q&&(Ie(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),o[t]=e,e="custom"),e}if(1===nt)return;const n=window.iframeResizer||window.iFrameResizer;typeof n===B&&(e(n),Ze=t(Ze,A),gt=t(gt,C),Oe(`Set targetOrigin for parent: %c${mt}`,h))}(),[Bt,Dt,an,It,Lt,on,rn,tn,Nt,At,Se?fe:Ve,Jt,dn,un,ln,Yt,()=>Wt("background",se),()=>Wt("padding",we),Se?fe:Xt,cn,sn,Sn,xt].forEach(e=>{try{e()}catch(e){if(nt<0)throw e;Ie("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),ke(e)}}),Tt(de(wt)),Dn(z,"Init message from host page",void 0,void 0,`${g}:${nt}`),document.title&&""!==document.title&&Hn(0,0,M,document.title)}function jt({persisted:e}){e||Hn(0,0,"beforeUnload"),xe($),Oe("Page persisted:",e),e||s.forEach(ye)}const xt=()=>te(window,$.toLowerCase(),jt);function Tt(e){"complete"===document.readyState?ue(e):te(document,D,()=>Tt(e))}function At(){dt=document.querySelectorAll(`[${j}]`),He=dt.length>0}let Ct=0;function It(){const n=document.querySelectorAll(`*[${T}]`);return De=n.length>0,De&&n.length!==Ct&&(function(n){const o=1===n.length?"":"s";Ce(`%c[${T}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),Ct=n.length),De}function Nt(){"BackCompat"===document.compatMode&&Ie("<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n")}function Bt(){p&&""!==p&&"false"!==p?p!==g&&Ie(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${p} - Child page: ${g}.\n`):Ie("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n")}function Lt(){try{lt=1===nt||"iframeParentListener"in window.parent}catch(e){}}function Dt(){qe===Ne&&(Se=!0)}function Wt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),Oe(`Set body ${e}: %c${t}`,h))}function Ht(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Jt(){Ht(0,j,ut),Ht(0,T,Qe)}function Yt(){var e,t;void 0===ze&&(ze=`${me}px`),Wt("margin",(e="margin",(t=ze).includes("-")&&(Ce(`Negative CSS value ignored for ${e}`),t=""),t))}function Xt(){const e=e=>e.style.setProperty(A,L,"important");e(document.documentElement),e(document.body)}function Kt(e){({add(t){function n(){Dn(e.eventName,e.eventType)}a[t]=n,te(window,t,n,{passive:!0})},remove(e){const t=a[e];var n,o;delete a[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function en(e){Kt({method:e,eventType:"After Print",eventName:"afterprint"}),Kt({method:e,eventType:"Before Print",eventName:"beforeprint"}),Kt({method:e,eventType:"Ready State Change",eventName:D})}function tn(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(j,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&Ie("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}function nn(e,t,n){const{label:o}=n;return t!==e&&(e in n||(Ce(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&Ie(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you ${p?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${o}CalculationMethod: AUTO,\n}\n`}\n`),e}function on(){Ze=nn(Ze,i,Cn)}function rn(){gt=nn(gt,c,In)}function an(){const t=nt,n=le({key:l}),o=le({key:u});if(nt=Math.max(n,o),nt<0){if(nt=Math.min(n,o),Ae(),Ie(`${ce(nt+2)}${ce(2)}`),he(p))throw ce(nt+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!he(p)||t>-1&&nt>t)&&(sessionStorage.getItem("ifr")!==g&&function(t,n){console.info(`${be} %ciframe-resizer ${t}`,ve||n<1?"font-weight: bold;":e)}(`v${g} (${(e=>oe(ie[e]))(nt)})`,nt),nt<2&&Ie(ce(3)),sessionStorage.setItem("ifr",g))}function sn(){en("add"),s.push(()=>en("remove"))}function cn(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function ln(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,k)+parseInt(n.x,k),y:parseInt(t.top,k)+parseInt(n.y,k)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Hn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Hn(n.y,n.x,E)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}const{enable:o}=Ye;o&&(1===nt?Ie(ce(5)):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&te(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),te(window,"hashchange",n),setTimeout(n,128))),Ye={...Ye,findTarget:t}}function un(){function e(e){Hn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){te(window.document,t,e)}!0===ot&&(t("mouseenter"),t("mouseleave"))}function dn(){1!==nt&&(bt.parentIframe=Object.freeze({autoResize:e=>(ge(e,"boolean","parentIframe.autoResize(enable) enable"),!1===qe&&!1===Ne?(xe(H),Ie("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===ae?(ae=!0,queueMicrotask(()=>Dn(H,"Auto Resize enabled"))):!1===e&&!0===ae&&(ae=!1),Hn(0,0,"autoResize",JSON.stringify(ae)),ae)),close(){Hn(0,0,"close")},getId:()=>st,getOrigin:()=>(xe("getOrigin"),Pe("getOrigin()","getParentOrigin()"),d),getParentOrigin:()=>d,getPageInfo(e){if(typeof e===q)return $t=e,Hn(0,0,S),void Re("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");$t=null,Hn(0,0,"pageInfoStop")},getParentProps:e=>(ge(e,q,"parentIframe.getParentProps(callback) callback"),St=e,Hn(0,0,O),()=>{St=null,Hn(0,0,"parentInfoStop")}),getParentProperties(e){Pe("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){ge(e,P,"parentIframe.moveToAnchor(anchor) anchor"),Ye.findTarget(e)},reset(){!function(){const e=Ze;Ze=i,ht||(ht=!0,requestAnimationFrame(()=>{ht=!1})),Fn("reset"),Ze=e}()},setOffsetSize(e){ge(e,R,"parentIframe.setOffsetSize(offset) offset"),rt=e,at=e,Dn(_,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){ge(e,R,"parentIframe.scrollBy(x, y) x"),ge(t,R,"parentIframe.scrollBy(x, y) y"),Hn(t,e,"scrollBy")},scrollTo(e,t){ge(e,R,"parentIframe.scrollTo(x, y) x"),ge(t,R,"parentIframe.scrollTo(x, y) y"),Hn(t,e,"scrollTo")},scrollToOffset(e,t){ge(e,R,"parentIframe.scrollToOffset(x, y) x"),ge(t,R,"parentIframe.scrollToOffset(x, y) y"),Hn(t,e,E)},sendMessage(e,t){t&&ge(t,P,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Hn(0,0,w,JSON.stringify(e),t)},setHeightCalculationMethod(e){Ze=e,on()},setWidthCalculationMethod(e){gt=e,rn()},setTargetOrigin(e){ge(e,P,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),mt=e},resize(e,t){void 0!==e&&ge(e,R,"parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&ge(t,R,"parentIframe.resize(customHeight, customWidth) customWidth"),Dn(V,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){Pe("size()","resize()"),this.resize(e,t)}}),bt.parentIFrame=bt.parentIframe)}let fn=new Set;function mn(){const e=document.querySelectorAll(`[${x}]`);it=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${T}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{xe("overflowIgnored"),Oe("Ignoring elements with [data-iframe-ignore] > *:\n",n),Me()}),t}(e),Fe=it.size>0,typeof Set.prototype.symmetricDifference===q&&(We=it.symmetricDifference(fn).size>0),fn=it}function pn(){switch(mn(),!0){case!We:return;case it.size>1:Oe("Overflowed Elements:",it);break;case Fe:break;default:Oe("No overflow detected")}Dn(G,"Overflow updated")}function hn(e){const t={root:document.documentElement,side:Ne?F:W};return f=Et(pn,t),f.attachObservers(e),f}function yn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Dn(Q,`Element resized <${function(e){switch(!0){case!he(e):return"";case he(e.id):return`${e.nodeName}#${e.id}`;case he(e.name):return`${e.nodeName} (${e.name}`;case he(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function gn(e){return Ut=new ResizeObserver(yn),Ut.observe(document.body),Ft.add(document.body),Oe("Attached ResizeObserver to body"),m={attachObserverToNonStaticElements:Vt,detachObservers:Ke(Rt,Ut,Ft,qt),disconnect:()=>{Ut.disconnect(),Oe("Detached ResizeObserver")}},m.attachObserverToNonStaticElements(e),m}function vn(e){Xe=!e,Dn(X,"Visibility changed")}const bn=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of kn(n))t.add(e)}return Oe("Inspecting:\n",t),t},zn=e=>{if(0===e.size)return;xe("addObservers");const t=bn(e);f.attachObservers(t),m.attachObserverToNonStaticElements(t),Me()},wn=e=>{if(0===e.size)return;xe("removeObservers");const t=bn(e);f.detachObservers(t),m.detachObservers(t),Me()};function $n(e){!function({addedNodes:e,removedNodes:t}){xe("contentMutated"),Jt(),At(),mn(),Me(),wn(t),zn(e)}(e),Dn(Y,"Mutation Observed")}function Sn(){const e=kn(document.documentElement);var t;t=[vt($n),hn(e),Pt(),gn(e),Zt(vn)],s.push(...t.map(e=>e.disconnect))}function On(e){performance.mark(Mt);const t=pe(e);let n=1,o=document.documentElement,r=He?0:document.documentElement.getBoundingClientRect().bottom;const a=He?dt:Fe?Array.from(it):kn(document.documentElement);for(const t of a)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return Oe(`${t} position calculated from:`,o),Oe(`Checked %c${a.length}%c elements`,h,y),performance.mark(kt,{detail:{hasTags:He,len:a.length,logging:tt,Side:t}}),r}const En=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],Mn=`* ${Array.from(ee).map(e=>`:not(${e})`).join("")}`,kn=e=>e.querySelectorAll(Mn),jn={height:0,width:0},xn={height:0,width:0},Tn=[h,y,h];function An(e){function t(){return xn[o]=r,jn[o]=s,Math.max(r,1)}const n=e===Cn,o=e.label,r=e.boundingClientRect(),a=Math.ceil(r),i=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: %c${r}px %cPage: %c${s}px`;let l=1;switch(!0){case!e.enabled():return Math.max(s,1);case He:Oe("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!Fe&&Le&&0===xn[o]&&0===jn[o]:Oe(`Initial page size values: ${c}`,...Tn),l=t();break;case ht&&r===xn[o]&&s===jn[o]:Oe(`Size unchanged: ${c}`,...Tn),l=Math.max(r,s);break;case 0===r&&0!==s:Oe(`Page is hidden: ${c}`,...Tn),l=s;break;case!Fe&&r!==xn[o]&&s<=jn[o]:Oe(`New <html> size: ${c} `,...Tn),Oe(`Previous <html> size: %c${xn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!Fe&&r<xn[o]:Oe(`<html> size decreased: ${c}`,...Tn),l=t();break;case s===i||s===a:Oe(`<html> size equals page size: ${c}`,...Tn),l=t();break;case r>s:Oe(`Page size < <html> size: ${c}`,...Tn),l=t();break;case Fe:Oe("Found elements possibly overflowing <html> "),l=e.taggedElement();break;default:Oe(`Using <html> size: ${c}`,...Tn),l=t()}return Oe(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&Oe(`Page offsetSize: %c${t}px`,h),t}(e),Math.max(l,1)}const Cn={label:A,enabled:()=>Ne,getOffset:()=>rt,auto:()=>An(Cn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,k)+parseInt(t.marginBottom,k)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Cn.bodyOffset(),custom:()=>o.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...En(Cn)),min:()=>Math.min(...En(Cn)),grow:()=>Cn.max(),lowestElement:()=>On(F),taggedElement:()=>On(F)},In={label:C,enabled:()=>qe,getOffset:()=>at,auto:()=>An(In),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>o.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...En(In)),min:()=>Math.min(...En(In)),rightMostElement:()=>On(W),scroll:()=>Math.max(In.bodyScroll(),In.documentElementScroll()),taggedElement:()=>On(W)},Nn=(e,t)=>!(Math.abs(e-t)<=pt);function Pn(e,t){const n=e[t](),o=e.enabled()&&void 0!==ne?function(e){const t=ne(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);if(t<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${t}, must be at least 1`);return t}(n):n;return Ee(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let Rn=!1;const Bn=de(()=>Ie(ce(4)));let qn,Ln=!1;const Dn=je((e,t,n,o,r)=>{switch(xe(e),!0){case!0===Xe:if(!0===Ln)break;Ln=!0,Rn=!1,cancelAnimationFrame(qn);break;case!0===Rn&&e!==G:Ae();break;case!ae&&!(e in J):Oe("Resizing disabled");break;default:Ln=!1,Rn=!0,performance.now(),qn=requestAnimationFrame(()=>{Rn=!1,xe("requestAnimationFrame")}),function(e,t,n,o,r){const a=n??Pn(Cn,Ze),i=o??Pn(In,gt);switch(Ne&&Nn(Ue,a)||qe&&Nn(yt,i)?U:e){case z:case H:case U:Ue=a,yt=i;case _:Wn(Ue,yt,e,r);break;case G:case Y:case Q:case X:Ae();break;default:Ae(),Oe("No change in content size detected")}}(e,0,n,o,r)}Me()});function Fn(e){Ue=Cn[Ze](),yt=In[gt](),Hn(Ue,yt,e)}function Wn(e,t,o,r,a){nt<-1||(void 0!==a||(a=mt),function(){const i=`${st}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(lt)try{window.parent.iframeParentListener(K+i)}catch(e){if(1!==nt)throw e;return void Bn()}else ft.postMessage(K+i,a);Oe(`Sending message to parent page via ${lt?"sameOrigin":"postMessage"}: %c%c${i}`,n,h)}())}const Hn=je((e,t,n,o,r)=>{xe(n),Wn(e,t,n,o,r),Me()}),Un=je(function(e){xe("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Hn(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(b);ft=e.source,d=e.origin,Ot(t),Le=!1,setTimeout(()=>{Ge=!1},128)},reset(){Ge||Fn("resetPage")},resize(){Dn(Z,"Parent window requested size check")},moveToAnchor(){Ye.findTarget(i())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=i();$t?ue($t,n(e)):o(S)},parentInfo(){const e=(r=i(),t(n(r)));var r;St?ue(St,e):o(O)},message(){const e=i();ue(zt,n(e))}},a=()=>e.data.split("]")[1].split(b)[0],i=()=>e.data.slice(e.data.indexOf(b)+1),s=()=>e.data.split(b)[2]in{true:1,false:1};function c(){const t=a();xe(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||Ce(`Unexpected message (${e.data})`)}K===`${e.data}`.slice(0,13)&&function(){if(!1!==Le)return s()?(Te(a()),xe(z),void r.init()):void 0;c()}()});let Vn=!1;const Zn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function Jn(){if("loading"===document.readyState||!Le||Vn)return;const{parent:e,top:t}=window;xe("ready"),Zn(e),e!==t&&Zn(t),Vn=!0}"iframeChildListener"in window?Ce("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Un({data:e,sameOrigin:!0})),te(window,w,Un),te(document,D,Jn),Jn())}()}();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/legacy (child) 5.5.7
|
|
4
|
+
* @module iframe-resizer/legacy (child) 5.5.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:!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
|
-
//# 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",a=Object.freeze({assert:!0,error:!0,warn:!0}),i={expand:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0},c=Object.assign(console);const{fromEntries:l,keys:u}=Object,d=e=>[e,c[e]],f=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(u(e).map(t));const p=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,h=p?"color: #A9C7FB;":"color: #135CD2;",y=p?"color: #E3E3E3;":"color: #1F1F1F;",g="5.5.7",v="iframeResizer",b=":",z="init",w="message",$="pageHide",S="pageInfo",O="parentInfo",E="scrollToOffset",M="title",k=10,j="data-iframe-size",x="data-iframe-overflowed",T="data-iframe-ignore",A="height",C="width",I="offset",N="offsetSize",P="string",R="number",B="object",q="function",L="auto",D="readystatechange",F="bottom",W="right",H="autoResizeEnabled",U=Symbol("sizeChanged"),V="manualResize",Z="parentResize",J={[V]:1,[Z]:1},_="setOffsetSize",Q="resizeObserver",G="overflowObserver",Y="mutationObserver",X="visibilityObserver",K="[iFrameSizer]",ee=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),te=(e,t,n,o)=>e.addEventListener(t,n,o||!1),ne=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},oe=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),re=["spjluzl","rlf","clyzpvu"],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."],ie=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],se=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),ce=e=>oe(ae[e]);var le=e=>{const t=e[oe(re[0])]||e[oe(re[1])]||e[oe(re[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=ne(oe(e));return n in se&&(t=se[n]),t}(n[0]);return 0===o||(e=>e[2]===ne(e[0]+e[1]))(n)||(o=-2),o};const ue=(e,...t)=>setTimeout(()=>e(...t),0),de=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},fe=e=>e,me=e=>Math.round(1e3*e)/1e3,pe=e=>e.charAt(0).toUpperCase()+e.slice(1),he=e=>""!=`${e}`&&void 0!==e,ye=e=>e();const ge=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${pe(t)}`)};let ve=!0,be=v;const ze=(we=function(n={}){const l={},u={},p=[],h={...i,expand:!n.collapsed||i.expanded,...n};let y="";function g(){p.length=0,y=""}function v(){delete h.event,g()}const b=()=>!!p.some(([e])=>e in a)||!!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?y:""}`,e,t,o);for(const[e,...t]of p)c.assert(e in c,`Unknown console method: ${e}`),e in c&&c[e](...t);c.groupEnd(),v()}else v()}function w(){""===y&&(y=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function $(e,...t){0===p.length&&(w(),queueMicrotask(()=>queueMicrotask(z))),p.push([e,...t])}function S(e=r,...t){l[e]?$("log",`${e}: ${performance.now()-l[e]} ms`,...t):$("timeLog",e,...t)}return{...m(h,f(h)),...m(console,e=>[e,(...t)=>$(e,...t)]),...m(s,d),assert:function(e,...t){!0!==e&&$("assert",e,...t)},count:function(e=r){u[e]?u[e]+=1:u[e]=1,$("log",`${e}: ${u[e]}`)},countReset:function(e=r){delete u[e]},endAutoGroup:z,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;$("error",e),z()}return n},event:function(e){w(),h.event=e},purge:g,time:function(e=r){w(),l[e]=performance.now()},timeEnd:function(e=r){S(e),delete l[e]},timeLog:S,touch:w}},we?.__esModule?we.default:we);var we;const $e=ze({label:`${v}(child)`,expand:!1});var Se;const Oe=(Se="log",(...e)=>!ve||$e[Se](...e));const{assert:Ee,endAutoGroup:Me,error:ke,errorBoundary:je,event:xe,label:Te,purge:Ae,warn:Ce}=$e,Ie=e=>{return $e.warn((t=fe,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},Ne=(e=>(t,n="renamed to")=>(o,r,a="",i="")=>e(i,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${a}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>Ie(t)),Pe=Ne("Method"),Re=Ne("Method","replaced with"),Be=Ne("Option"),qe=["min-height","min-width","max-height","max-width"],Le=new Set,De=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Fe=(e,t)=>{return(n=De(e,t))&&"0px"!==n&&n!==L&&"none"!==n;var n};function We({href:e}){Le.has(e)||Le.add(e)}const He=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){We(n)}return{source:"cross-origin stylesheet",value:De(e,t)}}(e,t),Ue=(e,t)=>{const{source:n,value:o}=He(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);Ie(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function Ve(){for(const e of[document.documentElement,document.body])for(const t of qe)Fe(e,t)&&Ue(e,t)}const Ze=e=>t=>void 0===t?void 0:e(t),Je=Ze(e=>"true"===e),_e=Ze(Number),Qe=e=>e=>{e.size},Ge=((e="")=>t=>n=>{n.size>0&&ke(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Ye=e=>e=>{e.size},Xe=(t,n=!0)=>o=>{o>0&&Oe(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},Ke=(e,t,n,o)=>{const r=Ye(e);return e=>{const a=new Set;let i=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),a.add(o),i+=1);r(a),o(i),a.clear()}},et=new Set,tt=new Set,nt=new Set,ot=[],rt={attributes:!0,attributeFilter:[T,j],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let at,it=1,st=!1,ct=0;const lt=e=>{e.size},ut=e=>{e.size},dt=e=>{e.size},ft=e=>e.nodeType!==Node.ELEMENT_NODE||ee.has(e.tagName.toLowerCase());function mt(e){const t=e.addedNodes;for(const e of t)ft(e)||et.add(e)}function pt(e){const t=e.removedNodes;for(const e of t)ft(e)||(et.has(e)?(et.delete(e),nt.add(e)):tt.add(e))}const ht=e=>{Oe("Mutations:",e);for(const t of e)mt(t),pt(t);lt(et),ut(tt),dt(nt),nt.clear()};const yt=e=>()=>{const t=performance.now(),n=t-ct,o=16*it+++2;if(n>o&&n<200)return xe("mutationThrottled"),Oe("Update delayed due to heavy workload on the callStack"),Oe(`EventLoop busy time: %c${me(n)}ms %c> Max wait: %c${o-2}ms`,h,y,h),setTimeout(at,16*it),void(ct=t);it=1,ot.forEach(ht),ot.length=0,st=!1,tt.size,et.size,e({addedNodes:et,removedNodes:tt}),et.clear(),tt.clear()};function gt(e){ot.push(e),st||(ct=performance.now(),st=!0,requestAnimationFrame(at))}function vt(e){const t=new window.MutationObserver(gt),n=document.body||document.documentElement;return at=yt(e),t.observe(n,rt),Oe("Attached MutationObserver to body"),{...t,disconnect:()=>{et.clear(),tt.clear(),ot.length=0,t.disconnect(),Oe("Detached MutationObserver")}}}const bt="Overflow",zt=Xe(bt),wt=Xe(bt,!1),$t=Qe(bt),St=Ge(bt),Ot=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,Et=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||fe,a=(t=!1)=>e(t),i=(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 a=e[n],c=i(a,o)&&!Ot(r);s(r,c)}r(a)},o),l=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(l.has(r)?t.add(r):(c.observe(r),l.add(r),n.add(r),o+=1));St(t),$t(n),zt(o),n.clear(),t.clear()},detachObservers:Ke(bt,c,l,wt),disconnect:()=>{c.disconnect(),Oe("Detached OverflowObserver")}}},Mt="--ifr-start",kt="--ifr-end",jt="--ifr-measure",xt=[];let Tt,At={},Ct=0;function It(){try{performance.clearMarks(Mt),performance.clearMarks(kt),performance.clearMeasures(jt)}catch{}}function Nt(e){e.getEntries().forEach(e=>{if(e.name===kt)try{const{duration:t}=performance.measure(jt,Mt,kt);At=e.detail,xt.push(t),xt.length>100&&xt.shift()}catch{}})}function Pt(){Oe("Attached PerformanceObserver to page");const e=new PerformanceObserver(Nt);return e.observe({entryTypes:["mark"]}),Tt=setInterval(()=>{if(xt.length<10)return;if(At.hasTags&&At.len<25)return;xt.sort();const e=Math.min(xt.reduce((e,t)=>e+t,0)/xt.length,xt[Math.floor(xt.length/2)]),t=me(e);t>Ct&&(Ct=t,xe("performanceObserver")),It(),e<=4||(clearInterval(Tt),Ie(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${me(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${At.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{It(),clearInterval(Tt),e.disconnect(),Oe("Detached PerformanceObserver")}}}const Rt="Resize",Bt=Xe(Rt),qt=Xe(Rt,!1),Lt=Qe(Rt),Dt=Ge(Rt),Ft=new WeakSet,Wt=new Set,Ht=new Set;let Ut;function Vt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(Ft.has(n)?Wt.add(n):(Ut.observe(n),Ft.add(n),Ht.add(n),t+=1))}Dt(Wt),Lt(Ht),Bt(t),Ht.clear(),Wt.clear()}function Zt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),Oe("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),Oe("Detached VisibilityObserver")}}}const Jt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},_t=Jt(q),Qt=Jt(R),Gt=Jt(P);"undefined"!=typeof window&&function(){const o={height:()=>(Ce("Custom height calculation function not defined"),Cn.auto()),width:()=>(Ce("Custom width calculation function not defined"),In.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},i=L,s=[],c="scroll";let l,u,d,f,m,p,ne,ae=!0,se="",me=0,ze="",we="",Se=!1,Ne=!0,qe=!1,Le=!0,De=!1,Fe=!1,We=!0,He=!1,Ue=1,Ze=i,Qe="",Ge=!0,Ye={},Xe=!1,et=!1,tt=!1,nt=0,ot=!1,rt=0,at=0,it=new Set,st="",ct="child",lt=!1,ut="",dt=[],ft=window.parent,mt="*",pt=0,ht=!1,yt=1,gt=c,bt=window,zt=()=>{Ce("onMessage function not defined")},wt=()=>{},$t=null,St=null;function Ot(e){var t;!function(e){st=e[0]??st,me=_e(e[1])??me,qe=Je(e[2])??qe,tt=Je(e[3])??tt,ae=Je(e[6])??ae,ze=e[7]??ze,Ze=e[8]??Ze,se=e[9]??se,we=e[10]??we,pt=_e(e[11])??pt,Ye.enable=Je(e[12])??!1,ct=e[13]??ct,gt=e[14]??gt,ot=Je(e[15])??ot,rt=_e(e[16])??rt,at=_e(e[17])??at,Ne=Je(e[18])??Ne,l=e[19]??l,p=e[20]??p,nt=_e(e[21])??nt,et=Je(e[23])??et}(e),be=(t={id:st,enabled:tt,expand:et}).id||v,$e.label(`${be}`),$e.expand(t.expand),ve=t.enabled,function(){function e(e){ne=_t(e,"onBeforeResize")??ne,zt=_t(e,"onMessage")??zt,wt=_t(e,"onReady")??wt,typeof e?.offset===R&&(Be(I,N),Ne&&(rt=Qt(e,I)??rt),qe&&(at=Qt(e,I)??at)),typeof e?.offsetSize===R&&(Ne&&(rt=Qt(e,N)??rt),qe&&(at=Qt(e,N)??at)),u=Gt(e,oe(re[0]))??u,Qe=Gt(e,"ignoreSelector")??Qe,ut=Gt(e,"sizeSelector")??ut,mt=Gt(e,"targetOrigin")??mt,Ze=e?.heightCalculationMethod||Ze,gt=e?.widthCalculationMethod||gt}function t(e,t){return typeof e===q&&(Ie(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),o[t]=e,e="custom"),e}if(1===nt)return;const n=window.iframeResizer||window.iFrameResizer;typeof n===B&&(e(n),Ze=t(Ze,A),gt=t(gt,C),Oe(`Set targetOrigin for parent: %c${mt}`,h))}(),[Bt,Dt,an,It,Lt,on,rn,tn,Nt,At,Se?fe:Ve,Jt,dn,un,ln,Yt,()=>Wt("background",se),()=>Wt("padding",we),Se?fe:Xt,cn,sn,Sn,xt].forEach(e=>{try{e()}catch(e){if(nt<0)throw e;Ie("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),ke(e)}}),Tt(de(wt)),Dn(z,"Init message from host page",void 0,void 0,`${g}:${nt}`),document.title&&""!==document.title&&Hn(0,0,M,document.title)}function jt({persisted:e}){e||Hn(0,0,"beforeUnload"),xe($),Oe("Page persisted:",e),e||s.forEach(ye)}const xt=()=>te(window,$.toLowerCase(),jt);function Tt(e){"complete"===document.readyState?ue(e):te(document,D,()=>Tt(e))}function At(){dt=document.querySelectorAll(`[${j}]`),He=dt.length>0}let Ct=0;function It(){const n=document.querySelectorAll(`*[${T}]`);return De=n.length>0,De&&n.length!==Ct&&(function(n){const o=1===n.length?"":"s";Ce(`%c[${T}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),Ct=n.length),De}function Nt(){"BackCompat"===document.compatMode&&Ie("<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n")}function Bt(){p&&""!==p&&"false"!==p?p!==g&&Ie(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${p} - Child page: ${g}.\n`):Ie("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n")}function Lt(){try{lt=1===nt||"iframeParentListener"in window.parent}catch(e){}}function Dt(){qe===Ne&&(Se=!0)}function Wt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),Oe(`Set body ${e}: %c${t}`,h))}function Ht(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Jt(){Ht(0,j,ut),Ht(0,T,Qe)}function Yt(){var e,t;void 0===ze&&(ze=`${me}px`),Wt("margin",(e="margin",(t=ze).includes("-")&&(Ce(`Negative CSS value ignored for ${e}`),t=""),t))}function Xt(){const e=e=>e.style.setProperty(A,L,"important");e(document.documentElement),e(document.body)}function Kt(e){({add(t){function n(){Dn(e.eventName,e.eventType)}a[t]=n,te(window,t,n,{passive:!0})},remove(e){const t=a[e];var n,o;delete a[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function en(e){Kt({method:e,eventType:"After Print",eventName:"afterprint"}),Kt({method:e,eventType:"Before Print",eventName:"beforeprint"}),Kt({method:e,eventType:"Ready State Change",eventName:D})}function tn(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(j,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&Ie("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}function nn(e,t,n){const{label:o}=n;return t!==e&&(e in n||(Ce(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&Ie(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you ${p?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${o}CalculationMethod: AUTO,\n}\n`}\n`),e}function on(){Ze=nn(Ze,i,Cn)}function rn(){gt=nn(gt,c,In)}function an(){const t=nt,n=le({key:l}),o=le({key:u});if(nt=Math.max(n,o),nt<0){if(nt=Math.min(n,o),Ae(),Ie(`${ce(nt+2)}${ce(2)}`),he(p))throw ce(nt+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!he(p)||t>-1&&nt>t)&&(sessionStorage.getItem("ifr")!==g&&function(t,n){console.info(`${be} %ciframe-resizer ${t}`,ve||n<1?"font-weight: bold;":e)}(`v${g} (${(e=>oe(ie[e]))(nt)})`,nt),nt<2&&Ie(ce(3)),sessionStorage.setItem("ifr",g))}function sn(){en("add"),s.push(()=>en("remove"))}function cn(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function ln(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,k)+parseInt(n.x,k),y:parseInt(t.top,k)+parseInt(n.y,k)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Hn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Hn(n.y,n.x,E)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}const{enable:o}=Ye;o&&(1===nt?Ie(ce(5)):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&te(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),te(window,"hashchange",n),setTimeout(n,128))),Ye={...Ye,findTarget:t}}function un(){function e(e){Hn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){te(window.document,t,e)}!0===ot&&(t("mouseenter"),t("mouseleave"))}function dn(){1!==nt&&(bt.parentIframe=Object.freeze({autoResize:e=>(ge(e,"boolean","parentIframe.autoResize(enable) enable"),!1===qe&&!1===Ne?(xe(H),Ie("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===ae?(ae=!0,queueMicrotask(()=>Dn(H,"Auto Resize enabled"))):!1===e&&!0===ae&&(ae=!1),Hn(0,0,"autoResize",JSON.stringify(ae)),ae)),close(){Hn(0,0,"close")},getId:()=>st,getOrigin:()=>(xe("getOrigin"),Pe("getOrigin()","getParentOrigin()"),d),getParentOrigin:()=>d,getPageInfo(e){if(typeof e===q)return $t=e,Hn(0,0,S),void Re("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");$t=null,Hn(0,0,"pageInfoStop")},getParentProps:e=>(ge(e,q,"parentIframe.getParentProps(callback) callback"),St=e,Hn(0,0,O),()=>{St=null,Hn(0,0,"parentInfoStop")}),getParentProperties(e){Pe("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){ge(e,P,"parentIframe.moveToAnchor(anchor) anchor"),Ye.findTarget(e)},reset(){!function(){const e=Ze;Ze=i,ht||(ht=!0,requestAnimationFrame(()=>{ht=!1})),Fn("reset"),Ze=e}()},setOffsetSize(e){ge(e,R,"parentIframe.setOffsetSize(offset) offset"),rt=e,at=e,Dn(_,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){ge(e,R,"parentIframe.scrollBy(x, y) x"),ge(t,R,"parentIframe.scrollBy(x, y) y"),Hn(t,e,"scrollBy")},scrollTo(e,t){ge(e,R,"parentIframe.scrollTo(x, y) x"),ge(t,R,"parentIframe.scrollTo(x, y) y"),Hn(t,e,"scrollTo")},scrollToOffset(e,t){ge(e,R,"parentIframe.scrollToOffset(x, y) x"),ge(t,R,"parentIframe.scrollToOffset(x, y) y"),Hn(t,e,E)},sendMessage(e,t){t&&ge(t,P,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Hn(0,0,w,JSON.stringify(e),t)},setHeightCalculationMethod(e){Ze=e,on()},setWidthCalculationMethod(e){gt=e,rn()},setTargetOrigin(e){ge(e,P,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),mt=e},resize(e,t){void 0!==e&&ge(e,R,"parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&ge(t,R,"parentIframe.resize(customHeight, customWidth) customWidth"),Dn(V,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){Pe("size()","resize()"),this.resize(e,t)}}),bt.parentIFrame=bt.parentIframe)}let fn=new Set;function mn(){const e=document.querySelectorAll(`[${x}]`);it=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${T}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{xe("overflowIgnored"),Oe("Ignoring elements with [data-iframe-ignore] > *:\n",n),Me()}),t}(e),Fe=it.size>0,typeof Set.prototype.symmetricDifference===q&&(We=it.symmetricDifference(fn).size>0),fn=it}function pn(){switch(mn(),!0){case!We:return;case it.size>1:Oe("Overflowed Elements:",it);break;case Fe:break;default:Oe("No overflow detected")}Dn(G,"Overflow updated")}function hn(e){const t={root:document.documentElement,side:Ne?F:W};return f=Et(pn,t),f.attachObservers(e),f}function yn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Dn(Q,`Element resized <${function(e){switch(!0){case!he(e):return"";case he(e.id):return`${e.nodeName}#${e.id}`;case he(e.name):return`${e.nodeName} (${e.name}`;case he(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function gn(e){return Ut=new ResizeObserver(yn),Ut.observe(document.body),Ft.add(document.body),Oe("Attached ResizeObserver to body"),m={attachObserverToNonStaticElements:Vt,detachObservers:Ke(Rt,Ut,Ft,qt),disconnect:()=>{Ut.disconnect(),Oe("Detached ResizeObserver")}},m.attachObserverToNonStaticElements(e),m}function vn(e){Xe=!e,Dn(X,"Visibility changed")}const bn=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of kn(n))t.add(e)}return Oe("Inspecting:\n",t),t},zn=e=>{if(0===e.size)return;xe("addObservers");const t=bn(e);f.attachObservers(t),m.attachObserverToNonStaticElements(t),Me()},wn=e=>{if(0===e.size)return;xe("removeObservers");const t=bn(e);f.detachObservers(t),m.detachObservers(t),Me()};function $n(e){!function({addedNodes:e,removedNodes:t}){xe("contentMutated"),Jt(),At(),mn(),Me(),wn(t),zn(e)}(e),Dn(Y,"Mutation Observed")}function Sn(){const e=kn(document.documentElement);var t;t=[vt($n),hn(e),Pt(),gn(e),Zt(vn)],s.push(...t.map(e=>e.disconnect))}function On(e){performance.mark(Mt);const t=pe(e);let n=1,o=document.documentElement,r=He?0:document.documentElement.getBoundingClientRect().bottom;const a=He?dt:Fe?Array.from(it):kn(document.documentElement);for(const t of a)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return Oe(`${t} position calculated from:`,o),Oe(`Checked %c${a.length}%c elements`,h,y),performance.mark(kt,{detail:{hasTags:He,len:a.length,logging:tt,Side:t}}),r}const En=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],Mn=`* ${Array.from(ee).map(e=>`:not(${e})`).join("")}`,kn=e=>e.querySelectorAll(Mn),jn={height:0,width:0},xn={height:0,width:0},Tn=[h,y,h];function An(e){function t(){return xn[o]=r,jn[o]=s,Math.max(r,1)}const n=e===Cn,o=e.label,r=e.boundingClientRect(),a=Math.ceil(r),i=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: %c${r}px %cPage: %c${s}px`;let l=1;switch(!0){case!e.enabled():return Math.max(s,1);case He:Oe("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!Fe&&Le&&0===xn[o]&&0===jn[o]:Oe(`Initial page size values: ${c}`,...Tn),l=t();break;case ht&&r===xn[o]&&s===jn[o]:Oe(`Size unchanged: ${c}`,...Tn),l=Math.max(r,s);break;case 0===r&&0!==s:Oe(`Page is hidden: ${c}`,...Tn),l=s;break;case!Fe&&r!==xn[o]&&s<=jn[o]:Oe(`New <html> size: ${c} `,...Tn),Oe(`Previous <html> size: %c${xn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!Fe&&r<xn[o]:Oe(`<html> size decreased: ${c}`,...Tn),l=t();break;case s===i||s===a:Oe(`<html> size equals page size: ${c}`,...Tn),l=t();break;case r>s:Oe(`Page size < <html> size: ${c}`,...Tn),l=t();break;case Fe:Oe("Found elements possibly overflowing <html> "),l=e.taggedElement();break;default:Oe(`Using <html> size: ${c}`,...Tn),l=t()}return Oe(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&Oe(`Page offsetSize: %c${t}px`,h),t}(e),Math.max(l,1)}const Cn={label:A,enabled:()=>Ne,getOffset:()=>rt,auto:()=>An(Cn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,k)+parseInt(t.marginBottom,k)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Cn.bodyOffset(),custom:()=>o.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...En(Cn)),min:()=>Math.min(...En(Cn)),grow:()=>Cn.max(),lowestElement:()=>On(F),taggedElement:()=>On(F)},In={label:C,enabled:()=>qe,getOffset:()=>at,auto:()=>An(In),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>o.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...En(In)),min:()=>Math.min(...En(In)),rightMostElement:()=>On(W),scroll:()=>Math.max(In.bodyScroll(),In.documentElementScroll()),taggedElement:()=>On(W)},Nn=(e,t)=>!(Math.abs(e-t)<=pt);function Pn(e,t){const n=e[t](),o=e.enabled()&&void 0!==ne?function(e){const t=ne(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);if(t<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${t}, must be at least 1`);return t}(n):n;return Ee(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let Rn=!1;const Bn=de(()=>Ie(ce(4)));let qn,Ln=!1;const Dn=je((e,t,n,o,r)=>{switch(xe(e),!0){case!0===Xe:if(!0===Ln)break;Ln=!0,Rn=!1,cancelAnimationFrame(qn);break;case!0===Rn&&e!==G:Ae();break;case!ae&&!(e in J):Oe("Resizing disabled");break;default:Ln=!1,Rn=!0,performance.now(),qn=requestAnimationFrame(()=>{Rn=!1,xe("requestAnimationFrame")}),function(e,t,n,o,r){const a=n??Pn(Cn,Ze),i=o??Pn(In,gt);switch(Ne&&Nn(Ue,a)||qe&&Nn(yt,i)?U:e){case z:case H:case U:Ue=a,yt=i;case _:Wn(Ue,yt,e,r);break;case G:case Y:case Q:case X:Ae();break;default:Ae(),Oe("No change in content size detected")}}(e,0,n,o,r)}Me()});function Fn(e){Ue=Cn[Ze](),yt=In[gt](),Hn(Ue,yt,e)}function Wn(e,t,o,r,a){nt<-1||(void 0!==a||(a=mt),function(){const i=`${st}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(lt)try{window.parent.iframeParentListener(K+i)}catch(e){if(1!==nt)throw e;return void Bn()}else ft.postMessage(K+i,a);Oe(`Sending message to parent page via ${lt?"sameOrigin":"postMessage"}: %c%c${i}`,n,h)}())}const Hn=je((e,t,n,o,r)=>{xe(n),Wn(e,t,n,o,r),Me()}),Un=je(function(e){xe("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Hn(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(b);ft=e.source,d=e.origin,Ot(t),Le=!1,setTimeout(()=>{Ge=!1},128)},reset(){Ge||Fn("resetPage")},resize(){Dn(Z,"Parent window requested size check")},moveToAnchor(){Ye.findTarget(i())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=i();$t?ue($t,n(e)):o(S)},parentInfo(){const e=(r=i(),t(n(r)));var r;St?ue(St,e):o(O)},message(){const e=i();ue(zt,n(e))}},a=()=>e.data.split("]")[1].split(b)[0],i=()=>e.data.slice(e.data.indexOf(b)+1),s=()=>e.data.split(b)[2]in{true:1,false:1};function c(){const t=a();xe(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||Ce(`Unexpected message (${e.data})`)}K===`${e.data}`.slice(0,13)&&function(){if(!1!==Le)return s()?(Te(a()),xe(z),void r.init()):void 0;c()}()});let Vn=!1;const Zn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function Jn(){if("loading"===document.readyState||!Le||Vn)return;const{parent:e,top:t}=window;xe("ready"),Zn(e),e!==t&&Zn(t),Vn=!0}"iframeChildListener"in window?Ce("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Un({data:e,sameOrigin:!0})),te(window,w,Un),te(document,D,Jn),Jn())}()}();
|
package/js/iframeResizer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/legacy (parent) 5.5.7
|
|
4
|
+
* @module iframe-resizer/legacy (parent) 5.5.7 (umd) - 2025-09-23
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 for non-commercial use only.
|
|
7
7
|
* For commercial use, you must purchase a license from
|
|
@@ -17,5 +17,4 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
!function(e,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="5.5.7-beta.1",t="iframeResizer",n=":",o="autoResize",i="init",r="iframeReady",a="load",s="message",l="onload",c="pageInfo",d="parentInfo",u="reset",f="resize",p="scroll",m="child",h="parent",g="string",y="object",b="function",w="undefined",v="auto",z="none",$="vertical",j="horizontal",k="[iFrameSizer]",T=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),x=Object.freeze({[l]:1,[i]:1,[r]:1}),M="expanded",E="collapsed",R=Object.freeze({[M]:1,[E]:1}),S="font-weight: normal;",O=S+"font-style: italic;",I="default",C=Object.freeze({assert:!0,error:!0,warn:!0}),A={expand:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},W={profile:0,profileEnd:0,timeStamp:0,trace:0},L=Object.assign(console);const{fromEntries:N,keys:F}=Object,P=e=>[e,L[e]],B=e=>t=>[t,function(n){e[t]=n}],H=(e,t)=>N(F(e).map(t));const q=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,D=q?"color: #A9C7FB;":"color: #135CD2;",U=q?"color: #E3E3E3;":"color: #1F1F1F;",J=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)),V=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),Z=e=>e,G={},X=(Y=function(e={}){const t={},n={},o=[],i={...A,expand:!e.collapsed||A.expanded,...e};let r="";function a(){o.length=0,r=""}function s(){delete i.event,a()}const l=()=>!!o.some(([e])=>e in C)||!!i.expand;function c(){if(0!==o.length){L[l()?"group":"groupCollapsed"](`%c${i.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(i)} %c${i.showTime?r:""}`,S,"font-weight: bold;",O);for(const[e,...t]of o)L.assert(e in L,`Unknown console method: ${e}`),e in L&&L[e](...t);L.groupEnd(),s()}else s()}function d(){""===r&&(r=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 u(e,...t){0===o.length&&(d(),queueMicrotask(()=>queueMicrotask(c))),o.push([e,...t])}function f(e=I,...n){t[e]?u("log",`${e}: ${performance.now()-t[e]} ms`,...n):u("timeLog",e,...n)}return{...H(i,B(i)),...H(console,e=>[e,(...t)=>u(e,...t)]),...H(W,P),assert:function(e,...t){!0!==e&&u("assert",e,...t)},count:function(e=I){n[e]?n[e]+=1:n[e]=1,u("log",`${e}: ${n[e]}`)},countReset:function(e=I){delete n[e]},endAutoGroup:c,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;u("error",e),c()}return n},event:function(e){d(),i.event=e},purge:a,time:function(e=I){d(),t[e]=performance.now()},timeEnd:function(e=I){f(e),delete t[e]},timeLog:f,touch:d}},Y?.__esModule?Y.default:Y);var Y;let _=!0;const Q=X({expand:!1,label:h}),K=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const ee=e=>(t,...n)=>G[t]?G[t].console[e](...n):Q[e](...n),te=e=>(t,...n)=>!0===(e=>G[e]?G[e].log:_)(t)?ee(e)(t,...n):null,ne=te("log"),oe=ne,ie=te("debug"),re=ee("warn"),ae=ee("error"),se=ee("event"),le=ee("purge"),ce=ee("errorBoundary");const de=(e,...n)=>G[e]?G[e].console.warn(J(Z)(...n)):queueMicrotask(()=>console?.warn(J((e=>(...n)=>[`${t}(${e})`,...n].join(" "))(e))(...n))),ue=(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</>.`))(de),fe=ue("Function"),pe=ue("Option"),me=(e,t,n,o)=>e.addEventListener(t,n,o||!1),he=(e,t,n)=>e.removeEventListener(t,n,!1),ge=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)},ye=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),be=["spjluzl","rlf","clyzpvu"],we=["<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."],ve=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],ze=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),$e=e=>ye(we[e]),je=e=>{const t=e[ye(be[0])]||e[ye(be[1])]||e[ye(be[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=ge(ye(e));return n in ze&&(t=ze[n]),t}(n[0]);return 0===o||(e=>e[2]===ge(e[0]+e[1]))(n)||(o=-2),o};function ke(e,t){const{msgTimeout:n,warningTimeout:o}=t[e];o&&(n&&clearTimeout(n),t[e].msgTimeout=setTimeout(function(){if(void 0===t[e])return;const{initialised:n,loadErrorShown:o}=t[e];t[e].msgTimeout=void 0,n||o||(t[e].loadErrorShown=!0,function(e,t){const{iframe:n,waitForLoad:o}=t[e],{sandbox:i}=n,r=typeof i===y&&i.length>0&&!(i.contains("allow-scripts")&&i.contains("allow-same-origin"));se(e,"noResponse"),de(e,`<rb>No response from iframe</>\n \nThe iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <b>'true'</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <b>'false'</>. \n":""}${r?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n":""}\nThis 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`)}(e,t))},o))}const Te=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:$,firstRun:!0,inPageLinks:!1,heightCalculationMethod:v,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:v,onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{typeof G[e.id].onInit===b&&(pe("init()","onReady()","",e.id),G[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),xe={position:null,version:e};function Me(t){function r(){We(N),Ce(B),I("onResized",N)}function l(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function m(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const y=e=>W.slice(W.indexOf(n)+7+e);const b=(e,t)=>(n,o)=>{const i={};var r,a;r=function(){Ne(`${n} (${e})`,`${e}:${t()}`,o)},i[a=o]||(r(),i[a]=requestAnimationFrame(()=>{i[a]=null}))},w=(e,t)=>()=>{let n=!1;const o=t=>()=>{G[c]?n&&n!==t||(e(t,c),n=t,requestAnimationFrame(()=>{n=!1})):l()},i=o(p),r=o("resize window");function s(e,n){ne(c,`${e}listeners for send${t}`),n(window,p,i),n(window,f,r)}function l(){se(c,`stop${t}`),s("Remove ",he),d.disconnect(),u.disconnect(),he(G[c].iframe,a,l)}const c=B,d=new ResizeObserver(o("pageObserver")),u=new ResizeObserver(o("iframeObserver"));G[c]&&(G[c][`stop${t}`]=l,me(G[c].iframe,a,l),s("Add ",me),d.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),u.observe(G[c].iframe,{attributes:!0,childList:!1,subtree:!1}))},v=e=>()=>{e in G[B]&&(G[B][e](),delete G[B][e])},z=b(c,function(){const e=document.body.getBoundingClientRect(),t=N.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})}),$=b(d,function(){const{iframe:e}=N,{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}})}),j=w(z,"PageInfo"),T=w($,"ParentInfo"),x=v("stopPageInfo"),M=v("stopParentInfo");function E(e){const t=e.getBoundingClientRect();return Oe(B),{x:Number(t.left)+Number(xe.position.x),y:Number(t.top)+Number(xe.position.y)}}function R(e){const t=e?E(N.iframe):{x:0,y:0};oe(B,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,D,U,D);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(N,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){setTimeout(()=>t["scrollTo"+(e?"Offset":"")](n.x,n.y))}(o,n):function(e){xe.position=e,S(B)}(n)}function S(e){const{x:t,y:n}=xe.position,o=G[e]?.iframe;!1!==I("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?Ce(e):Ie()}function O(e){let t={};if(0===N.width&&0===N.height){const e=y(9).split(n);t={x:e[1],y:e[0]}}else t={x:N.width,y:N.height};I(e,{iframe:N.iframe,screenX:Number(t.x),screenY:Number(t.y),type:N.type})}const I=(e,t)=>Ee(B,e,t);function C(){const{height:t,iframe:n,msg:a,type:l,width:f}=N;switch(G[B]?.firstRun&&function(){if(!G[B])return;ne(B,`First run for ${B}`),He(B,N.mode),G[B].firstRun=!1}(),l){case"close":Se(n);break;case s:m=y(6),ne(B,`onMessage passed: {iframe: %c${N.iframe.id}%c, message: %c${m}%c}`,D,U,D,U),I("onMessage",{iframe:N.iframe,message:JSON.parse(m)});break;case"mouseenter":O("onMouseEnter");break;case"mouseleave":O("onMouseLeave");break;case"beforeUnload":oe(B,"Ready state reset"),G[B].initialised=!1;break;case o:G[B].autoResize=JSON.parse(y(9));break;case"scrollBy":!function(){const e=N.width,t=N.height,n=window.parentIframe||window.parentIFrame||window;oe(B,`scrollBy: x: %c${e}%c y: %c${t}`,D,U,D),n.scrollBy(e,t)}();break;case"scrollTo":R(!1);break;case"scrollToOffset":R(!0);break;case c:j();break;case d:T();break;case"pageInfoStop":x();break;case"parentInfoStop":M();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=E(o);oe(B,`Moving to in page link: %c#${t}`,D),xe.position={x:e.x,y:e.y},S(B),window.location.hash=t}():window.top!==window.self?function(){const e=window.parentIframe||window.parentIFrame;e?e.moveToAnchor(t):ne(B,`In page link #${t} not found`)}():ne(B,`In page link #${t} not found`)}(y(9));break;case"title":!function(e,t){G[t]?.syncTitle&&(G[t].iframe.title=e,oe(t,`Set iframe title attribute: %c${e}`,D))}(a,B);break;case u:Ae(N);break;case i:r(),function(e){try{G[e].sameOrigin=!!G[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){G[e].sameOrigin=!1}ne(e,`sameOrigin: %c${G[e].sameOrigin}`,D)}(B),(p=a)!==e&&(void 0!==p?ne(B,`Version mismatch (Child: %c${p}%c !== Parent: %c${e})`,D,U,D):de(B,"<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")),G[B].initialised=!0,I("onReady",n);break;default:if(0===f&&0===t)return void re(B,`Unsupported message received (${l}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===f||0===t)return void ne(B,"Ignoring message with 0 height or width");if(document.hidden)return void ne(B,"Page hidden - ignored resize request");r()}var p,m}function A(e){if(!G[e])throw new Error(`${N.type} No settings for ${e}. Message was: ${W}`)}let W=t.data;if("[iFrameResizerChild]Ready"===W)return L=t.source,void Object.values(G).forEach((e=>({initChild:t,postMessageTarget:n})=>{e===n&&t()})(L));var L;if(!(e=>k===`${e}`.slice(0,13)&&e.slice(13).split(n)[0]in G)(W)){if(typeof W!==g)return;return se(h,"ignoredMessage"),void ie(h,W)}const N=function(e){const t=e.slice(13).split(n),o=t[1]?Number(t[1]):0,i=G[t[0]]?.iframe,r=getComputedStyle(i),a={iframe:i,id:t[0],height:o+l(r)+m(r),width:Number(t[2]),type:t[3],msg:t[4]};return t[5]&&(a.mode=t[5]),a}(W),{id:F,type:P}=N,B=F;B?(se(B,P),ce(B,function(e){A(B),function(){const e=N.type in{true:1,false:1,undefined:1};return e&&ne(B,"Ignoring init message from meta parent page"),e}()||(ne(B,`Received: %c${e}`,D),(null!==N.iframe||(re(B,`The iframe (${N.id}) was not found.`),0))&&function(){const{origin:e,sameOrigin:n}=t;if(n)return!0;let o=G[B]?.checkOrigin;if(o&&"null"!=`${e}`&&!(o.constructor===Array?function(){let t=0,n=!1;for(ne(B,`Checking connection is from allowed list of origins: %c${o}`,D);t<o.length;t++)if(o[t]===e){n=!0;break}return n}():function(){const t=G[B]?.remoteHost;return ne(B,`Checking connection is from: %c${t}`,D),e===t}()))throw new Error(`Unexpected message received from: ${e} for ${N.iframe.id}. Message was: ${t.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&C())})(W)):re("","iframeResizer received messageData without id, message was: ",W)}function Ee(e,t,n){let o=null,i=null;if(G[e]){if(o=G[e][t],typeof o!==b)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{i=o(n)}catch(n){console.error(n),re(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(o,n)}return i}function Re(e){const{id:t}=e;ne(t,"Disconnected from iframe"),delete G[t],delete e.iframeResizer}function Se(e){const{id:t}=e;if(!1!==Ee(t,"onBeforeClose",t)){ne(t,`Removing iFrame: %c${t}`,D);try{e.parentNode&&e.remove()}catch(e){re(t,e)}Ee(t,"onAfterClose",t),Re(e)}else ne(t,"Close iframe cancelled by onBeforeClose")}function Oe(e){null===xe.position&&(xe.position={x:window.scrollX,y:window.scrollY},ne(e,`Get page position: %c${xe.position.x}%c, %c${xe.position.y}`,D,U,D))}function Ie(){xe.position=null}function Ce(e){null!==xe.position&&(window.scrollTo(xe.position.x,xe.position.y),oe(e,`Set page position: %c${xe.position.x}%c, %c${xe.position.y}`,D,U,D),Ie())}function Ae(e){ne(e.id,"Size reset requested by "+(e.type===i?"parent page":"child page")),Oe(e.id),We(e),Ne(u,u,e.id)}function We(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,oe(n,`Set ${t}: %c${o}`,D)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=G[n];o&&t("height"),i&&t("width")}const Le=e=>e.split(n).filter((e,t)=>19!==t).join(n);function Ne(e,t,n){function o(o){const i=e in x?Le(t):t;oe(n,o,D,U,D),oe(n,`Message data: %c${i}`,D)}se(n,e),G[n]&&(G[n]?.postMessageTarget?function(){const{iframe:i,postMessageTarget:r,sameOrigin:a,targetOrigin:s}=G[n];if(a)try{return i.contentWindow.iframeChildListener(k+t),void o(`Sending message to iframe %c${n}%c via same origin%c`)}catch(t){e in x?(G[n].sameOrigin=!1,ne(n,"New iframe does not support same origin")):re(n,"Same origin messaging failed, falling back to postMessage")}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${s}`),r.postMessage(k+t,s)}():re(n,`Iframe(${n}) not found`))}let Fe=0,Pe=!1,Be=!1;function He(t,n=-3){if(Pe)return;const o=Math.max(G[t].mode,n);if(o>G[t].mode&&(G[t].mode=o),o<0)throw le(t),G[t].vAdvised||de(t||"Parent",`${$e(o+2)}${$e(2)}`),G[t].vAdvised=!0,$e(o+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");o>0&&Be||function(e,t){queueMicrotask(()=>console.info(`%ciframe-resizer ${e}`,_||t<1?"font-weight: bold;":S))}(`v${e} (${(e=>ye(ve[e]))(o)})`,o),o<1&&de("Parent",$e(3)),Pe=!0}const qe=e=>c=>{function d(){G[O]?.heightCalculationMethod in T&&Ae({iframe:c,height:1,width:1,type:i})}function u(){if(G[O]){const{iframe:e}=G[O],t={close:Se.bind(null,e),disconnect:Re.bind(null,e),removeListeners(){de(O,"<rb>Deprecated Method Name</>\n\nThe [removeListeners()</> method has been renamed to [disconnect()</>.\n"),this.disconnect()},resize(){de(O,"<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."),Ne.bind(null,"Window resize",f,O)},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,g,"moveToAnchor(anchor) anchor"),Ne("Move to anchor",`moveToAnchor:${e}`,O)},sendMessage(e){e=JSON.stringify(e),Ne(s,`${s}:${e}`,O)}};e.iframeResizer=t,e.iFrameResizer=t}}function p(e,t){const n=n=>()=>{if(!G[e])return;const{firstRun:o,iframe:r}=G[e];Ne(n,t,e),(e=>e===i)(n)&&(e=>"lazy"===e.loading)(r)||ke(e,G),o||d()},{iframe:o}=G[e];G[e].initChild=n(r),function(e,t){me(e,a,()=>setTimeout(t,1))}(o,n(l)),function(e,t){const{iframe:n,waitForLoad:o}=G[e];!0!==o&&((e=>{const{src:t,srcdoc:n}=e;return!n&&(null==t||""===t||"about:blank"===t)})(n)?setTimeout(()=>{se(e,"noContent"),oe(e,"No content detected in the iframe, delaying initialisation")}):setTimeout(t))}(e,n(i))}function h(e){return e?(("sizeWidth"in e||"sizeHeight"in e||o in e)&&de(O,`<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>"${$}"</>, <i>"${j}"</> or <i>"${z}"</>.\n`),e):{}}function b(e){const t=G[e]?.iframe?.title;return""===t||void 0===t}function w(e,t){V(G[O],e)&&(de(O,`<rb>Deprecated option</>\n\nThe <b>${e}</> option has been renamed to <b>${t}</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.`),G[O][t]=G[O][e],delete G[O][e])}const k=e=>V(e,"onMouseEnter")||V(e,"onMouseLeave");function x(e){var t,n;G[O]={...G[O],iframe:c,remoteHost:c?.src.split("/").slice(0,3).join("/"),...Te,...h(e),mouseEvents:k(e),mode:je(e),syncTitle:b(O)},w("offset","offsetSize"),w("onClose","onBeforeClose"),w("onClosed","onAfterClose"),se(O,"setup"),function(){const{direction:e}=G[O];switch(e){case $:break;case j:G[O].sizeHeight=!1;case"both":G[O].sizeWidth=!0;break;case z:G[O].sizeWidth=!1,G[O].sizeHeight=!1,G[O].autoResize=!1;break;default:throw new TypeError(O,`Direction value of "${e}" is not valid`)}ne(O,`direction: %c${e}`,D)}(),(t=e?.offsetSize||e?.offset)&&(G[O].direction===$?(G[O].offsetHeight=t,ne(O,`Offset height: %c${t}`,D)):(G[O].offsetWidth=t,ne(O,`Offset width: %c${t}`,D))),function(e){e?.offset&&de(O,"<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</>.")}(e),G[O].warningTimeout||oe(O,"warningTimeout:%c disabled",D),null===G[O].postMessageTarget&&(G[O].postMessageTarget=c.contentWindow),G[O].targetOrigin=!0===G[O].checkOrigin?""===(n=G[O].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*"}const S=()=>t in c,O=function(t){if(t&&typeof t!==g)throw new TypeError("Invalid id for iFrame. Expected String");return""!==t&&t||(t=function(){let t=e?.id||Te.id+Fe++;return null!==document.getElementById(t)&&(t+=Fe++),t}(),c.id=t,se(t,"assignId"),ne(t,`Added missing iframe ID: ${t} (${c.src})`)),t}(c.id);if(typeof e!==y)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=E,e.logExpand=t.includes("ifrlog=expanded"))}(e),function(e,t){const n=V(t,"log"),o=typeof t.log===g,i=n?!!o||t.log:Te.log;V(t,"logExpand")||(t.logExpand=n&&o?t.log===M:Te.logExpand),function(e){-1===e?.log&&(e.log=!1,Be=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const o=X({expand:t,label:K(n)});_=e,G[n]||(G[n]={console:o})}({enabled:i,expand:t.logExpand,iframeId:e}),o&&!(t.log in R)&&ae(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=i}(O,e),ce(O,function(e){S()?re(O,`Ignored iframe (${O}), already setup.`):(x(e),ne(O,`src: %c${c.srcdoc||c.src}`,D),function(){if(Pe)return;const{mode:e}=G[O];-1!==e&&He(O,e)}(),Ue(),function(){switch(ne(O,`Iframe scrolling ${G[O]?.scrolling?"enabled":"disabled"} for ${O}`),c.style.overflow=!1===G[O]?.scrolling?"hidden":v,G[O]?.scrolling){case"omit":break;case!0:c.scrolling="yes";break;case!1:c.scrolling="no";break;default:c.scrolling=G[O]?G[O].scrolling:"no"}}(),function(){const{bodyMargin:e}=G[O];"number"!=typeof e&&"0"!==e||(G[O].bodyMargin=`${e}px`)}(),p(O,function(e){const{autoResize:t,bodyBackground:o,bodyMargin:i,bodyPadding:r,heightCalculationMethod:a,inPageLinks:s,license:l,log:c,logExpand:d,mouseEvents:u,offsetHeight:f,offsetWidth:p,mode:h,sizeHeight:g,sizeWidth:y,tolerance:b,widthCalculationMethod:w}=G[e];return[e,"8",y,c,"32",!0,t,i,a,o,r,b,s,m,w,u,f,p,g,l,xe.version,h,"",d].join(n)}(O)),u(),ne(O,"Setup complete"))})(e),c?.iframeResizer};function De(){!0!==document.hidden&&((e,t)=>{Object.values(G).filter(({autoResize:e,firstRun:t})=>e&&!t).forEach(({iframe:n})=>Ne(e,t,n.id))})("tabVisible",f)}const Ue=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{me(window,s,Me),me(document,"visibilitychange",De),window.iframeParentListener=e=>setTimeout(()=>Me({data:e,sameOrigin:!0}))}),Je=`[${t}] `;const Ve=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(typeof window===w)return[];switch(t=qe(o),n=[],typeof i){case w:case g:document.querySelectorAll(i||"iframe").forEach(e);break;case y:e(i);break;default:throw new TypeError(`${Je}Unexpected data type (${typeof i})`)}return Object.freeze(n)}}();return typeof window!==w&&(window.iFrameResize=window.iFrameResize||function(...e){fe("iFrameResize()","iframeResize()","",h),Ve(...e)}),Ve});
|
|
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="5.5.7",t="iframeResizer",n=":",o="autoResize",i="init",r="iframeReady",a="load",s="message",l="onload",c="pageInfo",u="parentInfo",d="reset",f="resize",p="scroll",h="child",m="parent",g="string",y="object",b="function",w="undefined",v="auto",z="none",$="vertical",j="horizontal",k="[iFrameSizer]",T=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),x=Object.freeze({[l]:1,[i]:1,[r]:1}),M="expanded",E="collapsed",R=Object.freeze({[M]:1,[E]:1}),S="font-weight: normal;",O=S+"font-style: italic;",C="default",I=Object.freeze({assert:!0,error:!0,warn:!0}),A={expand:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},W={profile:0,profileEnd:0,timeStamp:0,trace:0},L=Object.assign(console);const{fromEntries:N,keys:F}=Object,B=e=>[e,L[e]],P=e=>t=>[t,function(n){e[t]=n}],H=(e,t)=>N(F(e).map(t));const q=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,D=q?"color: #A9C7FB;":"color: #135CD2;",U=q?"color: #E3E3E3;":"color: #1F1F1F;",J=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)),Z=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),V=e=>e,G={},X=(Y=function(e={}){const t={},n={},o=[],i={...A,expand:!e.collapsed||A.expanded,...e};let r="";function a(){o.length=0,r=""}function s(){delete i.event,a()}const l=()=>!!o.some(([e])=>e in I)||!!i.expand;function c(){if(0!==o.length){L[l()?"group":"groupCollapsed"](`%c${i.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(i)} %c${i.showTime?r:""}`,S,"font-weight: bold;",O);for(const[e,...t]of o)L.assert(e in L,`Unknown console method: ${e}`),e in L&&L[e](...t);L.groupEnd(),s()}else s()}function u(){""===r&&(r=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 d(e,...t){0===o.length&&(u(),queueMicrotask(()=>queueMicrotask(c))),o.push([e,...t])}function f(e=C,...n){t[e]?d("log",`${e}: ${performance.now()-t[e]} ms`,...n):d("timeLog",e,...n)}return{...H(i,P(i)),...H(console,e=>[e,(...t)=>d(e,...t)]),...H(W,B),assert:function(e,...t){!0!==e&&d("assert",e,...t)},count:function(e=C){n[e]?n[e]+=1:n[e]=1,d("log",`${e}: ${n[e]}`)},countReset:function(e=C){delete n[e]},endAutoGroup:c,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;d("error",e),c()}return n},event:function(e){u(),i.event=e},purge:a,time:function(e=C){u(),t[e]=performance.now()},timeEnd:function(e=C){f(e),delete t[e]},timeLog:f,touch:u}},Y?.__esModule?Y.default:Y);var Y;let _=!0;const Q=X({expand:!1,label:m}),K=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const ee=e=>(t,...n)=>G[t]?G[t].console[e](...n):Q[e](...n);var te;const ne=(te="log",(e,...t)=>!0===(e=>G[e]?G[e].log:_)(e)?ee(te)(e,...t):null),oe=ee("warn"),ie=ee("error"),re=ee("event"),ae=ee("purge"),se=ee("errorBoundary");const le=(e,...n)=>G[e]?G[e].console.warn(J(V)(...n)):queueMicrotask(()=>console?.warn(J((e=>(...n)=>[`${t}(${e})`,...n].join(" "))(e))(...n))),ce=(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</>.`))(le),ue=ce("Function"),de=ce("Option"),fe=(e,t,n,o)=>e.addEventListener(t,n,o||!1),pe=(e,t,n)=>e.removeEventListener(t,n,!1),he=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)},me=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),ge=["spjluzl","rlf","clyzpvu"],ye=["<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."],be=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],we=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),ve=e=>me(ye[e]),ze=e=>{const t=e[me(ge[0])]||e[me(ge[1])]||e[me(ge[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=he(me(e));return n in we&&(t=we[n]),t}(n[0]);return 0===o||(e=>e[2]===he(e[0]+e[1]))(n)||(o=-2),o};function $e(e,t){const{msgTimeout:n,warningTimeout:o}=t[e];o&&(n&&clearTimeout(n),t[e].msgTimeout=setTimeout(function(){if(void 0===t[e])return;const{initialised:n,loadErrorShown:o}=t[e];t[e].msgTimeout=void 0,n||o||(t[e].loadErrorShown=!0,function(e,t){const{iframe:n,waitForLoad:o}=t[e],{sandbox:i}=n,r=typeof i===y&&i.length>0&&!(i.contains("allow-scripts")&&i.contains("allow-same-origin"));re(e,"noResponse"),le(e,`<rb>No response from iframe</>\n \nThe iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <b>'true'</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <b>'false'</>. \n":""}${r?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n":""}\nThis 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`)}(e,t))},o))}const je=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:$,firstRun:!0,inPageLinks:!1,heightCalculationMethod:v,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:v,onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{typeof G[e.id].onInit===b&&(de("init()","onReady()","",e.id),G[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),ke={position:null,version:e};function Te(t){function r(){Ie(N),Oe(P),C("onResized",N)}function l(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function h(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const y=e=>W.slice(W.indexOf(n)+7+e);const b=(e,t)=>(n,o)=>{const i={};var r,a;r=function(){We(`${n} (${e})`,`${e}:${t()}`,o)},i[a=o]||(r(),i[a]=requestAnimationFrame(()=>{i[a]=null}))},w=(e,t)=>()=>{let n=!1;const o=t=>()=>{G[c]?n&&n!==t||(e(t,c),n=t,requestAnimationFrame(()=>{n=!1})):l()},i=o(p),r=o("resize window");function s(e,t){t(window,p,i),t(window,f,r)}function l(){re(c,`stop${t}`),s(0,pe),u.disconnect(),d.disconnect(),pe(G[c].iframe,a,l)}const c=P,u=new ResizeObserver(o("pageObserver")),d=new ResizeObserver(o("iframeObserver"));G[c]&&(G[c][`stop${t}`]=l,fe(G[c].iframe,a,l),s(0,fe),u.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(G[c].iframe,{attributes:!0,childList:!1,subtree:!1}))},v=e=>()=>{e in G[P]&&(G[P][e](),delete G[P][e])},z=b(c,function(){const e=document.body.getBoundingClientRect(),t=N.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})}),$=b(u,function(){const{iframe:e}=N,{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}})}),j=w(z,"PageInfo"),T=w($,"ParentInfo"),x=v("stopPageInfo"),M=v("stopParentInfo");function E(e){const t=e.getBoundingClientRect();return Re(),{x:Number(t.left)+Number(ke.position.x),y:Number(t.top)+Number(ke.position.y)}}function R(e){const t=e?E(N.iframe):{x:0,y:0};ne(P,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,D,U,D);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(N,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){setTimeout(()=>t["scrollTo"+(e?"Offset":"")](n.x,n.y))}(o,n):function(e){ke.position=e,S(P)}(n)}function S(e){const{x:t,y:n}=ke.position,o=G[e]?.iframe;!1!==C("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?Oe(e):Se()}function O(e){let t={};if(0===N.width&&0===N.height){const e=y(9).split(n);t={x:e[1],y:e[0]}}else t={x:N.width,y:N.height};C(e,{iframe:N.iframe,screenX:Number(t.x),screenY:Number(t.y),type:N.type})}const C=(e,t)=>xe(P,e,t);function I(){const{height:t,iframe:n,msg:a,type:l,width:f}=N;switch(G[P]?.firstRun&&function(){if(!G[P])return;Be(P,N.mode),G[P].firstRun=!1}(),l){case"close":Ee(n);break;case s:h=y(6),C("onMessage",{iframe:N.iframe,message:JSON.parse(h)});break;case"mouseenter":O("onMouseEnter");break;case"mouseleave":O("onMouseLeave");break;case"beforeUnload":ne(P,"Ready state reset"),G[P].initialised=!1;break;case o:G[P].autoResize=JSON.parse(y(9));break;case"scrollBy":!function(){const e=N.width,t=N.height,n=window.parentIframe||window.parentIFrame||window;ne(P,`scrollBy: x: %c${e}%c y: %c${t}`,D,U,D),n.scrollBy(e,t)}();break;case"scrollTo":R(!1);break;case"scrollToOffset":R(!0);break;case c:j();break;case u:T();break;case"pageInfoStop":x();break;case"parentInfoStop":M();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=E(o);ne(P,`Moving to in page link: %c#${t}`,D),ke.position={x:e.x,y:e.y},S(P),window.location.hash=t}():window.top!==window.self&&function(){const e=window.parentIframe||window.parentIFrame;e&&e.moveToAnchor(t)}()}(y(9));break;case"title":!function(e,t){G[t]?.syncTitle&&(G[t].iframe.title=e,ne(t,`Set iframe title attribute: %c${e}`,D))}(a,P);break;case d:Ce(N);break;case i:r(),function(e){try{G[e].sameOrigin=!!G[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){G[e].sameOrigin=!1}}(P),(p=a)!==e&&(void 0!==p||le(P,"<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")),G[P].initialised=!0,C("onReady",n);break;default:if(0===f&&0===t)return void oe(P,`Unsupported message received (${l}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===f||0===t)return;if(document.hidden)return;r()}var p,h}function A(e){if(!G[e])throw new Error(`${N.type} No settings for ${e}. Message was: ${W}`)}let W=t.data;if("[iFrameResizerChild]Ready"===W)return L=t.source,void Object.values(G).forEach((e=>({initChild:t,postMessageTarget:n})=>{e===n&&t()})(L));var L;if(!(e=>k===`${e}`.slice(0,13)&&e.slice(13).split(n)[0]in G)(W)){if(typeof W!==g)return;return void re(m,"ignoredMessage")}const N=function(e){const t=e.slice(13).split(n),o=t[1]?Number(t[1]):0,i=G[t[0]]?.iframe,r=getComputedStyle(i),a={iframe:i,id:t[0],height:o+l(r)+h(r),width:Number(t[2]),type:t[3],msg:t[4]};return t[5]&&(a.mode=t[5]),a}(W),{id:F,type:B}=N,P=F;P?(re(P,B),se(P,function(e){A(P),N.type in{true:1,false:1,undefined:1}||(null!==N.iframe||(oe(P,`The iframe (${N.id}) was not found.`),0))&&function(){const{origin:e,sameOrigin:n}=t;if(n)return!0;let o=G[P]?.checkOrigin;if(o&&"null"!=`${e}`&&!(o.constructor===Array?function(){let t=0,n=!1;for(;t<o.length;t++)if(o[t]===e){n=!0;break}return n}():function(){const t=G[P]?.remoteHost;return e===t}()))throw new Error(`Unexpected message received from: ${e} for ${N.iframe.id}. Message was: ${t.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&I()})(W)):oe("","iframeResizer received messageData without id, message was: ",W)}function xe(e,t,n){let o=null,i=null;if(G[e]){if(o=G[e][t],typeof o!==b)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{i=o(n)}catch(n){console.error(n),oe(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(o,n)}return i}function Me(e){const{id:t}=e;delete G[t],delete e.iframeResizer}function Ee(e){const{id:t}=e;if(!1!==xe(t,"onBeforeClose",t)){try{e.parentNode&&e.remove()}catch(e){oe(t,e)}xe(t,"onAfterClose",t),Me(e)}}function Re(e){null===ke.position&&(ke.position={x:window.scrollX,y:window.scrollY})}function Se(){ke.position=null}function Oe(e){null!==ke.position&&(window.scrollTo(ke.position.x,ke.position.y),ne(e,`Set page position: %c${ke.position.x}%c, %c${ke.position.y}`,D,U,D),Se())}function Ce(e){Re(e.id),Ie(e),We(d,d,e.id)}function Ie(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,ne(n,`Set ${t}: %c${o}`,D)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=G[n];o&&t("height"),i&&t("width")}const Ae=e=>e.split(n).filter((e,t)=>19!==t).join(n);function We(e,t,n){function o(o){const i=e in x?Ae(t):t;ne(n,o,D,U,D),ne(n,`Message data: %c${i}`,D)}re(n,e),G[n]&&(G[n]?.postMessageTarget?function(){const{iframe:i,postMessageTarget:r,sameOrigin:a,targetOrigin:s}=G[n];if(a)try{return i.contentWindow.iframeChildListener(k+t),void o(`Sending message to iframe %c${n}%c via same origin%c`)}catch(t){e in x?G[n].sameOrigin=!1:oe(n,"Same origin messaging failed, falling back to postMessage")}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${s}`),r.postMessage(k+t,s)}():oe(n,`Iframe(${n}) not found`))}let Le=0,Ne=!1,Fe=!1;function Be(t,n=-3){if(Ne)return;const o=Math.max(G[t].mode,n);if(o>G[t].mode&&(G[t].mode=o),o<0)throw ae(t),G[t].vAdvised||le(t||"Parent",`${ve(o+2)}${ve(2)}`),G[t].vAdvised=!0,ve(o+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");o>0&&Fe||function(e,t){queueMicrotask(()=>console.info(`%ciframe-resizer ${e}`,_||t<1?"font-weight: bold;":S))}(`v${e} (${(e=>me(be[e]))(o)})`,o),o<1&&le("Parent",ve(3)),Ne=!0}const Pe=e=>c=>{function u(){G[O]?.heightCalculationMethod in T&&Ce({iframe:c,height:1,width:1,type:i})}function d(){if(G[O]){const{iframe:e}=G[O],t={close:Ee.bind(null,e),disconnect:Me.bind(null,e),removeListeners(){le(O,"<rb>Deprecated Method Name</>\n\nThe [removeListeners()</> method has been renamed to [disconnect()</>.\n"),this.disconnect()},resize(){le(O,"<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."),We.bind(null,"Window resize",f,O)},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,g,"moveToAnchor(anchor) anchor"),We("Move to anchor",`moveToAnchor:${e}`,O)},sendMessage(e){e=JSON.stringify(e),We(s,`${s}:${e}`,O)}};e.iframeResizer=t,e.iFrameResizer=t}}function p(e,t){const n=n=>()=>{if(!G[e])return;const{firstRun:o,iframe:r}=G[e];We(n,t,e),(e=>e===i)(n)&&(e=>"lazy"===e.loading)(r)||$e(e,G),o||u()},{iframe:o}=G[e];G[e].initChild=n(r),function(e,t){fe(e,a,()=>setTimeout(t,1))}(o,n(l)),function(e,t){const{iframe:n,waitForLoad:o}=G[e];!0!==o&&((e=>{const{src:t,srcdoc:n}=e;return!n&&(null==t||""===t||"about:blank"===t)})(n)?setTimeout(()=>{re(e,"noContent"),ne(e,"No content detected in the iframe, delaying initialisation")}):setTimeout(t))}(e,n(i))}function m(e){return e?(("sizeWidth"in e||"sizeHeight"in e||o in e)&&le(O,`<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>"${$}"</>, <i>"${j}"</> or <i>"${z}"</>.\n`),e):{}}function b(e){const t=G[e]?.iframe?.title;return""===t||void 0===t}function w(e,t){Z(G[O],e)&&(le(O,`<rb>Deprecated option</>\n\nThe <b>${e}</> option has been renamed to <b>${t}</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.`),G[O][t]=G[O][e],delete G[O][e])}const k=e=>Z(e,"onMouseEnter")||Z(e,"onMouseLeave");function x(e){var t,n;G[O]={...G[O],iframe:c,remoteHost:c?.src.split("/").slice(0,3).join("/"),...je,...m(e),mouseEvents:k(e),mode:ze(e),syncTitle:b(O)},w("offset","offsetSize"),w("onClose","onBeforeClose"),w("onClosed","onAfterClose"),re(O,"setup"),function(){const{direction:e}=G[O];switch(e){case $:break;case j:G[O].sizeHeight=!1;case"both":G[O].sizeWidth=!0;break;case z:G[O].sizeWidth=!1,G[O].sizeHeight=!1,G[O].autoResize=!1;break;default:throw new TypeError(O,`Direction value of "${e}" is not valid`)}}(),(t=e?.offsetSize||e?.offset)&&(G[O].direction===$?G[O].offsetHeight=t:G[O].offsetWidth=t),function(e){e?.offset&&le(O,"<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</>.")}(e),G[O].warningTimeout||ne(O,"warningTimeout:%c disabled",D),null===G[O].postMessageTarget&&(G[O].postMessageTarget=c.contentWindow),G[O].targetOrigin=!0===G[O].checkOrigin?""===(n=G[O].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*"}const S=()=>t in c,O=function(t){if(t&&typeof t!==g)throw new TypeError("Invalid id for iFrame. Expected String");return""!==t&&t||(t=function(){let t=e?.id||je.id+Le++;return null!==document.getElementById(t)&&(t+=Le++),t}(),c.id=t,re(t,"assignId")),t}(c.id);if(typeof e!==y)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=E,e.logExpand=t.includes("ifrlog=expanded"))}(e),function(e,t){const n=Z(t,"log"),o=typeof t.log===g,i=n?!!o||t.log:je.log;Z(t,"logExpand")||(t.logExpand=n&&o?t.log===M:je.logExpand),function(e){-1===e?.log&&(e.log=!1,Fe=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const o=X({expand:t,label:K(n)});_=e,G[n]||(G[n]={console:o})}({enabled:i,expand:t.logExpand,iframeId:e}),o&&!(t.log in R)&&ie(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=i}(O,e),se(O,function(e){S()?oe(O,`Ignored iframe (${O}), already setup.`):(x(e),function(){if(Ne)return;const{mode:e}=G[O];-1!==e&&Be(O,e)}(),qe(),function(){switch(c.style.overflow=!1===G[O]?.scrolling?"hidden":v,G[O]?.scrolling){case"omit":break;case!0:c.scrolling="yes";break;case!1:c.scrolling="no";break;default:c.scrolling=G[O]?G[O].scrolling:"no"}}(),function(){const{bodyMargin:e}=G[O];"number"!=typeof e&&"0"!==e||(G[O].bodyMargin=`${e}px`)}(),p(O,function(e){const{autoResize:t,bodyBackground:o,bodyMargin:i,bodyPadding:r,heightCalculationMethod:a,inPageLinks:s,license:l,log:c,logExpand:u,mouseEvents:d,offsetHeight:f,offsetWidth:p,mode:m,sizeHeight:g,sizeWidth:y,tolerance:b,widthCalculationMethod:w}=G[e];return[e,"8",y,c,"32",!0,t,i,a,o,r,b,s,h,w,d,f,p,g,l,ke.version,m,"",u].join(n)}(O)),d())})(e),c?.iframeResizer};function He(){!0!==document.hidden&&((e,t)=>{Object.values(G).filter(({autoResize:e,firstRun:t})=>e&&!t).forEach(({iframe:n})=>We(e,t,n.id))})("tabVisible",f)}const qe=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{fe(window,s,Te),fe(document,"visibilitychange",He),window.iframeParentListener=e=>setTimeout(()=>Te({data:e,sameOrigin:!0}))}),De=`[${t}] `;const Ue=function(){function e(e){switch(!0){case!e:throw new TypeError(`${De}iframe is not defined`);case!e.tagName:throw new TypeError(`${De}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${De}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(o,i){if(typeof window===w)return[];switch(t=Pe(o),n=[],typeof i){case w:case g:document.querySelectorAll(i||"iframe").forEach(e);break;case y:e(i);break;default:throw new TypeError(`${De}Unexpected data type (${typeof i})`)}return Object.freeze(n)}}();return typeof window!==w&&(window.iFrameResize=window.iFrameResize||function(...e){ue("iFrameResize()","iframeResize()","",m),Ue(...e)}),Ue});
|