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