"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,isThumbnail:r=!1}=e;const s=(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=s.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(!s.current||d.current)return()=>{};const e=e=>{var n,i,o,u,c;if(e.source===(null===(n=s.current)||void 0===n?void 0:n.contentWindow))if("ready"===e.data.type)c=Object.assign(Object.assign({},t),{isThumbnail:r}),a(c,"init"),d.current=!0;else if("interactivity"===e.data.type){if(r)return;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===(u=null===(o=null===l||void 0===l?void 0:l.getAction)||void 0===o?void 0:o.call(l,n))||void 0===u||u.run())}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}})),(0,i.jsx)("iframe",{ref:s,src:n,style:{pointerEvents:l?"auto":"none",width:"100%",height:"100%"},title:"Genially App"})}},13844:(e,n,t)=>{t.d(n,{D:()=>o});var i=t(45992);const o=()=>(0,i.jsx)("div",{style:{backgroundColor:"#414141",width:"100%",height:"100%"}})},96901:(e,n,t)=>{t.d(n,{Y:()=>o,m:()=>i});const i=e=>{let{scriptId:n,developmentUrl:t}=e;return t?`${t}/index.html`:`https://plugins.genially.com/${n}/1.0.0/index.html`},o=e=>e.startsWith("@ai.genially/")},37030:(e,n,t)=>{t.r(n),t.d(n,{geniallyCodeViewScript:()=>d});var i=t(45992),o=t(41381),l=t(87001),r=t(13844),s=t(96901);const d=(e,n)=>{const t=function(){let{isThumbnail:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{developmentUrl:o,config:r,scriptId:d}=e,a=(0,s.m)({scriptId:d,developmentUrl:o});return(0,i.jsx)(l.q,{config:r,view:n,url:a,isThumbnail:t})};(0,o.p)({getTargetNodeItem:()=>e.item,initialState:void 0,renderThumbnailApp:()=>(0,s.Y)(e.scriptId||"")?(0,i.jsx)(r.D,{}):t({isThumbnail:!0}),renderApp:()=>()=>t()})(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:s}=e,d=!1;const a=[],u=e=>{a.push(e)};return e=>{const c=n(e.config),m=null===c||void 0===c?void 0:c.parentSlide;function f(){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(d){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"?')};d=!0,n(s),a.push((()=>{i.unmountComponentAtNode(e)}))}}function v(){d=!1,a.forEach((e=>{e()})),a.length=0}null===c||void 0===c||c.on(o.q.Mount,(()=>{f()})),null===c||void 0===c||c.on(o.q.Unmount,(()=>{v()})),c&&"isTransversal"in c&&c.isTransversal?f():null===m||void 0===m||m.on(l.m.Entering,(()=>{d||f()})),null===m||void 0===m||m.on(l.m.Exited,(()=>{c&&"isTransversal"in c&&c.isTransversal||d&&v()})),null===m||void 0===m||m.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.e2f7146f.chunk.js.map