"use strict";(self.webpackChunk_genially_view_client=self.webpackChunk_genially_view_client||[]).push([[5630],{60052:(t,e,i)=>{i.d(e,{q:()=>N});var n=i(45992),a=i(37577);const o={VERTICAL:"vertical",HORIZONTAL:"horizontal"};var r=i(17588),s=i(22077),l=i(62772);const d="4000ms",c=(0,a.i7)({"0%":{transform:"translateX(0)"},"2%":{transform:"translateX(-6px) rotateY(-9deg)"},"5%":{transform:"translateX(5px) rotateY(-7deg)"},"8%":{transform:"translateX(-3px) rotateY(-5deg)"},"11%":{transform:"translateX(-2px) rotateY(-3deg)"},"13%":{transform:"translateX(0)"}}),p=(0,a.i7)({"0%":{transform:"translateY(0)"},"2%":{transform:"translateY(-6px) rotateX(-9deg)"},"5%":{transform:"translateY(5px) rotateX(-7deg)"},"8%":{transform:"translateY(-3px) rotateX(-5deg)"},"11%":{transform:"translateY(-2px) rotateX(-3deg)"},"13%":{transform:"translateY(0)"}}),g="100ms",{color:u}=l.iF.themes.newPrimary,h=(t,e,i)=>Object.assign({},e===o.HORIZONTAL?{left:`${t}%`,top:i?"50%":0}:{top:`calc(100% - ${t}%)`,left:i?"50%":0}),m=a.Ay.div({position:"absolute",width:0,height:0,zIndex:1,touchAction:"none",userSelect:"none",pointerEvents:"none"}),x=a.Ay.div((t=>{let{$orientation:e,$sliderValue:i,$withTransition:n,$disabled:r}=t;return a.AH`
    position: absolute;
    z-index: 1;
    ${s=e===o.HORIZONTAL,{width:s?4:"100%",height:s?"100%":4}};
    ${h(i,e,!1)};
    background-color: white;
    cursor: pointer;
    box-shadow: 0px 1px 4px 0px rgba(0, 15, 51, 0.2);
    ${n&&{transition:`all ${g}`}};
    animation-name: ${e===o.HORIZONTAL?c:p};
    animation-duration: ${d};
    animation-iteration-count: infinite;
    animation-play-state: ${r?"paused":"running"};
    animation-delay: ${d};

    ${[m]} {
      ${h(i,e,!0)};
    }
  `;var s})),f=a.Ay.svg({position:"absolute",transform:"scale(1)",fill:u.content.reversed.default(),transition:"top 0.2s, left 0.2s",filter:"drop-shadow(0 1px 4px rgba(0, 15, 51, 0.2))"}),v=(0,a.Ay)(f)((t=>{let{$orientation:e}=t;return Object.assign({left:-32,top:-16},e===o.VERTICAL&&{transform:"rotate(90deg)",top:-32,left:-16})})),y=(0,a.Ay)(f)((t=>{let{$orientation:e}=t;return Object.assign({left:0,top:-16},e===o.VERTICAL&&{transform:"rotate(90deg)",top:0,left:-16})})),$=t=>{let{orientation:e,sliderValue:i,withTransition:a,disabled:o}=t;return(0,n.jsx)(x,{$orientation:e,$sliderValue:i,$withTransition:a,$disabled:o,children:(0,n.jsxs)(m,{$orientation:e,$sliderValue:i,children:[(0,n.jsx)(v,{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 16 16",fill:"none",$orientation:e,children:(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0002 14.0002C9.74425 14.0002 9.48825 13.9022 9.29325 13.7072L4.29325 8.70725C3.90225 8.31625 3.90225 7.68425 4.29325 7.29325L9.29325 2.29325C9.68425 1.90225 10.3163 1.90225 10.7073 2.29325C11.0982 2.68425 11.0982 3.31625 10.7073 3.70725L6.41425 8.00025L10.7073 12.2933C11.0982 12.6842 11.0982 13.3162 10.7073 13.7072C10.5122 13.9022 10.2562 14.0002 10.0002 14.0002Z"})}),(0,n.jsx)(y,{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 16 16",fill:"none",$orientation:e,children:(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.00025 2C6.25625 2 6.51225 2.098 6.70725 2.293L11.7073 7.293C12.0982 7.684 12.0982 8.316 11.7073 8.707L6.70725 13.707C6.31625 14.098 5.68425 14.098 5.29325 13.707C4.90225 13.316 4.90225 12.684 5.29325 12.293L9.58625 8L5.29325 3.707C4.90225 3.316 4.90225 2.684 5.29325 2.293C5.48825 2.098 5.74425 2 6.00025 2Z"})})]})})},w=a.Ay.div((t=>{let{$index:e,$isHorizontal:i,$opacity:n,$withTransition:a}=t;return Object.assign(Object.assign({position:"absolute",bottom:0,left:0,zIndex:111,opacity:n,transition:"opacity 0.2s"+(a?", width 0.2s":""),userSelect:"none"},1===e&&i&&{left:"unset",right:0}),0===e&&!i&&{top:0,bottom:"unset"})})),b=a.Ay.p(Object.assign({color:"white",backgroundColor:"rgba(18,18,18,0.5)",fontSize:16,lineHeight:"20px",fontWeight:"400",overflow:"hidden",textOverflow:"ellipsis",textAlign:"center",wordWrap:"break-word",whiteSpace:"nowrap",pointerEvents:"none",transform:"translate3d(0, 0, 0)",transitionProperty:"opacity, width",transitionDuration:"0.2s",transitionTimingFunction:"linear"},l.iF.mixins.increaseSpecificity({padding:16}))),j=a.Ay.img({width:"100%",height:"100%",objectFit:"cover"}),A=a.Ay.div({position:"relative",width:"100%"}),T=t=>{let{index:e,image:i,sliderValue:a,isHorizontal:o,withTransition:r}=t;const s=o?0===e?`${a}%`:`calc(${100-a}% - 4px)`:"100%",l=((t,e,i)=>{const n={horizontal:[0===t&&e>10,1===t&&e<90],vertical:[0===t&&e<90,1===t&&e>10]};return i?n.horizontal.some(Boolean):n.vertical.some(Boolean)})(e,a,o),d=(0,n.jsx)(w,{$index:e,style:{width:s},$isHorizontal:o,$opacity:l?1:0,$withTransition:r,children:(0,n.jsx)(b,{children:i.title})});return(0,n.jsxs)(A,{children:[(0,n.jsx)(j,{src:i.image,alt:i.altText}),i.title&&d]})},C=(0,a.i7)({"0%":{clipPath:"polygon(50% 0%, 100% 0%, 100% 100%, 50% 100%)"},"2%":{clipPath:"polygon(calc(50% - 6px) 0%, 100% 0%, 100% 100%, calc(50% - 6px) 100%)"},"5%":{clipPath:"polygon(calc(50% + 5px) 0%, 100% 0%, 100% 100%, calc(50% + 5px) 100%)"},"8%":{clipPath:"polygon(calc(50% - 3px) 0%, 100% 0%, 100% 100%, calc(50% - 3px) 100%)"},"11%":{clipPath:"polygon(calc(50% - 2px) 0%, 100% 0%, 100% 100%, calc(50% - 2px) 100%)"},"13%":{clipPath:"polygon(50% 0%, 100% 0%, 100% 100%, 50% 100%)"}}),O=(0,a.i7)({"0%":{clipPath:"polygon(0% 100%, 0% 50%, 100% 50%, 100% 100%)"},"2%":{clipPath:"polygon(0% 100%, 0% calc(50% - 6px), 100% calc(50% - 6px), 100% 100%)"},"5%":{clipPath:"polygon(0% 100%, 0% calc(50% + 5px), 100% calc(50% + 5px), 100% 100%)"},"8%":{clipPath:"polygon(0% 100%, 0% calc(50% - 3px), 100% calc(50% - 3px), 100% 100%)"},"11%":{clipPath:"polygon(0% 100%, 0% calc(50% - 2px), 100% calc(50% - 2px), 100% 100%)"},"13%":{clipPath:"polygon(0% 100%, 0% 50%, 100% 50%, 100% 100%)"}}),L=a.Ay.div((t=>{let{$withTransition:e,$orientation:i,$disabled:n}=t;return a.AH`
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    ${e&&{transition:`clip-path ${g}`}};

    &:nth-child(2) {
      animation-name: ${i===o.HORIZONTAL?C:O};
      animation-duration: ${n?"unset":d};
      animation-iteration-count: infinite;
      animation-play-state: ${n?"paused":"running"};
      animation-delay: ${d};
    }

    & > * {
      height: 100%;
    }

    > *:not(style) + * {
      height: unset;
    }
  `})),I=t=>{let{images:e,sliderValue:i,isDragging:a,isHorizontal:o,orientation:r,disabled:s}=t;const l=`polygon(0% 0%, 0% ${100-i}%, 100% ${100-i}%, 100% 0%)`,d=i>50&&!o?0:1,c=o?`polygon(${i}% 0, 100% 0%, 100% 100%, ${i}% 100%)`:`polygon(0% 100%, 0% ${100-i}%, 100% ${100-i}%, 100% 100%)`,p=!a;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(L,{style:{clipPath:0===d?l:"",zIndex:0===d?1:0},$orientation:r,$withTransition:p,children:(0,n.jsx)(T,{index:0,image:e[0],sliderValue:i,isHorizontal:o,withTransition:p})}),(0,n.jsx)(L,{style:{clipPath:1===d?c:""},$withTransition:p,$orientation:r,$disabled:s,children:(0,n.jsx)(T,{index:1,image:e[1],sliderValue:i,isHorizontal:o,withTransition:p})})]})};var R=i(82157);const{color:P}=l.iF.themes.newPrimary,H=a.Ay.input((t=>{let{$orientation:e,disabled:i}=t;return Object.assign(Object.assign({width:"100%",height:"100%",opacity:0,cursor:"col-resize"},e===o.VERTICAL&&{writingMode:"vertical-lr",direction:"rtl",verticalAlign:"bottom",cursor:"row-resize"}),i&&Object.assign({},l.iF.mixins.increaseSpecificity({cursor:"move"})))})),V=a.Ay.div((t=>{let{$orientation:e,$disabled:i}=t;return Object.assign({position:"relative",height:"100%",overflow:"hidden",borderRadius:8,[H]:{position:"absolute",top:0,left:0,zIndex:R.T}},!i&&{"&:hover":{[x]:{animationPlayState:"paused"},[L]:{animationPlayState:"paused"},[f]:{fill:P.content.reversed.hover()},[v]:Object.assign({left:-37},e===o.VERTICAL&&{top:-37,left:-16}),[y]:Object.assign({left:5},e===o.VERTICAL&&{top:5,left:-16})}})})),z=a.Ay.p({position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",border:0}),F=t=>{let{images:e,disabled:i=!1,defaultValue:a=50,orientation:l=o.HORIZONTAL}=t;const[d,c]=(0,r.useState)(a),[p,g]=(0,r.useState)(!1),u=(0,r.useRef)(!1),h=l===o.HORIZONTAL;return(0,n.jsxs)(V,{"data-testid":"aspect-ratio-container",$disabled:i,$orientation:l,role:"application","aria-describedby":"juxtapose-instructions","aria-live":"polite",children:[(0,n.jsx)("p",{id:"juxtapose-instructions",style:{display:"none"},hidden:!0,children:(0,s.A)("__new.shared.widget.comparison.accessibilityDescription")}),(0,n.jsx)(z,{id:"juxtapose-status","aria-live":"polite",children:(0,s.A)("__new.shared.widget.comparison.accesibilitySecondImage",{sliderValue:d.toString()})}),(0,n.jsx)(I,{images:e,sliderValue:d,isDragging:u.current,isHorizontal:h,orientation:l,disabled:i||p}),(0,n.jsx)($,{disabled:i||p,orientation:l,sliderValue:d,withTransition:!u.current}),(0,n.jsx)(H,{$orientation:l,$sliderValue:d,disabled:i,type:"range",defaultValue:d,"aria-label":(0,s.A)("__new.shared.widget.comparison.accesibilitySlider"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":d,onMouseDown:()=>{u.current=!1;const t=()=>{p||g(!0),u.current=!0};document.addEventListener("mousemove",t),document.addEventListener("mouseup",(()=>{document.removeEventListener("mousemove",t)}),{once:!0})},onChange:t=>{p||g(!0),c(t.target.valueAsNumber)}})]})},S=t=>{let{images:e,disabled:i=!1}=t;return(0,n.jsx)(F,{disabled:i,orientation:o.HORIZONTAL,images:e})},E=t=>{let{images:e,disabled:i=!1}=t;return(0,n.jsx)(F,{disabled:i,orientation:o.VERTICAL,images:e})},N=t=>{let{images:e,juxtaposeType:i,disabled:r,theme:s}=t;const l=i===o.VERTICAL?E:S;return(0,n.jsx)(a.NP,{theme:s,children:(0,n.jsx)(l,{images:e,disabled:r})})}},5630:(t,e,i)=>{i.r(e),i.d(e,{geniallyJuxtaposeEditorScript:()=>c});var n=i(45992),a=i(54072),o=i(57277),r=i(60052),s=i(22999);var l=i(5425);const d=t=>null!==t,c=t=>{let{script:e,editor:i}=t;const c=e.item;c&&("preserveAspectRatio"in c&&(c.preserveAspectRatio=!0),e.on("configChange",(t=>{let{config:e,prevConfig:n}=t;var a;const{juxtaposeType:o}=e;n&&o!==n.juxtaposeType&&(null===(a=i.trackWidgetPresetChange)||void 0===a||a.call(i,`${l.S.scriptId};${o}`),((t,e)=>{const{width:i,height:n,x:a,y:o}=t,r=t.parentSlide.size,l=r.width>=r.height,d=(0,s.R0)(e),c=l?n*d:i,p=l?n:i/d,g=a-(c-i)/2,u=o-(p-n)/2;t.setSize(c,p),t.setPosition(g,u)})(c,o));const r=(0,s.B_)(o);c.thumbnail!==r&&(c.thumbnail=r)})),(0,o.x)({getTargetNodeItem:()=>e.item,renderApp:()=>{const{slideList:t,juxtaposeType:o}=e.getConfig(),s=t.map((t=>null===t.image.source?null:{image:t.image.source,title:t.title,id:(0,a.Ak)()})).filter(d);return(0,n.jsx)(r.q,{images:s,juxtaposeType:o,disabled:!0,theme:i.theme})},nodePrefix:"juxtapose"})({script:e,editor:i}))}},57277:(t,e,i)=>{i.d(e,{x:()=>a});var n=i(70377);function a(t){let{getTargetNodeItem:e,renderApp:i,nodePrefix:a}=t;return t=>{let{script:o,editor:r}=t,s=null;function l(t){s&&(n.unmountComponentAtNode(s),s=null),t&&"innerHtml"in t&&(t.innerHtml='<div class="card-iframe"><div style="width: 100%; height: 100%; background: #FF0000; color: #FFFFFF;">Deleted</div><script><\/script></div>')}function d(){s&&n.render(i(),s)}function c(){const t=e(o.getConfig());if(!t)return;const i=`${a}-${t.id}`;"innerHtml"in t&&(t.innerHtml=`<div class="card-iframe"><div id="${i}" class="genially-widget-app" style="width: 100%; height: 100%;"></div></div>`),requestAnimationFrame((()=>{s="idOfFreeNode"in t?document.getElementById(t.idOfFreeNode):document.getElementById(i),d()}))}o.on("configChange",(t=>{let{config:i,prevConfig:n}=t;const a=e(i),o=n?e(n):void 0;o&&o!==a&&l(o),a&&(a!==o?c():d())})),o.on("dispose",(()=>{l(e(o.getConfig()))})),r.on("itemMount",(t=>{let{item:e}=t;e===o.item&&c()})),r.on("itemUnmount",(t=>{let{item:e}=t;e===o.item&&l()}))}}}}]);
//# sourceMappingURL=https://s3-static-genially.genially.com/view/static/js/5630.457b6841.chunk.js.map