"use strict";(self.webpackChunk_genially_view_client=self.webpackChunk_genially_view_client||[]).push([[782],{91720:(e,t,a)=>{a.d(t,{Z:()=>c});var n=a(45992),i=a(17588),r=a(97690);const o=e=>({transform:`${e.preTransforms.join(" ")} scale(${e.scale}) rotateX(${e.rotateX}deg) rotateY(${e.rotateY}deg) ${(0,r.Y)(e.rotateZ)}`,transition:e.transitions.join(", "),filter:e.filters.join(" ")});const s=e=>{const[t,a]=(0,i.useState)(null),[r,s]=(0,i.useState)(void 0),[l,c]=(0,i.useState)(void 0),[d,u]=(0,i.useState)(!1),f=(0,i.useRef)(null),h=(0,i.useCallback)((e=>{f.current=e,a(e)}),[]),m=(0,i.useCallback)((a=>{if(!t||e)return;u(!0);const n=t.getBoundingClientRect(),i=(a.clientX-n.left)/n.width,r=(a.clientY-n.top)/n.height,o={coords:{x:Math.min(Math.max(i,0),1),y:Math.min(Math.max(r,0),1)}};s(o),d||c(o)}),[t,d,e]),p=(0,i.useCallback)((()=>{s(void 0),u(!1)}),[]),{innerCardStyle:g,specialFxLayerStyles:b}=function(e){let{hoveringState:t}=e;const a={scale:1,rotateX:0,rotateY:0,rotateZ:0,preTransforms:[],transitions:[],filters:[]};a.rotateZ+=0;const n=[],i=e=>{var t;return null!==(t=n[e])&&void 0!==t||(n[e]={scale:1,rotateX:0,rotateY:0,rotateZ:0,preTransforms:[],transitions:[],filters:[]}),n[e]},r="perspective(1500px)",s=i(0),l=i(1),c="cubic-bezier(0.89, -0.3, 0.18, 1.37)";a.transitions.push(`transform 400ms ${c}`),s.transitions.push("transform 100ms linear"),l.transitions.push(`filter 400ms ${c}`);const d=e=>`drop-shadow(rgba(0, 15, 51, ${e}) 0px 1px 8px)`;if(t){a.preTransforms.push(r),s.preTransforms.push(r),l.filters.push(d(.3)),a.scale+=.05;const{coords:e}=t,n=20;s.rotateX+=n*-(e.y-.5),s.rotateY+=n*(e.x-.5)}else l.filters.push(d(0));return{specialFxLayerStyles:n.filter((e=>!!e)).map((e=>Object.assign(Object.assign({},o(e)),{top:0,bottom:0,left:0,right:0,width:"100%",height:"100%"}))),innerCardStyle:Object.assign({},o(a))}}({hoveringState:!r&&d?l:r}),v=(e,t)=>0===t.length?e:(0,n.jsx)("div",{style:t[0],children:v(e,t.slice(1))});return{handleMouseEnterOrMove:m,handleMouseLeave:p,innerCardStyle:g,specialFxLayerStyles:b,setCardRef:h,wrapInsideStyledCard:v}};var l=a(11833);const c=e=>{let{title:t,frontImageSrc:a,coverImageSrc:i,flipped:r,burned:o,flipAnimated:c,onClick:d,onAnimationEnd:u}=e;const f=Boolean(o),h=Boolean(r),{handleMouseEnterOrMove:m,handleMouseLeave:p,innerCardStyle:g,setCardRef:b,specialFxLayerStyles:v,wrapInsideStyledCard:y}=s(f);return y((0,n.jsxs)(l.Ox,{onMouseMove:m,onMouseEnter:m,onMouseLeave:p,role:"button",style:f?g:{},$burned:f,$flipped:h,$flipAnimated:c,ref:b,onClick:d,onAnimationEnd:u,"aria-label":`Card showing ${h?"front":"back"} side with title: ${t}`,"aria-disabled":f,tabIndex:f?-1:0,children:[(0,n.jsx)(l.$p,{$visible:h,$imageSrc:a,"aria-roledescription":"front-card",children:t&&(0,n.jsx)(l.aW,{hidden:!h,children:(0,n.jsx)(l.hE,{children:t})})}),(0,n.jsx)(l.n$,{$visible:!h,$flipAnimated:c,$imageSrc:i,"aria-roledescription":"cover-card"})]}),v)}},11833:(e,t,a)=>{a.d(t,{$p:()=>m,Ox:()=>g,aW:()=>u,hE:()=>f,n$:()=>p,rl:()=>c});var n=a(37577);const i=(0,n.i7)({"0%":{transform:"rotateY(0)"},"100%":{transform:"rotateY(180deg)"}}),r=(0,n.i7)({"0%":{transform:"rotateY(180deg)"},"100%":{transform:"rotateY(0)"}}),o=(0,n.i7)({"0%":{transform:"rotateY(180deg) scale(1)"},"50%":{transform:"rotateY(0deg) scale(1)"},"62%":{transform:"rotateY(0) scale(1.05, 1.05)"},"72%":{transform:"rotateY(0) scale(1.05, 1.05)"},"100%":{transform:"rotateY(0) scale(1)"}}),s=(0,n.i7)({"0%":{transform:"scale(1)"},"50%":{transform:"scale(1)"},"62%":{transform:"scale(1.05, 1.05)"},"72%":{transform:"scale(1.05, 1.05)"},"100%":{transform:"scale(1)"}}),l=(0,n.i7)({"0%":{opacity:0},"100%":{opacity:.4}}),c=1e3,d=c/3.4,u=n.Ay.div({display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0,position:"absolute",paddingLeft:"12px",paddingRight:"12px",bottom:0,left:0,userSelect:"none",minHeight:"25%",top:"75%",width:"100%",backgroundColor:"rgba(18,18,18,0.5)"}),f=n.Ay.p({color:"white",fontSize:12,textAlign:"center",fontStyle:"normal",fontWeight:400,lineHeight:"16px",overflow:"hidden",textOverflow:"ellipsis",wordWrap:"break-word",whiteSpace:"nowrap",pointerEvents:"none"}),h=n.Ay.div((e=>{let{$visible:t,$imageSrc:a}=e;return{width:"100%",height:t?"100%":0,transition:`height ${d}ms steps(1)`,backgroundImage:`url(${a})`,backgroundSize:"cover",backgroundPosition:"center",cursor:"default",[u]:{visibility:t?"initial":"hidden",transition:`visibility ${d}ms steps(1)`}}})),m=h,p=(0,n.Ay)(h)((e=>{let{$visible:t,$flipAnimated:a}=e;return a&&n.AH`
      animation-name: ${t?i:r};
      animation-duration: ${c}ms;
      animation-iteration-count: 1;
    `}),{cursor:"pointer"}),g=n.Ay.div((e=>{let{$flipped:t,$flipAnimated:a}=e;return a&&n.AH`
      animation-name: ${t?r:i};
      animation-duration: ${c}ms;
      animation-iteration-count: 1;
    `}),(e=>{let{$burned:t,$flipAnimated:a}=e;return t&&n.AH`
      animation-name: ${a?o:s};
      animation-duration: ${2*c}ms;
      animation-iteration-count: 1;
      animation-fill-mode: forwards;
      ${m} {
        &::before {
          animation-name: ${l};
          animation-duration: ${2*c}ms;
          animation-timing-function: steps(1);
          animation-fill-mode: forwards;
        }
      }
    `}),(e=>{let{theme:{color:t,borderRadius:a},$burned:n}=e;return Object.assign(Object.assign({position:"relative",borderRadius:a.large,border:"1px solid",borderColor:t.border.primary.default(),overflow:"hidden",flexShrink:0,width:"100%",height:"100%",filter:"drop-shadow(0px 1px 4px rgba(0, 15, 51, 0.20))",perspective:"1500px","&:hover":{filter:"drop-shadow(rgba(0, 15, 51, 0.3) 0px 1px 8px)",borderColor:t.border.primary.hover()}},n&&{borderColor:t.border.primary.disabled(),filter:"","&:hover":{filter:"",borderColor:t.border.primary.disabled()}}),{[m]:Object.assign({},n&&{"&::before":{content:"",position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"white",pointerEvents:"none"}})})}))},63107:(e,t,a)=>{a.d(t,{V:()=>i,m:()=>r});var n=a(37577);const i=n.Ay.div`
  display: grid;
  grid-template-columns: repeat(${e=>e.totalItems/2}, minmax(0, 1fr));
  grid-template-rows: repeat(2, 1fr);
  height: 100%;
  gap: 16px;
  padding: 8px;
`,r=n.Ay.canvas({width:"100%",height:"100%",pointerEvents:"none",position:"absolute",top:0,left:0,zIndex:3})},70782:(e,t,a)=>{a.r(t),a.d(t,{geniallyFindThePairViewScript:()=>w});var n=a(45992),i=a(54072),r=a(41381),o=a(17588),s={};!function e(t,a,n,i){var r=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),o="function"===typeof Path2D&&"function"===typeof DOMMatrix,s=function(){if(!t.OffscreenCanvas)return!1;var e=new OffscreenCanvas(1,1),a=e.getContext("2d");a.fillRect(0,0,1,1);var n=e.transferToImageBitmap();try{a.createPattern(n,"no-repeat")}catch(i){return!1}return!0}();function l(){}function c(e){var n=a.exports.Promise,i=void 0!==n?n:t.Promise;return"function"===typeof i?new i(e):(e(l,l),null)}var d,u,f,h=(d=s,u=new Map,{transform:function(e){if(d)return e;if(u.has(e))return u.get(e);var t=new OffscreenCanvas(e.width,e.height);return t.getContext("2d").drawImage(e,0,0),u.set(e,t),t},clear:function(){u.clear()}}),m=function(){var e,t,a=Math.floor(1e3/60),n={},i=0;return"function"===typeof requestAnimationFrame&&"function"===typeof cancelAnimationFrame?(e=function(e){var t=Math.random();return n[t]=requestAnimationFrame((function r(o){i===o||i+a-1<o?(i=o,delete n[t],e()):n[t]=requestAnimationFrame(r)})),t},t=function(e){n[e]&&cancelAnimationFrame(n[e])}):(e=function(e){return setTimeout(e,a)},t=function(e){return clearTimeout(e)}),{frame:e,cancel:t}}(),p=function(){var t,a,i={};return function(){if(t)return t;if(!n&&r){var o=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {","  if (msg.data.options) {","    CONFETTI(msg.data.options).then(function () {","      if (msg.data.callback) {","        postMessage({ callback: msg.data.callback });","      }","    });","  } else if (msg.data.reset) {","    CONFETTI && CONFETTI.reset();","  } else if (msg.data.resize) {","    SIZE.width = msg.data.resize.width;","    SIZE.height = msg.data.resize.height;","  } else if (msg.data.canvas) {","    SIZE.width = msg.data.canvas.width;","    SIZE.height = msg.data.canvas.height;","    CONFETTI = module.exports.create(msg.data.canvas);","  }","}"].join("\n");try{t=new Worker(URL.createObjectURL(new Blob([o])))}catch(s){return void 0!==typeof console&&"function"===typeof console.warn&&console.warn("\ud83c\udf8a Could not load worker",s),null}!function(e){function t(t,a){e.postMessage({options:t||{},callback:a})}e.init=function(t){var a=t.transferControlToOffscreen();e.postMessage({canvas:a},[a])},e.fire=function(n,r,o){if(a)return t(n,null),a;var s=Math.random().toString(36).slice(2);return a=c((function(r){function l(t){t.data.callback===s&&(delete i[s],e.removeEventListener("message",l),a=null,h.clear(),o(),r())}e.addEventListener("message",l),t(n,s),i[s]=l.bind(null,{data:{callback:s}})}))},e.reset=function(){for(var t in e.postMessage({reset:!0}),i)i[t](),delete i[t]}}(t)}return t}}(),g={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function b(e,t,a){return function(e,t){return t?t(e):e}(e&&(null!==(n=e[t])&&void 0!==n)?e[t]:g[t],a);var n}function v(e){return e<0?0:Math.floor(e)}function y(e){return parseInt(e,16)}function w(e){return e.map(M)}function M(e){var t=String(e).replace(/[^0-9a-f]/gi,"");return t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),{r:y(t.substring(0,2)),g:y(t.substring(2,4)),b:y(t.substring(4,6))}}function x(e){e.width=document.documentElement.clientWidth,e.height=document.documentElement.clientHeight}function C(e){var t=e.getBoundingClientRect();e.width=t.width,e.height=t.height}function S(e){var t=e.angle*(Math.PI/180),a=e.spread*(Math.PI/180);return{x:e.x,y:e.y,wobble:10*Math.random(),wobbleSpeed:Math.min(.11,.1*Math.random()+.05),velocity:.5*e.startVelocity+Math.random()*e.startVelocity,angle2D:-t+(.5*a-Math.random()*a),tiltAngle:(.5*Math.random()+.25)*Math.PI,color:e.color,shape:e.shape,tick:0,totalTicks:e.ticks,decay:e.decay,drift:e.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:3*e.gravity,ovalScalar:.6,scalar:e.scalar,flat:e.flat}}function A(e,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);var a=t.tick++/t.totalTicks,n=t.x+t.random*t.tiltCos,i=t.y+t.random*t.tiltSin,r=t.wobbleX+t.random*t.tiltCos,s=t.wobbleY+t.random*t.tiltSin;if(e.fillStyle="rgba("+t.color.r+", "+t.color.g+", "+t.color.b+", "+(1-a)+")",e.beginPath(),o&&"path"===t.shape.type&&"string"===typeof t.shape.path&&Array.isArray(t.shape.matrix))e.fill(function(e,t,a,n,i,r,o){var s=new Path2D(e),l=new Path2D;l.addPath(s,new DOMMatrix(t));var c=new Path2D;return c.addPath(l,new DOMMatrix([Math.cos(o)*i,Math.sin(o)*i,-Math.sin(o)*r,Math.cos(o)*r,a,n])),c}(t.shape.path,t.shape.matrix,t.x,t.y,.1*Math.abs(r-n),.1*Math.abs(s-i),Math.PI/10*t.wobble));else if("bitmap"===t.shape.type){var l=Math.PI/10*t.wobble,c=.1*Math.abs(r-n),d=.1*Math.abs(s-i),u=t.shape.bitmap.width*t.scalar,f=t.shape.bitmap.height*t.scalar,m=new DOMMatrix([Math.cos(l)*c,Math.sin(l)*c,-Math.sin(l)*d,Math.cos(l)*d,t.x,t.y]);m.multiplySelf(new DOMMatrix(t.shape.matrix));var p=e.createPattern(h.transform(t.shape.bitmap),"no-repeat");p.setTransform(m),e.globalAlpha=1-a,e.fillStyle=p,e.fillRect(t.x-u/2,t.y-f/2,u,f),e.globalAlpha=1}else if("circle"===t.shape)e.ellipse?e.ellipse(t.x,t.y,Math.abs(r-n)*t.ovalScalar,Math.abs(s-i)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):function(e,t,a,n,i,r,o,s,l){e.save(),e.translate(t,a),e.rotate(r),e.scale(n,i),e.arc(0,0,1,o,s,l),e.restore()}(e,t.x,t.y,Math.abs(r-n)*t.ovalScalar,Math.abs(s-i)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI);else if("star"===t.shape)for(var g=Math.PI/2*3,b=4*t.scalar,v=8*t.scalar,y=t.x,w=t.y,M=5,x=Math.PI/M;M--;)y=t.x+Math.cos(g)*v,w=t.y+Math.sin(g)*v,e.lineTo(y,w),g+=x,y=t.x+Math.cos(g)*b,w=t.y+Math.sin(g)*b,e.lineTo(y,w),g+=x;else e.moveTo(Math.floor(t.x),Math.floor(t.y)),e.lineTo(Math.floor(t.wobbleX),Math.floor(i)),e.lineTo(Math.floor(r),Math.floor(s)),e.lineTo(Math.floor(n),Math.floor(t.wobbleY));return e.closePath(),e.fill(),t.tick<t.totalTicks}function E(e,a){var o,s=!e,l=!!b(a||{},"resize"),d=!1,u=b(a,"disableForReducedMotion",Boolean),f=r&&!!b(a||{},"useWorker")?p():null,g=s?x:C,y=!(!e||!f)&&!!e.__confetti_initialized,M="function"===typeof matchMedia&&matchMedia("(prefers-reduced-motion)").matches;function E(t,a,r){for(var s,l,d=b(t,"particleCount",v),u=b(t,"angle",Number),f=b(t,"spread",Number),p=b(t,"startVelocity",Number),y=b(t,"decay",Number),M=b(t,"gravity",Number),x=b(t,"drift",Number),C=b(t,"colors",w),E=b(t,"ticks",Number),O=b(t,"shapes"),I=b(t,"scalar"),F=!!b(t,"flat"),j=function(e){var t=b(e,"origin",Object);return t.x=b(t,"x",Number),t.y=b(t,"y",Number),t}(t),T=d,k=[],$=e.width*j.x,P=e.height*j.y;T--;)k.push(S({x:$,y:P,angle:u,spread:f,startVelocity:p,color:C[T%C.length],shape:O[(s=0,l=O.length,Math.floor(Math.random()*(l-s))+s)],ticks:E,decay:y,gravity:M,drift:x,scalar:I,flat:F}));return o?o.addFettis(k):(o=function(e,t,a,r,o){var s,l,d=t.slice(),u=e.getContext("2d"),f=c((function(t){function c(){s=l=null,u.clearRect(0,0,r.width,r.height),h.clear(),o(),t()}s=m.frame((function t(){!n||r.width===i.width&&r.height===i.height||(r.width=e.width=i.width,r.height=e.height=i.height),r.width||r.height||(a(e),r.width=e.width,r.height=e.height),u.clearRect(0,0,r.width,r.height),(d=d.filter((function(e){return A(u,e)}))).length?s=m.frame(t):c()})),l=c}));return{addFettis:function(e){return d=d.concat(e),f},canvas:e,promise:f,reset:function(){s&&m.cancel(s),l&&l()}}}(e,k,g,a,r),o.promise)}function O(a){var n=u||b(a,"disableForReducedMotion",Boolean),i=b(a,"zIndex",Number);if(n&&M)return c((function(e){e()}));s&&o?e=o.canvas:s&&!e&&(e=function(e){var t=document.createElement("canvas");return t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",t.style.zIndex=e,t}(i),document.body.appendChild(e)),l&&!y&&g(e);var r={width:e.width,height:e.height};function h(){if(f){var t={getBoundingClientRect:function(){if(!s)return e.getBoundingClientRect()}};return g(t),void f.postMessage({resize:{width:t.width,height:t.height}})}r.width=r.height=null}function m(){o=null,l&&(d=!1,t.removeEventListener("resize",h)),s&&e&&(document.body.contains(e)&&document.body.removeChild(e),e=null,y=!1)}return f&&!y&&f.init(e),y=!0,f&&(e.__confetti_initialized=!0),l&&!d&&(d=!0,t.addEventListener("resize",h,!1)),f?f.fire(a,r,m):E(a,r,m)}return O.reset=function(){f&&f.reset(),o&&o.reset()},O}function O(){return f||(f=E(null,{useWorker:!0,resize:!0})),f}a.exports=function(){return O().apply(this,arguments)},a.exports.reset=function(){O().reset()},a.exports.create=E,a.exports.shapeFromPath=function(e){if(!o)throw new Error("path confetti are not supported in this browser");var t,a;"string"===typeof e?t=e:(t=e.path,a=e.matrix);var n=new Path2D(t),i=document.createElement("canvas").getContext("2d");if(!a){for(var r,s,l=1e3,c=l,d=l,u=0,f=0,h=0;h<l;h+=2)for(var m=0;m<l;m+=2)i.isPointInPath(n,h,m,"nonzero")&&(c=Math.min(c,h),d=Math.min(d,m),u=Math.max(u,h),f=Math.max(f,m));r=u-c,s=f-d;var p=Math.min(10/r,10/s);a=[p,0,0,p,-Math.round(r/2+c)*p,-Math.round(s/2+d)*p]}return{type:"path",path:t,matrix:a}},a.exports.shapeFromText=function(e){var t,a=1,n="#000000",i='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';"string"===typeof e?t=e:(t=e.text,a="scalar"in e?e.scalar:a,i="fontFamily"in e?e.fontFamily:i,n="color"in e?e.color:n);var r=10*a,o=r+"px "+i,s=new OffscreenCanvas(r,r),l=s.getContext("2d");l.font=o;var c=l.measureText(t),d=Math.ceil(c.actualBoundingBoxRight+c.actualBoundingBoxLeft),u=Math.ceil(c.actualBoundingBoxAscent+c.actualBoundingBoxDescent),f=c.actualBoundingBoxLeft+2,h=c.actualBoundingBoxAscent+2;d+=4,u+=4,(l=(s=new OffscreenCanvas(d,u)).getContext("2d")).font=o,l.fillStyle=n,l.fillText(t,f,h);var m=1/a;return{type:"bitmap",bitmap:s.transferToImageBitmap(),matrix:[m,0,0,m,-d*m/2,-u*m/2]}}}(function(){return"undefined"!==typeof window?window:"undefined"!==typeof self?self:this||{}}(),s,!1);const l=s.exports;s.exports.create;var c=a(37577),d=a(91720);var u;!function(e){e.FACEDOWN="faceDown",e.FACEUP="faceUp",e.BURNED="burned"}(u||(u={}));const f=e=>`${e}-original`,h=e=>`${e}-pair`;var m=a(11833),p=a(63107);const g=e=>{let{theme:t,images:a,coverImageSrc:i,onSuccess:r,onFailure:s}=e;const g=(0,o.useRef)(),{shuffledCards:b,isFaceUp:v,isBurned:y,isFlipAnimated:w,onClick:M}=((e,t,a,n)=>{const i=(0,o.useMemo)((()=>e.flatMap((e=>[Object.assign(Object.assign({},e),{id:f(e.id),pairId:h(e.id)}),Object.assign(Object.assign({},e),{id:h(e.id),pairId:f(e.id)})])).sort((()=>Math.random()-.5))),[e]),[r,s]=(0,o.useState)((()=>{const e=new Map;return i.forEach((t=>{e.set(t.id,{id:t.id,status:u.FACEDOWN,pairId:t.pairId,isFlipAnimated:!0})})),e})),l=(0,o.useCallback)((e=>{var t;return(null===(t=r.get(e))||void 0===t?void 0:t.status)===u.FACEUP}),[r]),c=(0,o.useCallback)((e=>{var t;return(null===(t=r.get(e))||void 0===t?void 0:t.status)===u.BURNED}),[r]),d=(0,o.useCallback)((e=>{var t;return Boolean(null===(t=r.get(e))||void 0===t?void 0:t.isFlipAnimated)}),[r]);return{shuffledCards:i,isFaceUp:l,isBurned:c,isFlipAnimated:d,onClick:e=>{const i=r.get(e);if(i.status!==u.FACEDOWN)return;const o=[...r.values()].filter((e=>e.status===u.FACEUP));if(0===o.length)r.set(i.id,Object.assign(Object.assign({},i),{status:u.FACEUP,isFlipAnimated:!0}));else if(1===o.length){const e=o[0];e.pairId===i.id?(r.set(e.id,Object.assign(Object.assign({},e),{status:u.BURNED,isFlipAnimated:!1})),r.set(i.id,Object.assign(Object.assign({},i),{status:u.BURNED,isFlipAnimated:!0})),t()):(r.set(i.id,Object.assign(Object.assign({},i),{status:u.FACEUP,isFlipAnimated:!0})),a())}else 2===o.length&&(o.forEach((e=>{r.set(e.id,Object.assign(Object.assign({},e),{status:u.FACEDOWN}))})),r.set(i.id,Object.assign(Object.assign({},i),{status:u.FACEUP,isFlipAnimated:!0})));s(new Map(r)),[...r.values()].every((e=>e.status===u.BURNED))&&n()}}})(a,(()=>{setTimeout((()=>{r()}),m.rl)}),(()=>{setTimeout((()=>{s()}),m.rl)}),(()=>{setTimeout((()=>{var e;e=g,l.create(e.current,{resize:!0})(Object.assign(Object.assign({},{particleCount:150,startVelocity:20,spread:150,ticks:60,zIndex:0,disableForReducedMotion:!0}),{disableForReducedMotion:!0,shapes:["circle"]}))}),m.rl)}));return(0,n.jsxs)(c.NP,{theme:t,children:[(0,n.jsx)(p.m,{ref:g}),(0,n.jsx)(p.V,{totalItems:b.length,children:b.map((e=>(0,n.jsx)(d.Z,{title:e.title,frontImageSrc:e.src,coverImageSrc:i,flipped:v(e.id)||y(e.id),burned:y(e.id),flipAnimated:w(e.id),onClick:()=>M(e.id)},e.id)))})]})},b=e=>null!==e,v="https://audios.genial.ly/59e059d30b9c21060cb4c2ec/de8b3efe-c4df-48ff-8bbb-2b3e940663d3.wav",y="https://audios.genial.ly/59e059d30b9c21060cb4c2ec/23fe908b-44e2-4972-981f-d857c429b126.wav",w=(e,t)=>{(0,r.p)({getTargetNodeItem:()=>e.item,initialState:void 0,renderApp:()=>{const{itemList:a,coverImage:r}=e.config,o=a.map((e=>null===e.image.source?null:{src:e.image.source,title:e.title,id:(0,i.Ak)()})).filter(b);t.preloadAudio(v),t.preloadAudio(y);const s=()=>{t.playAudio({source:v})},l=()=>{t.playAudio({source:y})};return()=>(0,n.jsx)(g,{theme:t.theme,images:o,coverImageSrc:String(r.source),onSuccess:s,onFailure:l})}})(e,t)}},41381:(e,t,a)=>{a.d(t,{p:()=>o});var n=a(70377),i=a(66264),r=a(60708);function o(e){let{getTargetNodeItem:t,renderApp:a,initialState:o}=e,s=!1;const l=[],c=e=>{l.push(e)};return e=>{const d=t(e.config),u=null===d||void 0===d?void 0:d.parentSlide;function f(){if(!d)return;let e=null;if("idOfFreeNode"in d)e=document.getElementById(d.idOfFreeNode);else{const t=document.createElement("div");t.innerHTML=d.source;let a=t.getElementsByClassName("genially-widget-app");a.length||(a=t.getElementsByClassName("genially-widget-gallery"));const{id:n}=a[0];if(!n)return;e=document.getElementById(n)}if(e){const t=i=>{if(s){const r=a({setState:t,onUnmount:c});n.render(r(i),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"?')};s=!0,t(o),l.push((()=>{n.unmountComponentAtNode(e)}))}}function h(){s=!1,l.forEach((e=>{e()})),l.length=0}null===d||void 0===d||d.on(i.q.Mount,(()=>{f()})),null===d||void 0===d||d.on(i.q.Unmount,(()=>{h()})),d&&"isTransversal"in d&&d.isTransversal?f():null===u||void 0===u||u.on(r.m.Entering,(()=>{s||f()})),null===u||void 0===u||u.on(r.m.Exited,(()=>{d&&"isTransversal"in d&&d.isTransversal||s&&h()}))}}}}]);
//# sourceMappingURL=https://s3-static-genially.genially.com/view/static/js/782.bbc42320.chunk.js.map