"use strict";(self.webpackChunk_genially_view_client=self.webpackChunk_genially_view_client||[]).push([[639],{95881(e,t,i){i.d(t,{q:()=>A});var s=i(45992),o=i(37577),a=i(17588),n=i(70377);const r=o.i7`
  from { opacity: 0; transform: translateX(-50%) translateY(4px)  scale(0.95); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0)     scale(1);   }
`,l=o.i7`
  from { opacity: 0; transform: translateX(-50%) translateY(-4px) scale(0.95); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0)    scale(1);   }
`,u=o.Ay.div`
  position: absolute;
  ${e=>{let{$placement:t}=e;return"top"===t?o.AH`
          bottom: calc(100% + 8px);
          top: auto;
          animation: ${l} 0.2s ease-out;
        `:o.AH`
          bottom: 8px;
          top: auto;
          animation: ${r} 0.2s ease-out;
        `}}
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  min-width: 120px;
  max-width: 220px;
  background: #ffffff;
  border-radius: 12px;
  /* !important needed: .genially-embed div reset overrides with padding: 0 */
  padding: 12px 20px !important;
  font-family: 'Comic Sans MS', 'Chalkboard SE', cursive, sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  color: #1a1a1a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  z-index: 10;
  text-align: center;
  white-space: normal;
  word-break: break-word;

  /* tail pointing toward the avatar */
  &::before {
    content: '';
    position: absolute;
    ${e=>{let{$placement:t}=e;return"top"===t?o.AH`
            bottom: -5px;
            top: auto;
          `:o.AH`
            top: -5px;
            bottom: auto;
          `}}
    left: 50%;
    width: 10px;
    height: 10px;
    background: #ffffff;
    transform: translateX(-50%) rotate(45deg);
    border-radius: 2px;
  }
`,d=e=>{let{controller:t,placement:i}=e;const[o,n]=(0,a.useState)(null);return(0,a.useEffect)((()=>(n(null),t?t.subscribeBubble(n):()=>{})),[t]),o?(0,s.jsx)(u,{$placement:i,role:"status","aria-live":"polite",children:o.text}):null};const c=.5,h=100;class m{constructor(){this.mode="static",this.slideBounds=null,this.avatarBounds=null,this.reactiveItemIds=[],this.isDragging=!1,this.offsetX=0,this.offsetY=0,this.targetX=0,this.targetY=0,this.velX=0,this.velY=0,this.assistantLeft=0,this.assistantTop=0,this.cursorX=0,this.cursorY=0,this.lastCursorForReeval={x:0,y:0},this.inactivityTimer=null,this.anchorHistory=[],this.rafId=null,this.listeners=new Set,this.disposed=!1,this.lastClosestId=null,this.onTargetItemChanged=null,this.reduceMotion="undefined"!==typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.tick=()=>{if(this.rafId=null,this.disposed)return;if("assistant"===this.mode)return void this.tickAssistant();if(this.reduceMotion)this.offsetX=this.targetX,this.offsetY=this.targetY,this.velX=0,this.velY=0;else{const e=.12*(this.targetX-this.offsetX),t=.12*(this.targetY-this.offsetY);this.velX=.72*(this.velX+e),this.velY=.72*(this.velY+t),this.offsetX+=this.velX,this.offsetY+=this.velY}this.notify();Math.abs(this.targetX-this.offsetX)<c&&Math.abs(this.targetY-this.offsetY)<c&&Math.abs(this.velX)<c&&Math.abs(this.velY)<c?(this.offsetX=this.targetX,this.offsetY=this.targetY,this.velX=0,this.velY=0,this.notify()):this.rafId=requestAnimationFrame(this.tick)}}setMode(e){if(!this.disposed&&e!==this.mode){if(this.mode=e,this.cancelInactivityTimer(),this.cancelRaf(),this.velX=0,this.velY=0,"static"===e)return this.targetX=0,this.targetY=0,this.offsetX=0,this.offsetY=0,this.notify(),void this.startRaf();if("wanderer"!==e){if("interactive"===e)return this.offsetX=0,this.offsetY=0,this.notify(),void this.updateReactiveTarget();this.avatarBounds&&(this.assistantLeft=this.avatarBounds.left,this.assistantTop=this.avatarBounds.top),this.notify(),this.startRaf()}else this.scheduleInactivity()}}setSlideBounds(e){this.disposed||(this.slideBounds=e)}setAvatarBounds(e){if(this.disposed)return;const t=this.avatarBounds;this.avatarBounds=e,"interactive"===this.mode&&null!==t&&Math.abs(e.left-t.left)>2&&(this.lastCursorForReeval={x:-9999,y:-9999})}getOffset(){return{x:this.offsetX,y:this.offsetY}}setReactiveItemIds(e){this.disposed||(this.reactiveItemIds=e,this.lastClosestId=null,this.lastCursorForReeval={x:-9999,y:-9999})}setDragging(e){this.disposed||(this.isDragging=e,e||"interactive"!==this.mode||this.updateReactiveTarget())}setCursor(e,t){if(!this.disposed&&(this.cursorX=e,this.cursorY=t,"wanderer"===this.mode&&this.onActivity(),"interactive"===this.mode&&!this.isDragging)){const i=e-this.lastCursorForReeval.x,s=t-this.lastCursorForReeval.y;Math.hypot(i,s)>60&&(this.lastCursorForReeval={x:e,y:t},this.updateReactiveTarget())}}onActivity(){this.disposed||"wanderer"===this.mode&&(this.cancelInactivityTimer(),this.scheduleInactivity())}subscribe(e){return this.listeners.add(e),e(this.currentState()),()=>this.listeners.delete(e)}dispose(){this.disposed=!0,this.cancelRaf(),this.cancelInactivityTimer(),this.listeners.clear(),this.onTargetItemChanged=null}currentState(){return"assistant"===this.mode?{kind:"fixed",left:this.assistantLeft,top:this.assistantTop}:{kind:"offset",x:this.offsetX,y:this.offsetY}}startRaf(){null===this.rafId&&(this.rafId=requestAnimationFrame(this.tick))}cancelRaf(){null!==this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null)}tickAssistant(){const e=-h/2;const t=this.cursorX+24,i=this.cursorY+e,s=this.clampViewport(t,i);this.reduceMotion?(this.assistantLeft=s.x,this.assistantTop=s.y):(this.assistantLeft+=.1*(s.x-this.assistantLeft),this.assistantTop+=.1*(s.y-this.assistantTop)),this.notify(),this.rafId=requestAnimationFrame(this.tick)}updateReactiveTarget(){var e;if(this.isDragging||!this.avatarBounds)return this.targetX=0,this.targetY=0,void this.startRaf();const t=this.queryReactiveItemBounds();if(0===t.length)return this.targetX=0,this.targetY=0,void this.startRaf();let i=t[0],s=1/0;for(const g of t){const e=g.bounds.left+g.bounds.width/2,t=g.bounds.top+g.bounds.height/2,o=Math.hypot(this.cursorX-e,this.cursorY-t);o<s&&(s=o,i=g)}i.id!==this.lastClosestId&&(this.lastClosestId=i.id,null===(e=this.onTargetItemChanged)||void 0===e||e.call(this));const{bounds:o}=i,a=this.avatarBounds.width,n=this.avatarBounds.height,r=o.top+o.height/2,l=o.left+o.width+4+a/2,u=o.left-4-a/2,d=this.cursorX>=o.left+o.width/2,c=!this.slideBounds||l+a/2<=this.slideBounds.left+this.slideBounds.width,h=!this.slideBounds||u-a/2>=this.slideBounds.left;let m;m=d?c?l:u:h?u:l;const v=this.clampToBounds(m,r),f=this.avatarBounds.left+a/2,p=this.avatarBounds.top+n/2;this.targetX=v.x-f,this.targetY=v.y-p,this.startRaf()}queryReactiveItemBounds(){return this.reactiveItemIds.flatMap((e=>{const t=document.querySelector(`[data-item-id="${e}"]`);if(!t)return[];const i=t.getBoundingClientRect();return 0===i.width&&0===i.height?[]:[{id:e,bounds:{left:i.left,top:i.top,width:i.width,height:i.height}}]}))}scheduleInactivity(){this.inactivityTimer=setTimeout((()=>{this.inactivityTimer=null,this.wander()}),8e3)}cancelInactivityTimer(){null!==this.inactivityTimer&&(clearTimeout(this.inactivityTimer),this.inactivityTimer=null)}wander(){if(!this.slideBounds||!this.avatarBounds)return;const e=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.12;const i=e.width*t,s=e.height*t,o=e.left+i,a=e.left+e.width-i,n=e.top+s,r=e.top+e.height-s,l=e.left+e.width/2,u=e.top+e.height/2;return[{x:o,y:n},{x:l,y:n},{x:a,y:n},{x:o,y:u},{x:l,y:u},{x:a,y:u},{x:o,y:r},{x:l,y:r},{x:a,y:r}]}(this.slideBounds),t=function(e,t){const i=new Set(t.map((e=>`${Math.round(e.x)},${Math.round(e.y)}`))),s=e.filter((e=>!i.has(`${Math.round(e.x)},${Math.round(e.y)}`))),o=s.length>0?s:e;return o[Math.floor(Math.random()*o.length)]}(e,this.anchorHistory.slice(-2));this.anchorHistory.push(t),this.anchorHistory.length>4&&this.anchorHistory.shift();const i=this.avatarBounds.left+this.avatarBounds.width/2,s=this.avatarBounds.top+this.avatarBounds.height/2;this.targetX=t.x-i,this.targetY=t.y-s,this.startRaf(),this.scheduleInactivity()}clampToBounds(e,t){if(!this.slideBounds||!this.avatarBounds)return{x:e,y:t};const i=this.avatarBounds.width/2,s=this.avatarBounds.height/2;return{x:Math.max(this.slideBounds.left+i,Math.min(this.slideBounds.left+this.slideBounds.width-i,e)),y:Math.max(this.slideBounds.top+s,Math.min(this.slideBounds.top+this.slideBounds.height-s,t))}}clampViewport(e,t){return{x:Math.max(8,Math.min(window.innerWidth-h-8,e)),y:Math.max(8,Math.min(window.innerHeight-h-8,t))}}notify(){const e=this.currentState();for(const t of this.listeners)t(e)}}var v=i(60053),f=i(1425),p=i(83043),g=i(48571),b=i(32297);const y=["es","en","pt","fr","de","it"],w={es:{question:["\xbfSabes la respuesta?","\xa1A ver qu\xe9 sabes!","\xa1Responde y demu\xe9stralo!","\xbfQu\xe9 opinas?","\xa1Atr\xe9vete a responder!","\xbfTienes la respuesta?","\xa1Hay una pregunta para ti!","Pi\xe9nsalo bien\u2026","\xa1A ver qu\xe9 piensas!","\xa1Vamos, t\xfa puedes responderla!"],moving:["\xa1S\xedgueme!","\xa1Por aqu\xed!","\xa1Mira lo que encontr\xe9!","\xa1Ven, hay algo aqu\xed!","\xa1Psst, por aqu\xed!","\xa1\xc9chale un ojo a esto!","\xa1He encontrado algo para ti!","\xa1Ven conmigo!"],idle:["\xbfProbamos a arrastrar algo?","\xa1A ver qu\xe9 pasa!","Arrastra los elementos a su sitio","\xbfVes los objetos? \xa1Mu\xe9velos!","El truco est\xe1 en arrastrar y soltar","\xa1Vamos, mueve esas piezas!","\xbfTe atreves a arrastrarlo?","Int\xe9ntalo, mueve algo","\xa1Prueba a colocar las piezas!","\xa1Hay algo que encaja aqu\xed!"],poke:["\xa1Eso hace cosquillas!","\xbfQu\xe9 haces?","\xa1Para, para!","Soy un avatar, \xa1no un bot\xf3n!","\xa1Oye, cuidado!","Jeje\u2026 eso ha molado","\xa1Buenas! \xbfMe necesitas?","\xa1Eh, que estoy aqu\xed!","Otro click m\xe1s y me pongo a bailar","\xbfMe est\xe1s probando?","\xa1Uf, casi me caigo!","\xa1Hola a ti tambi\xe9n!"],dragging:["\xa1T\xfa puedes!","Su\xe9ltalo donde toque","\xa1Casi lo tienes!","\xa1Venga, un poco m\xe1s!","\xa1Eso es, sigue as\xed!","\xa1Conf\xedo en ti!","\xa1Dale, dale!","\xbfAd\xf3nde va eso?"],success:["\xa1Bien hecho!","\xa1Lo lograste!","\xa1Perfecto!","\xa1Eso es!","\xa1Genial!","\xa1Sab\xeda que pod\xedas!","\xa1Incre\xedble!","\xa110 sobre 10!","\xa1Eres una m\xe1quina!","\xa1Toma ya!"],failure:["Casi, vuelve a intentarlo","No pasa nada, prueba otra vez","\xa1\xc1nimo, puedes hacerlo!","Ups, \xa1int\xe9ntalo de nuevo!","Casi casi\u2026","La pr\xf3xima seguro que s\xed","\xa1No te rindas!","Un intento m\xe1s, \xa1venga!","\xa1Fallo bueno, el que ense\xf1a!","Sigue probando, \xa1lo tienes!"]},en:{question:["Do you know the answer?","Let's see what you know!","Answer and prove it!","What do you think?","Dare to answer?","Got the answer?","There is a question for you!","Take your time and think\u2026","What's your take on this?","Come on, you can do it!"],moving:["Follow me!","Over here!","Look what I found!","Come, there is something here!","Psst, this way!","Take a look at this!","Found something for you!","Come with me!"],idle:["Try dragging something!","Let's see what happens!","Drag the elements to the right place","See those objects? Move them!","Give drag and drop a shot!","Something here fits somewhere\u2026","Come on, move those pieces!","Dare to drag it?","Try placing the pieces!","There is a perfect spot for each one!"],poke:["That tickles!","Hey, easy there!","Stop poking me!","I'm an avatar, not a button!","Did you just\u2026 click me?","Hehe, that was fun!","Hello to you too!","One more click and I start dancing!","Are you testing me?","Whoa, almost fell over!","Yes, I am here!","Fancy seeing you click me!"],dragging:["You got this!","Drop it where it belongs","Almost there!","Come on, a bit further!","That's it, keep going!","I believe in you!","Go, go, go!","Where are you taking that?"],success:["Great job!","You nailed it!","Perfect!","Yes!","Awesome!","I knew you could do it!","Incredible!","10 out of 10!","You are on fire!","Boom!"],failure:["Almost, try again!","No worries, give it another go","You can do it!","Oops, try once more!","So close\u2026","Next time for sure!","Don't give up!","One more try, come on!","Every mistake is a lesson!","Keep going, you have got this!"]},pt:{question:["Voc\xea sabe a resposta?","Vamos ver o que voc\xea sabe!","Responda e prove!","O que voc\xea acha?","Ouse responder?","Tem a resposta?","H\xe1 uma pergunta para voc\xea!","Pense bem\u2026","Qual \xe9 a sua opini\xe3o?","Vamos, voc\xea pode responder!"],moving:["Siga-me!","Por aqui!","Veja o que encontrei!","Venha, h\xe1 algo aqui!","Psst, por aqui!","D\xea uma olhada nisso!","Encontrei algo para voc\xea!","Venha comigo!"],idle:["Tente arrastar algo!","Vamos ver o que acontece!","Arraste os elementos para o lugar certo","V\xea aqueles objetos? Mova-os!","Experimente arrastar e soltar!","Algo aqui encaixa em algum lugar\u2026","Vamos l\xe1, mova essas pe\xe7as!","Topa arrastar?","Tente colocar as pe\xe7as!","Cada um tem o seu lugar!"],poke:["Isso faz c\xf3cegas!","Ei, com cuidado!","Para com isso!","Sou um avatar, n\xe3o um bot\xe3o!","Voc\xea acabou de me clicar?","Hehe, que divertido!","Ol\xe1 para voc\xea tamb\xe9m!","Mais um clique e come\xe7o a dan\xe7ar!","Est\xe1 me testando?","Uau, quase ca\xed!","Sim, estou aqui!","Que surpresa voc\xea me clicar!"],dragging:["Voc\xea consegue!","Solte onde for preciso","Quase l\xe1!","Vamos, um pouco mais!","Isso, continue assim!","Acredito em voc\xea!","Vai, vai, vai!","Para onde vai isso?"],success:["Muito bem!","Conseguiu!","Perfeito!","Isso mesmo!","Incr\xedvel!","Sabia que conseguia!","Fant\xe1stico!","10 em 10!","Voc\xea est\xe1 arrasando!","Boom!"],failure:["Quase, tente de novo!","N\xe3o tem problema, tente outra vez","Voc\xea pode fazer isso!","Ops, tente mais uma vez!","T\xe3o perto\u2026","Na pr\xf3xima com certeza!","N\xe3o desista!","Mais uma tentativa, vamos!","Cada erro \xe9 um aprendizado!","Continue, voc\xea consegue!"]},fr:{question:["Tu connais la r\xe9ponse?","Voyons ce que tu sais!","R\xe9ponds et prouve-le!","Qu'est-ce que tu en penses?","Tu oses r\xe9pondre?","Tu as la r\xe9ponse?","Il y a une question pour toi!","R\xe9fl\xe9chis bien\u2026","Quel est ton avis?","Allez, tu peux r\xe9pondre!"],moving:["Suis-moi!","Par ici!","Regarde ce que j'ai trouv\xe9!","Viens, il y a quelque chose ici!","Psst, par ici!","Jette un \u0153il \xe0 \xe7a!","J'ai trouv\xe9 quelque chose pour toi!","Viens avec moi!"],idle:["Essaie de faire glisser quelque chose!","Voyons ce qui se passe!","Fais glisser les \xe9l\xe9ments au bon endroit","Tu vois ces objets? Bouge-les!","Tente le glisser-d\xe9poser!","Il y a forc\xe9ment une place pour chaque pi\xe8ce\u2026","Allez, d\xe9place ces \xe9l\xe9ments!","Tu oses le faire glisser?","Essaie de placer les pi\xe8ces!","Chaque pi\xe8ce a son endroit!"],poke:["\xc7a chatouille!","H\xe9, doucement!","Arr\xeate de me toucher!","Je suis un avatar, pas un bouton!","Tu viens de me cliquer?","Hehe, c'\xe9tait sympa!","Bonjour \xe0 toi aussi!","Encore un clic et je me mets \xe0 danser!","Tu me testes?","Ouah, failli tomber!","Oui, je suis l\xe0!","Quelle surprise de te voir me cliquer!"],dragging:["Tu peux le faire!","D\xe9pose-le au bon endroit","Presque!","Allez, encore un peu!","C'est \xe7a, continue!","Je crois en toi!","Vas-y, vas-y!","Tu le poses o\xf9?"],success:["Bravo!","Tu y es arriv\xe9!","Parfait!","Oui!","Super!","Je savais que tu pouvais!","Incroyable!","10 sur 10!","Tu es en feu!","Boom!"],failure:["Presque, r\xe9essaie!","Pas de souci, essaie encore","Tu peux y arriver!","Oups, encore un essai!","Si proche\u2026","La prochaine fois, \xe7a ira!","Ne l\xe2che pas!","Un essai de plus, allez!","Chaque erreur est un apprentissage!","Continue, tu vas y arriver!"]},de:{question:["Kennst du die Antwort?","Mal sehen, was du wei\xdft!","Antworte und beweise es!","Was denkst du?","Traust du dich zu antworten?","Hast du die Antwort?","Hier ist eine Frage f\xfcr dich!","Denk gut nach\u2026","Was ist deine Meinung?","Komm, du kannst es beantworten!"],moving:["Komm mit!","Hierher!","Schau, was ich gefunden habe!","Komm, hier ist etwas!","Psst, hier entlang!","Wirf einen Blick darauf!","Ich habe etwas f\xfcr dich gefunden!","Folg mir!"],idle:["Versuche etwas zu ziehen!","Mal sehen, was passiert!","Ziehe die Elemente an den richtigen Ort","Siehst du die Objekte? Beweg sie!","Probiere Drag-and-Drop aus!","Irgendwo passt jedes Teil hin\u2026","Los, beweg diese Teile!","Traust du dich, es zu ziehen?","Versuche, die Teile zu platzieren!","Jedes Teil hat seinen Platz!"],poke:["Das kitzelt!","Hey, vorsichtig!","H\xf6r auf, mich anzutippen!","Ich bin ein Avatar, kein Knopf!","Hast du mich gerade geklickt?","Hehe, das hat Spa\xdf gemacht!","Hallo auch an dich!","Noch ein Klick und ich fange an zu tanzen!","Testest du mich?","Ui, fast hingefallen!","Ja, ich bin hier!","Was f\xfcr eine \xdcberraschung!"],dragging:["Du schaffst das!","Lass es los, wo es hingeh\xf6rt","Fast!","Komm, noch ein bisschen!","So ist es, weiter so!","Ich glaube an dich!","Los, los, los!","Wohin geh\xf6rt das?"],success:["Gut gemacht!","Du hast es geschafft!","Perfekt!","Ja!","Super!","Ich wusste, du kannst es!","Unglaublich!","10 von 10!","Du bist auf Feuer!","Boom!"],failure:["Fast, versuch es nochmal!","Kein Problem, versuche es noch einmal","Du kannst es schaffen!","Hoppla, noch ein Versuch!","So nah dran\u2026","N\xe4chstes Mal bestimmt!","Gib nicht auf!","Noch ein Versuch, komm!","Jeder Fehler ist eine Lektion!","Weiter so, du schaffst das!"]},it:{question:["Conosci la risposta?","Vediamo cosa sai!","Rispondi e dimostralo!","Cosa ne pensi?","Osi rispondere?","Hai la risposta?","C'\xe8 una domanda per te!","Pensa bene\u2026","Qual \xe8 la tua opinione?","Dai, puoi risponderci!"],moving:["Seguimi!","Da questa parte!","Guarda cosa ho trovato!","Vieni, c'\xe8 qualcosa qui!","Psst, da qui!","Dai un'occhiata a questo!","Ho trovato qualcosa per te!","Vieni con me!"],idle:["Prova a trascinare qualcosa!","Vediamo cosa succede!","Trascina gli elementi nel posto giusto","Vedi quegli oggetti? Spostali!","Prova il trascinamento!","Da qualche parte ci sta un posto giusto\u2026","Dai, muovi questi pezzi!","Osi trascinarlo?","Prova a posizionare i pezzi!","Ogni pezzo ha il suo posto!"],poke:["Fa il solletico!","Ehi, piano!","Smettila di toccarmi!","Sono un avatar, non un pulsante!","Mi hai appena cliccato?","Hehe, \xe8 stato divertente!","Ciao anche a te!","Un altro clic e comincio a ballare!","Mi stai mettendo alla prova?","Uh, quasi caduto!","S\xec, sono qui!","Che sorpresa vederti cliccarmi!"],dragging:["Ce la fai!","Lascialo dove va","Quasi!","Dai, ancora un po!","Ecco, continua cos\xec!","Credo in te!","Vai, vai, vai!","Dove lo porti?"],success:["Bravo!","Ce l'hai fatta!","Perfetto!","S\xec!","Fantastico!","Sapevo che potevi!","Incredibile!","10 su 10!","Sei in fiamme!","Boom!"],failure:["Quasi, riprova!","Non preoccuparti, riprova","Puoi farcela!","Ops, riprova ancora!","Cos\xec vicino\u2026","La prossima volta di sicuro!","Non mollare!","Un altro tentativo, dai!","Ogni errore \xe8 una lezione!","Continua, ci riesci!"]}};const T=4e3,x=5e3,M=[120,500],S=new Set(["happy","sad"]),I={success:"happy",failure:"sad"},C={success:"success",failure:"shake"},B={none:0,idle:1,poke:1,dragging:2,outcome:3},k={idle:"idle",question:"idle",moving:"idle",poke:"poke",dragging:"dragging",success:"outcome",failure:"outcome"};class q{constructor(){this.vmi=null,this.faceState="idle",this.idlePool=[],this.currentIdleExpression=null,this.idleEmotionTimer=null,this.reactionHoldTimer=null,this.reapplyTimers=[],this.pendingOutcome=null,this.hasDragAndDrop=!1,this.hasInteractiveQuestion=!1,this.suppressIdleUntil=0,this.bubblePriority="none",this.bubbleHideTimer=null,this.bubbleListeners=new Set,this.currentBubble=null,this.lang=function(){var e,t;const i=null!==(t=null===(e=navigator.language)||void 0===e?void 0:e.toLowerCase())&&void 0!==t?t:"";for(const s of y)if(i===s||i.startsWith(`${s}-`)||i.startsWith(`${s}_`))return s;return"en"}(),this.gazeTargetX=0,this.gazeTargetY=0,this.gazeCurrentX=0,this.gazeCurrentY=0,this.gazeRafId=null,this.tickGaze=()=>{var e,t;this.gazeCurrentX+=.15*(this.gazeTargetX-this.gazeCurrentX),this.gazeCurrentY+=.15*(this.gazeTargetY-this.gazeCurrentY);const i=null===(e=this.vmi)||void 0===e?void 0:e.number("head/gazeX"),s=null===(t=this.vmi)||void 0===t?void 0:t.number("head/gazeY");i&&(i.value=this.gazeCurrentX),s&&(s.value=this.gazeCurrentY),this.gazeRafId=requestAnimationFrame(this.tickGaze)}}setVmi(e){var t,i;if(this.stopIdleLoop(),this.vmi=e,!e)return;const s=e.enum("head/expression"),o=null!==(t=null===s||void 0===s?void 0:s.values)&&void 0!==t?t:[];if(this.idlePool=o.filter((e=>!S.has(e))),this.currentIdleExpression=null!==(i=o[0])&&void 0!==i?i:null,this.hasDragAndDrop?setTimeout((()=>this.showBubble("idle",x)),0):this.hasInteractiveQuestion&&setTimeout((()=>this.showBubble("question",x)),0),null!==this.pendingOutcome){const e=this.pendingOutcome;return this.pendingOutcome=null,void this.reactToOutcome(e)}this.scheduleIdleEmotionTick()}setHasDragAndDrop(e){this.hasDragAndDrop=e,e&&this.vmi&&"idle"===this.faceState&&"none"===this.bubblePriority&&this.showBubble("idle",x)}setHasInteractiveQuestion(e){this.hasInteractiveQuestion=e,e&&!this.hasDragAndDrop&&this.vmi&&"idle"===this.faceState&&this.showBubble("question",x)}reactToOutcome(e){var t;if(!this.vmi)return void(this.pendingOutcome=e);this.faceState="reacting",this.stopIdleLoop(),this.clearReapplyTimers(),null!==this.reactionHoldTimer&&clearTimeout(this.reactionHoldTimer);const i=I[e],s=C[e];this.applyExpression(i),null===(t=this.vmi.trigger(s))||void 0===t||t.trigger(),this.suppressIdleUntil=Date.now()+T;for(const o of M){const e=setTimeout((()=>{var e;"reacting"===this.faceState&&this.vmi&&(this.applyExpression(i),null===(e=this.vmi.trigger(s))||void 0===e||e.trigger())}),o);this.reapplyTimers.push(e)}this.reactionHoldTimer=setTimeout((()=>{this.reactionHoldTimer=null,this.faceState="idle",this.scheduleIdleEmotionTick()}),T),this.showBubble(e,T)}isIdleSuppressed(){return Date.now()<this.suppressIdleUntil}poke(){this.showBubble("poke",3e3)}onAvatarMoved(){this.vmi&&"idle"===this.faceState&&(this.hasDragAndDrop||this.hasInteractiveQuestion)&&this.showBubble("moving",3e3)}setDragState(e){e?this.showBubble("dragging",0):this.clearBubble("dragging")}subscribeBubble(e){return this.bubbleListeners.add(e),e(this.currentBubble),()=>{this.bubbleListeners.delete(e)}}applyExpression(e){if(!this.vmi)return;const t=this.vmi.enum("head/expression");t&&(t.value=e)}scheduleIdleEmotionTick(){if(0===this.idlePool.length||!this.vmi)return;const e=5e3+1e4*Math.random();this.idleEmotionTimer=setTimeout((()=>{if(this.idleEmotionTimer=null,"idle"===this.faceState&&this.vmi){const e=this.idlePool.filter((e=>e!==this.currentIdleExpression)),t=e.length>0?e:this.idlePool,i=t[Math.floor(Math.random()*t.length)];this.applyExpression(i),this.currentIdleExpression=i,this.scheduleIdleEmotionTick()}}),e)}stopIdleLoop(){null!==this.idleEmotionTimer&&(clearTimeout(this.idleEmotionTimer),this.idleEmotionTimer=null)}clearReapplyTimers(){for(const e of this.reapplyTimers)clearTimeout(e);this.reapplyTimers=[]}showBubble(e,t){const i=k[e];if(B[i]<B[this.bubblePriority])return;this.bubblePriority=i,null!==this.bubbleHideTimer&&(clearTimeout(this.bubbleHideTimer),this.bubbleHideTimer=null);const s=function(e,t){const i=w[e][t];return i[Math.floor(Math.random()*i.length)]}(this.lang,e);this.notifyBubble({state:e,text:s}),t>0&&(this.bubbleHideTimer=setTimeout((()=>{this.bubbleHideTimer=null,this.bubblePriority="none",this.notifyBubble(null)}),t))}clearBubble(e){this.bubblePriority===e&&(null!==this.bubbleHideTimer&&(clearTimeout(this.bubbleHideTimer),this.bubbleHideTimer=null),this.bubblePriority="none",this.notifyBubble(null))}notifyBubble(e){this.currentBubble=e;for(const t of this.bubbleListeners)t(e)}setGazeTarget(e,t){this.gazeTargetX=2*e,this.gazeTargetY=2*t,null===this.gazeRafId&&(this.gazeRafId=requestAnimationFrame(this.tickGaze))}dispose(){null!==this.gazeRafId&&(cancelAnimationFrame(this.gazeRafId),this.gazeRafId=null)}}const E=e=>{let{src:t,artboard:i,stateMachines:o,fit:n,alignment:r,layoutScaleFactor:l=1,autoplay:u=!0,autoBind:d=!0,viewModelSchema:c,viewModelData:h,onControllerReady:m,interactive:y=!0}=e;const w=(0,a.useRef)(null),{rive:T,RiveComponent:x,canvas:M}=(0,v.useRive)({src:t,artboard:i||void 0,stateMachines:o||void 0,layout:new v.Layout({fit:(0,p.eY)(n),alignment:(0,f.oy)(r),layoutScaleFactor:Number.isFinite(Number(l))?Number(l):1}),autoplay:u,autoBind:d},{shouldResizeCanvasToContainer:!1,useDevicePixelRatio:!0}),[S,I]=(0,a.useState)(null);(0,a.useEffect)((()=>{if(!T)return I(null),()=>{};const e=()=>{var e;I(null!==(e=T.viewModelInstance)&&void 0!==e?e:null)};return e(),T.on("load",e),()=>{T.off("load",e)}}),[T]);const C=(0,a.useMemo)((()=>new q),[]);return(0,a.useEffect)((()=>{null===m||void 0===m||m(C)}),[C,m]),(0,a.useEffect)((()=>(C.setVmi(S),()=>{C.setVmi(null)})),[C,S]),(0,a.useEffect)((()=>{const e=e=>{var t;const i=null===(t=w.current)||void 0===t?void 0:t.getBoundingClientRect();i&&C.setGazeTarget(e.clientX-(i.left+i.width/2),e.clientY-(i.top+i.height/2))};return window.addEventListener("pointermove",e),()=>{window.removeEventListener("pointermove",e),C.dispose()}}),[C]),(0,b.S)(S,h,c),(0,g.w)(T,M,w),(0,s.jsx)("div",{ref:w,style:{width:"100%",height:"100%"},children:(0,s.jsx)(x,{style:{width:"100%",height:"100%",pointerEvents:y?"auto":"none"}})})},z="https://rive.genially.com/rive-animations/avatar.riv",R=o.Ay.div`
  position: relative;
  width: 100%;
  height: 100%;
`,D=o.Ay.div`
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
`;const P=e=>{let{src:t=z,artboard:i,stateMachines:o,fit:r,alignment:l,layoutScaleFactor:u,autoplay:c=!0,autoBind:v=!0,viewModelSchema:f,viewModelData:p,onControllerReady:g,onMovementControllerReady:b,interactive:y=!0,movementMode:w="static"}=e;var T;const x=(0,a.useRef)(null),[M,S]=(0,a.useState)(null),[I,C]=(0,a.useState)({kind:"offset",x:0,y:0}),[B,k]=(0,a.useState)(!1),q=(0,a.useMemo)((()=>new m),[]);(0,a.useEffect)((()=>{null===b||void 0===b||b(q)}),[q,b]),(0,a.useEffect)((()=>{const e=null!==w&&void 0!==w?w:"static",t="reactive"===e?"interactive":e;q.setMode(t),"assistant"!==t&&C((e=>"fixed"===e.kind?{kind:"offset",x:0,y:0}:e))}),[q,w]),(0,a.useEffect)((()=>q.subscribe((e=>{C(e),"fixed"===e.kind&&k(function(e,t,i){const s=e+i,o=window.innerWidth,a=window.innerHeight;return t>.2*a&&t+i<.85*a&&(e<80||s>o-80)}(e.left,e.top,h))}))),[q]),(0,a.useEffect)((()=>(q.onTargetItemChanged=()=>{null===M||void 0===M||M.onAvatarMoved()},()=>{q.onTargetItemChanged=null})),[M,q]);const P=(0,a.useRef)(null),A=(0,a.useRef)({x:1,y:1}),H=(0,a.useCallback)((()=>{const e=x.current;if(!e)return;const t=e.getBoundingClientRect(),i=e.offsetWidth>0?t.width/e.offsetWidth:1,s=e.offsetHeight>0?t.height/e.offsetHeight:1;A.current={x:i,y:s};const{x:o,y:a}=q.getOffset(),n="interactive"===w,r=n?h*i:t.width,l=n?h*s:t.height,u=t.left-o+t.width/2,d=t.top-a+t.height/2;q.setAvatarBounds({left:u-r/2,top:d-l/2,width:r,height:l}),P.current||(P.current=function(e){const t=e.getBoundingClientRect();let i=e.parentElement;for(;i&&i!==document.body;){const e=i.getBoundingClientRect();if(e.width>=4*t.width&&e.height>=4*t.height)return i;i=i.parentElement}return null}(e));const c=P.current;if(c){const e=c.getBoundingClientRect();q.setSlideBounds({left:e.left,top:e.top,width:e.width,height:e.height})}else q.setSlideBounds({left:0,top:0,width:window.innerWidth,height:window.innerHeight})}),[q,w]);(0,a.useEffect)((()=>(P.current=null,H(),window.addEventListener("resize",H),()=>{P.current=null,window.removeEventListener("resize",H),q.dispose()})),[q,H]),(0,a.useEffect)((()=>{const e=e=>{H(),q.setCursor(e.clientX,e.clientY)};return window.addEventListener("pointermove",e),()=>window.removeEventListener("pointermove",e)}),[q,H]);const Y=(0,a.useCallback)((e=>{S(e),null===g||void 0===g||g(e)}),[g]),F=(0,a.useCallback)((()=>{y&&(null===M||void 0===M||M.poke(),q.onActivity())}),[M,y,q]),X=`${t}|${null!==i&&void 0!==i?i:""}|${null!==o&&void 0!==o?o:""}|${null!==(T=null===f||void 0===f?void 0:f.length)&&void 0!==T?T:0}`;if((0,a.useLayoutEffect)((()=>{let e;if("offset"===I.kind){let t=x.current;for(;t&&!t.hasAttribute("data-item-id");)t=t.parentElement;const i=t;if(i){const{x:t,y:s}=A.current;0===I.x&&0===I.y?(i.style.removeProperty("transform"),i.style.removeProperty("z-index")):(i.style.transform=`translate3d(${I.x/t}px, ${I.y/s}px, 0)`,i.style.zIndex="100"),e=()=>{i.style.removeProperty("transform"),i.style.removeProperty("z-index")}}}return e}),[I]),"fixed"===I.kind)return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{ref:x,style:{width:"100%",height:"100%"}}),(0,n.createPortal)((0,s.jsxs)("div",{style:{position:"fixed",left:I.left,top:I.top,width:h,height:h,zIndex:B?1:9999,opacity:B?.15:1,transition:"opacity 0.3s ease",pointerEvents:"none"},children:[(0,s.jsx)(E,{src:t,artboard:i,stateMachines:o,fit:r,alignment:l,layoutScaleFactor:u,autoplay:c,autoBind:v,viewModelSchema:f,viewModelData:p,onControllerReady:Y,interactive:!1},X),(0,s.jsx)(d,{controller:M,placement:"top"})]}),document.body)]});const V="interactive"===w,N=(0,s.jsx)(E,{src:t,artboard:i,stateMachines:o,fit:r,alignment:l,layoutScaleFactor:u,autoplay:c,autoBind:v,viewModelSchema:f,viewModelData:p,onControllerReady:Y},X);return V?(0,s.jsx)(R,{ref:x,children:(0,s.jsxs)("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:h,height:h},children:[(0,s.jsx)(D,{onClick:F,children:N}),(0,s.jsx)(d,{controller:M,placement:"top"})]})}):(0,s.jsxs)(R,{ref:x,children:[(0,s.jsx)(D,{onClick:F,children:N}),(0,s.jsx)(d,{controller:M})]})},A=e=>{let{theme:t,src:i,artboard:a,stateMachines:n,fit:r,alignment:l,layoutScaleFactor:u,autoplay:d,autoBind:c,viewModelSchema:h,viewModelData:m,movementMode:v,onControllerReady:f,onMovementControllerReady:p,interactive:g}=e;return(0,s.jsx)(o.NP,{theme:t,children:(0,s.jsx)(P,{src:i,artboard:a,stateMachines:n,fit:r,alignment:l,layoutScaleFactor:u,autoplay:d,autoBind:c,viewModelSchema:h,viewModelData:m,movementMode:v,onControllerReady:f,onMovementControllerReady:p,interactive:g})})}},80639(e,t,i){i.d(t,{avatarEditorScript:()=>c});var s=i(45992),o=i(57277),a=i(10455),n=i(13034),r=i(95881),l=function(e,t,i,s){return new(i||(i=Promise))((function(o,a){function n(e){try{l(s.next(e))}catch(t){a(t)}}function r(e){try{l(s.throw(e))}catch(t){a(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(n,r)}l((s=s.apply(e,t||[])).next())}))};function u(e){return"localhost"!==window.location.hostname||e.startsWith("/__rive-proxy/")?e:`/__rive-proxy/${e}`}function d(e,t,i,s){return l(this,arguments,void 0,(function*(e,t,i,s){let{schemaOnly:o=!1}=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};try{const n=yield(0,a.v)(u(e));return t((t=>{i&&n.artboardNames.length>0&&!n.artboardNames.includes(i)&&console.warn("[avatarEditorScript] configured artboard not found in runtime output.","Expected:",i,"| Runtime sees:",n.artboardNames,"| Likely a runtime version mismatch \u2014 upgrade @rive-app/react-webgl2."),t.stateMachineNames=n.stateMachineNames;const[s]=n.stateMachineNames;s?t.stateMachines=s:console.warn("[avatarEditorScript] no state machines detected in",e),t.viewModelSchema=n.viewModelProperties,o||(t.viewModelData=n.viewModelDefaults)})),s&&n.width>0&&n.height>0&&s.setSize(n.width,n.height),n.artboardNames}catch(n){return void console.warn("[avatarEditorScript] Could not read Rive file info",n)}}))}const c=e=>{let{script:t,editor:i}=e;var a,l,c;const h=t.item;if(!h)return;const m=t.getConfig();let v,f=String(null!==(a=m.src)&&void 0!==a?a:"");const p=null===(l=m.viewModelSchema)||void 0===l?void 0:l.some((e=>"number"===typeof e.type));!f||(null===(c=m.viewModelSchema)||void 0===c?void 0:c.length)&&!p||d(f,(e=>t.mutateConfig(e)),m.artboard,void 0,{schemaOnly:p}).then((e=>{v=e})),i.on("slideCreated",(e=>{let{slide:s}=e;if(s.parentSlide)return;"all"===t.getConfig().transversalMode&&(h.includedSlideIds=i.getNonPopupSlides().map((e=>e.id)))})),i.on("slideDeleted",(e=>{let{slide:s}=e;if(s.parentSlide)return;"all"===t.getConfig().transversalMode&&(h.includedSlideIds=i.getNonPopupSlides().map((e=>e.id)))})),t.on("configChange",(e=>{let{config:s}=e;var o;"all"===s.transversalMode?(h.isTransversal=!0,h.includedSlideIds=i.getNonPopupSlides().map((e=>e.id))):(h.isTransversal=!1,h.includedSlideIds=[]);const a=String(null!==(o=s.src)&&void 0!==o?o:""),r=(0,n.p)(a);r===a?a&&a!==f&&(f=a,d(a,(e=>t.mutateConfig(e)),s.artboard,h).then((e=>{v=e}))):t.mutateConfig((e=>{e.src=r}))})),(0,o.x)({getTargetNodeItem:()=>t.item,renderApp:()=>{const e=t.getConfig(),o=e.artboard&&(null===v||void 0===v?void 0:v.includes(e.artboard))?e.artboard:void 0;return(0,s.jsx)(r.q,{theme:i.theme,src:u(e.src),artboard:o,stateMachines:e.stateMachines,fit:e.fit,alignment:e.alignment,layoutScaleFactor:e.layoutScaleFactor,autoplay:e.autoplay,autoBind:e.autoBind,buttons:e.buttons,gapRatio:e.gapRatio,viewModelSchema:e.viewModelSchema,viewModelData:e.viewModelData,interactive:!1})},renderThumbnailApp:()=>{const e=t.getConfig(),o=e.artboard&&(null===v||void 0===v?void 0:v.includes(e.artboard))?e.artboard:void 0;return(0,s.jsx)(r.q,{theme:i.theme,src:u(e.src),artboard:o,stateMachines:e.stateMachines,fit:e.fit,alignment:e.alignment,layoutScaleFactor:e.layoutScaleFactor,autoplay:!1,autoBind:e.autoBind,viewModelSchema:e.viewModelSchema,viewModelData:e.viewModelData,interactive:!1})},nodePrefix:"avatar"})({script:t,editor:i})}},48571(e,t,i){i.d(t,{w:()=>o});var s=i(17588);function o(e,t,i){(0,s.useEffect)((()=>{if(!e||!t||!i.current)return;let s;const o=()=>{const{offsetWidth:e,offsetHeight:s}=i.current;t.style.width=`${e}px`,t.style.height=`${s}px`,t.style.maxWidth="100%",t.style.maxHeight="100%"};o(),e.resizeDrawingSurfaceToCanvas();const a=new ResizeObserver((()=>{o(),window.clearTimeout(s),s=window.setTimeout((()=>{e.resizeDrawingSurfaceToCanvas()}),100)}));return a.observe(i.current),()=>{a.disconnect(),window.clearTimeout(s)}}),[e,t,i])}},32297(e,t,i){i.d(t,{S:()=>l});var s=i(17588);function o(e,t){const i=[];for(const[s,a]of Object.entries(e)){const e=t?`${t}/${s}`:s;"object"===typeof a&&null!==a?i.push(...o(a,e)):i.push([e,a])}return i}const a={1:"string",2:"number",3:"boolean",4:"color",5:"list",6:"enum",7:"trigger",8:"viewModel"};function n(e){var t;return"number"===typeof e?null!==(t=a[e])&&void 0!==t?t:String(e):String(null!==e&&void 0!==e?e:"")}function r(e,t,i){const s=new Set;for(const o of e){const e=t?`${t}/${o.name}`:o.name,a=n(o.type);if(a===i)s.add(e);else if("viewModel"===a&&o.children)for(const t of r(o.children,e,i))s.add(t)}return s}function l(e,t,i){const a=(0,s.useMemo)((()=>JSON.stringify(null!==t&&void 0!==t?t:{})),[t]),n=(0,s.useMemo)((()=>r(null!==i&&void 0!==i?i:[],"","trigger")),[i]),l=(0,s.useMemo)((()=>r(null!==i&&void 0!==i?i:[],"","color")),[i]),u=(0,s.useRef)({});(0,s.useEffect)((()=>{if(!e)return;o(JSON.parse(a),"").forEach((t=>{let[i,s]=t;var o;try{if(n.has(i)){const t=Number(s)||0;if(t>(null!==(o=u.current[i])&&void 0!==o?o:0)){const t=e.trigger(i);t&&t.trigger()}u.current[i]=t}else if("string"===typeof s){const t=e.enum(i);if(t)t.value=s;else{const t=e.string(i);t&&(t.value=s)}}else if(l.has(i)){const t=e.color(i);t&&(t.value=Number(s))}else if("number"===typeof s){const t=e.number(i);t&&(t.value=s)}else if("boolean"===typeof s){const t=e.boolean(i);t&&(t.value=s)}}catch(a){}}))}),[e,a,n,l])}},10455(e,t,i){i.d(t,{v:()=>u});const s={1:"string",2:"number",3:"boolean",4:"color",5:"list",6:"enum",7:"trigger",8:"viewModel"};function o(e){var t;return"number"===typeof e?null!==(t=s[e])&&void 0!==t?t:String(e):String(null!==e&&void 0!==e?e:"")}function a(e,t,i){var s,o,a,n,r,l,u,d,c,h;return"string"===i?null!==(o=null===(s=e.string(t))||void 0===s?void 0:s.value)&&void 0!==o?o:"":"number"===i?null!==(n=null===(a=e.number(t))||void 0===a?void 0:a.value)&&void 0!==n?n:0:"boolean"===i?null!==(l=null===(r=e.boolean(t))||void 0===r?void 0:r.value)&&void 0!==l&&l:"color"===i?null!==(d=null===(u=e.color(t))||void 0===u?void 0:u.value)&&void 0!==d?d:0:"enum"===i?null!==(h=null===(c=e.enum(t))||void 0===c?void 0:c.value)&&void 0!==h?h:"":"trigger"===i?0:void 0}function n(e,t){var i;const s=[],r={};if(t>5||!e)return{properties:s,defaults:r};const l=null!==(i=e.properties)&&void 0!==i?i:[];for(let h=0;h<l.length;h+=1){const i=l[h];if((null===i||void 0===i?void 0:i.name)&&(null===i||void 0===i?void 0:i.type)){const{name:l}=i,h=o(i.type);if("viewModel"===h)try{const i=e.viewModel(l);if(i){const e=n(i,t+1);s.push({name:l,type:h,children:e.properties}),r[l]=e.defaults}else s.push({name:l,type:h,children:[]}),r[l]={}}catch(u){s.push({name:l,type:h,children:[]}),r[l]={}}else{const t={name:l,type:h};if("enum"===h)try{const i=e.enum(l);(null===i||void 0===i?void 0:i.values)&&(t.enumValues=i.values)}catch(d){}s.push(t);try{const t=a(e,l,h);void 0!==t&&(r[l]=t)}catch(c){}}}}return{properties:s,defaults:r}}function r(e){var t,i,s,o,a,r,l,u,d,c,h,m,v;try{const f=null!==(t=e.viewModelCount)&&void 0!==t?t:0,p=null!==(o=null!==(s=null===(i=e.defaultViewModel)||void 0===i?void 0:i.call(e))&&void 0!==s?s:f>0?e.viewModelByIndex(0):null)&&void 0!==o?o:null;if(!p)return{properties:[],defaults:{}};return n(null!==(v=null!==(m=null!==(d=null!==(r=null===(a=p.defaultInstance)||void 0===a?void 0:a.call(p))&&void 0!==r?r:null===(u=(l=p).instanceByIndex)||void 0===u?void 0:u.call(l,0))&&void 0!==d?d:null===(h=(c=p).instance)||void 0===h?void 0:h.call(c))&&void 0!==m?m:e.viewModelInstance)&&void 0!==v?v:null,0)}catch(f){return console.warn("[readViewModelData] Error reading ViewModel:",f),{properties:[],defaults:{}}}}var l=function(e,t,i,s){return new(i||(i=Promise))((function(o,a){function n(e){try{l(s.next(e))}catch(t){a(t)}}function r(e){try{l(s.throw(e))}catch(t){a(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(n,r)}l((s=s.apply(e,t||[])).next())}))};function u(e){return l(this,void 0,void 0,(function*(){const{Rive:t}=yield Promise.resolve().then(i.t.bind(i,60053,23));return new Promise(((i,s)=>{const o=document.createElement("canvas");o.width=1,o.height=1;let a,n=!1;const l=()=>{try{null===a||void 0===a||a.cleanup()}catch(e){}o.remove()},u=setTimeout((()=>{n||(n=!0,l(),s(new Error(`Rive file load timed out after 15000ms: ${e}`)))}),15e3);a=new t({src:e,canvas:o,autoplay:!1,autoBind:!0,onLoad:()=>{var e,t,o,d;if(!n){n=!0,clearTimeout(u);try{const{bounds:s}=a,n=(null===s||void 0===s?void 0:s.maxX)>0?s.maxX:300,l=(null===s||void 0===s?void 0:s.maxY)>0?s.maxY:300,u=null!==(e=a.stateMachineNames)&&void 0!==e?e:[],{properties:c,defaults:h}=r(a);i({width:n,height:l,artboardNames:null!==(d=null===(o=null===(t=a.contents)||void 0===t?void 0:t.artboards)||void 0===o?void 0:o.map((e=>e.name)))&&void 0!==d?d:[],stateMachineNames:u,viewModelProperties:c,viewModelDefaults:h})}catch(c){s(c)}finally{l()}}},onLoadError:e=>{n||(n=!0,clearTimeout(u),o.remove(),s(e))}})}))}))}},13034(e,t,i){function s(e){const t=e.match(/^https?:\/\/rive\.app\/(?:community\/files|marketplace)\/([^/]+)\/?$/i);return t?`https://public.rive.app/community/runtime-files/${t[1]}.riv`:e}i.d(t,{p:()=>s})},57277(e,t,i){i.d(t,{x:()=>o});var s=i(70377);function o(e){let{getTargetNodeItem:t,renderApp:i,renderThumbnailApp:o,nodePrefix:a}=e;return e=>{let{script:n,editor:r}=e,l=null,u=[];function d(e){l&&(s.unmountComponentAtNode(l),l=null),e&&"innerHtml"in e&&(e.innerHtml='<div class="card-iframe"><div style="width: 100%; height: 100%; background: #FF0000; color: #FFFFFF;">Deleted</div><script><\/script></div>')}function c(){l&&s.render(i(),l)}function h(){const e=t(n.getConfig());if(!e)return;const i=`${a}-${e.id}`;"innerHtml"in e&&(e.innerHtml=`<div class="card-iframe"><div id="${i}" class="genially-widget-app" style="width: 100%; height: 100%;"></div></div>`),requestAnimationFrame((()=>{l="idOfFreeNode"in e?document.getElementById(e.idOfFreeNode)||null:document.getElementById(i)||null,c()}))}function m(){o&&u.length&&u.forEach((e=>{const t="true"===e.dataset.critical,{renderingSlideId:i}=e.dataset;s.render(o({important:t,renderingSlideId:i}),e)}))}function v(){const e=t(n.getConfig());e&&"idOfThumbnailFreeNode"in e&&requestAnimationFrame((()=>{const t=document.getElementsByClassName(e.idOfThumbnailFreeNode);u=Array.from(t).filter((e=>e instanceof HTMLElement)),m()}))}n.on("configChange",(e=>{let{config:i,prevConfig:s}=e;const o=t(i),a=s?t(s):void 0;a&&a!==o&&d(a),o&&(o!==a?(h(),v()):(c(),m()))})),n.on("scriptIdChange",(e=>{let{scriptId:t,prevScriptId:i}=e;i!==t&&(d(),h(),v())})),n.on("dispose",(()=>{d(t(n.getConfig()))})),r.on("itemMount",(e=>{let{item:t}=e;t===n.item&&h()})),r.on("slideChange",(()=>{c()})),r.on("itemUnmount",(e=>{let{item:t}=e;t===n.item&&d()})),r.on("itemThumbnailMount",(e=>{let{item:t}=e;t===n.item&&v()}))}}}}]);
//# sourceMappingURL=https://s3-static-genially.genially.com/view/static/js/639.3e7a53e4.chunk.js.map