@iframe-resizer/child
Advanced tools
Comparing version 5.1.4 to 5.2.0-beta.1
@@ -12,117 +12,115 @@ /** | ||
declare module '@iframe-resizer/child' { | ||
namespace iframeResizer { | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
interface IFramePageOptions { | ||
/** | ||
* This option allows you to restrict the domain of the parent page, | ||
* to prevent other sites mimicking your parent page. | ||
*/ | ||
targetOrigin?: string | undefined | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
export interface IFramePageOptions { | ||
/** | ||
* This option allows you to restrict the domain of the parent page, | ||
* to prevent other sites mimicking your parent page. | ||
*/ | ||
targetOrigin?: string | undefined | ||
/** | ||
* Receive message posted from the parent page with the iframe.iFrameResizer.sendMessage() method. | ||
*/ | ||
onMessage?(message: any): void | ||
/** | ||
* Receive message posted from the parent page with the iframe.iFrameResizer.sendMessage() method. | ||
*/ | ||
onMessage?(message: any): void | ||
/** | ||
* This function is called once iFrame-Resizer has been initialized after receiving a call from the parent page. | ||
*/ | ||
onReady?(): void | ||
} | ||
/** | ||
* This function is called once iFrame-Resizer has been initialized after receiving a call from the parent page. | ||
*/ | ||
onReady?(): void | ||
} | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
interface IFramePage { | ||
/** | ||
* Turn autoResizing of the iFrame on and off. Returns bool of current state. | ||
*/ | ||
autoResize(resize?: boolean): boolean | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
export interface IFramePage { | ||
/** | ||
* Turn autoResizing of the iFrame on and off. Returns bool of current state. | ||
*/ | ||
autoResize(resize?: boolean): boolean | ||
/** | ||
* Remove the iFrame from the parent page. | ||
*/ | ||
close(): void | ||
/** | ||
* Remove the iFrame from the parent page. | ||
*/ | ||
close(): void | ||
/** | ||
* Returns the ID of the iFrame that the page is contained in. | ||
*/ | ||
getId(): string | ||
/** | ||
* Returns the ID of the iFrame that the page is contained in. | ||
*/ | ||
getId(): string | ||
/** | ||
* Ask the containing page for its positioning coordinates. | ||
* | ||
* Your callback function will be recalled when the parent page is scrolled or resized. | ||
* | ||
* Pass false to disable the callback. | ||
*/ | ||
getParentProps(callback: (data: ParentProps) => void): void | ||
/** | ||
* Ask the containing page for its positioning coordinates. | ||
* | ||
* Your callback function will be recalled when the parent page is scrolled or resized. | ||
* | ||
* Pass false to disable the callback. | ||
*/ | ||
getParentProps(callback: (data: ParentProps) => void): void | ||
/** | ||
* Scroll the parent page by x and y | ||
*/ | ||
scrollBy(x: number, y: number): void | ||
/** | ||
* Scroll the parent page by x and y | ||
*/ | ||
scrollBy(x: number, y: number): void | ||
/** | ||
* Scroll the parent page to the coordinates x and y | ||
*/ | ||
scrollTo(x: number, y: number): void | ||
/** | ||
* Scroll the parent page to the coordinates x and y | ||
*/ | ||
scrollTo(x: number, y: number): void | ||
/** | ||
* Scroll the parent page to the coordinates x and y relative to the position of the iFrame. | ||
*/ | ||
scrollToOffset(x: number, y: number): void | ||
/** | ||
* Scroll the parent page to the coordinates x and y relative to the position of the iFrame. | ||
*/ | ||
scrollToOffset(x: number, y: number): void | ||
/** | ||
* Send data to the containing page, message can be any data type that can be serialized into JSON. The `targetOrigin` | ||
* option is used to restrict where the message is sent to; to stop an attacker mimicking your parent page. | ||
* See the MDN documentation on postMessage for more details. | ||
*/ | ||
sendMessage(message: any, targetOrigin?: string): void | ||
/** | ||
* Send data to the containing page, message can be any data type that can be serialized into JSON. The `targetOrigin` | ||
* option is used to restrict where the message is sent to; to stop an attacker mimicking your parent page. | ||
* See the MDN documentation on postMessage for more details. | ||
*/ | ||
sendMessage(message: any, targetOrigin?: string): void | ||
/** | ||
* Set default target origin. | ||
*/ | ||
setTargetOrigin(targetOrigin: string): void | ||
/** | ||
* Set default target origin. | ||
*/ | ||
setTargetOrigin(targetOrigin: string): void | ||
/** | ||
* Manually force iFrame to resize. To use passed arguments you need first to disable the `autoResize` option to | ||
* prevent auto resizing and enable the `sizeWidth` option if you wish to set the width. | ||
*/ | ||
size(customHeight?: string, customWidth?: string): void | ||
/** | ||
* Manually force iFrame to resize. To use passed arguments you need first to disable the `autoResize` option to | ||
* prevent auto resizing and enable the `sizeWidth` option if you wish to set the width. | ||
*/ | ||
size(customHeight?: string, customWidth?: string): void | ||
} | ||
export interface ParentProps { | ||
/** | ||
* The values returned by iframe.getBoundingClientRect() | ||
*/ | ||
iframe: { | ||
x: number | ||
y: number | ||
width: number | ||
height: number | ||
top: number | ||
right: number | ||
bottom: number | ||
left: number | ||
} | ||
interface ParentProps { | ||
/** | ||
* The values returned by iframe.getBoundingClientRect() | ||
*/ | ||
iframe: { | ||
x: number | ||
y: number | ||
width: number | ||
height: number | ||
top: number | ||
right: number | ||
bottom: number | ||
left: number | ||
} | ||
/** | ||
* The values returned by document.documentElement.scrollWidth and document.documentElement.scrollHeight | ||
*/ | ||
document: { | ||
scrollWidth: number | ||
scrollHeight: number | ||
} | ||
/** | ||
* The values returned by document.documentElement.scrollWidth and document.documentElement.scrollHeight | ||
*/ | ||
document: { | ||
scrollWidth: number | ||
scrollHeight: number | ||
} | ||
/** | ||
* The values returned by window.visualViewport | ||
*/ | ||
viewport: { | ||
width: number | ||
height: number | ||
offsetLeft: number | ||
offsetTop: number | ||
pageLeft: number | ||
pageTop: number | ||
scale: number | ||
} | ||
/** | ||
* The values returned by window.visualViewport | ||
*/ | ||
viewport: { | ||
width: number | ||
height: number | ||
offsetLeft: number | ||
offsetTop: number | ||
pageLeft: number | ||
pageTop: number | ||
scale: number | ||
} | ||
@@ -133,7 +131,6 @@ } | ||
interface Window { | ||
iFrameResizer: iframeResizer.IFramePageOptions | ||
parentIFrame: iframeResizer.IFramePage | ||
iFrameResizer: IFramePageOptions | ||
parentIFrame: IFramePage | ||
} | ||
} | ||
} |
/*! | ||
* @preserve | ||
* | ||
* @module iframe-resizer/child 5.1.4 (cjs) - 2024-06-25 | ||
* @module iframe-resizer/child 5.2.0-beta.1 (cjs) - 2024-07-02 | ||
* | ||
@@ -20,2 +20,3 @@ * @license GPL-3.0 for non-commercial use only. | ||
"use strict";const e="5.1.4",t=10,n="data-iframe-size",o=(e,t,n,o)=>e.addEventListener(t,n,o||!1),i=(e,t,n)=>e.removeEventListener(t,n,!1),r=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const a=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(r[e]),l={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},c={height:()=>(de("Custom height calculation function not defined"),He.auto()),width:()=>(de("Custom width calculation function not defined"),We.auto())},s={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,documentElementBoundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},u=128,d={},m="checkVisibility"in window,f="auto",p="[iFrameSizer]",h=p.length,y={max:1,min:1,bodyScroll:1,documentElementScroll:1},g=["body"],v="scroll";let b,w,z=!0,S="",$=0,j="",E=null,P="",O=!0,M=!1,A=null,C=!0,T=!1,I=1,k=f,x=!0,N="",R={},B=!0,q=!1,L=0,D=!1,H="",W="child",U=null,F=!1,V="",J=window.parent,Z="*",Q=0,X=!1,Y="",G=1,K=v,_=window,ee=()=>{de("onMessage function not defined")},te=()=>{},ne=null,oe=null;const ie=e=>""!=`${e}`&&void 0!==e,re=new WeakSet,ae=e=>"object"==typeof e&&re.add(e);function le(e){switch(!0){case!ie(e):return"";case ie(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case ie(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(ie(e.className)?`.${e.className}`:"")}}function ce(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\n"," ")}...`:e}const se=(...e)=>[`[iframe-resizer][${H}]`,...e].join(" "),ue=(...e)=>console?.info(se(...e)),de=(...e)=>console?.warn(se(...e)),me=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(se)(...e)),fe=e=>me(e);function pe(){!function(){try{F="iframeParentListener"in window.parent}catch(e){}}(),function(){const e=e=>"true"===e,t=N.slice(h).split(":");H=t[0],$=void 0===t[1]?$:Number(t[1]),M=void 0===t[2]?M:e(t[2]),q=void 0===t[3]?q:e(t[3]),z=void 0===t[6]?z:e(t[6]),j=t[7],k=void 0===t[8]?k:t[8],S=t[9],P=t[10],Q=void 0===t[11]?Q:Number(t[11]),R.enable=void 0!==t[12]&&e(t[12]),W=void 0===t[13]?W:t[13],K=void 0===t[14]?K:t[14],D=void 0===t[15]?D:e(t[15]),b=void 0===t[16]?b:Number(t[16]),w=void 0===t[17]?w:Number(t[17]),O=void 0===t[18]?O:e(t[18]),t[19],Y=t[20]||Y,L=void 0===t[21]?L:Number(t[21])}(),function(){function e(){const e=window.iframeResizer||window.iFrameResizer;ee=e?.onMessage||ee,te=e?.onReady||te,"number"==typeof e?.offset&&(O&&(b=e?.offset),M&&(w=e?.offset)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(V=e.sizeSelector),Z=e?.targetOrigin||Z,k=e?.heightCalculationMethod||k,K=e?.widthCalculationMethod||K}function t(e,t){return"function"==typeof e&&(c[t]=e,e="custom"),e}if(1===L)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),k=t(k,"height"),K=t(K,"width"))}(),function(){void 0===j&&(j=`${$}px`);he("margin",function(e,t){t.includes("-")&&(de(`Negative CSS value ignored for ${e}`),t="");return t}("margin",j))}(),he("background",S),he("padding",P),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),ye(),L<0?fe(`${a(L+2)}${a(2)}`):Y.codePointAt(0)>4||L<2&&fe(a(3)),function(){if(!Y||""===Y||"false"===Y)return void 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/<u> for more details.\n");Y!==e&&me(`<rb>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Y} - Child page: ${e}.\n`)}(),ze(),Se(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.setAttribute(n,null)}));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</>.")}(),document.querySelectorAll(`[${n}]`).length>0&&("auto"===k&&(k="autoOverflow"),"auto"===K&&(K="autoOverflow")),be(),function(){if(1===L)return;_.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===z?(z=!0,$e()):!1===e&&!0===z&&(z=!1,ve("remove"),U?.disconnect(),E?.disconnect()),Qe(0,0,"autoResize",JSON.stringify(z)),z),close(){Qe(0,0,"close")},getId:()=>H,getPageInfo(e){if("function"==typeof e)return ne=e,Qe(0,0,"pageInfo"),void me("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ne=null,Qe(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return oe=e,Qe(0,0,"parentInfo"),()=>{oe=null,Qe(0,0,"parentInfoStop")}},getParentProperties(e){me("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){R.findTarget(e)},reset(){Ze()},scrollBy(e,t){Qe(t,e,"scrollBy")},scrollTo(e,t){Qe(t,e,"scrollTo")},scrollToOffset(e,t){Qe(t,e,"scrollToOffset")},sendMessage(e,t){Qe(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){k=e,ze()},setWidthCalculationMethod(e){K=e,Se()},setTargetOrigin(e){Z=e},resize(e,t){Fe("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){me("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),_.parentIFrame=_.parentIframe}(),function(){if(!0!==D)return;function e(e){Qe(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){o(window.document,t,e)}t("mouseenter"),t("mouseleave")}(),$e(),R=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function i(e){function t(e){const t=n(e);Qe(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?Qe(0,0,"inPageLink",`#${o}`):t(r)}function r(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&i(t)}function a(){function e(e){function t(e){e.preventDefault(),i(this.getAttribute("href"))}"#"!==e.getAttribute("href")&&o(e,"click",t)}document.querySelectorAll('a[href^="#"]').forEach(e)}function l(){o(window,"hashchange",r)}function c(){setTimeout(r,u)}function s(){a(),l(),c()}R.enable&&(1===L?me("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):s());return{findTarget:i}}(),ae(document.documentElement),ae(document.body),Fe("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&Qe(0,0,"title",document.title),te(),B=!1}function he(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function ye(){""!==V&&document.querySelectorAll(V).forEach((e=>{e.dataset.iframeSize=!0}))}function ge(e){({add(t){function n(){Fe(e.eventName,e.eventType)}d[t]=n,o(window,t,n,{passive:!0})},remove(e){const t=d[e];delete d[e],i(window,e,t)}})[e.method](e.eventName)}function ve(e){ge({method:e,eventType:"After Print",eventName:"afterprint"}),ge({method:e,eventType:"Before Print",eventName:"beforeprint"}),ge({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function be(){const e=document.querySelectorAll(`[${n}]`);T=e.length>0,A=T?e:Ne(document)()}function we(e,t,n,o){return t!==e&&(e in n||(de(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in s&&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 remove this option.`)),e}function ze(){k=we(k,f,He,"height")}function Se(){K=we(K,v,We,"width")}function $e(){!0===z&&(ve("add"),E=function(){function e(e){e.forEach(Ce),ye(),be()}function t(){const t=new window.MutationObserver(e),n=document.querySelector("body"),o={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return t.observe(n,o),t}const n=t();return{disconnect(){n.disconnect()}}}(),U=new ResizeObserver(Ee),Ae(window.document))}let je;function Ee(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;je=()=>Fe("resizeObserver",`Resize Observed: ${le(t)}`),setTimeout((()=>{je&&je(),je=void 0}),0)}const Pe=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Oe=()=>[...Ne(document)()].filter(Pe);function Me(e){e&&U.observe(e)}function Ae(e){[...Oe(),...g.flatMap((t=>e.querySelector(t)))].forEach(Me)}function Ce(e){"childList"===e.type&&Ae(e.target)}let Te=4,Ie=4;function ke(e){const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let o=0,i=A.length,r=document.documentElement,a=T?0:document.documentElement.getBoundingClientRect().bottom,c=performance.now();var s;A.forEach((t=>{T||!m||t.checkVisibility(l)?(o=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),o>a&&(a=o,r=t)):i-=1})),c=performance.now()-c,i>1&&(s=r,re.has(s)||(ae(s),ue(`\nHeight calculated from: ${le(s)} (${ce(s)})`)));const u=`\nParsed ${i} element${1===i?"":"s"} in ${c.toPrecision(3)}ms\n${t} ${T?"tagged ":""}element found at: ${a}px\nPosition calculated from HTML element: ${le(r)} (${ce(r,100)})`;return c<4||i<99||T||B||Te<c&&Te<Ie&&(Te=1.2*c,me(`<rb>Performance Warning</>\n\nCalculating the page size took an excessive amount of time. To improve performance add the <b>data-iframe-size</> attribute to the ${e} most element on the page.\n${u}`)),Ie=c,a}const xe=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],Ne=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)");let Re=!1;function Be({ceilBoundingSize:e,dimension:t,getDimension:n,isHeight:o,scrollSize:i}){if(!Re)return Re=!0,n.taggedElement();const r=o?"bottom":"right";return me(`<rb>Detected content overflowing html element</>\n \nThis causes <i>iframe-resizer</> to fall back to checking the position of every element on the page in order to calculate the correct dimensions of the iframe. Inspecting the size, ${r} margin, and position of every visible HTML element will have a performance impact on more complex pages. \n\nTo fix this issue, and remove this warning, you can either ensure the content of the page does not overflow the <b><HTML></> element or alternatively you can add the attribute <b>data-iframe-size</> to the elements on the page that you want <i>iframe-resizer</> to use when calculating the dimensions of the iframe. \n \nWhen present the ${r} margin of the ${o?"lowest":"right most"} element with a <b>data-iframe-size</> attribute will be used to set the ${t} of the iframe.\n\nMore info: https://iframe-resizer.com/performance.\n\n(Page size: ${i} > document size: ${e})`),o?k="autoOverflow":K="autoOverflow",n.taggedElement()}const qe={height:0,width:0},Le={height:0,width:0};function De(e,t){function n(){return Le[i]=r,qe[i]=c,r}const o=e===He,i=o?"height":"width",r=e.documentElementBoundingClientRect(),a=Math.ceil(r),l=Math.floor(r),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return c;case!t&&0===Le[i]&&0===qe[i]:if(e.taggedElement(!0)<=a)return n();break;case X&&r===Le[i]&&c===qe[i]:return Math.max(r,c);case 0===r:return c;case!t&&r!==Le[i]&&c<=qe[i]:return n();case!o:return t?e.taggedElement():Be({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c});case!t&&r<Le[i]:case c===l||c===a:case r>c:return n();case!t:return Be({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c})}return Math.max(e.taggedElement(),n())}const He={enabled:()=>O,getOffset:()=>b,type:"height",auto:()=>De(He,!1),autoOverflow:()=>De(He,!0),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>He.bodyOffset(),custom:()=>c.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(...xe(He)),min:()=>Math.min(...xe(He)),grow:()=>He.max(),lowestElement:()=>ke("bottom"),taggedElement:()=>ke("bottom")},We={enabled:()=>M,getOffset:()=>w,type:"width",auto:()=>De(We,!1),autoOverflow:()=>De(We,!0),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>c.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().right,max:()=>Math.max(...xe(We)),min:()=>Math.min(...xe(We)),rightMostElement:()=>ke("right"),scroll:()=>Math.max(We.bodyScroll(),We.documentElementScroll()),taggedElement:()=>ke("right")};function Ue(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=Q);return r=void 0===n?He[k]():n,a=void 0===o?We[K]():o,O&&e(I,r)||M&&e(G,a)}()&&"init"!==e?!(e in{init:1,size:1})&&(O&&k in y||M&&K in y)&&Ze():(Ve(),I=r,G=a,Qe(I,G,e,i))}function Fe(e,t,n,o,i){document.hidden||Ue(e,0,n,o,i)}function Ve(){X||(X=!0,requestAnimationFrame((()=>{X=!1})))}function Je(e){I=He[k](),G=We[K](),Qe(I,G,e)}function Ze(e){const t=k;k=f,Ve(),Je("reset"),k=t}function Qe(e,t,n,o,i){L<-1||(void 0!==i||(i=Z),function(){const r=`${H}:${`${e+(b||0)}:${t+(w||0)}`}:${n}${void 0===o?"":`:${o}`}`;F?window.parent.iframeParentListener(p+r):J.postMessage(p+r,i)}())}function Xe(e){const t={init:function(){N=e.data,J=e.source,pe(),C=!1,setTimeout((()=>{x=!1}),u)},reset(){x||Je("resetPage")},resize(){Fe("resizeParent")},moveToAnchor(){R.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ne?ne(JSON.parse(e)):Qe(0,0,"pageInfoStop")},parentInfo(){const e=o();oe?oe(Object.freeze(JSON.parse(e))):Qe(0,0,"parentInfoStop")},message(){const e=o();ee(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};p===`${e.data}`.slice(0,h)&&(!1!==C?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||de(`Unexpected message (${e.data})`)}())}function Ye(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>Xe({data:e,sameDomain:!0}),o(window,"message",Xe),o(window,"readystatechange",Ye),Ye()); | ||
"use strict";const e="5.2.0-beta.1",t=10,n="data-iframe-size",o="data-iframe-overflow",i="bottom",r="right",a=(e,t,n,o)=>e.addEventListener(t,n,o||!1),l=(e,t,n)=>e.removeEventListener(t,n,!1),c=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const s=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(c[e]),u=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},d=e=>e;let m=i,f=d;const p={root:document.documentElement,rootMargin:"0px",threshold:1};let h=[];const y=new WeakSet,g=new IntersectionObserver((e=>{e.forEach((e=>{e.target.toggleAttribute(o,(e=>0===e.boundingClientRect[m]||e.boundingClientRect[m]>e.rootBounds[m])(e))})),h=document.querySelectorAll(`[${o}]`),f()}),p),v=e=>(m=e.side,f=e.onChange,e=>e.forEach((e=>{y.has(e)||(g.observe(e),y.add(e))}))),b=()=>h.length>0,w={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},z={height:()=>($e("Custom height calculation function not defined"),tt.auto()),width:()=>($e("Custom width calculation function not defined"),nt.auto())},S={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,documentElementBoundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},j=128,$={},E="checkVisibility"in window,P="auto",C="[iFrameSizer]",A=C.length,M={max:1,min:1,bodyScroll:1,documentElementScroll:1},O=["body"],T="scroll";let R,I,N=!0,k="",x=0,B="",q=null,W="",L=!0,U=!1,F=null,V=!0,D=!1,H=1,J=P,Z=!0,Q="",X={},Y=!0,G=!1,K=0,_=!1,ee="",te=d,ne="child",oe=null,ie=!1,re="",ae=window.parent,le="*",ce=0,se=!1,ue="",de=1,me=T,fe=window,pe=()=>{$e("onMessage function not defined")},he=()=>{},ye=null,ge=null;const ve=e=>""!=`${e}`&&void 0!==e,be=new WeakSet,we=e=>"object"==typeof e&&be.add(e);function ze(e){switch(!0){case!ve(e):return"";case ve(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case ve(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(ve(e.className)?`.${e.className}`:"")}}const Se=(...e)=>[`[iframe-resizer][${ee}]`,...e].join(" "),je=(...e)=>console?.info(`[iframe-resizer][${ee}]`,...e),$e=(...e)=>console?.warn(Se(...e)),Ee=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(Se)(...e)),Pe=e=>Ee(e);function Ce(){!function(){const e=e=>"true"===e,t=Q.slice(A).split(":");ee=t[0],x=void 0===t[1]?x:Number(t[1]),U=void 0===t[2]?U:e(t[2]),G=void 0===t[3]?G:e(t[3]),N=void 0===t[6]?N:e(t[6]),B=t[7],J=void 0===t[8]?J:t[8],k=t[9],W=t[10],ce=void 0===t[11]?ce:Number(t[11]),X.enable=void 0!==t[12]&&e(t[12]),ne=void 0===t[13]?ne:t[13],me=void 0===t[14]?me:t[14],_=void 0===t[15]?_:e(t[15]),R=void 0===t[16]?R:Number(t[16]),I=void 0===t[17]?I:Number(t[17]),L=void 0===t[18]?L:e(t[18]),t[19],ue=t[20]||ue,K=void 0===t[21]?K:Number(t[21])}(),function(){function e(){const e=window.iframeResizer||window.iFrameResizer;pe=e?.onMessage||pe,he=e?.onReady||he,"number"==typeof e?.offset&&(L&&(R=e?.offset),U&&(I=e?.offset)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(re=e.sizeSelector),le=e?.targetOrigin||le,J=e?.heightCalculationMethod||J,me=e?.widthCalculationMethod||me}function t(e,t){return"function"==typeof e&&(z[t]=e,e="custom"),e}if(1===K)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),J=t(J,"height"),me=t(me,"width"))}(),function(){try{ie="iframeParentListener"in window.parent}catch(e){}}(),K<0?Pe(`${s(K+2)}${s(2)}`):ue.codePointAt(0)>4||K<2&&Pe(s(3)),function(){if(!ue||""===ue||"false"===ue)return void Ee("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/<u> for more details.\n");ue!==e&&Ee(`<rb>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ue} - Child page: ${e}.\n`)}(),ke(),xe(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.toggleAttribute(n,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&Ee("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),function(){if(L===U)return;te=v({onChange:u(Ae),side:L?i:r})}(),Me(),function(){if(1===K)return;fe.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===N?(N=!0,Be()):!1===e&&!0===N&&(N=!1,Ie("remove"),oe?.disconnect(),q?.disconnect()),ct(0,0,"autoResize",JSON.stringify(N)),N),close(){ct(0,0,"close")},getId:()=>ee,getPageInfo(e){if("function"==typeof e)return ye=e,ct(0,0,"pageInfo"),void Ee("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ye=null,ct(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return ge=e,ct(0,0,"parentInfo"),()=>{ge=null,ct(0,0,"parentInfoStop")}},getParentProperties(e){Ee("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){X.findTarget(e)},reset(){lt()},scrollBy(e,t){ct(t,e,"scrollBy")},scrollTo(e,t){ct(t,e,"scrollTo")},scrollToOffset(e,t){ct(t,e,"scrollToOffset")},sendMessage(e,t){ct(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){J=e,ke()},setWidthCalculationMethod(e){me=e,xe()},setTargetOrigin(e){le=e},resize(e,t){it("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){Ee("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),fe.parentIFrame=fe.parentIframe}(),function(){if(!0!==_)return;function e(e){ct(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){a(window.document,t,e)}t("mouseenter"),t("mouseleave")}(),X=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function o(e){function t(e){const t=n(e);ct(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?ct(0,0,"inPageLink",`#${o}`):t(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){function e(e){function t(e){e.preventDefault(),o(this.getAttribute("href"))}"#"!==e.getAttribute("href")&&a(e,"click",t)}document.querySelectorAll('a[href^="#"]').forEach(e)}function l(){a(window,"hashchange",i)}function c(){setTimeout(i,j)}function s(){r(),l(),c()}X.enable&&(1===K?Ee("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):s());return{findTarget:o}}(),we(document.documentElement),we(document.body),function(){void 0===B&&(B=`${x}px`);Oe("margin",function(e,t){t.includes("-")&&($e(`Negative CSS value ignored for ${e}`),t="");return t}("margin",B))}(),Oe("background",k),Oe("padding",W),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),Te()}const Ae=()=>{it("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&ct(0,0,"title",document.title),Be(),he(),Y=!1};function Me(){const e=document.querySelectorAll(`[${n}]`);D=e.length>0,F=D?e:Ge(document)(),D?setTimeout(Ae):te(F)}function Oe(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function Te(){""!==re&&document.querySelectorAll(re).forEach((e=>{e.dataset.iframeSize=!0}))}function Re(e){({add(t){function n(){it(e.eventName,e.eventType)}$[t]=n,a(window,t,n,{passive:!0})},remove(e){const t=$[e];delete $[e],l(window,e,t)}})[e.method](e.eventName)}function Ie(e){Re({method:e,eventType:"After Print",eventName:"afterprint"}),Re({method:e,eventType:"Before Print",eventName:"beforeprint"}),Re({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function Ne(e,t,n,o){return t!==e&&(e in n||($e(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in S&&Ee(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`)),e}function ke(){J=Ne(J,P,tt,"height")}function xe(){me=Ne(me,T,nt,"width")}function Be(){!0===N&&(Ie("add"),q=function(){function e(e){e.forEach(He),Te(),Me()}function t(){const t=new window.MutationObserver(e),n=document.querySelector("body"),o={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return t.observe(n,o),t}const n=t();return{disconnect(){n.disconnect()}}}(),oe=new ResizeObserver(We),De(window.document))}let qe;function We(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;qe=()=>it("resizeObserver",`Resize Observed: ${ze(t)}`),setTimeout((()=>{qe&&qe(),qe=void 0}),0)}const Le=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Ue=()=>[...Ge(document)()].filter(Le),Fe=new WeakSet;function Ve(e){e&&(Fe.has(e)||(oe.observe(e),Fe.add(e)))}function De(e){[...Ue(),...O.flatMap((t=>e.querySelector(t)))].forEach(Ve)}function He(e){"childList"===e.type&&De(e.target)}let Je=null;let Ze=4,Qe=4;function Xe(e){const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let o=0,i=document.documentElement,r=D?0:document.documentElement.getBoundingClientRect().bottom,a=performance.now();const l=!D&&b()?h:F;let c=l.length;l.forEach((t=>{D||!E||t.checkVisibility(w)?(o=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),o>r&&(r=o,i=t)):c-=1})),a=(performance.now()-a).toPrecision(1),function(e,t,n,o){be.has(e)||Je===e||D&&o<=1||(Je=e,je(`\n${t} position calculated from:\n`,e,`\nParsed ${o} ${D?"tagged":"potentially overflowing"} elements in ${n}ms`))}(i,t,a,c);const s=`\nParsed ${c} element${1===c?"":"s"} in ${a}ms\n${t} ${D?"tagged ":""}element found at: ${r}px\nPosition calculated from HTML element: ${ze(i)} (${function(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\n"," ")}...`:e}(i,100)})`;return a<4||c<99||D||Y||Ze<a&&Ze<Qe&&(Ze=1.2*a,Ee(`<rb>Performance Warning</>\n\nCalculating the page size took an excessive amount of time. To improve performance add the <b>data-iframe-size</> attribute to the ${e} most element on the page.\n${s}`)),Qe=a,r}const Ye=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],Ge=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)"),Ke={height:0,width:0},_e={height:0,width:0};function et(e){function t(){return _e[i]=r,Ke[i]=c,r}const n=b(),o=e===tt,i=o?"height":"width",r=e.documentElementBoundingClientRect(),a=Math.ceil(r),l=Math.floor(r),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return c;case D:return e.taggedElement();case!n&&0===_e[i]&&0===Ke[i]:return t();case se&&r===_e[i]&&c===Ke[i]:return Math.max(r,c);case 0===r:return c;case!n&&r!==_e[i]&&c<=Ke[i]:return t();case!o:return e.taggedElement();case!n&&r<_e[i]:case c===l||c===a:case r>c:return t()}return Math.max(e.taggedElement(),t())}const tt={enabled:()=>L,getOffset:()=>R,auto:()=>et(tt),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>tt.bodyOffset(),custom:()=>z.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(...Ye(tt)),min:()=>Math.min(...Ye(tt)),grow:()=>tt.max(),lowestElement:()=>Xe(i),taggedElement:()=>Xe(i)},nt={enabled:()=>U,getOffset:()=>I,auto:()=>et(nt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>z.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().right,max:()=>Math.max(...Ye(nt)),min:()=>Math.min(...Ye(nt)),rightMostElement:()=>Xe(r),scroll:()=>Math.max(nt.bodyScroll(),nt.documentElementScroll()),taggedElement:()=>Xe(r)};function ot(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=ce);return r=void 0===n?tt[J]():n,a=void 0===o?nt[me]():o,L&&e(H,r)||U&&e(de,a)}()&&"init"!==e?!(e in{init:1,size:1})&&(L&&J in M||U&&me in M)&<():(rt(),H=r,de=a,ct(H,de,e,i))}function it(e,t,n,o,i){document.hidden||ot(e,0,n,o,i)}function rt(){se||(se=!0,requestAnimationFrame((()=>{se=!1})))}function at(e){H=tt[J](),de=nt[me](),ct(H,de,e)}function lt(e){const t=J;J=P,rt(),at("reset"),J=t}function ct(e,t,n,o,i){K<-1||(void 0!==i||(i=le),function(){const r=`${ee}:${`${e+(R||0)}:${t+(I||0)}`}:${n}${void 0===o?"":`:${o}`}`;ie?window.parent.iframeParentListener(C+r):ae.postMessage(C+r,i)}())}function st(e){const t={init:function(){Q=e.data,ae=e.source,Ce(),V=!1,setTimeout((()=>{Z=!1}),j)},reset(){Z||at("resetPage")},resize(){it("resizeParent")},moveToAnchor(){X.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ye?ye(JSON.parse(e)):ct(0,0,"pageInfoStop")},parentInfo(){const e=o();ge?ge(Object.freeze(JSON.parse(e))):ct(0,0,"parentInfoStop")},message(){const e=o();pe(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};C===`${e.data}`.slice(0,A)&&(!1!==V?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||$e(`Unexpected message (${e.data})`)}())}function ut(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>st({data:e,sameDomain:!0}),a(window,"message",st),a(window,"readystatechange",ut),ut()); | ||
//# sourceMappingURL=index.cjs.js.map |
/*! | ||
* @preserve | ||
* | ||
* @module iframe-resizer/child 5.1.4 (esm) - 2024-06-25 | ||
* @module iframe-resizer/child 5.2.0-beta.1 (esm) - 2024-07-02 | ||
* | ||
@@ -20,2 +20,3 @@ * @license GPL-3.0 for non-commercial use only. | ||
const e="5.1.4",t=10,n="data-iframe-size",o=(e,t,n,o)=>e.addEventListener(t,n,o||!1),i=(e,t,n)=>e.removeEventListener(t,n,!1),r=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const a=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(r[e]),l={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},c={height:()=>(de("Custom height calculation function not defined"),He.auto()),width:()=>(de("Custom width calculation function not defined"),We.auto())},s={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,documentElementBoundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},u=128,d={},m="checkVisibility"in window,f="auto",p="[iFrameSizer]",h=p.length,y={max:1,min:1,bodyScroll:1,documentElementScroll:1},g=["body"],v="scroll";let b,w,z=!0,S="",$=0,j="",E=null,P="",O=!0,M=!1,A=null,C=!0,T=!1,I=1,k=f,x=!0,N="",R={},B=!0,q=!1,L=0,D=!1,H="",W="child",U=null,F=!1,V="",J=window.parent,Z="*",Q=0,X=!1,Y="",G=1,K=v,_=window,ee=()=>{de("onMessage function not defined")},te=()=>{},ne=null,oe=null;const ie=e=>""!=`${e}`&&void 0!==e,re=new WeakSet,ae=e=>"object"==typeof e&&re.add(e);function le(e){switch(!0){case!ie(e):return"";case ie(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case ie(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(ie(e.className)?`.${e.className}`:"")}}function ce(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\n"," ")}...`:e}const se=(...e)=>[`[iframe-resizer][${H}]`,...e].join(" "),ue=(...e)=>console?.info(se(...e)),de=(...e)=>console?.warn(se(...e)),me=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(se)(...e)),fe=e=>me(e);function pe(){!function(){try{F="iframeParentListener"in window.parent}catch(e){}}(),function(){const e=e=>"true"===e,t=N.slice(h).split(":");H=t[0],$=void 0===t[1]?$:Number(t[1]),M=void 0===t[2]?M:e(t[2]),q=void 0===t[3]?q:e(t[3]),z=void 0===t[6]?z:e(t[6]),j=t[7],k=void 0===t[8]?k:t[8],S=t[9],P=t[10],Q=void 0===t[11]?Q:Number(t[11]),R.enable=void 0!==t[12]&&e(t[12]),W=void 0===t[13]?W:t[13],K=void 0===t[14]?K:t[14],D=void 0===t[15]?D:e(t[15]),b=void 0===t[16]?b:Number(t[16]),w=void 0===t[17]?w:Number(t[17]),O=void 0===t[18]?O:e(t[18]),t[19],Y=t[20]||Y,L=void 0===t[21]?L:Number(t[21])}(),function(){function e(){const e=window.iframeResizer||window.iFrameResizer;ee=e?.onMessage||ee,te=e?.onReady||te,"number"==typeof e?.offset&&(O&&(b=e?.offset),M&&(w=e?.offset)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(V=e.sizeSelector),Z=e?.targetOrigin||Z,k=e?.heightCalculationMethod||k,K=e?.widthCalculationMethod||K}function t(e,t){return"function"==typeof e&&(c[t]=e,e="custom"),e}if(1===L)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),k=t(k,"height"),K=t(K,"width"))}(),function(){void 0===j&&(j=`${$}px`);he("margin",function(e,t){t.includes("-")&&(de(`Negative CSS value ignored for ${e}`),t="");return t}("margin",j))}(),he("background",S),he("padding",P),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),ye(),L<0?fe(`${a(L+2)}${a(2)}`):Y.codePointAt(0)>4||L<2&&fe(a(3)),function(){if(!Y||""===Y||"false"===Y)return void 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/<u> for more details.\n");Y!==e&&me(`<rb>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Y} - Child page: ${e}.\n`)}(),ze(),Se(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.setAttribute(n,null)}));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</>.")}(),document.querySelectorAll(`[${n}]`).length>0&&("auto"===k&&(k="autoOverflow"),"auto"===K&&(K="autoOverflow")),be(),function(){if(1===L)return;_.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===z?(z=!0,$e()):!1===e&&!0===z&&(z=!1,ve("remove"),U?.disconnect(),E?.disconnect()),Qe(0,0,"autoResize",JSON.stringify(z)),z),close(){Qe(0,0,"close")},getId:()=>H,getPageInfo(e){if("function"==typeof e)return ne=e,Qe(0,0,"pageInfo"),void me("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ne=null,Qe(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return oe=e,Qe(0,0,"parentInfo"),()=>{oe=null,Qe(0,0,"parentInfoStop")}},getParentProperties(e){me("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){R.findTarget(e)},reset(){Ze()},scrollBy(e,t){Qe(t,e,"scrollBy")},scrollTo(e,t){Qe(t,e,"scrollTo")},scrollToOffset(e,t){Qe(t,e,"scrollToOffset")},sendMessage(e,t){Qe(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){k=e,ze()},setWidthCalculationMethod(e){K=e,Se()},setTargetOrigin(e){Z=e},resize(e,t){Fe("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){me("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),_.parentIFrame=_.parentIframe}(),function(){if(!0!==D)return;function e(e){Qe(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){o(window.document,t,e)}t("mouseenter"),t("mouseleave")}(),$e(),R=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function i(e){function t(e){const t=n(e);Qe(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?Qe(0,0,"inPageLink",`#${o}`):t(r)}function r(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&i(t)}function a(){function e(e){function t(e){e.preventDefault(),i(this.getAttribute("href"))}"#"!==e.getAttribute("href")&&o(e,"click",t)}document.querySelectorAll('a[href^="#"]').forEach(e)}function l(){o(window,"hashchange",r)}function c(){setTimeout(r,u)}function s(){a(),l(),c()}R.enable&&(1===L?me("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):s());return{findTarget:i}}(),ae(document.documentElement),ae(document.body),Fe("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&Qe(0,0,"title",document.title),te(),B=!1}function he(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function ye(){""!==V&&document.querySelectorAll(V).forEach((e=>{e.dataset.iframeSize=!0}))}function ge(e){({add(t){function n(){Fe(e.eventName,e.eventType)}d[t]=n,o(window,t,n,{passive:!0})},remove(e){const t=d[e];delete d[e],i(window,e,t)}})[e.method](e.eventName)}function ve(e){ge({method:e,eventType:"After Print",eventName:"afterprint"}),ge({method:e,eventType:"Before Print",eventName:"beforeprint"}),ge({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function be(){const e=document.querySelectorAll(`[${n}]`);T=e.length>0,A=T?e:Ne(document)()}function we(e,t,n,o){return t!==e&&(e in n||(de(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in s&&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 remove this option.`)),e}function ze(){k=we(k,f,He,"height")}function Se(){K=we(K,v,We,"width")}function $e(){!0===z&&(ve("add"),E=function(){function e(e){e.forEach(Ce),ye(),be()}function t(){const t=new window.MutationObserver(e),n=document.querySelector("body"),o={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return t.observe(n,o),t}const n=t();return{disconnect(){n.disconnect()}}}(),U=new ResizeObserver(Ee),Ae(window.document))}let je;function Ee(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;je=()=>Fe("resizeObserver",`Resize Observed: ${le(t)}`),setTimeout((()=>{je&&je(),je=void 0}),0)}const Pe=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Oe=()=>[...Ne(document)()].filter(Pe);function Me(e){e&&U.observe(e)}function Ae(e){[...Oe(),...g.flatMap((t=>e.querySelector(t)))].forEach(Me)}function Ce(e){"childList"===e.type&&Ae(e.target)}let Te=4,Ie=4;function ke(e){const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let o=0,i=A.length,r=document.documentElement,a=T?0:document.documentElement.getBoundingClientRect().bottom,c=performance.now();var s;A.forEach((t=>{T||!m||t.checkVisibility(l)?(o=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),o>a&&(a=o,r=t)):i-=1})),c=performance.now()-c,i>1&&(s=r,re.has(s)||(ae(s),ue(`\nHeight calculated from: ${le(s)} (${ce(s)})`)));const u=`\nParsed ${i} element${1===i?"":"s"} in ${c.toPrecision(3)}ms\n${t} ${T?"tagged ":""}element found at: ${a}px\nPosition calculated from HTML element: ${le(r)} (${ce(r,100)})`;return c<4||i<99||T||B||Te<c&&Te<Ie&&(Te=1.2*c,me(`<rb>Performance Warning</>\n\nCalculating the page size took an excessive amount of time. To improve performance add the <b>data-iframe-size</> attribute to the ${e} most element on the page.\n${u}`)),Ie=c,a}const xe=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],Ne=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)");let Re=!1;function Be({ceilBoundingSize:e,dimension:t,getDimension:n,isHeight:o,scrollSize:i}){if(!Re)return Re=!0,n.taggedElement();const r=o?"bottom":"right";return me(`<rb>Detected content overflowing html element</>\n \nThis causes <i>iframe-resizer</> to fall back to checking the position of every element on the page in order to calculate the correct dimensions of the iframe. Inspecting the size, ${r} margin, and position of every visible HTML element will have a performance impact on more complex pages. \n\nTo fix this issue, and remove this warning, you can either ensure the content of the page does not overflow the <b><HTML></> element or alternatively you can add the attribute <b>data-iframe-size</> to the elements on the page that you want <i>iframe-resizer</> to use when calculating the dimensions of the iframe. \n \nWhen present the ${r} margin of the ${o?"lowest":"right most"} element with a <b>data-iframe-size</> attribute will be used to set the ${t} of the iframe.\n\nMore info: https://iframe-resizer.com/performance.\n\n(Page size: ${i} > document size: ${e})`),o?k="autoOverflow":K="autoOverflow",n.taggedElement()}const qe={height:0,width:0},Le={height:0,width:0};function De(e,t){function n(){return Le[i]=r,qe[i]=c,r}const o=e===He,i=o?"height":"width",r=e.documentElementBoundingClientRect(),a=Math.ceil(r),l=Math.floor(r),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return c;case!t&&0===Le[i]&&0===qe[i]:if(e.taggedElement(!0)<=a)return n();break;case X&&r===Le[i]&&c===qe[i]:return Math.max(r,c);case 0===r:return c;case!t&&r!==Le[i]&&c<=qe[i]:return n();case!o:return t?e.taggedElement():Be({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c});case!t&&r<Le[i]:case c===l||c===a:case r>c:return n();case!t:return Be({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c})}return Math.max(e.taggedElement(),n())}const He={enabled:()=>O,getOffset:()=>b,type:"height",auto:()=>De(He,!1),autoOverflow:()=>De(He,!0),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>He.bodyOffset(),custom:()=>c.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(...xe(He)),min:()=>Math.min(...xe(He)),grow:()=>He.max(),lowestElement:()=>ke("bottom"),taggedElement:()=>ke("bottom")},We={enabled:()=>M,getOffset:()=>w,type:"width",auto:()=>De(We,!1),autoOverflow:()=>De(We,!0),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>c.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().right,max:()=>Math.max(...xe(We)),min:()=>Math.min(...xe(We)),rightMostElement:()=>ke("right"),scroll:()=>Math.max(We.bodyScroll(),We.documentElementScroll()),taggedElement:()=>ke("right")};function Ue(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=Q);return r=void 0===n?He[k]():n,a=void 0===o?We[K]():o,O&&e(I,r)||M&&e(G,a)}()&&"init"!==e?!(e in{init:1,size:1})&&(O&&k in y||M&&K in y)&&Ze():(Ve(),I=r,G=a,Qe(I,G,e,i))}function Fe(e,t,n,o,i){document.hidden||Ue(e,0,n,o,i)}function Ve(){X||(X=!0,requestAnimationFrame((()=>{X=!1})))}function Je(e){I=He[k](),G=We[K](),Qe(I,G,e)}function Ze(e){const t=k;k=f,Ve(),Je("reset"),k=t}function Qe(e,t,n,o,i){L<-1||(void 0!==i||(i=Z),function(){const r=`${H}:${`${e+(b||0)}:${t+(w||0)}`}:${n}${void 0===o?"":`:${o}`}`;F?window.parent.iframeParentListener(p+r):J.postMessage(p+r,i)}())}function Xe(e){const t={init:function(){N=e.data,J=e.source,pe(),C=!1,setTimeout((()=>{x=!1}),u)},reset(){x||Je("resetPage")},resize(){Fe("resizeParent")},moveToAnchor(){R.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ne?ne(JSON.parse(e)):Qe(0,0,"pageInfoStop")},parentInfo(){const e=o();oe?oe(Object.freeze(JSON.parse(e))):Qe(0,0,"parentInfoStop")},message(){const e=o();ee(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};p===`${e.data}`.slice(0,h)&&(!1!==C?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||de(`Unexpected message (${e.data})`)}())}function Ye(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>Xe({data:e,sameDomain:!0}),o(window,"message",Xe),o(window,"readystatechange",Ye),Ye()); | ||
const e="5.2.0-beta.1",t=10,n="data-iframe-size",o="data-iframe-overflow",i="bottom",r="right",a=(e,t,n,o)=>e.addEventListener(t,n,o||!1),l=(e,t,n)=>e.removeEventListener(t,n,!1),c=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const s=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(c[e]),u=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},d=e=>e;let m=i,f=d;const p={root:document.documentElement,rootMargin:"0px",threshold:1};let h=[];const y=new WeakSet,g=new IntersectionObserver((e=>{e.forEach((e=>{e.target.toggleAttribute(o,(e=>0===e.boundingClientRect[m]||e.boundingClientRect[m]>e.rootBounds[m])(e))})),h=document.querySelectorAll(`[${o}]`),f()}),p),v=e=>(m=e.side,f=e.onChange,e=>e.forEach((e=>{y.has(e)||(g.observe(e),y.add(e))}))),b=()=>h.length>0,w={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},z={height:()=>($e("Custom height calculation function not defined"),tt.auto()),width:()=>($e("Custom width calculation function not defined"),nt.auto())},S={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,documentElementBoundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},j=128,$={},E="checkVisibility"in window,P="auto",C="[iFrameSizer]",A=C.length,M={max:1,min:1,bodyScroll:1,documentElementScroll:1},O=["body"],T="scroll";let R,I,N=!0,k="",x=0,B="",q=null,W="",L=!0,U=!1,F=null,V=!0,D=!1,H=1,J=P,Z=!0,Q="",X={},Y=!0,G=!1,K=0,_=!1,ee="",te=d,ne="child",oe=null,ie=!1,re="",ae=window.parent,le="*",ce=0,se=!1,ue="",de=1,me=T,fe=window,pe=()=>{$e("onMessage function not defined")},he=()=>{},ye=null,ge=null;const ve=e=>""!=`${e}`&&void 0!==e,be=new WeakSet,we=e=>"object"==typeof e&&be.add(e);function ze(e){switch(!0){case!ve(e):return"";case ve(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case ve(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(ve(e.className)?`.${e.className}`:"")}}const Se=(...e)=>[`[iframe-resizer][${ee}]`,...e].join(" "),je=(...e)=>console?.info(`[iframe-resizer][${ee}]`,...e),$e=(...e)=>console?.warn(Se(...e)),Ee=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(Se)(...e)),Pe=e=>Ee(e);function Ce(){!function(){const e=e=>"true"===e,t=Q.slice(A).split(":");ee=t[0],x=void 0===t[1]?x:Number(t[1]),U=void 0===t[2]?U:e(t[2]),G=void 0===t[3]?G:e(t[3]),N=void 0===t[6]?N:e(t[6]),B=t[7],J=void 0===t[8]?J:t[8],k=t[9],W=t[10],ce=void 0===t[11]?ce:Number(t[11]),X.enable=void 0!==t[12]&&e(t[12]),ne=void 0===t[13]?ne:t[13],me=void 0===t[14]?me:t[14],_=void 0===t[15]?_:e(t[15]),R=void 0===t[16]?R:Number(t[16]),I=void 0===t[17]?I:Number(t[17]),L=void 0===t[18]?L:e(t[18]),t[19],ue=t[20]||ue,K=void 0===t[21]?K:Number(t[21])}(),function(){function e(){const e=window.iframeResizer||window.iFrameResizer;pe=e?.onMessage||pe,he=e?.onReady||he,"number"==typeof e?.offset&&(L&&(R=e?.offset),U&&(I=e?.offset)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(re=e.sizeSelector),le=e?.targetOrigin||le,J=e?.heightCalculationMethod||J,me=e?.widthCalculationMethod||me}function t(e,t){return"function"==typeof e&&(z[t]=e,e="custom"),e}if(1===K)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),J=t(J,"height"),me=t(me,"width"))}(),function(){try{ie="iframeParentListener"in window.parent}catch(e){}}(),K<0?Pe(`${s(K+2)}${s(2)}`):ue.codePointAt(0)>4||K<2&&Pe(s(3)),function(){if(!ue||""===ue||"false"===ue)return void Ee("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/<u> for more details.\n");ue!==e&&Ee(`<rb>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ue} - Child page: ${e}.\n`)}(),ke(),xe(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.toggleAttribute(n,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&Ee("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),function(){if(L===U)return;te=v({onChange:u(Ae),side:L?i:r})}(),Me(),function(){if(1===K)return;fe.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===N?(N=!0,Be()):!1===e&&!0===N&&(N=!1,Ie("remove"),oe?.disconnect(),q?.disconnect()),ct(0,0,"autoResize",JSON.stringify(N)),N),close(){ct(0,0,"close")},getId:()=>ee,getPageInfo(e){if("function"==typeof e)return ye=e,ct(0,0,"pageInfo"),void Ee("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ye=null,ct(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return ge=e,ct(0,0,"parentInfo"),()=>{ge=null,ct(0,0,"parentInfoStop")}},getParentProperties(e){Ee("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){X.findTarget(e)},reset(){lt()},scrollBy(e,t){ct(t,e,"scrollBy")},scrollTo(e,t){ct(t,e,"scrollTo")},scrollToOffset(e,t){ct(t,e,"scrollToOffset")},sendMessage(e,t){ct(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){J=e,ke()},setWidthCalculationMethod(e){me=e,xe()},setTargetOrigin(e){le=e},resize(e,t){it("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){Ee("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),fe.parentIFrame=fe.parentIframe}(),function(){if(!0!==_)return;function e(e){ct(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){a(window.document,t,e)}t("mouseenter"),t("mouseleave")}(),X=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function o(e){function t(e){const t=n(e);ct(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?ct(0,0,"inPageLink",`#${o}`):t(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){function e(e){function t(e){e.preventDefault(),o(this.getAttribute("href"))}"#"!==e.getAttribute("href")&&a(e,"click",t)}document.querySelectorAll('a[href^="#"]').forEach(e)}function l(){a(window,"hashchange",i)}function c(){setTimeout(i,j)}function s(){r(),l(),c()}X.enable&&(1===K?Ee("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):s());return{findTarget:o}}(),we(document.documentElement),we(document.body),function(){void 0===B&&(B=`${x}px`);Oe("margin",function(e,t){t.includes("-")&&($e(`Negative CSS value ignored for ${e}`),t="");return t}("margin",B))}(),Oe("background",k),Oe("padding",W),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),Te()}const Ae=()=>{it("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&ct(0,0,"title",document.title),Be(),he(),Y=!1};function Me(){const e=document.querySelectorAll(`[${n}]`);D=e.length>0,F=D?e:Ge(document)(),D?setTimeout(Ae):te(F)}function Oe(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function Te(){""!==re&&document.querySelectorAll(re).forEach((e=>{e.dataset.iframeSize=!0}))}function Re(e){({add(t){function n(){it(e.eventName,e.eventType)}$[t]=n,a(window,t,n,{passive:!0})},remove(e){const t=$[e];delete $[e],l(window,e,t)}})[e.method](e.eventName)}function Ie(e){Re({method:e,eventType:"After Print",eventName:"afterprint"}),Re({method:e,eventType:"Before Print",eventName:"beforeprint"}),Re({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function Ne(e,t,n,o){return t!==e&&(e in n||($e(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in S&&Ee(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`)),e}function ke(){J=Ne(J,P,tt,"height")}function xe(){me=Ne(me,T,nt,"width")}function Be(){!0===N&&(Ie("add"),q=function(){function e(e){e.forEach(He),Te(),Me()}function t(){const t=new window.MutationObserver(e),n=document.querySelector("body"),o={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return t.observe(n,o),t}const n=t();return{disconnect(){n.disconnect()}}}(),oe=new ResizeObserver(We),De(window.document))}let qe;function We(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;qe=()=>it("resizeObserver",`Resize Observed: ${ze(t)}`),setTimeout((()=>{qe&&qe(),qe=void 0}),0)}const Le=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Ue=()=>[...Ge(document)()].filter(Le),Fe=new WeakSet;function Ve(e){e&&(Fe.has(e)||(oe.observe(e),Fe.add(e)))}function De(e){[...Ue(),...O.flatMap((t=>e.querySelector(t)))].forEach(Ve)}function He(e){"childList"===e.type&&De(e.target)}let Je=null;let Ze=4,Qe=4;function Xe(e){const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let o=0,i=document.documentElement,r=D?0:document.documentElement.getBoundingClientRect().bottom,a=performance.now();const l=!D&&b()?h:F;let c=l.length;l.forEach((t=>{D||!E||t.checkVisibility(w)?(o=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),o>r&&(r=o,i=t)):c-=1})),a=(performance.now()-a).toPrecision(1),function(e,t,n,o){be.has(e)||Je===e||D&&o<=1||(Je=e,je(`\n${t} position calculated from:\n`,e,`\nParsed ${o} ${D?"tagged":"potentially overflowing"} elements in ${n}ms`))}(i,t,a,c);const s=`\nParsed ${c} element${1===c?"":"s"} in ${a}ms\n${t} ${D?"tagged ":""}element found at: ${r}px\nPosition calculated from HTML element: ${ze(i)} (${function(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\n"," ")}...`:e}(i,100)})`;return a<4||c<99||D||Y||Ze<a&&Ze<Qe&&(Ze=1.2*a,Ee(`<rb>Performance Warning</>\n\nCalculating the page size took an excessive amount of time. To improve performance add the <b>data-iframe-size</> attribute to the ${e} most element on the page.\n${s}`)),Qe=a,r}const Ye=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],Ge=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)"),Ke={height:0,width:0},_e={height:0,width:0};function et(e){function t(){return _e[i]=r,Ke[i]=c,r}const n=b(),o=e===tt,i=o?"height":"width",r=e.documentElementBoundingClientRect(),a=Math.ceil(r),l=Math.floor(r),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return c;case D:return e.taggedElement();case!n&&0===_e[i]&&0===Ke[i]:return t();case se&&r===_e[i]&&c===Ke[i]:return Math.max(r,c);case 0===r:return c;case!n&&r!==_e[i]&&c<=Ke[i]:return t();case!o:return e.taggedElement();case!n&&r<_e[i]:case c===l||c===a:case r>c:return t()}return Math.max(e.taggedElement(),t())}const tt={enabled:()=>L,getOffset:()=>R,auto:()=>et(tt),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>tt.bodyOffset(),custom:()=>z.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(...Ye(tt)),min:()=>Math.min(...Ye(tt)),grow:()=>tt.max(),lowestElement:()=>Xe(i),taggedElement:()=>Xe(i)},nt={enabled:()=>U,getOffset:()=>I,auto:()=>et(nt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>z.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().right,max:()=>Math.max(...Ye(nt)),min:()=>Math.min(...Ye(nt)),rightMostElement:()=>Xe(r),scroll:()=>Math.max(nt.bodyScroll(),nt.documentElementScroll()),taggedElement:()=>Xe(r)};function ot(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=ce);return r=void 0===n?tt[J]():n,a=void 0===o?nt[me]():o,L&&e(H,r)||U&&e(de,a)}()&&"init"!==e?!(e in{init:1,size:1})&&(L&&J in M||U&&me in M)&<():(rt(),H=r,de=a,ct(H,de,e,i))}function it(e,t,n,o,i){document.hidden||ot(e,0,n,o,i)}function rt(){se||(se=!0,requestAnimationFrame((()=>{se=!1})))}function at(e){H=tt[J](),de=nt[me](),ct(H,de,e)}function lt(e){const t=J;J=P,rt(),at("reset"),J=t}function ct(e,t,n,o,i){K<-1||(void 0!==i||(i=le),function(){const r=`${ee}:${`${e+(R||0)}:${t+(I||0)}`}:${n}${void 0===o?"":`:${o}`}`;ie?window.parent.iframeParentListener(C+r):ae.postMessage(C+r,i)}())}function st(e){const t={init:function(){Q=e.data,ae=e.source,Ce(),V=!1,setTimeout((()=>{Z=!1}),j)},reset(){Z||at("resetPage")},resize(){it("resizeParent")},moveToAnchor(){X.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ye?ye(JSON.parse(e)):ct(0,0,"pageInfoStop")},parentInfo(){const e=o();ge?ge(Object.freeze(JSON.parse(e))):ct(0,0,"parentInfoStop")},message(){const e=o();pe(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};C===`${e.data}`.slice(0,A)&&(!1!==V?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||$e(`Unexpected message (${e.data})`)}())}function ut(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>st({data:e,sameDomain:!0}),a(window,"message",st),a(window,"readystatechange",ut),ut()); | ||
//# sourceMappingURL=index.esm.js.map |
/*! | ||
* @preserve | ||
* | ||
* @module iframe-resizer/child 5.1.4 (umd) - 2024-06-25 | ||
* @module iframe-resizer/child 5.2.0-beta.1 (umd) - 2024-07-02 | ||
* | ||
@@ -20,2 +20,3 @@ * @license GPL-3.0 for non-commercial use only. | ||
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";const e="5.1.4",t=10,n="data-iframe-size",o=(e,t,n,o)=>e.addEventListener(t,n,o||!1),i=(e,t,n)=>e.removeEventListener(t,n,!1),r=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const a=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(r[e]),l={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},c={height:()=>(de("Custom height calculation function not defined"),He.auto()),width:()=>(de("Custom width calculation function not defined"),We.auto())},s={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,documentElementBoundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},u=128,d={},m="checkVisibility"in window,f="auto",p="[iFrameSizer]",h=p.length,y={max:1,min:1,bodyScroll:1,documentElementScroll:1},g=["body"],v="scroll";let b,w,z=!0,S="",$=0,j="",E=null,P="",O=!0,M=!1,A=null,C=!0,T=!1,I=1,k=f,x=!0,N="",R={},B=!0,q=!1,L=0,D=!1,H="",W="child",U=null,F=!1,V="",J=window.parent,Z="*",Q=0,X=!1,Y="",G=1,K=v,_=window,ee=()=>{de("onMessage function not defined")},te=()=>{},ne=null,oe=null;const ie=e=>""!=`${e}`&&void 0!==e,re=new WeakSet,ae=e=>"object"==typeof e&&re.add(e);function le(e){switch(!0){case!ie(e):return"";case ie(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case ie(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(ie(e.className)?`.${e.className}`:"")}}function ce(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\n"," ")}...`:e}const se=(...e)=>[`[iframe-resizer][${H}]`,...e].join(" "),ue=(...e)=>console?.info(se(...e)),de=(...e)=>console?.warn(se(...e)),me=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(se)(...e)),fe=e=>me(e);function pe(){!function(){try{F="iframeParentListener"in window.parent}catch(e){}}(),function(){const e=e=>"true"===e,t=N.slice(h).split(":");H=t[0],$=void 0===t[1]?$:Number(t[1]),M=void 0===t[2]?M:e(t[2]),q=void 0===t[3]?q:e(t[3]),z=void 0===t[6]?z:e(t[6]),j=t[7],k=void 0===t[8]?k:t[8],S=t[9],P=t[10],Q=void 0===t[11]?Q:Number(t[11]),R.enable=void 0!==t[12]&&e(t[12]),W=void 0===t[13]?W:t[13],K=void 0===t[14]?K:t[14],D=void 0===t[15]?D:e(t[15]),b=void 0===t[16]?b:Number(t[16]),w=void 0===t[17]?w:Number(t[17]),O=void 0===t[18]?O:e(t[18]),t[19],Y=t[20]||Y,L=void 0===t[21]?L:Number(t[21])}(),function(){function e(){const e=window.iframeResizer||window.iFrameResizer;ee=e?.onMessage||ee,te=e?.onReady||te,"number"==typeof e?.offset&&(O&&(b=e?.offset),M&&(w=e?.offset)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(V=e.sizeSelector),Z=e?.targetOrigin||Z,k=e?.heightCalculationMethod||k,K=e?.widthCalculationMethod||K}function t(e,t){return"function"==typeof e&&(c[t]=e,e="custom"),e}if(1===L)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),k=t(k,"height"),K=t(K,"width"))}(),function(){void 0===j&&(j=`${$}px`);he("margin",function(e,t){t.includes("-")&&(de(`Negative CSS value ignored for ${e}`),t="");return t}("margin",j))}(),he("background",S),he("padding",P),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),ye(),L<0?fe(`${a(L+2)}${a(2)}`):Y.codePointAt(0)>4||L<2&&fe(a(3)),function(){if(!Y||""===Y||"false"===Y)return void 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/<u> for more details.\n");Y!==e&&me(`<rb>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Y} - Child page: ${e}.\n`)}(),ze(),Se(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.setAttribute(n,null)}));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</>.")}(),document.querySelectorAll(`[${n}]`).length>0&&("auto"===k&&(k="autoOverflow"),"auto"===K&&(K="autoOverflow")),be(),function(){if(1===L)return;_.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===z?(z=!0,$e()):!1===e&&!0===z&&(z=!1,ve("remove"),U?.disconnect(),E?.disconnect()),Qe(0,0,"autoResize",JSON.stringify(z)),z),close(){Qe(0,0,"close")},getId:()=>H,getPageInfo(e){if("function"==typeof e)return ne=e,Qe(0,0,"pageInfo"),void me("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ne=null,Qe(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return oe=e,Qe(0,0,"parentInfo"),()=>{oe=null,Qe(0,0,"parentInfoStop")}},getParentProperties(e){me("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){R.findTarget(e)},reset(){Ze()},scrollBy(e,t){Qe(t,e,"scrollBy")},scrollTo(e,t){Qe(t,e,"scrollTo")},scrollToOffset(e,t){Qe(t,e,"scrollToOffset")},sendMessage(e,t){Qe(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){k=e,ze()},setWidthCalculationMethod(e){K=e,Se()},setTargetOrigin(e){Z=e},resize(e,t){Fe("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){me("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),_.parentIFrame=_.parentIframe}(),function(){if(!0!==D)return;function e(e){Qe(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){o(window.document,t,e)}t("mouseenter"),t("mouseleave")}(),$e(),R=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function i(e){function t(e){const t=n(e);Qe(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?Qe(0,0,"inPageLink",`#${o}`):t(r)}function r(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&i(t)}function a(){function e(e){function t(e){e.preventDefault(),i(this.getAttribute("href"))}"#"!==e.getAttribute("href")&&o(e,"click",t)}document.querySelectorAll('a[href^="#"]').forEach(e)}function l(){o(window,"hashchange",r)}function c(){setTimeout(r,u)}function s(){a(),l(),c()}R.enable&&(1===L?me("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):s());return{findTarget:i}}(),ae(document.documentElement),ae(document.body),Fe("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&Qe(0,0,"title",document.title),te(),B=!1}function he(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function ye(){""!==V&&document.querySelectorAll(V).forEach((e=>{e.dataset.iframeSize=!0}))}function ge(e){({add(t){function n(){Fe(e.eventName,e.eventType)}d[t]=n,o(window,t,n,{passive:!0})},remove(e){const t=d[e];delete d[e],i(window,e,t)}})[e.method](e.eventName)}function ve(e){ge({method:e,eventType:"After Print",eventName:"afterprint"}),ge({method:e,eventType:"Before Print",eventName:"beforeprint"}),ge({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function be(){const e=document.querySelectorAll(`[${n}]`);T=e.length>0,A=T?e:Ne(document)()}function we(e,t,n,o){return t!==e&&(e in n||(de(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in s&&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 remove this option.`)),e}function ze(){k=we(k,f,He,"height")}function Se(){K=we(K,v,We,"width")}function $e(){!0===z&&(ve("add"),E=function(){function e(e){e.forEach(Ce),ye(),be()}function t(){const t=new window.MutationObserver(e),n=document.querySelector("body"),o={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return t.observe(n,o),t}const n=t();return{disconnect(){n.disconnect()}}}(),U=new ResizeObserver(Ee),Ae(window.document))}let je;function Ee(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;je=()=>Fe("resizeObserver",`Resize Observed: ${le(t)}`),setTimeout((()=>{je&&je(),je=void 0}),0)}const Pe=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Oe=()=>[...Ne(document)()].filter(Pe);function Me(e){e&&U.observe(e)}function Ae(e){[...Oe(),...g.flatMap((t=>e.querySelector(t)))].forEach(Me)}function Ce(e){"childList"===e.type&&Ae(e.target)}let Te=4,Ie=4;function ke(e){const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let o=0,i=A.length,r=document.documentElement,a=T?0:document.documentElement.getBoundingClientRect().bottom,c=performance.now();var s;A.forEach((t=>{T||!m||t.checkVisibility(l)?(o=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),o>a&&(a=o,r=t)):i-=1})),c=performance.now()-c,i>1&&(s=r,re.has(s)||(ae(s),ue(`\nHeight calculated from: ${le(s)} (${ce(s)})`)));const u=`\nParsed ${i} element${1===i?"":"s"} in ${c.toPrecision(3)}ms\n${t} ${T?"tagged ":""}element found at: ${a}px\nPosition calculated from HTML element: ${le(r)} (${ce(r,100)})`;return c<4||i<99||T||B||Te<c&&Te<Ie&&(Te=1.2*c,me(`<rb>Performance Warning</>\n\nCalculating the page size took an excessive amount of time. To improve performance add the <b>data-iframe-size</> attribute to the ${e} most element on the page.\n${u}`)),Ie=c,a}const xe=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],Ne=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)");let Re=!1;function Be({ceilBoundingSize:e,dimension:t,getDimension:n,isHeight:o,scrollSize:i}){if(!Re)return Re=!0,n.taggedElement();const r=o?"bottom":"right";return me(`<rb>Detected content overflowing html element</>\n \nThis causes <i>iframe-resizer</> to fall back to checking the position of every element on the page in order to calculate the correct dimensions of the iframe. Inspecting the size, ${r} margin, and position of every visible HTML element will have a performance impact on more complex pages. \n\nTo fix this issue, and remove this warning, you can either ensure the content of the page does not overflow the <b><HTML></> element or alternatively you can add the attribute <b>data-iframe-size</> to the elements on the page that you want <i>iframe-resizer</> to use when calculating the dimensions of the iframe. \n \nWhen present the ${r} margin of the ${o?"lowest":"right most"} element with a <b>data-iframe-size</> attribute will be used to set the ${t} of the iframe.\n\nMore info: https://iframe-resizer.com/performance.\n\n(Page size: ${i} > document size: ${e})`),o?k="autoOverflow":K="autoOverflow",n.taggedElement()}const qe={height:0,width:0},Le={height:0,width:0};function De(e,t){function n(){return Le[i]=r,qe[i]=c,r}const o=e===He,i=o?"height":"width",r=e.documentElementBoundingClientRect(),a=Math.ceil(r),l=Math.floor(r),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return c;case!t&&0===Le[i]&&0===qe[i]:if(e.taggedElement(!0)<=a)return n();break;case X&&r===Le[i]&&c===qe[i]:return Math.max(r,c);case 0===r:return c;case!t&&r!==Le[i]&&c<=qe[i]:return n();case!o:return t?e.taggedElement():Be({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c});case!t&&r<Le[i]:case c===l||c===a:case r>c:return n();case!t:return Be({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c})}return Math.max(e.taggedElement(),n())}const He={enabled:()=>O,getOffset:()=>b,type:"height",auto:()=>De(He,!1),autoOverflow:()=>De(He,!0),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>He.bodyOffset(),custom:()=>c.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(...xe(He)),min:()=>Math.min(...xe(He)),grow:()=>He.max(),lowestElement:()=>ke("bottom"),taggedElement:()=>ke("bottom")},We={enabled:()=>M,getOffset:()=>w,type:"width",auto:()=>De(We,!1),autoOverflow:()=>De(We,!0),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>c.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().right,max:()=>Math.max(...xe(We)),min:()=>Math.min(...xe(We)),rightMostElement:()=>ke("right"),scroll:()=>Math.max(We.bodyScroll(),We.documentElementScroll()),taggedElement:()=>ke("right")};function Ue(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=Q);return r=void 0===n?He[k]():n,a=void 0===o?We[K]():o,O&&e(I,r)||M&&e(G,a)}()&&"init"!==e?!(e in{init:1,size:1})&&(O&&k in y||M&&K in y)&&Ze():(Ve(),I=r,G=a,Qe(I,G,e,i))}function Fe(e,t,n,o,i){document.hidden||Ue(e,0,n,o,i)}function Ve(){X||(X=!0,requestAnimationFrame((()=>{X=!1})))}function Je(e){I=He[k](),G=We[K](),Qe(I,G,e)}function Ze(e){const t=k;k=f,Ve(),Je("reset"),k=t}function Qe(e,t,n,o,i){L<-1||(void 0!==i||(i=Z),function(){const r=`${H}:${`${e+(b||0)}:${t+(w||0)}`}:${n}${void 0===o?"":`:${o}`}`;F?window.parent.iframeParentListener(p+r):J.postMessage(p+r,i)}())}function Xe(e){const t={init:function(){N=e.data,J=e.source,pe(),C=!1,setTimeout((()=>{x=!1}),u)},reset(){x||Je("resetPage")},resize(){Fe("resizeParent")},moveToAnchor(){R.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ne?ne(JSON.parse(e)):Qe(0,0,"pageInfoStop")},parentInfo(){const e=o();oe?oe(Object.freeze(JSON.parse(e))):Qe(0,0,"parentInfoStop")},message(){const e=o();ee(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};p===`${e.data}`.slice(0,h)&&(!1!==C?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||de(`Unexpected message (${e.data})`)}())}function Ye(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>Xe({data:e,sameDomain:!0}),o(window,"message",Xe),o(window,"readystatechange",Ye),Ye())})); | ||
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";const e="5.2.0-beta.1",t=10,n="data-iframe-size",o="data-iframe-overflow",i="bottom",r="right",a=(e,t,n,o)=>e.addEventListener(t,n,o||!1),l=(e,t,n)=>e.removeEventListener(t,n,!1),c=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const s=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(c[e]),u=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},d=e=>e;let m=i,f=d;const p={root:document.documentElement,rootMargin:"0px",threshold:1};let h=[];const y=new WeakSet,g=new IntersectionObserver((e=>{e.forEach((e=>{e.target.toggleAttribute(o,(e=>0===e.boundingClientRect[m]||e.boundingClientRect[m]>e.rootBounds[m])(e))})),h=document.querySelectorAll(`[${o}]`),f()}),p),v=e=>(m=e.side,f=e.onChange,e=>e.forEach((e=>{y.has(e)||(g.observe(e),y.add(e))}))),b=()=>h.length>0,w={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},z={height:()=>($e("Custom height calculation function not defined"),tt.auto()),width:()=>($e("Custom width calculation function not defined"),nt.auto())},S={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,documentElementBoundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},j=128,$={},E="checkVisibility"in window,P="auto",C="[iFrameSizer]",A=C.length,M={max:1,min:1,bodyScroll:1,documentElementScroll:1},O=["body"],T="scroll";let R,I,N=!0,k="",x=0,B="",q=null,W="",L=!0,U=!1,F=null,V=!0,D=!1,H=1,J=P,Z=!0,Q="",X={},Y=!0,G=!1,K=0,_=!1,ee="",te=d,ne="child",oe=null,ie=!1,re="",ae=window.parent,le="*",ce=0,se=!1,ue="",de=1,me=T,fe=window,pe=()=>{$e("onMessage function not defined")},he=()=>{},ye=null,ge=null;const ve=e=>""!=`${e}`&&void 0!==e,be=new WeakSet,we=e=>"object"==typeof e&&be.add(e);function ze(e){switch(!0){case!ve(e):return"";case ve(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case ve(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(ve(e.className)?`.${e.className}`:"")}}const Se=(...e)=>[`[iframe-resizer][${ee}]`,...e].join(" "),je=(...e)=>console?.info(`[iframe-resizer][${ee}]`,...e),$e=(...e)=>console?.warn(Se(...e)),Ee=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(Se)(...e)),Pe=e=>Ee(e);function Ce(){!function(){const e=e=>"true"===e,t=Q.slice(A).split(":");ee=t[0],x=void 0===t[1]?x:Number(t[1]),U=void 0===t[2]?U:e(t[2]),G=void 0===t[3]?G:e(t[3]),N=void 0===t[6]?N:e(t[6]),B=t[7],J=void 0===t[8]?J:t[8],k=t[9],W=t[10],ce=void 0===t[11]?ce:Number(t[11]),X.enable=void 0!==t[12]&&e(t[12]),ne=void 0===t[13]?ne:t[13],me=void 0===t[14]?me:t[14],_=void 0===t[15]?_:e(t[15]),R=void 0===t[16]?R:Number(t[16]),I=void 0===t[17]?I:Number(t[17]),L=void 0===t[18]?L:e(t[18]),t[19],ue=t[20]||ue,K=void 0===t[21]?K:Number(t[21])}(),function(){function e(){const e=window.iframeResizer||window.iFrameResizer;pe=e?.onMessage||pe,he=e?.onReady||he,"number"==typeof e?.offset&&(L&&(R=e?.offset),U&&(I=e?.offset)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(re=e.sizeSelector),le=e?.targetOrigin||le,J=e?.heightCalculationMethod||J,me=e?.widthCalculationMethod||me}function t(e,t){return"function"==typeof e&&(z[t]=e,e="custom"),e}if(1===K)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),J=t(J,"height"),me=t(me,"width"))}(),function(){try{ie="iframeParentListener"in window.parent}catch(e){}}(),K<0?Pe(`${s(K+2)}${s(2)}`):ue.codePointAt(0)>4||K<2&&Pe(s(3)),function(){if(!ue||""===ue||"false"===ue)return void Ee("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/<u> for more details.\n");ue!==e&&Ee(`<rb>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ue} - Child page: ${e}.\n`)}(),ke(),xe(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.toggleAttribute(n,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&Ee("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),function(){if(L===U)return;te=v({onChange:u(Ae),side:L?i:r})}(),Me(),function(){if(1===K)return;fe.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===N?(N=!0,Be()):!1===e&&!0===N&&(N=!1,Ie("remove"),oe?.disconnect(),q?.disconnect()),ct(0,0,"autoResize",JSON.stringify(N)),N),close(){ct(0,0,"close")},getId:()=>ee,getPageInfo(e){if("function"==typeof e)return ye=e,ct(0,0,"pageInfo"),void Ee("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ye=null,ct(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return ge=e,ct(0,0,"parentInfo"),()=>{ge=null,ct(0,0,"parentInfoStop")}},getParentProperties(e){Ee("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){X.findTarget(e)},reset(){lt()},scrollBy(e,t){ct(t,e,"scrollBy")},scrollTo(e,t){ct(t,e,"scrollTo")},scrollToOffset(e,t){ct(t,e,"scrollToOffset")},sendMessage(e,t){ct(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){J=e,ke()},setWidthCalculationMethod(e){me=e,xe()},setTargetOrigin(e){le=e},resize(e,t){it("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){Ee("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),fe.parentIFrame=fe.parentIframe}(),function(){if(!0!==_)return;function e(e){ct(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){a(window.document,t,e)}t("mouseenter"),t("mouseleave")}(),X=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function o(e){function t(e){const t=n(e);ct(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?ct(0,0,"inPageLink",`#${o}`):t(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){function e(e){function t(e){e.preventDefault(),o(this.getAttribute("href"))}"#"!==e.getAttribute("href")&&a(e,"click",t)}document.querySelectorAll('a[href^="#"]').forEach(e)}function l(){a(window,"hashchange",i)}function c(){setTimeout(i,j)}function s(){r(),l(),c()}X.enable&&(1===K?Ee("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):s());return{findTarget:o}}(),we(document.documentElement),we(document.body),function(){void 0===B&&(B=`${x}px`);Oe("margin",function(e,t){t.includes("-")&&($e(`Negative CSS value ignored for ${e}`),t="");return t}("margin",B))}(),Oe("background",k),Oe("padding",W),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),Te()}const Ae=()=>{it("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&ct(0,0,"title",document.title),Be(),he(),Y=!1};function Me(){const e=document.querySelectorAll(`[${n}]`);D=e.length>0,F=D?e:Ge(document)(),D?setTimeout(Ae):te(F)}function Oe(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function Te(){""!==re&&document.querySelectorAll(re).forEach((e=>{e.dataset.iframeSize=!0}))}function Re(e){({add(t){function n(){it(e.eventName,e.eventType)}$[t]=n,a(window,t,n,{passive:!0})},remove(e){const t=$[e];delete $[e],l(window,e,t)}})[e.method](e.eventName)}function Ie(e){Re({method:e,eventType:"After Print",eventName:"afterprint"}),Re({method:e,eventType:"Before Print",eventName:"beforeprint"}),Re({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function Ne(e,t,n,o){return t!==e&&(e in n||($e(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in S&&Ee(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`)),e}function ke(){J=Ne(J,P,tt,"height")}function xe(){me=Ne(me,T,nt,"width")}function Be(){!0===N&&(Ie("add"),q=function(){function e(e){e.forEach(He),Te(),Me()}function t(){const t=new window.MutationObserver(e),n=document.querySelector("body"),o={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return t.observe(n,o),t}const n=t();return{disconnect(){n.disconnect()}}}(),oe=new ResizeObserver(We),De(window.document))}let qe;function We(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;qe=()=>it("resizeObserver",`Resize Observed: ${ze(t)}`),setTimeout((()=>{qe&&qe(),qe=void 0}),0)}const Le=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Ue=()=>[...Ge(document)()].filter(Le),Fe=new WeakSet;function Ve(e){e&&(Fe.has(e)||(oe.observe(e),Fe.add(e)))}function De(e){[...Ue(),...O.flatMap((t=>e.querySelector(t)))].forEach(Ve)}function He(e){"childList"===e.type&&De(e.target)}let Je=null;let Ze=4,Qe=4;function Xe(e){const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let o=0,i=document.documentElement,r=D?0:document.documentElement.getBoundingClientRect().bottom,a=performance.now();const l=!D&&b()?h:F;let c=l.length;l.forEach((t=>{D||!E||t.checkVisibility(w)?(o=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),o>r&&(r=o,i=t)):c-=1})),a=(performance.now()-a).toPrecision(1),function(e,t,n,o){be.has(e)||Je===e||D&&o<=1||(Je=e,je(`\n${t} position calculated from:\n`,e,`\nParsed ${o} ${D?"tagged":"potentially overflowing"} elements in ${n}ms`))}(i,t,a,c);const s=`\nParsed ${c} element${1===c?"":"s"} in ${a}ms\n${t} ${D?"tagged ":""}element found at: ${r}px\nPosition calculated from HTML element: ${ze(i)} (${function(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\n"," ")}...`:e}(i,100)})`;return a<4||c<99||D||Y||Ze<a&&Ze<Qe&&(Ze=1.2*a,Ee(`<rb>Performance Warning</>\n\nCalculating the page size took an excessive amount of time. To improve performance add the <b>data-iframe-size</> attribute to the ${e} most element on the page.\n${s}`)),Qe=a,r}const Ye=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],Ge=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)"),Ke={height:0,width:0},_e={height:0,width:0};function et(e){function t(){return _e[i]=r,Ke[i]=c,r}const n=b(),o=e===tt,i=o?"height":"width",r=e.documentElementBoundingClientRect(),a=Math.ceil(r),l=Math.floor(r),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return c;case D:return e.taggedElement();case!n&&0===_e[i]&&0===Ke[i]:return t();case se&&r===_e[i]&&c===Ke[i]:return Math.max(r,c);case 0===r:return c;case!n&&r!==_e[i]&&c<=Ke[i]:return t();case!o:return e.taggedElement();case!n&&r<_e[i]:case c===l||c===a:case r>c:return t()}return Math.max(e.taggedElement(),t())}const tt={enabled:()=>L,getOffset:()=>R,auto:()=>et(tt),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>tt.bodyOffset(),custom:()=>z.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(...Ye(tt)),min:()=>Math.min(...Ye(tt)),grow:()=>tt.max(),lowestElement:()=>Xe(i),taggedElement:()=>Xe(i)},nt={enabled:()=>U,getOffset:()=>I,auto:()=>et(nt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>z.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().right,max:()=>Math.max(...Ye(nt)),min:()=>Math.min(...Ye(nt)),rightMostElement:()=>Xe(r),scroll:()=>Math.max(nt.bodyScroll(),nt.documentElementScroll()),taggedElement:()=>Xe(r)};function ot(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=ce);return r=void 0===n?tt[J]():n,a=void 0===o?nt[me]():o,L&&e(H,r)||U&&e(de,a)}()&&"init"!==e?!(e in{init:1,size:1})&&(L&&J in M||U&&me in M)&<():(rt(),H=r,de=a,ct(H,de,e,i))}function it(e,t,n,o,i){document.hidden||ot(e,0,n,o,i)}function rt(){se||(se=!0,requestAnimationFrame((()=>{se=!1})))}function at(e){H=tt[J](),de=nt[me](),ct(H,de,e)}function lt(e){const t=J;J=P,rt(),at("reset"),J=t}function ct(e,t,n,o,i){K<-1||(void 0!==i||(i=le),function(){const r=`${ee}:${`${e+(R||0)}:${t+(I||0)}`}:${n}${void 0===o?"":`:${o}`}`;ie?window.parent.iframeParentListener(C+r):ae.postMessage(C+r,i)}())}function st(e){const t={init:function(){Q=e.data,ae=e.source,Ce(),V=!1,setTimeout((()=>{Z=!1}),j)},reset(){Z||at("resetPage")},resize(){it("resizeParent")},moveToAnchor(){X.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ye?ye(JSON.parse(e)):ct(0,0,"pageInfoStop")},parentInfo(){const e=o();ge?ge(Object.freeze(JSON.parse(e))):ct(0,0,"parentInfoStop")},message(){const e=o();pe(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};C===`${e.data}`.slice(0,A)&&(!1!==V?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||$e(`Unexpected message (${e.data})`)}())}function ut(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>st({data:e,sameDomain:!0}),a(window,"message",st),a(window,"readystatechange",ut),ut())})); | ||
//# sourceMappingURL=index.umd.js.map |
{ | ||
"name": "@iframe-resizer/child", | ||
"version": "5.1.4", | ||
"version": "5.2.0-beta.1", | ||
"license": "GPL-3.0", | ||
@@ -5,0 +5,0 @@ "homepage": "https://iframe-resizer.com", |
@@ -25,2 +25,2 @@ [<img src="https://iframe-resizer.com/logo-full.svg" alt="" title="" style="margin-bottom: -20px">](https://iframe-resizer.com) | ||
_iframe-resizer version 5.1.4 2024-06-25 - 09:35:49.581Z_ | ||
_iframe-resizer version 5.2.0-beta.1 2024-07-02 - 15:47:44.129Z_ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
286676
10
359
1