1import{a as o}from"./chunk-UOEFDBHP.js";import{a as l}from"./chunk-FACNBY35.js";import{B as d}from"./chunk-VJGBCIFP.js";import"./chunk-XCPXRTXT.js";import"./chunk-XJLSI5BW.js";import"./chunk-ZOYOJ6FT.js";import"./chunk-6KHOHYTW.js";var n=new Map;function h(i,e){let t=i.src;clearTimeout(n.get(t)),n.set(t,setTimeout(()=>{try{if(!document.body.contains(i))return;let r=i.getBoundingClientRect().width;if(r>e){i.classList.remove("ratio-portrait"),i.style.removeProperty("--aspect-ratio");return}let s=Math.round(r/e*100)/100;s&&(i.classList.add("ratio-portrait"),i.style.setProperty("--aspect-ratio",s.toString()))}finally{n.delete(t)}},120))}var a=class i extends l{static _findOwnIframe(e){return Array.prototype.find.call(document.querySelectorAll("lcl-iframe-embed iframe"),t=>t.contentWindow===e.source)}static _handleResizeMessage(e){let t=e.data;if(typeof t=="string")try{t=JSON.parse(t)}catch{return}if(!t)return;let r=i._findOwnIframe(e);if(r){if(t.location&&t.ratio){r.clientWidth>0&&o(r,Math.round(r.clientWidth*t.ratio));return}t.height&&(o(r,t.height),h(r,t.height))}}get _iframe(){return this._element.querySelector("iframe")}get source(){return this._withProviderParams(this._iframe.dataset.src)}_withProviderParams(e){let{colorSchemeParameter:t,colorSchemeOnlyWhenDark:r}=this._element.dataset;if(!t)return e;let s;try{s=new URL(e)}catch{return e}let m=!!document.querySelector("#storytelling-switch-article-color-scheme:not(:checked)"),c=d()||m;return r==="true"?c&&s.searchParams.set(t,"dark"):s.searchParams.set(t,c),s.toString()}_init(){if(super._init(),!this._isConsentRequired){let e=this._withProviderParams(this._iframe.src);e!==this._iframe.src&&(this._iframe.src=e)}}_activate(){super._activate(),this._iframe.src=this.source}};window.addEventListener("message",a._handleResizeMessage);export{a as default}; 2//# sourceMappingURL=iframe-embed-module-LU4C2HVI.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.