UNPKG

@robotical/martyblocks

Version:
1 lines 3.43 kB
var GUI=(window.webpackJsonpGUI=window.webpackJsonpGUI||[]).push([[2],{1472:function(t,e,n){"use strict";n.r(e);var r=n(0),o=n.n(r),i=n(48),c=n.n(i),u=n(136),a=n(159),l=n(124);function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,p(r.key),r)}}function p(t){var e=function(t,e){if("object"!==f(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===f(e)?e:String(e)}function y(t,e){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},y(t,e)}function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var n,r=h(t);if(e){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"===f(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return b(t)}(this,n)}}function b(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}var w=Object(l.a)(Object(a.a)(u.a)),m="10015059",v=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y(t,e)}(c,t);var e,n,r,i=d(c);function c(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),(e=i.call(this,t)).updateProject=e.updateProject.bind(b(e)),e.state={projectId:window.location.hash.substring(1)||m},e}return e=c,(n=[{key:"componentDidMount",value:function(){window.addEventListener("hashchange",this.updateProject),window.location.hash.substring(1)||(window.location.hash=m)}},{key:"componentWillUnmount",value:function(){window.addEventListener("hashchange",this.updateProject)}},{key:"updateProject",value:function(){this.setState({projectId:window.location.hash.substring(1)})}},{key:"render",value:function(){return o.a.createElement("div",{style:{display:"flex"}},o.a.createElement(w,{isPlayerOnly:!0,isFullScreen:!1}),o.a.createElement("iframe",{allowFullScreen:!0,allowTransparency:!0,frameBorder:"0",height:"402",src:"https://scratch.mit.edu/projects/embed/".concat(this.state.projectId,"/?autostart=true"),width:"485"}))}}])&&s(e.prototype,n),r&&s(e,r),Object.defineProperty(e,"prototype",{writable:!1}),c}(o.a.Component),j=document.createElement("div");document.body.appendChild(j),c.a.render(o.a.createElement(v,null),j)}},[[1472,0]]]);