diff --git a/apps/web/public/_assets/open-iframe-resizer-1.2.1.min.js b/apps/web/public/_assets/open-iframe-resizer-1.2.1.min.js new file mode 100644 index 0000000000..7529d80865 --- /dev/null +++ b/apps/web/public/_assets/open-iframe-resizer-1.2.1.min.js @@ -0,0 +1,8 @@ +/** + * Minified by jsDelivr using Terser v5.19.2. + * Original file: /npm/@open-iframe-resizer/core@1.2.1/dist/index.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +const g=()=>typeof window<"u",L=()=>window.self!==window.top,m=e=>e instanceof HTMLIFrameElement,w=(e,t)=>{"complete"===e.document.readyState?t():e.addEventListener("load",t)},y=(e,t)=>{t(),e.addEventListener("load",t)},p=(e,t)=>{var n,r;const i="complete"===(null==(n=e.contentWindow)?void 0:n.document.readyState);return"about:blank"!==e.src&&"about:blank"!==(null==(r=e.contentWindow)?void 0:r.location.href)&&i?t():e.addEventListener("load",t)},v=()=>({offsetSize:0,checkOrigin:!0,enableLegacyLibSupport:!1}),b=e=>{try{return new URL(e.src).origin===window.location.origin}catch{return!1}},I=e=>{try{const t=new URL(e.src).origin;if("about:blank"!==t)return t}catch{}return null},R=e=>(Object.keys(e).forEach((t=>void 0===e[t]&&delete e[t])),e),h=e=>{const{height:t}=e.documentElement.getBoundingClientRect();return Math.ceil(t)};function z(e){y(e,(()=>{var t;return null==(t=e.contentWindow)?void 0:t.postMessage("[iFrameSizer]ID:0:false:false:32:true:true::auto:::0:false:child:auto:true:::true:::false","*")}))}function O(e){if("string"==typeof e.data&&e.data.startsWith("[iFrameSizer]")){const[t,n]=e.data.split(":"),r=+n;return r>0?r:null}return null}const a=g()?M():null;let l=[];const D=(e,t)=>{if(!g())return[];const n={offsetSize:0,checkOrigin:!0,enableLegacyLibSupport:!1,...R(e??{})},r=S(t),i=E(n,r);return r.map((e=>{const t={iframe:e,settings:n,interactionState:{isHovered:!1}},r=C(t,i);return l.push(t),{unsubscribe:()=>{r(),l=l.filter((t=>t.iframe!==e))}}}))};function S(e){return"string"==typeof e?Array.from(document.querySelectorAll(e)).filter(m):e?m(e)?[e]:[]:Array.from(document.getElementsByTagName("iframe"))}function E(e,t){if(Array.isArray(e.checkOrigin))return e.checkOrigin;if(!e.checkOrigin)return[];const n=[];for(const e of t){const t=I(e);t&&n.push(t)}return n}function C(e,t){const n=b(e.iframe)?B(e):k(e,t),r=H(e);return()=>{n(),r()}}function k(e,t){const{iframe:n,settings:r}=e,i=i=>{var o;const a=!r.checkOrigin||t.includes(i.origin);if(n.contentWindow===i.source&&a){if("iframe-resized"===(null==(o=i.data)?void 0:o.type)){const{height:t}=i.data;return void(t&&f({newHeight:t,registeredElement:e}))}if(r.enableLegacyLibSupport){const t=O(i);return void(null!==t&&f({newHeight:t,registeredElement:e}))}}};return window.addEventListener("message",i),r.enableLegacyLibSupport&&z(n),()=>window.removeEventListener("message",i)}function B({iframe:e}){const t=()=>{var t;const n=null==(t=e.contentDocument)?void 0:t.body;n&&(null==a||a.observe(n))};return p(e,t),()=>{var n;null!=(n=e.contentDocument)&&n.body&&(null==a||a.unobserve(e.contentDocument.body)),e.removeEventListener("load",t)}}function H({iframe:e,interactionState:t}){const n=()=>{t.isHovered=!0},r=()=>{t.isHovered=!1};return e.addEventListener("mouseenter",n),e.addEventListener("mouseleave",r),()=>{e.removeEventListener("mouseenter",n),e.removeEventListener("mouseleave",r)}}function M(){const e=({target:e})=>{const t=l.find((t=>{var n;return(null==(n=t.iframe.contentDocument)?void 0:n.body)===e}));if(!t)return;const{iframe:n}=t;if(!n.contentDocument)return;const r=h(n.contentDocument);r&&f({newHeight:r,registeredElement:t})};return new ResizeObserver((t=>t.forEach(e)))}function f({registeredElement:e,newHeight:t}){const{iframe:n,settings:r,interactionState:i}=e,o=n.getBoundingClientRect(),a=t+r.offsetSize;if(n.style.height=`${a}px`,!r.onIframeResize)return;const c={iframe:n,settings:{...r},interactionState:{...i},previousRenderState:{rect:o},nextRenderState:{rect:n.getBoundingClientRect()}};r.onIframeResize(c)}function W(){var e,t;!g()||window.self===window.top||(e=window,t=()=>{new ResizeObserver((()=>{const e={type:"iframe-resized",width:document.documentElement.scrollWidth,height:h(document)};window.parent.postMessage(e,"*")})).observe(document.body)},"complete"===e.document.readyState?t():e.addEventListener("load",t))}W();const A=({previousRenderState:e,nextRenderState:t,interactionState:n})=>{n.isHovered&&window.scrollBy(0,t.rect.bottom-e.rect.bottom)};export{D as initialize,W as initializeChildListener,A as updateParentScrollOnResize}; +//# sourceMappingURL=/sm/1eccb19f18e01e9786e22cd2daf5b1e1e1305050d29f1b7c846ad8d1d3fdd2df.map \ No newline at end of file