@iframe-resizer/child 5.5.4 → 5.5.5
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 -2
- package/index.esm.js +2 -2
- package/index.umd.js +2 -2
- package/package.json +2 -2
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.
|
|
4
|
+
* @module iframe-resizer/child 5.5.5 (cjs) - 2025-09-01
|
|
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,4 +17,4 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
"use strict";const e=require("auto-console-group"),t="5.5.4",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((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()}()});let On=!1;const Sn=e=>e.postMessage("[iFrameResizerChild]Ready","*");function In(){if("loading"===document.readyState||!$e||On)return;const{parent:e,top:t}=window;Sn(e),e!==t&&Sn(t),On=!0}"iframeChildListener"in window?Q("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>$n({data:e,sameOrigin:!0})),w(window,"message",$n),w(document,"readystatechange",In),setTimeout(In))}();
|
|
20
|
+
"use strict";const e=require("auto-console-group"),t="5.5.5",n="iframeResizer",o="beforeUnload",r="init",i="message",a="pageInfo",s="parentInfo",c="scrollToOffset",l="title",u=10,d="data-iframe-size",f="data-iframe-overflowed",m="data-iframe-ignore",h="height",p="width",g="readystatechange",y="bottom",b="right",v="autoResizeEnabled",z=Symbol("sizeChanged"),w="manualResize",$="parentResize",O={[w]:1,[$]:1},S="setOffsetSize",I="resizeObserver",E="overflowObserver",M="mutationObserver",T="visibilityObserver",k="[iFrameSizer]",j=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),N=(e,t,n,o)=>e.addEventListener(t,n,o||!1),A=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)},x=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),R=["spjluzl","rlf","clyzpvu"],C=["<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."],P=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],H=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),L=e=>x(C[e]),G=e=>{const t=e[x(R[0])]||e[x(R[1])]||e[x(R[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=A(x(e));return n in H&&(t=H[n]),t}(n[0]);return 0===o||(e=>e[2]===A(e[0]+e[1]))(n)||(o=-2),o},B=(e,...t)=>setTimeout(()=>e(...t),0),q=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},D=e=>e,F=e=>Math.round(1e3*e)/1e3,W=e=>e.charAt(0).toUpperCase()+e.slice(1),U=e=>""!=`${e}`&&void 0!==e;const V=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${W(t)}`)};let Z=!0,J=n;var _;const Q=(_=e,_?.__esModule?_.default:_)({label:`${n}(child)`,expand:!1});var Y;const X=(Y="log",(...e)=>!Z||Q[Y](...e));const{assert:K,endAutoGroup:ee,error:te,errorBoundary:ne,event:oe,label:re,purge:ie,warn:ae}=Q,se=e=>{return Q.warn((t=D,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},ce=se,le=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>se(t)),ue=le("Method"),de=le("Method","replaced with"),fe=le("Option"),me=["min-height","min-width","max-height","max-width"],he=new Set,pe=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),ge=(e,t)=>{return(n=pe(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function ye({href:e}){he.has(e)||he.add(e)}const be=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){ye(n)}return{source:"cross-origin stylesheet",value:pe(e,t)}}(e,t),ve=(e,t)=>{const{source:n,value:o}=be(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);se(`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 ze(){for(const e of[document.documentElement,document.body])for(const t of me)ge(e,t)&&ve(e,t)}const we=e=>t=>void 0===t?void 0:e(t),$e=we(e=>"true"===e),Oe=we(Number),Se=e=>e=>{e.size},Ie=((e="")=>t=>n=>{n.size>0&&te(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Ee=e=>e=>{e.size},Me=(t,n=!0)=>o=>{o>0&&X(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,e.HIGHLIGHT,e.NORMAL)},Te=(e,t,n,o)=>{const r=Ee(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()}},ke=new Set,je=new Set,Ne=new Set,Ae=[],xe={attributes:!0,attributeFilter:[m,d],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Re,Ce=1,Pe=!1,He=0;const Le=e=>{e.size},Ge=e=>{e.size},Be=e=>{e.size},qe=e=>e.nodeType!==Node.ELEMENT_NODE||j.has(e.tagName.toLowerCase());function De(e){const t=e.addedNodes;for(const e of t)qe(e)||ke.add(e)}function Fe(e){const t=e.removedNodes;for(const e of t)qe(e)||(ke.has(e)?(ke.delete(e),Ne.add(e)):je.add(e))}const We=e=>{X("Mutations:",e);for(const t of e)De(t),Fe(t);Le(ke),Ge(je),Be(Ne),Ne.clear()};const Ue=t=>()=>{const n=performance.now(),o=n-He,r=16*Ce+++2;if(o>r&&o<200)return oe("mutationThrottled"),X("Update delayed due to heavy workload on the callStack"),X(`EventLoop busy time: %c${F(o)}ms %c> Max wait: %c${r-2}ms`,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT),setTimeout(Re,16*Ce),void(He=n);Ce=1,Ae.forEach(We),Ae.length=0,Pe=!1,je.size,ke.size,t({addedNodes:ke,removedNodes:je}),ke.clear(),je.clear()};function Ve(e){Ae.push(e),Pe||(He=performance.now(),Pe=!0,requestAnimationFrame(Re))}function Ze(e){const t=new window.MutationObserver(Ve),n=document.body||document.documentElement;return Re=Ue(e),t.observe(n,xe),X("Attached MutationObserver to body"),{...t,disconnect:()=>{ke.clear(),je.clear(),Ae.length=0,t.disconnect(),X("Detached MutationObserver")}}}const Je="Overflow",_e=Me(Je),Qe=Me(Je,!1),Ye=Se(Je),Xe=Ie(Je),Ke=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,et=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||D,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(f,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)&&!Ke(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));Xe(t),Ye(n),_e(o),n.clear(),t.clear()},detachObservers:Te(Je,c,l,Qe),disconnect:()=>{c.disconnect(),X("Detached OverflowObserver")}}},tt="--ifr-start",nt="--ifr-end",ot="--ifr-measure",rt=[];let it,at={},st=0;function ct(){try{performance.clearMarks(tt),performance.clearMarks(nt),performance.clearMeasures(ot)}catch{}}function lt(e){e.getEntries().forEach(e=>{if(e.name===nt)try{const{duration:t}=performance.measure(ot,tt,nt);at=e.detail,rt.push(t),rt.length>100&&rt.shift()}catch{}})}function ut(){X("Attached PerformanceObserver to page");const e=new PerformanceObserver(lt);return e.observe({entryTypes:["mark"]}),it=setInterval(()=>{if(rt.length<10)return;if(at.hasTags&&at.len<25)return;rt.sort();const e=Math.min(rt.reduce((e,t)=>e+t,0)/rt.length,rt[Math.floor(rt.length/2)]),t=F(e);t>st&&(st=t,oe("performanceObserver")),ct(),e<=4||(clearInterval(it),se(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${F(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${at.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{ct(),clearInterval(it),e.disconnect(),X("Detached PerformanceObserver")}}}const dt="Resize",ft=Me(dt),mt=Me(dt,!1),ht=Se(dt),pt=Ie(dt),gt=new WeakSet,yt=new Set,bt=new Set;let vt;function zt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(gt.has(n)?yt.add(n):(vt.observe(n),gt.add(n),bt.add(n),t+=1))}pt(yt),ht(bt),ft(t),bt.clear(),yt.clear()}function wt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),X("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),X("Detached VisibilityObserver")}}}const $t=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Ot=$t("function"),St=$t("number"),It=$t("string");"undefined"!=typeof window&&function(){const A={height:()=>(ae("Custom height calculation function not defined"),vn.auto()),width:()=>(ae("Custom width calculation function not defined"),zn.auto())},C={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},H={},F="auto",_=[],Y="scroll";let le,me,he,pe,ge,ye,be,ve=!0,we="",Se=0,Ie="",Ee="",Me=!1,ke=!0,je=!1,Ne=!0,Ae=!1,xe=!1,Re=!0,Ce=!1,Pe=1,He=F,Le="",Ge=!0,Be={},qe=!1,De=!1,Fe=!1,We=0,Ue=!1,Ve=0,Je=0,_e=new Set,Qe="",Ye="child",Xe=!1,Ke="",ot=[],rt=window.parent,it="*",at=0,st=!1,ct=1,lt=Y,ft=window,ht=()=>{ae("onMessage function not defined")},pt=()=>{},yt=null,bt=null;function $t(o){var i;!function(e){Qe=e[0]??Qe,Se=Oe(e[1])??Se,je=$e(e[2])??je,Fe=$e(e[3])??Fe,ve=$e(e[6])??ve,Ie=e[7]??Ie,He=e[8]??He,we=e[9]??we,Ee=e[10]??Ee,at=Oe(e[11])??at,Be.enable=$e(e[12])??!1,Ye=e[13]??Ye,lt=e[14]??lt,Ue=$e(e[15])??Ue,Ve=Oe(e[16])??Ve,Je=Oe(e[17])??Je,ke=$e(e[18])??ke,le=e[19]??le,ye=e[20]??ye,We=Oe(e[21])??We,De=$e(e[23])??De}(o),J=(i={id:Qe,enabled:Fe,expand:De}).id||n,Q.label(`${J}`),Q.expand(i.expand),Z=i.enabled,function(){function t(e){be=Ot(e,"onBeforeResize")??be,ht=Ot(e,"onMessage")??ht,pt=Ot(e,"onReady")??pt,"number"==typeof e?.offset&&(fe("offset","offsetSize"),ke&&(Ve=St(e,"offset")??Ve),je&&(Je=St(e,"offset")??Je)),"number"==typeof e?.offsetSize&&(ke&&(Ve=St(e,"offsetSize")??Ve),je&&(Je=St(e,"offsetSize")??Je)),me=It(e,x(R[0]))??me,Le=It(e,"ignoreSelector")??Le,Ke=It(e,"sizeSelector")??Ke,it=It(e,"targetOrigin")??it,He=e?.heightCalculationMethod||He,lt=e?.widthCalculationMethod||lt}function n(e,t){return"function"==typeof e&&(se(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),A[t]=e,e="custom"),e}if(1===We)return;const o=window.iframeResizer||window.iFrameResizer;"object"==typeof o&&(t(o),He=n(He,h),lt=n(lt,p),X(`Set targetOrigin for parent: %c${it}`,e.HIGHLIGHT))}(),[At,Rt,Vt,jt,xt,Wt,Ut,Dt,Nt,Tt,Me?D:ze,Ht,Yt,Qt,_t,Lt,()=>Ct("background",we),()=>Ct("padding",Ee),Me?D:Gt,Jt,Zt,un,Et].forEach(e=>{try{e()}catch(e){if(We<0)throw e;se("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),te(e)}}),Mt(q(pt)),Mn(r,"Init message from host page",void 0,void 0,`${t}:${We}`),document.title&&""!==document.title&&jn(0,0,l,document.title)}function Et(){N(window,o.toLowerCase(),()=>{_.forEach(e=>e()),jn(0,0,o)})}function Mt(e){"complete"===document.readyState?B(e):N(document,g,()=>Mt(e))}function Tt(){ot=document.querySelectorAll(`[${d}]`),Ce=ot.length>0}let kt=0;function jt(){const t=document.querySelectorAll(`*[${m}]`);return Ae=t.length>0,Ae&&t.length!==kt&&(function(t){const n=1===t.length?"":"s";ae(`%c[${m}]%c found on %c${t.length}%c element${n}`,e.BOLD,e.NORMAL,e.BOLD,e.NORMAL)}(t),kt=t.length),Ae}function Nt(){"BackCompat"===document.compatMode&&se("<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n")}function At(){ye&&""!==ye&&"false"!==ye?ye!==t&&se(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ye} - Child page: ${t}.\n`):se("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n")}function xt(){try{Xe=1===We||"iframeParentListener"in window.parent}catch(e){}}function Rt(){je===ke&&(Me=!0)}function Ct(t,n){void 0!==n&&""!==n&&"null"!==n&&(document.body.style.setProperty(t,n),X(`Set body ${t}: %c${n}`,e.HIGHLIGHT))}function Pt(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Ht(){Pt(0,d,Ke),Pt(0,m,Le)}function Lt(){var e,t;void 0===Ie&&(Ie=`${Se}px`),Ct("margin",(e="margin",(t=Ie).includes("-")&&(ae(`Negative CSS value ignored for ${e}`),t=""),t))}function Gt(){const e=e=>e.style.setProperty(h,"auto","important");e(document.documentElement),e(document.body)}function Bt(e){({add(t){function n(){Mn(e.eventName,e.eventType)}H[t]=n,N(window,t,n,{passive:!0})},remove(e){const t=H[e];var n,o;delete H[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function qt(e){Bt({method:e,eventType:"After Print",eventName:"afterprint"}),Bt({method:e,eventType:"Before Print",eventName:"beforeprint"}),Bt({method:e,eventType:"Ready State Change",eventName:g})}function Dt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(d,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&se("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}function Ft(e,t,n){const{label:o}=n;return t!==e&&(e in n||(ae(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in C)&&se(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you ${ye?"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 Wt(){He=Ft(He,F,vn)}function Ut(){lt=Ft(lt,Y,zn)}function Vt(){const n=We,o=G({key:le}),r=G({key:me});if(We=Math.max(o,r),We<0){if(We=Math.min(o,r),ie(),se(`${L(We+2)}${L(2)}`),U(ye))throw L(We+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!U(ye)||n>-1&&We>n)&&(sessionStorage.getItem("ifr")!==t&&function(t,n){console.info(`${J} %ciframe-resizer ${t}`,Z||n<1?"font-weight: bold;":e.NORMAL)}(`v${t} (${(e=>x(P[e]))(We)})`,We),We<2&&ce(L(3)),sessionStorage.setItem("ifr",t))}function Zt(){qt("add"),_.push(()=>qt("remove"))}function Jt(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function _t(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,u)+parseInt(n.x,u),y:parseInt(t.top,u)+parseInt(n.y,u)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?jn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);jn(n.y,n.x,c)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}Be.enable&&(1===We?se("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")&&N(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),N(window,"hashchange",n),setTimeout(n,128))),Be={findTarget:t}}function Qt(){function e(e){jn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){N(window.document,t,e)}!0===Ue&&(t("mouseenter"),t("mouseleave"))}function Yt(){1!==We&&(ft.parentIframe=Object.freeze({autoResize:e=>(V(e,"boolean","parentIframe.autoResize(enable) enable"),!1===je&&!1===ke?(oe(v),se("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===ve?(ve=!0,queueMicrotask(()=>Mn(v,"Auto Resize enabled"))):!1===e&&!0===ve&&(ve=!1),jn(0,0,"autoResize",JSON.stringify(ve)),ve)),close(){jn(0,0,"close")},getId:()=>Qe,getOrigin:()=>(oe("getOrigin"),ue("getOrigin()","getParentOrigin()"),he),getParentOrigin:()=>he,getPageInfo(e){if("function"==typeof e)return yt=e,jn(0,0,a),void de("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");yt=null,jn(0,0,"pageInfoStop")},getParentProps:e=>(V(e,"function","parentIframe.getParentProps(callback) callback"),bt=e,jn(0,0,s),()=>{bt=null,jn(0,0,"parentInfoStop")}),getParentProperties(e){ue("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){V(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Be.findTarget(e)},reset(){!function(){const e=He;He=F,st||(st=!0,requestAnimationFrame(()=>{st=!1})),Tn("reset"),He=e}()},setOffsetSize(e){V(e,"number","parentIframe.setOffsetSize(offset) offset"),Ve=e,Je=e,Mn(S,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){V(e,"number","parentIframe.scrollBy(x, y) x"),V(t,"number","parentIframe.scrollBy(x, y) y"),jn(t,e,"scrollBy")},scrollTo(e,t){V(e,"number","parentIframe.scrollTo(x, y) x"),V(t,"number","parentIframe.scrollTo(x, y) y"),jn(t,e,"scrollTo")},scrollToOffset(e,t){V(e,"number","parentIframe.scrollToOffset(x, y) x"),V(t,"number","parentIframe.scrollToOffset(x, y) y"),jn(t,e,c)},sendMessage(e,t){t&&V(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),jn(0,0,i,JSON.stringify(e),t)},setHeightCalculationMethod(e){He=e,Wt()},setWidthCalculationMethod(e){lt=e,Ut()},setTargetOrigin(e){V(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),it=e},resize(e,t){void 0!==e&&V(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&V(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),Mn(w,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ue("size()","resize()"),this.resize(e,t)}}),ft.parentIFrame=ft.parentIframe)}let Xt=new Set;function Kt(){const e=document.querySelectorAll(`[${f}]`);_e=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${m}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{oe("overflowIgnored"),X("Ignoring elements with [data-iframe-ignore] > *:\n",n),ee()}),t}(e),xe=_e.size>0,"function"==typeof Set.prototype.symmetricDifference&&(Re=_e.symmetricDifference(Xt).size>0),Xt=_e}function en(){switch(Kt(),!0){case!Re:return;case _e.size>1:X("Overflowed Elements:",_e);break;case xe:break;default:X("No overflow detected")}Mn(E,"Overflow updated")}function tn(e){const t={root:document.documentElement,side:ke?y:b};return pe=et(en,t),pe.attachObservers(e),pe}function nn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Mn(I,`Element resized <${function(e){switch(!0){case!U(e):return"";case U(e.id):return`${e.nodeName}#${e.id}`;case U(e.name):return`${e.nodeName} (${e.name}`;case U(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function on(e){return vt=new ResizeObserver(nn),vt.observe(document.body),gt.add(document.body),X("Attached ResizeObserver to body"),ge={attachObserverToNonStaticElements:zt,detachObservers:Te(dt,vt,gt,mt),disconnect:()=>{vt.disconnect(),X("Detached ResizeObserver")}},ge.attachObserverToNonStaticElements(e),ge}function rn(e){qe=!e,Mn(T,"Visibility changed")}const an=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of hn(n))t.add(e)}return X("Inspecting:\n",t),t},sn=e=>{if(0===e.size)return;oe("addObservers");const t=an(e);pe.attachObservers(t),ge.attachObserverToNonStaticElements(t),ee()},cn=e=>{if(0===e.size)return;oe("removeObservers");const t=an(e);pe.detachObservers(t),ge.detachObservers(t),ee()};function ln(e){!function({addedNodes:e,removedNodes:t}){oe("contentMutated"),Ht(),Tt(),Kt(),ee(),cn(t),sn(e)}(e),Mn(M,"Mutation Observed")}function un(){const e=hn(document.documentElement);var t;t=[Ze(ln),tn(e),ut(),on(e),wt(rn)],_.push(...t.map(e=>e.disconnect))}function dn(t){performance.mark(tt);const n=W(t);let o=1,r=document.documentElement,i=Ce?0:document.documentElement.getBoundingClientRect().bottom;const a=Ce?ot:xe?Array.from(_e):hn(document.documentElement);for(const e of a)o=e.getBoundingClientRect()[t]+parseFloat(getComputedStyle(e).getPropertyValue(`margin-${t}`)),o>i&&(i=o,r=e);return X(`${n} position calculated from:`,r),X(`Checked %c${a.length}%c elements`,e.HIGHLIGHT,e.FOREGROUND),performance.mark(nt,{detail:{hasTags:Ce,len:a.length,logging:Fe,Side:n}}),i}const fn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],mn=`* ${Array.from(j).map(e=>`:not(${e})`).join("")}`,hn=e=>e.querySelectorAll(mn),pn={height:0,width:0},gn={height:0,width:0},yn=[e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT];function bn(t){function n(){return gn[r]=i,pn[r]=c,Math.max(i,1)}const o=t===vn,r=t.label,i=t.boundingClientRect(),a=Math.ceil(i),s=Math.floor(i),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(t),l=`HTML: %c${i}px %cPage: %c${c}px`;let u=0;switch(!0){case!t.enabled():return Math.max(c,1);case Ce:X("Found element with data-iframe-size attribute"),u=t.taggedElement();break;case!xe&&Ne&&0===gn[r]&&0===pn[r]:X(`Initial page size values: ${l}`,...yn),u=n();break;case st&&i===gn[r]&&c===pn[r]:X(`Size unchanged: ${l}`,...yn),u=Math.max(i,c);break;case 0===i&&0!==c:X(`Page is hidden: ${l}`,...yn),u=c;break;case!xe&&i!==gn[r]&&c<=pn[r]:X(`New <html> size: ${l} `,...yn),X(`Previous <html> size: %c${gn[r]}px`,e.HIGHLIGHT),u=n();break;case!o:u=t.taggedElement();break;case!xe&&i<gn[r]:X(`<html> size decreased: ${l}`,...yn),u=n();break;case c===s||c===a:X(`<html> size equals page size: ${l}`,...yn),u=n();break;case i>c:X(`Page size < <html> size: ${l}`,...yn),u=n();break;case xe:X("Found elements possibly overflowing <html> "),u=t.taggedElement();break;default:X(`Using <html> size: ${l}`,...yn),u=n()}return X(`Content ${r}: %c${u}px`,e.HIGHLIGHT),u+=function(t){const n=t.getOffset();return 0!==n&&X(`Page offsetSize: %c${n}px`,e.HIGHLIGHT),n}(t),u}const vn={label:h,enabled:()=>ke,getOffset:()=>Ve,auto:()=>bn(vn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,u)+parseInt(t.marginBottom,u)},bodyScroll:()=>document.body.scrollHeight,offset:()=>vn.bodyOffset(),custom:()=>A.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...fn(vn)),min:()=>Math.min(...fn(vn)),grow:()=>vn.max(),lowestElement:()=>dn(y),taggedElement:()=>dn(y)},zn={label:p,enabled:()=>je,getOffset:()=>Je,auto:()=>bn(zn),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>A.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...fn(zn)),min:()=>Math.min(...fn(zn)),rightMostElement:()=>dn(b),scroll:()=>Math.max(zn.bodyScroll(),zn.documentElementScroll()),taggedElement:()=>dn(b)},wn=(e,t)=>!(Math.abs(e-t)<=at);function $n(e,t){const n=e[t](),o=e.enabled()&&void 0!==be?function(e){const t=be(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 K(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let On=!1;const Sn=q(()=>ce(L(4)));let In,En=!1;const Mn=ne((e,t,n,o,i)=>{switch(oe(e),!0){case!0===qe:if(!0===En)break;En=!0,On=!1,cancelAnimationFrame(In);break;case!0===On&&e!==E:ie();break;case!ve&&!(e in O):X("Resizing disabled");break;default:En=!1,On=!0,performance.now(),In=requestAnimationFrame(()=>{On=!1,oe("requestAnimationFrame")}),function(e,t,n,o,i){const a=n??$n(vn,He),s=o??$n(zn,lt);switch(ke&&wn(Pe,a)||je&&wn(ct,s)?z:e){case r:case v:case z:Pe=a,ct=s;case S:kn(Pe,ct,e,i);break;case E:case M:case I:case T:ie();break;default:ie(),X("No change in content size detected")}}(e,0,n,o,i)}ee()});function Tn(e){Pe=vn[He](),ct=zn[lt](),jn(Pe,ct,e)}function kn(t,n,o,r,i){We<-1||(void 0!==i||(i=it),function(){const a=`${Qe}:${t}:${n}:${o}${void 0===r?"":`:${r}`}`;if(Xe)try{window.parent.iframeParentListener(k+a)}catch(e){if(1!==We)throw e;return void Sn()}else rt.postMessage(k+a,i);X(`Sending message to parent page via ${Xe?"sameOrigin":"postMessage"}: %c%c${a}`,e.ITALIC,e.HIGHLIGHT)}())}const jn=ne((e,t,n,o,r)=>{oe(n),kn(e,t,n,o,r),ee()}),Nn=ne(function(e){oe("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>jn(0,0,`${e}Stop`),i={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");rt=e.source,he=e.origin,$t(t),Ne=!1,setTimeout(()=>{Ge=!1},128)},reset(){Ge||Tn("resetPage")},resize(){Mn($,"Parent window requested size check")},moveToAnchor(){Be.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();yt?B(yt,n(e)):o(a)},parentInfo(){const e=(r=l(),t(n(r)));var r;bt?B(bt,e):o(s)},message(){const e=l();B(ht,n(e))}},c=()=>e.data.split("]")[1].split(":")[0],l=()=>e.data.slice(e.data.indexOf(":")+1),u=()=>e.data.split(":")[2]in{true:1,false:1};function d(){const t=c();oe(t),t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||u()||ae(`Unexpected message (${e.data})`)}k===`${e.data}`.slice(0,13)&&function(){if(!1!==Ne)return u()?(re(c()),oe(r),void i.init()):void 0;d()}()});let An=!1;const xn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function Rn(){if("loading"===document.readyState||!Ne||An)return;const{parent:e,top:t}=window;oe("ready"),xn(e),e!==t&&xn(t),An=!0}"iframeChildListener"in window?ae("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Nn({data:e,sameOrigin:!0})),N(window,i,Nn),N(document,g,Rn),setTimeout(Rn))}();
|
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/child 5.5.
|
|
4
|
+
* @module iframe-resizer/child 5.5.5 (esm) - 2025-09-01
|
|
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,4 +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.4",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((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()}()});let kn=!1;const jn=e=>e.postMessage("[iFrameResizerChild]Ready","*");function Tn(){if("loading"===document.readyState||!Me||kn)return;const{parent:e,top:t}=window;jn(e),e!==t&&jn(t),kn=!0}"iframeChildListener"in window?te("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Mn({data:e,sameOrigin:!0})),M(window,"message",Mn),M(document,"readystatechange",Tn),setTimeout(Tn))}();
|
|
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.5",s="iframeResizer",c="beforeUnload",l="init",u="message",d="pageInfo",m="parentInfo",f="scrollToOffset",h="title",p=10,g="data-iframe-size",y="data-iframe-overflowed",b="data-iframe-ignore",v="height",z="width",w="readystatechange",$="bottom",S="right",O="autoResizeEnabled",E=Symbol("sizeChanged"),M="manualResize",k="parentResize",j={[M]:1,[k]:1},T="setOffsetSize",x="resizeObserver",A="overflowObserver",I="mutationObserver",N="visibilityObserver",C="[iFrameSizer]",P=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),R=(e,t,n,o)=>e.addEventListener(t,n,o||!1),B=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)},q=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),L=["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."],W=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],F=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),V=e=>q(D[e]),H=e=>{const t=e[q(L[0])]||e[q(L[1])]||e[q(L[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=B(q(e));return n in F&&(t=F[n]),t}(n[0]);return 0===o||(e=>e[2]===B(e[0]+e[1]))(n)||(o=-2),o},U=(e,...t)=>setTimeout(()=>e(...t),0),Z=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},J=e=>e,_=e=>Math.round(1e3*e)/1e3,Q=e=>e.charAt(0).toUpperCase()+e.slice(1),Y=e=>""!=`${e}`&&void 0!==e;const G=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${Q(t)}`)};let X=!0,K=s;var ee;const te=(ee=e,ee?.__esModule?ee.default:ee)({label:`${s}(child)`,expand:!1});var ne;const oe=(ne="log",(...e)=>!X||te[ne](...e));const{assert:re,endAutoGroup:ae,error:ie,errorBoundary:se,event:ce,label:le,purge:ue,warn:de}=te,me=e=>{return te.warn((t=J,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},fe=me,he=(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)=>me(t)),pe=he("Method"),ge=he("Method","replaced with"),ye=he("Option"),be=["min-height","min-width","max-height","max-width"],ve=new Set,ze=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),we=(e,t)=>{return(n=ze(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function $e({href:e}){ve.has(e)||ve.add(e)}const Se=(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){$e(n)}return{source:"cross-origin stylesheet",value:ze(e,t)}}(e,t),Oe=(e,t)=>{const{source:n,value:o}=Se(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);me(`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 Ee(){for(const e of[document.documentElement,document.body])for(const t of be)we(e,t)&&Oe(e,t)}const Me=e=>t=>void 0===t?void 0:e(t),ke=Me(e=>"true"===e),je=Me(Number),Te=e=>e=>{e.size},xe=((e="")=>t=>n=>{n.size>0&&ie(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Ae=e=>e=>{e.size},Ie=(e,o=!0)=>r=>{r>0&&oe(`${o?"At":"De"}tached ${e}Observer ${o?"to":"from"} %c${r}%c element${1===r?"":"s"}`,n,t)},Ne=(e,t,n,o)=>{const r=Ae(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()}},Ce=new Set,Pe=new Set,Re=new Set,Be=[],qe={attributes:!0,attributeFilter:[b,g],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Le,De=1,We=!1,Fe=0;const Ve=e=>{e.size},He=e=>{e.size},Ue=e=>{e.size},Ze=e=>e.nodeType!==Node.ELEMENT_NODE||P.has(e.tagName.toLowerCase());function Je(e){const t=e.addedNodes;for(const e of t)Ze(e)||Ce.add(e)}function _e(e){const t=e.removedNodes;for(const e of t)Ze(e)||(Ce.has(e)?(Ce.delete(e),Re.add(e)):Pe.add(e))}const Qe=e=>{oe("Mutations:",e);for(const t of e)Je(t),_e(t);Ve(Ce),He(Pe),Ue(Re),Re.clear()};const Ye=e=>()=>{const t=performance.now(),r=t-Fe,a=16*De+++2;if(r>a&&r<200)return ce("mutationThrottled"),oe("Update delayed due to heavy workload on the callStack"),oe(`EventLoop busy time: %c${_(r)}ms %c> Max wait: %c${a-2}ms`,n,o,n),setTimeout(Le,16*De),void(Fe=t);De=1,Be.forEach(Qe),Be.length=0,We=!1,Pe.size,Ce.size,e({addedNodes:Ce,removedNodes:Pe}),Ce.clear(),Pe.clear()};function Ge(e){Be.push(e),We||(Fe=performance.now(),We=!0,requestAnimationFrame(Le))}function Xe(e){const t=new window.MutationObserver(Ge),n=document.body||document.documentElement;return Le=Ye(e),t.observe(n,qe),oe("Attached MutationObserver to body"),{...t,disconnect:()=>{Ce.clear(),Pe.clear(),Be.length=0,t.disconnect(),oe("Detached MutationObserver")}}}const Ke="Overflow",et=Ie(Ke),tt=Ie(Ke,!1),nt=Te(Ke),ot=xe(Ke),rt=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,at=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||J,a=(t=!1)=>e(t),i=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(y,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)&&!rt(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));ot(t),nt(n),et(o),n.clear(),t.clear()},detachObservers:Ne(Ke,c,l,tt),disconnect:()=>{c.disconnect(),oe("Detached OverflowObserver")}}},it="--ifr-start",st="--ifr-end",ct="--ifr-measure",lt=[];let ut,dt={},mt=0;function ft(){try{performance.clearMarks(it),performance.clearMarks(st),performance.clearMeasures(ct)}catch{}}function ht(e){e.getEntries().forEach(e=>{if(e.name===st)try{const{duration:t}=performance.measure(ct,it,st);dt=e.detail,lt.push(t),lt.length>100&<.shift()}catch{}})}function pt(){oe("Attached PerformanceObserver to page");const e=new PerformanceObserver(ht);return e.observe({entryTypes:["mark"]}),ut=setInterval(()=>{if(lt.length<10)return;if(dt.hasTags&&dt.len<25)return;lt.sort();const e=Math.min(lt.reduce((e,t)=>e+t,0)/lt.length,lt[Math.floor(lt.length/2)]),t=_(e);t>mt&&(mt=t,ce("performanceObserver")),ft(),e<=4||(clearInterval(ut),me(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${_(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${dt.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{ft(),clearInterval(ut),e.disconnect(),oe("Detached PerformanceObserver")}}}const gt="Resize",yt=Ie(gt),bt=Ie(gt,!1),vt=Te(gt),zt=xe(gt),wt=new WeakSet,$t=new Set,St=new Set;let Ot;function Et(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(wt.has(n)?$t.add(n):(Ot.observe(n),wt.add(n),St.add(n),t+=1))}zt($t),vt(St),yt(t),St.clear(),$t.clear()}function Mt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),oe("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),oe("Detached VisibilityObserver")}}}const kt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},jt=kt("function"),Tt=kt("number"),xt=kt("string");"undefined"!=typeof window&&function(){const e={height:()=>(de("Custom height calculation function not defined"),Sn.auto()),width:()=>(de("Custom width calculation function not defined"),On.auto())},B={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},D={},F="auto",_=[],ee="scroll";let ne,he,be,ve,ze,we,$e,Se=!0,Oe="",Me=0,Te="",xe="",Ae=!1,Ie=!0,Ce=!1,Pe=!0,Re=!1,Be=!1,qe=!0,Le=!1,De=1,We=F,Fe="",Ve=!0,He={},Ue=!1,Ze=!1,Je=!1,_e=0,Qe=!1,Ye=0,Ge=0,Ke=new Set,et="",tt="child",nt=!1,ot="",rt=[],ct=window.parent,lt="*",ut=0,dt=!1,mt=1,ft=ee,ht=window,yt=()=>{de("onMessage function not defined")},vt=()=>{},zt=null,$t=null;function St(t){var o;!function(e){et=e[0]??et,Me=je(e[1])??Me,Ce=ke(e[2])??Ce,Je=ke(e[3])??Je,Se=ke(e[6])??Se,Te=e[7]??Te,We=e[8]??We,Oe=e[9]??Oe,xe=e[10]??xe,ut=je(e[11])??ut,He.enable=ke(e[12])??!1,tt=e[13]??tt,ft=e[14]??ft,Qe=ke(e[15])??Qe,Ye=je(e[16])??Ye,Ge=je(e[17])??Ge,Ie=ke(e[18])??Ie,ne=e[19]??ne,we=e[20]??we,_e=je(e[21])??_e,Ze=ke(e[23])??Ze}(t),K=(o={id:et,enabled:Je,expand:Ze}).id||s,te.label(`${K}`),te.expand(o.expand),X=o.enabled,function(){function t(e){$e=jt(e,"onBeforeResize")??$e,yt=jt(e,"onMessage")??yt,vt=jt(e,"onReady")??vt,"number"==typeof e?.offset&&(ye("offset","offsetSize"),Ie&&(Ye=Tt(e,"offset")??Ye),Ce&&(Ge=Tt(e,"offset")??Ge)),"number"==typeof e?.offsetSize&&(Ie&&(Ye=Tt(e,"offsetSize")??Ye),Ce&&(Ge=Tt(e,"offsetSize")??Ge)),he=xt(e,q(L[0]))??he,Fe=xt(e,"ignoreSelector")??Fe,ot=xt(e,"sizeSelector")??ot,lt=xt(e,"targetOrigin")??lt,We=e?.heightCalculationMethod||We,ft=e?.widthCalculationMethod||ft}function o(t,n){return"function"==typeof t&&(me(`<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===_e)return;const r=window.iframeResizer||window.iFrameResizer;"object"==typeof r&&(t(r),We=o(We,v),ft=o(ft,z),oe(`Set targetOrigin for parent: %c${lt}`,n))}(),[Rt,qt,Yt,Ct,Bt,_t,Qt,Zt,Pt,It,Ae?J:Ee,Wt,tn,en,Kt,Ft,()=>Lt("background",Oe),()=>Lt("padding",xe),Ae?J:Vt,Xt,Gt,hn,kt].forEach(e=>{try{e()}catch(e){if(_e<0)throw e;me("<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</>"),ie(e)}}),At(Z(vt)),An(l,"Init message from host page",void 0,void 0,`${i}:${_e}`),document.title&&""!==document.title&&Cn(0,0,h,document.title)}function kt(){R(window,c.toLowerCase(),()=>{_.forEach(e=>e()),Cn(0,0,c)})}function At(e){"complete"===document.readyState?U(e):R(document,w,()=>At(e))}function It(){rt=document.querySelectorAll(`[${g}]`),Le=rt.length>0}let Nt=0;function Ct(){const e=document.querySelectorAll(`*[${b}]`);return Re=e.length>0,Re&&e.length!==Nt&&(function(e){const n=1===e.length?"":"s";de(`%c[${b}]%c found on %c${e.length}%c element${n}`,a,t,a,t)}(e),Nt=e.length),Re}function Pt(){"BackCompat"===document.compatMode&&me("<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 Rt(){we&&""!==we&&"false"!==we?we!==i&&me(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${we} - Child page: ${i}.\n`):me("<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 Bt(){try{nt=1===_e||"iframeParentListener"in window.parent}catch(e){}}function qt(){Ce===Ie&&(Ae=!0)}function Lt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),oe(`Set body ${e}: %c${t}`,n))}function Dt(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Wt(){Dt(0,g,ot),Dt(0,b,Fe)}function Ft(){var e,t;void 0===Te&&(Te=`${Me}px`),Lt("margin",(e="margin",(t=Te).includes("-")&&(de(`Negative CSS value ignored for ${e}`),t=""),t))}function Vt(){const e=e=>e.style.setProperty(v,"auto","important");e(document.documentElement),e(document.body)}function Ht(e){({add(t){function n(){An(e.eventName,e.eventType)}D[t]=n,R(window,t,n,{passive:!0})},remove(e){const t=D[e];var n,o;delete D[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function Ut(e){Ht({method:e,eventType:"After Print",eventName:"afterprint"}),Ht({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ht({method:e,eventType:"Ready State Change",eventName:w})}function Zt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(g,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&me("<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(e,t,n){const{label:o}=n;return t!==e&&(e in n||(de(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in B)&&me(`<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 ${we?"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 _t(){We=Jt(We,F,Sn)}function Qt(){ft=Jt(ft,ee,On)}function Yt(){const e=_e,n=H({key:ne}),o=H({key:he});if(_e=Math.max(n,o),_e<0){if(_e=Math.min(n,o),ue(),me(`${V(_e+2)}${V(2)}`),Y(we))throw V(_e+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!Y(we)||e>-1&&_e>e)&&(sessionStorage.getItem("ifr")!==i&&function(e,n){console.info(`${K} %ciframe-resizer ${e}`,X||n<1?"font-weight: bold;":t)}(`v${i} (${(e=>q(W[e]))(_e)})`,_e),_e<2&&fe(V(3)),sessionStorage.setItem("ifr",i))}function Gt(){Ut("add"),_.push(()=>Ut("remove"))}function Xt(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Kt(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,p)+parseInt(n.x,p),y:parseInt(t.top,p)+parseInt(n.y,p)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Cn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Cn(n.y,n.x,f)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}He.enable&&(1===_e?me("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")&&R(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),R(window,"hashchange",n),setTimeout(n,128))),He={findTarget:t}}function en(){function e(e){Cn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){R(window.document,t,e)}!0===Qe&&(t("mouseenter"),t("mouseleave"))}function tn(){1!==_e&&(ht.parentIframe=Object.freeze({autoResize:e=>(G(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Ce&&!1===Ie?(ce(O),me("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===Se?(Se=!0,queueMicrotask(()=>An(O,"Auto Resize enabled"))):!1===e&&!0===Se&&(Se=!1),Cn(0,0,"autoResize",JSON.stringify(Se)),Se)),close(){Cn(0,0,"close")},getId:()=>et,getOrigin:()=>(ce("getOrigin"),pe("getOrigin()","getParentOrigin()"),be),getParentOrigin:()=>be,getPageInfo(e){if("function"==typeof e)return zt=e,Cn(0,0,d),void ge("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");zt=null,Cn(0,0,"pageInfoStop")},getParentProps:e=>(G(e,"function","parentIframe.getParentProps(callback) callback"),$t=e,Cn(0,0,m),()=>{$t=null,Cn(0,0,"parentInfoStop")}),getParentProperties(e){pe("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){G(e,"string","parentIframe.moveToAnchor(anchor) anchor"),He.findTarget(e)},reset(){!function(){const e=We;We=F,dt||(dt=!0,requestAnimationFrame(()=>{dt=!1})),In("reset"),We=e}()},setOffsetSize(e){G(e,"number","parentIframe.setOffsetSize(offset) offset"),Ye=e,Ge=e,An(T,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){G(e,"number","parentIframe.scrollBy(x, y) x"),G(t,"number","parentIframe.scrollBy(x, y) y"),Cn(t,e,"scrollBy")},scrollTo(e,t){G(e,"number","parentIframe.scrollTo(x, y) x"),G(t,"number","parentIframe.scrollTo(x, y) y"),Cn(t,e,"scrollTo")},scrollToOffset(e,t){G(e,"number","parentIframe.scrollToOffset(x, y) x"),G(t,"number","parentIframe.scrollToOffset(x, y) y"),Cn(t,e,f)},sendMessage(e,t){t&&G(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Cn(0,0,u,JSON.stringify(e),t)},setHeightCalculationMethod(e){We=e,_t()},setWidthCalculationMethod(e){ft=e,Qt()},setTargetOrigin(e){G(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),lt=e},resize(e,t){void 0!==e&&G(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&G(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),An(M,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){pe("size()","resize()"),this.resize(e,t)}}),ht.parentIFrame=ht.parentIframe)}let nn=new Set;function on(){const e=document.querySelectorAll(`[${y}]`);Ke=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${b}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{ce("overflowIgnored"),oe("Ignoring elements with [data-iframe-ignore] > *:\n",n),ae()}),t}(e),Be=Ke.size>0,"function"==typeof Set.prototype.symmetricDifference&&(qe=Ke.symmetricDifference(nn).size>0),nn=Ke}function rn(){switch(on(),!0){case!qe:return;case Ke.size>1:oe("Overflowed Elements:",Ke);break;case Be:break;default:oe("No overflow detected")}An(A,"Overflow updated")}function an(e){const t={root:document.documentElement,side:Ie?$:S};return ve=at(rn,t),ve.attachObservers(e),ve}function sn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;An(x,`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 cn(e){return Ot=new ResizeObserver(sn),Ot.observe(document.body),wt.add(document.body),oe("Attached ResizeObserver to body"),ze={attachObserverToNonStaticElements:Et,detachObservers:Ne(gt,Ot,wt,bt),disconnect:()=>{Ot.disconnect(),oe("Detached ResizeObserver")}},ze.attachObserverToNonStaticElements(e),ze}function ln(e){Ue=!e,An(N,"Visibility changed")}const un=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of bn(n))t.add(e)}return oe("Inspecting:\n",t),t},dn=e=>{if(0===e.size)return;ce("addObservers");const t=un(e);ve.attachObservers(t),ze.attachObserverToNonStaticElements(t),ae()},mn=e=>{if(0===e.size)return;ce("removeObservers");const t=un(e);ve.detachObservers(t),ze.detachObservers(t),ae()};function fn(e){!function({addedNodes:e,removedNodes:t}){ce("contentMutated"),Wt(),It(),on(),ae(),mn(t),dn(e)}(e),An(I,"Mutation Observed")}function hn(){const e=bn(document.documentElement);var t;t=[Xe(fn),an(e),pt(),cn(e),Mt(ln)],_.push(...t.map(e=>e.disconnect))}function pn(e){performance.mark(it);const t=Q(e);let r=1,a=document.documentElement,i=Le?0:document.documentElement.getBoundingClientRect().bottom;const s=Le?rt:Be?Array.from(Ke):bn(document.documentElement);for(const t of s)r=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),r>i&&(i=r,a=t);return oe(`${t} position calculated from:`,a),oe(`Checked %c${s.length}%c elements`,n,o),performance.mark(st,{detail:{hasTags:Le,len:s.length,logging:Je,Side:t}}),i}const gn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],yn=`* ${Array.from(P).map(e=>`:not(${e})`).join("")}`,bn=e=>e.querySelectorAll(yn),vn={height:0,width:0},zn={height:0,width:0},wn=[n,o,n];function $n(e){function t(){return zn[r]=a,vn[r]=c,Math.max(a,1)}const o=e===Sn,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 Le:oe("Found element with data-iframe-size attribute"),u=e.taggedElement();break;case!Be&&Pe&&0===zn[r]&&0===vn[r]:oe(`Initial page size values: ${l}`,...wn),u=t();break;case dt&&a===zn[r]&&c===vn[r]:oe(`Size unchanged: ${l}`,...wn),u=Math.max(a,c);break;case 0===a&&0!==c:oe(`Page is hidden: ${l}`,...wn),u=c;break;case!Be&&a!==zn[r]&&c<=vn[r]:oe(`New <html> size: ${l} `,...wn),oe(`Previous <html> size: %c${zn[r]}px`,n),u=t();break;case!o:u=e.taggedElement();break;case!Be&&a<zn[r]:oe(`<html> size decreased: ${l}`,...wn),u=t();break;case c===s||c===i:oe(`<html> size equals page size: ${l}`,...wn),u=t();break;case a>c:oe(`Page size < <html> size: ${l}`,...wn),u=t();break;case Be:oe("Found elements possibly overflowing <html> "),u=e.taggedElement();break;default:oe(`Using <html> size: ${l}`,...wn),u=t()}return oe(`Content ${r}: %c${u}px`,n),u+=function(e){const t=e.getOffset();return 0!==t&&oe(`Page offsetSize: %c${t}px`,n),t}(e),u}const Sn={label:v,enabled:()=>Ie,getOffset:()=>Ye,auto:()=>$n(Sn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,p)+parseInt(t.marginBottom,p)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Sn.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(...gn(Sn)),min:()=>Math.min(...gn(Sn)),grow:()=>Sn.max(),lowestElement:()=>pn($),taggedElement:()=>pn($)},On={label:z,enabled:()=>Ce,getOffset:()=>Ge,auto:()=>$n(On),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(...gn(On)),min:()=>Math.min(...gn(On)),rightMostElement:()=>pn(S),scroll:()=>Math.max(On.bodyScroll(),On.documentElementScroll()),taggedElement:()=>pn(S)},En=(e,t)=>!(Math.abs(e-t)<=ut);function Mn(e,t){const n=e[t](),o=e.enabled()&&void 0!==$e?function(e){const t=$e(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 re(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let kn=!1;const jn=Z(()=>fe(V(4)));let Tn,xn=!1;const An=se((e,t,n,o,r)=>{switch(ce(e),!0){case!0===Ue:if(!0===xn)break;xn=!0,kn=!1,cancelAnimationFrame(Tn);break;case!0===kn&&e!==A:ue();break;case!Se&&!(e in j):oe("Resizing disabled");break;default:xn=!1,kn=!0,performance.now(),Tn=requestAnimationFrame(()=>{kn=!1,ce("requestAnimationFrame")}),function(e,t,n,o,r){const a=n??Mn(Sn,We),i=o??Mn(On,ft);switch(Ie&&En(De,a)||Ce&&En(mt,i)?E:e){case l:case O:case E:De=a,mt=i;case T:Nn(De,mt,e,r);break;case A:case I:case x:case N:ue();break;default:ue(),oe("No change in content size detected")}}(e,0,n,o,r)}ae()});function In(e){De=Sn[We](),mt=On[ft](),Cn(De,mt,e)}function Nn(e,t,o,a,i){_e<-1||(void 0!==i||(i=lt),function(){const s=`${et}:${e}:${t}:${o}${void 0===a?"":`:${a}`}`;if(nt)try{window.parent.iframeParentListener(C+s)}catch(e){if(1!==_e)throw e;return void jn()}else ct.postMessage(C+s,i);oe(`Sending message to parent page via ${nt?"sameOrigin":"postMessage"}: %c%c${s}`,r,n)}())}const Cn=se((e,t,n,o,r)=>{ce(n),Nn(e,t,n,o,r),ae()}),Pn=se(function(e){ce("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Cn(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");ct=e.source,be=e.origin,St(t),Pe=!1,setTimeout(()=>{Ve=!1},128)},reset(){Ve||In("resetPage")},resize(){An(k,"Parent window requested size check")},moveToAnchor(){He.findTarget(i())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=i();zt?U(zt,n(e)):o(d)},parentInfo(){const e=(r=i(),t(n(r)));var r;$t?U($t,e):o(m)},message(){const e=i();U(yt,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();ce(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||de(`Unexpected message (${e.data})`)}C===`${e.data}`.slice(0,13)&&function(){if(!1!==Pe)return s()?(le(a()),ce(l),void r.init()):void 0;c()}()});let Rn=!1;const Bn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function qn(){if("loading"===document.readyState||!Pe||Rn)return;const{parent:e,top:t}=window;ce("ready"),Bn(e),e!==t&&Bn(t),Rn=!0}"iframeChildListener"in window?de("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Pn({data:e,sameOrigin:!0})),R(window,u,Pn),R(document,w,qn),setTimeout(qn))}();
|
package/index.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/child 5.5.
|
|
4
|
+
* @module iframe-resizer/child 5.5.5 (umd) - 2025-09-01
|
|
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,4 +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: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.4",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((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()}()});let kn=!1;const jn=e=>e.postMessage("[iFrameResizerChild]Ready","*");function Tn(){if("loading"===document.readyState||!$e||kn)return;const{parent:e,top:t}=window;jn(e),e!==t&&jn(t),kn=!0}"iframeChildListener"in window?me("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Mn({data:e,sameOrigin:!0})),B(window,"message",Mn),B(document,"readystatechange",Tn),setTimeout(Tn))}()});
|
|
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:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0},c=Object.assign(console);const{fromEntries:l,keys:u}=Object,d=e=>[e,c[e]],f=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(u(e).map(t));const p=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,h=p?"color: #A9C7FB;":"color: #135CD2;",g=p?"color: #E3E3E3;":"color: #1F1F1F;",y="5.5.5",b="iframeResizer",v="beforeUnload",w="init",z="message",$="pageInfo",S="parentInfo",O="scrollToOffset",E="title",M=10,k="data-iframe-size",j="data-iframe-overflowed",x="data-iframe-ignore",T="height",A="width",C="readystatechange",I="bottom",N="right",P="autoResizeEnabled",R=Symbol("sizeChanged"),B="manualResize",q="parentResize",L={[B]:1,[q]:1},D="setOffsetSize",F="resizeObserver",W="overflowObserver",V="mutationObserver",H="visibilityObserver",U="[iFrameSizer]",Z=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),J=(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)},Q=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),G=["spjluzl","rlf","clyzpvu"],Y=["<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."],X=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],K=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),ee=e=>Q(Y[e]),te=e=>{const t=e[Q(G[0])]||e[Q(G[1])]||e[Q(G[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=_(Q(e));return n in K&&(t=K[n]),t}(n[0]);return 0===o||(e=>e[2]===_(e[0]+e[1]))(n)||(o=-2),o},ne=(e,...t)=>setTimeout(()=>e(...t),0),oe=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},re=e=>e,ie=e=>Math.round(1e3*e)/1e3,ae=e=>e.charAt(0).toUpperCase()+e.slice(1),se=e=>""!=`${e}`&&void 0!==e;const ce=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${ae(t)}`)};let le=!0,ue=b;const de=(fe=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}},fe?.__esModule?fe.default:fe);var fe;const me=de({label:`${b}(child)`,expand:!1});var pe;const he=(pe="log",(...e)=>!le||me[pe](...e));const{assert:ge,endAutoGroup:ye,error:be,errorBoundary:ve,event:we,label:ze,purge:$e,warn:Se}=me,Oe=e=>{return me.warn((t=re,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},Ee=Oe,Me=(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)=>Oe(t)),ke=Me("Method"),je=Me("Method","replaced with"),xe=Me("Option"),Te=["min-height","min-width","max-height","max-width"],Ae=new Set,Ce=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Ie=(e,t)=>{return(n=Ce(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function Ne({href:e}){Ae.has(e)||Ae.add(e)}const Pe=(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){Ne(n)}return{source:"cross-origin stylesheet",value:Ce(e,t)}}(e,t),Re=(e,t)=>{const{source:n,value:o}=Pe(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);Oe(`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 Be(){for(const e of[document.documentElement,document.body])for(const t of Te)Ie(e,t)&&Re(e,t)}const qe=e=>t=>void 0===t?void 0:e(t),Le=qe(e=>"true"===e),De=qe(Number),Fe=e=>e=>{e.size},We=((e="")=>t=>n=>{n.size>0&&be(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Ve=e=>e=>{e.size},He=(t,n=!0)=>o=>{o>0&&he(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},Ue=(e,t,n,o)=>{const r=Ve(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()}},Ze=new Set,Je=new Set,_e=new Set,Qe=[],Ge={attributes:!0,attributeFilter:[x,k],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Ye,Xe=1,Ke=!1,et=0;const tt=e=>{e.size},nt=e=>{e.size},ot=e=>{e.size},rt=e=>e.nodeType!==Node.ELEMENT_NODE||Z.has(e.tagName.toLowerCase());function it(e){const t=e.addedNodes;for(const e of t)rt(e)||Ze.add(e)}function at(e){const t=e.removedNodes;for(const e of t)rt(e)||(Ze.has(e)?(Ze.delete(e),_e.add(e)):Je.add(e))}const st=e=>{he("Mutations:",e);for(const t of e)it(t),at(t);tt(Ze),nt(Je),ot(_e),_e.clear()};const ct=e=>()=>{const t=performance.now(),n=t-et,o=16*Xe+++2;if(n>o&&n<200)return we("mutationThrottled"),he("Update delayed due to heavy workload on the callStack"),he(`EventLoop busy time: %c${ie(n)}ms %c> Max wait: %c${o-2}ms`,h,g,h),setTimeout(Ye,16*Xe),void(et=t);Xe=1,Qe.forEach(st),Qe.length=0,Ke=!1,Je.size,Ze.size,e({addedNodes:Ze,removedNodes:Je}),Ze.clear(),Je.clear()};function lt(e){Qe.push(e),Ke||(et=performance.now(),Ke=!0,requestAnimationFrame(Ye))}function ut(e){const t=new window.MutationObserver(lt),n=document.body||document.documentElement;return Ye=ct(e),t.observe(n,Ge),he("Attached MutationObserver to body"),{...t,disconnect:()=>{Ze.clear(),Je.clear(),Qe.length=0,t.disconnect(),he("Detached MutationObserver")}}}const dt="Overflow",ft=He(dt),mt=He(dt,!1),pt=Fe(dt),ht=We(dt),gt=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,yt=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||re,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(j,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)&&!gt(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));ht(t),pt(n),ft(o),n.clear(),t.clear()},detachObservers:Ue(dt,c,l,mt),disconnect:()=>{c.disconnect(),he("Detached OverflowObserver")}}},bt="--ifr-start",vt="--ifr-end",wt="--ifr-measure",zt=[];let $t,St={},Ot=0;function Et(){try{performance.clearMarks(bt),performance.clearMarks(vt),performance.clearMeasures(wt)}catch{}}function Mt(e){e.getEntries().forEach(e=>{if(e.name===vt)try{const{duration:t}=performance.measure(wt,bt,vt);St=e.detail,zt.push(t),zt.length>100&&zt.shift()}catch{}})}function kt(){he("Attached PerformanceObserver to page");const e=new PerformanceObserver(Mt);return e.observe({entryTypes:["mark"]}),$t=setInterval(()=>{if(zt.length<10)return;if(St.hasTags&&St.len<25)return;zt.sort();const e=Math.min(zt.reduce((e,t)=>e+t,0)/zt.length,zt[Math.floor(zt.length/2)]),t=ie(e);t>Ot&&(Ot=t,we("performanceObserver")),Et(),e<=4||(clearInterval($t),Oe(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${ie(e)}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),{disconnect:()=>{Et(),clearInterval($t),e.disconnect(),he("Detached PerformanceObserver")}}}const jt="Resize",xt=He(jt),Tt=He(jt,!1),At=Fe(jt),Ct=We(jt),It=new WeakSet,Nt=new Set,Pt=new Set;let Rt;function Bt(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)?Nt.add(n):(Rt.observe(n),It.add(n),Pt.add(n),t+=1))}Ct(Nt),At(Pt),xt(t),Pt.clear(),Nt.clear()}function qt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),he("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),he("Detached VisibilityObserver")}}}const Lt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Dt=Lt("function"),Ft=Lt("number"),Wt=Lt("string");"undefined"!=typeof window&&function(){const o={height:()=>(Se("Custom height calculation function not defined"),Sn.auto()),width:()=>(Se("Custom width calculation function not defined"),On.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},i={},a="auto",s=[],c="scroll";let l,u,d,f,m,p,_,Y=!0,K="",ie=0,de="",fe="",pe=!1,Me=!0,Te=!1,Ae=!0,Ce=!1,Ie=!1,Ne=!0,Pe=!1,Re=1,qe=a,Fe="",We=!0,Ve={},He=!1,Ze=!1,Je=!1,_e=0,Qe=!1,Ge=0,Ye=0,Xe=new Set,Ke="",et="child",tt=!1,nt="",ot=[],rt=window.parent,it="*",at=0,st=!1,ct=1,lt=c,dt=window,ft=()=>{Se("onMessage function not defined")},mt=()=>{},pt=null,ht=null;function gt(e){var t;!function(e){Ke=e[0]??Ke,ie=De(e[1])??ie,Te=Le(e[2])??Te,Je=Le(e[3])??Je,Y=Le(e[6])??Y,de=e[7]??de,qe=e[8]??qe,K=e[9]??K,fe=e[10]??fe,at=De(e[11])??at,Ve.enable=Le(e[12])??!1,et=e[13]??et,lt=e[14]??lt,Qe=Le(e[15])??Qe,Ge=De(e[16])??Ge,Ye=De(e[17])??Ye,Me=Le(e[18])??Me,l=e[19]??l,p=e[20]??p,_e=De(e[21])??_e,Ze=Le(e[23])??Ze}(e),ue=(t={id:Ke,enabled:Je,expand:Ze}).id||b,me.label(`${ue}`),me.expand(t.expand),le=t.enabled,function(){function e(e){_=Dt(e,"onBeforeResize")??_,ft=Dt(e,"onMessage")??ft,mt=Dt(e,"onReady")??mt,"number"==typeof e?.offset&&(xe("offset","offsetSize"),Me&&(Ge=Ft(e,"offset")??Ge),Te&&(Ye=Ft(e,"offset")??Ye)),"number"==typeof e?.offsetSize&&(Me&&(Ge=Ft(e,"offsetSize")??Ge),Te&&(Ye=Ft(e,"offsetSize")??Ye)),u=Wt(e,Q(G[0]))??u,Fe=Wt(e,"ignoreSelector")??Fe,nt=Wt(e,"sizeSelector")??nt,it=Wt(e,"targetOrigin")??it,qe=e?.heightCalculationMethod||qe,lt=e?.widthCalculationMethod||lt}function t(e,t){return"function"==typeof e&&(Oe(`<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===_e)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),qe=t(qe,T),lt=t(lt,A),he(`Set targetOrigin for parent: %c${it}`,h))}(),[Mt,At,Gt,Ot,xt,_t,Qt,Zt,Et,$t,pe?re:Be,Pt,tn,en,Kt,Lt,()=>Ct("background",K),()=>Ct("padding",fe),pe?re:Vt,Xt,Yt,pn,wt].forEach(e=>{try{e()}catch(e){if(_e<0)throw e;Oe("<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</>"),be(e)}}),zt(oe(mt)),An(w,"Init message from host page",void 0,void 0,`${y}:${_e}`),document.title&&""!==document.title&&Nn(0,0,E,document.title)}function wt(){J(window,v.toLowerCase(),()=>{s.forEach(e=>e()),Nn(0,0,v)})}function zt(e){"complete"===document.readyState?ne(e):J(document,C,()=>zt(e))}function $t(){ot=document.querySelectorAll(`[${k}]`),Pe=ot.length>0}let St=0;function Ot(){const n=document.querySelectorAll(`*[${x}]`);return Ce=n.length>0,Ce&&n.length!==St&&(function(n){const o=1===n.length?"":"s";Se(`%c[${x}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),St=n.length),Ce}function Et(){"BackCompat"===document.compatMode&&Oe("<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 Mt(){p&&""!==p&&"false"!==p?p!==y&&Oe(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${p} - Child page: ${y}.\n`):Oe("<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 xt(){try{tt=1===_e||"iframeParentListener"in window.parent}catch(e){}}function At(){Te===Me&&(pe=!0)}function Ct(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),he(`Set body ${e}: %c${t}`,h))}function Nt(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Pt(){Nt(0,k,nt),Nt(0,x,Fe)}function Lt(){var e,t;void 0===de&&(de=`${ie}px`),Ct("margin",(e="margin",(t=de).includes("-")&&(Se(`Negative CSS value ignored for ${e}`),t=""),t))}function Vt(){const e=e=>e.style.setProperty(T,"auto","important");e(document.documentElement),e(document.body)}function Ht(e){({add(t){function n(){An(e.eventName,e.eventType)}i[t]=n,J(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 Ut(e){Ht({method:e,eventType:"After Print",eventName:"afterprint"}),Ht({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ht({method:e,eventType:"Ready State Change",eventName:C})}function Zt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(k,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&Oe("<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(e,t,n){const{label:o}=n;return t!==e&&(e in n||(Se(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&Oe(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you ${p?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${o}CalculationMethod: 'auto',\n}\n`}\n`),e}function _t(){qe=Jt(qe,a,Sn)}function Qt(){lt=Jt(lt,c,On)}function Gt(){const t=_e,n=te({key:l}),o=te({key:u});if(_e=Math.max(n,o),_e<0){if(_e=Math.min(n,o),$e(),Oe(`${ee(_e+2)}${ee(2)}`),se(p))throw ee(_e+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!se(p)||t>-1&&_e>t)&&(sessionStorage.getItem("ifr")!==y&&function(t,n){console.info(`${ue} %ciframe-resizer ${t}`,le||n<1?"font-weight: bold;":e)}(`v${y} (${(e=>Q(X[e]))(_e)})`,_e),_e<2&&Ee(ee(3)),sessionStorage.setItem("ifr",y))}function Yt(){Ut("add"),s.push(()=>Ut("remove"))}function Xt(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Kt(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,M)+parseInt(n.x,M),y:parseInt(t.top,M)+parseInt(n.y,M)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Nn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Nn(n.y,n.x,O)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}Ve.enable&&(1===_e?Oe("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")&&J(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),J(window,"hashchange",n),setTimeout(n,128))),Ve={findTarget:t}}function en(){function e(e){Nn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){J(window.document,t,e)}!0===Qe&&(t("mouseenter"),t("mouseleave"))}function tn(){1!==_e&&(dt.parentIframe=Object.freeze({autoResize:e=>(ce(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Te&&!1===Me?(we(P),Oe("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===Y?(Y=!0,queueMicrotask(()=>An(P,"Auto Resize enabled"))):!1===e&&!0===Y&&(Y=!1),Nn(0,0,"autoResize",JSON.stringify(Y)),Y)),close(){Nn(0,0,"close")},getId:()=>Ke,getOrigin:()=>(we("getOrigin"),ke("getOrigin()","getParentOrigin()"),d),getParentOrigin:()=>d,getPageInfo(e){if("function"==typeof e)return pt=e,Nn(0,0,$),void je("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");pt=null,Nn(0,0,"pageInfoStop")},getParentProps:e=>(ce(e,"function","parentIframe.getParentProps(callback) callback"),ht=e,Nn(0,0,S),()=>{ht=null,Nn(0,0,"parentInfoStop")}),getParentProperties(e){ke("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){ce(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Ve.findTarget(e)},reset(){!function(){const e=qe;qe=a,st||(st=!0,requestAnimationFrame(()=>{st=!1})),Cn("reset"),qe=e}()},setOffsetSize(e){ce(e,"number","parentIframe.setOffsetSize(offset) offset"),Ge=e,Ye=e,An(D,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){ce(e,"number","parentIframe.scrollBy(x, y) x"),ce(t,"number","parentIframe.scrollBy(x, y) y"),Nn(t,e,"scrollBy")},scrollTo(e,t){ce(e,"number","parentIframe.scrollTo(x, y) x"),ce(t,"number","parentIframe.scrollTo(x, y) y"),Nn(t,e,"scrollTo")},scrollToOffset(e,t){ce(e,"number","parentIframe.scrollToOffset(x, y) x"),ce(t,"number","parentIframe.scrollToOffset(x, y) y"),Nn(t,e,O)},sendMessage(e,t){t&&ce(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Nn(0,0,z,JSON.stringify(e),t)},setHeightCalculationMethod(e){qe=e,_t()},setWidthCalculationMethod(e){lt=e,Qt()},setTargetOrigin(e){ce(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),it=e},resize(e,t){void 0!==e&&ce(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&ce(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),An(B,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ke("size()","resize()"),this.resize(e,t)}}),dt.parentIFrame=dt.parentIframe)}let nn=new Set;function on(){const e=document.querySelectorAll(`[${j}]`);Xe=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${x}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{we("overflowIgnored"),he("Ignoring elements with [data-iframe-ignore] > *:\n",n),ye()}),t}(e),Ie=Xe.size>0,"function"==typeof Set.prototype.symmetricDifference&&(Ne=Xe.symmetricDifference(nn).size>0),nn=Xe}function rn(){switch(on(),!0){case!Ne:return;case Xe.size>1:he("Overflowed Elements:",Xe);break;case Ie:break;default:he("No overflow detected")}An(W,"Overflow updated")}function an(e){const t={root:document.documentElement,side:Me?I:N};return f=yt(rn,t),f.attachObservers(e),f}function sn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;An(F,`Element resized <${function(e){switch(!0){case!se(e):return"";case se(e.id):return`${e.nodeName}#${e.id}`;case se(e.name):return`${e.nodeName} (${e.name}`;case se(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function cn(e){return Rt=new ResizeObserver(sn),Rt.observe(document.body),It.add(document.body),he("Attached ResizeObserver to body"),m={attachObserverToNonStaticElements:Bt,detachObservers:Ue(jt,Rt,It,Tt),disconnect:()=>{Rt.disconnect(),he("Detached ResizeObserver")}},m.attachObserverToNonStaticElements(e),m}function ln(e){He=!e,An(H,"Visibility changed")}const un=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of bn(n))t.add(e)}return he("Inspecting:\n",t),t},dn=e=>{if(0===e.size)return;we("addObservers");const t=un(e);f.attachObservers(t),m.attachObserverToNonStaticElements(t),ye()},fn=e=>{if(0===e.size)return;we("removeObservers");const t=un(e);f.detachObservers(t),m.detachObservers(t),ye()};function mn(e){!function({addedNodes:e,removedNodes:t}){we("contentMutated"),Pt(),$t(),on(),ye(),fn(t),dn(e)}(e),An(V,"Mutation Observed")}function pn(){const e=bn(document.documentElement);var t;t=[ut(mn),an(e),kt(),cn(e),qt(ln)],s.push(...t.map(e=>e.disconnect))}function hn(e){performance.mark(bt);const t=ae(e);let n=1,o=document.documentElement,r=Pe?0:document.documentElement.getBoundingClientRect().bottom;const i=Pe?ot:Ie?Array.from(Xe):bn(document.documentElement);for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return he(`${t} position calculated from:`,o),he(`Checked %c${i.length}%c elements`,h,g),performance.mark(vt,{detail:{hasTags:Pe,len:i.length,logging:Je,Side:t}}),r}const gn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],yn=`* ${Array.from(Z).map(e=>`:not(${e})`).join("")}`,bn=e=>e.querySelectorAll(yn),vn={height:0,width:0},wn={height:0,width:0},zn=[h,g,h];function $n(e){function t(){return wn[o]=r,vn[o]=s,Math.max(r,1)}const n=e===Sn,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 Pe:he("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!Ie&&Ae&&0===wn[o]&&0===vn[o]:he(`Initial page size values: ${c}`,...zn),l=t();break;case st&&r===wn[o]&&s===vn[o]:he(`Size unchanged: ${c}`,...zn),l=Math.max(r,s);break;case 0===r&&0!==s:he(`Page is hidden: ${c}`,...zn),l=s;break;case!Ie&&r!==wn[o]&&s<=vn[o]:he(`New <html> size: ${c} `,...zn),he(`Previous <html> size: %c${wn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!Ie&&r<wn[o]:he(`<html> size decreased: ${c}`,...zn),l=t();break;case s===a||s===i:he(`<html> size equals page size: ${c}`,...zn),l=t();break;case r>s:he(`Page size < <html> size: ${c}`,...zn),l=t();break;case Ie:he("Found elements possibly overflowing <html> "),l=e.taggedElement();break;default:he(`Using <html> size: ${c}`,...zn),l=t()}return he(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&he(`Page offsetSize: %c${t}px`,h),t}(e),l}const Sn={label:T,enabled:()=>Me,getOffset:()=>Ge,auto:()=>$n(Sn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,M)+parseInt(t.marginBottom,M)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Sn.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(...gn(Sn)),min:()=>Math.min(...gn(Sn)),grow:()=>Sn.max(),lowestElement:()=>hn(I),taggedElement:()=>hn(I)},On={label:A,enabled:()=>Te,getOffset:()=>Ye,auto:()=>$n(On),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(...gn(On)),min:()=>Math.min(...gn(On)),rightMostElement:()=>hn(N),scroll:()=>Math.max(On.bodyScroll(),On.documentElementScroll()),taggedElement:()=>hn(N)},En=(e,t)=>!(Math.abs(e-t)<=at);function Mn(e,t){const n=e[t](),o=e.enabled()&&void 0!==_?function(e){const t=_(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 ge(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let kn=!1;const jn=oe(()=>Ee(ee(4)));let xn,Tn=!1;const An=ve((e,t,n,o,r)=>{switch(we(e),!0){case!0===He:if(!0===Tn)break;Tn=!0,kn=!1,cancelAnimationFrame(xn);break;case!0===kn&&e!==W:$e();break;case!Y&&!(e in L):he("Resizing disabled");break;default:Tn=!1,kn=!0,performance.now(),xn=requestAnimationFrame(()=>{kn=!1,we("requestAnimationFrame")}),function(e,t,n,o,r){const i=n??Mn(Sn,qe),a=o??Mn(On,lt);switch(Me&&En(Re,i)||Te&&En(ct,a)?R:e){case w:case P:case R:Re=i,ct=a;case D:In(Re,ct,e,r);break;case W:case V:case F:case H:$e();break;default:$e(),he("No change in content size detected")}}(e,0,n,o,r)}ye()});function Cn(e){Re=Sn[qe](),ct=On[lt](),Nn(Re,ct,e)}function In(e,t,o,r,i){_e<-1||(void 0!==i||(i=it),function(){const a=`${Ke}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(tt)try{window.parent.iframeParentListener(U+a)}catch(e){if(1!==_e)throw e;return void jn()}else rt.postMessage(U+a,i);he(`Sending message to parent page via ${tt?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}())}const Nn=ve((e,t,n,o,r)=>{we(n),In(e,t,n,o,r),ye()}),Pn=ve(function(e){we("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Nn(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");rt=e.source,d=e.origin,gt(t),Ae=!1,setTimeout(()=>{We=!1},128)},reset(){We||Cn("resetPage")},resize(){An(q,"Parent window requested size check")},moveToAnchor(){Ve.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();pt?ne(pt,n(e)):o($)},parentInfo(){const e=(r=a(),t(n(r)));var r;ht?ne(ht,e):o(S)},message(){const e=a();ne(ft,n(e))}},i=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),s=()=>e.data.split(":")[2]in{true:1,false:1};function c(){const t=i();we(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||Se(`Unexpected message (${e.data})`)}U===`${e.data}`.slice(0,13)&&function(){if(!1!==Ae)return s()?(ze(i()),we(w),void r.init()):void 0;c()}()});let Rn=!1;const Bn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function qn(){if("loading"===document.readyState||!Ae||Rn)return;const{parent:e,top:t}=window;we("ready"),Bn(e),e!==t&&Bn(t),Rn=!0}"iframeChildListener"in window?Se("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Pn({data:e,sameOrigin:!0})),J(window,z,Pn),J(document,C,qn),setTimeout(qn))}()});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iframe-resizer/child",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.5",
|
|
4
4
|
"license": "GPL-3.0",
|
|
5
5
|
"homepage": "https://iframe-resizer.com",
|
|
6
6
|
"author": {
|
|
@@ -35,6 +35,6 @@
|
|
|
35
35
|
"child"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"auto-console-group": "1.2.
|
|
38
|
+
"auto-console-group": "1.2.11"
|
|
39
39
|
}
|
|
40
40
|
}
|