(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2f0ac866"],{"49da":function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n("2b0e"),s=!0;i["default"],i["default"].util.warn;let r=0;function a(t){return isNaN(t)?t:t+"px"}var o=Object(i["defineComponent"])({name:"UnityWebglComponent",props:{unity:{type:Object},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},tabindex:{type:[Number,String]}},setup(t){const e=Object(i["ref"])(null);r++;const n=Object(i["computed"])(()=>({width:a(t.width),height:a(t.height)})),o={id:"unity-canvas-"+r};return(t.tabindex||0===t.tabindex)&&(o.tabindex=t.tabindex),Object(i["onMounted"])(()=>{var n;e.value&&(null===(n=t.unity)||void 0===n||n.create(e.value))}),Object(i["onBeforeUnmount"])(()=>{var e;null===(e=t.unity)||void 0===e||e._unsafe_unload()}),()=>Object(i["h"])("canvas",s?{ref:e,attrs:o,style:n.value}:Object.assign({ref:e,style:n.value},o))}})},"7a7c":function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));
/*!
 * unity-webgl.js v3.5.6
 * (c) 2024 Mervin<mengqing723@gmail.com>
 * Released under the MIT License.
 */
const i="undefined"!==typeof window&&"undefined"!==typeof window.document,s=t=>"[object Object]"===Object.prototype.toString.call(t),r="[UnityWebgl]: ",a=t=>{console.log(r,t)};function o(t){return t instanceof HTMLCanvasElement?t:"string"===typeof t?document.querySelector(t):(a.warn("CanvasElement not found."),null)}a.warn=t=>console.warn(r,t),a.error=t=>console.error(r,t);class u{constructor(t={}){this._eventMap=t}on(t,e){if("function"!==typeof e)throw new TypeError(r+"The argument handler must be function");return this._eventMap[t]=e,this}off(t){return delete this._eventMap[t],this}once(t,e){const n=this;function i(...i){"function"===typeof e&&(n.off(t),e.apply(n,i))}return this.on(t,i)}emit(t,...e){const n=this._eventMap[t];n&&n.apply(this,e)}clear(){for(const t in this._eventMap)delete this._eventMap[t]}}function l(t,{resolve:e,reject:n}){if(!i)return;if(!t)return void(n&&n(new Error(r+" loaderUrl not found.")));function s(i){"ready"===i?e&&e():n&&n(new Error(`${r} ${t} loading failure.`))}let a=window.document.querySelector(`script[src="${t}"]`);if(null===a){a=window.document.createElement("script"),a.type="text/javascript",a.src=t,a.async=!0,a.setAttribute("data-status","loading"),window.document.body.appendChild(a);const e=function(t){const e="load"===t.type?"ready":"error";null===a||void 0===a||a.setAttribute("data-status",e)};a.addEventListener("load",e),a.addEventListener("error",e)}else s(a.getAttribute("data-status"));const o=function(t){s("load"===t.type?"ready":"error")};return a.addEventListener("load",o),a.addEventListener("error",o),function(){a&&(a.removeEventListener("load",o),a.removeEventListener("error",o),window.document.body.removeChild(a))}}let c="__UnityLib__";const d={streamingAssetsUrl:"StreamingAssets",companyName:"Unity",productName:"Unity"};function h(t){const e=Object.assign({},t.unityConfig);return e.print=function(e){t.emit("debug",e)},e.printError=function(e){t.emit("error",e)},e}class y extends u{constructor(t,e,n){let i;if(i=globalThis||i,n=null!==n&&void 0!==n?n:c,s(t)&&"string"===typeof e&&(n=e||n),n in i&&a.error(r+`window.${n} already exists.`),c=n,super(i[n]={}),this.canvasElement=null,this.unityLoader=null,this.unityInstance=null,s(t))this.unityConfig=Object.assign({},d,t);else{this.unityConfig=Object.assign({},d,e);const n=o(t);n&&this.create(n)}}get bridge(){return c}set bridge(t){
//!window
window[t]=window[c],delete window[c],c=t}create(t){if(!i)return;if(this.unityInstance&&this.canvasElement&&this.unityLoader)return void a.warn("Unity Instance already exists!");const e=o(t);if(!e)return void a.warn("CanvasElement not found.");this.canvasElement=e;const n=this,s=h(this);this.emit("beforeMount",this),this.unityLoader=l(this.unityConfig.loaderUrl,{resolve(){try{window.createUnityInstance(e,s,t=>n.emit("progress",t)).then(t=>{n.unityInstance=t,n.emit("created",t),n.emit("mounted",n)}).catch(t=>{throw t})}catch(t){n.unityInstance=null,n.emit("error",t)}},reject(t){a.error(t.message),n.emit("error",t)}})}reload(t){var e,n;const i=this.canvasElement||(null===(n=null===(e=this.unityInstance)||void 0===e?void 0:e.Module)||void 0===n?void 0:n.canvas);this.unityInstance&&i&&this.unityInstance.Quit().then(()=>{this.unityLoader=null,this.unityConfig=Object.assign({},this.unityConfig,t),this.emit("reload",this),this.create(i)}).catch(t=>{this.emit("error",t)})}send(t,e,n){if(this.unityInstance)if(void 0===n||null===n)this.unityInstance.SendMessage(t,e);else{const i="object"===typeof n?JSON.stringify(n):n;this.unityInstance.SendMessage(t,e,i)}else a.warn("Unable to Send Message while Unity is not Instantiated.");return this}requestPointerLock(){var t,e;const n=this.canvasElement||(null===(e=null===(t=this.unityInstance)||void 0===t?void 0:t.Module)||void 0===e?void 0:e.canvas);n&&n.requestPointerLock()}takeScreenshot(t="image/jpeg",e){var n,i,s;const r=this.canvasElement||(null===(i=null===(n=this.unityInstance)||void 0===n?void 0:n.Module)||void 0===i?void 0:i.canvas);if(r)return!0!==(null===(s=this.unityConfig.webglContextAttributes)||void 0===s?void 0:s.preserveDrawingBuffer)&&a.warn('Taking a screenshot requires "preserveDrawingBuffer".'),r.toDataURL(t,e);a.warn("Unable to Take Screenshot while Unity is not Instantiated or Canvas is not available.")}setFullscreen(t){this.unityInstance?this.unityInstance.SetFullscreen(t?1:0):a.warn("Unable to Set Fullscreen while Unity is not Instantiated.")}unload(){return this.unityInstance?(this.emit("beforeUnmount",this),"function"===typeof this.unityLoader&&(this.unityLoader(),this.unityLoader=null),this.unityInstance.Quit().then(()=>{this.unityInstance=null,this.canvasElement=null,delete window[c],this.emit("unmounted"),this.emit("destroyed")}).catch(t=>{throw a.error("Unable to Unload Unity"),this.emit("error",t),t})):(a.warn("Unable to Quit Unity while Unity is not Instantiated."),Promise.reject(new Error("Unity is not Instantiated.")))}_unsafe_unload(){try{if(null===this.unityInstance||!this.unityInstance.Module.canvas)return a.warn("No Unity Instance found."),Promise.reject();const t=this.unityInstance.Module.canvas;return document.body.appendChild(t),t.style.display="none",this.unload().then(()=>{t.remove()})}catch(t){return a.error(t.message),Promise.reject(t)}}}},ae88:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t._self._c;return e("div",[t.loading?[e("div",{staticClass:"text-center"},[e("v-progress-circular",{attrs:{indeterminate:"",color:"success"}})],1)]:t._e(),t.loading?t._e():e("VueUnity",{staticClass:"pl-8 unity-canvas pt-8 rounded-0",attrs:{unity:t.unityContext,width:"100%",height:"50vh"}}),t._v(" "),e("br"),e("br")],2)},s=[],r=n("7a7c"),a=n("49da");const o=new r["a"]({loaderUrl:"/Build/buho/final2.loader.js",dataUrl:"/Build/buho/final2.data",frameworkUrl:"/Build/buho/final2.framework.js",codeUrl:"/Build/buho/final2.wasm"});o.on("device",()=>alert("click device ..."));var u={props:["data"],components:{VueUnity:a["a"]},data(){return{unityContext:o,loading:!0,datos:null}},mounted(){this.cargarDatos()},methods:{async cargarDatos(){await this.axios.get("/course/dinamicas/datos/"+this.data.game.id).then(t=>{0==t.data.length?(this.loading=!1,this.datos=[],alert("no hay datos")):(this.datos=JSON.stringify(t.data),this.loading=!1,setTimeout(this.consumirAPI,1e4))})},consumirAPI(){o.send("JavaScriptJson","setString",this.datos)}}},l=u,c=n("2877"),d=Object(c["a"])(l,i,s,!1,null,null,null);e["default"]=d.exports}}]);
//# sourceMappingURL=chunk-2f0ac866.4a70f51b.js.map