@iframe-resizer/child 6.0.0-beta.8 → 6.0.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.cjs.js +1 -1
- package/index.cjs.js.map +1 -1
- package/index.esm.js +1 -1
- package/index.esm.js.map +1 -1
- package/index.umd.js +2 -2
- package/index.umd.js.map +1 -1
- package/package.json +2 -3
package/index.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/child 6.0.0-beta.
|
|
4
|
+
* @module iframe-resizer/child 6.0.0-beta.9 (esm) - 2026-04-13
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 For use with GPL compliant sites (fully published front & backend source code)
|
|
7
7
|
* Alternatively for commercial use, you can purchase a license from
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@iframe-resizer/common/consts"),require("@iframe-resizer/common"),require("auto-console-group")):"function"==typeof define&&define.amd?define(["@iframe-resizer/common/consts","@iframe-resizer/common","auto-console-group"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).iframeResizerConsts,e.iframeResizerCommon,e.acg)}(this,function(e,t,n){"use strict";let o=!0,r=e.LABEL;const i=t.esModuleInterop(n)({label:`${e.LABEL}(child)`,expand:!1});const a=e=>(...t)=>!o||i[e](...t),s=a("log"),c=s,d=a("debug");const{assert:l,endAutoGroup:u,error:f,errorBoundary:m,event:g,label:h,purge:E,warn:I}=i,p=t.createFormatAdvise(t.id),T=(...e)=>i.warn(...e.map(p)),O=t.deprecate((e,t)=>T(t));O("Method"),O("Method","replaced with"),O("Option");const R=[];function H(e,t){s(`${e} event listener: %c${t}`,n.HIGHLIGHT)}const S=(e,t,n,o)=>{e.removeEventListener(t,n,o),H("Removed",t)},b=(e,t,n,o=!1)=>{e.addEventListener(t,n,o),R.push(()=>S(e,t,n,o)),H("Added",t)},y={applySelectors:null,firstRun:!0,hasTags:!1,hasOverflow:!1,height:0,isHidden:!1,initLock:!0,inPageLinks:{},origin:void 0,hasOverflowUpdated:!0,overflowedNodeSet:new Set,sameOrigin:!1,taggedElements:[],target:window?.parent,timerActive:!1,totalTime:0,triggerLocked:!1,width:0,win:window,onPageInfo:null,onParentInfo:null};let w=!1;function v(t){const n=window?.iframeResizer?.targetOrigin||"*",o=Array.isArray(n)?n:[n];for(const r of o)t.postMessage(e.CHILD_READY_MESSAGE,r)}function G(){if("loading"===document.readyState||!y.firstRun||w)return;const{parent:e,top:t}=window;g("ready"),s("Sending%c ready%c to parent from",n.HIGHLIGHT,n.FOREGROUND,window.location.href),v(e),e!==t&&v(t),w=!0}const N="iframeResize",A=["min-height","min-width","max-height","max-width"],L=new Set,M=e=>e.tagName?e.tagName.toLowerCase():"unknown",$=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),z=(t,n)=>{return!!(o=$(t,n))&&"0px"!==o&&o!==e.AUTO&&o!==e.NONE;var o};function _({href:e}){L.has(e)||(s("Unable to access stylesheet:",e),L.add(e))}const k=(e,t)=>function(e,t){const n=e.style.getPropertyValue(t);return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const o of document.styleSheets)try{for(const n of o.cssRules||[]){if(!("selectorText"in n))continue;const r=n;if(!e.matches(r.selectorText))continue;const i=r.style.getPropertyValue(t);if(!i)continue;const{ownerNode:a}=o;return{source:a instanceof Element&&"STYLE"===a.tagName?"an inline <style> block":`stylesheet (${o.href})`,value:i}}}catch(n){_(o)}return{source:"cross-origin stylesheet",value:$(e,t)}}(e,t),D=(e,t)=>{const{source:n,value:o}=k(e,t),r=M(e);T(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function C(){for(const e of[document.documentElement,document.body])for(const t of A)s(`Checking <${M(e)}> for blocking CSS: ${t}`),z(e,t)&&D(e,t)}const P={autoResize:!0,bodyBackground:"",bodyMargin:0,bodyMarginStr:"",bodyPadding:"",calculateHeight:!0,calculateWidth:!1,heightCalcMode:e.AUTO,ignoreSelector:"",inPageLinks:!1,logging:!1,logExpand:!1,mode:0,mouseEvents:!1,offsetHeight:0,offsetWidth:0,parentId:void 0,sizeSelector:"",targetOrigin:"*",tolerance:0,widthCalcMode:e.AUTO,onBeforeResize:void 0,onMessage:()=>{I("onMessage function not defined")},onReady:()=>{}};function B(){try{y.sameOrigin=1===P.mode||"iframeParentListener"in window.parent}catch(e){s("Cross domain iframe detected")}}let F=0;function U(){const t=document.querySelectorAll(`*[${e.IGNORE_ATTR}]`),o=t.length>0;return o&&t.length!==F&&(!function(t){const o=1===t.length?"":"s";I(`%c[${e.IGNORE_ATTR}]%c found on %c${t.length}%c element${o}`,n.BOLD,n.NORMAL,n.BOLD,n.NORMAL)}(t),F=t.length),o}function x(r,i,a){(!t.isDef(a)||i>-1&&r>i)&&(function(t,r){console.info(`%ciframe-resizer ${t}`,o||r<1?e.BOLD:n.NORMAL)}(`v${e.VERSION} (${t.getModeLabel(r)})`,r),0===r&&((...e)=>{console.warn(...e.map(p))})(t.getModeData(3)))}function V(){"BackCompat"===document.compatMode&&T("<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n")}let W=!1;function Z(n){"complete"===document.readyState?t.isolateUserCode(n):W||b(document,e.READY_STATE_CHANGE,()=>Z(n)),W=!0}const q=()=>{c(`Set targetOrigin for parent: %c${P.targetOrigin}`,n.HIGHLIGHT),!0!==P.autoResize&&s("Auto Resize disabled")};function j(){y.taggedElements=document.querySelectorAll(`[${e.SIZE_ATTR}]`),y.hasTags=y.taggedElements.length>0,s(`Tagged elements found: %c${y.hasTags}`,n.HIGHLIGHT)}function Y({version:t}){t&&""!==t&&t!==e.FALSE?t!==e.VERSION&&T((t=>`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${t} - Child page: ${e.VERSION}.\n`)(t)):T("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n")}const Q=t.once(()=>T(t.getModeData(4)));function J(o,r){const{mode:i}=P,{sameOrigin:a,target:c}=y;if(a)try{window.parent.iframeParentListener(e.MESSAGE_ID+o)}catch(d){if(!t.checkMode(i))throw new Error(d);return Q(),!1}else{l(c,"Internal error: postMessage target is undefined");const t=function(e){return void 0===e?e=P.targetOrigin:s(`Message targetOrigin: %c${e}`,n.HIGHLIGHT),e}(r),i=Array.isArray(t)?t:[t];for(const n of i)c.postMessage(e.MESSAGE_ID+o,n)}return!0}function K(o,r,i,a,d){const{parentId:l}=P,{sameOrigin:u}=y,f=`${l}:${`${o}:${r}`}:${i}${void 0===a?"":`:${a}`}`;if(P.mode<-1)return;J(f,d)&&(!function(o){if(!y.timerActive)return;const r=t.round(performance.now()-y.totalTime),i=o===e.INIT?`Initialised iframe in %c${r}ms`:`Size calculated in %c${r}ms`;s(i,n.HIGHLIGHT)}(i),c(`Sending message to parent page via ${u?"sameOrigin":"postMessage"}: %c%c${f}`,n.ITALIC,n.HIGHLIGHT))}const X=m((e,t,n,o,r)=>{g(n),K(e,t,n,o,r),u()}),ee=e=>X(0,0,e.type,`${e.screenY}:${e.screenX}`);function te(e,t){s(`Add event listener: %c${t}`,n.HIGHLIGHT),b(window.document,e,ee)}function ne({persisted:n}){n||X(0,0,e.BEFORE_UNLOAD),g(e.PAGE_HIDE),c("Page persisted:",n),n||R.forEach(t.invoke)}const oe=()=>b(window,t.lower(e.PAGE_HIDE),ne),re=(e,t)=>!(Math.abs(e-t)<=P.tolerance);const ie=[n.HIGHLIGHT,n.FOREGROUND,n.HIGHLIGHT],ae={height:0,width:0},se={height:0,width:0};function ce(e,t,n){return se[e]=t,ae[e]=n,t}function de(t){const{hasOverflow:o,hasTags:r,triggerLocked:i}=y,a=t.label,s=a===e.HEIGHT,d=t.boundingClientRect(),l=Math.ceil(d),u=Math.floor(d),f=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(t),m=`HTML: %c${d}px %cPage: %c${f}px`;let g;switch(!0){case!t.enabled():return Math.max(f,e.MIN_SIZE);case r:c("Found element with data-iframe-size attribute"),g=t.taggedElement();break;case!o&&y.firstRun&&0===se[a]&&0===ae[a]:c(`Initial page size values: ${m}`,...ie),g=ce(a,d,f);break;case i&&d===se[a]&&f===ae[a]:c(`Size unchanged: ${m}`,...ie),g=Math.max(d,f);break;case 0===d&&0!==f:c(`Page is hidden: ${m}`,...ie),g=f;break;case!o&&d!==se[a]&&f<=ae[a]:c(`New <html> size: ${m} `,...ie),c(`Previous <html> size: %c${se[a]}px`,n.HIGHLIGHT),g=ce(a,d,f);break;case!s:g=t.taggedElement();break;case!o&&d<se[a]:c(`<html> size decreased: ${m}`,...ie),g=ce(a,d,f);break;case f===u||f===l:c(`<html> size equals page size: ${m}`,...ie),g=ce(a,d,f);break;case d>f:c(`Page size < <html> size: ${m}`,...ie),g=ce(a,d,f);break;case o:c("Found elements possibly overflowing <html> "),g=t.taggedElement();break;default:c(`Using <html> size: ${m}`,...ie),g=ce(a,d,f)}return c(`Content ${a}: %c${g}px`,n.HIGHLIGHT),g+=function(e){const t=e.getOffset();return 0!==t&&c(`Page offsetSize: %c${t}px`,n.HIGHLIGHT),t}(t),Math.max(g,e.MIN_SIZE)}const le="--ifr-start",ue="--ifr-end",fe="--ifr-measure",me=[];let ge,he={},Ee=0;function Ie(){try{performance.clearMarks(le),performance.clearMarks(ue),performance.clearMeasures(fe)}catch{}}function pe(e){e.getEntries().forEach(e=>{if(e.name===ue)try{const{duration:t}=performance.measure(fe,le,ue);he=e.detail,me.push(t),me.length>100&&me.shift()}catch{}})}function Te(){c("Attached%c PerformanceObserver%c to page",n.HIGHLIGHT,n.FOREGROUND);const e=new PerformanceObserver(pe);return e.observe({entryTypes:["mark"]}),ge=setInterval(()=>{if(me.length<10)return;if(he.hasTags&&he.len<25)return;me.sort();const e=Math.min(me.reduce((e,t)=>e+t,0)/me.length,me[Math.floor(me.length/2)]),n=t.round(e);n>Ee&&(Ee=n,g("performanceObserver"),s("Mean time:",t.round(me[Math.floor(me.length/2)])),s("Median time:",t.round(me.reduce((e,t)=>e+t,0)/me.length)),s("Average time:",n),s("Max time:",t.round(Math.max(...me)))),Ie(),e<=4||(clearInterval(ge),T(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${t.round(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${he.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{Ie(),clearInterval(ge),e.disconnect(),c("Detached%c PerformanceObserver",n.HIGHLIGHT)}}}const Oe=`* ${Array.from(e.IGNORE_TAGS).map(e=>`:not(${e})`).join("")}`,Re=e=>e.querySelectorAll(Oe);function He(o){performance.mark(le);const r=t.capitalizeFirstLetter(o),{logging:i}=P,{hasTags:a}=y,s=function(){const{hasOverflow:e,hasTags:t,overflowedNodeSet:n,taggedElements:o}=y;return t?o:e?Array.from(n):Re(document.documentElement)}(),{maxEl:d,maxVal:l}=function(t,n){const o=`margin-${n}`;let r,i=document.documentElement,a=y.hasTags?e.MIN_SIZE:document.documentElement.getBoundingClientRect().bottom;for(const e of t)r=e.getBoundingClientRect()[n]+parseFloat(getComputedStyle(e).getPropertyValue(o)),r>a&&(a=r,i=e);return{maxEl:i,maxVal:a}}(s,o);return c(`${r} position calculated from:`,d),c(`Checked %c${s.length}%c elements`,n.HIGHLIGHT,n.FOREGROUND),performance.mark(ue,{detail:{hasTags:a,len:s.length,logging:i,Side:r}}),l}const Se={label:e.HEIGHT,enabled:()=>P.calculateHeight,getOffset:()=>P.offsetHeight,auto:()=>de(Se),boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),documentElementScroll:()=>document.documentElement.scrollHeight,taggedElement:()=>He(e.HEIGHT_EDGE)},be={label:e.WIDTH,enabled:()=>P.calculateWidth,getOffset:()=>P.offsetWidth,auto:()=>de(be),boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),documentElementScroll:()=>document.documentElement.scrollWidth,taggedElement:()=>He(e.WIDTH_EDGE)};const ye=(t,n)=>(o,r)=>{const i=t[o]();return t.enabled()&&void 0!==P.onBeforeResize?function(t,n,o){const r=P.onBeforeResize(t,n,o);if(void 0===r)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(r))throw new TypeError(`Invalid value returned from onBeforeResize(): ${r}, expected Number`);if(r<e.MIN_SIZE)throw new RangeError(`Out of range value returned from onBeforeResize(): ${r}, must be at least ${e.MIN_SIZE}`);return r}(i,r,n):i},we=ye(Se,e.HEIGHT),ve=ye(be,e.WIDTH);function Ge(t,o,r,i){const{heightCalcMode:a,widthCalcMode:d}=P;0===window.scrollY&&0===window.scrollX||(c("Reset iframe scroll position to (0, 0)"),window.scrollTo(0,0));const l=r??we(a,t),u=i??ve(d,t),f=function(e,t){const{calculateHeight:n,calculateWidth:o}=P,{height:r,width:i}=y;return n&&re(r,e)||o&&re(i,t)}(l,u)?e.SIZE_CHANGE_DETECTED:t;switch(s(`Resize event: %c${o}`,n.HIGHLIGHT),f){case e.INIT:case e.ENABLE:case e.SIZE_CHANGE_DETECTED:case e.MANUAL_RESIZE_REQUEST:case e.PARENT_RESIZE_REQUEST:y.height=l,y.width=u;case e.SET_OFFSET_SIZE:return y;case e.OVERFLOW_OBSERVER:case e.MUTATION_OBSERVER:case e.RESIZE_OBSERVER:case e.VISIBILITY_OBSERVER:s(e.NO_CHANGE);break;default:c(e.NO_CHANGE)}return null}let Ne=!1,Ae=!1,Le=null;const Me=m(function(t,o,r,i,a){const{autoResize:l}=P,{isHidden:f}=y;switch(g(t),!0){case!0===f&&!(t in e.IGNORE_DISABLE_RESIZE):if(!0===Ae)break;s("Iframe hidden - Ignored resize request"),Ae=!0,Ne=!1,cancelAnimationFrame(Le),Le=null;break;case!0===Ne&&t!==e.OVERFLOW_OBSERVER&&!(t in e.IGNORE_DISABLE_RESIZE):s("Resize already pending - Ignored resize request");break;case!l&&!(t in e.IGNORE_DISABLE_RESIZE):c("Resizing disabled");break;default:{Ae=!1,Ne=!0,y.totalTime=performance.now(),y.timerActive=!0;const e=Ge(t,o,r,i);e&&K(e.height,e.width,t,a),Le||(Le=requestAnimationFrame(()=>{Ne=!1,Le=null,g("requestAnimationFrame"),d(`Reset sendPending: %c${t}`,n.HIGHLIGHT)})),y.timerActive=!1}}u()});function $e({eventType:e,eventName:t}){b(window,t,()=>Me(t,e),{passive:!0})}function ze(){$e({eventType:"After Print",eventName:"afterprint"}),$e({eventType:"Before Print",eventName:"beforeprint"})}function _e(e){const{heightCalcMode:t,widthCalcMode:o}=P,r=Se[t](),i=be[o]();s(`Reset trigger event: %c${e}`,n.HIGHLIGHT),X(r,i,e)}function ke(t){const o=P.heightCalcMode;s(`Reset trigger event: %c${t}`,n.HIGHLIGHT),P.heightCalcMode=e.HEIGHT_CALC_MODE_DEFAULT,y.triggerLocked?s("TriggerLock blocked calculation"):(y.triggerLocked=!0,d("Trigger event lock on"),requestAnimationFrame(()=>{y.triggerLocked=!1,d("Trigger event lock off")})),_e("reset"),P.heightCalcMode=o}const De=`Auto Resize can not be changed when <b>direction</> is set to '${e.NONE}'.`;function Ce(n){t.typeAssert(n,e.BOOLEAN,"parentIframe.autoResize(enable) enable");const{autoResize:o,calculateHeight:r,calculateWidth:i}=P;return!1===i&&!1===r?(g(e.ENABLE),T(De),!1):(!0===n&&!1===o?(P.autoResize=!0,queueMicrotask(()=>Me(e.ENABLE,"Auto Resize enabled"))):!1===n&&!0===o&&(P.autoResize=!1),X(0,0,e.AUTO_RESIZE,JSON.stringify(P.autoResize)),P.autoResize)}function Pe(n){t.typeAssert(n,e.STRING,"parentIframe.moveToAnchor(anchor) anchor"),y.inPageLinks.findTarget(n)}function Be(n){t.typeAssert(n,e.NUMBER,"parentIframe.setOffsetSize(offset) offset"),P.offsetHeight=n,P.offsetWidth=n,Me(e.SET_OFFSET_SIZE,`parentIframe.setOffsetSize(${n})`)}const Fe=()=>y.origin;function Ue(o){t.typeAssert(o,e.STRING,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),s(`Set targetOrigin: %c${o}`,n.HIGHLIGHT),P.targetOrigin=o}function xe(n){return t.typeAssert(n,e.FUNCTION,"parentIframe.getParentProps(callback) callback"),y.onParentInfo=n,X(0,0,e.PARENT_INFO),()=>{y.onParentInfo=null,X(0,0,e.PARENT_INFO_STOP)}}function Ve(n,o){void 0!==n&&t.typeAssert(n,e.NUMBER,"parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==o&&t.typeAssert(o,e.NUMBER,"parentIframe.resize(customHeight, customWidth) customWidth");const r=`${void 0===n?"":n}${void 0===o?"":`,${o}`}`;Me(e.MANUAL_RESIZE_REQUEST,`parentIframe.resize(${r})`,n,o)}const We=n=>(o,r)=>{t.typeAssert(o,e.NUMBER,`parentIframe.${n}(x, y) x`),t.typeAssert(r,e.NUMBER,`parentIframe.${n}(x, y) y`),X(r,o,n)},Ze=We(e.SCROLL_BY),qe=We(e.SCROLL_TO),je=We(e.SCROLL_TO_OFFSET);function Ye(n,o){o&&t.typeAssert(o,e.STRING,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),X(0,0,e.MESSAGE,JSON.stringify(n),o)}const Qe=()=>X(0,0,e.CLOSE),Je=()=>P.parentId,Ke=()=>ke("parentIframe.reset");const Xe=(t="")=>n=>o=>{o.size>0&&d(`${n}Observer ${t}:`,...Array.from(o).flatMap(t=>[e.NEW_LINE,t]))},et=Xe("attached to"),tt=((t="")=>n=>o=>{o.size>0&&f(`${n}Observer ${t}:`,...Array.from(o).flatMap(t=>[e.NEW_LINE,t]))})("already attached"),nt=Xe("detached from"),ot=(e,t=!0)=>o=>{o>0&&c(`${t?"At":"De"}tached %c${e}Observer%c ${t?"to":"from"} %c${o}%c element${1===o?"":"s"}`,n.HIGHLIGHT,n.NORMAL,n.HIGHLIGHT,n.NORMAL)},rt=(e,t,n,o)=>{const r=nt(e);return e=>{const i=new Set;let a=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),i.add(o),a+=1);r(i),o(a),i.clear()}},it="Mutation",at=new Set,st=new Set,ct=new Set,dt=[],lt={attributes:!0,attributeFilter:[e.IGNORE_ATTR,e.SIZE_ATTR],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let ut,ft=1,mt=!1,gt=0;const ht=Xe("added")(it),Et=Xe("removed (page)")(it),It=Xe("removed (added)")(it),pt=t=>t.nodeType!==Node.ELEMENT_NODE||e.IGNORE_TAGS.has(t.tagName.toLowerCase());function Tt(e){const t=e.addedNodes;for(const n of t)pt(n)||at.add(n)}function Ot(e){const t=e.removedNodes;for(const n of t)pt(n)||(at.has(n)?(at.delete(n),ct.add(n)):st.add(n))}const Rt=e=>{c("Mutations:",e);for(const t of e)Tt(t),Ot(t);ht(at),Et(st),It(ct),ct.clear()};const Ht=e=>()=>{const o=performance.now(),r=o-gt,i=16*ft+++2;if(r>i&&r<200)return g("mutationThrottled"),c("Update delayed due to heavy workload on the callStack"),c(`EventLoop busy time: %c${t.round(r)}ms %c> Max wait: %c${i-2}ms`,n.HIGHLIGHT,n.FOREGROUND,n.HIGHLIGHT),setTimeout(ut,16*ft),void(gt=o);ft=1,dt.forEach(Rt),dt.length=0,mt=!1,st.size>0&&s(`Detected %c${st.size} %cremoved element${st.size>1?"s":""}`,n.HIGHLIGHT,n.FOREGROUND),at.size>0&&s(`Found %c${at.size} %cnew element${at.size>1?"s":""}`,n.HIGHLIGHT,n.FOREGROUND),e({addedNodes:at,removedNodes:st}),at.clear(),st.clear()};function St(e){dt.push(e),mt||(gt=performance.now(),mt=!0,requestAnimationFrame(ut))}function bt(e){const t=new window.MutationObserver(St),o=document.body||document.documentElement;return ut=Ht(e),t.observe(o,lt),c("Attached%c MutationObserver%c to body",n.HIGHLIGHT,n.FOREGROUND),{disconnect:()=>{at.clear(),st.clear(),dt.length=0,t.disconnect(),c("Detached%c MutationObserver",n.HIGHLIGHT)}}}const yt={characterData:!0,childList:!0,subtree:!0};function wt(e){const t=document.querySelector("title")??document.head??document.documentElement,o=new MutationObserver(e);return o.observe(t,yt),c("Attached%c TitleObserver%c to head",n.HIGHLIGHT,n.FOREGROUND),setTimeout(e),{disconnect:()=>{o.disconnect(),c("Detached%c TitleObserver",n.HIGHLIGHT)}}}function vt(e){const t=new IntersectionObserver(t=>e(t.at(-1)?.isIntersecting??!1),{threshold:0}),o=document.documentElement;return t.observe(o),c("Attached%c VisibilityObserver%c to page",n.HIGHLIGHT,n.FOREGROUND),{disconnect:()=>{t.disconnect(),c("Detached%c VisibilityObserver",n.HIGHLIGHT)}}}let Gt=new Set;function Nt(){const t=function(t){const n=new Set,o=new Set;for(const r of t)r.closest(`[${e.IGNORE_ATTR}]`)?o.add(r):n.add(r);return o.size>0&&queueMicrotask(()=>{g("overflowIgnored"),c("Ignoring elements with [data-iframe-ignore] > *:\n",o),u()}),n}(document.querySelectorAll(`[${e.OVERFLOW_ATTR}]`));let n=!0;return typeof Set.prototype.symmetricDifference===e.FUNCTION&&(n=t.symmetricDifference(Gt).size>0),Gt=t,y.overflowedNodeSet=t,y.hasOverflow=t.size>0,{hasOverflowUpdated:n,overflowedNodeSet:t}}const At={},Lt=e=>{const t=new Set;for(const n of e)if(n instanceof Element){t.add(n);for(const e of Re(n))t.add(e)}return c("Inspecting:\n",t),t};function Mt({addedNodes:e,removedNodes:t}){g("contentMutated"),y.applySelectors(),j(),Nt(),u(),(e=>{if(0===e.size)return;g("removeObservers");const t=Lt(e);At.overflow.detachObservers(t),At.resize.detachObservers(t),u()})(t),(e=>{if(0===e.size)return;g("addObservers");const t=Lt(e);At.overflow.attachObservers(t),At.resize.attachObserverToNonStaticElements(t),u()})(e)}function $t(t){Mt(t),Me(e.MUTATION_OBSERVER,"Mutation Observed")}const zt="Overflow",_t=ot(zt),kt=ot(zt,!1),Dt=et(zt),Ct=tt(zt),Pt=t=>t instanceof HTMLElement&&(!!t.hidden||null===t.offsetParent||t.style.display===e.NONE);function Bt(){const{hasOverflow:t}=y,{hasOverflowUpdated:n,overflowedNodeSet:o}=Nt();switch(!0){case!n:return;case o.size>1:c("Overflowed Elements:",o);break;case t:break;default:c("No overflow detected")}Me(e.OVERFLOW_OBSERVER,"Overflow updated")}function Ft(o){const r={root:document.documentElement,side:P.calculateHeight?e.HEIGHT_EDGE:e.WIDTH_EDGE};return At.overflow=((o,r)=>{const i=r.side||e.HEIGHT_EDGE,a={root:r.root,rootMargin:"0px",threshold:1},s=window?.requestAnimationFrame||t.id,d=(e=!1)=>o(e),l=(e,t)=>0===e||e>t[i],u=(t,n)=>{t.toggleAttribute(e.OVERFLOW_ATTR,n)},f=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:n,target:o}=t;if(!n)continue;const r=e[i],a=l(r,n)&&!(o instanceof HTMLElement&&Pt(o));u(o,a)}s(d)},a),m=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r instanceof Element&&(m.has(r)?t.add(r):(f.observe(r),m.add(r),n.add(r),o+=1));Ct(t),Dt(n),_t(o),n.clear(),t.clear()},detachObservers:rt(zt,f,m,kt),disconnect:()=>{f.disconnect(),c("Detached%c OverflowObserver",n.HIGHLIGHT)}}})(Bt,r),At.overflow.attachObservers(o),At.overflow}const Ut="Resize",xt=ot(Ut),Vt=ot(Ut,!1),Wt=et(Ut),Zt=tt(Ut),qt=new WeakSet,jt=new Set,Yt=new Set;let Qt;function Jt(e){let t=0;for(const n of e){if(!(n instanceof Element))continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(qt.has(n)?jt.add(n):(Qt.observe(n),qt.add(n),Yt.add(n),t+=1))}Zt(jt),Wt(Yt),xt(t),Yt.clear(),jt.clear()}function Kt(n){if(!Array.isArray(n)||0===n.length)return;const o=n[0].target;Me(e.RESIZE_OBSERVER,`Element resized <${t.getElementName(o)}>`)}function Xt(e){return At.resize=(Qt=new ResizeObserver(Kt),Qt.observe(document.body),qt.add(document.body),c("Attached%c ResizeObserver%c to body",n.HIGHLIGHT,n.FOREGROUND),{attachObserverToNonStaticElements:Jt,detachObservers:rt(Ut,Qt,qt,Vt),disconnect:()=>{Qt.disconnect(),c("Detached%c ResizeObserver",n.HIGHLIGHT)}}),At.resize.attachObserverToNonStaticElements(e),At.resize}let en;function tn(){const t=document.title;t!==en&&(en=t,s(`Title: %c${t}`,n.HIGHLIGHT),t&&X(0,0,e.TITLE,t))}function nn(t){s(`Visible: %c${t}`,n.HIGHLIGHT),y.isHidden=!t,Me(e.VISIBILITY_OBSERVER,"Visibility changed")}function on(){g("attachObservers");const e=Re(document.documentElement);!function(e){R.push(...e.map(e=>e.disconnect))}([bt($t),Ft(e),Te(),Xt(e),wt(tn),vt(nn)])}const rn=(e,t,o)=>{if(""!==o){s(`${e}: %c${o}`,n.HIGHLIGHT);for(const e of document.querySelectorAll(o))s(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}};function an(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function sn(t,o){void 0!==o&&""!==o&&o!==e.NULL&&(document.body.style.setProperty(t,o),c(`Set body ${t}: %c${o}`,n.HIGHLIGHT))}function cn({bodyMarginStr:e,bodyMargin:t}){var n,o;void 0===e&&(e=`${t}px`),sn("margin",(n="margin",(o=e).includes("-")&&(I(`Negative CSS value ignored for ${n}`),o=""),o))}function dn(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:Math.round(t.left+n.x),y:Math.round(t.top+n.y)}}function ln(t){const o=t.split("#")[1]||t,r=decodeURIComponent(o),i=document.getElementById(r)||document.getElementsByName(r)[0];void 0===i?(s(`In page link (#${o}) not found in iframe, so sending to parent`),X(0,0,e.IN_PAGE_LINK,`#${o}`)):function(t,o){const r=dn(o);s(`Moving to in page link (%c#${t}%c) at x: %c${r.x}%c y: %c${r.y}`,n.HIGHLIGHT,n.FOREGROUND,n.HIGHLIGHT,n.FOREGROUND,n.HIGHLIGHT),X(r.y,r.x,e.SCROLL_TO_OFFSET)}(o,i)}function un(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&ln(t)}function fn(){s("Setting up location.hash handlers"),function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&b(e,"click",t=>{t.preventDefault(),ln(e.getAttribute("href"))})}(),b(window,"hashchange",un),setTimeout(un,e.EVENT_CANCEL_TIMER),y.inPageLinks={findTarget:ln}}function mn(){const t=t=>t.style.setProperty(e.HEIGHT,e.AUTO,"important");t(document.documentElement),t(document.body),s("Set HTML & body height: %cauto !important",n.HIGHLIGHT)}const gn=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},hn=gn(e.FUNCTION),En=gn(e.NUMBER),In=gn(e.STRING);function pn(n){s("Reading data from page:",Object.keys(n));const{offsetHeight:o,offsetWidth:r}=function(t){const{calculateHeight:n,calculateWidth:o}=P;let r,i;return typeof t?.offsetSize===e.NUMBER&&(n&&(r=En(t,e.OFFSET_SIZE)),o&&(i=En(t,e.OFFSET_SIZE))),{offsetHeight:r,offsetWidth:i}}(n);return{offsetHeight:o,offsetWidth:r,ignoreSelector:In(n,"ignoreSelector"),[t.getKey(3)]:In(n,t.getKey(0)),sizeSelector:In(n,"sizeSelector"),targetOrigin:In(n,"targetOrigin"),onBeforeResize:hn(n,"onBeforeResize"),onMessage:hn(n,"onMessage"),onReady:hn(n,"onReady")}}function Tn(){const{mode:n}=P;if(t.checkMode(n))return{};const o=window.iframeResizer||window.iFrameResizer;return null===(r=o)||typeof r!==e.OBJECT||Array.isArray(r)?{}:pn(o);var r}const On=e=>t=>void 0===t?void 0:e(t),Rn=On(e=>"true"===e),Hn=On(Number);function Sn(e){for(const[t,n]of Object.entries(e))void 0!==n&&(P[t]=n)}function bn({logExpand:t,logging:n,parentId:a=""}){var c;r=(c={id:a,enabled:n,expand:t}).id||e.LABEL,i.label(`${r}`),i.expand(c.expand),o=c.enabled,g("initReceived"),s(`Initialising iframe v${e.VERSION} ${window.location.href}`)}function yn(e){g("ready"),Z(t.once(e)),s("Initialization complete",(({key:e,key2:t,...n})=>n)(P))}function wn({bodyBackground:n,bodyPadding:o,inPageLinks:r,onReady:i}){const a=(({calculateWidth:e,calculateHeight:t})=>e===t)(P),c=[U,B,V,j,q,a?t.id:C,()=>cn(P),()=>sn("background",n),()=>sn("padding",o),a?t.id:mn,an,y.applySelectors,()=>function(e){const{mode:n}=P;e?t.checkMode(n)?T(t.getModeData(5)):fn():s("In page linking not enabled")}(r),ze,()=>function({mouseEvents:t}){!0===t&&(te(e.MOUSE_ENTER,"Mouse Enter"),te(e.MOUSE_LEAVE,"Mouse Leave"))}(P),oe,()=>function(){const{win:e}=y;1!==P.mode&&(e.parentIframe=Object.freeze({autoResize:Ce,close:Qe,getId:Je,getParentOrigin:Fe,getParentProps:xe,moveToAnchor:Pe,reset:Ke,setOffsetSize:Be,scrollBy:Ze,scrollTo:qe,scrollToOffset:je,sendMessage:Ye,setTargetOrigin:Ue,resize:Ve}))}(),()=>Me(e.INIT,"Init message from host page",void 0,void 0,`${e.VERSION}:${P.mode}`),on,u];Y(P),function({key:e,key2:n,mode:o,version:r}){const i=o,a=t.isDef(e)?t.setMode({key:e}):-1,s=t.isDef(n)?t.setMode({key:n}):-1;let c;switch(o=Math.max(a,s)){case-2:case-1:c=`${t.getModeData(Math.min(a,s)+2)}${t.getModeData(2)}`,y.firstRun=!1;break;case 1:case 2:case 3:c=t.getModeData(6);break;case 4:c=t.getModeData(7);break;case 5:c=t.getModeData(8)}if(o>=0&&x(o,i,r),(!t.isDef(r)||!y.firstRun)&&(c&&T(c),o<0))throw T(t.getModeData(9)),c.split("<br>")[0].replace(/<\/?[a-z][^>]*>|<\/>/gi,"");P.mode=o}(P),function(e){const{mode:t}=P;e.forEach(e=>{try{e()}catch(n){if(t<0)throw n;T("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),f(n)}})}(c),yn(i)}function vn(t){y.firstRun&&(Sn((e=>({parentId:e[0],bodyMargin:Hn(e[1]),calculateWidth:Rn(e[2]),logging:Rn(e[3]),autoResize:Rn(e[6]),bodyMarginStr:e[7],bodyBackground:e[9],bodyPadding:e[10],tolerance:Hn(e[11]),inPageLinks:Rn(e[12]),mouseEvents:Rn(e[15]),offsetHeight:Hn(e[16]),offsetWidth:Hn(e[17]),calculateHeight:Rn(e[18]),key:e[19],version:e[20],mode:Hn(e[21]),logExpand:Rn(e[23])}))(t)),bn(P),Sn(Tn()),y.applySelectors=function({sizeSelector:t,ignoreSelector:n}){return()=>{rn("sizeSelector",e.SIZE_ATTR,t),rn("ignoreSelector",e.IGNORE_ATTR,n)}}(P),wn(P))}const{freeze:Gn}=Object,{parse:Nn}=JSON,An=e=>Gn(Nn(e)),Ln=e=>X(0,0,`${e}Stop`),Mn=t=>t.data.slice(t.data.indexOf(e.SEPARATOR)+1),$n=t=>(t=>t.data.split(e.SEPARATOR)[2]in{true:1,false:1})(t)?e.INIT:t.data.split("]")[1].split(e.SEPARATOR)[0];const zn=e=>y.inPageLinks.findTarget(Mn(e)),_n={init:function(t){if("loading"===document.readyState)return void s("Page not ready, ignoring init message");const n=t.data.slice(e.MESSAGE_ID_LENGTH).split(e.SEPARATOR);y.target=t.source,y.origin=t.origin,vn(n),y.firstRun=!1,setTimeout(()=>{y.initLock=!1},e.EVENT_CANCEL_TIMER)},reset:function(){y.initLock?s("Page reset ignored by init"):(s("Page size reset by host page"),_e("resetPage"))},resize:function(){s("Resize requested by host page"),Me(e.PARENT_RESIZE_REQUEST,"Parent window requested size check")},moveToAnchor:zn,inPageLink:zn,pageInfo:function(n){const{onPageInfo:o}=y,r=Mn(n);s("PageInfo received from parent:",An(r)),o?t.isolateUserCode(o,Nn(r)):Ln(e.PAGE_INFO)},parentInfo:function(n){const{onParentInfo:o}=y,r=An(Mn(n));s("ParentInfo received from parent:",r),o?t.isolateUserCode(o,r):Ln(e.PARENT_INFO)},message:function(e){const o=Mn(e);s("onMessage called from parent:%c",n.HIGHLIGHT,An(o)),t.isolateUserCode(P.onMessage,Nn(o))}};function kn(e){const{firstRun:t}=y,n=$n(e);switch(g(n),!0){case n in _n:_n[n](e);break;case t&&(N in window||void 0!==window.jQuery&&N in window.jQuery.prototype):I(`Ignored message of type "${n}". Received before initialization.`);break;default:I(`Unexpected message (${e.data}), this is likely due to a newer version of iframe-resizer running on the parent page.`)}}const Dn=m(t=>{(t=>e.MESSAGE_ID===`${t.data}`.slice(0,e.MESSAGE_ID_LENGTH))(t)&&kn(t)});typeof window!==e.UNDEFINED&&function(){if("iframeChildListener"in window)I("Already setup");else{window.iframeChildListener=e=>{setTimeout(()=>Dn({data:e,sameOrigin:!0}))},g("listen"),b(window,e.MESSAGE,Dn),b(document,e.READY_STATE_CHANGE,G),G();try{top?.document?.getElementById("banner")&&(y.win={},window.mockMsgListener=t,S(window,e.MESSAGE,Dn),"function"==typeof window.define&&window.define([],()=>t))}catch(n){}}function t(e){return Dn(e),y.win}}()});
|
|
20
|
+
!function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";const e="6.0.0-beta.9",t="iframeResizer",n=":",o="init",r="message",i="pageHide",a="parentInfo",s="scrollToOffset",c="data-iframe-size",l="data-iframe-overflowed",d="data-iframe-ignore",u="height",f="width",m="offsetSize",p="string",h="number",g="function",y="auto",v="readystatechange",z="bottom",b="right",w="autoResizeEnabled",$=Symbol("sizeChanged"),k="manualResize",S="parentResize",j={[k]:1,[S]:1},O="setOffsetSize",M="resizeObserver",E="overflowObserver",R="mutationObserver",T="visibilityObserver",A="none",I="No change in content size detected",P="[iFrameSizer]",x=y,C=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),N=(e,...t)=>setTimeout(()=>e(...t),0),L=e=>{let t=!1;return function(...n){return t?void 0:(t=!0,e.apply(this,n))}},B=e=>e,W=e=>Math.round(1e3*e)/1e3,q=e=>e.charAt(0).toUpperCase()+e.slice(1),H=e=>""!=`${e}`&&void 0!==e,F=e=>e();const D=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${q(t)}`)},V={br:"\n",rb:"[31;1m",bb:"[34;1m",b:"[1m",i:"[3m",u:"[4m","/":"[m"},U=Object.keys(V),Z=new RegExp(`<(${U.join("|")})>`,"gi"),J=(e,t)=>V[t]??"",Q=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},G=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),Y=new Date,_=e=>new Set(Array.from({length:9},e)),X=" - lewpylk",K=["spjluzl","rlf","clyzpvu","rlf2","nlaMbssFlhy"],ee=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>. Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt.","Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz.","<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>Fvb hyl jbyyluasf bzpun h spjluzl rlf mvy aol wylcpvbz clyzpvu vm <p>pmyhtl-ylzpgly</>.</><iy><iy>Av bwnyhkl av <i>Clyzpvu 6</> fvb jhu bzl aol <i>mpyza 11 johyhjalyz vm fvb spjluzl rlf</> av nla h 60% kpzjvbua ha oaawz://pmyhtl-ylzpgly.jvt/wypjpun.","<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>Fvb hyl jbyyluasf bzpun h spjluzl rlf mvy aol wylcpvbz clyzpvu vm <p>pmyhtl-ylzpgly</>.<iy><iy>Av bwnyhkl av <i>Clyzpvu 6</> vm <p>pmyhtl-ylzpgly</> wslhzl kvdusvhk aol shalza rlf myvt oaawz://pmyhtl-ylzpgly.jvt/tf-vyklyz.","<yi> VLT rlf lewpylk</><iy><iy>Aol spjluzl rlf fvb hyl bzpun mvy <p>pmyhtl-ylzpgly</> pz myvt h wypvy flhy huk ohz lewpylk. Hu bwkhalk rlf pz ylslhzlk vu aol mpyza vm Uvcltily lhjo flhy.<iy><iy>Wslhzl kvdusvhk aol shalza rlf myvt oaawz://pmyhtl-ylzpgly.jvt/tf-vyklyz.","<yi>Bzl dpao slnhjf jspluaz</><iy><iy>Dolu bzpun <p>pmyhtl-ylzpgly</> jopsk whjrhnl dpao hu vskly clyzpvu vm aol whylua, fvb jhu zla aol spjluzl rlf pu aol pmyhtl. Mvy klahpsz vu ovd av zla aopz bw, wslhzl zll aol kvjbtluahapvu ha:<iy><iy>oaawz://pmyhtl-ylzpgly.jvt/zlabw/jopsk/#spjluzl"],te=[(se=["NWSc3","zvsv","wyv","ibzpulzz","VLT"])[0],...se.slice(1).map(e=>`${e}${X}`),`${se[4]}${X}`,...se.slice(1)],ne=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5","1foobarqaz","2b5sdlfhbev","zo4ui3arjo","oclbb4thgl","igb1wzrjqr"].map((e,t)=>[e,Math.max(0,t-1)])),oe=new Set([1,6]),re=Y[G(K[4])](),ie=_((e,t)=>Q(`${re+t}`)),ae=_((e,t)=>Q(""+(re-++t)));var se;const ce=e=>oe.has(e),le=e=>G(ee[e]),de=e=>G(K[e]),ue=e=>{const t=e[G(K[0])]||e[G(K[1])]||e[G(K[2])]||e[G(K[3])];if(!t)return-1;const n=t.split("-");let o=function(e="",t=""){let n=-2;const o=Q(G(e));return o in ne&&(n=ne[o]),9===n?(r=t,ie.has(r)?9:ae.has(r)?5:-2):n;var r}(...n);return 0===o||(r=n)[2]===Q(r[0]+r[1])||(o=-2),o;var r},fe="font-weight: normal;",me="font-weight: bold;",pe="font-style: italic;",he=fe+pe,ge="default",ye=Object.freeze({assert:!0,error:!0,warn:!0}),ve={expand:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},ze={profile:0,profileEnd:0,timeStamp:0,trace:0},be=Object.assign(console);const{fromEntries:we,keys:$e}=Object,ke=e=>[e,be[e]],Se=e=>t=>[t,function(n){e[t]=n}],je=(e,t)=>we($e(e).map(t));const Oe=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,Me=Oe?"color: #A9C7FB;":"color: #135CD2;",Ee=Oe?"color: #E3E3E3;":"color: #1F1F1F;";let Re=!0,Te=t;var Ae;const Ie=(Ae=function(e={}){const t={},n={},o=[],r={...ve,expand:!e.collapsed||ve.expanded,...e};let i="";function a(){o.length=0,i=""}function s(){delete r.event,a()}const c=()=>!!o.some(([e])=>e in ye)||!!r.expand;function l(){if(0!==o.length){be[c()?"group":"groupCollapsed"](`%c${r.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(r)} %c${r.showTime?i:""}`,fe,me,he);for(const[e,...t]of o)be.assert(e in be,`Unknown console method: ${e}`),e in be&&be[e](...t);be.groupEnd(),s()}else s()}function d(){""===i&&(i=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}(),queueMicrotask(()=>queueMicrotask(l)))}function u(e,...t){0===o.length&&d(),o.push([e,...t])}function f(e=ge,...n){t[e]?u("log",`${e}: ${performance.now()-t[e]} ms`,...n):u("timeLog",e,...n)}return{...je(r,Se(r)),...je(console,e=>[e,(...t)=>u(e,...t)]),...je(ze,ke),assert:function(e,...t){!0!==e&&u("assert",e,...t)},count:function(e=ge){n[e]?n[e]+=1:n[e]=1,u("log",`${e}: ${n[e]}`)},countReset:function(e=ge){delete n[e]},endAutoGroup:l,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(o){if(!Error.prototype.isPrototypeOf(o))throw o;u("error",o),l()}return n},event:function(e){d(),r.event=e},purge:a,time:function(e=ge){d(),t[e]=performance.now()},timeEnd:function(e=ge){f(e),delete t[e]},timeLog:f,touch:d}},Ae?.__esModule?Ae.default:Ae)({label:`${t}(child)`,expand:!1});const Pe=e=>(...t)=>!Re||Ie[e](...t),xe=Pe("log"),Ce=xe,Ne=Pe("debug");const{assert:Le,endAutoGroup:Be,error:We,errorBoundary:qe,event:He,label:Fe,purge:De,warn:Ve}=Ie,Ue=(Ze=B,e=>Ze("string"==typeof e?window.chrome?e.replace(Z,J):(e=>e.replaceAll("<br>","\n").replaceAll(/<\/?[^>]+>/gi,""))(e):e));var Ze;const Je=(...e)=>Ie.warn(...e.map(Ue)),Qe=[];function Ge(e,t){xe(`${e} event listener: %c${t}`,Me)}const Ye=(e,t,n,o)=>{e.removeEventListener(t,n,o),Ge("Removed",t)},_e=(e,t,n,o=!1)=>{e.addEventListener(t,n,o),Qe.push(()=>Ye(e,t,n,o)),Ge("Added",t)},Xe={applySelectors:null,firstRun:!0,hasTags:!1,hasOverflow:!1,height:0,isHidden:!1,initLock:!0,inPageLinks:{},origin:void 0,hasOverflowUpdated:!0,overflowedNodeSet:new Set,sameOrigin:!1,taggedElements:[],target:window?.parent,timerActive:!1,totalTime:0,triggerLocked:!1,width:0,win:window,onPageInfo:null,onParentInfo:null};let Ke=!1;function et(e){const t=window?.iframeResizer?.targetOrigin||"*",n=Array.isArray(t)?t:[t];for(const o of n)e.postMessage("[iFrameResizerChild]Ready",o)}function tt(){if("loading"===document.readyState||!Xe.firstRun||Ke)return;const{parent:e,top:t}=window;He("ready"),xe("Sending%c ready%c to parent from",Me,Ee,window.location.href),et(e),e!==t&&et(t),Ke=!0}const nt="iframeResize",ot=["min-height","min-width","max-height","max-width"],rt=new Set,it=e=>e.tagName?e.tagName.toLowerCase():"unknown",at=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),st=(e,t)=>{return!!(n=at(e,t))&&"0px"!==n&&n!==y&&n!==A;var n};function ct({href:e}){rt.has(e)||(xe("Unable to access stylesheet:",e),rt.add(e))}const lt=(e,t)=>function(e,t){const n=e.style.getPropertyValue(t);return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const o of document.styleSheets)try{for(const n of o.cssRules||[]){if(!("selectorText"in n))continue;const r=n;if(!e.matches(r.selectorText))continue;const i=r.style.getPropertyValue(t);if(!i)continue;const{ownerNode:a}=o;return{source:a instanceof Element&&"STYLE"===a.tagName?"an inline <style> block":`stylesheet (${o.href})`,value:i}}}catch(n){ct(o)}return{source:"cross-origin stylesheet",value:at(e,t)}}(e,t),dt=(e,t)=>{const{source:n,value:o}=lt(e,t),r=it(e);Je(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function ut(){for(const e of[document.documentElement,document.body])for(const t of ot)xe(`Checking <${it(e)}> for blocking CSS: ${t}`),st(e,t)&&dt(e,t)}const ft={autoResize:!0,bodyBackground:"",bodyMargin:0,bodyMarginStr:"",bodyPadding:"",calculateHeight:!0,calculateWidth:!1,heightCalcMode:y,ignoreSelector:"",inPageLinks:!1,logging:!1,logExpand:!1,mode:0,mouseEvents:!1,offsetHeight:0,offsetWidth:0,parentId:void 0,sizeSelector:"",targetOrigin:"*",tolerance:0,widthCalcMode:y,onBeforeResize:void 0,onMessage:()=>{Ve("onMessage function not defined")},onReady:()=>{}};function mt(){try{Xe.sameOrigin=1===ft.mode||"iframeParentListener"in window.parent}catch(e){xe("Cross domain iframe detected")}}let pt=0;function ht(){const e=document.querySelectorAll(`*[${d}]`),t=e.length>0;return t&&e.length!==pt&&(!function(e){const t=1===e.length?"":"s";Ve(`%c[${d}]%c found on %c${e.length}%c element${t}`,me,fe,me,fe)}(e),pt=e.length),t}function gt(t,n,o){var r;(!H(o)||n>-1&&t>n)&&(function(e,t){console.info(`%ciframe-resizer ${e}`,Re||t<1?"font-weight: bold;":fe)}(`v${e} (${r=t,G(te[r])})`,t),0===t&&((...e)=>{console.warn(...e.map(Ue))})(le(3)))}function yt(){"BackCompat"===document.compatMode&&Je("<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n")}let vt=!1;function zt(e){"complete"===document.readyState?N(e):vt||_e(document,v,()=>zt(e)),vt=!0}const bt=()=>{Ce(`Set targetOrigin for parent: %c${ft.targetOrigin}`,Me),!0!==ft.autoResize&&xe("Auto Resize disabled")};function wt(){Xe.taggedElements=document.querySelectorAll(`[${c}]`),Xe.hasTags=Xe.taggedElements.length>0,xe(`Tagged elements found: %c${Xe.hasTags}`,Me)}function $t({version:t}){t&&""!==t&&"false"!==t?t!==e&&Je((t=>`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${t} - Child page: ${e}.\n`)(t)):Je("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n")}const kt=L(()=>Je(le(4)));function St(e,t){const{mode:n}=ft,{sameOrigin:o,target:r}=Xe;if(o)try{window.parent.iframeParentListener(P+e)}catch(i){if(!ce(n))throw new Error(i);return kt(),!1}else{Le(r,"Internal error: postMessage target is undefined");const n=function(e){return void 0===e?e=ft.targetOrigin:xe(`Message targetOrigin: %c${e}`,Me),e}(t),o=Array.isArray(n)?n:[n];for(const t of o)r.postMessage(P+e,t)}return!0}function jt(e,t,n,r,i){const{parentId:a}=ft,{sameOrigin:s}=Xe,c=`${a}:${`${e}:${t}`}:${n}${void 0===r?"":`:${r}`}`;if(ft.mode<-1)return;St(c,i)&&(!function(e){if(!Xe.timerActive)return;const t=W(performance.now()-Xe.totalTime);xe(e===o?`Initialised iframe in %c${t}ms`:`Size calculated in %c${t}ms`,Me)}(n),Ce(`Sending message to parent page via ${s?"sameOrigin":"postMessage"}: %c%c${c}`,pe,Me))}const Ot=qe((e,t,n,o,r)=>{He(n),jt(e,t,n,o,r),Be()}),Mt=e=>Ot(0,0,e.type,`${e.screenY}:${e.screenX}`);function Et(e,t){xe(`Add event listener: %c${t}`,Me),_e(window.document,e,Mt)}function Rt({persisted:e}){e||Ot(0,0,"beforeUnload"),He(i),Ce("Page persisted:",e),e||Qe.forEach(F)}const Tt=()=>_e(window,i.toLowerCase(),Rt),At=(e,t)=>!(Math.abs(e-t)<=ft.tolerance);const It=[Me,Ee,Me],Pt={height:0,width:0},xt={height:0,width:0};function Ct(e,t,n){return xt[e]=t,Pt[e]=n,t}function Nt(e){const{hasOverflow:t,hasTags:n,triggerLocked:o}=Xe,r=e.label,i=r===u,a=e.boundingClientRect(),s=Math.ceil(a),c=Math.floor(a),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),d=`HTML: %c${a}px %cPage: %c${l}px`;let f;switch(!0){case!e.enabled():return Math.max(l,1);case n:Ce("Found element with data-iframe-size attribute"),f=e.taggedElement();break;case!t&&Xe.firstRun&&0===xt[r]&&0===Pt[r]:Ce(`Initial page size values: ${d}`,...It),f=Ct(r,a,l);break;case o&&a===xt[r]&&l===Pt[r]:Ce(`Size unchanged: ${d}`,...It),f=Math.max(a,l);break;case 0===a&&0!==l:Ce(`Page is hidden: ${d}`,...It),f=l;break;case!t&&a!==xt[r]&&l<=Pt[r]:Ce(`New <html> size: ${d} `,...It),Ce(`Previous <html> size: %c${xt[r]}px`,Me),f=Ct(r,a,l);break;case!i:f=e.taggedElement();break;case!t&&a<xt[r]:Ce(`<html> size decreased: ${d}`,...It),f=Ct(r,a,l);break;case l===c||l===s:Ce(`<html> size equals page size: ${d}`,...It),f=Ct(r,a,l);break;case a>l:Ce(`Page size < <html> size: ${d}`,...It),f=Ct(r,a,l);break;case t:Ce("Found elements possibly overflowing <html> "),f=e.taggedElement();break;default:Ce(`Using <html> size: ${d}`,...It),f=Ct(r,a,l)}return Ce(`Content ${r}: %c${f}px`,Me),f+=function(e){const t=e.getOffset();return 0!==t&&Ce(`Page offsetSize: %c${t}px`,Me),t}(e),Math.max(f,1)}const Lt="--ifr-start",Bt="--ifr-end",Wt="--ifr-measure",qt=[];let Ht,Ft={},Dt=0;function Vt(){try{performance.clearMarks(Lt),performance.clearMarks(Bt),performance.clearMeasures(Wt)}catch{}}function Ut(e){e.getEntries().forEach(e=>{if(e.name===Bt)try{const{duration:t}=performance.measure(Wt,Lt,Bt);Ft=e.detail,qt.push(t),qt.length>100&&qt.shift()}catch{}})}function Zt(){Ce("Attached%c PerformanceObserver%c to page",Me,Ee);const e=new PerformanceObserver(Ut);return e.observe({entryTypes:["mark"]}),Ht=setInterval(()=>{if(qt.length<10)return;if(Ft.hasTags&&Ft.len<25)return;qt.sort();const e=Math.min(qt.reduce((e,t)=>e+t,0)/qt.length,qt[Math.floor(qt.length/2)]),t=W(e);t>Dt&&(Dt=t,He("performanceObserver"),xe("Mean time:",W(qt[Math.floor(qt.length/2)])),xe("Median time:",W(qt.reduce((e,t)=>e+t,0)/qt.length)),xe("Average time:",t),xe("Max time:",W(Math.max(...qt)))),Vt(),e<=4||(clearInterval(Ht),Je(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${W(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${Ft.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{Vt(),clearInterval(Ht),e.disconnect(),Ce("Detached%c PerformanceObserver",Me)}}}const Jt=`* ${Array.from(C).map(e=>`:not(${e})`).join("")}`,Qt=e=>e.querySelectorAll(Jt);function Gt(e){performance.mark(Lt);const t=q(e),{logging:n}=ft,{hasTags:o}=Xe,r=function(){const{hasOverflow:e,hasTags:t,overflowedNodeSet:n,taggedElements:o}=Xe;return t?o:e?Array.from(n):Qt(document.documentElement)}(),{maxEl:i,maxVal:a}=function(e,t){const n=`margin-${t}`;let o,r=document.documentElement,i=Xe.hasTags?1:document.documentElement.getBoundingClientRect().bottom;for(const a of e)o=a.getBoundingClientRect()[t]+parseFloat(getComputedStyle(a).getPropertyValue(n)),o>i&&(i=o,r=a);return{maxEl:r,maxVal:i}}(r,e);return Ce(`${t} position calculated from:`,i),Ce(`Checked %c${r.length}%c elements`,Me,Ee),performance.mark(Bt,{detail:{hasTags:o,len:r.length,logging:n,Side:t}}),a}const Yt={label:u,enabled:()=>ft.calculateHeight,getOffset:()=>ft.offsetHeight,auto:()=>Nt(Yt),boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),documentElementScroll:()=>document.documentElement.scrollHeight,taggedElement:()=>Gt(z)},_t={label:f,enabled:()=>ft.calculateWidth,getOffset:()=>ft.offsetWidth,auto:()=>Nt(_t),boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),documentElementScroll:()=>document.documentElement.scrollWidth,taggedElement:()=>Gt(b)};const Xt=(e,t)=>(n,o)=>{const r=e[n]();return e.enabled()&&void 0!==ft.onBeforeResize?function(e,t,n){const o=ft.onBeforeResize(e,t,n);if(void 0===o)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(o))throw new TypeError(`Invalid value returned from onBeforeResize(): ${o}, expected Number`);if(o<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${o}, must be at least 1`);return o}(r,o,t):r},Kt=Xt(Yt,u),en=Xt(_t,f);function tn(e,t,n,r){const{heightCalcMode:i,widthCalcMode:a}=ft;0===window.scrollY&&0===window.scrollX||(Ce("Reset iframe scroll position to (0, 0)"),window.scrollTo(0,0));const s=n??Kt(i,e),c=r??en(a,e),l=function(e,t){const{calculateHeight:n,calculateWidth:o}=ft,{height:r,width:i}=Xe;return n&&At(r,e)||o&&At(i,t)}(s,c)?$:e;switch(xe(`Resize event: %c${t}`,Me),l){case o:case w:case $:case k:case S:Xe.height=s,Xe.width=c;case O:return Xe;case E:case R:case M:case T:xe(I),De();break;default:De(),Ce(I)}return null}let nn=!1,on=!1,rn=null;const an=qe(function(e,t,n,o,r){const{autoResize:i}=ft,{isHidden:a}=Xe;switch(He(e),!0){case!0===a&&!(e in j):if(!0===on)break;xe("Iframe hidden - Ignored resize request"),on=!0,nn=!1,cancelAnimationFrame(rn),rn=null;break;case!0===nn&&e!==E&&!(e in j):De(),xe("Resize already pending - Ignored resize request");break;case!i&&!(e in j):Ce("Resizing disabled");break;default:{on=!1,nn=!0,Xe.totalTime=performance.now(),Xe.timerActive=!0;const i=tn(e,t,n,o);i&&jt(i.height,i.width,e,r),rn||(rn=requestAnimationFrame(()=>{nn=!1,rn=null,He("requestAnimationFrame"),Ne(`Reset sendPending: %c${e}`,Me)})),Xe.timerActive=!1}}Be()});function sn({eventType:e,eventName:t}){_e(window,t,()=>an(t,e),{passive:!0})}function cn(){sn({eventType:"After Print",eventName:"afterprint"}),sn({eventType:"Before Print",eventName:"beforeprint"})}function ln(e){const{heightCalcMode:t,widthCalcMode:n}=ft,o=Yt[t](),r=_t[n]();xe(`Reset trigger event: %c${e}`,Me),Ot(o,r,e)}function dn(e){const t=ft.heightCalcMode;xe(`Reset trigger event: %c${e}`,Me),ft.heightCalcMode=x,Xe.triggerLocked?xe("TriggerLock blocked calculation"):(Xe.triggerLocked=!0,Ne("Trigger event lock on"),requestAnimationFrame(()=>{Xe.triggerLocked=!1,Ne("Trigger event lock off")})),ln("reset"),ft.heightCalcMode=t}const un=`Auto Resize can not be changed when <b>direction</> is set to '${A}'.`;function fn(e){D(e,"boolean","parentIframe.autoResize(enable) enable");const{autoResize:t,calculateHeight:n,calculateWidth:o}=ft;return!1===o&&!1===n?(He(w),Je(un),!1):(!0===e&&!1===t?(ft.autoResize=!0,queueMicrotask(()=>an(w,"Auto Resize enabled"))):!1===e&&!0===t&&(ft.autoResize=!1),Ot(0,0,"autoResize",JSON.stringify(ft.autoResize)),ft.autoResize)}function mn(e){D(e,p,"parentIframe.moveToAnchor(anchor) anchor"),Xe.inPageLinks.findTarget(e)}function pn(e){D(e,h,"parentIframe.setOffsetSize(offset) offset"),ft.offsetHeight=e,ft.offsetWidth=e,an(O,`parentIframe.setOffsetSize(${e})`)}const hn=()=>Xe.origin;function gn(e){D(e,p,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),xe(`Set targetOrigin: %c${e}`,Me),ft.targetOrigin=e}function yn(e){return D(e,g,"parentIframe.getParentProps(callback) callback"),Xe.onParentInfo=e,Ot(0,0,a),()=>{Xe.onParentInfo=null,Ot(0,0,"parentInfoStop")}}function vn(e,t){void 0!==e&&D(e,h,"parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&D(t,h,"parentIframe.resize(customHeight, customWidth) customWidth");an(k,`parentIframe.resize(${`${void 0===e?"":e}${void 0===t?"":`,${t}`}`})`,e,t)}const zn=e=>(t,n)=>{D(t,h,`parentIframe.${e}(x, y) x`),D(n,h,`parentIframe.${e}(x, y) y`),Ot(n,t,e)},bn=zn("scrollBy"),wn=zn("scrollTo"),$n=zn(s);function kn(e,t){t&&D(t,p,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Ot(0,0,r,JSON.stringify(e),t)}const Sn=()=>Ot(0,0,"close"),jn=()=>ft.parentId,On=()=>dn("parentIframe.reset");const Mn=(e="")=>t=>n=>{n.size>0&&Ne(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))},En=Mn("attached to"),Rn=((e="")=>t=>n=>{n.size>0&&We(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Tn=Mn("detached from"),An=(e,t=!0)=>n=>{n>0&&Ce(`${t?"At":"De"}tached %c${e}Observer%c ${t?"to":"from"} %c${n}%c element${1===n?"":"s"}`,Me,fe,Me,fe)},In=(e,t,n,o)=>{const r=Tn(e);return e=>{const i=new Set;let a=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),i.add(o),a+=1);r(i),o(a),i.clear()}},Pn="Mutation",xn=new Set,Cn=new Set,Nn=new Set,Ln=[],Bn={attributes:!0,attributeFilter:[d,c],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Wn,qn=1,Hn=!1,Fn=0;const Dn=Mn("added")(Pn),Vn=Mn("removed (page)")(Pn),Un=Mn("removed (added)")(Pn),Zn=e=>e.nodeType!==Node.ELEMENT_NODE||C.has(e.tagName.toLowerCase());function Jn(e){const t=e.addedNodes;for(const n of t)Zn(n)||xn.add(n)}function Qn(e){const t=e.removedNodes;for(const n of t)Zn(n)||(xn.has(n)?(xn.delete(n),Nn.add(n)):Cn.add(n))}const Gn=e=>{Ce("Mutations:",e);for(const t of e)Jn(t),Qn(t);Dn(xn),Vn(Cn),Un(Nn),Nn.clear()};const Yn=e=>()=>{const t=performance.now(),n=t-Fn,o=16*qn+++2;if(n>o&&n<200)return He("mutationThrottled"),Ce("Update delayed due to heavy workload on the callStack"),Ce(`EventLoop busy time: %c${W(n)}ms %c> Max wait: %c${o-2}ms`,Me,Ee,Me),setTimeout(Wn,16*qn),void(Fn=t);qn=1,Ln.forEach(Gn),Ln.length=0,Hn=!1,Cn.size>0&&xe(`Detected %c${Cn.size} %cremoved element${Cn.size>1?"s":""}`,Me,Ee),xn.size>0&&xe(`Found %c${xn.size} %cnew element${xn.size>1?"s":""}`,Me,Ee),e({addedNodes:xn,removedNodes:Cn}),xn.clear(),Cn.clear()};function _n(e){Ln.push(e),Hn||(Fn=performance.now(),Hn=!0,requestAnimationFrame(Wn))}function Xn(e){const t=new window.MutationObserver(_n),n=document.body||document.documentElement;return Wn=Yn(e),t.observe(n,Bn),Ce("Attached%c MutationObserver%c to body",Me,Ee),{disconnect:()=>{xn.clear(),Cn.clear(),Ln.length=0,t.disconnect(),Ce("Detached%c MutationObserver",Me)}}}const Kn={characterData:!0,childList:!0,subtree:!0};function eo(e){const t=document.querySelector("title")??document.head??document.documentElement,n=new MutationObserver(e);return n.observe(t,Kn),Ce("Attached%c TitleObserver%c to head",Me,Ee),setTimeout(e),{disconnect:()=>{n.disconnect(),Ce("Detached%c TitleObserver",Me)}}}function to(e){const t=new IntersectionObserver(t=>e(t.at(-1)?.isIntersecting??!1),{threshold:0}),n=document.documentElement;return t.observe(n),Ce("Attached%c VisibilityObserver%c to page",Me,Ee),{disconnect:()=>{t.disconnect(),Ce("Detached%c VisibilityObserver",Me)}}}let no=new Set;function oo(){const e=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${d}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{He("overflowIgnored"),Ce("Ignoring elements with [data-iframe-ignore] > *:\n",n),Be()}),t}(document.querySelectorAll(`[${l}]`));let t=!0;return typeof Set.prototype.symmetricDifference===g&&(t=e.symmetricDifference(no).size>0),no=e,Xe.overflowedNodeSet=e,Xe.hasOverflow=e.size>0,{hasOverflowUpdated:t,overflowedNodeSet:e}}const ro={},io=e=>{const t=new Set;for(const n of e)if(n instanceof Element){t.add(n);for(const e of Qt(n))t.add(e)}return Ce("Inspecting:\n",t),t};function ao({addedNodes:e,removedNodes:t}){He("contentMutated"),Xe.applySelectors(),wt(),oo(),Be(),(e=>{if(0===e.size)return;He("removeObservers");const t=io(e);ro.overflow.detachObservers(t),ro.resize.detachObservers(t),Be()})(t),(e=>{if(0===e.size)return;He("addObservers");const t=io(e);ro.overflow.attachObservers(t),ro.resize.attachObserverToNonStaticElements(t),Be()})(e)}function so(e){ao(e),an(R,"Mutation Observed")}const co="Overflow",lo=An(co),uo=An(co,!1),fo=En(co),mo=Rn(co),po=e=>e instanceof HTMLElement&&(!!e.hidden||null===e.offsetParent||e.style.display===A);function ho(){const{hasOverflow:e}=Xe,{hasOverflowUpdated:t,overflowedNodeSet:n}=oo();switch(!0){case!t:return;case n.size>1:Ce("Overflowed Elements:",n);break;case e:break;default:Ce("No overflow detected")}an(E,"Overflow updated")}function go(e){const t={root:document.documentElement,side:ft.calculateHeight?z:b};return ro.overflow=((e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||B,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>{e.toggleAttribute(l,t)},c=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t;if(!o)continue;const i=e[n],c=a(i,o)&&!(r instanceof HTMLElement&&po(r));s(r,c)}r(i)},o),d=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r instanceof Element&&(d.has(r)?t.add(r):(c.observe(r),d.add(r),n.add(r),o+=1));mo(t),fo(n),lo(o),n.clear(),t.clear()},detachObservers:In(co,c,d,uo),disconnect:()=>{c.disconnect(),Ce("Detached%c OverflowObserver",Me)}}})(ho,t),ro.overflow.attachObservers(e),ro.overflow}const yo="Resize",vo=An(yo),zo=An(yo,!1),bo=En(yo),wo=Rn(yo),$o=new WeakSet,ko=new Set,So=new Set;let jo;function Oo(e){let t=0;for(const n of e){if(!(n instanceof Element))continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&($o.has(n)?ko.add(n):(jo.observe(n),$o.add(n),So.add(n),t+=1))}wo(ko),bo(So),vo(t),So.clear(),ko.clear()}function Mo(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;an(M,`Element resized <${function(e){switch(!0){case!H(e):return"";case H(e.id):return`${e.nodeName}#${e.id}`;case H(e.name):return`${e.nodeName} (${e.name}`;case H(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function Eo(e){return ro.resize=(jo=new ResizeObserver(Mo),jo.observe(document.body),$o.add(document.body),Ce("Attached%c ResizeObserver%c to body",Me,Ee),{attachObserverToNonStaticElements:Oo,detachObservers:In(yo,jo,$o,zo),disconnect:()=>{jo.disconnect(),Ce("Detached%c ResizeObserver",Me)}}),ro.resize.attachObserverToNonStaticElements(e),ro.resize}let Ro;function To(){const e=document.title;e!==Ro&&(Ro=e,xe(`Title: %c${e}`,Me),e&&Ot(0,0,"title",e))}function Ao(e){xe(`Visible: %c${e}`,Me),Xe.isHidden=!e,an(T,"Visibility changed")}function Io(){He("attachObservers");const e=Qt(document.documentElement);!function(e){Qe.push(...e.map(e=>e.disconnect))}([Xn(so),go(e),Zt(),Eo(e),eo(To),to(Ao)])}const Po=(e,t,n)=>{if(""!==n){xe(`${e}: %c${n}`,Me);for(const e of document.querySelectorAll(n))xe(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}};function xo(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Co(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),Ce(`Set body ${e}: %c${t}`,Me))}function No({bodyMarginStr:e,bodyMargin:t}){var n,o;void 0===e&&(e=`${t}px`),Co("margin",(n="margin",(o=e).includes("-")&&(Ve(`Negative CSS value ignored for ${n}`),o=""),o))}function Lo(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:Math.round(t.left+n.x),y:Math.round(t.top+n.y)}}function Bo(e){const t=e.split("#")[1]||e,n=decodeURIComponent(t),o=document.getElementById(n)||document.getElementsByName(n)[0];void 0===o?(xe(`In page link (#${t}) not found in iframe, so sending to parent`),Ot(0,0,"inPageLink",`#${t}`)):function(e,t){const n=Lo(t);xe(`Moving to in page link (%c#${e}%c) at x: %c${n.x}%c y: %c${n.y}`,Me,Ee,Me,Ee,Me),Ot(n.y,n.x,s)}(t,o)}function Wo(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&Bo(t)}function qo(){xe("Setting up location.hash handlers"),function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&_e(e,"click",t=>{t.preventDefault(),Bo(e.getAttribute("href"))})}(),_e(window,"hashchange",Wo),setTimeout(Wo,128),Xe.inPageLinks={findTarget:Bo}}function Ho(){const e=e=>e.style.setProperty(u,y,"important");e(document.documentElement),e(document.body),xe("Set HTML & body height: %cauto !important",Me)}const Fo=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Do=Fo(g),Vo=Fo(h),Uo=Fo(p);function Zo(e){xe("Reading data from page:",Object.keys(e));const{offsetHeight:t,offsetWidth:n}=function(e){const{calculateHeight:t,calculateWidth:n}=ft;let o,r;return typeof e?.offsetSize===h&&(t&&(o=Vo(e,m)),n&&(r=Vo(e,m))),{offsetHeight:o,offsetWidth:r}}(e);return{offsetHeight:t,offsetWidth:n,ignoreSelector:Uo(e,"ignoreSelector"),[de(3)]:Uo(e,de(0)),sizeSelector:Uo(e,"sizeSelector"),targetOrigin:Uo(e,"targetOrigin"),onBeforeResize:Do(e,"onBeforeResize"),onMessage:Do(e,"onMessage"),onReady:Do(e,"onReady")}}function Jo(){const{mode:e}=ft;if(ce(e))return{};const t=window.iframeResizer||window.iFrameResizer;return null===(n=t)||"object"!=typeof n||Array.isArray(n)?{}:Zo(t);var n}const Qo=e=>t=>void 0===t?void 0:e(t),Go=Qo(e=>"true"===e),Yo=Qo(Number);function _o(e){for(const[t,n]of Object.entries(e))void 0!==n&&(ft[t]=n)}function Xo({logExpand:n,logging:o,parentId:r=""}){var i;Te=(i={id:r,enabled:o,expand:n}).id||t,Ie.label(`${Te}`),Ie.expand(i.expand),Re=i.enabled,He("initReceived"),xe(`Initialising iframe v${e} ${window.location.href}`)}function Ko(e){He("ready"),zt(L(e)),xe("Initialization complete",(({key:e,key2:t,...n})=>n)(ft))}function er({bodyBackground:t,bodyPadding:n,inPageLinks:r,onReady:i}){const a=(({calculateWidth:e,calculateHeight:t})=>e===t)(ft),s=[ht,mt,yt,wt,bt,a?B:ut,()=>No(ft),()=>Co("background",t),()=>Co("padding",n),a?B:Ho,xo,Xe.applySelectors,()=>function(e){const{mode:t}=ft;e?ce(t)?Je(le(5)):qo():xe("In page linking not enabled")}(r),cn,()=>function({mouseEvents:e}){!0===e&&(Et("mouseenter","Mouse Enter"),Et("mouseleave","Mouse Leave"))}(ft),Tt,()=>function(){const{win:e}=Xe;1!==ft.mode&&(e.parentIframe=Object.freeze({autoResize:fn,close:Sn,getId:jn,getParentOrigin:hn,getParentProps:yn,moveToAnchor:mn,reset:On,setOffsetSize:pn,scrollBy:bn,scrollTo:wn,scrollToOffset:$n,sendMessage:kn,setTargetOrigin:gn,resize:vn}))}(),()=>an(o,"Init message from host page",void 0,void 0,`${e}:${ft.mode}`),Io,Be];$t(ft),function({key:e,key2:t,mode:n,version:o}){const r=n,i=H(e)?ue({key:e}):-1,a=H(t)?ue({key:t}):-1;let s;switch(n=Math.max(i,a)){case-2:case-1:De(),s=`${le(Math.min(i,a)+2)}${le(2)}`,Xe.firstRun=!1;break;case 1:case 2:case 3:s=le(6);break;case 4:s=le(7);break;case 5:s=le(8)}if(n>=0&>(n,r,o),(!H(o)||!Xe.firstRun)&&(s&&Je(s),n<0))throw Je(le(9)),s.split("<br>")[0].replace(/<\/?[a-z][^>]*>|<\/>/gi,"");ft.mode=n}(ft),function(e){const{mode:t}=ft;e.forEach(e=>{try{e()}catch(n){if(t<0)throw n;Je("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),We(n)}})}(s),Ko(i)}function tr(e){Xe.firstRun&&(_o((e=>({parentId:e[0],bodyMargin:Yo(e[1]),calculateWidth:Go(e[2]),logging:Go(e[3]),autoResize:Go(e[6]),bodyMarginStr:e[7],bodyBackground:e[9],bodyPadding:e[10],tolerance:Yo(e[11]),inPageLinks:Go(e[12]),mouseEvents:Go(e[15]),offsetHeight:Yo(e[16]),offsetWidth:Yo(e[17]),calculateHeight:Go(e[18]),key:e[19],version:e[20],mode:Yo(e[21]),logExpand:Go(e[23])}))(e)),Xo(ft),_o(Jo()),Xe.applySelectors=function({sizeSelector:e,ignoreSelector:t}){return()=>{Po("sizeSelector",c,e),Po("ignoreSelector",d,t)}}(ft),er(ft))}const{freeze:nr}=Object,{parse:or}=JSON,rr=e=>nr(or(e)),ir=e=>Ot(0,0,`${e}Stop`),ar=e=>e.data.slice(e.data.indexOf(n)+1),sr=e=>(e=>e.data.split(n)[2]in{true:1,false:1})(e)?o:e.data.split("]")[1].split(n)[0];const cr=e=>Xe.inPageLinks.findTarget(ar(e)),lr={init:function(e){if("loading"===document.readyState)return void xe("Page not ready, ignoring init message");const t=e.data.slice(13).split(n);Xe.target=e.source,Xe.origin=e.origin,tr(t),Xe.firstRun=!1,setTimeout(()=>{Xe.initLock=!1},128)},reset:function(){Xe.initLock?xe("Page reset ignored by init"):(xe("Page size reset by host page"),ln("resetPage"))},resize:function(){xe("Resize requested by host page"),an(S,"Parent window requested size check")},moveToAnchor:cr,inPageLink:cr,pageInfo:function(e){const{onPageInfo:t}=Xe,n=ar(e);xe("PageInfo received from parent:",rr(n)),t?N(t,or(n)):ir("pageInfo")},parentInfo:function(e){const{onParentInfo:t}=Xe,n=rr(ar(e));xe("ParentInfo received from parent:",n),t?N(t,n):ir(a)},message:function(e){const t=ar(e);xe("onMessage called from parent:%c",Me,rr(t)),N(ft.onMessage,or(t))}};function dr(e){const{firstRun:t}=Xe,n=sr(e);switch(He(n),!0){case n in lr:lr[n](e);break;case t&&(nt in window||void 0!==window.jQuery&&nt in window.jQuery.prototype):Ve(`Ignored message of type "${n}". Received before initialization.`);break;default:Ve(`Unexpected message (${e.data}), this is likely due to a newer version of iframe-resizer running on the parent page.`)}}const ur=qe(e=>{(e=>P===`${e.data}`.slice(0,13))(e)&&dr(e)});"undefined"!=typeof window&&function(){if("iframeChildListener"in window)Ve("Already setup");else{window.iframeChildListener=e=>{setTimeout(()=>ur({data:e,sameOrigin:!0}))},He("listen"),_e(window,r,ur),_e(document,v,tt),tt();try{top?.document?.getElementById("banner")&&(Xe.win={},window.mockMsgListener=e,Ye(window,r,ur),"function"==typeof window.define&&window.define([],()=>e))}catch(t){}}function e(e){return ur(e),Xe.win}}()});
|
|
21
21
|
//# sourceMappingURL=index.umd.js.map
|