"use strict";(self.webpackChunk_genially_view_client=self.webpackChunk_genially_view_client||[]).push([[8938],{68124:(e,n,t)=>{t.d(n,{q:()=>g});var o=t(45992),i=t(37577),l=t(23119),r=t(17588),s=t(66264),a=t(60708);var d=t(29973),u=t(88138);const c=e=>{let{isInEditor:n,slides:t,showControls:i,showPagination:l,autoplay:r,options:s,fit:a,onClickSelectedImage:d,onZoomedOut:c,galleryType:m,viewId:g}=e;if(!m)return null;const h=(0,u.BR)(m);return(0,o.jsx)(h,{isInEditor:n,slides:t,showControls:i,showPagination:l,autoplay:r,options:s,fit:a,onClickSelectedImage:d,onZoomedOut:c,viewId:g})},m=i.Ay.div({display:"flex",alignItems:"center",height:"100%",cursor:"default",".is-dragging":{cursor:"grabbing","& *":{cursor:"grabbing !important"}}}),g=e=>{let{isInEditor:n=!1,fit:t,autoplay:u,widgetItem:g,slides:h,showControls:p,showPagination:f=!0,galleryType:y,viewId:v,theme:w,onZoomed:I,t:E}=e;const C=Object.assign({loop:!0,skipSnaps:!0,watchResize:!0},d.Z),T=((e,n)=>{const[t,o]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{if(!e||!n)return;const t=[n.parentSlide.on(a.m.Entered,(()=>{n.visible&&o(!0)})),n.on(s.q.Visible,(()=>{o(!0)})),n.on(s.q.Hidden,(()=>{o(!1)}))];return()=>{t.forEach((e=>e())),o(!1)}}),[e,n]),t})(u,g);return(0,o.jsx)(l.i.Provider,{value:{t:E},children:(0,o.jsx)(i.NP,{theme:w,children:(0,o.jsx)(m,{style:{display:"flex",alignItems:"center",height:"100%"},children:(0,o.jsx)(c,{isInEditor:n,slides:h,showControls:p,showPagination:f,options:C,autoplay:T,onClickSelectedImage:e=>{null===I||void 0===I||I(void 0!==e)},onZoomedOut:()=>{null===I||void 0===I||I(!1)},fit:t,galleryType:y,viewId:v})})})})}},38938:(e,n,t)=>{t.r(n),t.d(n,{geniallyGalleryViewScript:()=>a});var o=t(45992),i=t(54072),l=t(41381),r=t(68124),s=t(88138);const a=(e,n)=>{const t=e.config.nodeRichContent,{slideList:a,showControls:d,autoplay:u,fit:c,galleryType:m}=e.config,g=e.item;t&&(t.markAsInteractive=!0,t.thumbnail=(0,s.mJ)(m));const{viewId:h}=n,p=e=>{n.setIsExternalModalOpen(e)},f=a.map((e=>({image:e.image.source,title:e.title,id:(0,i.Ak)(),altText:e.image.altText})));(0,l.p)({getTargetNodeItem:e=>e.nodeRichContent,initialState:void 0,renderApp:()=>()=>(0,o.jsx)(r.q,{autoplay:u,slides:f,showControls:d,fit:c,galleryType:m,onZoomed:p,viewId:h,widgetItem:g,theme:n.theme,t:n.t})})(e,n)}},41381:(e,n,t)=>{t.d(n,{p:()=>r});var o=t(70377),i=t(66264),l=t(60708);function r(e){let{getTargetNodeItem:n,renderApp:t,renderThumbnailApp:r,initialState:s}=e,a=!1;const d=[],u=e=>{d.push(e)};return e=>{const c=n(e.config),m=null===c||void 0===c?void 0:c.parentSlide;function g(){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:o}=t[0];if(!o)return;e=document.getElementById(o)}if(e){let n;const i=t=>{a&&n?o.render(n(t),e):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"?')};n=t({setState:i,onUnmount:u}),a=!0,i(s),d.push((()=>{o.unmountComponentAtNode(e)}))}}function h(){a=!1,d.forEach((e=>{e()})),d.length=0}c&&"isTransversal"in c&&c.isTransversal?(null===c||void 0===c||c.on(i.q.Mount,(()=>{g()})),null===c||void 0===c||c.on(i.q.Unmount,(()=>{h()}))):(null===m||void 0===m||m.on(l.m.Entering,(()=>{a||g()})),null===m||void 0===m||m.on(l.m.Exited,(()=>{a&&h()}))),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=>{o.unmountComponentAtNode(e)}))}(),function(){if(!r||!c||!("idOfThumbnailFreeNode"in c))return;const e=document.getElementsByClassName(c.idOfThumbnailFreeNode);Array.from(e).forEach((e=>{o.render(r(),e)}))}()}))}}}}]);
//# sourceMappingURL=https://s3-static-genially.genially.com/view/static/js/8938.41b6943f.chunk.js.map