var GameLauncher;(()=>{var e={783(e){class t{createIframe(){const e=document.createElement("iframe");return Object.keys(this.iframeAttributes).forEach(t=>{const r=this.iframeAttributes[t];Array.isArray(r)?e.setAttribute(t,r.join("; ")+";"):e.setAttribute(t,r)}),e}constructor(e,t){this.iframeAttributes={frameBorder:"0",allow:["fullscreen","camera","microphone","autoplay","clipboard-read *","clipboard-write *"],height:"100%",width:"100%"},this.launch=this.run,e&&delete window.sg,this.targetContainerId=e,this.iframeAttributes=Object.assign(Object.assign({},this.iframeAttributes),t)}run(e,t,r){var n;let a;if(r=r||function(e){throw new Error(e)},"string"==typeof e)try{a=JSON.parse(e)}catch(e){r("Connector error: wrong launch options provided")}else a=Object.assign({},e);(null==a?void 0:a.target_element)&&(this.targetContainerId=a.target_element),(null==a?void 0:a.launch_url)||(null==a?void 0:a.launch_options)||(a={launch_options:a}),this.targetContainer=document.getElementById(this.targetContainerId),this.targetContainer||r("GameLauncher error: could not find target container");const i=null===(n=null==a?void 0:a.launch_options)||void 0===n?void 0:n.game_launcher_url,o=null==a?void 0:a.launch_url;i||o||r("GameLauncher error: game_launcher_url or launch_url is not set"),i&&o&&r("GameLauncher error: both game_launcher_url and launch_url are set (only one of them should be set)");try{const e=new URL(i||o);if(i){const t=window.btoa(unescape(encodeURIComponent(JSON.stringify(a))));e.searchParams.append("options",t)}else o&&(e.href=a.launch_url);this.iframe||(this.iframe=this.createIframe()),this.iframe.src=e.toString(),this.targetContainer.hasChildNodes()||this.targetContainer.appendChild(this.iframe),null==t||t()}catch(e){r(e.message)}}}e.exports=t,window.sg=new t("")}},t={};var r=function r(n){var a=t[n];if(void 0!==a)return a.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}(783);GameLauncher=r})();