(function () { var isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1); if (!isIOS) return; document.documentElement.classList.add('simon-ios'); var viewport = document.querySelector('meta[name="viewport"]'); if (viewport && !/viewport-fit\s*=\s*cover/i.test(viewport.content)) { viewport.content = viewport.content.replace(/\s+$/, '') + ', viewport-fit=cover'; } var theme = document.querySelector('meta[name="theme-color"]'); if (!theme) { theme = document.createElement('meta'); theme.name = 'theme-color'; document.head.appendChild(theme); } theme.content = '#c7b7ad'; })();
(function(){ function isSimonView(){ var hash=location.hash.toLowerCase(); return ( hash==="#simon" || hash==="#santa" || (location.protocol==="file:" && !hash) ); } function updateSimonPageClass(){ document.documentElement.classList.toggle( "simon-view-active", isSimonView() ); } window.addEventListener( "hashchange", updateSimonPageClass ); window.addEventListener( "pageshow", updateSimonPageClass ); updateSimonPageClass(); var PUBLIC_KEY= "pub_b1c3dfda838198e745160fc79b66ad4091169f08123257d95bf83667bd02d532"; var CURRENT= "https://cdn.dev.runwayml.com/prod/widget.js"; var nativeAttachShadow= Element.prototype.attachShadow; Element.prototype.attachShadow=function(init){ var isRunway= this.id==="runway-embed-widget"; var mount= document.getElementById( "santa-runway-mount" ); if(isRunway && mount){ mount.appendChild(this); } var root= nativeAttachShadow.call( this, isRunway ? Object.assign( {}, init, {mode:"open"} ) : init ); if(isRunway){ var style= document.createElement("style"); style.textContent= ":host{" + "position:absolute!important;" + "inset:0!important;" + "display:block!important;" + "width:100%!important;" + "height:100%!important;" + "overflow:hidden!important;" + "}" + ".rw-container{" + "position:absolute!important;" + "inset:0!important;" + "width:100%!important;" + "height:100%!important;" + "}" + ".rw-widget-wrapper{" + "width:100%!important;" + "height:100%!important;" + "}" + ".rw-pill{" + "display:none!important;" + "}" + ".rw-card{" + "inset:0!important;" + "width:100%!important;" + "height:100%!important;" + "min-height:0!important;" + "padding:0!important;" + "border:0!important;" + "border-radius:0!important;" + "transform:none!important;" + "overflow:hidden!important;" + "background:#111!important;" + "visibility:visible!important;" + "opacity:1!important;" + "pointer-events:auto!important;" + "transition:none!important;" + "}" + ".rw-close-btn{" + "display:none!important;" + "}" + ".rw-card .rw-cta-inner{" + "position:relative!important;" + "display:block!important;" + "width:100%!important;" + "height:100%!important;" + "gap:0!important;" + "}" + ".rw-card .rw-cta-row{" + "position:absolute!important;" + "inset:0!important;" + "display:block!important;" + "width:100%!important;" + "height:100%!important;" + "max-width:none!important;" + "margin:0!important;" + "padding:0!important;" + "}" + ".rw-card .rw-cta-icon{" + "position:absolute!important;" + "inset:0!important;" + "display:block!important;" + "width:100%!important;" + "height:100%!important;" + "max-width:none!important;" + "margin:0!important;" + "padding:0!important;" + "border-radius:0!important;" + "}" + ".rw-card .rw-cta-icon img{" + "display:block!important;" + "width:100%!important;" + "height:100%!important;" + "max-width:none!important;" + "margin:0!important;" + "padding:0!important;" + "object-fit:cover!important;" + "object-position:center!important;" + "border-radius:0!important;" + "background:#000!important;" + "}" + ".rw-card .rw-cta-label{" + "display:none!important;" + "}" + ".rw-card .rw-start-row{" + "position:absolute!important;" + "left:16px!important;" + "right:16px!important;" + "bottom:16px!important;" + "z-index:4!important;" + "width:calc(100% - 32px)!important;" + "background:#fff!important;" + "color:#000!important;" + "border:1px solid #ddd!important;" + "box-shadow:0 2px 8px #0004!important;" + "font-size:0!important;" + "}" + ".rw-card .rw-start-row:after{" + "content:'Tap to ask me anything';" + "font-size:14px!important;" + "color:#000!important;" + "}" + ".rw-card .rw-start-row:hover{" + "background:#fff!important;" + "filter:brightness(.94)!important;" + "}" + ".rw-card .rw-start-icon svg{" + "stroke:#000!important;" + "}" + ".rw-card .rw-powered-by{" + "display:none!important;" + "}" + ".rw-call-container," + ".rw-call-container.shape-full{" + "position:absolute!important;" + "inset:0!important;" + "width:100%!important;" + "height:100%!important;" + "border-radius:0!important;" + "box-shadow:none!important;" + "}" + ".rw-call-container video{" + "width:100%!important;" + "height:100%!important;" + "object-fit:cover!important;" + "object-position:center!important;" + "background:#000!important;" + "}" + ".rw-call-container [data-avatar-control-bar]{" + "padding-bottom:16px!important;" + "}"; root.appendChild(style); var callWasActive=false; var userRequestedEnd=false; root.addEventListener( "click", function(event){ var path= event.composedPath ? event.composedPath() : []; for( var index=0; index!==path.length; index++ ){ var element= path[index]; if( element && element.getAttribute && element.getAttribute( "data-avatar-control" )==="end-call" ){ userRequestedEnd=true; break; } } }, true ); var callObserver= new MutationObserver( function(){ var callIsActive= !!root.querySelector( ".rw-call-container" ); if(callIsActive){ callWasActive=true; userRequestedEnd=false; return; } if(callWasActive){ callWasActive=false; if( userRequestedEnd && isSimonView() ){ userRequestedEnd=false; setTimeout( function(){ location.hash="home"; }, 0 ); }else{ setTimeout( reopenSimonWidget, 50 ); } return; } var wrapper= root.querySelector( ".rw-widget-wrapper" ); if( wrapper && !wrapper.classList.contains( "expanded" ) && isSimonView() ){ setTimeout( reopenSimonWidget, 50 ); } } ); callObserver.observe( root, { childList:true, subtree:true } ); } return root; }; function restore(){ Element.prototype.attachShadow= nativeAttachShadow; } function load( src, fallback ){ var script= document.createElement( "script" ); script.src=src; script.setAttribute( "data-pub-key", PUBLIC_KEY ); script.setAttribute( "data-dismissible", "false" ); script.onload= restore; script.onerror= function(){ script.remove(); if(fallback){ fallback(); }else{ restore(); } }; document.body.appendChild( script ); } function reopenSimonWidget(){ if(!isSimonView()){ return; } var attempts=0; function reopen(){ var host= document.getElementById( "runway-embed-widget" ); var root= host && host.shadowRoot; var wrapper= root && root.querySelector( ".rw-widget-wrapper" ); if(wrapper){ if( !wrapper.classList.contains( "expanded" ) ){ var launcher= root.querySelector( ".rw-pill" ); if(launcher){ launcher.click(); }else{ wrapper.classList.add( "expanded" ); } } return; } attempts++; if(attempts<30){ setTimeout( reopen, 100 ); } } setTimeout( reopen, 50 ); } window.addEventListener( "hashchange", reopenSimonWidget ); window.addEventListener( "pageshow", reopenSimonWidget ); load(CURRENT); reopenSimonWidget(); })();