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