"use strict";(self.webpackChunk_genially_view_client=self.webpackChunk_genially_view_client||[]).push([[8938],{68124:(e,n,t)=>{t.d(n,{q:()=>g});var i=t(45992),o=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:o,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,i.jsx)(h,{isInEditor:n,slides:t,showControls:o,showPagination:l,autoplay:r,options:s,fit:a,onClickSelectedImage:d,onZoomedOut:c,viewId:g})},m=o.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:f,showPagination:p=!0,galleryType:y,viewId:v,theme:w,onZoomed:I,t:E}=e;const T=Object.assign({loop:!0,skipSnaps:!0,watchResize:!0},d.Z),C=((e,n)=>{const[t,i]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{if(!e||!n)return;const t=[n.parentSlide.on(a.m.Entered,(()=>{n.visible&&i(!0)})),n.on(s.q.Visible,(()=>{i(!0)})),n.on(s.q.Hidden,(()=>{i(!1)}))];return()=>{t.forEach((e=>e())),i(!1)}}),[e,n]),t})(u,g);return(0,i.jsx)(l.i.Provider,{value:{t:E},children:(0,i.jsx)(o.NP,{theme:w,children:(0,i.jsx)(m,{style:{display:"flex",alignItems:"center",height:"100%"},children:(0,i.jsx)(c,{isInEditor:n,slides:h,showControls:f,showPagination:p,options:T,autoplay:C,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 i=t(45992),o=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,f=e=>{n.setIsExternalModalOpen(e)},p=a.map((e=>({image:e.image.source,title:e.title,id:(0,o.Ak)(),altText:e.image.altText})));(0,l.p)({getTargetNodeItem:e=>e.nodeRichContent,initialState:void 0,renderApp:()=>()=>(0,i.jsx)(r.q,{autoplay:u,slides:p,showControls:d,fit:c,galleryType:m,onZoomed:f,viewId:h,widgetItem:g,theme:n.theme,t:n.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,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:i}=t[0];if(!i)return;e=document.getElementById(i)}if(e){let n;const o=t=>{a&&n?i.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:o,onUnmount:u}),a=!0,o(s),d.push((()=>{i.unmountComponentAtNode(e)}))}}function h(){a=!1,d.forEach((e=>{e()})),d.length=0}function f(){if(!c||!("idOfThumbnailFreeNode"in c))return[];const e=document.getElementsByClassName(c.idOfThumbnailFreeNode);return Array.from(e).filter((e=>e instanceof HTMLElement))}const p=c&&"isTransversal"in c&&c.isTransversal,y=()=>{null===c||void 0===c||c.on(o.q.Mount,(()=>{g()})),null===c||void 0===c||c.on(o.q.Unmount,(()=>{h()}))};p?y():(null===m||void 0===m||m.on(l.m.Entering,(()=>{a||(g(),a||y())})),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;f().forEach((e=>{i.unmountComponentAtNode(e)}))}(),function(){if(!r||!c||!("idOfThumbnailFreeNode"in c))return;f().forEach((e=>{const{renderingSlideId:n}=e.dataset;i.render(r({renderingSlideId:n}),e)}))}()}))}}}}]);
//# sourceMappingURL=https://s3-static-genially.genially.com/view/static/js/8938.64b6e2e7.chunk.js.map