iframe-resizer 5.4.0-beta.1 → 5.4.0-beta.2
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.min.js +2 -2
- package/js/iframeResizer.js +2 -2
- package/js/iframeResizer.js.map +1 -1
- package/js/iframeResizer.min.js +2 -2
- package/js/iframeResizer.min.js.map +1 -1
- package/package.json +4 -4
package/index.cjs.js
CHANGED
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/legacy (child) 5.4.0-beta.
|
|
4
|
+
* @module iframe-resizer/legacy (child) 5.4.0-beta.2 (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="5.4.0-beta.1",t=10,n="data-iframe-size",o="data-overflowed",i="bottom",r="right",a="resizeParent",l=(e,t,n,o)=>e.addEventListener(t,n,o||!1),s=["<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 c=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(s[e]),d=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},u=e=>e,m=e=>Math.round(1e3*e)/1e3,f=e=>e.charAt(0).toUpperCase()+e.slice(1),p=e=>""!=`${e}`&&void 0!==e;function h(e){switch(!0){case!p(e):return"";case p(e.id):return`${e.nodeName}#${e.id}`;case p(e.name):return`${e.nodeName} (${e.name}`;case p(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}const g="default",y={collapsed:!1,defaultEvent:void 0,event:void 0,label:"Auto Group",showTime:!0},v={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:b,keys:z}=Object,w=e=>t=>[t,function(n){e[t]=n}],$=(e,t)=>b(z(e).map(t));let S=!0;const M=function(e){const t=[],n={},o={...y,...e};let i;function r(){t.length=0}function a(){delete o.event,r()}const l=()=>!t.some((([e])=>"error"===e||"warn"===e))&&o.collapsed;function s(){if(0!==t.length){console[l()?"groupCollapsed":"group"](`%c${o.label} %c${(e=>{const t=e.event||e.defaultEvent;return t?`${t} `:""})(o)}%c${o.showTime?i:""}`,"font-weight: normal;","font-weight: bold;","font-weight: normal;font-style: italic;");for(const[e,...n]of t)console[e](...n);console.groupEnd(),a()}else a()}function c(){i=function(){const e=new Date,t=(t,n)=>e[`get${t}`]().toString().padStart(n,"0");return`@ ${t("Hours",2)}:${t("Minutes",2)}:${t("Seconds",2)}.${t("Milliseconds",3)}`}(),queueMicrotask((()=>queueMicrotask(s)))}function d(e,...n){0===t.length&&c(),t.push([e,...n])}function u(e=g,...t){d("log",`${e}: ${performance.now()-n[e]} ms`,...t)}return{...$(o,w(o)),...$(console,(e=>[e,(...t)=>d(e,...t)])),...$(v,(e=>[e,console[e]])),endAutoGroup:s,purge:r,time:function(e=g){n[e]=performance.now()},timeEnd:function(e=g){u(e),delete n[e]},timeLog:u}}({label:"iframeResizer(child)"});const E=e=>(...t)=>!S||M[e](...t),j=E("log"),k=E("info"),{event:O,assert:P,debug:A,endAutoGroup:T,error:C,warn:I}=M,N=(...e)=>{return M.warn((t=u,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},R=N,x=(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</>.`))(((e,...t)=>N(...t))),q=x("Method"),L=x("Method","replaced with"),B=x("Option"),F=e=>{const t=e.side||i,n=e.onChange||u,r={root:e.root,rootMargin:"0px",threshold:1};function a(){const e=document.querySelectorAll(`[${o}]`);n(e)}const l=new IntersectionObserver((function(e){for(const n of e){const{boundingClientRect:e,rootBounds:i,target:r}=n,a=e[t],l=0===a||a>i[t];r.toggleAttribute(o,l)}requestAnimationFrame(a)}),r),s=new WeakSet;return function(e){j("Attached overflowObserver");for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}},W="--ifr-start",D="--ifr-end",V=[],H=new WeakSet,J=e=>"object"==typeof e&&H.add(e);let U={},Z=0;const Q=setInterval((()=>{if(V.length<10)return;if(U.hasTags&&U.len<25)return;V.sort();const e=Math.min(V.reduce(((e,t)=>e+t),0)/V.length,V[Math.floor(V.length/2)]),t=m(e);t>Z&&(Z=t,j("%cPage size calculation timings:","font-weight: bold;"),j(" Mean time:",m(V[Math.floor(V.length/2)])),j(" Median time:",m(V.reduce(((e,t)=>e+t),0)/V.length)),j(" Average time:",t),j(" Max time:",m(Math.max(...V)))),e<=4||(clearInterval(Q),N(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${m(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${U.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function G(e){e.getEntries().forEach((e=>{if(e.name===D){const{duration:t}=performance.measure("--ifr-measure",W,D);U=e.detail,V.push(t),V.length>100&&V.shift()}}))}function _(){new PerformanceObserver(G).observe({entryTypes:["mark"]}),J(document.documentElement),J(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",_):_()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},s={height:()=>(I("Custom height calculation function not defined"),Ue.auto()),width:()=>(I("Custom width calculation function not defined"),Ze.auto())},p={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},g={},y="checkVisibility"in window,v="auto",b="[iFrameSizer]",z={max:1,min:1,bodyScroll:1,documentElementScroll:1},w="scroll";let $,E,P,C,x,V=!0,H="",J=0,U="",Z="",Q=!0,G=!1,_=!0,X=!1,Y=!1,K=1,ee=v,te=!0,ne="",oe={},ie=!1,re=0,ae=!1,le="",se=u,ce=[],de="child",ue=null,me=!1,fe="",pe=[],he=window.parent,ge="*",ye=0,ve=!1,be="",ze=1,we=w,$e=window,Se=()=>{I("onMessage function not defined")},Me=()=>{},Ee=null,je=null;function ke(){var o,d,u,m;!function(){const e=e=>"true"===e,t=ne.slice(13).split(":");le=t[0],J=void 0===t[1]?J:Number(t[1]),G=void 0===t[2]?G:e(t[2]),ie=void 0===t[3]?ie:e(t[3]),V=void 0===t[6]?V:e(t[6]),U=t[7],ee=void 0===t[8]?ee:t[8],H=t[9],Z=t[10],ye=void 0===t[11]?ye:Number(t[11]),oe.enable=void 0!==t[12]&&e(t[12]),de=void 0===t[13]?de:t[13],we=void 0===t[14]?we:t[14],ae=void 0===t[15]?ae:e(t[15]),$=void 0===t[16]?$:Number(t[16]),E=void 0===t[17]?E:Number(t[17]),Q=void 0===t[18]?Q:e(t[18]),t[19],be=t[20]||be,re=void 0===t[21]?re:Number(t[21])}(),o={id:le,enabled:ie},M.label(`${o.id}`),S=o.enabled,j(`Initialising iframe v${e} (${window.location.href})`),function(){function e(e){j(`Reading data from page: ${JSON.stringify(e)}`),Se=e?.onMessage||Se,Me=e?.onReady||Me,"number"==typeof e?.offset&&(B("offset","offsetSize"),Q&&($=e?.offset),G&&(E=e?.offset)),"number"==typeof e?.offsetSize&&(Q&&($=e?.offsetSize),G&&(E=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(fe=e.sizeSelector),ge=e?.targetOrigin||ge,ee=e?.heightCalculationMethod||ee,we=e?.widthCalculationMethod||we}function t(e,t){return"function"==typeof e&&(j(`Setup custom ${t}CalcMethod`),s[t]=e,e="custom"),e}if(1===re)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),ee=t(ee,"height"),we=t(we,"width"),j(`TargetOrigin for parent set to: ${ge}`))}(),function(){try{me=1===re||"iframeParentListener"in window.parent}catch(e){j("Cross domain iframe detected.")}}(),re<0?R(`${c(re+2)}${c(2)}`):be.codePointAt(0)>4||re<2&&R(c(3)),be&&""!==be&&"false"!==be?be!==e&&N(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${be} - Child page: ${e}.\n`):N("<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"),Re(),xe(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.toggleAttribute(n,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&N("<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&&N("<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"),Pe(),Q!==G&&(j("Setup OverflowObserver"),se=F({onChange:Oe,root:document.documentElement,side:Q?i:r})),1!==re&&($e.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===V?(V=!0,Xe("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===V&&(V=!1),et(0,0,"autoResize",JSON.stringify(V)),V),close(){et(0,0,"close")},getId:()=>le,getOrigin:()=>(q("getOrigin()","getParentOrigin()"),P),getParentOrigin:()=>P,getPageInfo(e){if("function"==typeof e)return Ee=e,et(0,0,"pageInfo"),void L("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Ee=null,et(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return je=e,et(0,0,"parentInfo"),()=>{je=null,et(0,0,"parentInfoStop")}},getParentProperties(e){q("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){oe.findTarget(e)},reset(){Ke("parentIframe.reset")},scrollBy(e,t){et(t,e,"scrollBy")},scrollTo(e,t){et(t,e,"scrollTo")},scrollToOffset(e,t){et(t,e,"scrollToOffset")},sendMessage(e,t){et(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){ee=e,Re()},setWidthCalculationMethod(e){we=e,xe()},setTargetOrigin(e){j(`Set targetOrigin: ${e}`),ge=e},resize(e,t){Xe(a,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){q("size()","resize()"),this.resize(e,t)}}),$e.parentIFrame=$e.parentIframe),function(){function e(e){et(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){j(`Add event listener: ${n}`),l(window.document,t,e)}!0===ae&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),oe=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function o(e){function t(e){const t=n(e);j(`Moving to in page link (#${o}) at x: ${t.x}y: ${t.y}`),et(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?(j(`In page link (#${o}) not found in iFrame, so sending to parent`),et(0,0,"inPageLink",`#${o}`)):t(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&l(e,"click",(t=>{t.preventDefault(),o(e.getAttribute("href"))}))}function a(){l(window,"hashchange",i)}function s(){setTimeout(i,128)}function c(){j("Setting up location.hash handlers"),r(),a(),s()}return oe.enable?1===re?N("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):c():j("In page linking not enabled"),{findTarget:o}}(),Ae(De(document)()),void 0===U&&(U=`${J}px`),Te("margin",(u="margin",(m=U).includes("-")&&(I(`Negative CSS value ignored for ${u}`),m=""),m)),Te("background",H),Te("padding",Z),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),j('HTML & body height set to "auto !important"')}(),Ce(),!0!==V&&j("Auto Resize disabled"),Ie({method:d="add",eventType:"After Print",eventName:"afterprint"}),Ie({method:d,eventType:"Before Print",eventName:"beforeprint"}),Ie({method:d,eventType:"Ready State Change",eventName:"readystatechange"}),function(){const e=new Set;let t=!1,n=0,o=[];const i=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)}},r=16,a=2,l=200;let s=1;function c(){j("MutationObserver: processMutations");const d=performance.now(),u=d-n,m=r*s+++a;if(u>m&&u<l)return j(`MutationObserver delay: ${u}ms > ${m}`),setTimeout(c,r*s),void(n=d);s=1,o.forEach(i),o=[],0!==e.size?(Ce(),Pe(),Ae(e),e.forEach(Be),e.clear(),t=!1):t=!1}function d(e){o.push(e),t||(n=performance.now(),t=!0,requestAnimationFrame(c))}function u(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return j("Setup <body> MutationObserver"),e.observe(t,n),e}u()}(),j("Setup ResizeObserver"),ue=new ResizeObserver(qe),ue.observe(document.body),Le.add(document.body),Be(document.body),queueMicrotask(Me),j("Initialization complete"),Xe("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&et(0,0,"title",document.title)}function Oe(e){j("Overflowed Elements:",e.length),ce=e,X=ce.length>0,Xe("overflowObserver","Overflow updated")}function Pe(){pe=document.querySelectorAll(`[${n}]`),Y=pe.length>0,j(`Tagged elements found: ${Y}`)}function Ae(e){Y||se(e)}function Te(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),j(`Body ${e} set to "${t}"`))}function Ce(){if(""!==fe){j(`Applying sizeSelector: ${fe}`);for(const e of document.querySelectorAll(fe))j(`Applying data-iframe-size to: ${h(e)}`),e.dataset.iframeSize=!0}}function Ie(e){({add(t){function n(){Xe(e.eventName,e.eventType)}g[t]=n,l(window,t,n,{passive:!0})},remove(e){const t=g[e];var n,o;delete g[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),j(`${f(e.method)} event listener: ${e.eventType}`)}function Ne(e,t,n,o){return t!==e&&(e in n||(I(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in p&&N(`<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 remove this option.`),j(`${f(o)} calculation method set to "${e}"`)),e}function Re(){ee=Ne(ee,v,Ue,"height")}function xe(){we=Ne(we,w,Ze,"width")}function qe(e){Array.isArray(e)&&0!==e.length&&Xe("resizeObserver",`Element resized <${h(e[0].target)}>`)}const Le=new WeakSet;function Be(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!Le.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(ue.observe(e),Le.add(e),j(`Attached resizeObserver: ${h(e)}`))}const t=De(e)();for(const e of t){if(Le.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(ue.observe(e),Le.add(e),j(`Attached resizeObserver: ${h(e)}`))}}function Fe(e){performance.mark(W);const t=f(e);let n=0,i=document.documentElement,r=Y?0:document.documentElement.getBoundingClientRect().bottom;const a=Y?pe:X?ce:De(document)();let l=a.length;for(const t of a)Y||!y||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,i=t)):l-=1;return k(`${t} position calculated from:`,i),performance.mark(D,{detail:{Side:t,len:l,hasTags:Y,logging:ie}}),r}const We=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],De=e=>()=>e.querySelectorAll("* :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)"),Ve={height:0,width:0},He={height:0,width:0};function Je(e){function t(){return He[o]=i,Ve[o]=l,i}const n=e===Ue,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),s=`HTML: ${i} Page: ${l}`;let c=0;switch(!0){case!e.enabled():return l;case Y:k("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!X&&0===He[o]&&0===Ve[o]:k(`Initial page size values: ${s}`),c=t();break;case ve&&i===He[o]&&l===Ve[o]:k(`Size unchanged: ${s}`),c=Math.max(i,l);break;case 0===i:k(`Page is hidden: ${s}`),c=l;break;case!X&&i!==He[o]&&l<=Ve[o]:k(`New <html> bounding size: ${s}`,"Previous bounding size:",He[o]),c=t();break;case!n:c=e.taggedElement();break;case!X&&i<He[o]:k("<html> bounding size decreased:",s),c=t();break;case l===a||l===r:k("<html> bounding size equals page size:",s),c=t();break;case i>l:k(`Page size < <html> bounding size: ${s}`),c=t();break;case X:k("Found element overflowing <html> "),c=e.taggedElement();break;default:c=t()}return k(`Calculated content ${o}: ${c}px`),c}const Ue={enabled:()=>Q,getOffset:()=>$,auto:()=>Je(Ue),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Ue.bodyOffset(),custom:()=>s.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...We(Ue)),min:()=>Math.min(...We(Ue)),grow:()=>Ue.max(),lowestElement:()=>Fe(i),taggedElement:()=>Fe(i)},Ze={enabled:()=>G,getOffset:()=>E,auto:()=>Je(Ze),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>s.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...We(Ze)),min:()=>Math.min(...We(Ze)),rightMostElement:()=>Fe(r),scroll:()=>Math.max(Ze.bodyScroll(),Ze.documentElementScroll()),taggedElement:()=>Fe(r)},Qe=(e,t)=>!(Math.abs(e-t)<=ye);let Ge=!1;const _e=d((()=>R(c(4))));function Xe(e,t,n,o,i){x=performance.now(),O(e),V||e===a?document.hidden?j("Page hidden - Ignored resize request"):(Ge||(j(`Resize event: ${t}`),C=!0,function(e,t,n,o,i){const r=void 0===n?Ue[ee]():n,l=void 0===o?Ze[we]():o;Q&&Qe(K,r)||G&&Qe(ze,l)||"init"===e?(K=r,ze=l,et(K,ze,e,i)):!e!==a&&(Q&&ee in z||G&&we in z)?Ke(t):(k("No change in content size detected"),C=!1)}(e,t,n,o,i),requestAnimationFrame((()=>{Ge=!1}))),Ge=!0):k("Resizing disabled")}function Ye(e){K=Ue[ee](),ze=Ze[we](),et(K,ze,e)}function Ke(e){const t=ee;ee=v,j(`Reset trigger event: ${e}`),ve?j("TriggerLock blocked calculation"):(ve=!0,A("Trigger event lock on"),requestAnimationFrame((()=>{ve=!1,A("Trigger event lock off")}))),Ye("reset"),ee=t}function et(e,t,n,o,i){re<-1||(O(n),void 0!==i?j(`Message targetOrigin: ${i}`):i=ge,function(){const r=`${le}:${e+($||0)}:${t+(E||0)}:${n}${void 0===o?"":`:${o}`}`;if(me)try{window.parent.iframeParentListener(b+r)}catch(e){if(1!==re)throw e;return void _e()}else he.postMessage(b+r,i);k("Sending message to host page via "+(me?"sameDomain":"postMessage")),k(`%c${r}`,"font-style: italic"),C&&k(function(){const e=m(performance.now()-x);return"init"===n?`Initialised iFrame in %c${e}ms`:`Content size recalculated in %c${e}ms`}(),"font-weight:bold;color:#777"),C=!1}(),T())}function tt(e){const{freeze:t}=Object,{parse:n}=JSON,o=e=>et(0,0,`${e}Stop`),i={init:function(){ne=e.data,he=e.source,P=e.origin,ke(),_=!1,setTimeout((()=>{te=!1}),128)},reset(){te?j("Page reset ignored by init"):(j("Page size reset by host page"),Ye("resetPage"))},resize(){Xe(a,"Parent window requested size check")},moveToAnchor(){oe.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();j(`PageInfo received from parent: ${e}`),Ee?setTimeout((()=>Ee(n(e)))):o("pageInfo")},parentInfo(){const e=l();j(`ParentInfo received from parent: ${e}`),je?setTimeout((()=>je(t(n(e))))):o("parentInfo")},message(){const e=l();j(`onMessage called from parent: ${e}`),setTimeout((()=>Se(n(e))))}},r=()=>e.data.split("]")[1].split(":")[0],l=()=>e.data.slice(e.data.indexOf(":")+1),s=()=>e.data.split(":")[2]in{true:1,false:1};function c(){const t=r();t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||I(`Unexpected message (${e.data})`)}b===`${e.data}`.slice(0,13)&&(O(r()),!1!==_?s()?i.init():j(`Ignored message of type "${r()}". Received before initialization.`):c())}function nt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?I("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>tt({data:e}))),l(window,"message",tt),l(window,"readystatechange",nt),nt())}()}();
|
|
20
|
+
!function(){"use strict";const e="5.4.0-beta.2",t=10,n="data-iframe-size",o="data-overflowed",i="bottom",r="right",a="resizeParent",l=(e,t,n,o)=>e.addEventListener(t,n,o||!1),s=["<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 c=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(s[e]),d=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},u=e=>e,m=e=>Math.round(1e3*e)/1e3,f=e=>e.charAt(0).toUpperCase()+e.slice(1),p=e=>""!=`${e}`&&void 0!==e;function h(e){switch(!0){case!p(e):return"";case p(e.id):return`${e.nodeName}#${e.id}`;case p(e.name):return`${e.nodeName} (${e.name}`;case p(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}const g="default",y={collapsed:!1,defaultEvent:void 0,event:void 0,label:"Auto Group",showTime:!0},v={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:b,keys:z}=Object,w=e=>t=>[t,function(n){e[t]=n}],$=(e,t)=>b(z(e).map(t));let S=!0;const M=function(e){const t=[],n={},o={...y,...e};let i;function r(){t.length=0}function a(){delete o.event,r()}const l=()=>!t.some((([e])=>"error"===e||"warn"===e))&&o.collapsed;function s(){if(0!==t.length){console[l()?"groupCollapsed":"group"](`%c${o.label} %c${(e=>{const t=e.event||e.defaultEvent;return t?`${t} `:""})(o)}%c${o.showTime?i:""}`,"font-weight: normal;","font-weight: bold;","font-weight: normal;font-style: italic;");for(const[e,...n]of t)console[e](...n);console.groupEnd(),a()}else a()}function c(){i=function(){const e=new Date,t=(t,n)=>e[`get${t}`]().toString().padStart(n,"0");return`@ ${t("Hours",2)}:${t("Minutes",2)}:${t("Seconds",2)}.${t("Milliseconds",3)}`}(),queueMicrotask((()=>queueMicrotask(s)))}function d(e,...n){0===t.length&&c(),t.push([e,...n])}function u(e=g,...t){d("log",`${e}: ${performance.now()-n[e]} ms`,...t)}return{...$(o,w(o)),...$(console,(e=>[e,(...t)=>d(e,...t)])),...$(v,(e=>[e,console[e]])),endAutoGroup:s,purge:r,time:function(e=g){n[e]=performance.now()},timeEnd:function(e=g){u(e),delete n[e]},timeLog:u}}({label:"iframeResizer(child)"});const E=e=>(...t)=>!S||M[e](...t),j=E("log"),k=E("info"),{event:O,assert:P,debug:A,endAutoGroup:T,error:C,warn:I}=M,N=(...e)=>{return M.warn((t=u,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},R=N,x=(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</>.`))(((e,...t)=>N(...t))),q=x("Method"),L=x("Method","replaced with"),B=x("Option"),F=e=>{const t=e.side||i,n=e.onChange||u,r={root:e.root,rootMargin:"0px",threshold:1};function a(){const e=document.querySelectorAll(`[${o}]`);n(e)}const l=new IntersectionObserver((function(e){for(const n of e){const{boundingClientRect:e,rootBounds:i,target:r}=n,a=e[t],l=0===a||a>i[t];r.toggleAttribute(o,l)}requestAnimationFrame(a)}),r),s=new WeakSet;return function(e){j("Attached overflowObserver");for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}},W="--ifr-start",D="--ifr-end",V=[],H=new WeakSet,J=e=>"object"==typeof e&&H.add(e);let U={},Z=0;const Q=setInterval((()=>{if(V.length<10)return;if(U.hasTags&&U.len<25)return;V.sort();const e=Math.min(V.reduce(((e,t)=>e+t),0)/V.length,V[Math.floor(V.length/2)]),t=m(e);t>Z&&(Z=t,j("%cPage size calculation timings:","font-weight: bold;"),j(" Mean time:",m(V[Math.floor(V.length/2)])),j(" Median time:",m(V.reduce(((e,t)=>e+t),0)/V.length)),j(" Average time:",t),j(" Max time:",m(Math.max(...V)))),e<=4||(clearInterval(Q),N(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${m(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${U.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function G(e){e.getEntries().forEach((e=>{if(e.name===D){const{duration:t}=performance.measure("--ifr-measure",W,D);U=e.detail,V.push(t),V.length>100&&V.shift()}}))}function _(){new PerformanceObserver(G).observe({entryTypes:["mark"]}),J(document.documentElement),J(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",_):_()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},s={height:()=>(I("Custom height calculation function not defined"),Ue.auto()),width:()=>(I("Custom width calculation function not defined"),Ze.auto())},p={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},g={},y="checkVisibility"in window,v="auto",b="[iFrameSizer]",z={max:1,min:1,bodyScroll:1,documentElementScroll:1},w="scroll";let $,E,P,C,x,V=!0,H="",J=0,U="",Z="",Q=!0,G=!1,_=!0,X=!1,Y=!1,K=1,ee=v,te=!0,ne="",oe={},ie=!1,re=0,ae=!1,le="",se=u,ce=[],de="child",ue=null,me=!1,fe="",pe=[],he=window.parent,ge="*",ye=0,ve=!1,be="",ze=1,we=w,$e=window,Se=()=>{I("onMessage function not defined")},Me=()=>{},Ee=null,je=null;function ke(){var o,d,u,m;!function(){const e=e=>"true"===e,t=ne.slice(13).split(":");le=t[0],J=void 0===t[1]?J:Number(t[1]),G=void 0===t[2]?G:e(t[2]),ie=void 0===t[3]?ie:e(t[3]),V=void 0===t[6]?V:e(t[6]),U=t[7],ee=void 0===t[8]?ee:t[8],H=t[9],Z=t[10],ye=void 0===t[11]?ye:Number(t[11]),oe.enable=void 0!==t[12]&&e(t[12]),de=void 0===t[13]?de:t[13],we=void 0===t[14]?we:t[14],ae=void 0===t[15]?ae:e(t[15]),$=void 0===t[16]?$:Number(t[16]),E=void 0===t[17]?E:Number(t[17]),Q=void 0===t[18]?Q:e(t[18]),t[19],be=t[20]||be,re=void 0===t[21]?re:Number(t[21])}(),o={id:le,enabled:ie},M.label(`${o.id}`),S=o.enabled,j(`Initialising iframe v${e} (${window.location.href})`),function(){function e(e){j(`Reading data from page: ${JSON.stringify(e)}`),Se=e?.onMessage||Se,Me=e?.onReady||Me,"number"==typeof e?.offset&&(B("offset","offsetSize"),Q&&($=e?.offset),G&&(E=e?.offset)),"number"==typeof e?.offsetSize&&(Q&&($=e?.offsetSize),G&&(E=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(fe=e.sizeSelector),ge=e?.targetOrigin||ge,ee=e?.heightCalculationMethod||ee,we=e?.widthCalculationMethod||we}function t(e,t){return"function"==typeof e&&(j(`Setup custom ${t}CalcMethod`),s[t]=e,e="custom"),e}if(1===re)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),ee=t(ee,"height"),we=t(we,"width"),j(`TargetOrigin for parent set to: ${ge}`))}(),function(){try{me=1===re||"iframeParentListener"in window.parent}catch(e){j("Cross domain iframe detected.")}}(),re<0?R(`${c(re+2)}${c(2)}`):be.codePointAt(0)>4||re<2&&R(c(3)),be&&""!==be&&"false"!==be?be!==e&&N(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${be} - Child page: ${e}.\n`):N("<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"),Re(),xe(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.toggleAttribute(n,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&N("<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&&N("<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"),Pe(),Q!==G&&(j("Setup OverflowObserver"),se=F({onChange:Oe,root:document.documentElement,side:Q?i:r})),1!==re&&($e.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===V?(V=!0,Xe("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===V&&(V=!1),et(0,0,"autoResize",JSON.stringify(V)),V),close(){et(0,0,"close")},getId:()=>le,getOrigin:()=>(q("getOrigin()","getParentOrigin()"),P),getParentOrigin:()=>P,getPageInfo(e){if("function"==typeof e)return Ee=e,et(0,0,"pageInfo"),void L("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Ee=null,et(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return je=e,et(0,0,"parentInfo"),()=>{je=null,et(0,0,"parentInfoStop")}},getParentProperties(e){q("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){oe.findTarget(e)},reset(){Ke("parentIframe.reset")},scrollBy(e,t){et(t,e,"scrollBy")},scrollTo(e,t){et(t,e,"scrollTo")},scrollToOffset(e,t){et(t,e,"scrollToOffset")},sendMessage(e,t){et(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){ee=e,Re()},setWidthCalculationMethod(e){we=e,xe()},setTargetOrigin(e){j(`Set targetOrigin: ${e}`),ge=e},resize(e,t){Xe(a,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){q("size()","resize()"),this.resize(e,t)}}),$e.parentIFrame=$e.parentIframe),function(){function e(e){et(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){j(`Add event listener: ${n}`),l(window.document,t,e)}!0===ae&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),oe=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function o(e){function t(e){const t=n(e);j(`Moving to in page link (#${o}) at x: ${t.x}y: ${t.y}`),et(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?(j(`In page link (#${o}) not found in iFrame, so sending to parent`),et(0,0,"inPageLink",`#${o}`)):t(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&l(e,"click",(t=>{t.preventDefault(),o(e.getAttribute("href"))}))}function a(){l(window,"hashchange",i)}function s(){setTimeout(i,128)}function c(){j("Setting up location.hash handlers"),r(),a(),s()}return oe.enable?1===re?N("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):c():j("In page linking not enabled"),{findTarget:o}}(),Ae(De(document)()),void 0===U&&(U=`${J}px`),Te("margin",(u="margin",(m=U).includes("-")&&(I(`Negative CSS value ignored for ${u}`),m=""),m)),Te("background",H),Te("padding",Z),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),j('HTML & body height set to "auto !important"')}(),Ce(),!0!==V&&j("Auto Resize disabled"),Ie({method:d="add",eventType:"After Print",eventName:"afterprint"}),Ie({method:d,eventType:"Before Print",eventName:"beforeprint"}),Ie({method:d,eventType:"Ready State Change",eventName:"readystatechange"}),function(){const e=new Set;let t=!1,n=0,o=[];const i=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)}},r=16,a=2,l=200;let s=1;function c(){j("MutationObserver: processMutations");const d=performance.now(),u=d-n,m=r*s+++a;if(u>m&&u<l)return j(`MutationObserver delay: ${u}ms > ${m}`),setTimeout(c,r*s),void(n=d);s=1,o.forEach(i),o=[],0!==e.size?(Ce(),Pe(),Ae(e),e.forEach(Be),e.clear(),t=!1):t=!1}function d(e){o.push(e),t||(n=performance.now(),t=!0,requestAnimationFrame(c))}function u(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return j("Setup <body> MutationObserver"),e.observe(t,n),e}u()}(),j("Setup ResizeObserver"),ue=new ResizeObserver(qe),ue.observe(document.body),Le.add(document.body),Be(document.body),queueMicrotask(Me),j("Initialization complete"),Xe("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&et(0,0,"title",document.title)}function Oe(e){j("Overflowed Elements:",e.length),ce=e,X=ce.length>0,Xe("overflowObserver","Overflow updated")}function Pe(){pe=document.querySelectorAll(`[${n}]`),Y=pe.length>0,j(`Tagged elements found: ${Y}`)}function Ae(e){Y||se(e)}function Te(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),j(`Body ${e} set to "${t}"`))}function Ce(){if(""!==fe){j(`Applying sizeSelector: ${fe}`);for(const e of document.querySelectorAll(fe))j(`Applying data-iframe-size to: ${h(e)}`),e.dataset.iframeSize=!0}}function Ie(e){({add(t){function n(){Xe(e.eventName,e.eventType)}g[t]=n,l(window,t,n,{passive:!0})},remove(e){const t=g[e];var n,o;delete g[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),j(`${f(e.method)} event listener: ${e.eventType}`)}function Ne(e,t,n,o){return t!==e&&(e in n||(I(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in p&&N(`<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 remove this option.`),j(`${f(o)} calculation method set to "${e}"`)),e}function Re(){ee=Ne(ee,v,Ue,"height")}function xe(){we=Ne(we,w,Ze,"width")}function qe(e){Array.isArray(e)&&0!==e.length&&Xe("resizeObserver",`Element resized <${h(e[0].target)}>`)}const Le=new WeakSet;function Be(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!Le.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(ue.observe(e),Le.add(e),j(`Attached resizeObserver: ${h(e)}`))}const t=De(e)();for(const e of t){if(Le.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(ue.observe(e),Le.add(e),j(`Attached resizeObserver: ${h(e)}`))}}function Fe(e){performance.mark(W);const t=f(e);let n=0,i=document.documentElement,r=Y?0:document.documentElement.getBoundingClientRect().bottom;const a=Y?pe:X?ce:De(document)();let l=a.length;for(const t of a)Y||!y||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,i=t)):l-=1;return k(`${t} position calculated from:`,i),performance.mark(D,{detail:{Side:t,len:l,hasTags:Y,logging:ie}}),r}const We=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],De=e=>()=>e.querySelectorAll("* :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)"),Ve={height:0,width:0},He={height:0,width:0};function Je(e){function t(){return He[o]=i,Ve[o]=l,i}const n=e===Ue,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),s=`HTML: ${i} Page: ${l}`;let c=0;switch(!0){case!e.enabled():return l;case Y:k("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!X&&0===He[o]&&0===Ve[o]:k(`Initial page size values: ${s}`),c=t();break;case ve&&i===He[o]&&l===Ve[o]:k(`Size unchanged: ${s}`),c=Math.max(i,l);break;case 0===i:k(`Page is hidden: ${s}`),c=l;break;case!X&&i!==He[o]&&l<=Ve[o]:k(`New <html> bounding size: ${s}`,"Previous bounding size:",He[o]),c=t();break;case!n:c=e.taggedElement();break;case!X&&i<He[o]:k("<html> bounding size decreased:",s),c=t();break;case l===a||l===r:k("<html> bounding size equals page size:",s),c=t();break;case i>l:k(`Page size < <html> bounding size: ${s}`),c=t();break;case X:k("Found element overflowing <html> "),c=e.taggedElement();break;default:c=t()}return k(`Calculated content ${o}: ${c}px`),c}const Ue={enabled:()=>Q,getOffset:()=>$,auto:()=>Je(Ue),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Ue.bodyOffset(),custom:()=>s.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...We(Ue)),min:()=>Math.min(...We(Ue)),grow:()=>Ue.max(),lowestElement:()=>Fe(i),taggedElement:()=>Fe(i)},Ze={enabled:()=>G,getOffset:()=>E,auto:()=>Je(Ze),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>s.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...We(Ze)),min:()=>Math.min(...We(Ze)),rightMostElement:()=>Fe(r),scroll:()=>Math.max(Ze.bodyScroll(),Ze.documentElementScroll()),taggedElement:()=>Fe(r)},Qe=(e,t)=>!(Math.abs(e-t)<=ye);let Ge=!1;const _e=d((()=>R(c(4))));function Xe(e,t,n,o,i){x=performance.now(),O(e),V||e===a?document.hidden?j("Page hidden - Ignored resize request"):(Ge||(j(`Resize event: ${t}`),C=!0,function(e,t,n,o,i){const r=void 0===n?Ue[ee]():n,l=void 0===o?Ze[we]():o;Q&&Qe(K,r)||G&&Qe(ze,l)||"init"===e?(K=r,ze=l,et(K,ze,e,i)):!e!==a&&(Q&&ee in z||G&&we in z)?Ke(t):(k("No change in content size detected"),C=!1)}(e,t,n,o,i),requestAnimationFrame((()=>{Ge=!1}))),Ge=!0):k("Resizing disabled")}function Ye(e){K=Ue[ee](),ze=Ze[we](),et(K,ze,e)}function Ke(e){const t=ee;ee=v,j(`Reset trigger event: ${e}`),ve?j("TriggerLock blocked calculation"):(ve=!0,A("Trigger event lock on"),requestAnimationFrame((()=>{ve=!1,A("Trigger event lock off")}))),Ye("reset"),ee=t}function et(e,t,n,o,i){re<-1||(O(n),void 0!==i?j(`Message targetOrigin: ${i}`):i=ge,function(){const r=`${le}:${e+($||0)}:${t+(E||0)}:${n}${void 0===o?"":`:${o}`}`;if(me)try{window.parent.iframeParentListener(b+r)}catch(e){if(1!==re)throw e;return void _e()}else he.postMessage(b+r,i);k("Sending message to host page via "+(me?"sameDomain":"postMessage")),k(`%c${r}`,"font-style: italic"),C&&k(function(){const e=m(performance.now()-x);return"init"===n?`Initialised iFrame in %c${e}ms`:`Content size recalculated in %c${e}ms`}(),"font-weight:bold;color:#777"),C=!1}(),T())}function tt(e){const{freeze:t}=Object,{parse:n}=JSON,o=e=>et(0,0,`${e}Stop`),i={init:function(){ne=e.data,he=e.source,P=e.origin,ke(),_=!1,setTimeout((()=>{te=!1}),128)},reset(){te?j("Page reset ignored by init"):(j("Page size reset by host page"),Ye("resetPage"))},resize(){Xe(a,"Parent window requested size check")},moveToAnchor(){oe.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();j(`PageInfo received from parent: ${e}`),Ee?setTimeout((()=>Ee(n(e)))):o("pageInfo")},parentInfo(){const e=l();j(`ParentInfo received from parent: ${e}`),je?setTimeout((()=>je(t(n(e))))):o("parentInfo")},message(){const e=l();j(`onMessage called from parent: ${e}`),setTimeout((()=>Se(n(e))))}},r=()=>e.data.split("]")[1].split(":")[0],l=()=>e.data.slice(e.data.indexOf(":")+1),s=()=>e.data.split(":")[2]in{true:1,false:1};function c(){const t=r();t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||I(`Unexpected message (${e.data})`)}b===`${e.data}`.slice(0,13)&&(O(r()),!1!==_?s()?i.init():j(`Ignored message of type "${r()}". Received before initialization.`):c())}function nt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?I("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>tt({data:e}))),l(window,"message",tt),l(window,"readystatechange",nt),nt())}()}();
|
|
21
21
|
//# sourceMappingURL=iframeResizer.contentWindow.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/legacy (child) 5.4.0-beta.
|
|
4
|
+
* @module iframe-resizer/legacy (child) 5.4.0-beta.2 (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="5.4.0-beta.1",t=10,n="data-iframe-size",o="data-overflowed",i="bottom",r="right",a="resizeParent",l=(e,t,n,o)=>e.addEventListener(t,n,o||!1),s=["<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 c=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(s[e]),d=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},u=e=>e,m=e=>Math.round(1e3*e)/1e3,f=e=>e.charAt(0).toUpperCase()+e.slice(1),p=e=>""!=`${e}`&&void 0!==e;function h(e){switch(!0){case!p(e):return"";case p(e.id):return`${e.nodeName}#${e.id}`;case p(e.name):return`${e.nodeName} (${e.name}`;case p(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}const g="default",y={collapsed:!1,defaultEvent:void 0,event:void 0,label:"Auto Group",showTime:!0},v={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:b,keys:z}=Object,w=e=>t=>[t,function(n){e[t]=n}],$=(e,t)=>b(z(e).map(t));let S=!0;const M=function(e){const t=[],n={},o={...y,...e};let i;function r(){t.length=0}function a(){delete o.event,r()}const l=()=>!t.some((([e])=>"error"===e||"warn"===e))&&o.collapsed;function s(){if(0!==t.length){console[l()?"groupCollapsed":"group"](`%c${o.label} %c${(e=>{const t=e.event||e.defaultEvent;return t?`${t} `:""})(o)}%c${o.showTime?i:""}`,"font-weight: normal;","font-weight: bold;","font-weight: normal;font-style: italic;");for(const[e,...n]of t)console[e](...n);console.groupEnd(),a()}else a()}function c(){i=function(){const e=new Date,t=(t,n)=>e[`get${t}`]().toString().padStart(n,"0");return`@ ${t("Hours",2)}:${t("Minutes",2)}:${t("Seconds",2)}.${t("Milliseconds",3)}`}(),queueMicrotask((()=>queueMicrotask(s)))}function d(e,...n){0===t.length&&c(),t.push([e,...n])}function u(e=g,...t){d("log",`${e}: ${performance.now()-n[e]} ms`,...t)}return{...$(o,w(o)),...$(console,(e=>[e,(...t)=>d(e,...t)])),...$(v,(e=>[e,console[e]])),endAutoGroup:s,purge:r,time:function(e=g){n[e]=performance.now()},timeEnd:function(e=g){u(e),delete n[e]},timeLog:u}}({label:"iframeResizer(child)"});const E=e=>(...t)=>!S||M[e](...t),j=E("log"),k=E("info"),{event:O,assert:P,debug:A,endAutoGroup:T,error:C,warn:I}=M,N=(...e)=>{return M.warn((t=u,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},R=N,x=(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</>.`))(((e,...t)=>N(...t))),q=x("Method"),L=x("Method","replaced with"),B=x("Option"),F=e=>{const t=e.side||i,n=e.onChange||u,r={root:e.root,rootMargin:"0px",threshold:1};function a(){const e=document.querySelectorAll(`[${o}]`);n(e)}const l=new IntersectionObserver((function(e){for(const n of e){const{boundingClientRect:e,rootBounds:i,target:r}=n,a=e[t],l=0===a||a>i[t];r.toggleAttribute(o,l)}requestAnimationFrame(a)}),r),s=new WeakSet;return function(e){j("Attached overflowObserver");for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}},W="--ifr-start",D="--ifr-end",V=[],H=new WeakSet,J=e=>"object"==typeof e&&H.add(e);let U={},Z=0;const Q=setInterval((()=>{if(V.length<10)return;if(U.hasTags&&U.len<25)return;V.sort();const e=Math.min(V.reduce(((e,t)=>e+t),0)/V.length,V[Math.floor(V.length/2)]),t=m(e);t>Z&&(Z=t,j("%cPage size calculation timings:","font-weight: bold;"),j(" Mean time:",m(V[Math.floor(V.length/2)])),j(" Median time:",m(V.reduce(((e,t)=>e+t),0)/V.length)),j(" Average time:",t),j(" Max time:",m(Math.max(...V)))),e<=4||(clearInterval(Q),N(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${m(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${U.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function G(e){e.getEntries().forEach((e=>{if(e.name===D){const{duration:t}=performance.measure("--ifr-measure",W,D);U=e.detail,V.push(t),V.length>100&&V.shift()}}))}function _(){new PerformanceObserver(G).observe({entryTypes:["mark"]}),J(document.documentElement),J(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",_):_()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},s={height:()=>(I("Custom height calculation function not defined"),Ue.auto()),width:()=>(I("Custom width calculation function not defined"),Ze.auto())},p={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},g={},y="checkVisibility"in window,v="auto",b="[iFrameSizer]",z={max:1,min:1,bodyScroll:1,documentElementScroll:1},w="scroll";let $,E,P,C,x,V=!0,H="",J=0,U="",Z="",Q=!0,G=!1,_=!0,X=!1,Y=!1,K=1,ee=v,te=!0,ne="",oe={},ie=!1,re=0,ae=!1,le="",se=u,ce=[],de="child",ue=null,me=!1,fe="",pe=[],he=window.parent,ge="*",ye=0,ve=!1,be="",ze=1,we=w,$e=window,Se=()=>{I("onMessage function not defined")},Me=()=>{},Ee=null,je=null;function ke(){var o,d,u,m;!function(){const e=e=>"true"===e,t=ne.slice(13).split(":");le=t[0],J=void 0===t[1]?J:Number(t[1]),G=void 0===t[2]?G:e(t[2]),ie=void 0===t[3]?ie:e(t[3]),V=void 0===t[6]?V:e(t[6]),U=t[7],ee=void 0===t[8]?ee:t[8],H=t[9],Z=t[10],ye=void 0===t[11]?ye:Number(t[11]),oe.enable=void 0!==t[12]&&e(t[12]),de=void 0===t[13]?de:t[13],we=void 0===t[14]?we:t[14],ae=void 0===t[15]?ae:e(t[15]),$=void 0===t[16]?$:Number(t[16]),E=void 0===t[17]?E:Number(t[17]),Q=void 0===t[18]?Q:e(t[18]),t[19],be=t[20]||be,re=void 0===t[21]?re:Number(t[21])}(),o={id:le,enabled:ie},M.label(`${o.id}`),S=o.enabled,j(`Initialising iframe v${e} (${window.location.href})`),function(){function e(e){j(`Reading data from page: ${JSON.stringify(e)}`),Se=e?.onMessage||Se,Me=e?.onReady||Me,"number"==typeof e?.offset&&(B("offset","offsetSize"),Q&&($=e?.offset),G&&(E=e?.offset)),"number"==typeof e?.offsetSize&&(Q&&($=e?.offsetSize),G&&(E=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(fe=e.sizeSelector),ge=e?.targetOrigin||ge,ee=e?.heightCalculationMethod||ee,we=e?.widthCalculationMethod||we}function t(e,t){return"function"==typeof e&&(j(`Setup custom ${t}CalcMethod`),s[t]=e,e="custom"),e}if(1===re)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),ee=t(ee,"height"),we=t(we,"width"),j(`TargetOrigin for parent set to: ${ge}`))}(),function(){try{me=1===re||"iframeParentListener"in window.parent}catch(e){j("Cross domain iframe detected.")}}(),re<0?R(`${c(re+2)}${c(2)}`):be.codePointAt(0)>4||re<2&&R(c(3)),be&&""!==be&&"false"!==be?be!==e&&N(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${be} - Child page: ${e}.\n`):N("<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"),Re(),xe(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.toggleAttribute(n,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&N("<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&&N("<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"),Pe(),Q!==G&&(j("Setup OverflowObserver"),se=F({onChange:Oe,root:document.documentElement,side:Q?i:r})),1!==re&&($e.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===V?(V=!0,Xe("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===V&&(V=!1),et(0,0,"autoResize",JSON.stringify(V)),V),close(){et(0,0,"close")},getId:()=>le,getOrigin:()=>(q("getOrigin()","getParentOrigin()"),P),getParentOrigin:()=>P,getPageInfo(e){if("function"==typeof e)return Ee=e,et(0,0,"pageInfo"),void L("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Ee=null,et(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return je=e,et(0,0,"parentInfo"),()=>{je=null,et(0,0,"parentInfoStop")}},getParentProperties(e){q("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){oe.findTarget(e)},reset(){Ke("parentIframe.reset")},scrollBy(e,t){et(t,e,"scrollBy")},scrollTo(e,t){et(t,e,"scrollTo")},scrollToOffset(e,t){et(t,e,"scrollToOffset")},sendMessage(e,t){et(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){ee=e,Re()},setWidthCalculationMethod(e){we=e,xe()},setTargetOrigin(e){j(`Set targetOrigin: ${e}`),ge=e},resize(e,t){Xe(a,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){q("size()","resize()"),this.resize(e,t)}}),$e.parentIFrame=$e.parentIframe),function(){function e(e){et(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){j(`Add event listener: ${n}`),l(window.document,t,e)}!0===ae&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),oe=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function o(e){function t(e){const t=n(e);j(`Moving to in page link (#${o}) at x: ${t.x}y: ${t.y}`),et(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?(j(`In page link (#${o}) not found in iFrame, so sending to parent`),et(0,0,"inPageLink",`#${o}`)):t(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&l(e,"click",(t=>{t.preventDefault(),o(e.getAttribute("href"))}))}function a(){l(window,"hashchange",i)}function s(){setTimeout(i,128)}function c(){j("Setting up location.hash handlers"),r(),a(),s()}return oe.enable?1===re?N("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):c():j("In page linking not enabled"),{findTarget:o}}(),Ae(De(document)()),void 0===U&&(U=`${J}px`),Te("margin",(u="margin",(m=U).includes("-")&&(I(`Negative CSS value ignored for ${u}`),m=""),m)),Te("background",H),Te("padding",Z),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),j('HTML & body height set to "auto !important"')}(),Ce(),!0!==V&&j("Auto Resize disabled"),Ie({method:d="add",eventType:"After Print",eventName:"afterprint"}),Ie({method:d,eventType:"Before Print",eventName:"beforeprint"}),Ie({method:d,eventType:"Ready State Change",eventName:"readystatechange"}),function(){const e=new Set;let t=!1,n=0,o=[];const i=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)}},r=16,a=2,l=200;let s=1;function c(){j("MutationObserver: processMutations");const d=performance.now(),u=d-n,m=r*s+++a;if(u>m&&u<l)return j(`MutationObserver delay: ${u}ms > ${m}`),setTimeout(c,r*s),void(n=d);s=1,o.forEach(i),o=[],0!==e.size?(Ce(),Pe(),Ae(e),e.forEach(Be),e.clear(),t=!1):t=!1}function d(e){o.push(e),t||(n=performance.now(),t=!0,requestAnimationFrame(c))}function u(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return j("Setup <body> MutationObserver"),e.observe(t,n),e}u()}(),j("Setup ResizeObserver"),ue=new ResizeObserver(qe),ue.observe(document.body),Le.add(document.body),Be(document.body),queueMicrotask(Me),j("Initialization complete"),Xe("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&et(0,0,"title",document.title)}function Oe(e){j("Overflowed Elements:",e.length),ce=e,X=ce.length>0,Xe("overflowObserver","Overflow updated")}function Pe(){pe=document.querySelectorAll(`[${n}]`),Y=pe.length>0,j(`Tagged elements found: ${Y}`)}function Ae(e){Y||se(e)}function Te(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),j(`Body ${e} set to "${t}"`))}function Ce(){if(""!==fe){j(`Applying sizeSelector: ${fe}`);for(const e of document.querySelectorAll(fe))j(`Applying data-iframe-size to: ${h(e)}`),e.dataset.iframeSize=!0}}function Ie(e){({add(t){function n(){Xe(e.eventName,e.eventType)}g[t]=n,l(window,t,n,{passive:!0})},remove(e){const t=g[e];var n,o;delete g[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),j(`${f(e.method)} event listener: ${e.eventType}`)}function Ne(e,t,n,o){return t!==e&&(e in n||(I(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in p&&N(`<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 remove this option.`),j(`${f(o)} calculation method set to "${e}"`)),e}function Re(){ee=Ne(ee,v,Ue,"height")}function xe(){we=Ne(we,w,Ze,"width")}function qe(e){Array.isArray(e)&&0!==e.length&&Xe("resizeObserver",`Element resized <${h(e[0].target)}>`)}const Le=new WeakSet;function Be(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!Le.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(ue.observe(e),Le.add(e),j(`Attached resizeObserver: ${h(e)}`))}const t=De(e)();for(const e of t){if(Le.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(ue.observe(e),Le.add(e),j(`Attached resizeObserver: ${h(e)}`))}}function Fe(e){performance.mark(W);const t=f(e);let n=0,i=document.documentElement,r=Y?0:document.documentElement.getBoundingClientRect().bottom;const a=Y?pe:X?ce:De(document)();let l=a.length;for(const t of a)Y||!y||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,i=t)):l-=1;return k(`${t} position calculated from:`,i),performance.mark(D,{detail:{Side:t,len:l,hasTags:Y,logging:ie}}),r}const We=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],De=e=>()=>e.querySelectorAll("* :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)"),Ve={height:0,width:0},He={height:0,width:0};function Je(e){function t(){return He[o]=i,Ve[o]=l,i}const n=e===Ue,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),s=`HTML: ${i} Page: ${l}`;let c=0;switch(!0){case!e.enabled():return l;case Y:k("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!X&&0===He[o]&&0===Ve[o]:k(`Initial page size values: ${s}`),c=t();break;case ve&&i===He[o]&&l===Ve[o]:k(`Size unchanged: ${s}`),c=Math.max(i,l);break;case 0===i:k(`Page is hidden: ${s}`),c=l;break;case!X&&i!==He[o]&&l<=Ve[o]:k(`New <html> bounding size: ${s}`,"Previous bounding size:",He[o]),c=t();break;case!n:c=e.taggedElement();break;case!X&&i<He[o]:k("<html> bounding size decreased:",s),c=t();break;case l===a||l===r:k("<html> bounding size equals page size:",s),c=t();break;case i>l:k(`Page size < <html> bounding size: ${s}`),c=t();break;case X:k("Found element overflowing <html> "),c=e.taggedElement();break;default:c=t()}return k(`Calculated content ${o}: ${c}px`),c}const Ue={enabled:()=>Q,getOffset:()=>$,auto:()=>Je(Ue),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Ue.bodyOffset(),custom:()=>s.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...We(Ue)),min:()=>Math.min(...We(Ue)),grow:()=>Ue.max(),lowestElement:()=>Fe(i),taggedElement:()=>Fe(i)},Ze={enabled:()=>G,getOffset:()=>E,auto:()=>Je(Ze),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>s.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...We(Ze)),min:()=>Math.min(...We(Ze)),rightMostElement:()=>Fe(r),scroll:()=>Math.max(Ze.bodyScroll(),Ze.documentElementScroll()),taggedElement:()=>Fe(r)},Qe=(e,t)=>!(Math.abs(e-t)<=ye);let Ge=!1;const _e=d((()=>R(c(4))));function Xe(e,t,n,o,i){x=performance.now(),O(e),V||e===a?document.hidden?j("Page hidden - Ignored resize request"):(Ge||(j(`Resize event: ${t}`),C=!0,function(e,t,n,o,i){const r=void 0===n?Ue[ee]():n,l=void 0===o?Ze[we]():o;Q&&Qe(K,r)||G&&Qe(ze,l)||"init"===e?(K=r,ze=l,et(K,ze,e,i)):!e!==a&&(Q&&ee in z||G&&we in z)?Ke(t):(k("No change in content size detected"),C=!1)}(e,t,n,o,i),requestAnimationFrame((()=>{Ge=!1}))),Ge=!0):k("Resizing disabled")}function Ye(e){K=Ue[ee](),ze=Ze[we](),et(K,ze,e)}function Ke(e){const t=ee;ee=v,j(`Reset trigger event: ${e}`),ve?j("TriggerLock blocked calculation"):(ve=!0,A("Trigger event lock on"),requestAnimationFrame((()=>{ve=!1,A("Trigger event lock off")}))),Ye("reset"),ee=t}function et(e,t,n,o,i){re<-1||(O(n),void 0!==i?j(`Message targetOrigin: ${i}`):i=ge,function(){const r=`${le}:${e+($||0)}:${t+(E||0)}:${n}${void 0===o?"":`:${o}`}`;if(me)try{window.parent.iframeParentListener(b+r)}catch(e){if(1!==re)throw e;return void _e()}else he.postMessage(b+r,i);k("Sending message to host page via "+(me?"sameDomain":"postMessage")),k(`%c${r}`,"font-style: italic"),C&&k(function(){const e=m(performance.now()-x);return"init"===n?`Initialised iFrame in %c${e}ms`:`Content size recalculated in %c${e}ms`}(),"font-weight:bold;color:#777"),C=!1}(),T())}function tt(e){const{freeze:t}=Object,{parse:n}=JSON,o=e=>et(0,0,`${e}Stop`),i={init:function(){ne=e.data,he=e.source,P=e.origin,ke(),_=!1,setTimeout((()=>{te=!1}),128)},reset(){te?j("Page reset ignored by init"):(j("Page size reset by host page"),Ye("resetPage"))},resize(){Xe(a,"Parent window requested size check")},moveToAnchor(){oe.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();j(`PageInfo received from parent: ${e}`),Ee?setTimeout((()=>Ee(n(e)))):o("pageInfo")},parentInfo(){const e=l();j(`ParentInfo received from parent: ${e}`),je?setTimeout((()=>je(t(n(e))))):o("parentInfo")},message(){const e=l();j(`onMessage called from parent: ${e}`),setTimeout((()=>Se(n(e))))}},r=()=>e.data.split("]")[1].split(":")[0],l=()=>e.data.slice(e.data.indexOf(":")+1),s=()=>e.data.split(":")[2]in{true:1,false:1};function c(){const t=r();t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||I(`Unexpected message (${e.data})`)}b===`${e.data}`.slice(0,13)&&(O(r()),!1!==_?s()?i.init():j(`Ignored message of type "${r()}". Received before initialization.`):c())}function nt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?I("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>tt({data:e}))),l(window,"message",tt),l(window,"readystatechange",nt),nt())}()}();
|
|
20
|
+
!function(){"use strict";const e="5.4.0-beta.2",t=10,n="data-iframe-size",o="data-overflowed",i="bottom",r="right",a="resizeParent",l=(e,t,n,o)=>e.addEventListener(t,n,o||!1),s=["<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 c=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(s[e]),d=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},u=e=>e,m=e=>Math.round(1e3*e)/1e3,f=e=>e.charAt(0).toUpperCase()+e.slice(1),p=e=>""!=`${e}`&&void 0!==e;function h(e){switch(!0){case!p(e):return"";case p(e.id):return`${e.nodeName}#${e.id}`;case p(e.name):return`${e.nodeName} (${e.name}`;case p(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}const g="default",y={collapsed:!1,defaultEvent:void 0,event:void 0,label:"Auto Group",showTime:!0},v={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:b,keys:z}=Object,w=e=>t=>[t,function(n){e[t]=n}],$=(e,t)=>b(z(e).map(t));let S=!0;const M=function(e){const t=[],n={},o={...y,...e};let i;function r(){t.length=0}function a(){delete o.event,r()}const l=()=>!t.some((([e])=>"error"===e||"warn"===e))&&o.collapsed;function s(){if(0!==t.length){console[l()?"groupCollapsed":"group"](`%c${o.label} %c${(e=>{const t=e.event||e.defaultEvent;return t?`${t} `:""})(o)}%c${o.showTime?i:""}`,"font-weight: normal;","font-weight: bold;","font-weight: normal;font-style: italic;");for(const[e,...n]of t)console[e](...n);console.groupEnd(),a()}else a()}function c(){i=function(){const e=new Date,t=(t,n)=>e[`get${t}`]().toString().padStart(n,"0");return`@ ${t("Hours",2)}:${t("Minutes",2)}:${t("Seconds",2)}.${t("Milliseconds",3)}`}(),queueMicrotask((()=>queueMicrotask(s)))}function d(e,...n){0===t.length&&c(),t.push([e,...n])}function u(e=g,...t){d("log",`${e}: ${performance.now()-n[e]} ms`,...t)}return{...$(o,w(o)),...$(console,(e=>[e,(...t)=>d(e,...t)])),...$(v,(e=>[e,console[e]])),endAutoGroup:s,purge:r,time:function(e=g){n[e]=performance.now()},timeEnd:function(e=g){u(e),delete n[e]},timeLog:u}}({label:"iframeResizer(child)"});const E=e=>(...t)=>!S||M[e](...t),j=E("log"),k=E("info"),{event:O,assert:P,debug:A,endAutoGroup:T,error:C,warn:I}=M,N=(...e)=>{return M.warn((t=u,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},R=N,x=(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</>.`))(((e,...t)=>N(...t))),q=x("Method"),L=x("Method","replaced with"),B=x("Option"),F=e=>{const t=e.side||i,n=e.onChange||u,r={root:e.root,rootMargin:"0px",threshold:1};function a(){const e=document.querySelectorAll(`[${o}]`);n(e)}const l=new IntersectionObserver((function(e){for(const n of e){const{boundingClientRect:e,rootBounds:i,target:r}=n,a=e[t],l=0===a||a>i[t];r.toggleAttribute(o,l)}requestAnimationFrame(a)}),r),s=new WeakSet;return function(e){j("Attached overflowObserver");for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}},W="--ifr-start",D="--ifr-end",V=[],H=new WeakSet,J=e=>"object"==typeof e&&H.add(e);let U={},Z=0;const Q=setInterval((()=>{if(V.length<10)return;if(U.hasTags&&U.len<25)return;V.sort();const e=Math.min(V.reduce(((e,t)=>e+t),0)/V.length,V[Math.floor(V.length/2)]),t=m(e);t>Z&&(Z=t,j("%cPage size calculation timings:","font-weight: bold;"),j(" Mean time:",m(V[Math.floor(V.length/2)])),j(" Median time:",m(V.reduce(((e,t)=>e+t),0)/V.length)),j(" Average time:",t),j(" Max time:",m(Math.max(...V)))),e<=4||(clearInterval(Q),N(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${m(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${U.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function G(e){e.getEntries().forEach((e=>{if(e.name===D){const{duration:t}=performance.measure("--ifr-measure",W,D);U=e.detail,V.push(t),V.length>100&&V.shift()}}))}function _(){new PerformanceObserver(G).observe({entryTypes:["mark"]}),J(document.documentElement),J(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",_):_()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},s={height:()=>(I("Custom height calculation function not defined"),Ue.auto()),width:()=>(I("Custom width calculation function not defined"),Ze.auto())},p={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},g={},y="checkVisibility"in window,v="auto",b="[iFrameSizer]",z={max:1,min:1,bodyScroll:1,documentElementScroll:1},w="scroll";let $,E,P,C,x,V=!0,H="",J=0,U="",Z="",Q=!0,G=!1,_=!0,X=!1,Y=!1,K=1,ee=v,te=!0,ne="",oe={},ie=!1,re=0,ae=!1,le="",se=u,ce=[],de="child",ue=null,me=!1,fe="",pe=[],he=window.parent,ge="*",ye=0,ve=!1,be="",ze=1,we=w,$e=window,Se=()=>{I("onMessage function not defined")},Me=()=>{},Ee=null,je=null;function ke(){var o,d,u,m;!function(){const e=e=>"true"===e,t=ne.slice(13).split(":");le=t[0],J=void 0===t[1]?J:Number(t[1]),G=void 0===t[2]?G:e(t[2]),ie=void 0===t[3]?ie:e(t[3]),V=void 0===t[6]?V:e(t[6]),U=t[7],ee=void 0===t[8]?ee:t[8],H=t[9],Z=t[10],ye=void 0===t[11]?ye:Number(t[11]),oe.enable=void 0!==t[12]&&e(t[12]),de=void 0===t[13]?de:t[13],we=void 0===t[14]?we:t[14],ae=void 0===t[15]?ae:e(t[15]),$=void 0===t[16]?$:Number(t[16]),E=void 0===t[17]?E:Number(t[17]),Q=void 0===t[18]?Q:e(t[18]),t[19],be=t[20]||be,re=void 0===t[21]?re:Number(t[21])}(),o={id:le,enabled:ie},M.label(`${o.id}`),S=o.enabled,j(`Initialising iframe v${e} (${window.location.href})`),function(){function e(e){j(`Reading data from page: ${JSON.stringify(e)}`),Se=e?.onMessage||Se,Me=e?.onReady||Me,"number"==typeof e?.offset&&(B("offset","offsetSize"),Q&&($=e?.offset),G&&(E=e?.offset)),"number"==typeof e?.offsetSize&&(Q&&($=e?.offsetSize),G&&(E=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(fe=e.sizeSelector),ge=e?.targetOrigin||ge,ee=e?.heightCalculationMethod||ee,we=e?.widthCalculationMethod||we}function t(e,t){return"function"==typeof e&&(j(`Setup custom ${t}CalcMethod`),s[t]=e,e="custom"),e}if(1===re)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),ee=t(ee,"height"),we=t(we,"width"),j(`TargetOrigin for parent set to: ${ge}`))}(),function(){try{me=1===re||"iframeParentListener"in window.parent}catch(e){j("Cross domain iframe detected.")}}(),re<0?R(`${c(re+2)}${c(2)}`):be.codePointAt(0)>4||re<2&&R(c(3)),be&&""!==be&&"false"!==be?be!==e&&N(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${be} - Child page: ${e}.\n`):N("<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"),Re(),xe(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.toggleAttribute(n,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&N("<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&&N("<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"),Pe(),Q!==G&&(j("Setup OverflowObserver"),se=F({onChange:Oe,root:document.documentElement,side:Q?i:r})),1!==re&&($e.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===V?(V=!0,Xe("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===V&&(V=!1),et(0,0,"autoResize",JSON.stringify(V)),V),close(){et(0,0,"close")},getId:()=>le,getOrigin:()=>(q("getOrigin()","getParentOrigin()"),P),getParentOrigin:()=>P,getPageInfo(e){if("function"==typeof e)return Ee=e,et(0,0,"pageInfo"),void L("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Ee=null,et(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return je=e,et(0,0,"parentInfo"),()=>{je=null,et(0,0,"parentInfoStop")}},getParentProperties(e){q("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){oe.findTarget(e)},reset(){Ke("parentIframe.reset")},scrollBy(e,t){et(t,e,"scrollBy")},scrollTo(e,t){et(t,e,"scrollTo")},scrollToOffset(e,t){et(t,e,"scrollToOffset")},sendMessage(e,t){et(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){ee=e,Re()},setWidthCalculationMethod(e){we=e,xe()},setTargetOrigin(e){j(`Set targetOrigin: ${e}`),ge=e},resize(e,t){Xe(a,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){q("size()","resize()"),this.resize(e,t)}}),$e.parentIFrame=$e.parentIframe),function(){function e(e){et(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){j(`Add event listener: ${n}`),l(window.document,t,e)}!0===ae&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),oe=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function o(e){function t(e){const t=n(e);j(`Moving to in page link (#${o}) at x: ${t.x}y: ${t.y}`),et(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?(j(`In page link (#${o}) not found in iFrame, so sending to parent`),et(0,0,"inPageLink",`#${o}`)):t(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&l(e,"click",(t=>{t.preventDefault(),o(e.getAttribute("href"))}))}function a(){l(window,"hashchange",i)}function s(){setTimeout(i,128)}function c(){j("Setting up location.hash handlers"),r(),a(),s()}return oe.enable?1===re?N("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):c():j("In page linking not enabled"),{findTarget:o}}(),Ae(De(document)()),void 0===U&&(U=`${J}px`),Te("margin",(u="margin",(m=U).includes("-")&&(I(`Negative CSS value ignored for ${u}`),m=""),m)),Te("background",H),Te("padding",Z),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),j('HTML & body height set to "auto !important"')}(),Ce(),!0!==V&&j("Auto Resize disabled"),Ie({method:d="add",eventType:"After Print",eventName:"afterprint"}),Ie({method:d,eventType:"Before Print",eventName:"beforeprint"}),Ie({method:d,eventType:"Ready State Change",eventName:"readystatechange"}),function(){const e=new Set;let t=!1,n=0,o=[];const i=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)}},r=16,a=2,l=200;let s=1;function c(){j("MutationObserver: processMutations");const d=performance.now(),u=d-n,m=r*s+++a;if(u>m&&u<l)return j(`MutationObserver delay: ${u}ms > ${m}`),setTimeout(c,r*s),void(n=d);s=1,o.forEach(i),o=[],0!==e.size?(Ce(),Pe(),Ae(e),e.forEach(Be),e.clear(),t=!1):t=!1}function d(e){o.push(e),t||(n=performance.now(),t=!0,requestAnimationFrame(c))}function u(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return j("Setup <body> MutationObserver"),e.observe(t,n),e}u()}(),j("Setup ResizeObserver"),ue=new ResizeObserver(qe),ue.observe(document.body),Le.add(document.body),Be(document.body),queueMicrotask(Me),j("Initialization complete"),Xe("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&et(0,0,"title",document.title)}function Oe(e){j("Overflowed Elements:",e.length),ce=e,X=ce.length>0,Xe("overflowObserver","Overflow updated")}function Pe(){pe=document.querySelectorAll(`[${n}]`),Y=pe.length>0,j(`Tagged elements found: ${Y}`)}function Ae(e){Y||se(e)}function Te(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),j(`Body ${e} set to "${t}"`))}function Ce(){if(""!==fe){j(`Applying sizeSelector: ${fe}`);for(const e of document.querySelectorAll(fe))j(`Applying data-iframe-size to: ${h(e)}`),e.dataset.iframeSize=!0}}function Ie(e){({add(t){function n(){Xe(e.eventName,e.eventType)}g[t]=n,l(window,t,n,{passive:!0})},remove(e){const t=g[e];var n,o;delete g[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),j(`${f(e.method)} event listener: ${e.eventType}`)}function Ne(e,t,n,o){return t!==e&&(e in n||(I(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in p&&N(`<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 remove this option.`),j(`${f(o)} calculation method set to "${e}"`)),e}function Re(){ee=Ne(ee,v,Ue,"height")}function xe(){we=Ne(we,w,Ze,"width")}function qe(e){Array.isArray(e)&&0!==e.length&&Xe("resizeObserver",`Element resized <${h(e[0].target)}>`)}const Le=new WeakSet;function Be(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!Le.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(ue.observe(e),Le.add(e),j(`Attached resizeObserver: ${h(e)}`))}const t=De(e)();for(const e of t){if(Le.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(ue.observe(e),Le.add(e),j(`Attached resizeObserver: ${h(e)}`))}}function Fe(e){performance.mark(W);const t=f(e);let n=0,i=document.documentElement,r=Y?0:document.documentElement.getBoundingClientRect().bottom;const a=Y?pe:X?ce:De(document)();let l=a.length;for(const t of a)Y||!y||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,i=t)):l-=1;return k(`${t} position calculated from:`,i),performance.mark(D,{detail:{Side:t,len:l,hasTags:Y,logging:ie}}),r}const We=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],De=e=>()=>e.querySelectorAll("* :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)"),Ve={height:0,width:0},He={height:0,width:0};function Je(e){function t(){return He[o]=i,Ve[o]=l,i}const n=e===Ue,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),s=`HTML: ${i} Page: ${l}`;let c=0;switch(!0){case!e.enabled():return l;case Y:k("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!X&&0===He[o]&&0===Ve[o]:k(`Initial page size values: ${s}`),c=t();break;case ve&&i===He[o]&&l===Ve[o]:k(`Size unchanged: ${s}`),c=Math.max(i,l);break;case 0===i:k(`Page is hidden: ${s}`),c=l;break;case!X&&i!==He[o]&&l<=Ve[o]:k(`New <html> bounding size: ${s}`,"Previous bounding size:",He[o]),c=t();break;case!n:c=e.taggedElement();break;case!X&&i<He[o]:k("<html> bounding size decreased:",s),c=t();break;case l===a||l===r:k("<html> bounding size equals page size:",s),c=t();break;case i>l:k(`Page size < <html> bounding size: ${s}`),c=t();break;case X:k("Found element overflowing <html> "),c=e.taggedElement();break;default:c=t()}return k(`Calculated content ${o}: ${c}px`),c}const Ue={enabled:()=>Q,getOffset:()=>$,auto:()=>Je(Ue),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Ue.bodyOffset(),custom:()=>s.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...We(Ue)),min:()=>Math.min(...We(Ue)),grow:()=>Ue.max(),lowestElement:()=>Fe(i),taggedElement:()=>Fe(i)},Ze={enabled:()=>G,getOffset:()=>E,auto:()=>Je(Ze),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>s.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...We(Ze)),min:()=>Math.min(...We(Ze)),rightMostElement:()=>Fe(r),scroll:()=>Math.max(Ze.bodyScroll(),Ze.documentElementScroll()),taggedElement:()=>Fe(r)},Qe=(e,t)=>!(Math.abs(e-t)<=ye);let Ge=!1;const _e=d((()=>R(c(4))));function Xe(e,t,n,o,i){x=performance.now(),O(e),V||e===a?document.hidden?j("Page hidden - Ignored resize request"):(Ge||(j(`Resize event: ${t}`),C=!0,function(e,t,n,o,i){const r=void 0===n?Ue[ee]():n,l=void 0===o?Ze[we]():o;Q&&Qe(K,r)||G&&Qe(ze,l)||"init"===e?(K=r,ze=l,et(K,ze,e,i)):!e!==a&&(Q&&ee in z||G&&we in z)?Ke(t):(k("No change in content size detected"),C=!1)}(e,t,n,o,i),requestAnimationFrame((()=>{Ge=!1}))),Ge=!0):k("Resizing disabled")}function Ye(e){K=Ue[ee](),ze=Ze[we](),et(K,ze,e)}function Ke(e){const t=ee;ee=v,j(`Reset trigger event: ${e}`),ve?j("TriggerLock blocked calculation"):(ve=!0,A("Trigger event lock on"),requestAnimationFrame((()=>{ve=!1,A("Trigger event lock off")}))),Ye("reset"),ee=t}function et(e,t,n,o,i){re<-1||(O(n),void 0!==i?j(`Message targetOrigin: ${i}`):i=ge,function(){const r=`${le}:${e+($||0)}:${t+(E||0)}:${n}${void 0===o?"":`:${o}`}`;if(me)try{window.parent.iframeParentListener(b+r)}catch(e){if(1!==re)throw e;return void _e()}else he.postMessage(b+r,i);k("Sending message to host page via "+(me?"sameDomain":"postMessage")),k(`%c${r}`,"font-style: italic"),C&&k(function(){const e=m(performance.now()-x);return"init"===n?`Initialised iFrame in %c${e}ms`:`Content size recalculated in %c${e}ms`}(),"font-weight:bold;color:#777"),C=!1}(),T())}function tt(e){const{freeze:t}=Object,{parse:n}=JSON,o=e=>et(0,0,`${e}Stop`),i={init:function(){ne=e.data,he=e.source,P=e.origin,ke(),_=!1,setTimeout((()=>{te=!1}),128)},reset(){te?j("Page reset ignored by init"):(j("Page size reset by host page"),Ye("resetPage"))},resize(){Xe(a,"Parent window requested size check")},moveToAnchor(){oe.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();j(`PageInfo received from parent: ${e}`),Ee?setTimeout((()=>Ee(n(e)))):o("pageInfo")},parentInfo(){const e=l();j(`ParentInfo received from parent: ${e}`),je?setTimeout((()=>je(t(n(e))))):o("parentInfo")},message(){const e=l();j(`onMessage called from parent: ${e}`),setTimeout((()=>Se(n(e))))}},r=()=>e.data.split("]")[1].split(":")[0],l=()=>e.data.slice(e.data.indexOf(":")+1),s=()=>e.data.split(":")[2]in{true:1,false:1};function c(){const t=r();t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||I(`Unexpected message (${e.data})`)}b===`${e.data}`.slice(0,13)&&(O(r()),!1!==_?s()?i.init():j(`Ignored message of type "${r()}". Received before initialization.`):c())}function nt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?I("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>tt({data:e}))),l(window,"message",tt),l(window,"readystatechange",nt),nt())}()}();
|
|
21
21
|
//# sourceMappingURL=iframeResizer.contentWindow.min.js.map
|
package/js/iframeResizer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/legacy (parent) 5.4.0-beta.
|
|
4
|
+
* @module iframe-resizer/legacy (parent) 5.4.0-beta.2 (umd) - 2025-03-18
|
|
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(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="default",t={collapsed:!1,defaultEvent:void 0,event:void 0,label:"Auto Group",showTime:!0},i={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:n,keys:o}=Object,r=e=>t=>[t,function(i){e[t]=i}],a=(e,t)=>n(o(e).map(t));function s(n){const o=[],s={},l={...t,...n};let c;function d(){o.length=0}function u(){delete l.event,d()}const f=()=>!o.some((([e])=>"error"===e||"warn"===e))&&l.collapsed;function p(){if(0!==o.length){console[f()?"groupCollapsed":"group"](`%c${l.label} %c${(e=>{const t=e.event||e.defaultEvent;return t?`${t} `:""})(l)}%c${l.showTime?c:""}`,"font-weight: normal;","font-weight: bold;","font-weight: normal;font-style: italic;");for(const[e,...t]of o)console[e](...t);console.groupEnd(),u()}else u()}function m(){c=function(){const e=new Date,t=(t,i)=>e[`get${t}`]().toString().padStart(i,"0");return`@ ${t("Hours",2)}:${t("Minutes",2)}:${t("Seconds",2)}.${t("Milliseconds",3)}`}(),queueMicrotask((()=>queueMicrotask(p)))}function h(e,...t){0===o.length&&m(),o.push([e,...t])}function g(t=e,...i){h("log",`${t}: ${performance.now()-s[t]} ms`,...i)}return{...a(l,r(l)),...a(console,(e=>[e,(...t)=>h(e,...t)])),...a(i,(e=>[e,console[e]])),endAutoGroup:p,purge:d,time:function(t=e){s[t]=performance.now()},timeEnd:function(t=e){g(t),delete s[t]},timeLog:g}}const l="5.4.0-beta.1",c="[iFrameSizer]",d=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),u=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)),f=e=>e;let p={},m=!1;const h=e=>window.top===window.self?`${e}(parent)`:`${e}(nested parent)`;const g=e=>(t,...i)=>p[t]?.console[e](...i),y=(w="log",(e,...t)=>!0===(e=>p[e]?p[e].log:m)(e)?g(w)(e,...t):null);var w;const b=g("warn"),v=g("event");const z=(e,t)=>p[e]?p[e].console.warn(u(f)(t)):queueMicrotask((()=>console?.warn(u((e=>(...t)=>[`iframeResizer(${e})`,...t].join(" "))(e))(t)))),$=(e=>(t,i="renamed to")=>(n,o,r="",a="")=>e(a,`<rb>Deprecated ${t}(${n.replace("()","")})</>\n\nThe <b>${n}</> ${t.toLowerCase()} has been ${i} <b>${o}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(z),j=$("Function"),k=$("Option"),T=(e,t,i,n)=>e.addEventListener(t,i,n||!1),R=(e,t,i)=>e.removeEventListener(t,i,!1),M=e=>{if(!e)return"";let t=-559038744,i=1103547984;for(let n,o=0;o<e.length;o++)n=e.codePointAt(o),t=Math.imul(t^n,2246822519),i=Math.imul(i^n,3266489917);return t^=Math.imul(t^i>>>15,1935289751),i^=Math.imul(i^t>>>15,3405138345),t^=i>>>16,i^=t>>>16,(2097152*(i>>>0)+(t>>>11)).toString(36)},S=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),I=["<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."],x=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],E=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),C=e=>S(I[e]),O=e=>{const t=e[S("spjluzl")];if(!t)return-1;const i=t.split("-");let n=function(e=""){let t=-2;const i=M(S(e));return i in E&&(t=E[i]),t}(i[0]);return 0===n||(e=>e[2]===M(e[0]+e[1]))(i)||(n=-2),n},W={},A=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,waitForLoad:!1,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof W[e.id].onInit&&(k("init()","onReady()","",e.id),W[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),F={position:null,version:l};function L(e){function t(){U(S),B(I),k("onResized",S)}function i(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const o=e=>M.slice(M.indexOf(":")+7+e);const r=(e,t)=>(i,n)=>{const o={};var r,a;r=function(){V(`${i} (${e})`,`${e}:${t()}`,n)},o[a=n]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},a=(e,t)=>()=>{let i=!1;const n=t=>()=>{W[l]?i&&i!==t||(e(t,l),i=t,requestAnimationFrame((()=>{i=!1}))):s()},o=n("scroll"),r=n("resize window");function a(e,i){y(l,`${e} listeners for send${t}`),i(window,"scroll",o),i(window,"resize",r)}function s(){a("Remove ",R),c.disconnect(),d.disconnect()}const l=I,c=new ResizeObserver(n("pageObserver")),d=new ResizeObserver(n("iframeObserver"));a("Add ",T),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(W[l].iframe,{attributes:!0,childList:!1,subtree:!1}),W[l]&&(W[l][`stop${t}`]=s)},s=e=>()=>{e in W[I]&&(W[I][e](),delete W[I][e])},d=r("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=S.iframe.getBoundingClientRect(),{scrollY:i,scrollX:n,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:i,scrollLeft:n,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),u=r("parentInfo",(function(){const{iframe:e}=S,{scrollWidth:t,scrollHeight:i}=document.documentElement,{width:n,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:i},viewport:{width:n,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),f=a(d,"PageInfo"),p=a(u,"ParentInfo"),m=s("stopPageInfo"),h=s("stopParentInfo");function g(e){const t=e.getBoundingClientRect();return H(I),{x:Number(t.left)+Number(F.position.x),y:Number(t.top)+Number(F.position.y)}}function w(e){const t=e?g(S.iframe):{x:0,y:0};y(I,`Reposition requested from iFrame (offset x:${t.x} y:${t.y})`);const i=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(S,t),n=window.parentIframe||window.parentIFrame;n?function(t,i){t["scrollTo"+(e?"Offset":"")](i.x,i.y)}(n,i):function(e){F.position=e,$(I)}(i)}function $(e){const{x:t,y:i}=F.position,n=W[e]?.iframe;!1!==k("onScroll",{iframe:n,top:i,left:t,x:t,y:i})?B(e):q()}function j(e){let t={};if(0===S.width&&0===S.height){const e=o(9).split(":");t={x:e[1],y:e[0]}}else t={x:S.width,y:S.height};k(e,{iframe:S.iframe,screenX:Number(t.x),screenY:Number(t.y),type:S.type})}const k=(e,t)=>N(I,e,t);let M=e.data,S={},I=null;"[iFrameResizerChild]Ready"!==M?c===`${M}`.slice(0,13)&&M.slice(13).split(":")[0]in W?(S=function(){const e=M.slice(13).split(":"),t=e[1]?Number(e[1]):0,o=W[e[0]]?.iframe,r=getComputedStyle(o);return{iframe:o,id:e[0],height:t+i(r)+n(r),width:Number(e[2]),type:e[3],msg:e[4]}}(),I=S.id,v(I,S.type),I?(function(e){if(!W[e])throw new Error(`${S.type} No settings for ${e}. Message was: ${M}`)}(I),function(){const e=S.type in{true:1,false:1,undefined:1};return e&&y(I,"Ignoring init message from meta parent page"),e}()||(y(I,`Received: ${M}`),W[I].loaded=!0,(null!==S.iframe||(b(I,`The iframe (${S.id}) was not found.`),0))&&function(){const{origin:t,sameDomain:i}=e;if(i)return!0;let n=W[I]?.checkOrigin;if(n&&"null"!=`${t}`&&!(n.constructor===Array?function(){let e=0,i=!1;for(y(I,`Checking connection is from allowed list of origins: ${n}`);e<n.length;e++)if(n[e]===t){i=!0;break}return i}():function(){const e=W[I]?.remoteHost;return y(I,`Checking connection is from: ${e}`),t===e}()))throw new Error(`Unexpected message received from: ${t} for ${S.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&function(){switch(W[I]?.firstRun&&W[I]&&(W[I].firstRun=!1),S.type){case"close":P(S.iframe);break;case"message":i=o(6),y(I,`onMessage passed: {iframe: ${S.iframe.id}, message: ${i}}`),k("onMessage",{iframe:S.iframe,message:JSON.parse(i)});break;case"mouseenter":j("onMouseEnter");break;case"mouseleave":j("onMouseLeave");break;case"autoResize":W[I].autoResize=JSON.parse(o(9));break;case"scrollBy":!function(){const e=S.width,t=S.height,i=window.parentIframe||window.parentIFrame||window;y(I,`Scroll request received by parent: x: ${e} y: ${t}`),i.scrollBy(e,t)}();break;case"scrollTo":w(!1);break;case"scrollToOffset":w(!0);break;case"pageInfo":d("start",I),f();break;case"parentInfo":u("start",I),p();break;case"pageInfoStop":m();break;case"parentInfoStop":h();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",i=decodeURIComponent(t);let n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){const e=g(n);y(I,`Moving to in page link (#${t}) at x: ${e.x} y: ${e.y}`),F.position={x:e.x,y:e.y},$(I),window.location.hash=t,y(I,"--")}():window.top!==window.self?function(){const e=window.parentIframe||window.parentIFrame;e?e.moveToAnchor(t):y(I,`In page link #${t} not found and window.parentIframe not found`)}():y(I,`In page link #${t} not found`)}(o(9));break;case"title":!function(e,t){W[t]?.syncTitle&&(W[t].iframe.title=e,y(t,`Set title attribute to: ${e}`))}(S.msg,I);break;case"reset":J(S);break;case"init":t(),function(e){try{W[e].sameDomain=!!W[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){W[e].sameDomain=!1}y(e,`sameDomain: ${W[e].sameDomain}`)}(I),(e=S.msg)!==l&&(void 0!==e?y(I,`Version mismatch (Child: ${e} !== Parent: ${l})`):z(I,"<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")),X=!0,k("onReady",S.iframe);break;default:if(0===S.width&&0===S.height)return void b(I,`Unsupported message received (${S.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===S.width||0===S.height)return void y(I,"Ignoring message with 0 height or width");if(document.hidden)return void y(I,"Page hidden - ignored resize request");t()}var e,i}())):b("","iframeResizer received messageData without id, message was: ",M)):null!==I&&y(I,"Ignored:",M):Object.keys(W).forEach((e=>{W[e].mode>=0&&V("iFrame requested init",Z(e),e)}))}function N(e,t,i){let n=null,o=null;if(W[e]){if(n=W[e][t],"function"!=typeof n)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onClose"===t||"onScroll"===t)try{o=n(i)}catch(i){console.error(i),b(e,`Error in ${t} callback`)}else setTimeout((()=>n(i)))}return o}function D(e){const{id:t}=e;y(t,"Disconnected from iframe"),delete W[t]}function P(e){const{id:t}=e;if(!1!==N(t,"onClose",t)){y(t,`Removing iFrame: ${t}`);try{e.parentNode&&e.remove()}catch(e){b(t,e)}N(t,"onClosed",t),D(e)}else y(t,"Close iframe cancelled by onClose event")}function H(e){null===F.position&&(F.position={x:window.scrollX,y:window.scrollY},y(e,`Get page position: ${F.position.x}, ${F.position.y}`))}function q(){F.position=null}function B(e){null!==F.position&&(window.scrollTo(F.position.x,F.position.y),y(e,`Set page position: ${F.position.x}, ${F.position.y}`),q())}function J(e){y(e.id,"Size reset requested by "+("init"===e.type?"parent page":"child page")),H(e.id),U(e),V("reset","reset",e.id)}function U(e){function t(t){const n=`${e[t]}px`;e.iframe.style[t]=n,y(i,`Iframe (${i}) ${t} set to ${n}`)}const{id:i}=e,{sizeHeight:n,sizeWidth:o}=W[i];n&&t("height"),o&&t("width")}function V(e,t,i,n){v(i,e),W[i]&&(W[i]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:n,sameDomain:o,targetOrigin:r}=W[i];if(o)try{return e.contentWindow.iframeChildListener(c+t),void y(i,`Sending message to iframe[${i}] (${t}) via sameDomain`)}catch(e){y(i,"Same domain connection failed. Trying cross domain")}y(i,`Sending message to iframe[${i}] (${t}) targetOrigin: ${r}`),n.postMessage(c+t,r)}():b(i,`Iframe(${i}) not found`),n&&W[i]?.warningTimeout&&(W[i].msgTimeout=setTimeout((function(){if(void 0===W[i])return;const{iframe:e,loaded:t,loadErrorShown:n,waitForLoad:o}=W[i],{sandbox:r}=e;t||n||(W[i].loadErrorShown=!0,z(i,`<rb>No response from iFrame</>\n \nThe iframe (<i>${i}</>) has not responded within ${W[i].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 <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}${!(r?.length>0)||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"} \n${!(r?.length>0)||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"}This message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`))}),W[i].warningTimeout)))}function Z(e){const t=W[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,F.version,t.mode].join(":")}p=W;let G=0,X=!1,Y=!1;const Q=e=>t=>{function i(e){if(!e)return{};if("object"!=typeof e)throw new TypeError("Options is not an object");return("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&z(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>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e}function n(e){const t=W[e]?.iframe?.title;return""===t||void 0===t}const o=function(i){if(i&&"string"!=typeof i)throw new TypeError("Invalid id for iFrame. Expected String");return""!==i&&i||(i=function(){let t=e?.id||A.id+G++;return null!==document.getElementById(t)&&(t+=G++),t}(),t.id=i,y(i,`Added missing iframe ID: ${i} (${t.src})`)),i}(t.id);return function({enabled:e,iframeId:t}){m=e,p[t]||(p[t]={console:s({label:h(t)})})}({enabled:Object.hasOwn(e,"log")?e.log:A.log,iframeId:o}),"iframeResizer"in t?b(o,`Ignored iframe (${o}), already setup.`):(function(e){var r,a;W[o]={...W[o],iframe:t,firstRun:!0,remoteHost:t?.src.split("/").slice(0,3).join("/"),...A,...i(e),mode:O(e),syncTitle:n(o)},v(o,"setup"),function(){const{direction:e}=W[o];if("horizontal"===e)return W[o].sizeWidth=!0,W[o].sizeHeight=!1,void y(o,'Direction set to "horizontal"');if("none"===e)return W[o].sizeWidth=!1,W[o].sizeHeight=!1,W[o].autoResize=!1,void y(o,'Direction set to "none"');if("vertical"!==e)throw new TypeError(o,`Direction value of "${e}" is not valid`);y(o,'Direction set to "vertical"')}(),(r=e?.offsetSize||e?.offset)&&("vertical"===W[o].direction?(W[o].offsetHeight=r,y(o,`Offset height set to ${r}`)):(W[o].offsetWidth=r,y(o,`Offset width set to ${r}`))),e?.offset&&z(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</>."),null===W[o].postMessageTarget&&(W[o].postMessageTarget=t.contentWindow),W[o].targetOrigin=!0===W[o].checkOrigin?""===(a=W[o].remoteHost)||null!==a.match(/^(about:blank|javascript:|file:\/\/)/)?"*":a:"*"}(e),function(){const{mode:e}=W[o];e<0&&z("Parent",`${C(e+2)}${C(2)}`),Y||e<0||(Y=!0,function(e,t){"iframeResizer"in window||(window.iframeResizer={version:e}),!m&&t>0||queueMicrotask((()=>console.info(`%ciframe-resizer ${e}`,"font-weight: bold;")))}(`v${l} (${(e=>S(x[e]))(e)})`,e),e<1&&z("Parent",C(3)))}(),_(),function(){switch(y(o,`Iframe scrolling ${W[o]?.scrolling?"enabled":"disabled"} for ${o}`),t.style.overflow=!1===W[o]?.scrolling?"hidden":"auto",W[o]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=W[o]?W[o].scrolling:"no"}}(),function(){const{bodyMargin:e}=W[o];"number"!=typeof e&&"0"!==e||(W[o].bodyMargin=`${e}px`)}(),function(e){const{id:i}=t,{mode:n,waitForLoad:r}=W[i];-1!==n&&-2!==n&&(T(t,"load",(function(){V("iFrame.onload",`${e}:${X}`,i,!0),function(){const e=W[o]?.firstRun,i=W[o]?.heightCalculationMethod in d;!e&&i&&J({iframe:t,height:0,width:0,type:"init"})}()})),!1===r&&V("init",`${e}:${X}`,i,!0))}(Z(o)),function(){if(W[o]){const{iframe:e}=W[o],t={close:P.bind(null,e),disconnect:D.bind(null,e),removeListeners(){z(o,"\n<rb>Deprecated Method Name</>\n\nThe [removeListeners()</> method has been renamed to [disconnect()</>.\n"),this.disconnect()},resize:V.bind(null,"Window resize","resize",o),moveToAnchor(e){V("Move to anchor",`moveToAnchor:${e}`,o)},sendMessage(e){V("message",`message:${e=JSON.stringify(e)}`,o)}};e.iframeResizer=t,e.iFrameResizer=t}}()),t?.iFrameResizer};function K(){!1===document.hidden&&(y("document","Trigger event: Visibility change"),function(e,t){const i=e=>W[e]?.autoResize&&!W[e]?.firstRun;Object.keys(W).forEach((function(n){i(n)&&V(e,t,n)}))}("Tab Visible","resize"))}const _=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{T(window,"message",L),T(document,"visibilitychange",K),window.iframeParentListener=e=>setTimeout((()=>L({data:e,sameDomain:!0})))})),ee="[iframeResizer] ";const te=function(){function e(e){switch(!0){case!e:throw new TypeError(`${ee}iframe is not defined`);case!e.tagName:throw new TypeError(`${ee}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${ee}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),i.push(e)}}let t,i;return function(n,o){if("undefined"==typeof window)return[];switch(t=Q(n),i=[],typeof o){case"undefined":case"string":document.querySelectorAll(o||"iframe").forEach(e);break;case"object":e(o);break;default:throw new TypeError(`${ee}Unexpected data type (${typeof o})`)}return Object.freeze(i)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){j("iFrameResize()","iframeResize()","","parent"),te(...e)}),te}));
|
|
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="default",t={collapsed:!1,defaultEvent:void 0,event:void 0,label:"Auto Group",showTime:!0},i={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:n,keys:o}=Object,r=e=>t=>[t,function(i){e[t]=i}],a=(e,t)=>n(o(e).map(t));function s(n){const o=[],s={},l={...t,...n};let c;function u(){o.length=0}function d(){delete l.event,u()}const f=()=>!o.some((([e])=>"error"===e||"warn"===e))&&l.collapsed;function p(){if(0!==o.length){console[f()?"groupCollapsed":"group"](`%c${l.label} %c${(e=>{const t=e.event||e.defaultEvent;return t?`${t} `:""})(l)}%c${l.showTime?c:""}`,"font-weight: normal;","font-weight: bold;","font-weight: normal;font-style: italic;");for(const[e,...t]of o)console[e](...t);console.groupEnd(),d()}else d()}function m(){c=function(){const e=new Date,t=(t,i)=>e[`get${t}`]().toString().padStart(i,"0");return`@ ${t("Hours",2)}:${t("Minutes",2)}:${t("Seconds",2)}.${t("Milliseconds",3)}`}(),queueMicrotask((()=>queueMicrotask(p)))}function h(e,...t){0===o.length&&m(),o.push([e,...t])}function g(t=e,...i){h("log",`${t}: ${performance.now()-s[t]} ms`,...i)}return{...a(l,r(l)),...a(console,(e=>[e,(...t)=>h(e,...t)])),...a(i,(e=>[e,console[e]])),endAutoGroup:p,purge:u,time:function(t=e){s[t]=performance.now()},timeEnd:function(t=e){g(t),delete s[t]},timeLog:g}}const l="5.4.0-beta.2",c="[iFrameSizer]",u=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),d=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)),f=e=>e;let p={},m=!1;const h=e=>window.top===window.self?`${e}(parent)`:`${e}(nested parent)`;const g=e=>(t,...i)=>p[t]?.console[e](...i),y=(w="log",(e,...t)=>!0===(e=>p[e]?p[e].log:m)(e)?g(w)(e,...t):null);var w;const b=g("warn"),v=g("event");const z=(e,t)=>p[e]?p[e].console.warn(d(f)(t)):queueMicrotask((()=>console?.warn(d((e=>(...t)=>[`iframeResizer(${e})`,...t].join(" "))(e))(t)))),$=(e=>(t,i="renamed to")=>(n,o,r="",a="")=>e(a,`<rb>Deprecated ${t}(${n.replace("()","")})</>\n\nThe <b>${n}</> ${t.toLowerCase()} has been ${i} <b>${o}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(z),j=$("Function"),k=$("Option"),T=(e,t,i,n)=>e.addEventListener(t,i,n||!1),R=(e,t,i)=>e.removeEventListener(t,i,!1),M=e=>{if(!e)return"";let t=-559038744,i=1103547984;for(let n,o=0;o<e.length;o++)n=e.codePointAt(o),t=Math.imul(t^n,2246822519),i=Math.imul(i^n,3266489917);return t^=Math.imul(t^i>>>15,1935289751),i^=Math.imul(i^t>>>15,3405138345),t^=i>>>16,i^=t>>>16,(2097152*(i>>>0)+(t>>>11)).toString(36)},S=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),I=["<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."],x=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],E=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),O=e=>S(I[e]),C=e=>{const t=e[S("spjluzl")];if(!t)return-1;const i=t.split("-");let n=function(e=""){let t=-2;const i=M(S(e));return i in E&&(t=E[i]),t}(i[0]);return 0===n||(e=>e[2]===M(e[0]+e[1]))(i)||(n=-2),n},W={},A=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,waitForLoad:!1,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof W[e.id].onInit&&(k("init()","onReady()","",e.id),W[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),L={position:null,version:l};function F(e){function t(){U(S),B(I),k("onResized",S)}function i(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const o=e=>M.slice(M.indexOf(":")+7+e);const r=(e,t)=>(i,n)=>{const o={};var r,a;r=function(){V(`${i} (${e})`,`${e}:${t()}`,n)},o[a=n]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},a=(e,t)=>()=>{let i=!1;const n=t=>()=>{W[l]?i&&i!==t||(e(t,l),i=t,requestAnimationFrame((()=>{i=!1}))):s()},o=n("scroll"),r=n("resize window");function a(e,i){y(l,`${e} listeners for send${t}`),i(window,"scroll",o),i(window,"resize",r)}function s(){a("Remove ",R),c.disconnect(),u.disconnect()}const l=I,c=new ResizeObserver(n("pageObserver")),u=new ResizeObserver(n("iframeObserver"));a("Add ",T),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),u.observe(W[l].iframe,{attributes:!0,childList:!1,subtree:!1}),W[l]&&(W[l][`stop${t}`]=s)},s=e=>()=>{e in W[I]&&(W[I][e](),delete W[I][e])},u=r("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=S.iframe.getBoundingClientRect(),{scrollY:i,scrollX:n,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:i,scrollLeft:n,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),d=r("parentInfo",(function(){const{iframe:e}=S,{scrollWidth:t,scrollHeight:i}=document.documentElement,{width:n,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:i},viewport:{width:n,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),f=a(u,"PageInfo"),p=a(d,"ParentInfo"),m=s("stopPageInfo"),h=s("stopParentInfo");function g(e){const t=e.getBoundingClientRect();return H(I),{x:Number(t.left)+Number(L.position.x),y:Number(t.top)+Number(L.position.y)}}function w(e){const t=e?g(S.iframe):{x:0,y:0};y(I,`Reposition requested from iFrame (offset x:${t.x} y:${t.y})`);const i=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(S,t),n=window.parentIframe||window.parentIFrame;n?function(t,i){t["scrollTo"+(e?"Offset":"")](i.x,i.y)}(n,i):function(e){L.position=e,$(I)}(i)}function $(e){const{x:t,y:i}=L.position,n=W[e]?.iframe;!1!==k("onScroll",{iframe:n,top:i,left:t,x:t,y:i})?B(e):q()}function j(e){let t={};if(0===S.width&&0===S.height){const e=o(9).split(":");t={x:e[1],y:e[0]}}else t={x:S.width,y:S.height};k(e,{iframe:S.iframe,screenX:Number(t.x),screenY:Number(t.y),type:S.type})}const k=(e,t)=>N(I,e,t);let M=e.data,S={},I=null;"[iFrameResizerChild]Ready"!==M?c===`${M}`.slice(0,13)&&M.slice(13).split(":")[0]in W?(S=function(){const e=M.slice(13).split(":"),t=e[1]?Number(e[1]):0,o=W[e[0]]?.iframe,r=getComputedStyle(o);return{iframe:o,id:e[0],height:t+i(r)+n(r),width:Number(e[2]),type:e[3],msg:e[4]}}(),I=S.id,v(I,S.type),I?(function(e){if(!W[e])throw new Error(`${S.type} No settings for ${e}. Message was: ${M}`)}(I),function(){const e=S.type in{true:1,false:1,undefined:1};return e&&y(I,"Ignoring init message from meta parent page"),e}()||(y(I,`Received: ${M}`),W[I].loaded=!0,(null!==S.iframe||(b(I,`The iframe (${S.id}) was not found.`),0))&&function(){const{origin:t,sameDomain:i}=e;if(i)return!0;let n=W[I]?.checkOrigin;if(n&&"null"!=`${t}`&&!(n.constructor===Array?function(){let e=0,i=!1;for(y(I,`Checking connection is from allowed list of origins: ${n}`);e<n.length;e++)if(n[e]===t){i=!0;break}return i}():function(){const e=W[I]?.remoteHost;return y(I,`Checking connection is from: ${e}`),t===e}()))throw new Error(`Unexpected message received from: ${t} for ${S.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&function(){switch(W[I]?.firstRun&&W[I]&&(W[I].firstRun=!1),S.type){case"close":P(S.iframe);break;case"message":i=o(6),y(I,`onMessage passed: {iframe: ${S.iframe.id}, message: ${i}}`),k("onMessage",{iframe:S.iframe,message:JSON.parse(i)});break;case"mouseenter":j("onMouseEnter");break;case"mouseleave":j("onMouseLeave");break;case"autoResize":W[I].autoResize=JSON.parse(o(9));break;case"scrollBy":!function(){const e=S.width,t=S.height,i=window.parentIframe||window.parentIFrame||window;y(I,`Scroll request received by parent: x: ${e} y: ${t}`),i.scrollBy(e,t)}();break;case"scrollTo":w(!1);break;case"scrollToOffset":w(!0);break;case"pageInfo":u("start",I),f();break;case"parentInfo":d("start",I),p();break;case"pageInfoStop":m();break;case"parentInfoStop":h();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",i=decodeURIComponent(t);let n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){const e=g(n);y(I,`Moving to in page link (#${t}) at x: ${e.x} y: ${e.y}`),L.position={x:e.x,y:e.y},$(I),window.location.hash=t,y(I,"--")}():window.top!==window.self?function(){const e=window.parentIframe||window.parentIFrame;e?e.moveToAnchor(t):y(I,`In page link #${t} not found and window.parentIframe not found`)}():y(I,`In page link #${t} not found`)}(o(9));break;case"title":!function(e,t){W[t]?.syncTitle&&(W[t].iframe.title=e,y(t,`Set title attribute to: ${e}`))}(S.msg,I);break;case"reset":J(S);break;case"init":t(),function(e){try{W[e].sameDomain=!!W[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){W[e].sameDomain=!1}y(e,`sameDomain: ${W[e].sameDomain}`)}(I),(e=S.msg)!==l&&(void 0!==e?y(I,`Version mismatch (Child: ${e} !== Parent: ${l})`):z(I,"<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")),X=!0,k("onReady",S.iframe);break;default:if(0===S.width&&0===S.height)return void b(I,`Unsupported message received (${S.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===S.width||0===S.height)return void y(I,"Ignoring message with 0 height or width");if(document.hidden)return void y(I,"Page hidden - ignored resize request");t()}var e,i}())):b("","iframeResizer received messageData without id, message was: ",M)):null!==I&&y(I,"Ignored:",M):Object.keys(W).forEach((e=>{W[e].mode>=0&&V("iFrame requested init",Z(e),e)}))}function N(e,t,i){let n=null,o=null;if(W[e]){if(n=W[e][t],"function"!=typeof n)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onClose"===t||"onScroll"===t)try{o=n(i)}catch(i){console.error(i),b(e,`Error in ${t} callback`)}else setTimeout((()=>n(i)))}return o}function D(e){const{id:t}=e;y(t,"Disconnected from iframe"),delete W[t]}function P(e){const{id:t}=e;if(!1!==N(t,"onClose",t)){y(t,`Removing iFrame: ${t}`);try{e.parentNode&&e.remove()}catch(e){b(t,e)}N(t,"onClosed",t),D(e)}else y(t,"Close iframe cancelled by onClose event")}function H(e){null===L.position&&(L.position={x:window.scrollX,y:window.scrollY},y(e,`Get page position: ${L.position.x}, ${L.position.y}`))}function q(){L.position=null}function B(e){null!==L.position&&(window.scrollTo(L.position.x,L.position.y),y(e,`Set page position: ${L.position.x}, ${L.position.y}`),q())}function J(e){y(e.id,"Size reset requested by "+("init"===e.type?"parent page":"child page")),H(e.id),U(e),V("reset","reset",e.id)}function U(e){function t(t){const n=`${e[t]}px`;e.iframe.style[t]=n,y(i,`Iframe (${i}) ${t} set to ${n}`)}const{id:i}=e,{sizeHeight:n,sizeWidth:o}=W[i];n&&t("height"),o&&t("width")}function V(e,t,i,n){v(i,e),W[i]&&(W[i]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:n,sameDomain:o,targetOrigin:r}=W[i];if(o)try{return e.contentWindow.iframeChildListener(c+t),void y(i,`Sending message to iframe[${i}] (${t}) via sameDomain`)}catch(e){y(i,"Same domain connection failed. Trying cross domain")}y(i,`Sending message to iframe[${i}] (${t}) targetOrigin: ${r}`),n.postMessage(c+t,r)}():b(i,`Iframe(${i}) not found`),n&&W[i]?.warningTimeout&&(W[i].msgTimeout=setTimeout((function(){if(void 0===W[i])return;const{iframe:e,loaded:t,loadErrorShown:n,waitForLoad:o}=W[i],{sandbox:r}=e;t||n||(W[i].loadErrorShown=!0,z(i,`<rb>No response from iFrame</>\n \nThe iframe (<i>${i}</>) has not responded within ${W[i].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 <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}${!(r?.length>0)||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"} \n${!(r?.length>0)||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"}This message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`))}),W[i].warningTimeout)))}function Z(e){const t=W[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,L.version,t.mode].join(":")}p=W;let G=0,X=!1,Y=!1;const Q=e=>t=>{function i(e){if(!e)return{};if("object"!=typeof e)throw new TypeError("Options is not an object");return("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&z(r,'<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>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e}function n(e){const t=W[e]?.iframe?.title;return""===t||void 0===t}const o=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");const r=function(i){if(i&&"string"!=typeof i)throw new TypeError("Invalid id for iFrame. Expected String");return""!==i&&i||(i=function(){let t=e?.id||A.id+G++;return null!==document.getElementById(t)&&(t+=G++),t}(),t.id=i,y(i,`Added missing iframe ID: ${i} (${t.src})`)),i}(t.id);return function({enabled:e,iframeId:t}){m=e,p[t]||(p[t]={console:s({label:h(t)})})}({enabled:Object.hasOwn(e,"log")?e.log:A.log,iframeId:r}),"iframeResizer"in t?b(r,`Ignored iframe (${r}), already setup.`):(function(e){var a,s;W[r]={...W[r],iframe:t,firstRun:!0,remoteHost:t?.src.split("/").slice(0,3).join("/"),...A,...i(e),mouseEvents:o(e),mode:C(e),syncTitle:n(r)},v(r,"setup"),function(){const{direction:e}=W[r];if("horizontal"===e)return W[r].sizeWidth=!0,W[r].sizeHeight=!1,void y(r,'Direction set to "horizontal"');if("none"===e)return W[r].sizeWidth=!1,W[r].sizeHeight=!1,W[r].autoResize=!1,void y(r,'Direction set to "none"');if("vertical"!==e)throw new TypeError(r,`Direction value of "${e}" is not valid`);y(r,'Direction set to "vertical"')}(),(a=e?.offsetSize||e?.offset)&&("vertical"===W[r].direction?(W[r].offsetHeight=a,y(r,`Offset height set to ${a}`)):(W[r].offsetWidth=a,y(r,`Offset width set to ${a}`))),e?.offset&&z(r,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>."),null===W[r].postMessageTarget&&(W[r].postMessageTarget=t.contentWindow),W[r].targetOrigin=!0===W[r].checkOrigin?""===(s=W[r].remoteHost)||null!==s.match(/^(about:blank|javascript:|file:\/\/)/)?"*":s:"*"}(e),function(){const{mode:e}=W[r];e<0&&z("Parent",`${O(e+2)}${O(2)}`),Y||e<0||(Y=!0,function(e,t){"iframeResizer"in window||(window.iframeResizer={version:e}),!m&&t>0||queueMicrotask((()=>console.info(`%ciframe-resizer ${e}`,"font-weight: bold;")))}(`v${l} (${(e=>S(x[e]))(e)})`,e),e<1&&z("Parent",O(3)))}(),_(),function(){switch(y(r,`Iframe scrolling ${W[r]?.scrolling?"enabled":"disabled"} for ${r}`),t.style.overflow=!1===W[r]?.scrolling?"hidden":"auto",W[r]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=W[r]?W[r].scrolling:"no"}}(),function(){const{bodyMargin:e}=W[r];"number"!=typeof e&&"0"!==e||(W[r].bodyMargin=`${e}px`)}(),function(e){const{id:i}=t,{mode:n,waitForLoad:o}=W[i];-1!==n&&-2!==n&&(T(t,"load",(function(){V("iFrame.onload",`${e}:${X}`,i,!0),function(){const e=W[r]?.firstRun,i=W[r]?.heightCalculationMethod in u;!e&&i&&J({iframe:t,height:0,width:0,type:"init"})}()})),!1===o&&V("init",`${e}:${X}`,i,!0))}(Z(r)),function(){if(W[r]){const{iframe:e}=W[r],t={close:P.bind(null,e),disconnect:D.bind(null,e),removeListeners(){z(r,"\n<rb>Deprecated Method Name</>\n\nThe [removeListeners()</> method has been renamed to [disconnect()</>.\n"),this.disconnect()},resize:V.bind(null,"Window resize","resize",r),moveToAnchor(e){V("Move to anchor",`moveToAnchor:${e}`,r)},sendMessage(e){V("message",`message:${e=JSON.stringify(e)}`,r)}};e.iframeResizer=t,e.iFrameResizer=t}}()),t?.iFrameResizer};function K(){!1===document.hidden&&(y("document","Trigger event: Visibility change"),function(e,t){const i=e=>W[e]?.autoResize&&!W[e]?.firstRun;Object.keys(W).forEach((function(n){i(n)&&V(e,t,n)}))}("Tab Visible","resize"))}const _=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{T(window,"message",F),T(document,"visibilitychange",K),window.iframeParentListener=e=>setTimeout((()=>F({data:e,sameDomain:!0})))})),ee="[iframeResizer] ";const te=function(){function e(e){switch(!0){case!e:throw new TypeError(`${ee}iframe is not defined`);case!e.tagName:throw new TypeError(`${ee}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${ee}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),i.push(e)}}let t,i;return function(n,o){if("undefined"==typeof window)return[];switch(t=Q(n),i=[],typeof o){case"undefined":case"string":document.querySelectorAll(o||"iframe").forEach(e);break;case"object":e(o);break;default:throw new TypeError(`${ee}Unexpected data type (${typeof o})`)}return Object.freeze(i)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){j("iFrameResize()","iframeResize()","","parent"),te(...e)}),te}));
|
|
21
21
|
//# sourceMappingURL=iframeResizer.js.map
|