"use strict";(self.webpackChunk_genially_view_client=self.webpackChunk_genially_view_client||[]).push([[7030],{87001:(e,n,t)=>{t.d(n,{q:()=>l});var i=t(45992),o=t(17588);const l=e=>{let{url:n,config:t,view:l}=e;const r=(0,o.useRef)(null),d=(0,o.useRef)(!1),a=function(e){var n,t;const i={type:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"config",data:JSON.parse(JSON.stringify(e))};null===(t=null===(n=r.current)||void 0===n?void 0:n.contentWindow)||void 0===t||t.postMessage(i,"*")};return(0,o.useEffect)((()=>{a(t)}),[t]),(0,o.useEffect)((()=>{if(!r.current||d.current)return()=>{};const e=e=>{var n,i,o,s;if(e.source===(null===(n=r.current)||void 0===n?void 0:n.contentWindow))if("ready"===e.data.type)a(t,"init"),d.current=!0;else if("interactivity"===e.data.type){const n=e.data.data;"object"===typeof n?null===(i=null===l||void 0===l?void 0:l.runAction)||void 0===i||i.call(l,n):"string"===typeof n&&(null===(s=null===(o=null===l||void 0===l?void 0:l.getAction)||void 0===o?void 0:o.call(l,n))||void 0===s||s.run())}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}})),(0,i.jsx)("iframe",{ref:r,src:n,style:{pointerEvents:l?"auto":"none",width:"100%",height:"100%"},title:"Genially App"})}},37030:(e,n,t)=>{t.r(n),t.d(n,{geniallyCodeViewScript:()=>r});var i=t(45992),o=t(41381),l=t(87001);const r=(e,n)=>{(0,o.p)({getTargetNodeItem:()=>e.item,initialState:void 0,renderApp:()=>()=>(0,i.jsx)(l.q,{config:e.config,view:n,url:`https://plugins.genially.com/${e.scriptId}/1.0.0/index.html`})})(e,n)}},41381:(e,n,t)=>{t.d(n,{p:()=>r});var i=t(70377),o=t(66264),l=t(60708);function r(e){let{getTargetNodeItem:n,renderApp:t,renderThumbnailApp:r,initialState:d}=e,a=!1;const s=[],u=e=>{s.push(e)};return e=>{const c=n(e.config),f=null===c||void 0===c?void 0:c.parentSlide;function m(){if(!c)return;let e=null;if("idOfFreeNode"in c)e=document.getElementById(c.idOfFreeNode);else{const n=document.createElement("div");n.innerHTML=c.source;let t=n.getElementsByClassName("genially-widget-app");t.length||(t=n.getElementsByClassName("genially-widget-gallery"));const{id:i}=t[0];if(!i)return;e=document.getElementById(i)}if(e){const n=o=>{if(a){const l=t({setState:n,onUnmount:u});i.render(l(o),e)}else console.warn('"rerender" was called when the widget was already unmounted. This is a no-op. Did you forget to dispose of an event handler with "onUnmount"?')};a=!0,n(d),s.push((()=>{i.unmountComponentAtNode(e)}))}}function v(){a=!1,s.forEach((e=>{e()})),s.length=0}null===c||void 0===c||c.on(o.q.Mount,(()=>{m()})),null===c||void 0===c||c.on(o.q.Unmount,(()=>{v()})),c&&"isTransversal"in c&&c.isTransversal?m():null===f||void 0===f||f.on(l.m.Entering,(()=>{a||m()})),null===f||void 0===f||f.on(l.m.Exited,(()=>{c&&"isTransversal"in c&&c.isTransversal||a&&v()})),null===f||void 0===f||f.on(l.m.ThumbnailMount,(()=>{!function(){if(!r||!c||!("idOfThumbnailFreeNode"in c))return;const e=document.getElementsByClassName(c.idOfThumbnailFreeNode);Array.from(e).forEach((e=>{i.unmountComponentAtNode(e)}))}(),function(){if(!r||!c||!("idOfThumbnailFreeNode"in c))return;const e=document.getElementsByClassName(c.idOfThumbnailFreeNode);Array.from(e).forEach((e=>{i.render(r(),e)}))}()}))}}}}]);
//# sourceMappingURL=https://s3-static-genially.genially.com/view/static/js/7030.0d637ab0.chunk.js.map