{"code":"!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t(require(\"react\"),require(\"react-dom\")):\"function\"==typeof define&&define.amd?define([\"react\",\"react-dom\"],t):\"object\"==typeof exports?exports.GUI=t(require(\"react\"),require(\"react-dom\")):e.GUI=t(e.react,e[\"react-dom\"])}(window,(function(__WEBPACK_EXTERNAL_MODULE__1__,__WEBPACK_EXTERNAL_MODULE__76__){return function(e){function t(t){for(var i,o,a=t[0],r=t[1],s=0,u=[];s0&&void 0!==arguments[0]?arguments[0]:[];(Array.isArray(e)?e:[e]).forEach((function(e){e&&e.locale&&(r.a.__addLocaleData(e),l.a.__addLocaleData(e))}))}function w(e){var t=e&&e.toLowerCase();return!(!r.a.__localeData__[t]||!l.a.__localeData__[t])}var T=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},S=(function(){function e(e){this.value=e}function t(t){var i,n;function o(i,n){try{var r=t[i](n),s=r.value;s instanceof e?Promise.resolve(s.value).then((function(e){o(\"next\",e)}),(function(e){o(\"throw\",e)})):a(r.done?\"return\":\"normal\",r.value)}catch(e){a(\"throw\",e)}}function a(e,t){switch(e){case\"return\":i.resolve({value:t,done:!0});break;case\"throw\":i.reject(t);break;default:i.resolve({value:t,done:!1})}(i=i.next)?o(i.key,i.arg):n=null}this._invoke=function(e,t){return new Promise((function(a,r){var s={key:e,arg:t,resolve:a,reject:r,next:null};n?n=n.next=s:(i=n=s,o(e,t))}))},\"function\"!=typeof t.return&&(this.return=void 0)}\"function\"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke(\"next\",e)},t.prototype.throw=function(e){return this._invoke(\"throw\",e)},t.prototype.return=function(e){return this._invoke(\"return\",e)}}(),function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}),M=function(){function e(e,t){for(var i=0;i\":\">\",\"<\":\"<\",'\"':\""\",\"'\":\"'\"},J=/[&><\"']/g;function $(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.reduce((function(t,n){return e.hasOwnProperty(n)?t[n]=e[n]:i.hasOwnProperty(n)&&(t[n]=i[n]),t}),{})}function ee(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).intl;f()(e,\"[React Intl] Could not find required `intl` object. needs to exist in the component ancestry.\")}function te(e,t){if(e===t)return!0;if(\"object\"!==(void 0===e?\"undefined\":T(e))||null===e||\"object\"!==(void 0===t?\"undefined\":T(t))||null===t)return!1;var i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(t),a=0;a3&&void 0!==arguments[3]?arguments[3]:{},s=(void 0===a?{}:a).intl,l=void 0===s?{}:s,u=r.intl,c=void 0===u?{}:u;return!te(t,n)||!te(i,o)||!(c===l||te($(c,Q),$(l,Q)))}function ne(e,t){return\"[React Intl] \"+e+(t?\"\\n\"+t:\"\")}function oe(e){0}function ae(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.intlPropName,o=void 0===n?\"intl\":n,a=i.withRef,r=void 0!==a&&a,s=function(t){function i(e,t){S(this,i);var n=_(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e,t));return ee(t),n}return x(i,t),M(i,[{key:\"getWrappedInstance\",value:function(){return f()(r,\"[React Intl] To access the wrapped instance, the `{withRef: true}` option must be set when calling: `injectIntl()`\"),this._wrappedInstance}},{key:\"render\",value:function(){var t=this;return p.a.createElement(e,I({},this.props,E({},o,this.context.intl),{ref:r?function(e){return t._wrappedInstance=e}:null}))}}]),i}(d.Component);return s.displayName=\"InjectIntl(\"+(((t=e).displayName||t.name||\"Component\")+\")\"),s.contextTypes={intl:V},s.WrappedComponent=e,g()(s,e)}function re(e){return e}var se=function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};S(this,e);var n,o=\"ordinal\"===i.style,a=(n=function(e){return r.a.prototype._resolveLocale(e)}(t),r.a.prototype._findPluralRuleFunction(n));this.format=function(e){return a(e,o)}},le=Object.keys(q),ue=Object.keys(Y),ce=Object.keys(Z),de=Object.keys(K),pe={second:60,minute:60,hour:24,day:30,month:12};function me(e){var t=l.a.thresholds;t.second=e.second,t.minute=e.minute,t.hour=e.hour,t.day=e.day,t.month=e.month,t[\"second-short\"]=e[\"second-short\"],t[\"minute-short\"]=e[\"minute-short\"],t[\"hour-short\"]=e[\"hour-short\"],t[\"day-short\"]=e[\"day-short\"],t[\"month-short\"]=e[\"month-short\"]}function ge(e,t,i,n){var o=e&&e[t]&&e[t][i];if(o)return o;n(ne(\"No \"+t+\" format named: \"+i))}function he(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.locale,a=e.formats,r=e.messages,s=e.defaultLocale,l=e.defaultFormats,u=i.id,c=i.defaultMessage;f()(u,\"[React Intl] An `id` must be provided to format a message.\");var d=r&&r[u];if(!(Object.keys(n).length>0))return d||c||u;var p=void 0,m=e.onError||oe;if(d)try{p=t.getMessageFormat(d,o,a).format(n)}catch(e){m(ne('Error formatting message: \"'+u+'\" for locale: \"'+o+'\"'+(c?\", using default message as fallback.\":\"\"),e))}else(!c||o&&o.toLowerCase()!==s.toLowerCase())&&m(ne('Missing message: \"'+u+'\" for locale: \"'+o+'\"'+(c?\", using default message as fallback.\":\"\")));if(!p&&c)try{p=t.getMessageFormat(c,s,l).format(n)}catch(e){m(ne('Error formatting the default message for: \"'+u+'\"',e))}return p||m(ne('Cannot format message: \"'+u+'\", using message '+(d||c?\"source\":\"id\")+\" as fallback.\")),p||d||c||u}var fe=Object.freeze({formatDate:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.locale,a=e.formats,r=e.timeZone,s=n.format,l=e.onError||oe,u=new Date(i),c=I({},r&&{timeZone:r},s&&ge(a,\"date\",s,l)),d=$(n,le,c);try{return t.getDateTimeFormat(o,d).format(u)}catch(e){l(ne(\"Error formatting date.\",e))}return String(u)},formatTime:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.locale,a=e.formats,r=e.timeZone,s=n.format,l=e.onError||oe,u=new Date(i),c=I({},r&&{timeZone:r},s&&ge(a,\"time\",s,l)),d=$(n,le,c);d.hour||d.minute||d.second||(d=I({},d,{hour:\"numeric\",minute:\"numeric\"}));try{return t.getDateTimeFormat(o,d).format(u)}catch(e){l(ne(\"Error formatting time.\",e))}return String(u)},formatRelative:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.locale,a=e.formats,r=n.format,s=e.onError||oe,u=new Date(i),c=new Date(n.now),d=r&&ge(a,\"relative\",r,s),p=$(n,ce,d),m=I({},l.a.thresholds);me(pe);try{return t.getRelativeFormat(o,p).format(u,{now:isFinite(c)?c:t.now()})}catch(e){s(ne(\"Error formatting relative time.\",e))}finally{me(m)}return String(u)},formatNumber:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.locale,a=e.formats,r=n.format,s=e.onError||oe,l=r&&ge(a,\"number\",r,s),u=$(n,ue,l);try{return t.getNumberFormat(o,u).format(i)}catch(e){s(ne(\"Error formatting number.\",e))}return String(i)},formatPlural:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.locale,a=$(n,de),r=e.onError||oe;try{return t.getPluralFormat(o,a).format(i)}catch(e){r(ne(\"Error formatting plural.\",e))}return\"other\"},formatMessage:he,formatHTMLMessage:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return he(e,t,i,Object.keys(n).reduce((function(e,t){var i=n[t];return e[t]=\"string\"==typeof i?(\"\"+i).replace(J,(function(e){return X[e]})):i,e}),{}))}}),be=Object.keys(G),ye=Object.keys(W),ve={formats:{},messages:{},timeZone:null,textComponent:\"span\",defaultLocale:\"en\",defaultFormats:{},onError:oe},ke=function(e){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};S(this,t);var n=_(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i));f()(\"undefined\"!=typeof Intl,\"[React Intl] The `Intl` APIs must be available in the runtime, and do not appear to be built-in. An `Intl` polyfill should be loaded.\\nSee: http://formatjs.io/guides/runtime-environments/\");var o=i.intl,a=void 0;a=isFinite(e.initialNow)?Number(e.initialNow):o?o.now():Date.now();var s=(o||{}).formatters,u=void 0===s?{getDateTimeFormat:y(Intl.DateTimeFormat),getNumberFormat:y(Intl.NumberFormat),getMessageFormat:y(r.a),getRelativeFormat:y(l.a),getPluralFormat:y(se)}:s;return n.state=I({},u,{now:function(){return n._didDisplay?Date.now():a}}),n}return x(t,e),M(t,[{key:\"getConfig\",value:function(){var e=this.context.intl,t=$(this.props,be,e);for(var i in ve)void 0===t[i]&&(t[i]=ve[i]);if(!function(e){for(var t=(e||\"\").split(\"-\");t.length>0;){if(w(t.join(\"-\")))return!0;t.pop()}return!1}(t.locale)){var n=t,o=n.locale,a=n.defaultLocale,r=n.defaultFormats;(0,n.onError)(ne('Missing locale data for locale: \"'+o+'\". Using default locale: \"'+a+'\" as fallback.')),t=I({},t,{locale:a,formats:r,messages:ve.messages})}return t}},{key:\"getBoundFormatFns\",value:function(e,t){return ye.reduce((function(i,n){return i[n]=fe[n].bind(null,e,t),i}),{})}},{key:\"getChildContext\",value:function(){var e=this.getConfig(),t=this.getBoundFormatFns(e,this.state),i=this.state,n=i.now,o=function(e,t){var i={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n]);return i}(i,[\"now\"]);return{intl:I({},e,t,{formatters:o,now:n})}}},{key:\"shouldComponentUpdate\",value:function(){for(var e=arguments.length,t=Array(e),i=0;i1?n-1:0),a=1;a0){var y=Math.floor(1099511627776*Math.random()).toString(16),v=(e=0,function(){return\"ELEMENT-\"+y+\"-\"+(e+=1)});h=\"@__\"+y+\"__@\",f={},b={},Object.keys(c).forEach((function(e){var t=c[e];if(Object(d.isValidElement)(t)){var i=v();f[e]=h+i+h,b[i]=t}else f[e]=t}))}var k=n({id:s,description:l,defaultMessage:u},f||c),w=void 0;return w=b&&Object.keys(b).length>0?k.split(h).filter((function(e){return!!e})).map((function(e){return b[e]||e})):[k],\"function\"==typeof g?g.apply(void 0,O(w)):d.createElement.apply(void 0,[m,null].concat(O(w)))}}]),t}(d.Component);Oe.displayName=\"FormattedMessage\",Oe.contextTypes={intl:V},Oe.defaultProps={values:{}};var Ce=function(e){function t(e,i){S(this,t);var n=_(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i));return ee(i),n}return x(t,e),M(t,[{key:\"shouldComponentUpdate\",value:function(e){var t=this.props.values;if(!te(e.values,t))return!0;for(var i=I({},e,{values:t}),n=arguments.length,o=Array(n>1?n-1:0),a=1;a0||l+n0?[[\"dictionary\",n.definitions],o]:o},deserialize:function(e,t,i,n,o){var a=e,r=!i,s=r&&e&&e.length&&\"dictionary\"===e[0][0];if(i=i||{},Array.isArray(e)){var l=e[0],c=\"dictionary\"===l;if(1==e.length&&/^#/.test(l))return i.dictionary[l];a=[];for(var d=(l=u.exports[l])?1:0,p=e.length;de.length&&(i=e.length);for(var s=0;s0){var a=t[o],r=a&&a[n];r&&r.call(this,o)}},statics:{inject:function e(t){var i=t._events;if(i){var n={};u.each(i,(function(e,i){var o=\"string\"==typeof e,a=o?e:i,r=u.capitalize(a),s=a.substring(2).toLowerCase();n[s]=o?{}:e,a=\"_\"+a,t[\"get\"+r]=function(){return this[a]},t[\"set\"+r]=function(e){var t=this[a];t&&this.off(s,t),e&&this.on(s,e),this[a]=e}})),t._eventTypes=n}return e.base.apply(this,arguments)}}},d=u.extend({_class:\"PaperScope\",initialize:function e(){le=this,this.settings=new u({applyMatrix:!0,insertItems:!0,handleSize:4,hitTolerance:0}),this.project=null,this.projects=[],this.tools=[],this._id=e._id++,e._scopes[this._id]=this;var t=e.prototype;if(!this.support){var i=oe.getContext(1,1)||{};t.support={nativeDash:\"setLineDash\"in i||\"mozDash\"in i,nativeBlendModes:ae.nativeModes},oe.release(i)}if(!this.agent){var n=a.navigator.userAgent.toLowerCase(),o=(/(darwin|win|mac|linux|freebsd|sunos)/.exec(n)||[])[0],r=\"darwin\"===o?\"mac\":o,s=t.agent=t.browser={platform:r};r&&(s[r]=!0),n.replace(/(opera|chrome|safari|webkit|firefox|msie|trident|atom|node|jsdom)\\/?\\s*([.\\d]+)(?:.*version\\/([.\\d]+))?(?:.*rv\\:v?([.\\d]+))?/g,(function(e,t,i,n,o){if(!s.chrome){var a=\"opera\"===t?n:/^(node|trident)$/.test(t)?o:i;s.version=a,s.versionNumber=parseFloat(a),t={trident:\"msie\",jsdom:\"node\"}[t]||t,s.name=t,s[t]=!0}})),s.chrome&&delete s.webkit,s.atom&&delete s.chrome}},version:\"0.12.7\",getView:function(){var e=this.project;return e&&e._view},getPaper:function(){return this},execute:function(e,t){var i=le.PaperScript.execute(e,this,t);return X.updateFocus(),i},install:function(e){var t=this;for(var i in u.each([\"project\",\"view\",\"tool\"],(function(i){u.define(e,i,{configurable:!0,get:function(){return t[i]}})})),this)!/^_/.test(i)&&this[i]&&(e[i]=this[i])},setup:function(e){return le=this,this.project=new E(e),this},createCanvas:function(e,t){return oe.getCanvas(e,t)},activate:function(){le=this},clear:function(){for(var e=this.projects,t=this.tools,i=e.length-1;i>=0;i--)e[i].remove();for(i=t.length-1;i>=0;i--)t[i].remove()},remove:function(){this.clear(),delete d._scopes[this._id]},statics:new function(){function e(e){return e+=\"Attribute\",function(t,i){return t[e](i)||t[e](\"data-paper-\"+i)}}return{_scopes:{},_id:0,get:function(e){return this._scopes[e]||null},getAttribute:e(\"get\"),hasAttribute:e(\"has\")}}}),p=u.extend(c,{initialize:function(e){this._scope=le,this._index=this._scope[this._list].push(this)-1,!e&&this._scope[this._reference]||this.activate()},activate:function(){if(!this._scope)return!1;var e=this._scope[this._reference];return e&&e!==this&&e.emit(\"deactivate\"),this._scope[this._reference]=this,this.emit(\"activate\",e),!0},isActive:function(){return this._scope[this._reference]===this},remove:function(){return null!=this._index&&(u.splice(this._scope[this._list],null,this._index,1),this._scope[this._reference]==this&&(this._scope[this._reference]=null),this._scope=null,!0)},getView:function(){return this._scope.getView()}}),m={findItemBoundsCollisions:function(e,t,i){function n(e){for(var t=new Array(e.length),i=0;i>>1;r[e[a]][t]=s;(o||(w&&N||T&&C)&&I>=O[p]-i&&x<=O[m]+i)&&(w&&N&&S.push(a?_:_-s),T&&C&&b[_].push(k))}}}if(w&&(e===t&&S.push(y),b[y]=S),f.length){var A=u(f,d,v[d]);f.splice(A+1,0,y)}else f.push(y)}for(h=0;hi?i:e}function u(e,t,n){function o(e){var t=134217729*e,i=e-t+t;return[i,e-i]}var a=t*t-e*n,r=t*t+e*n;if(3*i(a)1e8)?o(2,-Math.round(a(e))):0}return{EPSILON:r,MACHINE_EPSILON:s,CURVETIME_EPSILON:1e-8,GEOMETRIC_EPSILON:1e-7,TRIGONOMETRIC_EPSILON:1e-8,KAPPA:4*(n(2)-1)/3,isZero:function(e){return e>=-1e-12&&e<=r},isMachineZero:function(e){return e>=-112e-18&&e<=s},clamp:l,integrate:function(i,n,o,a){for(var r=e[a-2],s=t[a-2],l=.5*(o-n),u=l+n,c=0,d=a+1>>1,p=1&a?s[c++]*i(u):0;c0?(a=n,n=p<=o?.5*(o+a):p):(o=n,n=p>=a?.5*(o+a):p)}return l(n,o,a)},solveQuadratic:function(e,t,o,a,d,p){var m,g=1/0;if(i(e)=-112e-18){var b=h<0?0:n(h),y=t+(t<0?-b:b);0===y?g=-(m=o/e):(m=y/e,g=o/y)}}var v=0,k=null==d,w=d-r,T=p+r;return isFinite(m)&&(k||m>w&&mw&&g0?1.324717957244746*Math.max(S,n(E)):S,x=g-M*I;if(x!==g){do{w(x),x=0===y?g:g-v/y/(1+s)}while(M*x>M*g);i(e)*g*g>i(u/g)&&(f=((b=-u/g)-a)/g)}}var _=h.solveQuadratic(e,f,b,d,p,m),O=null==p;return isFinite(g)&&(0===_||_>0&&g!==d[0]&&g!==d[1])&&(O||g>p-r&&g1?r[1]:r[0])):\"x\"in r?this._set(r.x||0,r.y||0):\"width\"in r?this._set(r.width||0,r.height||0):\"angle\"in r?(this._set(r.length||0,0),this.setAngle(r.angle||0)):(this._set(0,0),o=0)}return n&&(this.__read=o),this},set:\"#initialize\",_set:function(e,t){return this.x=e,this.y=t,this},equals:function(e){return this===e||e&&(this.x===e.x&&this.y===e.y||Array.isArray(e)&&this.x===e[0]&&this.y===e[1])||!1},clone:function(){return new b(this.x,this.y)},toString:function(){var e=g.instance;return\"{ x: \"+e.number(this.x)+\", y: \"+e.number(this.y)+\" }\"},_serialize:function(e){var t=e.formatter;return[t.number(this.x),t.number(this.y)]},getLength:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},setLength:function(e){if(this.isZero()){var t=this._angle||0;this._set(Math.cos(t)*e,Math.sin(t)*e)}else{var i=e/this.getLength();h.isZero(i)&&this.getAngle(),this._set(this.x*i,this.y*i)}},getAngle:function(){return 180*this.getAngleInRadians.apply(this,arguments)/Math.PI},setAngle:function(e){this.setAngleInRadians.call(this,e*Math.PI/180)},getAngleInDegrees:\"#getAngle\",setAngleInDegrees:\"#setAngle\",getAngleInRadians:function(){if(arguments.length){var e=b.read(arguments),t=this.getLength()*e.getLength();if(h.isZero(t))return NaN;var i=this.dot(e)/t;return Math.acos(i<-1?-1:i>1?1:i)}return this.isZero()?this._angle||0:this._angle=Math.atan2(this.y,this.x)},setAngleInRadians:function(e){if(this._angle=e,!this.isZero()){var t=this.getLength();this._set(Math.cos(e)*t,Math.sin(e)*t)}},getQuadrant:function(){return this.x>=0?this.y>=0?1:4:this.y>=0?2:3}},{beans:!1,getDirectedAngle:function(){var e=b.read(arguments);return 180*Math.atan2(this.cross(e),this.dot(e))/Math.PI},getDistance:function(){var e=arguments,t=b.read(e),i=t.x-this.x,n=t.y-this.y,o=i*i+n*n;return u.read(e)?o:Math.sqrt(o)},normalize:function(e){e===r&&(e=1);var t=this.getLength(),i=0!==t?e/t:0,n=new b(this.x*i,this.y*i);return i>=0&&(n._angle=this._angle),n},rotate:function(e,t){if(0===e)return this.clone();e=e*Math.PI/180;var i=t?this.subtract(t):this,n=Math.sin(e),o=Math.cos(e);return i=new b(i.x*o-i.y*n,i.x*n+i.y*o),t?i.add(t):i},transform:function(e){return e?e._transformPoint(this):this},add:function(){var e=b.read(arguments);return new b(this.x+e.x,this.y+e.y)},subtract:function(){var e=b.read(arguments);return new b(this.x-e.x,this.y-e.y)},multiply:function(){var e=b.read(arguments);return new b(this.x*e.x,this.y*e.y)},divide:function(){var e=b.read(arguments);return new b(this.x/e.x,this.y/e.y)},modulo:function(){var e=b.read(arguments);return new b(this.x%e.x,this.y%e.y)},negate:function(){return new b(-this.x,-this.y)},isInside:function(){return w.read(arguments).contains(this)},isClose:function(){var e=arguments,t=b.read(e),i=u.read(e);return this.getDistance(t)<=i},isCollinear:function(){var e=b.read(arguments);return b.isCollinear(this.x,this.y,e.x,e.y)},isColinear:\"#isCollinear\",isOrthogonal:function(){var e=b.read(arguments);return b.isOrthogonal(this.x,this.y,e.x,e.y)},isZero:function(){var e=h.isZero;return e(this.x)&&e(this.y)},isNaN:function(){return isNaN(this.x)||isNaN(this.y)},isInQuadrant:function(e){return this.x*(e>1&&e<4?-1:1)>=0&&this.y*(e>2?-1:1)>=0},dot:function(){var e=b.read(arguments);return this.x*e.x+this.y*e.y},cross:function(){var e=b.read(arguments);return this.x*e.y-this.y*e.x},project:function(){var e=b.read(arguments),t=e.isZero()?0:this.dot(e)/e.dot(e);return new b(e.x*t,e.y*t)},statics:{min:function(){var e=arguments,t=b.read(e),i=b.read(e);return new b(Math.min(t.x,i.x),Math.min(t.y,i.y))},max:function(){var e=arguments,t=b.read(e),i=b.read(e);return new b(Math.max(t.x,i.x),Math.max(t.y,i.y))},random:function(){return new b(Math.random(),Math.random())},isCollinear:function(e,t,i,n){return Math.abs(e*n-t*i)<=1e-8*Math.sqrt((e*e+t*t)*(i*i+n*n))},isOrthogonal:function(e,t,i,n){return Math.abs(e*i+t*n)<=1e-8*Math.sqrt((e*e+t*t)*(i*i+n*n))}}},u.each([\"round\",\"ceil\",\"floor\",\"abs\"],(function(e){var t=Math[e];this[e]=function(){return new b(t(this.x),t(this.y))}}),{})),y=b.extend({initialize:function(e,t,i,n){this._x=e,this._y=t,this._owner=i,this._setter=n},_set:function(e,t,i){return this._x=e,this._y=t,i||this._owner[this._setter](this),this},getX:function(){return this._x},setX:function(e){this._x=e,this._owner[this._setter](this)},getY:function(){return this._y},setY:function(e){this._y=e,this._owner[this._setter](this)},isSelected:function(){return!!(this._owner._selection&this._getSelection())},setSelected:function(e){this._owner._changeSelection(this._getSelection(),e)},_getSelection:function(){return\"setPosition\"===this._setter?4:0}}),v=u.extend({_class:\"Size\",_readIndex:!0,initialize:function(e,t){var i=typeof e,n=this.__read,o=0;if(\"number\"===i){var a=\"number\"==typeof t;this._set(e,a?t:e),n&&(o=a?2:1)}else if(\"undefined\"===i||null===e)this._set(0,0),n&&(o=null===e?1:0);else{var r=\"string\"===i?e.split(/[\\s,]+/)||[]:e;o=1,Array.isArray(r)?this._set(+r[0],+(r.length>1?r[1]:r[0])):\"width\"in r?this._set(r.width||0,r.height||0):\"x\"in r?this._set(r.x||0,r.y||0):(this._set(0,0),o=0)}return n&&(this.__read=o),this},set:\"#initialize\",_set:function(e,t){return this.width=e,this.height=t,this},equals:function(e){return e===this||e&&(this.width===e.width&&this.height===e.height||Array.isArray(e)&&this.width===e[0]&&this.height===e[1])||!1},clone:function(){return new v(this.width,this.height)},toString:function(){var e=g.instance;return\"{ width: \"+e.number(this.width)+\", height: \"+e.number(this.height)+\" }\"},_serialize:function(e){var t=e.formatter;return[t.number(this.width),t.number(this.height)]},add:function(){var e=v.read(arguments);return new v(this.width+e.width,this.height+e.height)},subtract:function(){var e=v.read(arguments);return new v(this.width-e.width,this.height-e.height)},multiply:function(){var e=v.read(arguments);return new v(this.width*e.width,this.height*e.height)},divide:function(){var e=v.read(arguments);return new v(this.width/e.width,this.height/e.height)},modulo:function(){var e=v.read(arguments);return new v(this.width%e.width,this.height%e.height)},negate:function(){return new v(-this.width,-this.height)},isZero:function(){var e=h.isZero;return e(this.width)&&e(this.height)},isNaN:function(){return isNaN(this.width)||isNaN(this.height)},statics:{min:function(e,t){return new v(Math.min(e.width,t.width),Math.min(e.height,t.height))},max:function(e,t){return new v(Math.max(e.width,t.width),Math.max(e.height,t.height))},random:function(){return new v(Math.random(),Math.random())}}},u.each([\"round\",\"ceil\",\"floor\",\"abs\"],(function(e){var t=Math[e];this[e]=function(){return new v(t(this.width),t(this.height))}}),{})),k=v.extend({initialize:function(e,t,i,n){this._width=e,this._height=t,this._owner=i,this._setter=n},_set:function(e,t,i){return this._width=e,this._height=t,i||this._owner[this._setter](this),this},getWidth:function(){return this._width},setWidth:function(e){this._width=e,this._owner[this._setter](this)},getHeight:function(){return this._height},setHeight:function(e){this._height=e,this._owner[this._setter](this)}}),w=u.extend({_class:\"Rectangle\",_readIndex:!0,beans:!0,initialize:function(e,t,i,n){var o,a=arguments,s=typeof e;if(\"number\"===s?(this._set(e,t,i,n),o=4):\"undefined\"===s||null===e?(this._set(0,0,0,0),o=null===e?1:0):1===a.length&&(Array.isArray(e)?(this._set.apply(this,e),o=1):e.x!==r||e.width!==r?(this._set(e.x||0,e.y||0,e.width||0,e.height||0),o=1):e.from===r&&e.to===r&&(this._set(0,0,0,0),u.readSupported(a,this)&&(o=1))),o===r){var l,c,d=b.readNamed(a,\"from\"),p=u.peek(a),m=d.x,g=d.y;if(p&&p.x!==r||u.hasNamed(a,\"to\")){var h=b.readNamed(a,\"to\");l=h.x-m,c=h.y-g,l<0&&(m=h.x,l=-l),c<0&&(g=h.y,c=-c)}else{var f=v.read(a);l=f.width,c=f.height}this._set(m,g,l,c),o=a.__index}var y=a.__filtered;return y&&(this.__filtered=y),this.__read&&(this.__read=o),this},set:\"#initialize\",_set:function(e,t,i,n){return this.x=e,this.y=t,this.width=i,this.height=n,this},clone:function(){return new w(this.x,this.y,this.width,this.height)},equals:function(e){var t=u.isPlainValue(e)?w.read(arguments):e;return t===this||t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height||!1},toString:function(){var e=g.instance;return\"{ x: \"+e.number(this.x)+\", y: \"+e.number(this.y)+\", width: \"+e.number(this.width)+\", height: \"+e.number(this.height)+\" }\"},_serialize:function(e){var t=e.formatter;return[t.number(this.x),t.number(this.y),t.number(this.width),t.number(this.height)]},getPoint:function(e){return new(e?b:y)(this.x,this.y,this,\"setPoint\")},setPoint:function(){var e=b.read(arguments);this.x=e.x,this.y=e.y},getSize:function(e){return new(e?v:k)(this.width,this.height,this,\"setSize\")},_fw:1,_fh:1,setSize:function(){var e=v.read(arguments),t=this._sx,i=this._sy,n=e.width,o=e.height;t&&(this.x+=(this.width-n)*t),i&&(this.y+=(this.height-o)*i),this.width=n,this.height=o,this._fw=this._fh=1},getLeft:function(){return this.x},setLeft:function(e){if(!this._fw){var t=e-this.x;this.width-=.5===this._sx?2*t:t}this.x=e,this._sx=this._fw=0},getTop:function(){return this.y},setTop:function(e){if(!this._fh){var t=e-this.y;this.height-=.5===this._sy?2*t:t}this.y=e,this._sy=this._fh=0},getRight:function(){return this.x+this.width},setRight:function(e){if(!this._fw){var t=e-this.x;this.width=.5===this._sx?2*t:t}this.x=e-this.width,this._sx=1,this._fw=0},getBottom:function(){return this.y+this.height},setBottom:function(e){if(!this._fh){var t=e-this.y;this.height=.5===this._sy?2*t:t}this.y=e-this.height,this._sy=1,this._fh=0},getCenterX:function(){return this.x+this.width/2},setCenterX:function(e){this._fw||.5===this._sx?this.x=e-this.width/2:(this._sx&&(this.x+=2*(e-this.x)*this._sx),this.width=2*(e-this.x)),this._sx=.5,this._fw=0},getCenterY:function(){return this.y+this.height/2},setCenterY:function(e){this._fh||.5===this._sy?this.y=e-this.height/2:(this._sy&&(this.y+=2*(e-this.y)*this._sy),this.height=2*(e-this.y)),this._sy=.5,this._fh=0},getCenter:function(e){return new(e?b:y)(this.getCenterX(),this.getCenterY(),this,\"setCenter\")},setCenter:function(){var e=b.read(arguments);return this.setCenterX(e.x),this.setCenterY(e.y),this},getArea:function(){return this.width*this.height},isEmpty:function(){return 0===this.width||0===this.height},contains:function(e){return e&&e.width!==r||4===(Array.isArray(e)?e:arguments).length?this._containsRectangle(w.read(arguments)):this._containsPoint(b.read(arguments))},_containsPoint:function(e){var t=e.x,i=e.y;return t>=this.x&&i>=this.y&&t<=this.x+this.width&&i<=this.y+this.height},_containsRectangle:function(e){var t=e.x,i=e.y;return t>=this.x&&i>=this.y&&t+e.width<=this.x+this.width&&i+e.height<=this.y+this.height},intersects:function(){var e=w.read(arguments),t=u.read(arguments)||0;return e.x+e.width>this.x-t&&e.y+e.height>this.y-t&&e.x=4&&(e[1]+=n?\"Y\":\"X\");var o=e[n?0:1],a=e[n?1:0],r=\"get\"+o,s=\"get\"+a,l=\"set\"+o,u=\"set\"+a,c=\"set\"+i;this[\"get\"+i]=function(e){return new(e?b:y)(this[r](),this[s](),this,c)},this[c]=function(){var e=b.read(arguments);this[l](e.x),this[u](e.y)}}),{beans:!0})),T=w.extend({initialize:function(e,t,i,n,o,a){this._set(e,t,i,n,!0),this._owner=o,this._setter=a},_set:function(e,t,i,n,o){return this._x=e,this._y=t,this._width=i,this._height=n,o||this._owner[this._setter](this),this}},new function(){var e=w.prototype;return u.each([\"x\",\"y\",\"width\",\"height\"],(function(e){var t=u.capitalize(e),i=\"_\"+e;this[\"get\"+t]=function(){return this[i]},this[\"set\"+t]=function(e){this[i]=e,this._dontNotify||this._owner[this._setter](this)}}),u.each([\"Point\",\"Size\",\"Center\",\"Left\",\"Top\",\"Right\",\"Bottom\",\"CenterX\",\"CenterY\",\"TopLeft\",\"TopRight\",\"BottomLeft\",\"BottomRight\",\"LeftCenter\",\"TopCenter\",\"RightCenter\",\"BottomCenter\"],(function(t){var i=\"set\"+t;this[i]=function(){this._dontNotify=!0,e[i].apply(this,arguments),this._dontNotify=!1,this._owner[this._setter](this)}}),{isSelected:function(){return!!(2&this._owner._selection)},setSelected:function(e){var t=this._owner;t._changeSelection&&t._changeSelection(2,e)}}))}),S=u.extend({_class:\"Matrix\",initialize:function e(t,i){var n=arguments,o=n.length,a=!0;if(o>=6?this._set.apply(this,n):1===o||2===o?t instanceof e?this._set(t._a,t._b,t._c,t._d,t._tx,t._ty,i):Array.isArray(t)?this._set.apply(this,i?t.concat([i]):t):a=!1:o?a=!1:this.reset(),!a)throw new Error(\"Unsupported matrix parameters\");return this},set:\"#initialize\",_set:function(e,t,i,n,o,a,r){return this._a=e,this._b=t,this._c=i,this._d=n,this._tx=o,this._ty=a,r||this._changed(),this},_serialize:function(e,t){return u.serialize(this.getValues(),e,!0,t)},_changed:function(){var e=this._owner;e&&(e._applyMatrix?e.transform(null,!0):e._changed(25))},clone:function(){return new S(this._a,this._b,this._c,this._d,this._tx,this._ty)},equals:function(e){return e===this||e&&this._a===e._a&&this._b===e._b&&this._c===e._c&&this._d===e._d&&this._tx===e._tx&&this._ty===e._ty},toString:function(){var e=g.instance;return\"[[\"+[e.number(this._a),e.number(this._c),e.number(this._tx)].join(\", \")+\"], [\"+[e.number(this._b),e.number(this._d),e.number(this._ty)].join(\", \")+\"]]\"},reset:function(e){return this._a=this._d=1,this._b=this._c=this._tx=this._ty=0,e||this._changed(),this},apply:function(e,t){var i=this._owner;return!!i&&(i.transform(null,u.pick(e,!0),t),this.isIdentity())},translate:function(){var e=b.read(arguments),t=e.x,i=e.y;return this._tx+=t*this._a+i*this._c,this._ty+=t*this._b+i*this._d,this._changed(),this},scale:function(){var e=arguments,t=b.read(e),i=b.read(e,0,{readNull:!0});return i&&this.translate(i),this._a*=t.x,this._b*=t.x,this._c*=t.y,this._d*=t.y,i&&this.translate(i.negate()),this._changed(),this},rotate:function(e){e*=Math.PI/180;var t=b.read(arguments,1),i=t.x,n=t.y,o=Math.cos(e),a=Math.sin(e),r=i-i*o+n*a,s=n-i*a-n*o,l=this._a,u=this._b,c=this._c,d=this._d;return this._a=o*l+a*c,this._b=o*u+a*d,this._c=-a*l+o*c,this._d=-a*u+o*d,this._tx+=r*l+s*c,this._ty+=r*u+s*d,this._changed(),this},shear:function(){var e=arguments,t=b.read(e),i=b.read(e,0,{readNull:!0});i&&this.translate(i);var n=this._a,o=this._b;return this._a+=t.y*this._c,this._b+=t.y*this._d,this._c+=t.x*n,this._d+=t.x*o,i&&this.translate(i.negate()),this._changed(),this},skew:function(){var e=arguments,t=b.read(e),i=b.read(e,0,{readNull:!0}),n=Math.PI/180,o=new b(Math.tan(t.x*n),Math.tan(t.y*n));return this.shear(o,i)},append:function(e,t){if(e){var i=this._a,n=this._b,o=this._c,a=this._d,r=e._a,s=e._c,l=e._b,u=e._d,c=e._tx,d=e._ty;this._a=r*i+l*o,this._c=s*i+u*o,this._b=r*n+l*a,this._d=s*n+u*a,this._tx+=c*i+d*o,this._ty+=c*n+d*a,t||this._changed()}return this},prepend:function(e,t){if(e){var i=this._a,n=this._b,o=this._c,a=this._d,r=this._tx,s=this._ty,l=e._a,u=e._c,c=e._b,d=e._d,p=e._tx,m=e._ty;this._a=l*i+u*n,this._c=l*o+u*a,this._b=c*i+d*n,this._d=c*o+d*a,this._tx=l*r+u*s+p,this._ty=c*r+d*s+m,t||this._changed()}return this},appended:function(e){return this.clone().append(e)},prepended:function(e){return this.clone().prepend(e)},invert:function(){var e=this._a,t=this._b,i=this._c,n=this._d,o=this._tx,a=this._ty,r=e*n-t*i,s=null;return r&&!isNaN(r)&&isFinite(o)&&isFinite(a)&&(this._a=n/r,this._b=-t/r,this._c=-i/r,this._d=e/r,this._tx=(i*a-n*o)/r,this._ty=(t*o-e*a)/r,s=this),s},inverted:function(){return this.clone().invert()},concatenate:\"#append\",preConcatenate:\"#prepend\",chain:\"#appended\",_shiftless:function(){return new S(this._a,this._b,this._c,this._d,0,0)},_orNullIfIdentity:function(){return this.isIdentity()?null:this},isIdentity:function(){return 1===this._a&&0===this._b&&0===this._c&&1===this._d&&0===this._tx&&0===this._ty},isInvertible:function(){var e=this._a*this._d-this._c*this._b;return e&&!isNaN(e)&&isFinite(this._tx)&&isFinite(this._ty)},isSingular:function(){return!this.isInvertible()},transform:function(e,t,i){return arguments.length<3?this._transformPoint(b.read(arguments)):this._transformCoordinates(e,t,i)},_transformPoint:function(e,t,i){var n=e.x,o=e.y;return t||(t=new b),t._set(n*this._a+o*this._c+this._tx,n*this._b+o*this._d+this._ty,i)},_transformCoordinates:function(e,t,i){for(var n=0,o=2*i;na[l]&&(a[l]=s)}return t||(t=new w),t._set(o[0],o[1],a[0]-o[0],a[1]-o[1],i)},inverseTransform:function(){return this._inverseTransform(b.read(arguments))},_inverseTransform:function(e,t,i){var n=this._a,o=this._b,a=this._c,r=this._d,s=this._tx,l=this._ty,u=n*r-o*a,c=null;if(u&&!isNaN(u)&&isFinite(s)&&isFinite(l)){var d=e.x-this._tx,p=e.y-this._ty;t||(t=new b),c=t._set((d*r-p*a)/u,(p*n-d*o)/u,i)}return c},decompose:function(){var e,t,i,n=this._a,o=this._b,a=this._c,r=this._d,s=n*r-o*a,l=Math.sqrt,u=Math.atan2,c=180/Math.PI;if(0!==n||0!==o){var d=l(n*n+o*o);e=Math.acos(n/d)*(o>0?1:-1),t=[d,s/d],i=[u(n*a+o*r,d*d),0]}else if(0!==a||0!==r){var p=l(a*a+r*r);e=Math.asin(a/p)*(r>0?1:-1),t=[s/p,p],i=[0,u(n*a+o*r,p*p)]}else e=0,i=t=[0,0];return{translation:this.getTranslation(),rotation:e*c,scaling:new b(t),skewing:new b(i[0]*c,i[1]*c)}},getValues:function(){return[this._a,this._b,this._c,this._d,this._tx,this._ty]},getTranslation:function(){return new b(this._tx,this._ty)},getScaling:function(){return this.decompose().scaling},getRotation:function(){return this.decompose().rotation},applyToContext:function(e){this.isIdentity()||e.transform(this._a,this._b,this._c,this._d,this._tx,this._ty)}},u.each([\"a\",\"b\",\"c\",\"d\",\"tx\",\"ty\"],(function(e){var t=u.capitalize(e),i=\"_\"+e;this[\"get\"+t]=function(){return this[i]},this[\"set\"+t]=function(e){this[i]=e,this._changed()}}),{})),M=u.extend({_class:\"Line\",initialize:function(e,t,i,n,o){var a=!1;arguments.length>=4?(this._px=e,this._py=t,this._vx=i,this._vy=n,a=o):(this._px=e.x,this._py=e.y,this._vx=t.x,this._vy=t.y,a=i),a||(this._vx-=this._px,this._vy-=this._py)},getPoint:function(){return new b(this._px,this._py)},getVector:function(){return new b(this._vx,this._vy)},getLength:function(){return this.getVector().getLength()},intersect:function(e,t){return M.intersect(this._px,this._py,this._vx,this._vy,e._px,e._py,e._vx,e._vy,!0,t)},getSide:function(e,t){return M.getSide(this._px,this._py,this._vx,this._vy,e.x,e.y,!0,t)},getDistance:function(e){return Math.abs(this.getSignedDistance(e))},getSignedDistance:function(e){return M.getSignedDistance(this._px,this._py,this._vx,this._vy,e.x,e.y,!0)},isCollinear:function(e){return b.isCollinear(this._vx,this._vy,e._vx,e._vy)},isOrthogonal:function(e){return b.isOrthogonal(this._vx,this._vy,e._vx,e._vy)},statics:{intersect:function(e,t,i,n,o,a,r,s,l,u){l||(i-=e,n-=t,r-=o,s-=a);var c=i*s-n*r;if(!h.isMachineZero(c)){var d=e-o,p=t-a,m=(r*p-s*d)/c,g=(i*p-n*d)/c,f=-1e-12,y=1+1e-12;if(u||f=1?1:m),new b(e+m*i,t+m*n)}},getSide:function(e,t,i,n,o,a,r,s){r||(i-=e,n-=t);var l=o-e,u=l*n-(a-t)*i;return!s&&h.isMachineZero(u)&&(u=(l*i+l*i)/(i*i+n*n))>=0&&u<=1&&(u=0),u<0?-1:u>0?1:0},getSignedDistance:function(e,t,i,n,o,a,r){return r||(i-=e,n-=t),0===i?n>0?o-e:e-o:0===n?i<0?a-t:t-a:((o-e)*n-(a-t)*i)/(n>i?n*Math.sqrt(1+i*i/(n*n)):i*Math.sqrt(1+n*n/(i*i)))},getDistance:function(e,t,i,n,o,a,r){return Math.abs(M.getSignedDistance(e,t,i,n,o,a,r))}}}),E=p.extend({_class:\"Project\",_list:\"projects\",_reference:\"project\",_compactSerialize:!0,initialize:function(e){p.call(this,!0),this._children=[],this._namedChildren={},this._activeLayer=null,this._currentStyle=new Z(null,null,this),this._view=X.create(this,e||oe.getCanvas(1,1)),this._selectionItems={},this._selectionCount=0,this._updateVersion=0},_serialize:function(e,t){return u.serialize(this._children,e,!0,t)},_changed:function(e,t){if(1&e){var i=this._view;i&&(i._needsUpdate=!0,!i._requested&&i._autoUpdate&&i.requestUpdate())}var n=this._changes;if(n&&t){var o=this._changesById,a=t._id,r=o[a];r?r.flags|=e:n.push(o[a]={item:t,flags:e})}},clear:function(){for(var e=this._children,t=e.length-1;t>=0;t--)e[t].remove()},isEmpty:function(){return!this._children.length},remove:function e(){return!!e.base.call(this)&&(this._view&&this._view.remove(),!0)},getView:function(){return this._view},getCurrentStyle:function(){return this._currentStyle},setCurrentStyle:function(e){this._currentStyle.set(e)},getIndex:function(){return this._index},getOptions:function(){return this._scope.settings},getLayers:function(){return this._children},getActiveLayer:function(){return this._activeLayer||new _({project:this,insert:!0})},getSymbolDefinitions:function(){var e=[],t={};return this.getItems({class:N,match:function(i){var n=i._definition,o=n._id;return t[o]||(t[o]=!0,e.push(n)),!1}}),e},getSymbols:\"getSymbolDefinitions\",getSelectedItems:function(){var e=this._selectionItems,t=[];for(var i in e){var n=e[i],o=n._selection;1&o&&n.isInserted()?t.push(n):o||this._updateSelection(n)}return t},_updateSelection:function(e){var t=e._id,i=this._selectionItems;e._selection?i[t]!==e&&(this._selectionCount++,i[t]=e):i[t]===e&&(this._selectionCount--,delete i[t])},selectAll:function(){for(var e=this._children,t=0,i=e.length;t0){e.save(),e.strokeWidth=1;var s=this._selectionItems,l=this._scope.settings.handleSize,c=this._updateVersion;for(var d in s)s[d]._drawSelection(e,t,l,s,c);e.restore()}}}),I=u.extend(c,{statics:{extend:function e(t){return t._serializeFields&&(t._serializeFields=u.set({},this.prototype._serializeFields,t._serializeFields)),e.base.apply(this,arguments)},NO_INSERT:{insert:!1}},_class:\"Item\",_name:null,_applyMatrix:!0,_canApplyMatrix:!0,_canScaleStroke:!1,_pivot:null,_visible:!0,_blendMode:\"normal\",_opacity:1,_locked:!1,_guide:!1,_clipMask:!1,_selection:0,_selectBounds:!0,_selectChildren:!1,_serializeFields:{name:null,applyMatrix:null,matrix:new S,pivot:null,visible:!0,blendMode:\"normal\",opacity:1,locked:!1,guide:!1,clipMask:!1,selected:!1,data:{}},_prioritize:[\"applyMatrix\"]},new function(){var e=[\"onMouseDown\",\"onMouseUp\",\"onMouseDrag\",\"onClick\",\"onDoubleClick\",\"onMouseMove\",\"onMouseEnter\",\"onMouseLeave\"];return u.each(e,(function(e){this._events[e]={install:function(e){this.getView()._countItemEvent(e,1)},uninstall:function(e){this.getView()._countItemEvent(e,-1)}}}),{_events:{onFrame:{install:function(){this.getView()._animateItem(this,!0)},uninstall:function(){this.getView()._animateItem(this,!1)}},onLoad:{},onError:{}},statics:{_itemHandlers:e}})},{initialize:function(){},_initialize:function(e,t){var i=e&&u.isPlainObject(e),n=i&&!0===e.internal,o=this._matrix=new S,a=i&&e.project||le.project,s=le.settings;return this._id=n?null:f.get(),this._parent=this._index=null,this._applyMatrix=this._canApplyMatrix&&s.applyMatrix,t&&o.translate(t),o._owner=this,this._style=new Z(a._currentStyle,this,a),n||i&&0==e.insert||!s.insertItems&&(!i||!0!==e.insert)?this._setProject(a):(i&&e.parent||a)._insertItem(r,this,!0),i&&e!==I.NO_INSERT&&this.set(e,{internal:!0,insert:!0,project:!0,parent:!0}),i},_serialize:function(e,t){var i={},n=this;function o(o){for(var a in o){var r=n[a];u.equals(r,\"leading\"===a?1.2*o.fontSize:o[a])||(i[a]=u.serialize(r,e,\"data\"!==a,t))}}return o(this._serializeFields),this instanceof x||o(this._style._defaults),[this._class,i]},_changed:function(e){var t=this._symbol,i=this._parent||t,n=this._project;8&e&&(this._bounds=this._position=this._decomposed=r),16&e&&(this._globalMatrix=r),i&&72&e&&I._clearBoundsCache(i),2&e&&I._clearBoundsCache(this),n&&n._changed(e,this),t&&t._changed(e)},getId:function(){return this._id},getName:function(){return this._name},setName:function(e){if(this._name&&this._removeNamed(),e===+e+\"\")throw new Error(\"Names consisting only of numbers are not supported.\");var t=this._getOwner();if(e&&t){var i=t._children,n=t._namedChildren;(n[e]=n[e]||[]).push(this),e in i||(i[e]=this)}this._name=e||r,this._changed(256)},getStyle:function(){return this._style},setStyle:function(e){this.getStyle().set(e)}},u.each([\"locked\",\"visible\",\"blendMode\",\"opacity\",\"guide\"],(function(e){var t=u.capitalize(e),i=\"_\"+e,n={locked:256,visible:265};this[\"get\"+t]=function(){return this[i]},this[\"set\"+t]=function(t){t!=this[i]&&(this[i]=t,this._changed(n[e]||257))}}),{}),{beans:!0,getSelection:function(){return this._selection},setSelection:function(e){if(e!==this._selection){this._selection=e;var t=this._project;t&&(t._updateSelection(this),this._changed(257))}},_changeSelection:function(e,t){var i=this._selection;this.setSelection(t?i|e:i&~e)},isSelected:function(){if(this._selectChildren)for(var e=this._children,t=0,i=e.length;t=0;i--)if(t[i].contains(e))return!0;return!1}return e.isInside(this.getInternalBounds())},isInside:function(){return w.read(arguments).contains(this.getBounds())},_asPathItem:function(){return new B.Rectangle({rectangle:this.getInternalBounds(),matrix:this._matrix,insert:!1})},intersects:function(e,t){return e instanceof I&&this._asPathItem().getIntersections(e._asPathItem(),null,t,!0).length>0}},new function(){function e(){var e=arguments;return this._hitTest(b.read(e),P.getOptions(e))}function t(){var e=arguments,t=b.read(e),i=P.getOptions(e),n=[];return this._hitTest(t,new u({all:n},i)),n}function i(e,t,i,n){var o=this._children;if(o)for(var a=o.length-1;a>=0;a--){var r=o[a],s=r!==n&&r._hitTest(e,t,i);if(s&&!t.all)return s}return null}return E.inject({hitTest:e,hitTestAll:t,_hitTest:i}),{hitTest:e,hitTestAll:t,_hitTestChildren:i}},{_hitTest:function(e,t,i){if(this._locked||!this._visible||this._guide&&!t.guides||this.isEmpty())return null;var n=this._matrix,o=i?i.appended(n):this.getGlobalMatrix().prepend(this.getView()._matrix),a=Math.max(t.tolerance,1e-12),r=t._tolerancePadding=new v(B._getStrokePadding(a,n._shiftless().invert()));if(!(e=n._inverseTransform(e))||!this._children&&!this.getBounds({internal:!0,stroke:!0,handle:!0}).expand(r.multiply(2))._containsPoint(e))return null;var s,l,c=!(t.guides&&!this._guide||t.selected&&!this.isSelected()||t.type&&t.type!==u.hyphenate(this._class)||t.class&&!(this instanceof t.class)),d=t.match,p=this;function m(e){return e&&d&&!d(e)&&(e=null),e&&t.all&&t.all.push(e),e}function g(t,i){var n=i?s[\"get\"+i]():p.getPosition();if(e.subtract(n).divide(r).length<=1)return new P(t,p,{name:i?u.hyphenate(i):t,point:n})}var h=t.position,f=t.center,b=t.bounds;if(c&&this._parent&&(h||f||b)){if((f||b)&&(s=this.getInternalBounds()),!(l=h&&g(\"position\")||f&&g(\"center\",\"Center\"))&&b)for(var y=[\"TopLeft\",\"TopRight\",\"BottomLeft\",\"BottomRight\",\"LeftCenter\",\"TopCenter\",\"RightCenter\",\"BottomCenter\"],k=0;k<8&&!l;k++)l=g(\"bounds\",y[k]);l=m(l)}return l||(l=this._hitTestChildren(e,t,o)||c&&m(this._hitTestSelf(e,t,o,this.getStrokeScaling()?null:o._shiftless().invert()))||null),l&&l.point&&(l.point=n.transform(l.point)),l},_hitTestSelf:function(e,t){if(t.fill&&this.hasFill()&&this._contains(e))return new P(\"fill\",this)},matches:function(e,t){var i=typeof e;if(\"object\"===i){for(var n in e)if(e.hasOwnProperty(n)&&!this.matches(n,e[n]))return!1;return!0}if(\"function\"===i)return e(this);if(\"match\"===e)return t(this);var o=/^(empty|editable)$/.test(e)?this[\"is\"+u.capitalize(e)]():\"type\"===e?u.hyphenate(this._class):this[e];if(\"class\"===e){if(\"function\"==typeof t)return this instanceof t;o=this._class}if(\"function\"==typeof t)return!!t(o);if(t){if(t.test)return t.test(o);if(u.isPlainObject(t))return function e(t,i){for(var n in t)if(t.hasOwnProperty(n)){var o=t[n],a=i[n];if(u.isPlainObject(o)&&u.isPlainObject(a)){if(!e(o,a))return!1}else if(!u.equals(o,a))return!1}return!0}(t,o)}return u.equals(o,t)},getItems:function(e){return I._getItems(this,e,this._matrix)},getItem:function(e){return I._getItems(this,e,this._matrix,null,!0)[0]||null},statics:{_getItems:function e(t,i,n,o,a){if(!o){var r=\"object\"==typeof i&&i,s=r&&r.overlapping,l=r&&r.inside,c=(y=s||l)&&w.read([y]);o={items:[],recursive:r&&!1!==r.recursive,inside:!!l,overlapping:!!s,rect:c,path:s&&new B.Rectangle({rectangle:c,insert:!1})},r&&(i=u.filter({},i,{recursive:!0,inside:!0,overlapping:!0}))}var d=t._children,p=o.items;n=(c=o.rect)&&(n||new S);for(var m=0,g=d&&d.length;m0)break}return p}}},{importJSON:function(e){var t=u.importJSON(e,this);return t!==this?this.addChild(t):t},addChild:function(e){return this.insertChild(r,e)},insertChild:function(e,t){var i=t?this.insertChildren(e,[t]):null;return i&&i[0]},addChildren:function(e){return this.insertChildren(this._children.length,e)},insertChildren:function(e,t){var i=this._children;if(i&&t&&t.length>0){for(var n={},o=(t=u.slice(t)).length-1;o>=0;o--){var a=(c=t[o])&&c._id;!c||n[a]?t.splice(o,1):(c._remove(!1,!0),n[a]=!0)}u.splice(i,t,e,0);for(var r=this._project,s=r._changes,l=(o=0,t.length);o=0;n--)i[n]._remove(!0,!1);return i.length>0&&this._changed(11),i},clear:\"#removeChildren\",reverseChildren:function(){if(this._children){this._children.reverse();for(var e=0,t=this._children.length;e0},isInserted:function(){return!!this._parent&&this._parent.isInserted()},isAbove:function(e){return-1===this._getOrder(e)},isBelow:function(e){return 1===this._getOrder(e)},isParent:function(e){return this._parent===e},isChild:function(e){return e&&e._parent===this},isDescendant:function(e){for(var t=this;t=t._parent;)if(t===e)return!0;return!1},isAncestor:function(e){return!!e&&e.isDescendant(this)},isSibling:function(e){return this._parent===e._parent},isGroupedWith:function(e){for(var t=this._parent;t;){if(t._parent&&/^(Group|Layer|CompoundPath)$/.test(t._class)&&e.isDescendant(t))return!0;t=t._parent}return!1}},u.each([\"rotate\",\"scale\",\"shear\",\"skew\"],(function(e){var t=\"rotate\"===e;this[e]=function(){var i=arguments,n=(t?u:b).read(i),o=b.read(i,0,{readNull:!0});return this.transform((new S)[e](n,o||this.getPosition(!0)))}}),{translate:function(){var e=new S;return this.transform(e.translate.apply(e,arguments))},transform:function(e,t,i){var n=this._matrix,o=e&&!e.isIdentity(),a=i&&this._canApplyMatrix||this._applyMatrix&&(o||!n.isIdentity()||t&&this._children);if(!o&&!a)return this;if(o){!e.isInvertible()&&n.isInvertible()&&(n._backup=n.getValues()),n.prepend(e,!0);var r=this._style,s=r.getFillColor(!0),l=r.getStrokeColor(!0);s&&s.transform(e),l&&l.transform(e)}if(a&&(a=this._transformContent(n,t,i))){var u=this._pivot;u&&n._transformPoint(u,u,!0),n.reset(!0),i&&this._canApplyMatrix&&(this._applyMatrix=!0)}var c=this._bounds,d=this._position;(o||a)&&this._changed(25);var p=o&&c&&e.decompose();if(p&&p.skewing.isZero()&&p.rotation%90==0){for(var m in c){var g=c[m];if(g.nonscaling)delete c[m];else if(a||!g.internal){var h=g.rect;e._transformBounds(h,h)}}this._bounds=c;var f=c[this._getBoundsCacheKey(this._boundsOptions||{})];f&&(this._position=this._getPositionFromBounds(f.rect))}else o&&d&&this._pivot&&(this._position=e._transformPoint(d,d));return this},_transformContent:function(e,t,i){var n=this._children;if(n){for(var o=0,a=n.length;oo:n1&&a<4?-1:1,a>2?-1:1),s=r.multiply(o),l=s.subtract(r.multiply(n));if(new w(i?s.add(r.multiply(i)):s,l).contains(t))return{point:l,quadrant:a}}}function t(e,t,i,n){var o=e.divide(t);return(!n||o.isInQuadrant(n))&&o.subtract(o.normalize()).multiply(t).divide(i).length<=1}return{_contains:function t(i){if(\"rectangle\"===this._type){var n=e(this,i);return n?i.subtract(n.point).divide(this._radius).getLength()<=1:t.base.call(this,i)}return i.divide(this.size).getLength()<=.5},_hitTestSelf:function i(n,o,a,r){var s=!1,l=this._style,u=o.stroke&&l.hasStroke(),c=o.fill&&l.hasFill();if(u||c){var d=this._type,p=this._radius,m=u?l.getStrokeWidth()/2:0,g=o._tolerancePadding.add(B._getStrokePadding(m,!l.getStrokeScaling()&&r));if(\"rectangle\"===d){var h=g.multiply(2),f=e(this,n,h);if(f)s=t(n.subtract(f.point),p,g,f.quadrant);else{var b=new w(this._size).setCenter(0,0),y=b.expand(h),v=b.expand(h.negate());s=y._containsPoint(n)&&!v._containsPoint(n)}}else s=t(n,p,g)}return s?new P(u?\"stroke\":\"fill\",this):i.base.apply(this,arguments)}}},{statics:new function(){function e(e,t,i,n,o){var a=u.create(O.prototype);return a._type=e,a._size=i,a._radius=n,a._initialize(u.getNamed(o),t),a}return{Circle:function(){var t=arguments,i=b.readNamed(t,\"center\"),n=u.readNamed(t,\"radius\");return e(\"circle\",i,new v(2*n),n,t)},Rectangle:function(){var t=arguments,i=w.readNamed(t,\"rectangle\"),n=v.min(v.readNamed(t,\"radius\"),i.getSize(!0).divide(2));return e(\"rectangle\",i.getCenter(!0),i.getSize(!0),n,t)},Ellipse:function(){var t=arguments,i=O._readEllipse(t),n=i.radius;return e(\"ellipse\",i.center,n.multiply(2),n,t)},_readEllipse:function(e){var t,i;if(u.hasNamed(e,\"radius\"))t=b.readNamed(e,\"center\"),i=v.readNamed(e,\"radius\");else{var n=w.readNamed(e,\"rectangle\");t=n.getCenter(!0),i=n.getSize(!0).divide(2)}return{center:t,radius:i}}}}}),C=I.extend({_class:\"Raster\",_applyMatrix:!1,_canApplyMatrix:!1,_boundsOptions:{stroke:!1,handle:!1},_serializeFields:{crossOrigin:null,source:null},_prioritize:[\"crossOrigin\"],_smoothing:!1,beans:!0,initialize:function(e,t){if(!this._initialize(e,t!==r&&b.read(arguments))){var i,n=typeof e,o=\"string\"===n?l.getElementById(e):\"object\"===n?e:null;if(o&&o!==I.NO_INSERT)if(o.getContext||null!=o.naturalHeight)i=o;else if(o){var a=v.read(arguments);a.isZero()||(i=oe.getCanvas(a))}i?this.setImage(i):this.setSource(e)}this._size||(this._size=new v,this._loaded=!1)},_equals:function(e){return this.getSource()===e.getSource()},copyContent:function(e){var t=e._image,i=e._canvas;if(t)this._setImage(t);else if(i){var n=oe.getCanvas(e._size);n.getContext(\"2d\").drawImage(i,0,0),this._setImage(n)}this._crossOrigin=e._crossOrigin},getSize:function(){var e=this._size;return new k(e?e.width:0,e?e.height:0,this,\"setSize\")},setSize:function(){var e=v.read(arguments);if(!e.equals(this._size))if(e.width>0&&e.height>0){var t=this.getElement();this._setImage(oe.getCanvas(e)),t&&this.getContext(!0).drawImage(t,0,0,e.width,e.height)}else this._canvas&&oe.release(this._canvas),this._size=e.clone()},getWidth:function(){return this._size?this._size.width:0},setWidth:function(e){this.setSize(e,this.getHeight())},getHeight:function(){return this._size?this._size.height:0},setHeight:function(e){this.setSize(this.getWidth(),e)},getLoaded:function(){return this._loaded},isEmpty:function(){var e=this._size;return!e||0===e.width&&0===e.height},getResolution:function(){var e=this._matrix,t=new b(0,0).transform(e),i=new b(1,0).transform(e).subtract(t),n=new b(0,1).transform(e).subtract(t);return new v(72/i.getLength(),72/n.getLength())},getPpi:\"#getResolution\",getImage:function(){return this._image},setImage:function(e){var t=this;function i(e){var i=t.getView(),n=e&&e.type||\"load\";i&&t.responds(n)&&(le=i._scope,t.emit(n,new $(e)))}this._setImage(e),this._loaded?setTimeout(i,0):e&&Q.add(e,{load:function(n){t._setImage(e),i(n)},error:i})},_setImage:function(e){this._canvas&&oe.release(this._canvas),e&&e.getContext?(this._image=null,this._canvas=e,this._loaded=!0):(this._image=e,this._canvas=null,this._loaded=!!(e&&e.src&&e.complete)),this._size=new v(e?e.naturalWidth||e.width:0,e?e.naturalHeight||e.height:0),this._context=null,this._changed(1033)},getCanvas:function(){if(!this._canvas){var e=oe.getContext(this._size);try{this._image&&e.drawImage(this._image,0,0),this._canvas=e.canvas}catch(t){oe.release(e)}}return this._canvas},setCanvas:\"#setImage\",getContext:function(e){return this._context||(this._context=this.getCanvas().getContext(\"2d\")),e&&(this._image=null,this._changed(1025)),this._context},setContext:function(e){this._context=e},getSource:function(){var e=this._image;return e&&e.src||this.toDataURL()},setSource:function(e){var t=new a.Image,i=this._crossOrigin;i&&(t.crossOrigin=i),e&&\"string\"==typeof e&&/^data:/i.test(e)&&(t.src=e),this.setImage(t)},getCrossOrigin:function(){var e=this._image;return e&&e.crossOrigin||this._crossOrigin||\"\"},setCrossOrigin:function(e){this._crossOrigin=e;var t=this._image;t&&(t.crossOrigin=e)},getSmoothing:function(){return this._smoothing},setSmoothing:function(e){this._smoothing=e,this._changed(257)},getElement:function(){return this._canvas||this._loaded&&this._image}},{beans:!1,getSubCanvas:function(){var e=w.read(arguments),t=oe.getContext(e.getSize()),i=Math.max(0,e.x),n=Math.max(0,e.y),o=Math.min(this.getCanvas().width,e.x+e.width),a=Math.min(this.getCanvas().height,e.y+e.height);return t.drawImage(this.getCanvas(),i,n,o-i,a-n,i-e.x,n-e.y,o-i,a-n),t.canvas},getSubRaster:function(){var e=w.read(arguments),t=new C(I.NO_INSERT);return t._setImage(this.getSubCanvas(e)),t.translate(e.getCenter().subtract(this.getSize().divide(2))),t._matrix.prepend(this._matrix),t.insertAbove(this),t},toDataURL:function(){var e=this._image,t=e&&e.src;if(/^data:/.test(t))return t;var i=this.getCanvas();return i?i.toDataURL.apply(i,arguments):null},drawImage:function(e){var t=b.read(arguments,1);this.getContext(!0).drawImage(e,t.x,t.y)},getAverageColor:function(e){var t,i;if(e?e instanceof z?(i=e,t=e.getBounds()):\"object\"==typeof e&&(\"width\"in e?t=new w(e):\"x\"in e&&(t=new w(e.x-.5,e.y-.5,1,1))):t=this.getBounds(),!t)return null;var n=Math.min(t.width,32),o=Math.min(t.height,32),a=C._sampleContext;a?a.clearRect(0,0,33,33):a=C._sampleContext=oe.getContext(new v(32)),a.save();var r=(new S).scale(n/t.width,o/t.height).translate(-t.x,-t.y);r.applyToContext(a),i&&i.draw(a,new u({clip:!0,matrices:[r]})),this._matrix.applyToContext(a);var s=this.getElement(),l=this._size;s&&a.drawImage(s,-l.width/2,-l.height/2),a.restore();for(var c=a.getImageData(.5,.5,Math.ceil(n),Math.ceil(o)).data,d=[0,0,0],p=0,m=0,g=c.length;m0&&n.height>0&&(e.globalAlpha=h.clamp(this._opacity,0,1),this._setStyles(e,t,i),K.setPrefixed(e,\"imageSmoothingEnabled\",this._smoothing),e.drawImage(n,-this._size.width/2,-this._size.height/2))},_canComposite:function(){return!0}}),N=I.extend({_class:\"SymbolItem\",_applyMatrix:!1,_canApplyMatrix:!1,_boundsOptions:{stroke:!0},_serializeFields:{symbol:null},initialize:function(e,t){this._initialize(e,t!==r&&b.read(arguments,1))||this.setDefinition(e instanceof A?e:new A(e))},_equals:function(e){return this._definition===e._definition},copyContent:function(e){this.setDefinition(e._definition)},getDefinition:function(){return this._definition},setDefinition:function(e){this._definition=e,this._changed(9)},getSymbol:\"#getDefinition\",setSymbol:\"#setDefinition\",isEmpty:function(){return this._definition._item.isEmpty()},_getBounds:function(e,t){var i=this._definition._item;return i._getCachedBounds(i._matrix.prepended(e),t)},_hitTestSelf:function(e,t,i){var n=t.extend({all:!1}),o=this._definition._item._hitTest(e,n,i);return o&&(o.item=this),o},_draw:function(e,t){this._definition._item.draw(e,t)}}),A=u.extend({_class:\"SymbolDefinition\",initialize:function(e,t){this._id=f.get(),this.project=le.project,e&&this.setItem(e,t)},_serialize:function(e,t){return t.add(this,(function(){return u.serialize([this._class,this._item],e,!1,t)}))},_changed:function(e){8&e&&I._clearBoundsCache(this),1&e&&this.project._changed(e)},getItem:function(){return this._item},setItem:function(e,t){e._symbol&&(e=e.clone()),this._item&&(this._item._symbol=null),this._item=e,e.remove(),e.setSelected(!1),t||e.setPosition(new b),e._symbol=this,this._changed(9)},getDefinition:\"#getItem\",setDefinition:\"#setItem\",place:function(e){return new N(this,e)},clone:function(){return new A(this._item.clone(!1))},equals:function(e){return e===this||e&&this._item.equals(e._item)||!1}}),P=u.extend({_class:\"HitResult\",initialize:function(e,t,i){this.type=e,this.item=t,i&&this.inject(i)},statics:{getOptions:function(e){var t=e&&u.read(e);return new u({type:null,tolerance:le.settings.hitTolerance,fill:!t,stroke:!t,segments:!t,handles:!1,ends:!1,position:!1,center:!1,bounds:!1,guides:!1,selected:!1},t)}}}),D=u.extend({_class:\"Segment\",beans:!0,_selection:0,initialize:function(e,t,i,n,o,a){var s,l,u,c,d=arguments.length;d>0&&(null==e||\"object\"==typeof e?1===d&&e&&\"point\"in e?(s=e.point,l=e.handleIn,u=e.handleOut,c=e.selection):(s=e,l=t,u=i,c=n):(s=[e,t],l=i!==r?[i,n]:null,u=o!==r?[o,a]:null)),new L(s,this,\"_point\"),new L(l,this,\"_handleIn\"),new L(u,this,\"_handleOut\"),c&&this.setSelection(c)},_serialize:function(e,t){var i=this._point,n=this._selection,o=n||this.hasHandles()?[i,this._handleIn,this._handleOut]:i;return n&&o.push(n),u.serialize(o,e,!0,t)},_changed:function(e){var t=this._path;if(t){var i,n=t._curves,o=this._index;n&&(e&&e!==this._point&&e!==this._handleIn||!(i=o>0?n[o-1]:t._closed?n[n.length-1]:null)||i._changed(),e&&e!==this._point&&e!==this._handleOut||!(i=n[o])||i._changed()),t._changed(41)}},getPoint:function(){return this._point},setPoint:function(){this._point.set(b.read(arguments))},getHandleIn:function(){return this._handleIn},setHandleIn:function(){this._handleIn.set(b.read(arguments))},getHandleOut:function(){return this._handleOut},setHandleOut:function(){this._handleOut.set(b.read(arguments))},hasHandles:function(){return!this._handleIn.isZero()||!this._handleOut.isZero()},isSmooth:function(){var e=this._handleIn,t=this._handleOut;return!e.isZero()&&!t.isZero()&&e.isCollinear(t)},clearHandles:function(){this._handleIn._set(0,0),this._handleOut._set(0,0)},getSelection:function(){return this._selection},setSelection:function(e){var t=this._selection,i=this._path;this._selection=e=e||0,i&&e!==t&&(i._updateSelection(this,t,e),i._changed(257))},_changeSelection:function(e,t){var i=this._selection;this.setSelection(t?i|e:i&~e)},isSelected:function(){return!!(7&this._selection)},setSelected:function(e){this._changeSelection(7,e)},getIndex:function(){return this._index!==r?this._index:null},getPath:function(){return this._path||null},getCurve:function(){var e=this._path,t=this._index;return e?(t>0&&!e._closed&&t===e._segments.length-1&&t--,e.getCurves()[t]||null):null},getLocation:function(){var e=this.getCurve();return e?new j(e,this===e._segment1?0:1):null},getNext:function(){var e=this._path&&this._path._segments;return e&&(e[this._index+1]||this._path._closed&&e[0])||null},smooth:function(e,t,i){var n=e||{},o=n.type,a=n.factor,s=this.getPrevious(),l=this.getNext(),u=(s||this)._point,c=this._point,d=(l||this)._point,p=u.getDistance(c),m=c.getDistance(d);if(o&&\"catmull-rom\"!==o){if(\"geometric\"!==o)throw new Error(\"Smoothing method '\"+o+\"' not supported.\");if(s&&l){var g=u.subtract(d),h=a===r?.4:a,f=h*p/(p+m);t||this.setHandleIn(g.multiply(f)),i||this.setHandleOut(g.multiply(f-h))}}else{var y=a===r?.5:a,v=Math.pow(p,y),k=v*v,w=Math.pow(m,y),T=w*w;if(!t&&s){var S=2*T+3*w*v+k,M=3*w*(w+v);this.setHandleIn(0!==M?new b((T*u._x+S*c._x-k*d._x)/M-c._x,(T*u._y+S*c._y-k*d._y)/M-c._y):new b)}if(!i&&l){S=2*k+3*v*w+T,M=3*v*(v+w);this.setHandleOut(0!==M?new b((k*d._x+S*c._x-T*u._x)/M-c._x,(k*d._y+S*c._y-T*u._y)/M-c._y):new b)}}},getPrevious:function(){var e=this._path&&this._path._segments;return e&&(e[this._index-1]||this._path._closed&&e[e.length-1])||null},isFirst:function(){return!this._index},isLast:function(){var e=this._path;return e&&this._index===e._segments.length-1||!1},reverse:function(){var e=this._handleIn,t=this._handleOut,i=e.clone();e.set(t),t.set(i)},reversed:function(){return new D(this._point,this._handleOut,this._handleIn)},remove:function(){return!!this._path&&!!this._path.removeSegment(this._index)},clone:function(){return new D(this._point,this._handleIn,this._handleOut)},equals:function(e){return e===this||e&&this._class===e._class&&this._point.equals(e._point)&&this._handleIn.equals(e._handleIn)&&this._handleOut.equals(e._handleOut)||!1},toString:function(){var e=[\"point: \"+this._point];return this._handleIn.isZero()||e.push(\"handleIn: \"+this._handleIn),this._handleOut.isZero()||e.push(\"handleOut: \"+this._handleOut),\"{ \"+e.join(\", \")+\" }\"},transform:function(e){this._transformCoordinates(e,new Array(6),!0),this._changed()},interpolate:function(e,t,i){var n=1-i,o=i,a=e._point,r=t._point,s=e._handleIn,l=t._handleIn,u=t._handleOut,c=e._handleOut;this._point._set(n*a._x+o*r._x,n*a._y+o*r._y,!0),this._handleIn._set(n*s._x+o*l._x,n*s._y+o*l._y,!0),this._handleOut._set(n*c._x+o*u._x,n*c._y+o*u._y,!0),this._changed()},_transformCoordinates:function(e,t,i){var n=this._point,o=i&&this._handleIn.isZero()?null:this._handleIn,a=i&&this._handleOut.isZero()?null:this._handleOut,r=n._x,s=n._y,l=2;return t[0]=r,t[1]=s,o&&(t[l++]=o._x+r,t[l++]=o._y+s),a&&(t[l++]=a._x+r,t[l++]=a._y+s),e&&(e._transformCoordinates(t,t,l/2),r=t[0],s=t[1],i?(n._x=r,n._y=s,l=2,o&&(o._x=t[l++]-r,o._y=t[l++]-s),a&&(a._x=t[l++]-r,a._y=t[l++]-s)):(o||(t[l++]=r,t[l++]=s),a||(t[l++]=r,t[l++]=s))),t}}),L=b.extend({initialize:function(e,t,i){var n,o,a;if(e)if((n=e[0])!==r)o=e[1];else{var s=e;(n=s.x)===r&&(n=(s=b.read(arguments)).x),o=s.y,a=s.selected}else n=o=0;this._x=n,this._y=o,this._owner=t,t[i]=this,a&&this.setSelected(!0)},_set:function(e,t){return this._x=e,this._y=t,this._owner._changed(this),this},getX:function(){return this._x},setX:function(e){this._x=e,this._owner._changed(this)},getY:function(){return this._y},setY:function(e){this._y=e,this._owner._changed(this)},isZero:function(){var e=h.isZero;return e(this._x)&&e(this._y)},isSelected:function(){return!!(this._owner._selection&this._getSelection())},setSelected:function(e){this._owner._changeSelection(this._getSelection(),e)},_getSelection:function(){var e=this._owner;return this===e._point?1:this===e._handleIn?2:this===e._handleOut?4:0}}),R=u.extend({_class:\"Curve\",beans:!0,initialize:function(e,t,i,n,o,a,r,s){var l,u,c,d,p,m,g=arguments.length;3===g?(this._path=e,l=t,u=i):g?1===g?\"segment1\"in e?(l=new D(e.segment1),u=new D(e.segment2)):\"point1\"in e?(c=e.point1,p=e.handle1,m=e.handle2,d=e.point2):Array.isArray(e)&&(c=[e[0],e[1]],d=[e[6],e[7]],p=[e[2]-e[0],e[3]-e[1]],m=[e[4]-e[6],e[5]-e[7]]):2===g?(l=new D(e),u=new D(t)):4===g?(c=e,p=t,m=i,d=n):8===g&&(c=[e,t],d=[r,s],p=[i-e,n-t],m=[o-r,a-s]):(l=new D,u=new D),this._segment1=l||new D(c,null,p),this._segment2=u||new D(d,m,null)},_serialize:function(e,t){return u.serialize(this.hasHandles()?[this.getPoint1(),this.getHandle1(),this.getHandle2(),this.getPoint2()]:[this.getPoint1(),this.getPoint2()],e,!0,t)},_changed:function(){this._length=this._bounds=r},clone:function(){return new R(this._segment1,this._segment2)},toString:function(){var e=[\"point1: \"+this._segment1._point];return this._segment1._handleOut.isZero()||e.push(\"handle1: \"+this._segment1._handleOut),this._segment2._handleIn.isZero()||e.push(\"handle2: \"+this._segment2._handleIn),e.push(\"point2: \"+this._segment2._point),\"{ \"+e.join(\", \")+\" }\"},classify:function(){return R.classify(this.getValues())},remove:function(){var e=!1;if(this._path){var t=this._segment2,i=t._handleOut;(e=t.remove())&&this._segment1._handleOut.set(i)}return e},getPoint1:function(){return this._segment1._point},setPoint1:function(){this._segment1._point.set(b.read(arguments))},getPoint2:function(){return this._segment2._point},setPoint2:function(){this._segment2._point.set(b.read(arguments))},getHandle1:function(){return this._segment1._handleOut},setHandle1:function(){this._segment1._handleOut.set(b.read(arguments))},getHandle2:function(){return this._segment2._handleIn},setHandle2:function(){this._segment2._handleIn.set(b.read(arguments))},getSegment1:function(){return this._segment1},getSegment2:function(){return this._segment2},getPath:function(){return this._path},getIndex:function(){return this._segment1._index},getNext:function(){var e=this._path&&this._path._curves;return e&&(e[this._segment1._index+1]||this._path._closed&&e[0])||null},getPrevious:function(){var e=this._path&&this._path._curves;return e&&(e[this._segment1._index-1]||this._path._closed&&e[e.length-1])||null},isFirst:function(){return!this._segment1._index},isLast:function(){var e=this._path;return e&&this._segment1._index===e._curves.length-1||!1},isSelected:function(){return this.getPoint1().isSelected()&&this.getHandle1().isSelected()&&this.getHandle2().isSelected()&&this.getPoint2().isSelected()},setSelected:function(e){this.getPoint1().setSelected(e),this.getHandle1().setSelected(e),this.getHandle2().setSelected(e),this.getPoint2().setSelected(e)},getValues:function(e){return R.getValues(this._segment1,this._segment2,e)},getPoints:function(){for(var e=this.getValues(),t=[],i=0;i<8;i+=2)t.push(new b(e[i],e[i+1]));return t}},{getLength:function(){return null==this._length&&(this._length=R.getLength(this.getValues(),0,1)),this._length},getArea:function(){return R.getArea(this.getValues())},getLine:function(){return new M(this._segment1._point,this._segment2._point)},getPart:function(e,t){return new R(R.getPart(this.getValues(),e,t))},getPartLength:function(e,t){return R.getLength(this.getValues(),e,t)},divideAt:function(e){return this.divideAtTime(e&&e.curve===this?e.time:this.getTimeAt(e))},divideAtTime:function(e,t){var i=null;if(e>=1e-8&&e<=.99999999){var n=R.subdivide(this.getValues(),e),o=n[0],a=n[1],r=t||this.hasHandles(),s=this._segment1,l=this._segment2,u=this._path;r&&(s._handleOut._set(o[2]-o[0],o[3]-o[1]),l._handleIn._set(a[4]-a[6],a[5]-a[7]));var c=o[6],d=o[7],p=new D(new b(c,d),r&&new b(o[4]-c,o[5]-d),r&&new b(a[2]-c,a[3]-d));u?(u.insert(s._index+1,p),i=this.getNext()):(this._segment2=p,this._changed(),i=new R(p,l))}return i},splitAt:function(e){var t=this._path;return t?t.splitAt(e):null},splitAtTime:function(e){return this.splitAt(this.getLocationAtTime(e))},divide:function(e,t){return this.divideAtTime(e===r?.5:t?e:this.getTimeAt(e))},split:function(e,t){return this.splitAtTime(e===r?.5:t?e:this.getTimeAt(e))},reversed:function(){return new R(this._segment2.reversed(),this._segment1.reversed())},clearHandles:function(){this._segment1._handleOut._set(0,0),this._segment2._handleIn._set(0,0)},statics:{getValues:function(e,t,i,n){var o=e._point,a=e._handleOut,r=t._handleIn,s=t._point,l=o.x,u=o.y,c=s.x,d=s.y,p=n?[l,u,l,u,c,d,c,d]:[l,u,l+a._x,u+a._y,c+r._x,d+r._y,c,d];return i&&i._transformCoordinates(p,p,4),p},subdivide:function(e,t){var i=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7];t===r&&(t=.5);var d=1-t,p=d*i+t*o,m=d*n+t*a,g=d*o+t*s,h=d*a+t*l,f=d*s+t*u,b=d*l+t*c,y=d*p+t*g,v=d*m+t*h,k=d*g+t*f,w=d*h+t*b,T=d*y+t*k,S=d*v+t*w;return[[i,n,p,m,y,v,T,S],[T,S,k,w,f,b,u,c]]},getMonoCurves:function(e,t){var i=[],n=t?0:1,o=e[n+0],a=e[n+2],r=e[n+4],s=e[n+6];if(o>=a==a>=r&&a>=r==r>=s||R.isStraight(e))i.push(e);else{var l=3*(a-r)-o+s,u=2*(o+r)-4*a,c=a-o,d=[],p=h.solveQuadratic(l,u,c,d,1e-8,.99999999);if(p){d.sort();var m=d[0],g=R.subdivide(e,m);i.push(g[0]),p>1&&(m=(d[1]-m)/(1-m),g=R.subdivide(g[1],m),i.push(g[0])),i.push(g[1])}else i.push(e)}return i},solveCubic:function(e,t,i,n,o,a){var r=e[t],s=e[t+2],l=e[t+4],u=e[t+6],c=0;if(!(ri&&u>i&&s>i&&l>i)){var d=3*(s-r),p=3*(l-s)-d,m=u-r-d-p;c=h.solveCubic(m,p,d,r-i,n,o,a)}return c},getTimeOf:function(e,t){var i=new b(e[0],e[1]),n=new b(e[6],e[7]),o=1e-7;if(null===(t.isClose(i,1e-12)?0:t.isClose(n,1e-12)?1:null))for(var a=[t.x,t.y],r=[],s=0;s<2;s++)for(var l=R.solveCubic(e,s,a[s],r,0,1),u=0;u.999999999999?1:R.getTimeOf(e,new b(i+s*o,n+s*a))}var l=1/0,u=0;function c(i){if(i>=0&&i<=1){var n=t.getDistance(R.getPoint(e,i),!0);if(n1e-8;)c(u-p)||c(u+p)||(p/=2);return u},getPart:function(e,t,i){var n=t>i;if(n){var o=t;t=i,i=o}return t>0&&(e=R.subdivide(e,t)[1]),i<1&&(e=R.subdivide(e,(i-t)/(1-t))[0]),n?[e[6],e[7],e[4],e[5],e[2],e[3],e[0],e[1]]:e},isFlatEnough:function(e,t){var i=e[0],n=e[1],o=e[2],a=e[3],r=e[4],s=e[5],l=e[6],u=e[7],c=3*o-2*i-l,d=3*a-2*n-u,p=3*r-2*l-i,m=3*s-2*u-n;return Math.max(c*c,p*p)+Math.max(d*d,m*m)<=16*t*t},getArea:function(e){var t=e[0],i=e[1],n=e[2],o=e[3],a=e[4],r=e[5],s=e[6],l=e[7];return 3*((l-i)*(n+a)-(s-t)*(o+r)+o*(t-a)-n*(i-r)+l*(a+t/3)-s*(r+i/3))/20},getBounds:function(e){for(var t=e.slice(0,2),i=t.slice(),n=[0,0],o=0;o<2;o++)R._addBounds(e[o],e[o+2],e[o+4],e[o+6],o,0,t,i,n);return new w(t[0],t[1],i[0]-t[0],i[1]-t[1])},_addBounds:function(e,t,i,n,o,a,r,s,l){function u(e,t){var i=e-t,n=e+t;is[o]&&(s[o]=n)}a/=2;var c=r[o]-a,d=s[o]+a;if(ed||t>d||i>d||n>d)if(t=0&&s<=1&&l<=0&&l>=-1}}return!1},isLinear:function(e,t,i,n){var o=n.subtract(e).divide(3);return t.equals(o)&&i.negate().equals(o)}},(function(e,t){this[t]=function(t){var i=this._segment1,n=this._segment2;return e(i._point,i._handleOut,n._handleIn,n._point,t)},this.statics[t]=function(t,i){var n=t[0],o=t[1],a=t[6],r=t[7];return e(new b(n,o),new b(t[2]-n,t[3]-o),new b(t[4]-a,t[5]-r),new b(a,r),i)}}),{statics:{},hasHandles:function(){return!this._segment1._handleOut.isZero()||!this._segment2._handleIn.isZero()},hasLength:function(e){return(!this.getPoint1().equals(this.getPoint2())||this.hasHandles())&&this.getLength()>(e||0)},isCollinear:function(e){return e&&this.isStraight()&&e.isStraight()&&this.getLine().isCollinear(e.getLine())},isHorizontal:function(){return this.isStraight()&&Math.abs(this.getTangentAtTime(.5).y)<1e-8},isVertical:function(){return this.isStraight()&&Math.abs(this.getTangentAtTime(.5).x)<1e-8}}),{beans:!1,getLocationAt:function(e,t){return this.getLocationAtTime(t?e:this.getTimeAt(e))},getLocationAtTime:function(e){return null!=e&&e>=0&&e<=1?new j(this,e):null},getTimeAt:function(e,t){return R.getTimeAt(this.getValues(),e,t)},getParameterAt:\"#getTimeAt\",getTimesWithTangent:function(){var e=b.read(arguments);return e.isZero()?[]:R.getTimesWithTangent(this.getValues(),e)},getOffsetAtTime:function(e){return this.getPartLength(0,e)},getLocationOf:function(){return this.getLocationAtTime(this.getTimeOf(b.read(arguments)))},getOffsetOf:function(){var e=this.getLocationOf.apply(this,arguments);return e?e.getOffset():null},getTimeOf:function(){return R.getTimeOf(this.getValues(),b.read(arguments))},getParameterOf:\"#getTimeOf\",getNearestLocation:function(){var e=b.read(arguments),t=this.getValues(),i=R.getNearestTime(t,e),n=R.getPoint(t,i);return new j(this,i,n,null,e.getDistance(n))},getNearestPoint:function(){var e=this.getNearestLocation.apply(this,arguments);return e?e.getPoint():e}},new function(){var e=[\"getPoint\",\"getTangent\",\"getNormal\",\"getWeightedTangent\",\"getWeightedNormal\",\"getCurvature\"];return u.each(e,(function(e){this[e+\"At\"]=function(t,i){var n=this.getValues();return R[e](n,i?t:R.getTimeAt(n,t))},this[e+\"AtTime\"]=function(t){return R[e](this.getValues(),t)}}),{statics:{_evaluateMethods:e}})},new function(){function e(e){var t=e[0],i=e[1],n=e[2],o=e[3],a=e[4],r=e[5],s=e[6],l=e[7],u=9*(n-a)+3*(s-t),c=6*(t+a)-12*n,d=3*(n-t),p=9*(o-r)+3*(l-i),m=6*(i+r)-12*o,g=3*(o-i);return function(e){var t=(u*e+c)*e+d,i=(p*e+m)*e+g;return Math.sqrt(t*t+i*i)}}function t(e,t){return Math.max(2,Math.min(16,Math.ceil(32*Math.abs(t-e))))}function i(e,t,i,n){if(null==t||t<0||t>1)return null;var o=e[0],a=e[1],r=e[2],s=e[3],l=e[4],u=e[5],c=e[6],d=e[7],p=h.isZero;p(r-o)&&p(s-a)&&(r=o,s=a),p(l-c)&&p(u-d)&&(l=c,u=d);var m,g,f=3*(r-o),y=3*(l-r)-f,v=c-o-f-y,k=3*(s-a),w=3*(u-s)-k,T=d-a-k-w;if(0===i)m=0===t?o:1===t?c:((v*t+y)*t+f)*t+o,g=0===t?a:1===t?d:((T*t+w)*t+k)*t+a;else{var S=1e-8,M=1-S;if(tM?(m=3*(c-l),g=3*(d-u)):(m=(3*v*t+2*y)*t+f,g=(3*T*t+2*w)*t+k),n){0===m&&0===g&&(tM)&&(m=l-r,g=u-s);var E=Math.sqrt(m*m+g*g);E&&(m/=E,g/=E)}if(3===i){l=6*v*t+2*y,u=6*T*t+2*w;var I=Math.pow(m*m+g*g,1.5);m=0!==I?(m*u-g*l)/I:0,g=0}}return 2===i?new b(g,-m):new b(m,g)}return{statics:{classify:function(e){var t=e[0],i=e[1],n=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=n*(i-u)+o*(l-t)+t*u-i*l,d=3*(a*(o-i)+s*(t-n)+n*i-o*t),p=d-c,m=p-c+(t*(u-s)+i*(a-l)+l*s-u*a),g=Math.sqrt(m*m+p*p+d*d),f=0!==g?1/g:0,b=h.isZero,y=\"serpentine\";function v(e,t,i){var n=t!==r,o=n&&t>0&&t<1,a=n&&i>0&&i<1;return!n||(o||a)&&(\"loop\"!==e||o&&a)||(e=\"arch\",o=a=!1),{type:e,roots:o||a?o&&a?t0?Math.sqrt(k/3):Math.sqrt(-k),T=2*m;return v(k>0?y:\"loop\",(p+w)/T,(p-w)/T)},getLength:function(i,n,o,a){if(n===r&&(n=0),o===r&&(o=1),R.isStraight(i)){var s=i;o<1&&(s=R.subdivide(s,o)[0],n/=o),n>0&&(s=R.subdivide(s,n)[1]);var l=s[6]-s[0],u=s[7]-s[1];return Math.sqrt(l*l+u*u)}return h.integrate(a||e(i),n,o,t(n,o))},getTimeAt:function(i,n,o){if(o===r&&(o=n<0?1:0),0===n)return o;var a=Math.abs,s=n>0,l=s?o:0,u=s?1:o,c=e(i),d=R.getLength(i,l,u,c),p=a(n)-d;if(a(p)<1e-12)return s?u:l;if(p>1e-12)return null;var m=n/d,g=0;return h.findRoot((function(e){return g+=h.integrate(c,o,e,t(o,e)),o=e,g-n}),c,o+m,l,u,32,1e-12)},getPoint:function(e,t){return i(e,t,0,!1)},getTangent:function(e,t){return i(e,t,1,!0)},getWeightedTangent:function(e,t){return i(e,t,1,!1)},getNormal:function(e,t){return i(e,t,2,!0)},getWeightedNormal:function(e,t){return i(e,t,2,!1)},getCurvature:function(e,t){return i(e,t,3,!1).x},getPeaks:function(e){var t=e[0],i=e[1],n=e[2],o=e[3],a=e[4],r=e[5],s=3*n-t-3*a+e[6],l=3*t-6*n+3*a,u=-3*t+3*n,c=3*o-i-3*r+e[7],d=3*i-6*o+3*r,p=-3*i+3*o,m=[];return h.solveCubic(9*(s*s+c*c),9*(s*l+d*c),2*(l*l+d*d)+3*(u*s+p*c),u*l+d*p,m,1e-8,.99999999),m.sort()}}}},new function(){function e(e,t,i,n,o,a,r){var s=!r&&i.getPrevious()===o,l=!r&&i!==o&&i.getNext()===o,u=1e-8,c=1-u;if(null!==n&&n>=(s?u:0)&&n<=(l?c:1)&&null!==a&&a>=(l?u:0)&&a<=(s?c:1)){var d=new j(i,n,null,r),p=new j(o,a,null,r);d._intersection=p,p._intersection=d,t&&!t(d)||j.insert(e,d,!0)}}function t(n,o,a,r,s,l,u,c,d,p,m,g,h){if(++d>=4096||++c>=40)return d;var f,b,y=o[0],v=o[1],k=o[6],w=o[7],T=M.getSignedDistance,S=T(y,v,k,w,o[2],o[3]),E=T(y,v,k,w,o[4],o[5]),I=S*E>0?3/4:4/9,x=I*Math.min(0,S,E),_=I*Math.max(0,S,E),O=T(y,v,k,w,n[0],n[1]),C=T(y,v,k,w,n[2],n[3]),N=T(y,v,k,w,n[4],n[5]),A=T(y,v,k,w,n[6],n[7]),P=function(e,t,i,n){var o,a=[0,e],r=[1/3,t],s=[2/3,i],l=[1,n],u=t-(2*e+n)/3,c=i-(e+2*n)/3;if(u*c<0)o=[[a,r,l],[a,s,l]];else{var d=u/c;o=[d>=2?[a,r,l]:d<=.5?[a,s,l]:[a,r,s,l],[a,l]]}return(u||c)<0?o.reverse():o}(O,C,N,A),D=P[0],L=P[1];if(0===S&&0===E&&0===O&&0===C&&0===N&&0===A||null==(f=i(D,L,x,_))||null==(b=i(D.reverse(),L.reverse(),x,_)))return d;var j=p+(m-p)*f,z=p+(m-p)*b;if(Math.max(h-g,z-j)<1e-9){var B=(j+z)/2,U=(g+h)/2;e(s,l,u?r:a,u?U:B,u?a:r,u?B:U)}else{n=R.getPart(n,f,b);var F=h-g;if(b-f>.8)if(z-j>F){B=(j+z)/2;d=t(o,(H=R.subdivide(n,.5))[0],r,a,s,l,!u,c,d,g,h,j,B),d=t(o,H[1],r,a,s,l,!u,c,d,g,h,B,z)}else{var H;U=(g+h)/2;d=t((H=R.subdivide(o,.5))[0],n,r,a,s,l,!u,c,d,g,U,j,z),d=t(H[1],n,r,a,s,l,!u,c,d,U,h,j,z)}else d=0===F||F>=1e-9?t(o,n,r,a,s,l,!u,c,d,g,h,j,z):t(n,o,a,r,s,l,u,c,d,j,z,g,h)}return d}function i(e,t,i,o){return e[0][1]o?n(t,!1,o):e[0][0]}function n(e,t,i){for(var n=e[0][0],o=e[0][1],a=1,r=e.length;a=i:l<=i)return l===i?s:n+(i-o)*(s-n)/(l-o);n=s,o=l}return null}function o(e,t,i,n,o){var a=h.isZero;if(a(n)&&a(o)){var r=R.getTimeOf(e,new b(t,i));return null===r?[]:[r]}for(var s=Math.atan2(-o,n),l=Math.sin(s),u=Math.cos(s),c=[],d=[],p=0;p<8;p+=2){var m=e[p]-t,g=e[p+1]-i;c.push(m*u-g*l,m*l+g*u)}return R.solveCubic(c,1,0,d,0,1),d}function a(t,i,n,a,r,s,l){for(var u=i[0],c=i[1],d=o(t,u,c,i[6]-u,i[7]-c),p=0,m=d.length;pp(n[0],n[2],n[4],n[6])&&p(i[0],i[2],i[4],i[6])-dp(n[1],n[3],n[5],n[7])&&p(i[1],i[3],i[5],i[7])-d>1,M=1&h,E=6*S,I=6*M,x=new b(i[E],i[E+1]),_=new b(n[I],n[I+1]);x.isClose(_,d)&&e(l,c,o,S,s,M)}}}return l}function l(t,i,n,o){var a=R.classify(t);if(\"loop\"===a.type){var r=a.roots;e(n,o,i,r[0],i,r[1])}return n}function u(e,t){function i(e){var t=e[6]-e[0],i=e[7]-e[1];return t*t+i*i}var n=Math.abs,o=M.getDistance,a=1e-7,r=R.isStraight(e),s=R.isStraight(t),l=r&&s,u=i(e)>1,S=R.getTimeOf(f[k],new b(f[w][T?6:0],f[w][T?7:1]));if(null!=S){var E=k?[T,S]:[S,T];(!y.length||n(E[0]-y[0][0])>1e-8&&n(E[1]-y[0][1])>1e-8)&&y.push(E)}if(v>2&&!y.length)break}if(2!==y.length)y=null;else if(!l){var I=R.getPart(e,y[0][0],y[1][0]),x=R.getPart(t,y[0][1],y[1][1]);(n(x[2]-I[2])>a||n(x[3]-I[3])>a||n(x[4]-I[4])>a||n(x[5]-I[5])>a)&&(y=null)}return y}return{getIntersections:function(e){var t=this.getValues(),i=e&&e!==this&&e.getValues();return i?s(t,i,this,e,[]):l(t,this,[])},statics:{getOverlaps:u,getIntersections:function(e,t,i,n,o,a){var r=!t;r&&(t=e);for(var u=e.length,c=t.length,d=new Array(u),p=r?d:new Array(c),g=[],h=0;hb){var S=t[T];s(v,p[T],y,S,g,i)}}}return g},getCurveLineIntersections:o,getTimesWithTangent:function(e,t){var i=e[0],n=e[1],o=e[2],a=e[3],r=e[4],s=e[5],l=e[6],u=e[7],c=t.normalize(),d=c.x,p=c.y,m=3*l-9*r+9*o-3*i,g=3*u-9*s+9*a-3*n,f=6*r-12*o+6*i,b=6*s-12*a+6*n,y=3*o-3*i,v=3*a-3*n,k=2*m*p-2*g*d,w=[];if(Math.abs(k)=0&&T<=1&&w.push(T)}}else{var S=(f*f-4*m*y)*p*p+(-2*f*b+4*g*y+4*m*v)*d*p+(b*b-4*g*v)*d*d,M=f*p-b*d;if(S>=0&&0!=k){var E=Math.sqrt(S),I=-(M+E)/k,x=(-M+E)/k;I>=0&&I<=1&&w.push(I),x>=0&&x<=1&&w.push(x)}}return w}}}}),j=u.extend({_class:\"CurveLocation\",initialize:function(e,t,i,n,o){if(t>=.99999999){var a=e.getNext();a&&(t=0,e=a)}this._setCurve(e),this._time=t,this._point=i||e.getPointAtTime(t),this._overlap=n,this._distance=o,this._intersection=this._next=this._previous=null},_setPath:function(e){this._path=e,this._version=e?e._version:0},_setCurve:function(e){this._setPath(e._path),this._curve=e,this._segment=null,this._segment1=e._segment1,this._segment2=e._segment2},_setSegment:function(e){var t=e.getCurve();t?this._setCurve(t):(this._setPath(e._path),this._segment1=e,this._segment2=null),this._segment=e,this._time=e===this._segment1?0:1,this._point=e._point.clone()},getSegment:function(){var e=this._segment;if(!e){var t=this.getCurve(),i=this.getTime();0===i?e=t._segment1:1===i?e=t._segment2:null!=i&&(e=t.getPartLength(0,i)=n&&t<=o,r=i>=n&&i<=o;if(a&&r)return!this.isTouching();var s=this.getCurve(),l=s&&to&&(s=s.getNext()),i>o&&(u=u.getNext()),!(l&&s&&c&&u))return!1;var d=[];function p(e,t){var i=e.getValues(),n=R.classify(i).roots||R.getPeaks(i),o=n.length,a=R.getLength(i,t&&o?n[o-1]:0,!t&&o?n[0]:1);d.push(o?a:a/32)}function m(e,t,i){return tt&&et||e=-1&&a<=n;a+=o){var r=e[(a%n+n)%n];if(!t.getPoint().isClose(r.getPoint(),1e-7))break;if(t.equals(r))return r}return null}for(;o<=a;){var s,l=o+a>>>1,u=e[l];if(i&&(s=t.equals(u)?u:r(l,-1)||r(l,1)))return t._overlap&&(s._overlap=s._intersection._overlap=!0),s;var c=t.getPath(),d=u.getPath();(c!==d?c._id-d._id:t.getIndex()+t.getTime()-(u.getIndex()+u.getTime()))<0?a=l-1:o=l+1}return e.splice(o,0,t),t}return{statics:{insert:e,expand:function(t){for(var i=t.slice(),n=t.length-1;n>=0;n--)e(i,t[n]._intersection,!1);return i}}}}),z=I.extend({_class:\"PathItem\",_selectBounds:!1,_canScaleStroke:!0,beans:!0,initialize:function(){},statics:{create:function(e){var t,i,n;if(u.isPlainObject(e)?(i=e.segments,t=e.pathData):Array.isArray(e)?i=e:\"string\"==typeof e&&(t=e),i){var o=i[0];n=o&&Array.isArray(o[0])}else t&&(n=(t.match(/m/gi)||[]).length>1||/z\\s*\\S+/i.test(t));return new(n?U:B)(e)}},_asPathItem:function(){return this},isClockwise:function(){return this.getArea()>=0},setClockwise:function(e){this.isClockwise()!=(e=!!e)&&this.reverse()},setPathData:function(e){var t,i,n,o=e&&e.match(/[mlhvcsqtaz][^mlhvcsqtaz]*/gi),a=!1,r=new b,s=new b;function l(e,i){var n=+t[e];return a&&(n+=r[i]),n}function u(e){return new b(l(e,\"x\"),l(e+1,\"y\"))}this.clear();for(var c=0,d=o&&o.length;cu&&this[n?\"removeSegments\":\"removeChildren\"](u,l);for(d=0;d=0&&t;u--){var c=i[u];t=!1;var d=l[u];if(d)for(var p=d.length-1;p>=0&&!t;p--)c.compare(n[d[p]])&&(r[d[p]]||(r[d[p]]=!0,s++),t=!0)}t=t&&s===a}return t}}),B=z.extend({_class:\"Path\",_serializeFields:{segments:[],closed:!1},initialize:function(e){this._closed=!1,this._segments=[],this._version=0;var t=arguments,i=Array.isArray(e)?\"object\"==typeof e[0]?e:t:!e||e.size!==r||e.x===r&&e.point===r?null:t;i&&i.length>0?this.setSegments(i):(this._curves=r,this._segmentSelection=0,i||\"string\"!=typeof e||(this.setPathData(e),e=null)),this._initialize(!i&&e)},_equals:function(e){return this._closed===e._closed&&u.equals(this._segments,e._segments)},copyContent:function(e){this.setSegments(e._segments),this._closed=e._closed},_changed:function e(t){if(e.base.call(this,t),8&t){if(this._length=this._area=r,32&t)this._version++;else if(this._curves)for(var i=0,n=this._curves.length;i0&&(b(c[0],!0),f.push(\"z\")),f.join(\"\")},isEmpty:function(){return!this._segments.length},_transformContent:function(e){for(var t=this._segments,i=new Array(6),n=0,o=t.length;n0&&t+o-1===c?t-1:t,p=d,m=Math.min(d+o,c);e._curves&&(n.splice.apply(n,[d,0].concat(e._curves)),p+=e._curves.length);for(r=p;r0?e-1:e},add:function(e){var t=arguments;return t.length>1&&\"number\"!=typeof e?this._add(D.readList(t)):this._add([D.read(t)])[0]},insert:function(e,t){var i=arguments;return i.length>2&&\"number\"!=typeof t?this._add(D.readList(i,1),e):this._add([D.read(i,1)],e)[0]},addSegment:function(){return this._add([D.read(arguments)])[0]},insertSegment:function(e){return this._add([D.read(arguments,1)],e)[0]},addSegments:function(e){return this._add(D.readList(e))},insertSegments:function(e,t){return this._add(D.readList(t),e)},removeSegment:function(e){return this.removeSegments(e,e+1)[0]||null},removeSegments:function(e,t,i){e=e||0,t=u.pick(t,this._segments.length);var n=this._segments,o=this._curves,a=n.length,r=n.splice(e,t-e),s=r.length;if(!s)return r;for(var l=0;l0&&t===a+(this._closed?1:0)?e-1:e;for(l=(o=o.splice(p,s)).length-1;l>=0;l--)o[l]._path=null;i&&(r._curves=o.slice(1)),this._adjustCurves(p,p)}return this._changed(41),r},clear:\"#removeSegments\",hasHandles:function(){for(var e=this._segments,t=0,i=e.length;t0&&this._segmentSelection===7*e},setFullySelected:function(e){e&&this._selectSegments(!0),this.setSelected(e)},setSelection:function e(t){1&t||this._selectSegments(!1),e.base.call(this,t)},_selectSegments:function(e){var t=this._segments,i=t.length,n=e?7:0;this._segmentSelection=n*i;for(var o=0;o0&&this.setSelected(!0)},divideAt:function(e){var t,i=this.getLocationAt(e);return i&&(t=i.getCurve().divideAt(i.getCurveOffset()))?t._segment1:null},splitAt:function(e){var t=this.getLocationAt(e),i=t&&t.index,n=t&&t.time;n>.99999999&&(i++,n=0);var o=this.getCurves();if(i>=0&&i=1e-8&&o[i++].divideAtTime(n);var a,r=this.removeSegments(i,this._segments.length,!0);return this._closed?(this.setClosed(!1),a=this):((a=new B(I.NO_INSERT)).insertAbove(this),a.copyAttributes(this)),a._add(r,0),this.addSegment(r[0]),a}return null},split:function(e,t){var i,n=t===r?e:(i=this.getCurves()[e])&&i.getLocationAtTime(t);return null!=n?this.splitAt(n):null},join:function(e,t){var i=t||0;if(e&&e!==this){var n=e._segments,o=this.getLastSegment(),a=e.getLastSegment();if(!a)return this;o&&o._point.isClose(a._point,i)&&e.reverse();var r=e.getFirstSegment();if(o&&o._point.isClose(r._point,i))o.setHandleOut(r._handleOut),this._add(n.slice(1));else{var s=this.getFirstSegment();s&&s._point.isClose(r._point,i)&&e.reverse(),a=e.getLastSegment(),s&&s._point.isClose(a._point,i)?(s.setHandleIn(a._handleIn),this._add(n.slice(0,n.length-1),0)):this._add(n.slice())}e._closed&&this._add([n[0]]),e.remove()}var l=this.getFirstSegment(),u=this.getLastSegment();return l!==u&&l._point.isClose(u._point,i)&&(l.setHandleIn(u._handleIn),u.remove(),this.setClosed(!0)),this},reduce:function(e){for(var t=this.getCurves(),i=e&&e.simplify,n=i?1e-7:0,o=t.length-1;o>=0;o--){var a=t[o];!a.hasHandles()&&(!a.hasLength(n)||i&&a.isCollinear(a.getNext()))&&a.remove()}return this},reverse:function(){this._segments.reverse();for(var e=0,t=this._segments.length;e0&&n.push(new D(t[i-1].curve.slice(6))),this.setSegments(n)},simplify:function(e){var t=new H(this).fit(e||2.5);return t&&this.setSegments(t),!!t},smooth:function(e){var t=this,i=e||{},n=i.type||\"asymmetric\",o=this._segments,a=o.length,s=this._closed;function l(e,i){var n=e&&e.index;if(null!=n){var o=e.path;if(o&&o!==t)throw new Error(e._class+\" \"+n+\" of \"+o+\" is not part of \"+t);i&&e instanceof R&&n++}else n=\"number\"==typeof e?e:i;return Math.min(n<0&&s?n%a:n<0?n+a:n,a-1)}var u=s&&i.from===r&&i.to===r,c=l(i.from,0),d=l(i.to,a-1);if(c>d)if(s)c-=a;else{var p=c;c=d,d=p}if(/^(?:asymmetric|continuous)$/.test(n)){var m=\"asymmetric\"===n,g=Math.min,h=d-c+1,f=h-1,b=u?g(h,4):1,y=b,v=b,k=[];if(s||(y=g(1,c),v=g(1,a-d-1)),(f+=y+v)<=1)return;for(var w=0,T=c-y;w<=f;w++,T++)k[w]=o[(T<0?T+a:T)%a]._point;var S=k[0]._x+2*k[1]._x,M=k[0]._y+2*k[1]._y,E=2,I=f-1,x=[S],_=[M],O=[E],C=[],N=[];for(w=1;w=0;w--)C[w]=(x[w]-C[w+1])/O[w],N[w]=(_[w]-N[w+1])/O[w];C[f]=(3*k[f]._x-C[I])/2,N[f]=(3*k[f]._y-N[I])/2;w=y;var z=f-v;for(T=c;w<=z;w++,T++){var B=o[T<0?T+a:T],U=B._point,F=C[w]-U._x,H=N[w]-U._y;(u||wy)&&B.setHandleIn(-F,-H)}}else for(w=c;w<=d;w++)o[w<0?w+a:w].smooth(i,!u&&w===c,!u&&w===d)},toShape:function(e){if(!this._closed)return null;var t,i,n,o,a,s,l,u=this._segments;function c(e,t){var i=u[e],n=i.getNext(),o=u[t],a=o.getNext();return i._handleOut.isZero()&&n._handleIn.isZero()&&o._handleOut.isZero()&&a._handleIn.isZero()&&n._point.subtract(i._point).isCollinear(a._point.subtract(o._point))}function d(e){var t=u[e],i=t.getNext(),n=t._handleOut,o=i._handleIn,a=.5522847498307936;if(n.isOrthogonal(o)){var r=t._point,s=i._point,l=new M(r,n,!0).intersect(new M(s,o,!0),!0);return l&&h.isZero(n.getLength()/l.subtract(r).getLength()-a)&&h.isZero(o.getLength()/l.subtract(s).getLength()-a)}return!1}function p(e,t){return u[e]._point.getDistance(u[t]._point)}if(!this.hasHandles()&&4===u.length&&c(0,2)&&c(1,3)&&(a=u[1],s=a.getPrevious(),l=a.getNext(),s._handleOut.isZero()&&a._handleIn.isZero()&&a._handleOut.isZero()&&l._handleIn.isZero()&&a._point.subtract(s._point).isOrthogonal(l._point.subtract(a._point)))?(t=O.Rectangle,i=new v(p(0,3),p(0,1)),o=u[1]._point.add(u[2]._point).divide(2)):8===u.length&&d(0)&&d(2)&&d(4)&&d(6)&&c(1,5)&&c(3,7)?(t=O.Rectangle,n=(i=new v(p(1,6),p(0,3))).subtract(new v(p(0,7),p(1,2))).divide(2),o=u[3]._point.add(u[4]._point).divide(2)):4===u.length&&d(0)&&d(1)&&d(2)&&d(3)&&(h.isZero(p(0,2)-p(1,3))?(t=O.Circle,n=p(0,2)/2):(t=O.Ellipse,n=new v(p(2,0)/2,p(3,1)/2)),o=u[1]._point),t){var m=this.getPosition(!0),g=new t({center:m,size:i,radius:n,insert:!1});return g.copyAttributes(this,!0),g._matrix.prepend(this._matrix),g.rotate(o.subtract(m).getAngle()+90),(e===r||e)&&g.insertAbove(this),g}return null},toPath:\"#clone\",compare:function e(t){if(!t||t instanceof U)return e.base.call(this,t);var i=this.getCurves(),n=t.getCurves(),o=i.length,a=n.length;if(!o||!a)return o==a;for(var r,s,l=i[0].getValues(),u=[],c=0,d=0,p=0;p0?a-1:p,s=f[0][1];break}}var g,h=Math.abs;for(m=u[r];l&&m;){var f;if(f=R.getOverlaps(l,m))if(h(f[0][0]-d)<1e-8){1===(d=f[1][0])&&(l=++c=a&&(r=0),m=u[r]||n[r].getValues(),s=0),!l)return g[0]===r&&g[1]===s;continue}}break}return!1},_hitTestSelf:function(e,t,i,n){var o,a,r,s,l,u,c=this,d=this.getStyle(),p=this._segments,m=p.length,g=this._closed,h=t._tolerancePadding,f=h,b=t.stroke&&(d.hasStroke()||t.hitUnstrokedPaths),y=t.fill&&(d.hasFill()||t.hitUnfilledPaths),v=t.curves,k=b?d.getStrokeWidth()/2:y&&t.tolerance>0||v?0:null;function w(t,i){return e.subtract(t).divide(i).length<=1}function T(e,i,n){if(!t.selected||i.isSelected()){var o=e._point;if(i!==o&&(i=i.add(o)),w(i,f))return new P(n,c,{segment:e,point:i})}}function S(e,i){return(i||t.segments)&&T(e,e._point,\"segment\")||!i&&t.handles&&(T(e,e._handleIn,\"handle-in\")||T(e,e._handleOut,\"handle-out\"))}function M(e){s.add(e)}function E(t){var i,l=g||t._index>0&&t._index0?(o=d.getStrokeJoin(),a=d.getStrokeCap(),r=d.getMiterLimit(),f=f.add(B._getStrokePadding(k,n))):o=a=\"round\"),!t.ends||t.segments||g){if(t.segments||t.handles)for(var I=0;I1?E(l.getSegment())||(l=null):w(l.getPoint(),f)||(l=null)}if(!l&&\"miter\"===o&&m>1)for(I=0;Ie)return r.getLocationAt(e-a)}if(t.length>0&&e<=this.getLength())return new j(t[t.length-1],1)}else if(e&&e.getPath&&e.getPath()===this)return e;return null},getOffsetsWithTangent:function(){var e=b.read(arguments);if(e.isZero())return[];for(var t=[],i=0,n=this.getCurves(),o=0,a=n.length;o0&&h(d[0])}return{_draw:function(t,i,n,o){var a=i.dontStart,r=i.dontFinish||i.clip,s=this.getStyle(),l=s.hasFill(),u=s.hasStroke(),c=s.getDashArray(),d=!le.support.nativeDash&&u&&c&&c.length;function p(e){return c[(e%d+d)%d]}if(a||t.beginPath(),(l||u&&!d||r)&&(e(t,this,o),this._closed&&t.closePath()),!r&&(l||u)&&(this._setStyles(t,i,n,o),l&&(t.fill(s.getFillRule()),t.shadowColor=\"rgba(0,0,0,0)\"),u)){if(d){a||t.beginPath();var m,g=new F(this,.25,32,!1,o),h=g.length,f=-s.getDashOffset(),b=0;for(f%=h;f>0;)f-=p(b--)+p(b--);for(;f0||m>0)&&g.drawPart(t,Math.max(f,0),Math.max(m,0)),f=m+p(b++)}t.stroke()}},_drawSelected:function(t,i){t.beginPath(),e(t,this,i),t.stroke(),function(e,t,i,n,o){if(!(n<=0))for(var a,r,s=n/2,l=new Array(6),u=0,c=t.length;u1&&(O=(x*=P)*x,C=(_*=P)*_),r(P=(O*C-O*A-C*N)/(O*A+C*N))<1e-12&&(P=0),P<0)throw new Error(\"Cannot create an arc with the given arguments\");t=new b(x*I/_,-_*E/x).multiply((w===k?-1:1)*s(P)).rotate(y).add(T),i=(n=(o=(new S).translate(t).rotate(y).scale(x,_))._inverseTransform(c)).getDirectedAngle(o._inverseTransform(d)),!k&&i>0?i-=360:k&&i<0&&(i+=360)}if(m){var L=new M(c.add(m).divide(2),m.subtract(c).rotate(90),!0),R=new M(m.add(d).divide(2),d.subtract(m).rotate(90),!0),j=new M(c,d),z=j.getSide(m);if(!(t=L.intersect(R,!0))){if(!z)return this.lineTo(d);throw new Error(\"Cannot create an arc with the given arguments\")}i=(n=c.subtract(t)).getDirectedAngle(d.subtract(t));var B=j.getSide(t,!0);0===B?i=z*r(i):z===B&&(i+=i<0?360:-360)}if(i){for(var U=r(i),F=U>=360?4:Math.ceil((U-1e-7)/90),H=i/F,G=H*Math.PI/360,W=4/3*Math.sin(G)/(1+Math.cos(G)),V=[],q=0;q<=F;q++){var Y=d,Z=null;if(q0){for(var S=1;S=180)&&(d=d.negate(),p=p.negate()),s&&r(c),r(c.add(d)),\"miter\"===t){var g=new M(c.add(d),new b(-d.y,d.x),!0).intersect(new M(c.add(p),new b(-p.y,p.x),!0),!0);g&&c.getDistance(g)<=n*i&&r(g)}r(c.add(p))},_addSquareCap:function(e,t,i,n,o,a,r){var s=e._point.transform(n),l=e.getLocation(),u=l.getNormal().multiply(0===l.getTime()?i:-i).transform(o);\"square\"===t&&(r&&(a(s.subtract(u)),a(s.add(u))),s=s.add(u.rotate(-90))),a(s.add(u)),a(s.subtract(u))},getHandleBounds:function(e,t,i,n,o){var a,r,s=i.getStyle();if(o.stroke&&s.hasStroke()){var l=i._getStrokeMatrix(n,o),u=s.getStrokeWidth()/2,c=u;\"miter\"===s.getStrokeJoin()&&(c=u*s.getMiterLimit()),\"square\"===s.getStrokeCap()&&(c=Math.max(c,u*Math.SQRT2)),a=B._getStrokePadding(u,l),r=B._getStrokePadding(c,l)}for(var d=new Array(6),p=1/0,m=-p,g=p,h=m,f=0,b=e.length;fm&&(m=I),xh&&(h=_)}}return new w(p,g,m-p,h-g)}}});B.inject({statics:new function(){var e=.5522847498307936,t=[new D([-1,0],[0,e],[0,-e]),new D([0,-1],[-e,0],[e,0]),new D([1,0],[0,-e],[0,e]),new D([0,1],[e,0],[-e,0])];function i(e,t,i){var n=u.getNamed(i),o=new B(n&&0==n.insert&&I.NO_INSERT);return o._add(e),o._closed=t,o.set(n,{insert:!0})}function n(e,n,o){for(var a=new Array(4),r=0;r<4;r++){var s=t[r];a[r]=new D(s._point.multiply(n).add(e),s._handleIn.multiply(n),s._handleOut.multiply(n))}return i(a,!0,o)}return{Line:function(){var e=arguments;return i([new D(b.readNamed(e,\"from\")),new D(b.readNamed(e,\"to\"))],!1,e)},Circle:function(){var e=arguments,t=b.readNamed(e,\"center\"),i=u.readNamed(e,\"radius\");return n(t,new v(i),e)},Rectangle:function(){var t,n=arguments,o=w.readNamed(n,\"rectangle\"),a=v.readNamed(n,\"radius\",0,{readNull:!0}),r=o.getBottomLeft(!0),s=o.getTopLeft(!0),l=o.getTopRight(!0),u=o.getBottomRight(!0);if(!a||a.isZero())t=[new D(r),new D(s),new D(l),new D(u)];else{var c=(a=v.min(a,o.getSize(!0).divide(2))).width,d=a.height,p=c*e,m=d*e;t=[new D(r.add(c,0),null,[-p,0]),new D(r.subtract(0,d),[0,m]),new D(s.add(0,d),null,[0,-m]),new D(s.add(c,0),[-p,0],null),new D(l.subtract(c,0),null,[p,0]),new D(l.add(0,d),[0,-m],null),new D(u.subtract(0,d),null,[0,m]),new D(u.subtract(c,0),[p,0])]}return i(t,!0,n)},RoundRectangle:\"#Rectangle\",Ellipse:function(){var e=arguments,t=O._readEllipse(e);return n(t.center,t.radius,e)},Oval:\"#Ellipse\",Arc:function(){var e=arguments,t=b.readNamed(e,\"from\"),i=b.readNamed(e,\"through\"),n=b.readNamed(e,\"to\"),o=u.getNamed(e),a=new B(o&&0==o.insert&&I.NO_INSERT);return a.moveTo(t),a.arcTo(i,n),a.set(o)},RegularPolygon:function(){for(var e=arguments,t=b.readNamed(e,\"center\"),n=u.readNamed(e,\"sides\"),o=u.readNamed(e,\"radius\"),a=360/n,r=n%3==0,s=new b(0,r?-o:o),l=r?-1:.5,c=new Array(n),d=0;d=0;a--){var r=n[a];n!==i||r instanceof B||(n=u.slice(n)),Array.isArray(r)?n[a]=new B({segments:r,insert:!1}):r instanceof U&&(n.splice.apply(n,[a,1].concat(r.removeChildren())),r.remove())}return e.base.call(this,t,n)},reduce:function e(t){for(var i=this._children,n=i.length-1;n>=0;n--){var o;(o=i[n].reduce(t)).isEmpty()&&o.remove()}return i.length?e.base.call(this):((o=new B(I.NO_INSERT)).copyAttributes(this),o.insertAbove(this),this.remove(),o)},isClosed:function(){for(var e=this._children,t=0,i=e.length;t=0;g--){var h=r[g].split();h&&(m(h)&&h.getFirstSegment().setHandleIn(0,0),n.getLastSegment().setHandleOut(0,0))}return m(n),s(p,!1,e,t)}function p(e,t){for(var i=e;i;){if(i===t)return;i=i._previous}for(;e._next&&e._next!==t;)e=e._next;if(!e._next){for(;t._previous;)t=t._previous;e._next=t,t._previous=e}}function g(e){for(var t=e.length-1;t>=0;t--)e[t].clearHandles()}function f(e,t,n){var o=e&&e.length;if(o){var a=u.each(e,(function(e,t){this[e._id]={container:null,winding:e.isClockwise()?1:-1,index:t}}),{}),r=e.slice().sort((function(e,t){return i(t.getArea())-i(e.getArea())})),s=r[0],l=m.findItemBoundsCollisions(r,null,h.GEOMETRIC_EPSILON);null==n&&(n=s.isClockwise());for(var c=0;c=0;y--)if(f[y]=0;h--){(f=i[h])._path&&(d[m(f)]=!0)}for(h=e.length-1;h>=0;h--){var f,b,y=e[h],v=y._time,k=v,w=t&&!t(y);if((f=y._curve)&&(f!==o?(u=!f.hasHandles()||d&&d[m(f)],n=[],a=null,o=f):a>=s&&(v/=a)),w)n&&n.push(y);else{if(t&&r.unshift(y),a=k,vl)b=f._segment2;else{var T=f.divideAtTime(v,!0);u&&c.push(f,T),b=T._segment1;for(var S=n.length-1;S>=0;S--){var M=n[S];M._time=(M._time-v)/(1-v)}}y._setSegment(b);var E=b._intersection,I=y._intersection;if(E){p(E,I);for(var x=E;x;)p(x._intersection,E),x=x._next}else b._intersection=I}}return i||g(c),r||e}function y(n,o,a,r,s){var l,u,c=Array.isArray(o)?o:o[a?\"hor\":\"ver\"],d=a?1:0,p=1^d,m=[n.x,n.y],g=m[d],h=m[p],f=1e-6,b=g-1e-9,v=g+1e-9,k=0,w=0,T=0,S=0,M=!1,E=!1,I=1,x=[];function _(i){var u=i[p+0],c=i[p+6];if(!(ht(u,c))){var m=i[d+0],k=i[d+2],w=i[d+4],E=i[d+6];if(u!==c){var _=h===u?0:h===c||b>t(m,k,w,E)||v0?x[0]:1,O=0===_?m:1===_?E:R.getPoint(i,_)[a?\"y\":\"x\"],C=u>c?1:-1,N=l[p]>l[p+6]?1:-1,A=l[d+6];return h!==u?(Ov?S+=C:M=!0,O>g-f&&Ov&&(S+=C):m!=A&&(Av?(S+=C,M=!0):A>b&&Ob&&Ob||Eb)&&(M=!0)}}function O(i){var n=i[p+0],o=i[p+2],r=i[p+4],s=i[p+6];if(h<=t(n,o,r,s)&&h>=e(n,o,r,s))for(var l,u=i[d+0],c=i[d+2],m=i[d+4],g=i[d+6],f=b>t(u,c,m,g)||vd.quality&&(d=I);break}u-=b}}for(m=r.length-1;m>=0;m--)r[m].segment._winding=d}function k(e,t){var i,n=[];function o(e){var i;return!(!e||e._visited||t&&(!t[(i=e._winding||{}).winding]||t.unite&&2===i.winding&&i.windingL&&i.windingR))}function a(e){if(e)for(var t=0,n=i.length;t=0;l--){var c=s[l],d=c._path,p=c._segment,m=p.getPrevious(),h=p.getNext();i(m,d)&&i(h,d)&&(p.remove(),m._handleOut._set(0,0),h._handleIn._set(0,0),m===p||m.getCurve().hasLength()||(h._handleIn.set(m._handleIn),m.remove()))}o&&(b(a,n&&function(e){var t=e.getCurve(),i=e.getSegment(),n=e._intersection,o=n._curve,a=n._segment;if(t&&o&&t._path&&o._path)return!0;i&&(i._intersection=null),a&&(a._intersection=null)},r),r&&g(r),t=k(u.each(t,(function(e){u.push(this,e._segments)}),[])));var f,y=t.length;return y>1&&e?(t!==e&&this.setChildren(t),f=this):1!==y||e||(t[0]!==this&&this.setSegments(t[0].removeSegments()),f=this),f||((f=new U(I.NO_INSERT)).addChildren(t),(f=f.reduce()).copyAttributes(this),this.replaceWith(f)),f},reorient:function(e,t){var i=this._children;return i&&i.length?this.setChildren(f(this.removeChildren(),(function(t){return!!(e?t:1&t)}),t)):t!==r&&this.setClockwise(t),this},getInteriorPoint:function(){var i=this.getBounds().getCenter(!0);if(!this.contains(i)){for(var n=this.getCurves(),o=i.y,a=[],r=[],s=0,l=n.length;s=e(c,d,p,m)&&o<=t(c,d,p,m))for(var g=R.getMonoCurves(u),h=0,f=g.length;h=y&&o<=v||o>=v&&o<=y)){var k=o===y?b[0]:o===v?b[6]:1===R.solveCubic(b,1,o,r,0,1)?R.getPoint(b,r[0]).x:(b[0]+b[6])/2;a.push(k)}}}a.length>1&&(a.sort((function(e,t){return e-t})),i.x=(a[0]+a[1])/2)}return i}}});var F=u.extend({_class:\"PathFlattener\",initialize:function(e,t,i,n,o){var a,r=[],s=[],l=0,u=1/(i||32),c=e._segments,d=c[0];function p(e,t){var i=R.getValues(e,t,o);r.push(i),m(i,e._index,0,1)}function m(e,i,o,a){if(!(a-o>u)||n&&R.isStraight(e)||R.isFlatEnough(e,t||.25)){var r=e[6]-e[0],c=e[7]-e[1],d=Math.sqrt(r*r+c*c);d>0&&(l+=d,s.push({offset:l,curve:e,index:i,time:a}))}else{var p=R.subdivide(e,.5),g=(o+a)/2;m(p[0],i,o,g),m(p[1],i,g,a)}}for(var g=1,h=c.length;g=e){this.index=t;var r=i[t-1],s=r&&r.index===a.index?r.time:0,l=r?r.offset:0;return{index:a.index,time:s+(a.time-s)*(e-l)/(a.offset-l)}}}return{index:i[n-1].index,time:1}},drawPart:function(e,t,i){for(var n=this._get(t),o=this._get(i),a=n.index,r=o.index;a<=r;a++){var s=R.getPart(this.curves[a],a===n.index?n.time:0,a===o.index?o.time:1);a===n.index&&e.moveTo(s[0],s[1]),e.bezierCurveTo.apply(e,s.slice(2))}}},u.each(R._evaluateMethods,(function(e){this[e+\"At\"]=function(t){var i=this._get(t);return R[e](this.curves[i.index],i.time)}}),{})),H=u.extend({initialize:function(e){for(var t,i=this.points=[],n=e._segments,o=e._closed,a=0,r=n.length;a0&&(n=[new D(t[0])],i>1&&(this.fitCubic(n,e,0,i-1,t[1].subtract(t[0]),t[i-2].subtract(t[i-1])),this.closed&&(n.shift(),n.pop()))),n},fitCubic:function(e,t,i,n,o,a){var r=this.points;if(n-i!==1){for(var s,l=this.chordLengthParameterize(i,n),u=Math.max(t,t*t),c=!0,d=0;d<=4;d++){var p=this.generateBezier(i,n,l,o,a),m=this.findMaxError(i,n,p,l);if(m.error=u)break;c=this.reparameterize(i,n,l,p),u=m.error}var g=r[s-1].subtract(r[s+1]);this.fitCubic(e,t,i,s,o,g),this.fitCubic(e,t,s,n,g.negate(),a)}else{var h=r[i],f=r[n],b=h.getDistance(f)/3;this.addCurve(e,[h,h.add(o.normalize(b)),f.add(a.normalize(b)),f])}},addCurve:function(e,t){e[e.length-1].setHandleOut(t[1].subtract(t[0])),e.push(new D(t[3],t[2].subtract(t[3])))},generateBezier:function(e,t,i,n,o){for(var a=1e-12,r=Math.abs,s=this.points,l=s[e],u=s[t],c=[[0,0],[0,0]],d=[0,0],p=0,m=t-e+1;pa){var x=c[0][0]*d[1]-c[1][0]*d[0];M=(d[0]*c[1][1]-d[1]*c[0][1])/I,E=x/I}else{var _=c[0][0]+c[0][1],O=c[1][0]+c[1][1];M=E=r(_)>a?d[0]/_:r(O)>a?d[1]/O:0}var C,N,A=u.getDistance(l),P=a*A;if(MA*A&&(M=E=A/3,C=N=null)}return[l,l.add(C||n.normalize(M)),u.add(N||o.normalize(E)),u]},reparameterize:function(e,t,i,n){for(var o=e;o<=t;o++)i[o-e]=this.findRoot(n,this.points[o],i[o-e]);o=1;for(var a=i.length;o=a&&(a=l,o=r)}return{error:a,index:o}}}),G=I.extend({_class:\"TextItem\",_applyMatrix:!1,_canApplyMatrix:!1,_serializeFields:{content:null},_boundsOptions:{stroke:!1,handle:!1},initialize:function(e){this._content=\"\",this._lines=[];var t=e&&u.isPlainObject(e)&&e.x===r&&e.y===r;this._initialize(t&&e,!t&&b.read(arguments))},_equals:function(e){return this._content===e._content},copyContent:function(e){this.setContent(e._content)},getContent:function(){return this._content},setContent:function(e){this._content=\"\"+e,this._lines=this._content.split(/\\r\\n|\\n|\\r/gm),this._changed(521)},isEmpty:function(){return!this._content},getCharacterStyle:\"#getStyle\",setCharacterStyle:\"#setStyle\",getParagraphStyle:\"#getStyle\",setParagraphStyle:\"#setStyle\"}),W=G.extend({_class:\"PointText\",initialize:function(){G.apply(this,arguments)},getPoint:function(){var e=this._matrix.getTranslation();return new y(e.x,e.y,this,\"setPoint\")},setPoint:function(){var e=b.read(arguments);this.translate(e.subtract(this._matrix.getTranslation()))},_draw:function(e,t,i){if(this._content){this._setStyles(e,t,i);var n=this._lines,o=this._style,a=o.hasFill(),r=o.hasStroke(),s=o.getLeading(),l=e.shadowColor;e.font=o.getFontStyle(),e.textAlign=o.getJustification();for(var u=0,c=n.length;u1&&(l-=1),r[s]=6*l<1?a+6*(o-a)*l:2*l<1?o:3*l<2?a+(o-a)*(2/3-l)*6:a}return r},\"rgb-gray\":function(e,t,i){return[.2989*e+.587*t+.114*i]},\"gray-rgb\":function(e){return[e,e,e]},\"gray-hsb\":function(e){return[0,0,e]},\"gray-hsl\":function(e){return[0,0,e]},\"gradient-rgb\":function(){return[]},\"rgb-gradient\":function(){return[]}};return u.each(t,(function(e,n){i[n]=[],u.each(e,(function(e,o){var a=u.capitalize(e),r=/^(hue|saturation)$/.test(e),s=i[n][o]=\"gradient\"===n?\"gradient\"===e?function(e){var t=this._components[0];return t!==(e=q.read(Array.isArray(e)?e:arguments,0,{readNull:!0}))&&(t&&t._removeOwner(this),e&&e._addOwner(this)),e}:function(){return b.read(arguments,0,{readNull:\"highlight\"===e,clone:!0})}:function(e){return null==e||isNaN(e)?0:+e};this[\"get\"+a]=function(){return this._type===n||r&&/^hs[bl]$/.test(this._type)?this._components[o]:this._convert(n)[o]},this[\"set\"+a]=function(e){this._type===n||r&&/^hs[bl]$/.test(this._type)||(this._components=this._convert(n),this._properties=t[n],this._type=n),this._components[o]=s.call(this,e),this._changed()}}),this)}),{_class:\"Color\",_readIndex:!0,initialize:function o(a){var r,l,c,d,p=arguments,m=this.__read,g=0;Array.isArray(a)&&(a=(p=a)[0]);var h=null!=a&&typeof a;if(\"string\"===h&&a in t&&(r=a,a=p[1],Array.isArray(a)?(l=a,c=p[2]):(m&&(g=1),p=u.slice(p,1),h=typeof a)),!l){if(d=\"number\"===h?p:\"object\"===h&&null!=a.length?a:null){r||(r=d.length>=3?\"rgb\":\"gray\");var f=t[r].length;c=d[f],m&&(g+=d===arguments?f+(null!=c?1:0):1),d.length>f&&(d=u.slice(d,0,f))}else if(\"string\"===h){var b=function(t){var i,o=t.match(/^#([\\da-f]{2})([\\da-f]{2})([\\da-f]{2})([\\da-f]{2})?$/i)||t.match(/^#([\\da-f])([\\da-f])([\\da-f])([\\da-f])?$/i),a=\"rgb\";if(o){var r=o[4]?4:3;i=new Array(r);for(var l=0;l1?1:e))}return t=[n(t[0]),n(t[1]),n(t[2])],i<1&&t.push(i<0?0:i),e?\"#\"+((1<<24)+(t[0]<<16)+(t[1]<<8)+t[2]).toString(16).slice(1):(4==t.length?\"rgba(\":\"rgb(\")+t.join(\",\")+\")\"},toCanvasStyle:function(e,t,i){var n=\"gradient\"===this._type&&i;if(this._canvasStyle&&!n)return this._canvasStyle;if(\"gradient\"!==this._type)return this._canvasStyle=this.toCSS();var o,a=this._components,r=a[0],s=r._stops,l=a[1],u=a[2],c=a[3],d=t&&t.inverted();if(d&&(l=d._transformPoint(l),u=d._transformPoint(u),c&&(c=d._transformPoint(c))),i&&(l=i._transformPoint(l),u=i._transformPoint(u),c&&(c=i._transformPoint(c))),r._radial){var p=u.getDistance(l);if(c){var m=c.subtract(l);m.getLength()>p&&(c=l.add(m.normalize(p-.1)))}var g=c||l;o=e.createRadialGradient(g.x,g.y,0,l.x,l.y,p)}else o=e.createLinearGradient(l.x,l.y,u.x,u.y);for(var h=0,f=s.length;h0&&!(n instanceof U);if(a)for(var r=0,s=o.length;r0&&!(n instanceof U);if(a&&!e)for(var l=0,c=o.length;l0},hasStroke:function(){var e=this.getStrokeColor();return!!e&&e.alpha>0&&this.getStrokeWidth()>0},hasShadow:function(){var e=this.getShadowColor();return!!e&&e.alpha>0&&(this.getShadowBlur()>0||!this.getShadowOffset().isZero())},getView:function(){return this._project._view},getFontStyle:function(){var e=this.getFontSize();return this.getFontWeight()+\" \"+e+(/[a-z]/i.test(e+\"\")?\" \":\"px \")+this.getFontFamily()},getFont:\"#getFontFamily\",setFont:\"#setFontFamily\",getLeading:function e(){var t=e.base.call(this),i=this.getFontSize();return/pt|em|%|px/.test(i)&&(i=this.getView().getPixelSize(i)),null!=t?t:1.2*i}}),K=new function(){function e(e,t,i,n){for(var o=[\"\",\"webkit\",\"moz\",\"Moz\",\"ms\",\"o\"],a=t[0].toUpperCase()+t.substring(1),r=0;r<6;r++){var s=o[r],l=s?s+a:t;if(l in e){if(!i)return e[l];e[l]=n;break}}}return{getStyles:function(e){var t=e&&9!==e.nodeType?e.ownerDocument:e,i=t&&t.defaultView;return i&&i.getComputedStyle(e,\"\")},getBounds:function(e,t){var i,n=e.ownerDocument,o=n.body,a=n.documentElement;try{i=e.getBoundingClientRect()}catch(e){i={left:0,top:0,width:0,height:0}}var r=i.left-(a.clientLeft||o.clientLeft||0),s=i.top-(a.clientTop||o.clientTop||0);if(!t){var l=n.defaultView;r+=l.pageXOffset||a.scrollLeft||o.scrollLeft,s+=l.pageYOffset||a.scrollTop||o.scrollTop}return new w(r,s,i.width,i.height)},getViewportBounds:function(e){var t=e.ownerDocument,i=t.defaultView,n=t.documentElement;return new w(0,0,i.innerWidth||n.clientWidth,i.innerHeight||n.clientHeight)},getOffset:function(e,t){return K.getBounds(e,t).getPoint()},getSize:function(e){return K.getBounds(e,!0).getSize()},isInvisible:function(e){return K.getSize(e).equals(new v(0,0))},isInView:function(e){return!K.isInvisible(e)&&K.getViewportBounds(e).intersects(K.getBounds(e,!0))},isInserted:function(e){return l.body.contains(e)},getPrefixed:function(t,i){return t&&e(t,i)},setPrefixed:function(t,i,n){if(\"object\"==typeof i)for(var o in i)e(t,o,!0,i[o]);else e(t,i,!0,n)}}},Q={add:function(e,t){if(e)for(var i in t)for(var n=t[i],o=i.split(/[\\s,]+/g),a=0,r=o.length;a1?u.hyphenate(t):t.toLowerCase())}function p(t,i,n,r){var s,l=X._focused;if(o[i]=t,t?a[i]=n:delete a[i],i.length>1&&(s=u.camelize(i))in c){c[s]=t;var d=le&&le.agent;if(\"meta\"===s&&d&&d.mac)if(t)e={};else{for(var m in e)m in a&&p(!1,m,e[m],r);e=null}}else t&&e&&(e[i]=n);l&&l._handleKeyEvent(t?\"keydown\":\"keyup\",r,i,n)}return Q.add(l,{keydown:function(e){var i=d(e),o=le&&le.agent;i.length>1||o&&o.chrome&&(e.altKey||o.mac&&e.metaKey||!o.mac&&e.ctrlKey)?p(!0,i,n[i]||(i.length>1?\"\":i),e):t=i},keypress:function(e){if(t){var i=d(e),n=e.charCode,o=n>=32?String.fromCharCode(n):i.length>1?\"\":i;i!==t&&(i=o.toLowerCase()),p(!0,i,o,e),t=null}},keyup:function(e){var t=d(e);t in a&&p(!1,t,a[t],e)}}),Q.add(s,{blur:function(e){for(var t in a)p(!1,t,a[t],e)}}),{modifiers:c,isDown:function(e){return!!o[e]}}},ie=$.extend({_class:\"MouseEvent\",initialize:function(e,t,i,n,o){this.type=e,this.event=t,this.point=i,this.target=n,this.delta=o},toString:function(){return\"{ type: '\"+this.type+\"', point: \"+this.point+\", target: \"+this.target+(this.delta?\", delta: \"+this.delta:\"\")+\", modifiers: \"+this.getModifiers()+\" }\"}}),ne=$.extend({_class:\"ToolEvent\",_item:null,initialize:function(e,t,i){this.tool=e,this.type=t,this.event=i},_choosePoint:function(e,t){return e||(t?t.clone():null)},getPoint:function(){return this._choosePoint(this._point,this.tool._point)},setPoint:function(e){this._point=e},getLastPoint:function(){return this._choosePoint(this._lastPoint,this.tool._lastPoint)},setLastPoint:function(e){this._lastPoint=e},getDownPoint:function(){return this._choosePoint(this._downPoint,this.tool._downPoint)},setDownPoint:function(e){this._downPoint=e},getMiddlePoint:function(){return!this._middlePoint&&this.tool._lastPoint?this.tool._point.add(this.tool._lastPoint).divide(2):this._middlePoint},setMiddlePoint:function(e){this._middlePoint=e},getDelta:function(){return!this._delta&&this.tool._lastPoint?this.tool._point.subtract(this.tool._lastPoint):this._delta},setDelta:function(e){this._delta=e},getCount:function(){return this.tool[/^mouse(down|up)$/.test(this.type)?\"_downCount\":\"_moveCount\"]},setCount:function(e){this.tool[/^mouse(down|up)$/.test(this.type)?\"downCount\":\"count\"]=e},getItem:function(){if(!this._item){var e=this.tool._scope.project.hitTest(this.getPoint());if(e){for(var t=e.item,i=t._parent;/^(Group|CompoundPath)$/.test(i._class);)t=i,i=i._parent;this._item=t}}return this._item},setItem:function(e){this._item=e},toString:function(){return\"{ type: \"+this.type+\", point: \"+this.getPoint()+\", count: \"+this.getCount()+\", modifiers: \"+this.getModifiers()+\" }\"}}),oe=(p.extend({_class:\"Tool\",_list:\"tools\",_reference:\"tool\",_events:[\"onMouseDown\",\"onMouseUp\",\"onMouseDrag\",\"onMouseMove\",\"onActivate\",\"onDeactivate\",\"onEditOptions\",\"onKeyDown\",\"onKeyUp\"],initialize:function(e){p.call(this),this._moveCount=-1,this._downCount=-1,this.set(e)},getMinDistance:function(){return this._minDistance},setMinDistance:function(e){this._minDistance=e,null!=e&&null!=this._maxDistance&&e>this._maxDistance&&(this._maxDistance=e)},getMaxDistance:function(){return this._maxDistance},setMaxDistance:function(e){this._maxDistance=e,null!=this._minDistance&&null!=e&&e=0&&a.equals(r))return!1;if(r&&(null!=e||null!=t)){var s=a.subtract(r),l=s.getLength();if(l<(e||0))return!1;t&&(a=r.add(s.normalize(Math.min(l,t))))}u._moveCount++}return u._point=a,u._lastPoint=r||a,n.down&&(u._moveCount=-1,u._downPoint=a,u._downCount++),!0}function d(){a&&(l=u.emit(e,new ne(u,e,t))||l)}if(n.down)c(),d();else if(n.up)c(null,s),d();else if(a)for(;c(r,s);)d();return l}}),{canvases:[],getCanvas:function(e,t){if(!s)return null;var i,n=!0;\"object\"==typeof e&&(t=e.height,e=e.width),this.canvases.length?i=this.canvases.pop():(i=l.createElement(\"canvas\"),n=!1);var o=i.getContext(\"2d\");if(!o)throw new Error(\"Canvas \"+i+\" is unable to provide a 2D context.\");return i.width===e&&i.height===t?n&&o.clearRect(0,0,e+1,t+1):(i.width=e,i.height=t),o.save(),i},getContext:function(e,t){var i=this.getCanvas(e,t);return i?i.getContext(\"2d\"):null},release:function(e){var t=e&&e.canvas?e.canvas:e;t&&t.getContext&&(t.getContext(\"2d\").restore(),this.canvases.push(t))}}),ae=new function(){var e,t,i,n,o,a,r,s,l,c,d,p=Math.min,m=Math.max,g=Math.abs;function h(e,t,i){return.2989*e+.587*t+.114*i}function f(e,t,i,n){var o=n-h(e,t,i),a=(n=h(l=e+o,c=t+o,d=i+o),p(l,c,d)),r=m(l,c,d);if(a<0){var s=n-a;l=n+(l-n)*n/s,c=n+(c-n)*n/s,d=n+(d-n)*n/s}if(r>255){var u=255-n,g=r-n;l=n+(l-n)*u/g,c=n+(c-n)*u/g,d=n+(d-n)*u/g}}function b(e,t,i){return m(e,t,i)-p(e,t,i)}function y(e,t,i,n){var o,a=[e,t,i],r=m(e,t,i),s=p(e,t,i);o=0===p(s=s===e?0:s===t?1:2,r=r===e?0:r===t?1:2)?1===m(s,r)?2:1:0,a[r]>a[s]?(a[o]=(a[o]-a[s])*n/(a[r]-a[s]),a[r]=n):a[o]=a[r]=0,a[s]=0,l=a[0],c=a[1],d=a[2]}var v={multiply:function(){l=o*e/255,c=a*t/255,d=r*i/255},screen:function(){l=o+e-o*e/255,c=a+t-a*t/255,d=r+i-r*i/255},overlay:function(){l=o<128?2*o*e/255:255-2*(255-o)*(255-e)/255,c=a<128?2*a*t/255:255-2*(255-a)*(255-t)/255,d=r<128?2*r*i/255:255-2*(255-r)*(255-i)/255},\"soft-light\":function(){var n=e*o/255;l=n+o*(255-(255-o)*(255-e)/255-n)/255,c=(n=t*a/255)+a*(255-(255-a)*(255-t)/255-n)/255,d=(n=i*r/255)+r*(255-(255-r)*(255-i)/255-n)/255},\"hard-light\":function(){l=e<128?2*e*o/255:255-2*(255-e)*(255-o)/255,c=t<128?2*t*a/255:255-2*(255-t)*(255-a)/255,d=i<128?2*i*r/255:255-2*(255-i)*(255-r)/255},\"color-dodge\":function(){l=0===o?0:255===e?255:p(255,255*o/(255-e)),c=0===a?0:255===t?255:p(255,255*a/(255-t)),d=0===r?0:255===i?255:p(255,255*r/(255-i))},\"color-burn\":function(){l=255===o?255:0===e?0:m(0,255-255*(255-o)/e),c=255===a?255:0===t?0:m(0,255-255*(255-a)/t),d=255===r?255:0===i?0:m(0,255-255*(255-r)/i)},darken:function(){l=oe?o:e,c=a>t?a:t,d=r>i?r:i},difference:function(){(l=o-e)<0&&(l=-l),(c=a-t)<0&&(c=-c),(d=r-i)<0&&(d=-d)},exclusion:function(){l=o+e*(255-o-o)/255,c=a+t*(255-a-a)/255,d=r+i*(255-r-r)/255},hue:function(){y(e,t,i,b(o,a,r)),f(l,c,d,h(o,a,r))},saturation:function(){y(o,a,r,b(e,t,i)),f(l,c,d,h(o,a,r))},luminosity:function(){f(o,a,r,h(e,t,i))},color:function(){f(e,t,i,h(o,a,r))},add:function(){l=p(o+e,255),c=p(a+t,255),d=p(r+i,255)},subtract:function(){l=m(o-e,0),c=m(a-t,0),d=m(r-i,0)},average:function(){l=(o+e)/2,c=(a+t)/2,d=(r+i)/2},negation:function(){l=255-g(255-e-o),c=255-g(255-t-a),d=255-g(255-i-r)}},k=this.nativeModes=u.each([\"source-over\",\"source-in\",\"source-out\",\"source-atop\",\"destination-over\",\"destination-in\",\"destination-out\",\"destination-atop\",\"lighter\",\"darker\",\"copy\",\"xor\"],(function(e){this[e]=!0}),{}),w=oe.getContext(1,1);w&&(u.each(v,(function(e,t){var i=\"darken\"===t,n=!1;w.save();try{w.fillStyle=i?\"#300\":\"#a00\",w.fillRect(0,0,1,1),w.globalCompositeOperation=t,w.globalCompositeOperation===t&&(w.fillStyle=i?\"#a00\":\"#300\",w.fillRect(0,0,1,1),n=w.getImageData(0,0,1,1).data[0]!==i?170:51)}catch(e){}w.restore(),k[t]=n})),oe.release(w)),this.process=function(u,p,m,g,h){var f=p.canvas,b=\"normal\"===u;if(b||k[u])m.save(),m.setTransform(1,0,0,1,0,0),m.globalAlpha=g,b||(m.globalCompositeOperation=u),m.drawImage(f,h.x,h.y),m.restore();else{var y=v[u];if(!y)return;for(var w=m.getImageData(h.x,h.y,f.width,f.height),T=w.data,S=p.getImageData(0,0,f.width,f.height).data,M=0,E=T.length;M=2&&!i.hasHandles())if(u>2){s=i._closed?\"polygon\":\"polyline\";for(var d=[],p=0;p\\n\\n \\n \\n \\n \\n \\n'),t.contentDocument.close()),t.contentDocument.body);try{a&&m&&(e=le.getView().getSize(),e=c(n,null,null,!0)||e,r=re.create(\"svg\",{style:\"stroke-width: 1px; stroke-miterlimit: 10\"}),s=n.parentNode,d=n.nextSibling,r.appendChild(n),g.appendChild(r));var f=le.settings,b=f.applyMatrix,y=f.insertItems;f.applyMatrix=!1,f.insertItems=!1;var v=h[p],k=v&&v(n,p,o,a)||null;if(f.insertItems=y,f.applyMatrix=b,k){!m||k instanceof x||(k=M(k,n,a));var w=o.onImport;w&&(k=w(n,k,o)||k),o.expandShapes&&k instanceof O&&(k.remove(),k=k.toPath())}return a&&(i={},k&&u.pick(o.applyMatrix,b)&&k.matrix.apply(!0,!0)),k}finally{r&&(g.removeChild(r),s&&(d?s.insertBefore(n,d):s.appendChild(n)))}}function P(e,t,i){if(!e)return null;t=\"function\"==typeof t?{onLoad:t}:t||{};var n=le,o=null;function s(s){try{var u=\"object\"==typeof s?s:(new a.DOMParser).parseFromString(s,\"image/svg+xml\");if(!u.nodeName)throw u=null,new Error(\"Unsupported SVG source: \"+e);le=n,o=N(u,t,!0),t&&!1===t.insert||i._insertItem(r,o);var c=t.onLoad;c&&c(o,s)}catch(e){l(e)}}function l(e,i){var n=t.onError;if(!n)throw new Error(e);n(e,i)}if(\"undefined\"!=typeof File&&e instanceof File){var u=new FileReader;return u.onload=function(){s(u.result)},u.onerror=function(){l(u.error)},u.readAsText(e)}return s(e),o}I.inject({importSVG:function(e,t){return P(e,t,this)}}),E.inject({importSVG:function(e,t){return this.activate(),P(e,t,this)}})},u.exports.PaperScript=function(){var e={\"+\":\"__add\",\"-\":\"__subtract\",\"*\":\"__multiply\",\"/\":\"__divide\",\"%\":\"__modulo\",\"==\":\"__equals\",\"!=\":\"__equals\"},t={\"-\":\"__negate\",\"+\":\"__self\"},i=u.each([\"add\",\"subtract\",\"multiply\",\"divide\",\"modulo\",\"equals\",\"negate\"],(function(e){this[\"__\"+e]=\"#\"+e}),{__self:function(){return this}});return b.inject(i),v.inject(i),V.inject(i),{calculateBinary:function(t,i,n){var o=e[i];if(t&&t[o]){var a=t[o](n);return\"!=\"===i?!a:a}switch(i){case\"+\":return t+n;case\"-\":return t-n;case\"*\":return t*n;case\"/\":return t/n;case\"%\":return t%n;case\"==\":return t==n;case\"!=\":return t!=n}},calculateUnary:function(e,i){var n=t[e];if(i&&i[n])return i[n]();switch(e){case\"+\":return+i;case\"-\":return-i}}}}.call(this);var le=new(d.inject(u.exports,{Base:u,Numerical:h,Key:te,DomEvent:Q,DomElement:K,document:l,window:s,Symbol:A,PlacedSymbol:N}));return le.agent.node&&i(1047)(le),(o=\"function\"==typeof(n=le)?n.call(t,i,t,e):n)===r||(e.exports=o),le}).call(this,\"object\"==typeof self?self:null)},function(e,t,i){var n;!function(){\"use strict\";var i={}.hasOwnProperty;function o(){for(var e=[],t=0;t-1}function E(e,t){for(var i=-1,n=t.length,o=e.length;++i2?O:void 0);function q(e,t,i,n,o){var a=-1,r=e.length;for(i||(i=ne),o||(o=[]);++a0&&i(s)?t>1?q(s,t-1,i,n,o):E(o,s):n||(o[o.length]=s)}return o}function Y(e){if(!ce(e)||function(e){return!!D&&D in e}(e))return!1;var t=ue(e)||function(e){var t=!1;if(null!=e&&\"function\"!=typeof e.toString)try{t=!!(e+\"\")}catch(e){}return t}(e)?z:h;return t.test(function(e){if(null!=e){try{return L.call(e)}catch(e){}try{return e+\"\"}catch(e){}}return\"\"}(e))}function Z(e,t){return t=G(void 0===t?e.length-1:t,0),function(){for(var i=arguments,n=-1,o=G(i.length-t,0),a=Array(o);++n1&&y.reverse(),c&&l1?\"& \":\"\")+t[n],t=t.join(i>2?\", \":\" \"),e.replace(c,\"{\\n/* [wrapped with \"+t+\"] */\\n\")}function ne(e){return le(e)||function(e){return function(e){return de(e)&&function(e){return null!=e&&function(e){return\"number\"==typeof e&&e>-1&&e%1==0&&e<=a}(e.length)&&!ue(e)}(e)}(e)&&R.call(e,\"callee\")&&(!F.call(e,\"callee\")||j.call(e)==l)}(e)||!!(H&&e&&e[H])}function oe(e,t){return!!(t=null==t?a:t)&&(\"number\"==typeof e||b.test(e))&&e>-1&&e%1==0&&e0&&void 0!==arguments[0]?arguments[0]:\"store\",i=arguments[1]||t+\"Subscription\",o=function(e){function o(i,n){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,o);var a=function(e,t){if(!e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!=typeof t&&\"function\"!=typeof t?e:t}(this,e.call(this,i,n));return a[t]=i.store,a}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,e),o.prototype.getChildContext=function(){var e;return(e={})[t]=this[t],e[i]=null,e},o.prototype.render=function(){return n.Children.only(this.props.children)},o}(n.Component);return o.propTypes={store:s.isRequired,children:a.a.element.isRequired},o.childContextTypes=((e={})[t]=s.isRequired,e[i]=r,e),o}(),u=i(450),c=i.n(u),d=i(120),p=i.n(d);var m=null,g={notify:function(){}};var h=function(){function e(t,i,n){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),this.store=t,this.parentSub=i,this.onStateChange=n,this.unsubscribe=null,this.listeners=g}return e.prototype.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},e.prototype.notifyNestedSubs=function(){this.listeners.notify()},e.prototype.isSubscribed=function(){return Boolean(this.unsubscribe)},e.prototype.trySubscribe=function(){var e,t;this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.onStateChange):this.store.subscribe(this.onStateChange),this.listeners=(e=[],t=[],{clear:function(){t=m,e=m},notify:function(){for(var i=e=t,n=0;n1&&void 0!==arguments[1]?arguments[1]:{},a=o.getDisplayName,l=void 0===a?function(e){return\"ConnectAdvanced(\"+e+\")\"}:a,u=o.methodName,d=void 0===u?\"connectAdvanced\":u,m=o.renderCountProp,g=void 0===m?void 0:m,k=o.shouldHandleStateChanges,w=void 0===k||k,T=o.storeKey,S=void 0===T?\"store\":T,M=o.withRef,E=void 0!==M&&M,I=function(e,t){var i={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n]);return i}(o,[\"getDisplayName\",\"methodName\",\"renderCountProp\",\"shouldHandleStateChanges\",\"storeKey\",\"withRef\"]),x=S+\"Subscription\",_=b++,O=((t={})[S]=s,t[x]=r,t),C=((i={})[x]=r,i);return function(t){p()(\"function\"==typeof t,\"You must pass a component to the function returned by \"+d+\". Instead received \"+JSON.stringify(t));var i=t.displayName||t.name||\"Component\",o=l(i),a=f({},I,{getDisplayName:l,methodName:d,renderCountProp:g,shouldHandleStateChanges:w,storeKey:S,withRef:E,displayName:o,wrappedComponentName:i,WrappedComponent:t}),r=function(i){function r(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,r);var n=function(e,t){if(!e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!=typeof t&&\"function\"!=typeof t?e:t}(this,i.call(this,e,t));return n.version=_,n.state={},n.renderCount=0,n.store=e[S]||t[S],n.propsMode=Boolean(e[S]),n.setWrappedInstance=n.setWrappedInstance.bind(n),p()(n.store,'Could not find \"'+S+'\" in either the context or props of \"'+o+'\". Either wrap the root component in a , or explicitly pass \"'+S+'\" as a prop to \"'+o+'\".'),n.initSelector(),n.initSubscription(),n}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,i),r.prototype.getChildContext=function(){var e,t=this.propsMode?null:this.subscription;return(e={})[x]=t||this.context[x],e},r.prototype.componentDidMount=function(){w&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},r.prototype.componentWillReceiveProps=function(e){this.selector.run(e)},r.prototype.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},r.prototype.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=v,this.store=null,this.selector.run=v,this.selector.shouldComponentUpdate=!1},r.prototype.getWrappedInstance=function(){return p()(E,\"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the \"+d+\"() call.\"),this.wrappedInstance},r.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},r.prototype.initSelector=function(){var t=e(this.store.dispatch,a);this.selector=function(e,t){var i={run:function(n){try{var o=e(t.getState(),n);(o!==i.props||i.error)&&(i.shouldComponentUpdate=!0,i.props=o,i.error=null)}catch(e){i.shouldComponentUpdate=!0,i.error=e}}};return i}(t,this.store),this.selector.run(this.props)},r.prototype.initSubscription=function(){if(w){var e=(this.propsMode?this.props:this.context)[x];this.subscription=new h(this.store,e,this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription)}},r.prototype.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(y)):this.notifyNestedSubs()},r.prototype.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},r.prototype.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},r.prototype.addExtraProps=function(e){if(!(E||g||this.propsMode&&this.subscription))return e;var t=f({},e);return E&&(t.ref=this.setWrappedInstance),g&&(t[g]=this.renderCount++),this.propsMode&&this.subscription&&(t[x]=this.subscription),t},r.prototype.render=function(){var e=this.selector;if(e.shouldComponentUpdate=!1,e.error)throw e.error;return Object(n.createElement)(t,this.addExtraProps(e.props))},r}(n.Component);return r.WrappedComponent=t,r.displayName=o,r.childContextTypes=C,r.contextTypes=O,r.propTypes=O,c()(r,t)}}var w=Object.prototype.hasOwnProperty;function T(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function S(e,t){if(T(e,t))return!0;if(\"object\"!=typeof e||null===e||\"object\"!=typeof t||null===t)return!1;var i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(var o=0;o=0||Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n]);return i}(t,[\"initMapStateToProps\",\"initMapDispatchToProps\",\"initMergeProps\"]),r=i(e,a),s=n(e,a),l=o(e,a);return(a.pure?D:P)(r,s,l,e,a)}var R=Object.assign||function(e){for(var t=1;t=0;n--){var o=t[n](e);if(o)return o}return function(t,n){throw new Error(\"Invalid value of type \"+typeof e+\" for \"+i+\" argument when connecting component \"+n.wrappedComponentName+\".\")}}function z(e,t){return e===t}var B=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.connectHOC,i=void 0===t?k:t,n=e.mapStateToPropsFactories,o=void 0===n?O:n,a=e.mapDispatchToPropsFactories,r=void 0===a?_:a,s=e.mergePropsFactories,l=void 0===s?A:s,u=e.selectorFactory,c=void 0===u?L:u;return function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=a.pure,u=void 0===s||s,d=a.areStatesEqual,p=void 0===d?z:d,m=a.areOwnPropsEqual,g=void 0===m?S:m,h=a.areStatePropsEqual,f=void 0===h?S:h,b=a.areMergedPropsEqual,y=void 0===b?S:b,v=function(e,t){var i={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n]);return i}(a,[\"pure\",\"areStatesEqual\",\"areOwnPropsEqual\",\"areStatePropsEqual\",\"areMergedPropsEqual\"]),k=j(e,o,\"mapStateToProps\"),w=j(t,r,\"mapDispatchToProps\"),T=j(n,l,\"mergeProps\");return i(c,R({methodName:\"connect\",getDisplayName:function(e){return\"Connect(\"+e+\")\"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:k,initMapDispatchToProps:w,initMergeProps:T,pure:u,areStatesEqual:p,areOwnPropsEqual:g,areStatePropsEqual:f,areMergedPropsEqual:y},v))}}()},function(e,t,i){\"use strict\";(function(e){var n=i(4),o=i.n(n),a=i(0),r=i.n(a),s=i(1),l=i.n(s),u=i(172),c=i.n(u),d=i(453),p=i.n(d);const m=[\"alignContent\",\"alignItems\",\"alignSelf\",\"basis\",\"children\",\"className\",\"componentRef\",\"direction\",\"element\",\"grow\",\"height\",\"justifyContent\",\"width\",\"wrap\",\"shrink\",\"style\"];function g(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function h(e,t,i){return(t=function(e){var t=function(e,t){if(\"object\"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||\"default\");if(\"object\"!=typeof n)return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(\"string\"===t?String:Number)(e)}(e,\"string\");return\"symbol\"==typeof t?t:t+\"\"}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const f=function(){const e=function(){let e=601,t=987654321;const i=4294967295;return function(){t=36969*(65535&t)+(t>>16)&i,e=18e3*(65535&e)+(e>>16)&i;let n=(t<<16)+e&i;return n/=4294967296,n+1}}();return function(){const t=Math.max(parseInt(100*e(),10)%256,1),i=Math.max(parseInt(100*e(),10)%256,1),n=Math.max(parseInt(100*e(),10)%256,1);return\"rgb(\".concat(t,\",\").concat(i,\",\").concat(n,\")\")}}(),b=t=>{const{alignContent:i,alignItems:n,alignSelf:a,basis:r,children:s,className:u,componentRef:c,direction:d,element:b,grow:y,height:v,justifyContent:k,width:w,wrap:T,shrink:S,style:M}=t,E=function(e,t){if(null==e)return{};var i,n,o=function(e,t){if(null==e)return{};var i={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;i[n]=e[n]}return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0&&d.splice(t,1)}function b(e){var t=document.createElement(\"style\");if(void 0===e.attrs.type&&(e.attrs.type=\"text/css\"),void 0===e.attrs.nonce){var n=function(){0;return i.nc}();n&&(e.attrs.nonce=n)}return y(t,e.attrs),h(e,t),t}function y(e,t){Object.keys(t).forEach((function(i){e.setAttribute(i,t[i])}))}function v(e,t){var i,n,o,a;if(t.transform&&e.css){if(!(a=\"function\"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=a}if(t.singleton){var r=c++;i=u||(u=b(t)),n=T.bind(null,i,r,!1),o=T.bind(null,i,r,!0)}else e.sourceMap&&\"function\"==typeof URL&&\"function\"==typeof URL.createObjectURL&&\"function\"==typeof URL.revokeObjectURL&&\"function\"==typeof Blob&&\"function\"==typeof btoa?(i=function(e){var t=document.createElement(\"link\");return void 0===e.attrs.type&&(e.attrs.type=\"text/css\"),e.attrs.rel=\"stylesheet\",y(t,e.attrs),h(e,t),t}(t),n=M.bind(null,i,t),o=function(){f(i),i.href&&URL.revokeObjectURL(i.href)}):(i=b(t),n=S.bind(null,i),o=function(){f(i)});return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else o()}}e.exports=function(e,t){if(\"undefined\"!=typeof DEBUG&&DEBUG&&\"object\"!=typeof document)throw new Error(\"The style-loader cannot be used in a non-browser environment\");(t=t||{}).attrs=\"object\"==typeof t.attrs?t.attrs:{},t.singleton||\"boolean\"==typeof t.singleton||(t.singleton=r()),t.insertInto||(t.insertInto=\"head\"),t.insertAt||(t.insertAt=\"bottom\");var i=g(e,t);return m(i,t),function(e){for(var n=[],o=0;oe===x.FETCHING_WITH_ID||e===x.FETCHING_NEW_DEFAULT,C=e=>e===x.LOADING_VM_WITH_ID||e===x.LOADING_VM_NEW_DEFAULT,N=e=>e===x.LOADING_VM_FILE_UPLOAD||e===x.LOADING_VM_WITH_ID||e===x.LOADING_VM_NEW_DEFAULT,A=e=>e===x.LOADING_VM_FILE_UPLOAD,P=e=>e===x.CREATING_NEW,D=e=>e===x.FETCHING_NEW_DEFAULT||e===x.LOADING_VM_NEW_DEFAULT||e===x.CREATING_NEW,L=e=>e===x.CREATING_COPY,R=e=>e===x.MANUAL_UPDATING,j=e=>e===x.REMIXING,z=e=>e===x.AUTO_UPDATING||e===x.MANUAL_UPDATING||e===x.UPDATING_BEFORE_COPY||e===x.UPDATING_BEFORE_NEW,B=e=>e===x.SHOWING_WITH_ID||e===x.SHOWING_WITHOUT_ID,U=e=>e===x.SHOWING_WITH_ID,F=e=>e===x.SHOWING_WITHOUT_ID,H=e=>e===x.ERROR,G={error:null,projectData:null,projectId:null,loadingState:x.NOT_LOADED},W=function(e,t){switch(void 0===e&&(e=G),t.type){case a:return e.loadingState===x.CREATING_NEW?Object.assign({},e,{loadingState:x.SHOWING_WITH_ID,projectId:t.projectId}):e;case s:return e.loadingState===x.FETCHING_WITH_ID?Object.assign({},e,{loadingState:x.LOADING_VM_WITH_ID,projectData:t.projectData}):e;case r:return e.loadingState===x.FETCHING_NEW_DEFAULT?Object.assign({},e,{loadingState:x.LOADING_VM_NEW_DEFAULT,projectData:t.projectData}):e;case c:return e.loadingState===x.LOADING_VM_FILE_UPLOAD||e.loadingState===x.LOADING_VM_NEW_DEFAULT?Object.assign({},e,{loadingState:x.SHOWING_WITHOUT_ID,projectId:I}):e;case u:return e.loadingState===x.LOADING_VM_WITH_ID?Object.assign({},e,{loadingState:x.SHOWING_WITH_ID}):e;case l:return e.loadingState===x.LOADING_VM_FILE_UPLOAD?Object.assign({},e,{loadingState:x.AUTO_UPDATING}):e;case d:return e.loadingState===x.REMIXING?Object.assign({},e,{loadingState:x.SHOWING_WITH_ID,projectId:t.projectId}):e;case o:return e.loadingState===x.CREATING_COPY?Object.assign({},e,{loadingState:x.SHOWING_WITH_ID,projectId:t.projectId}):e;case p:return e.loadingState===x.AUTO_UPDATING||e.loadingState===x.MANUAL_UPDATING?Object.assign({},e,{loadingState:x.SHOWING_WITH_ID}):e;case m:return e.loadingState===x.UPDATING_BEFORE_COPY?Object.assign({},e,{loadingState:x.CREATING_COPY}):e;case g:return e.loadingState===x.UPDATING_BEFORE_NEW?Object.assign({},e,{loadingState:x.FETCHING_NEW_DEFAULT,projectId:I}):e;case h:return null===e.projectId||e.projectId===I?Object.assign({},e,{loadingState:x.SHOWING_WITHOUT_ID,projectId:I}):Object.assign({},e,{loadingState:x.SHOWING_WITH_ID});case f:return e.projectId===t.projectId?e:e.loadingState===x.SHOWING_WITH_ID||e.loadingState!==x.SHOWING_WITHOUT_ID?t.projectId===I||null===t.projectId?Object.assign({},e,{loadingState:x.FETCHING_NEW_DEFAULT,projectId:I}):Object.assign({},e,{loadingState:x.FETCHING_WITH_ID,projectId:t.projectId}):t.projectId!==I&&null!==t.projectId?Object.assign({},e,{loadingState:x.FETCHING_WITH_ID,projectId:t.projectId}):e;case b:return e.loadingState===x.SHOWING_WITH_ID?Object.assign({},e,{loadingState:x.AUTO_UPDATING}):e;case y:return e.loadingState===x.SHOWING_WITHOUT_ID?Object.assign({},e,{loadingState:x.CREATING_NEW}):e;case k:return[x.SHOWING_WITH_ID,x.SHOWING_WITHOUT_ID].includes(e.loadingState)?Object.assign({},e,{loadingState:x.FETCHING_NEW_DEFAULT,projectId:I}):e;case w:return[x.NOT_LOADED,x.SHOWING_WITH_ID,x.SHOWING_WITHOUT_ID].includes(e.loadingState)?Object.assign({},e,{loadingState:x.LOADING_VM_FILE_UPLOAD}):e;case T:return e.loadingState===x.SHOWING_WITH_ID?Object.assign({},e,{loadingState:x.MANUAL_UPDATING}):e;case S:return e.loadingState===x.SHOWING_WITH_ID?Object.assign({},e,{loadingState:x.REMIXING}):e;case M:return e.loadingState===x.SHOWING_WITH_ID?Object.assign({},e,{loadingState:x.UPDATING_BEFORE_COPY}):e;case E:return e.loadingState===x.SHOWING_WITH_ID?Object.assign({},e,{loadingState:x.UPDATING_BEFORE_NEW}):e;case v:return[x.FETCHING_NEW_DEFAULT,x.FETCHING_WITH_ID,x.LOADING_VM_NEW_DEFAULT,x.LOADING_VM_WITH_ID].includes(e.loadingState)?Object.assign({},e,{loadingState:x.ERROR,error:t.error}):[x.AUTO_UPDATING,x.CREATING_COPY,x.MANUAL_UPDATING,x.REMIXING,x.UPDATING_BEFORE_COPY,x.UPDATING_BEFORE_NEW].includes(e.loadingState)?Object.assign({},e,{loadingState:x.SHOWING_WITH_ID,error:t.error}):e.loadingState===x.CREATING_NEW?e.projectId===I||null===e.projectId?Object.assign({},e,{loadingState:x.SHOWING_WITHOUT_ID,error:t.error}):Object.assign({},e,{loadingState:x.SHOWING_WITH_ID,error:t.error}):e;default:return e}},V=()=>({type:y}),q=(e,t)=>{switch(t){case x.CREATING_NEW:return{type:a,projectId:e};case x.CREATING_COPY:return{type:o,projectId:e};case x.REMIXING:return{type:d,projectId:e}}},Y=(e,t)=>{switch(t){case x.FETCHING_WITH_ID:return{type:s,projectData:e};case x.FETCHING_NEW_DEFAULT:return{type:r,projectData:e}}},Z=(e,t,i)=>{switch(e){case x.LOADING_VM_WITH_ID:return i?{type:u}:{type:h};case x.LOADING_VM_FILE_UPLOAD:return i?t?{type:l}:{type:c}:{type:h};case x.LOADING_VM_NEW_DEFAULT:return i?{type:c}:{type:v};default:return}},K=e=>{switch(e){case x.AUTO_UPDATING:case x.MANUAL_UPDATING:return{type:p};case x.UPDATING_BEFORE_COPY:return{type:m};case x.UPDATING_BEFORE_NEW:return{type:g}}},Q=e=>({type:v,error:e}),X=e=>({type:f,projectId:e}),J=e=>e?{type:E}:{type:k},$=e=>{switch(e){case x.NOT_LOADED:case x.SHOWING_WITH_ID:case x.SHOWING_WITHOUT_ID:return{type:w}}},ee=()=>({type:b}),te=()=>({type:T}),ie=()=>({type:M}),ne=()=>({type:S})},function(e,t,i){\"use strict\";i.d(t,\"r\",(function(){return S})),i.d(t,\"s\",(function(){return T})),i.d(t,\"t\",(function(){return I})),i.d(t,\"v\",(function(){return x})),i.d(t,\"x\",(function(){return _})),i.d(t,\"A\",(function(){return O})),i.d(t,\"D\",(function(){return C})),i.d(t,\"F\",(function(){return N})),i.d(t,\"E\",(function(){return A})),i.d(t,\"G\",(function(){return D})),i.d(t,\"u\",(function(){return P})),i.d(t,\"I\",(function(){return L})),i.d(t,\"C\",(function(){return R})),i.d(t,\"w\",(function(){return j})),i.d(t,\"B\",(function(){return z})),i.d(t,\"y\",(function(){return B})),i.d(t,\"H\",(function(){return U})),i.d(t,\"z\",(function(){return F})),i.d(t,\"a\",(function(){return H})),i.d(t,\"c\",(function(){return G})),i.d(t,\"e\",(function(){return W})),i.d(t,\"h\",(function(){return V})),i.d(t,\"m\",(function(){return Y})),i.d(t,\"k\",(function(){return Z})),i.d(t,\"l\",(function(){return K})),i.d(t,\"n\",(function(){return q})),i.d(t,\"o\",(function(){return Q})),i.d(t,\"b\",(function(){return X})),i.d(t,\"q\",(function(){return J})),i.d(t,\"j\",(function(){return $})),i.d(t,\"d\",(function(){return ee})),i.d(t,\"i\",(function(){return te})),i.d(t,\"f\",(function(){return ie})),i.d(t,\"p\",(function(){return ne})),i.d(t,\"g\",(function(){return oe}));const n=\"scratch-gui/modals/OPEN_MODAL\",o=\"scratch-gui/modals/CLOSE_MODAL\",a=\"backdropLibrary\",r=\"costumeLibrary\",s=\"extensionLibrary\",l=\"loadingProject\",u=\"telemetryModal\",c=\"soundLibrary\",d=\"spriteLibrary\",p=\"soundRecorder\",m=\"connectionModal\",g=\"tipsLibrary\",h=\"usernameModal\",f=\"settingsModal\",b=\"customExtensionModal\",y=\"restorePointModal\",v=\"fontsModal\",k=\"unknownPlatformModal\",w=\"invalidProjectModal\",T={[a]:!1,[r]:!1,[s]:!1,[l]:!1,[u]:!1,[c]:!1,[d]:!1,[p]:!1,[m]:!1,[g]:!1,[h]:!1,[f]:!1,[b]:!1,[y]:!1,[v]:!1,[k]:!1,[w]:!1},S=function(e,t){switch(void 0===e&&(e=T),t.type){case n:return Object.assign({},e,{[t.modal]:!0});case o:return Object.assign({},e,{[t.modal]:!1});default:return e}},M=function(e){return{type:n,modal:e}},E=function(e){return{type:o,modal:e}},I=function(){return M(a)},x=function(){return M(r)},_=function(){return M(s)},O=function(){return M(l)},C=function(){return M(c)},N=function(){return M(d)},A=function(){return M(p)},P=function(){return M(m)},D=function(){return M(g)},L=function(){return M(h)},R=function(){return M(f)},j=function(){return M(b)},z=function(){return M(y)},B=function(){return M(v)},U=function(){return M(k)},F=function(){return M(w)},H=function(){return E(a)},G=function(){return E(r)},W=function(){return E(s)},V=function(){return E(l)},q=function(){return E(u)},Y=function(){return E(d)},Z=function(){return E(c)},K=function(){return E(p)},Q=function(){return E(g)},X=function(){return E(m)},J=function(){return E(h)},$=function(){return E(f)},ee=function(){return E(b)},te=function(){return E(y)},ie=function(){return E(v)},ne=function(){return E(k)},oe=function(){return E(w)}},function(e,t,i){var n;!function(){\"use strict\";var i={}.hasOwnProperty;function o(){for(var e=[],t=0;t(e=>{let t,i,n,o,a;const r=e[0]/255,s=e[1]/255,l=e[2]/255,u=Math.max(r,s,l),c=u-Math.min(r,s,l),d=e=>(u-e)/6/c+.5;return 0===c?(o=0,a=0):(a=c/u,t=d(r),i=d(s),n=d(l),r===u?o=n-i:s===u?o=1/3+t-n:l===u&&(o=2/3+i-t),o<0?o+=1:o>1&&(o-=1)),[360*o,100*a,100*u]})((e=>{const t=Number.parseInt(e.substring(1),16);return[t>>16&255,t>>8&255,255&t]})(e)),L=e=>(e=>{const t=e[0]<<16|e[1]<<8|e[2];return\"#\".concat(t.toString(16).padStart(6,\"0\"))})((e=>{const t=e[0]/60,i=e[1]/100;let n=e[2]/100;const o=Math.floor(t)%6,a=t-Math.floor(t),r=255*n*(1-i),s=255*n*(1-i*a),l=255*n*(1-i*(1-a));switch(n*=255,o){case 0:return[n,l,r];case 1:return[s,n,r];case 2:return[r,n,l];case 3:return[r,s,n];case 4:return[l,r,n];case 5:return[n,r,s]}})(e)),R={music:{blockIconURI:E.a},pen:{blockIconURI:x.a},text2speech:{blockIconURI:O.a},translate:{blockIconURI:N.a},videoSensing:{blockIconURI:P.a}},j=(e,t,i)=>Math.max(t,Math.min(i,e)),z={primary:e=>{const t=D(e);return t[1]=j(t[1]-20,0,50),t[2]=j(t[2]+20,80,100),L(t)},secondary:e=>{const t=D(e);return t[1]=j(t[1]-40,0,50),t[2]=j(t[2]+20,80,100),L(t)},tertiary:e=>{const t=D(e);return t[2]=j(t[2]-20,0,100),L(t)},quaternary:e=>{const t=D(e);return t[1]=j(t[1]-60,0,100),t[2]=j(t[2]+20,90,100),L(t)},categoryIconBackground:e=>z.primary(e),categoryIconBorder:e=>z.tertiary(e)},B={primary:e=>{const t=D(e);return t[2]=Math.max(t[2]-70,20),L(t)},secondary:()=>\"#4C4C4C\",tertiary:e=>e,quaternary:e=>e,categoryIconBackground:e=>B.primary(e),categoryIconBorder:e=>B.tertiary(e)};var U;function F(e,t,i){return(t=function(e){var t=function(e,t){if(\"object\"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||\"default\");if(\"object\"!=typeof n)return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(\"string\"===t?String:Number)(e)}(e,\"string\");return\"symbol\"==typeof t?t:t+\"\"}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const H=\"purple\",G=\"blue\",W=\"red\",V=\"rainbow\",q={[H]:n,[G]:o,[W]:a,[V]:r},Y=W,Z=\"light\",K=\"dark\",Q={[Z]:s,[K]:l},X=Z,J=\"three\",$=\"dark\",ee=\"high-contrast\",te=\"custom\",ie=J,ne=S,oe={[J]:{blocksMediaFolder:\"blocks-media/default\",colors:S,extensions:{},customExtensionColors:{},useForStage:!0},[ee]:{blocksMediaFolder:\"blocks-media/high-contrast\",colors:c()({},{motion:{primary:\"#80B5FF\",secondary:\"#B3D2FF\",tertiary:\"#3373CC\",quaternary:\"#CCE1FF\"},looks:{primary:\"#CCB3FF\",secondary:\"#DDCCFF\",tertiary:\"#774DCB\",quaternary:\"#EEE5FF\"},sounds:{primary:\"#E19DE1\",secondary:\"#FFB3FF\",tertiary:\"#BD42BD\",quaternary:\"#FFCCFF\"},control:{primary:\"#FFBE4C\",secondary:\"#FFDA99\",tertiary:\"#CF8B17\",quaternary:\"#FFE3B3\"},event:{primary:\"#FFD966\",secondary:\"#FFECB3\",tertiary:\"#CC9900\",quaternary:\"#FFF2CC\"},sensing:{primary:\"#85C4E0\",secondary:\"#AED8EA\",tertiary:\"#2E8EB8\",quaternary:\"#C2E2F0\"},pen:{primary:\"#13ECAF\",secondary:\"#75F0CD\",tertiary:\"#0B8E69\",quaternary:\"#A3F5DE\"},operators:{primary:\"#7ECE7E\",secondary:\"#B5E3B5\",tertiary:\"#389438\",quaternary:\"#DAF1DA\"},data:{primary:\"#FFA54C\",secondary:\"#FFCC99\",tertiary:\"#DB6E00\",quaternary:\"#FFE5CC\"},data_lists:{primary:\"#FF9966\",secondary:\"#FFCAB0\",tertiary:\"#E64D00\",quaternary:\"#FFDDCC\"},more:{primary:\"#FF99AA\",secondary:\"#FFCCD5\",tertiary:\"#FF3355\",quaternary:\"#FFE5EA\"},addons:{primary:\"#34e4d0\",secondary:\"#71e2d5\",tertiary:\"#29b2a2\",quaternary:\"#9ee2db\"},text:\"#000000\",textFieldText:\"#000000\",toolboxText:\"#000000\",blackText:\"#000000\",toolboxHover:\"#3373CC\",insertionMarker:\"#000000\",insertionMarkerOpacity:.2,fieldShadow:\"rgba(255, 255, 255, 0.3)\",dragShadowOpacity:.6,menuHover:\"rgba(255, 255, 255, 0.3)\"},ne),extensions:R,customExtensionColors:z,useForStage:!0},[$]:{blocksMediaFolder:\"blocks-media/default\",colors:c()({},{motion:{primary:\"#0F1E33\",secondary:\"#4C4C4C\",tertiary:\"#4C97FF\",quaternary:\"#4C97FF\"},looks:{primary:\"#1E1433\",secondary:\"#4C4C4C\",tertiary:\"#9966FF\",quaternary:\"#9966FF\"},sounds:{primary:\"#291329\",secondary:\"#4C4C4C\",tertiary:\"#CF63CF\",quaternary:\"#CF63CF\"},control:{primary:\"#332205\",secondary:\"#4C4C4C\",tertiary:\"#FFAB19\",quaternary:\"#FFAB19\"},event:{primary:\"#332600\",secondary:\"#4C4C4C\",tertiary:\"#FFBF00\",quaternary:\"#FFBF00\"},sensing:{primary:\"#12232A\",secondary:\"#4C4C4C\",tertiary:\"#5CB1D6\",quaternary:\"#5CB1D6\"},pen:{primary:\"#03251C\",secondary:\"#4C4C4C\",tertiary:\"#0fBD8C\",quaternary:\"#0fBD8C\"},operators:{primary:\"#112611\",secondary:\"#4C4C4C\",tertiary:\"#59C059\",quaternary:\"#59C059\"},data:{primary:\"#331C05\",secondary:\"#4C4C4C\",tertiary:\"#FF8C1A\",quaternary:\"#FF8C1A\"},data_lists:{primary:\"#331405\",secondary:\"#4C4C4C\",tertiary:\"#FF661A\",quaternary:\"#FF661A\"},more:{primary:\"#331419\",secondary:\"#4C4C4C\",tertiary:\"#FF6680\",quaternary:\"#FF6680\"},addons:{primary:\"#0b3331\",secondary:\"#4C4C4C\",tertiary:\"#34e4d0\",quaternary:\"#34e4d0\"},text:\"rgba(255, 255, 255, .7)\",textFieldText:\"#E5E5E5\",textField:\"#4C4C4C\",menuHover:\"rgba(255, 255, 255, 0.3)\"},ne),extensions:{},customExtensionColors:B,useForStage:!1},[te]:{blocksMediaFolder:\"blocks-media/default\",colors:S,extensions:{},customExtensionColors:{},useForStage:!1}};let ae=0;class re{constructor(e,t,i){this.id=++ae,this.accent=Object.prototype.hasOwnProperty.call(q,e)?e:Y,this.gui=Object.prototype.hasOwnProperty.call(Q,t)?t:X,this.blocks=Object.prototype.hasOwnProperty.call(oe,i)?i:ie}set(e,t){if(\"accent\"===e)return new re(t,this.gui,this.blocks);if(\"gui\"===e)return new re(this.accent,t,this.blocks);if(\"blocks\"===e)return new re(this.accent,this.gui,t);throw new Error(\"Unknown theme property: \".concat(e))}getBlocksMediaFolder(){return oe[this.blocks].blocksMediaFolder}getGuiColors(){return c()({},q[this.accent].guiColors,Q[this.gui].guiColors,v)}getBlockColors(){return c()({},q[this.accent].blockColors,Q[this.gui].blockColors,oe[this.blocks].colors)}getExtensions(){return oe[this.blocks].extensions}isDark(){return\"dark\"===this.getGuiColors()[\"color-scheme\"]}getStageBlockColors(){return oe[this.blocks].useForStage?this.getBlockColors():re.light.getBlockColors()}getCustomExtensionColors(){return oe[this.blocks].customExtensionColors}}F(re,\"light\",new(U=re)(Y,Z,ie)),F(re,\"dark\",new U(Y,K,ie)),F(re,\"highContrast\",new U(Y,X,ee))},function(e,t,i){var n=i(1072);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){\"use strict\";i.d(t,\"a\",(function(){return s})),i.d(t,\"c\",(function(){return c})),i.d(t,\"d\",(function(){return r})),i.d(t,\"e\",(function(){return a})),i.d(t,\"b\",(function(){return l})),i.d(t,\"f\",(function(){return u}));var n=i(44),o=i.n(n);const a=o()({large:null,small:null,full:null}),r=o()({large:null,small:null,constrained:null,full:null}),s=.675,l=480,u=1096-l,c={[r.large]:{width:l},[r.small]:{width:.5*l},[r.constrained]:{scale:.85},[r.full]:{scale:1}}},function(e,t,i){var n=i(1214);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){\"use strict\";t.__esModule=!0;var n,o=i(264),a=(n=o)&&n.__esModule?n:{default:n};t.default=a.default||function(e){for(var t=1;t[e,...e.descendants()]))}siblings(){return this.parent?this.parent.children.filter((e=>e.id!==this.id)):[]}findById(e){if(this.id===e)return this;for(const t of this.children){const i=t.findById(e);if(i)return i}return null}}const k=new v(\"root\").addChild(new v(y)).addChild(new v(h).addChild(new v(p)).addChild(new v(f)).addChild(new v(b))).addChild(new v(d)).addChild(new v(c)).addChild(new v(g)).addChild(new v(h)).addChild(new v(m)).addChild(new v(u)).addChild(new v(l)),w={[l]:!1,[u]:!1,[c]:!1,[d]:!1,[p]:!1,[m]:!1,[g]:!1,[h]:!1,[f]:!1,[b]:!1,[y]:!1},T=function(e,t){switch(void 0===e&&(e=w),t.type){case r:{const i=k.findById(t.menu).siblings().flatMap((e=>[e,...e.descendants()]));return o(o({},e),{},{[t.menu]:!0},Object.fromEntries(i.map((e=>{let{id:t}=e;return[t,!1]}))))}case s:{const i=k.findById(t.menu),n=[i,...i.descendants()];return o(o({},e),Object.fromEntries(n.map((e=>{let{id:t}=e;return[t,!1]}))))}default:return e}},S=e=>({type:r,menu:e}),M=e=>({type:s,menu:e}),E=()=>S(l),I=()=>M(l),x=e=>e.scratchGui.menus[l],_=()=>S(u),O=()=>M(u),C=e=>e.scratchGui.menus[u],N=()=>S(c),A=()=>M(c),P=e=>e.scratchGui.menus[c],D=()=>S(d),L=()=>M(d),R=e=>e.scratchGui.menus[d],j=()=>S(p),z=e=>e.scratchGui.menus[p],B=()=>S(m),U=()=>M(m),F=e=>e.scratchGui.menus[m],H=()=>S(g),G=()=>M(g),W=e=>e.scratchGui.menus[g],V=()=>S(h),q=()=>M(h),Y=e=>e.scratchGui.menus[h],Z=()=>S(f),K=e=>e.scratchGui.menus[f],Q=()=>S(b),X=e=>e.scratchGui.menus[b],J=()=>S(y),$=()=>M(y),ee=e=>e.scratchGui.menus[y]},function(e,t,i){var n=i(1099);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){\"use strict\";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}},function(e,t,i){\"use strict\";i.d(t,\"d\",(function(){return m})),i.d(t,\"a\",(function(){return c})),i.d(t,\"b\",(function(){return g})),i.d(t,\"c\",(function(){return h})),i.d(t,\"e\",(function(){return p})),i.d(t,\"f\",(function(){return d})),i.d(t,\"g\",(function(){return y})),i.d(t,\"h\",(function(){return b})),i.d(t,\"i\",(function(){return f}));var n=i(67),o=i(101);const a=\"scratch-gui/alerts/SHOW_ALERT\",r=\"scratch-gui/alerts/SHOW_EXTENSION_ALERT\",s=\"scratch-gui/alerts/CLOSE_ALERT\",l=\"scratch-gui/alerts/CLOSE_ALERTS_WITH_ID\",u=\"scratch-gui/alerts/CLOSE_ALERT_WITH_ID\",c={visible:!0,alertsList:[]},d=e=>e.filter((e=>e.alertType===n.b.STANDARD||e.alertType===n.b.EXTENSION)),p=e=>e.filter((e=>e.alertType===n.b.INLINE)),m=function(e,t){switch(void 0===e&&(e=c),t.type){case a:{const i=t.alertId;if(i){const o={alertId:i,level:n.a.WARN},a=n.c.find((e=>e.alertId===i));if(a){const i=e.alertsList.filter((e=>!a.clearList||-1===a.clearList.indexOf(e.alertId)));return t.data&&t.data.message&&(o.message=t.data.message),o.alertType=a.alertType||n.b.STANDARD,o.closeButton=a.closeButton,o.content=a.content,o.iconURL=a.iconURL,o.iconSpinner=a.iconSpinner,o.level=a.level,o.showDownload=a.showDownload,o.showSaveNow=a.showSaveNow,i.push(o),Object.assign({},e,{alertsList:i})}}return e}case r:{const i=t.data.extensionId;if(i){const t=o.a.find((e=>e.extensionId===i));if(t){const o=e.alertsList.slice(),a={alertType:n.b.EXTENSION,closeButton:!0,extensionId:i,extensionName:t.name,iconURL:t.connectionSmallIconURL,level:n.a.WARN,showReconnect:!0};return o.push(a),Object.assign({},e,{alertsList:o})}}return e}case u:case s:{if(t.alertId&&(t.index=e.alertsList.findIndex((e=>e.alertId===t.alertId)),-1===t.index))return e;const i=e.alertsList.slice();return i.splice(t.index,1),Object.assign({},e,{alertsList:i})}case l:return Object.assign({},e,{alertsList:e.alertsList.filter((e=>e.alertId!==t.alertId))});default:return e}},g=function(e){return{type:s,index:e}},h=function(e){return{type:u,alertId:e}},f=function(e){return{type:a,alertId:e}},b=function(e){return{type:r,data:e}},y=function(e,t){const i=n.c.find((e=>e.alertId===t));i&&(e(f(t)),i.maxDisplaySecs&&setTimeout((()=>{e(function(e){return{type:l,alertId:e}}(t))}),1e3*i.maxDisplaySecs))}},function(e,t,i){var n=i(1248);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){\"use strict\";t.__esModule=!0;var n,o=i(431),a=(n=o)&&n.__esModule?n:{default:n};t.default=function(){function e(e,t){for(var i=0;ie.defaultMessage;var p=e=>{const t=e||d;return{targets:[{isStage:!0,name:\"Stage\",variables:{\"`jEk@4|i[#Fk?(8x)AV.-my variable\":[t(c.variable),0]},lists:{},broadcasts:{},blocks:{},currentCostume:0,costumes:[{assetId:\"cd21514d0531fdffb22204e0ec5ed84a\",name:t(c.backdrop,{index:1}),md5ext:\"cd21514d0531fdffb22204e0ec5ed84a.svg\",dataFormat:\"svg\",rotationCenterX:240,rotationCenterY:180}],sounds:[],volume:100},{isStage:!1,name:t(c.sprite,{index:1}),variables:{},lists:{},broadcasts:{},blocks:{},comments:{},currentCostume:0,costumes:[{assetId:\"927d672925e7b99f7813735c484c6922\",name:t(c.costume,{index:1}),bitmapResolution:1,md5ext:\"927d672925e7b99f7813735c484c6922.svg\",dataFormat:\"svg\",rotationCenterX:30.74937882782359,rotationCenterY:58.864768144346826}],sounds:[],volume:100,visible:!0,x:0,y:0,size:100,direction:90,draggable:!1,rotationStyle:\"all around\"}],meta:{semver:\"3.0.0\",vm:\"0.1.0\",agent:\"\"}}},m=i(339),g=i.n(m),h=i(456),f=i.n(h),b=i(457),y=i.n(b),v=i(111);var k=e=>{if(g.a.byteLength>0)return[{id:0,assetType:\"Project\",dataFormat:\"JSON\",data:g.a}];let t;t=void 0===v.TextEncoder?i(111).TextEncoder:v.TextEncoder;const n=new t,o=p(e);return[{id:0,assetType:\"Project\",dataFormat:\"JSON\",data:JSON.stringify(o)},{id:\"cd21514d0531fdffb22204e0ec5ed84a\",assetType:\"ImageVector\",dataFormat:\"SVG\",data:n.encode(f.a)},{id:\"927d672925e7b99f7813735c484c6922\",assetType:\"ImageVector\",dataFormat:\"SVG\",data:n.encode(y.a)}]};class w extends o.a{constructor(){super(),this.cacheDefaultProject()}addOfficialScratchWebStores(){this.addWebStore([this.AssetType.Project],this.getProjectGetConfig.bind(this),this.getProjectCreateConfig.bind(this),this.getProjectUpdateConfig.bind(this)),this.addWebStore([this.AssetType.ImageVector,this.AssetType.ImageBitmap,this.AssetType.Sound,this.AssetType.Font],this.getAssetGetConfig.bind(this),this.getAssetCreateConfig.bind(this),this.getAssetCreateConfig.bind(this))}setProjectHost(e){this.projectHost=e}setProjectToken(e){this.projectToken=e}getProjectGetConfig(e){return\"\".concat(this.projectHost,\"/\").concat(e.assetId)+(this.projectToken?\"?token=\".concat(this.projectToken):\"\")}getProjectCreateConfig(){return{url:\"\".concat(this.projectHost,\"/\"),withCredentials:!0}}getProjectUpdateConfig(e){return{url:\"\".concat(this.projectHost,\"/\").concat(e.assetId),withCredentials:!0}}setAssetHost(e){this.assetHost=e}getAssetGetConfig(e){return\"\".concat(this.assetHost,\"/internalapi/asset/\").concat(e.assetId,\".\").concat(e.dataFormat,\"/get/\")}getAssetCreateConfig(e){return{method:\"post\",url:\"\".concat(this.assetHost,\"/\").concat(e.assetId,\".\").concat(e.dataFormat),withCredentials:!0}}setTranslatorFunction(e){this.translator=e,this.cacheDefaultProject()}cacheDefaultProject(){k(this.translator).forEach((e=>this.builtinHelper._store(this.AssetType[e.assetType],this.DataFormat[e.dataFormat],e.data,e.id)))}}const T=new w;t.a=T},function(e,t,i){var n=i(1082);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){\"use strict\";t.a={SANS_SERIF:\"Sans Serif\",SERIF:\"Serif\",HANDWRITING:\"Handwriting\",MARKER:\"Marker\",CURLY:\"Curly\",PIXEL:\"Pixel\",MOPED_LIKE:\"Scratch\",CHINESE:'\"Microsoft YaHei\", \"微软雅黑\", STXihei, \"华文细黑\"',JAPANESE:'\"ヒラギノ角ゴ Pro W3\", \"Hiragino Kaku Gothic Pro\", Osaka, \"メイリオ\", Meiryo, \"MS Pゴシック\", \"MS PGothic\"',KOREAN:\"Malgun Gothic\"}},function(e,t,i){\"use strict\";t.__esModule=!0;var n,o=i(432),a=(n=o)&&n.__esModule?n:{default:n};t.default=function(e,t){if(!e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!==(void 0===t?\"undefined\":(0,a.default)(t))&&\"function\"!=typeof t?e:t}},function(e,t,i){\"use strict\";i.d(t,\"c\",(function(){return S})),i.d(t,\"t\",(function(){return T})),i.d(t,\"k\",(function(){return M})),i.d(t,\"n\",(function(){return E})),i.d(t,\"g\",(function(){return I})),i.d(t,\"q\",(function(){return x})),i.d(t,\"r\",(function(){return _})),i.d(t,\"e\",(function(){return O})),i.d(t,\"m\",(function(){return C})),i.d(t,\"i\",(function(){return N})),i.d(t,\"d\",(function(){return A})),i.d(t,\"h\",(function(){return P})),i.d(t,\"a\",(function(){return D})),i.d(t,\"b\",(function(){return L})),i.d(t,\"j\",(function(){return R})),i.d(t,\"s\",(function(){return j})),i.d(t,\"l\",(function(){return z})),i.d(t,\"f\",(function(){return B})),i.d(t,\"o\",(function(){return U})),i.d(t,\"p\",(function(){return F}));const n=\"tw/SET_FRAMERATE\",o=\"tw/SET_INTERPOLATION\",a=\"tw/SET_COMPILER_OPTIONS\",r=\"tw/SET_RUNTIME_OPTIONS\",s=\"tw/SET_USERNAME\",l=\"tw/SET_CLOUD\",u=\"tw/SET_HIGH_QUALITY_PEN\",c=\"tw/SET_WINDOW_FULLSCREEN\",d=\"tw/SET_DIMENSIONS\",p=\"tw/SET_AUTHOR\",m=\"tw/SET_DESCRIPTION\",g=\"tw/ADD_COMPILE_ERROR\",h=\"tw/CLEAR_COMPILE_ERRORS\",f=\"tw/SET_FILE_HANDLE\",b=\"tw/SET_USERNAME_INVALID\",y=\"tw/SET_HAS_CLOUD_VARIABLES\",v=\"tw/SET_CLOUD_HOST\",k=\"tw/SET_PLATFORM_MISMATCH_DETAILS\",w=\"tw/SET_PROJECT_ERROR\",T={framerate:30,interpolation:!1,cloud:!0,username:\"\",highQualityPen:!1,compilerOptions:{enabled:!0,warpTimer:!1},runtimeOptions:{maxClones:300,miscLimits:!0,fencing:!0},isWindowFullScreen:!1,dimensions:[0,0],author:{username:\"\",thumbnail:\"\"},description:{instructions:\"\",credits:\"\"},compileErrors:[],fileHandle:null,usernameInvalid:!1,hasCloudVariables:!1,cloudHost:\"\",platformMismatchDetails:{platform:null,callback:null},projectError:null},S=function(e,t){switch(void 0===e&&(e=T),t.type){case n:return Object.assign({},e,{framerate:t.framerate});case o:return Object.assign({},e,{interpolation:t.interpolation});case a:return Object.assign({},e,{compilerOptions:t.compilerOptions});case r:return Object.assign({},e,{runtimeOptions:t.runtimeOptions});case s:return Object.assign({},e,{username:t.username});case l:return Object.assign({},e,{cloud:t.cloud});case u:return Object.assign({},e,{highQualityPen:t.highQualityPen});case c:return Object.assign({},e,{isWindowFullScreen:t.isWindowFullScreen});case d:return Object.assign({},e,{dimensions:t.dimensions});case p:return Object.assign({},e,{author:t.author});case m:return Object.assign({},e,{description:t.description});case g:return Object.assign({},e,{compileErrors:[t.error,...e.compileErrors.slice(0,7)]});case h:return Object.assign({},e,{compileErrors:[]});case f:return Object.assign({},e,{fileHandle:t.fileHandle});case b:return Object.assign({},e,{usernameInvalid:t.usernameInvalid});case y:return Object.assign({},e,{hasCloudVariables:t.hasCloudVariables});case v:return Object.assign({},e,{cloudHost:t.cloudHost});case k:return Object.assign({},e,{platformMismatchDetails:{platform:t.platform,callback:t.callback}});case w:return Object.assign({},e,{projectError:t.projectError});default:return e}},M=function(e){return{type:n,framerate:e}},E=function(e){return{type:o,interpolation:e}},I=function(e){return{type:a,compilerOptions:e}},x=function(e){return{type:r,runtimeOptions:e}},_=function(e){return{type:s,username:e}},O=function(e){return{type:l,cloud:e}},C=function(e){return{type:u,highQualityPen:e}},N=function(e){return{type:d,dimensions:e}},A=function(e){return{type:p,author:e}},P=function(e){return{type:m,description:e}},D=function(e){return{type:g,error:e}},L=function(){return{type:h}},R=function(e){return{type:f,fileHandle:e}},j=function(e){return{type:b,usernameInvalid:e}},z=function(e){return{type:y,hasCloudVariables:e}},B=function(e){return{type:v,cloudHost:e}},U=function(e,t){return{type:k,platform:e,callback:t}},F=function(e){return{type:w,projectError:e}}},function(e,t,i){var n=i(1141);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1218);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){\"use strict\";i.d(t,\"e\",(function(){return l})),i.d(t,\"f\",(function(){return s})),i.d(t,\"d\",(function(){return u})),i.d(t,\"a\",(function(){return o})),i.d(t,\"b\",(function(){return a})),i.d(t,\"c\",(function(){return r}));const n=\"scratch-gui/navigation/ACTIVATE_TAB\",o=0,a=1,r=2,s={activeTabIndex:o},l=function(e,t){return void 0===e&&(e=s),t.type===n?Object.assign({},e,{activeTabIndex:t.activeTabIndex}):e},u=function(e){return{type:n,activeTabIndex:e}}},function(e,t,i){var n=i(1097);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1019);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){const n=i(715);n.enable(),e.exports=n(\"vm\")},function(e,t){e.exports={APP_NAME:\"TurboWarp\"}},function(e,t,i){e.exports={default:i(1142),__esModule:!0}},function(e,t,i){\"use strict\";t.__esModule=!0;var n=r(i(1165)),o=r(i(1169)),a=r(i(432));function r(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function, not \"+(void 0===t?\"undefined\":(0,a.default)(t)));e.prototype=(0,o.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(n.default?(0,n.default)(e,t):e.__proto__=t)}},function(e,t,i){var n=i(1089);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){\"use strict\";var n=i(5),o=i.n(n),a=i(0),r=i.n(a),s=i(1),l=i.n(s),u=i(6),c=i(4),d=i.n(c),p=i(96),m=i.n(p),g=i(2),h=i(7),f=i(52),b=i(112),y=i(248),v=i.n(y),k=i(493),w=i.n(k),T=i(82),S=i.n(T);const M=e=>l.a.createElement(m.a,{isOpen:!0,className:d()(S.a.modalContent,e.className,{[S.a.fullScreen]:e.fullScreen}),contentLabel:e.contentLabel,overlayClassName:S.a.modalOverlay,onRequestClose:e.onRequestClose},l.a.createElement(h.a,{dir:e.isRtl?\"rtl\":\"ltr\",direction:\"column\",grow:1},l.a.createElement(\"div\",{className:d()(S.a.header,e.headerClassName)},e.onHelp?l.a.createElement(\"div\",{className:d()(S.a.headerItem,S.a.headerItemHelp)},l.a.createElement(f.a,{className:S.a.helpButton,iconSrc:w.a,onClick:e.onHelp},l.a.createElement(g.b,{defaultMessage:\"Help\",id:\"gui.modal.help\"}))):null,l.a.createElement(\"div\",{className:d()(S.a.headerItem,S.a.headerItemTitle)},e.headerImage?l.a.createElement(\"img\",{className:S.a.headerImage,src:e.headerImage,draggable:!1}):null,e.contentLabel),l.a.createElement(\"div\",{className:d()(S.a.headerItem,S.a.headerItemClose)},e.fullScreen?l.a.createElement(f.a,{className:S.a.backButton,iconSrc:v.a,onClick:e.onRequestClose},l.a.createElement(g.b,{defaultMessage:\"Back\",id:\"gui.modal.back\"})):l.a.createElement(b.a,{size:b.a.SIZE_LARGE,onClick:e.onRequestClose}))),e.children));M.propTypes={children:r.a.node,className:r.a.string,contentLabel:r.a.oneOfType([r.a.string,r.a.object]).isRequired,fullScreen:r.a.bool,headerClassName:r.a.string,headerImage:r.a.string,isRtl:r.a.bool,onHelp:r.a.func,onRequestClose:r.a.func};var E=M;class I extends l.a.Component{constructor(e){super(e),o()(this,[\"addEventListeners\",\"removeEventListeners\",\"handlePopState\",\"pushHistory\"]),this.addEventListeners()}componentDidMount(){this.pushHistory(this.id,null===history.state||history.state!==this.id)}componentWillUnmount(){this.removeEventListeners()}addEventListeners(){window.addEventListener(\"popstate\",this.handlePopState)}removeEventListeners(){window.removeEventListener(\"popstate\",this.handlePopState)}handlePopState(){this.props.onRequestClose()}get id(){return\"modal-\".concat(this.props.id)}pushHistory(e,t){if(t)return history.pushState(e,this.id,null);history.replaceState(e,this.id,null)}render(){return l.a.createElement(E,this.props)}}I.propTypes={id:r.a.string.isRequired,isRtl:r.a.bool,onRequestClose:r.a.func,onRequestOpen:r.a.func};t.a=Object(u.b)((e=>({isRtl:e.locales.isRtl})))(I)},function(e,t,i){\"use strict\";e.exports=function(e){var t,i={};if(!(e instanceof Object)||Array.isArray(e))throw new Error(\"keyMirror(...): Argument must be an object.\");for(t in e)e.hasOwnProperty(t)&&(i[t]=t);return i}},function(e,t){e.exports={BOOLEAN:\"Boolean\",BUTTON:\"button\",LABEL:\"label\",COMMAND:\"command\",CONDITIONAL:\"conditional\",EVENT:\"event\",HAT:\"hat\",LOOP:\"loop\",REPORTER:\"reporter\",XML:\"xml\"}},function(e,t,i){const n=i(190),o=e=>{if(\"string\"!=typeof e)return!1;for(let t=0;tn?1:0}return i===1/0&&n===1/0||i===-1/0&&n===-1/0?0:i-n}static isInt(e){return\"number\"==typeof e?!!isNaN(e)||e===Math.floor(e):\"boolean\"==typeof e||\"string\"==typeof e&&e.indexOf(\".\")<0}static get LIST_INVALID(){return\"INVALID\"}static get LIST_ALL(){return\"ALL\"}static toListIndex(e,t,i){if(\"number\"!=typeof e){if(\"all\"===e)return i?a.LIST_ALL:a.LIST_INVALID;if(\"last\"===e)return t>0?t:a.LIST_INVALID;if(\"random\"===e||\"any\"===e)return t>0?1+Math.floor(Math.random()*t):a.LIST_INVALID}return(e=Math.floor(a.toNumber(e)))<1||e>t?a.LIST_INVALID:e}}e.exports=a},function(e,t,i){var n=i(1095);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1106);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1247);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1251);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1079);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){\"use strict\";var n=i(4),o=i.n(n),a=i(0),r=i.n(a),s=i(1),l=i.n(s),u=i(272),c=i.n(u);const d=[\"className\",\"disabled\",\"iconClassName\",\"iconSrc\",\"iconWidth\",\"iconHeight\",\"onClick\",\"children\"];function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{className:t,disabled:i,iconClassName:n,iconSrc:a,iconWidth:r,iconHeight:s,onClick:u,children:m}=e,g=function(e,t){if(null==e)return{};var i,n,o=function(e,t){if(null==e)return{};var i={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;i[n]=e[n]}return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n-1}function d(e,t,i){for(var n=-1,o=e?e.length:0;++n0&&i(s)?t>1?H(s,t-1,i,n,o):m(o,s):n||(o[o.length]=s)}return o}function G(e){if(!ne(e)||(t=e,T&&T in t))return!1;var t,i=ie(e)||function(e){var t=!1;if(null!=e&&\"function\"!=typeof e.toString)try{t=!!(e+\"\")}catch(e){}return t}(e)?I:a;return i.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+\"\"}catch(e){}}return\"\"}(e))}function W(e){if(!ne(e))return function(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t}(e);var t,i,n,o=(i=(t=e)&&t.constructor,n=\"function\"==typeof i&&i.prototype||k,t===n),a=[];for(var r in e)(\"constructor\"!=r||!o&&M.call(e,r))&&a.push(r);return a}function V(e){return function(e,t,i){var n=t(e);return ee(e)?n:m(n,i(e))}(e,ae,K)}function q(e,t){var i,n,o=e.__data__;return(\"string\"==(n=typeof(i=t))||\"number\"==n||\"symbol\"==n||\"boolean\"==n?\"__proto__\"!==i:null===i)?o[\"string\"==typeof t?\"string\":\"hash\"]:o.map}function Y(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return G(i)?i:void 0}R.prototype.clear=function(){this.__data__=L?L(null):{}},R.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},R.prototype.get=function(e){var t=this.__data__;if(L){var n=t[e];return n===i?void 0:n}return M.call(t,e)?t[e]:void 0},R.prototype.has=function(e){var t=this.__data__;return L?void 0!==t[e]:M.call(t,e)},R.prototype.set=function(e,t){return this.__data__[e]=L&&void 0===t?i:t,this},j.prototype.clear=function(){this.__data__=[]},j.prototype.delete=function(e){var t=this.__data__,i=F(t,e);return!(i<0)&&(i==t.length-1?t.pop():C.call(t,i,1),!0)},j.prototype.get=function(e){var t=this.__data__,i=F(t,e);return i<0?void 0:t[i][1]},j.prototype.has=function(e){return F(this.__data__,e)>-1},j.prototype.set=function(e,t){var i=this.__data__,n=F(i,e);return n<0?i.push([e,t]):i[n][1]=t,this},z.prototype.clear=function(){this.__data__={hash:new R,map:new(D||j),string:new R}},z.prototype.delete=function(e){return q(this,e).delete(e)},z.prototype.get=function(e){return q(this,e).get(e)},z.prototype.has=function(e){return q(this,e).has(e)},z.prototype.set=function(e,t){return q(this,e).set(e,t),this},B.prototype.add=B.prototype.push=function(e){return this.__data__.set(e,i),this},B.prototype.has=function(e){return this.__data__.has(e)};var Z=A?f(A,Object):ue,K=A?function(e){for(var t=[];e;)m(t,Z(e)),e=_(e);return t}:ue;function Q(e){return ee(e)||$(e)||!!(N&&e&&e[N])}function X(e,t){return!!(t=null==t?n:t)&&(\"number\"==typeof e||r.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=n}(e.length)&&!ie(e)}function ie(e){var t=ne(e)?E.call(e):\"\";return\"[object Function]\"==t||\"[object GeneratorFunction]\"==t}function ne(e){var t=typeof e;return!!e&&(\"object\"==t||\"function\"==t)}function oe(e){return!!e&&\"object\"==typeof e}function ae(e){return te(e)?U(e,!0):W(e)}var re,se,le=(re=function(e,t){return null==e?{}:(t=p(H(t,1),J),function(e,t){return function(e,t,i){for(var n=-1,o=t.length,a={};++n=200&&(r=h,s=!1,t=new B(t));e:for(;++a0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(l)throw l;for(var n=!1,o={},a=0;ae-t));return e.map((e=>t.indexOf(e)))}static inclusiveRandIntWithout(e,t,i){const n=t-e,o=e+Math.floor(Math.random()*n);return o>=i?o+1:o}static scale(e,t,i,n,o){return(e-t)/(i-t)*(o-n)+n}}},function(e,t,i){\"use strict\";var n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String(\"abc\");if(e[5]=\"de\",\"5\"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},i=0;i<10;i++)t[\"_\"+String.fromCharCode(i)]=i;if(\"0123456789\"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(\"\"))return!1;var n={};return\"abcdefghijklmnopqrst\".split(\"\").forEach((function(e){n[e]=e})),\"abcdefghijklmnopqrst\"===Object.keys(Object.assign({},n)).join(\"\")}catch(e){return!1}}()?Object.assign:function(e,t){for(var i,r,s=function(e){if(null==e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}(e),l=1;l{let{src:t}=e,i=function(e,t){if(null==e)return{};var i,n,o=function(e,t){if(null==e)return{};var i={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;i[n]=e[n]}return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n({theme:e.scratchGui.theme.theme})),(()=>({})))(c)},function(e,t,i){\"use strict\";i.d(t,\"c\",(function(){return p})),i.d(t,\"a\",(function(){return d})),i.d(t,\"b\",(function(){return c}));var n=i(1),o=i.n(n),a=i(2),r=i(44),s=i.n(r),l=i(138),u=i.n(l);const c=s()({STANDARD:null,EXTENSION:null,INLINE:null}),d={SUCCESS:\"success\",INFO:\"info\",WARN:\"warn\"},p=[{alertId:\"createSuccess\",alertType:c.STANDARD,clearList:[\"createSuccess\",\"creating\",\"createCopySuccess\",\"creatingCopy\",\"createRemixSuccess\",\"creatingRemix\",\"saveSuccess\",\"saving\"],content:o.a.createElement(a.b,{defaultMessage:\"New project created.\",id:\"gui.alerts.createsuccess\"}),iconURL:u.a,level:d.SUCCESS,maxDisplaySecs:5},{alertId:\"createCopySuccess\",alertType:c.STANDARD,clearList:[\"createSuccess\",\"creating\",\"createCopySuccess\",\"creatingCopy\",\"createRemixSuccess\",\"creatingRemix\",\"saveSuccess\",\"saving\"],content:o.a.createElement(a.b,{defaultMessage:\"Project saved as a copy.\",id:\"gui.alerts.createcopysuccess\"}),iconURL:u.a,level:d.SUCCESS,maxDisplaySecs:5},{alertId:\"createRemixSuccess\",alertType:c.STANDARD,clearList:[\"createSuccess\",\"creating\",\"createCopySuccess\",\"creatingCopy\",\"createRemixSuccess\",\"creatingRemix\",\"saveSuccess\",\"saving\"],content:o.a.createElement(a.b,{defaultMessage:\"Project saved as a remix.\",id:\"gui.alerts.createremixsuccess\"}),iconURL:u.a,level:d.SUCCESS,maxDisplaySecs:5},{alertId:\"creating\",alertType:c.STANDARD,clearList:[\"createSuccess\",\"creating\",\"createCopySuccess\",\"creatingCopy\",\"createRemixSuccess\",\"creatingRemix\",\"saveSuccess\",\"saving\"],content:o.a.createElement(a.b,{defaultMessage:\"Creating new…\",id:\"gui.alerts.creating\"}),iconSpinner:!0,level:d.SUCCESS},{alertId:\"creatingCopy\",alertType:c.STANDARD,clearList:[\"createSuccess\",\"creating\",\"createCopySuccess\",\"creatingCopy\",\"createRemixSuccess\",\"creatingRemix\",\"saveSuccess\",\"saving\"],content:o.a.createElement(a.b,{defaultMessage:\"Copying project…\",id:\"gui.alerts.creatingCopy\"}),iconSpinner:!0,level:d.SUCCESS},{alertId:\"creatingRemix\",alertType:c.STANDARD,clearList:[\"createSuccess\",\"creating\",\"createCopySuccess\",\"creatingCopy\",\"createRemixSuccess\",\"creatingRemix\",\"saveSuccess\",\"saving\"],content:o.a.createElement(a.b,{defaultMessage:\"Remixing project…\",id:\"gui.alerts.creatingRemix\"}),iconSpinner:!0,level:d.SUCCESS},{alertId:\"creatingError\",clearList:[\"createSuccess\",\"creating\",\"createCopySuccess\",\"creatingCopy\",\"createRemixSuccess\",\"creatingRemix\",\"saveSuccess\",\"saving\"],closeButton:!0,content:o.a.createElement(a.b,{defaultMessage:\"Could not create the project. Please try again!\",id:\"gui.alerts.creatingError\"}),level:d.WARN},{alertId:\"savingError\",clearList:[\"createSuccess\",\"creating\",\"createCopySuccess\",\"creatingCopy\",\"createRemixSuccess\",\"creatingRemix\",\"saveSuccess\",\"saving\"],showDownload:!0,closeButton:!0,content:o.a.createElement(a.b,{defaultMessage:\"Project could not save.\",id:\"gui.alerts.savingError\"}),level:d.WARN},{alertId:\"saveSuccess\",alertType:c.INLINE,clearList:[\"saveSuccess\",\"saving\",\"savingError\",\"twSaveToDiskSuccess\",\"twCreatingRestorePoint\",\"twRestorePointSuccess\",\"twRestorePointError\"],content:o.a.createElement(a.b,{defaultMessage:\"Project saved.\",id:\"gui.alerts.savesuccess\"}),iconURL:u.a,level:d.SUCCESS,maxDisplaySecs:3},{alertId:\"twSaveToDiskSuccess\",alertType:c.INLINE,clearList:[\"saveSuccess\",\"saving\",\"savingError\",\"twCreatingRestorePoint\",\"twRestorePointSuccess\",\"twRestorePointError\"],content:o.a.createElement(a.b,{defaultMessage:\"Saved to your computer.\",id:\"tw.alerts.savedToDisk\"}),iconURL:u.a,level:d.SUCCESS,maxDisplaySecs:3},{alertId:\"saving\",alertType:c.INLINE,clearList:[\"saveSuccess\",\"saving\",\"savingError\",\"twSaveToDiskSuccess\",\"twCreatingRestorePoint\",\"twRestorePointSuccess\",\"twRestorePointError\"],content:o.a.createElement(a.b,{defaultMessage:\"Saving project…\",id:\"gui.alerts.saving\"}),iconSpinner:!0,level:d.INFO},{alertId:\"twCreatingRestorePoint\",alertType:c.INLINE,clearList:[\"twRestorePointSuccess\",\"twRestorePointError\"],content:o.a.createElement(a.b,{defaultMessage:\"Creating restore point…\",id:\"tw.alerts.creatingRestorePoint\"}),iconSpinner:!0,level:d.INFO},{alertId:\"twRestorePointSuccess\",alertType:c.INLINE,clearList:[\"twCreatingRestorePoint\",\"twRestorePointError\"],content:o.a.createElement(a.b,{defaultMessage:'Access restore points in \"File\"',id:\"tw.alerts.restorePointSuccess\"}),iconURL:u.a,level:d.SUCCESS,maxDisplaySecs:3},{alertId:\"twRestorePointError\",alertType:c.INLINE,clearList:[\"twCreatingRestorePoint\",\"twRestorePointSuccess\"],content:o.a.createElement(a.b,{defaultMessage:\"Could not create restore point\",id:\"tw.alerts.restorePointError\"}),iconURL:u.a,level:d.WARN,maxDisplaySecs:5},{alertId:\"cloudInfo\",alertType:c.STANDARD,clearList:[\"cloudInfo\"],content:o.a.createElement(a.b,{defaultMessage:\"Please note, cloud variables only support numbers, not letters or symbols. {learnMoreLink}\",id:\"gui.alerts.cloudInfo\",values:{learnMoreLink:o.a.createElement(\"a\",{href:\"https://scratch.mit.edu/info/faq/#clouddata\",rel:\"noopener noreferrer\",target:\"_blank\"},o.a.createElement(a.b,{defaultMessage:\"Learn more.\",id:\"gui.alerts.cloudInfoLearnMore\"}))}}),closeButton:!0,level:d.SUCCESS,maxDisplaySecs:15},{alertId:\"importingAsset\",alertType:c.STANDARD,clearList:[],content:o.a.createElement(a.b,{defaultMessage:\"Importing…\",id:\"gui.alerts.importing\"}),iconSpinner:!0,level:d.SUCCESS}]},function(e,t,i){\"use strict\";var n=i(717),o=i(718),a=i(365),r=i(364),s=i(363);function l(e,t){return Object.keys(t).forEach((function(i){e[i]=t[i]})),e}e.exports=function e(){var t=l({},s),i=\"en\",u={},c=function(e){return e},d=null,p=\"warning\",m={};function g(e,t,a){var r=\"string\"==typeof e?e:e.default,s=b(r,\"object\"==typeof e&&e.id||c(r),a||i);return(s.format||(s.format=o(n(s.message),a||i,m)))(t)}g.rich=function(e,t,a){var r=\"string\"==typeof e?e:e.default,s=b(r,\"object\"==typeof e&&e.id||c(r),a||i);return(s.toParts||(s.toParts=o.toParts(n(s.message,{tagsType:h}),a||i,m)))(t)};var h=\"<>\";function f(e,t){var i=e[2];return function(e,t){var n=\"object\"==typeof i?function(e,t){return Object.keys(e).reduce((function(i,n){return i[n]=e[n](t),i}),{})}(i,t):i;return\"function\"==typeof e?e(n):e}}function b(e,t,i){var n=r(i,u)||\"en\",o=u[n]||(u[n]={}),a=o[t];if(\"string\"==typeof a&&(a=o[t]={message:a}),!a){var s='Translation for \"'+t+'\" in \"'+n+'\" is missing';if(\"warning\"===p)\"undefined\"!=typeof console&&console.warn(s);else if(\"ignore\"!==p)throw new Error(s);var l=\"function\"==typeof d?d(e,t,n)||e:d||e;a=o[t]={message:l}}return a}function y(e,t,n,o,s){\"object\"==typeof n&&\"object\"!=typeof o&&(s=o,o=n,n=0);var l=r(s||i,a),u=l&&a[l][e]||v;return o[\"=\"+ +t]||o[u(t-n)]||o.other}function v(){return\"other\"}return m[h]=f,g.setup=function(e){return(e=e||{}).locale&&(i=e.locale),\"translations\"in e&&(u=e.translations||{}),e.generateId&&(c=e.generateId),\"missingReplacement\"in e&&(d=e.missingReplacement),e.missingTranslation&&(p=e.missingTranslation),e.formats&&(e.formats.number&&l(t.number,e.formats.number),e.formats.date&&l(t.date,e.formats.date),e.formats.time&&l(t.time,e.formats.time)),e.types&&((m=e.types)[h]=f),{locale:i,translations:u,generateId:c,missingReplacement:d,missingTranslation:p,formats:t,types:m}},g.number=function(e,n,o){var a=n&&t.number[n]||t.parseNumberPattern(n)||t.number.default;return new Intl.NumberFormat(o||i,a).format(e)},g.date=function(e,n,o){var a=n&&t.date[n]||t.parseDatePattern(n)||t.date.default;return new Intl.DateTimeFormat(o||i,a).format(e)},g.time=function(e,n,o){var a=n&&t.time[n]||t.parseDatePattern(n)||t.time.default;return new Intl.DateTimeFormat(o||i,a).format(e)},g.select=function(e,t){return t[e]||t.other},g.custom=function(e,t,i,n){return e[1]in m?m[e[1]](e,t)(i,n):i},g.plural=y.bind(null,\"cardinal\"),g.selectordinal=y.bind(null,\"ordinal\"),g.namespace=e,g}()},function(e,t,i){\"use strict\";i.d(t,\"a\",(function(){return r})),i.d(t,\"b\",(function(){return a})),i.d(t,\"c\",(function(){return s})),i.d(t,\"d\",(function(){return l}));const n=\"scratch-gui/mode/SET_FULL_SCREEN\",o=\"scratch-gui/mode/SET_PLAYER\",a={isEmbedded:!1,isFullScreen:!1,isPlayerOnly:!1,hasEverEnteredEditor:!0},r=function(e,t){switch(void 0===e&&(e=a),t.type){case n:return Object.assign({},e,{isFullScreen:t.isFullScreen});case o:return Object.assign({},e,{isPlayerOnly:t.isPlayerOnly,hasEverEnteredEditor:e.hasEverEnteredEditor||!t.isPlayerOnly});default:return e}},s=function(e){return{type:n,isFullScreen:e}},l=function(e){return{type:o,isPlayerOnly:e}}},function(e,t,i){\"use strict\";var n=i(2);t.a=Object(n.g)({backdrop:{id:\"gui.sharedMessages.backdrop\",defaultMessage:\"backdrop{index}\"},costume:{id:\"gui.sharedMessages.costume\",defaultMessage:\"costume{index}\"},sprite:{id:\"gui.sharedMessages.sprite\",defaultMessage:\"Sprite{index}\"},pop:{id:\"gui.sharedMessages.pop\",defaultMessage:\"pop\"},replaceProjectWarning:{id:\"gui.sharedMessages.replaceProjectWarning\",defaultMessage:\"Replace contents of the current project?\"},loadFromComputerTitle:{id:\"gui.sharedMessages.loadFromComputerTitle\",defaultMessage:\"Load from your computer\"}})},function(e,t,i){\"use strict\";i.d(t,\"d\",(function(){return h})),i.d(t,\"b\",(function(){return g})),i.d(t,\"a\",(function(){return f})),i.d(t,\"c\",(function(){return b})),i.d(t,\"i\",(function(){return y})),i.d(t,\"g\",(function(){return v})),i.d(t,\"h\",(function(){return k})),i.d(t,\"e\",(function(){return w})),i.d(t,\"j\",(function(){return T})),i.d(t,\"f\",(function(){return S}));var n=i(103),o=i(84);const a=\"scratch-gui/cards/CLOSE_CARDS\",r=\"scratch-gui/cards/SHRINK_EXPAND_CARDS\",s=\"scratch-gui/cards/VIEW_CARDS\",l=\"scratch-gui/cards/ACTIVATE_DECK\",u=\"scratch-gui/cards/NEXT_STEP\",c=\"scratch-gui/cards/PREV_STEP\",d=\"scratch-gui/cards/DRAG_CARD\",p=\"scratch-gui/cards/START_DRAG\",m=\"scratch-gui/cards/END_DRAG\",g={visible:!1,content:o.a,activeDeckId:null,step:0,x:0,y:0,expanded:!0,dragging:!1},h=function(e,t){switch(void 0===e&&(e=g),t.type){case a:return Object.assign({},e,{visible:!1});case r:return Object.assign({},e,{expanded:!e.expanded});case s:return Object.assign({},e,{visible:!0});case l:return Object.assign({},e,{activeDeckId:t.activeDeckId,step:0,x:0,y:0,expanded:!0,visible:!0});case u:return null!==e.activeDeckId?(n.a.event({category:\"how-to\",action:\"next step\",label:\"\".concat(e.activeDeckId,\" - \").concat(e.step)}),Object.assign({},e,{step:e.step+1})):e;case c:return null!==e.activeDeckId&&e.step>0?Object.assign({},e,{step:e.step-1}):e;case d:return Object.assign({},e,{x:t.x,y:t.y});case p:return Object.assign({},e,{dragging:!0});case m:return Object.assign({},e,{dragging:!1});default:return e}},f=function(e){return{type:l,activeDeckId:e}},b=function(){return{type:a}},y=function(){return{type:r}},v=function(){return{type:u}},k=function(){return{type:c}},w=function(e,t){return{type:d,x:e,y:t}},T=function(){return{type:p}},S=function(){return{type:m}}},function(e,t,i){var n=i(1016);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1246);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t){var i=e.exports=\"undefined\"!=typeof window&&window.Math==Math?window:\"undefined\"!=typeof self&&self.Math==Math?self:Function(\"return this\")();\"number\"==typeof __g&&(__g=i)},function(e,t,i){var n=i(315)(\"wks\"),o=i(233),a=i(74).Symbol,r=\"function\"==typeof a;(e.exports=function(e){return n[e]||(n[e]=r&&a[e]||(r?a:o)(\"Symbol.\"+e))}).store=n},function(e,t){e.exports=__WEBPACK_EXTERNAL_MODULE__76__},function(e,t,i){const n=i(872),o=i(885),a=i(391),r=i(387),s=i(887),l=i(390),u=i(302),c=i(388),d=i(888),p=i(301);e.exports={BitmapAdapter:o,convertFonts:c,inlineSvgFonts:a,loadSvgString:r,sanitizeSvg:s,serializeSvgToString:l,SvgElement:u,SVGRenderer:n,fixForVanilla:d,DOMPurify:p}},function(e,t,i){\"use strict\";i.d(t,\"a\",(function(){return a})),i.d(t,\"b\",(function(){return o})),i.d(t,\"c\",(function(){return r}));const n=\"projectTitle/SET_PROJECT_TITLE\",o=\"\",a=function(e,t){return void 0===e&&(e=o),t.type===n?t.title:e},r=e=>({type:n,title:e})},function(e,t,i){\"use strict\";i.d(t,\"a\",(function(){return a})),i.d(t,\"b\",(function(){return o})),i.d(t,\"c\",(function(){return r})),i.d(t,\"d\",(function(){return s}));const n=\"scratch-gui/project-changed/SET_PROJECT_CHANGED\",o=!1,a=function(e,t){return void 0===e&&(e=o),t.type===n?t.changed:e},r=()=>({type:n,changed:!0}),s=()=>({type:n,changed:!1})},function(e,t,i){\"use strict\";let n=null;const o=()=>!!n;t.a={get:()=>{if(!o())throw new Error(\"scratch-blocks is not loaded yet\");return n},isLoaded:o,load:()=>n?Promise.resolve():i.e(6).then(i.t.bind(null,1258,7)).then((e=>(n=e.default,n)))}},function(e,t,i){var n=i(1053);e.exports=function(e){var t,i,o,a;if(t=/^((?:rgb|hs[lv]|cmyk|xyz|lab)a?)\\s*\\(([^\\)]*)\\)/.exec(e)){var r=t[1],s=\"cmyk\"===(l=r.replace(/a$/,\"\"))?4:3;i=n[l],o=t[2].replace(/^\\s+|\\s+$/g,\"\").split(/\\s*,\\s*/).map((function(e,t){return/%$/.test(e)&&t===s?parseFloat(e)/100:(/%$/.test(e),parseFloat(e))})),r===l&&o.push(1),a=void 0===o[s]?1:o[s],o=o.slice(0,s),i[l]=function(){return o}}else if(/^#[A-Fa-f0-9]+$/.test(e)){var l;s=(l=e.replace(/^#/,\"\")).length;i=n.rgb,o=(o=l.split(3===s?/(.)/:/(..)/)).filter(Boolean).map((function(e){return 3===s?parseInt(e+e,16):parseInt(e,16)})),a=1,i.rgb=function(){return o},o[0]||(o[0]=0),o[1]||(o[1]=0),o[2]||(o[2]=0)}else(i=n.keyword).keyword=function(){return e},o=e,a=1;var u={rgb:void 0,hsl:void 0,hsv:void 0,cmyk:void 0,keyword:void 0,hex:void 0};try{u.rgb=i.rgb(o)}catch(e){}try{u.hsl=i.hsl(o)}catch(e){}try{u.hsv=i.hsv(o)}catch(e){}try{u.cmyk=i.cmyk(o)}catch(e){}try{u.keyword=i.keyword(o)}catch(e){}return u.rgb&&(u.hex=\"#\"+u.rgb.map((function(e){var t=e.toString(16);return 1===t.length?\"0\"+t:t})).join(\"\")),u.rgb&&(u.rgba=u.rgb.concat(a)),u.hsl&&(u.hsla=u.hsl.concat(a)),u.hsv&&(u.hsva=u.hsv.concat(a)),u.cmyk&&(u.cmyka=u.cmyk.concat(a)),u}},function(e,t,i){var n=i(1015);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1236);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){\"use strict\";t.a={}},function(e,t,i){var n=i(1026);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1227);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){const n=i(38);class o{static withoutTrailingDigits(e){let t=e.length-1;for(;t>=0&&\"0123456789\".indexOf(e.charAt(t))>-1;)t--;return e.slice(0,t+1)}static unusedName(e,t){if(t.indexOf(e)<0)return e;e=o.withoutTrailingDigits(e);let i=2;for(;t.indexOf(e+i)>=0;)i++;return e+i}static caseInsensitiveUnusedName(e,t){const i=e=>t.some((t=>t.toLowerCase()===e.toLowerCase()));if(!i(e))return e;e=o.withoutTrailingDigits(e);let n=2;for(;i(\"\".concat(e).concat(n));)n++;return\"\".concat(e).concat(n)}static splitFirst(e,t){const i=e.indexOf(t);return i>=0?[e.substring(0,i),e.substring(i+1)]:[e,null]}static stringify(e){return JSON.stringify(e,((e,t)=>\"number\"!=typeof t||t!==1/0&&t!==-1/0&&!isNaN(t)?t:0))}static replaceUnsafeChars(e){if(\"string\"!=typeof e){if(!Array.isArray(e))return n.error(\"Unexpected input recieved in replaceUnsafeChars\"),e;e=String(e)}return e.replace(/[<>&'\"]/g,(e=>{switch(e){case\"<\":return\"lt\";case\">\":return\"gt\";case\"&\":return\"amp\";case\"'\":return\"apos\";case'\"':return\"quot\"}}))}}e.exports=o},function(e,t,i){\"use strict\";var n=i(4),o=i.n(n),a=i(5),r=i.n(a),s=i(0),l=i.n(s),u=i(1),c=i.n(u),d=i(2),p=i(7),m=i(273),g=i.n(m),h=i(496),f=i.n(h),b=i(497),y=i.n(b);const v=[\"className\",\"intl\",\"isPlaying\",\"onClick\",\"onMouseDown\",\"onMouseEnter\",\"onMouseLeave\",\"setButtonRef\"];function k(){return k=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{className:t,intl:i,isPlaying:n,onClick:a,onMouseDown:r,onMouseEnter:s,onMouseLeave:l,setButtonRef:u}=e,d=function(e,t){if(null==e)return{};var i,n,o=function(e,t){if(null==e)return{};var i={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;i[n]=e[n]}return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n0&&c.a.createElement(\"div\",{className:x.a.extensionLinks},c.a.createElement(\"div\",null,c.a.createElement(d.b,{defaultMessage:\"Created by:\",id:\"tw.createdBy\"}),\" \",this.props.credits.map(((e,t)=>c.a.createElement(c.a.Fragment,{key:t},e,t!==this.props.credits.length-1&&\", \"))))),this.props.bluetoothRequired||this.props.internetConnectionRequired||this.props.collaborator?c.a.createElement(\"div\",{className:x.a.featuredExtensionMetadata},c.a.createElement(\"div\",{className:x.a.featuredExtensionRequirement},this.props.bluetoothRequired||this.props.internetConnectionRequired?c.a.createElement(\"div\",null,c.a.createElement(\"div\",null,c.a.createElement(d.b,{defaultMessage:\"Requires\",id:\"gui.extensionLibrary.requires\"})),c.a.createElement(\"div\",{className:x.a.featuredExtensionMetadataDetail},this.props.bluetoothRequired?c.a.createElement(\"img\",{src:O.a,draggable:!1}):null,this.props.internetConnectionRequired?c.a.createElement(\"img\",{src:N.a,draggable:!1}):null)):null),c.a.createElement(\"div\",{className:x.a.featuredExtensionCollaboration},this.props.collaborator?c.a.createElement(\"div\",null,c.a.createElement(\"div\",null,c.a.createElement(d.b,{defaultMessage:\"Collaboration with\",id:\"gui.extensionLibrary.collaboration\"})),c.a.createElement(\"div\",{className:x.a.featuredExtensionMetadataDetail},this.props.collaborator)):null)):null,t):c.a.createElement(p.a,{className:o()(x.a.libraryItem,{[x.a.hidden]:this.props.hidden}),role:\"button\",tabIndex:\"0\",onBlur:this.props.onBlur,onClick:this.props.onClick,onFocus:this.props.onFocus,onKeyPress:this.props.onKeyPress,onMouseEnter:this.props.showPlayButton?null:this.props.onMouseEnter,onMouseLeave:this.props.showPlayButton?null:this.props.onMouseLeave},c.a.createElement(p.a,{className:x.a.libraryItemImageContainerWrapper},c.a.createElement(p.a,{className:x.a.libraryItemImageContainer,onMouseEnter:this.props.showPlayButton?this.props.onMouseEnter:null,onMouseLeave:this.props.showPlayButton?this.props.onMouseLeave:null},c.a.createElement(\"img\",{className:x.a.libraryItemImage,loading:\"lazy\",src:this.props.iconURL,draggable:!1}))),c.a.createElement(\"span\",{className:x.a.libraryItemName},this.props.name),this.props.showPlayButton?c.a.createElement(E,{isPlaying:this.props.isPlaying,onPlay:this.props.onPlay,onStop:this.props.onStop}):null,t)}}j.propTypes={intl:d.i,bluetoothRequired:l.a.bool,collaborator:l.a.string,description:l.a.oneOfType([l.a.string,l.a.node]),disabled:l.a.bool,extensionId:l.a.string,featured:l.a.bool,hidden:l.a.bool,iconURL:l.a.string,insetIconURL:l.a.string,internetConnectionRequired:l.a.bool,isPlaying:l.a.bool,name:l.a.oneOfType([l.a.string,l.a.node]),credits:l.a.arrayOf(l.a.oneOfType([l.a.string,l.a.node])),docsURI:l.a.string,samples:l.a.arrayOf(l.a.shape({href:l.a.string,text:l.a.string})),favorite:l.a.bool,onFavorite:l.a.func,onBlur:l.a.func.isRequired,onClick:l.a.func.isRequired,onFocus:l.a.func.isRequired,onKeyPress:l.a.func.isRequired,onMouseEnter:l.a.func.isRequired,onMouseLeave:l.a.func.isRequired,onPlay:l.a.func.isRequired,onStop:l.a.func.isRequired,showPlayButton:l.a.bool},j.defaultProps={disabled:!1,showPlayButton:!1};var z=j;const B=Object(d.g)({incompatible:{id:\"tw.confirmIncompatibleExtension\",defaultMessage:\"This extension is incompatible with Scratch. Projects made with it cannot be uploaded to the Scratch website. Are you sure you want to enable it?\"}});class U extends c.a.PureComponent{constructor(e){super(e),r()(this,[\"handleBlur\",\"handleClick\",\"handleFavorite\",\"handleFocus\",\"handleKeyPress\",\"handleMouseEnter\",\"handleMouseLeave\",\"handlePlay\",\"handleStop\",\"rotateIcon\",\"startRotatingIcons\",\"stopRotatingIcons\"]),this.state={iconIndex:0,isRotatingIcon:!1}}componentWillUnmount(){clearInterval(this.intervalId)}handleBlur(e){this.handleMouseLeave(e)}handleClick(e){e.target.closest(\"a\")||(this.props.favorite||!this.props.incompatibleWithScratch||e.shiftKey||confirm(this.props.intl.formatMessage(B.incompatible)))&&(this.props.disabled||(this.props.href?window.open(this.props.href):this.props.onSelect(this.props.id)),e.preventDefault())}handleFavorite(e){e.stopPropagation(),this.props.onFavorite(this.props.id)}handleFocus(e){this.props.showPlayButton||this.handleMouseEnter(e)}handleKeyPress(e){\" \"!==e.key&&\"Enter\"!==e.key||(e.preventDefault(),this.props.onSelect(this.props.id))}handleMouseEnter(){this.props.showPlayButton||(this.props.onMouseEnter(this.props.id),this.props.icons&&this.props.icons.length&&(this.stopRotatingIcons(),this.setState({isRotatingIcon:!0},this.startRotatingIcons)))}handleMouseLeave(){this.props.showPlayButton||(this.props.onMouseLeave(this.props.id),this.props.icons&&this.props.icons.length&&this.setState({isRotatingIcon:!1},this.stopRotatingIcons))}handlePlay(){this.props.onMouseEnter(this.props.id)}handleStop(){this.props.onMouseLeave(this.props.id)}startRotatingIcons(){this.rotateIcon(),this.intervalId=setInterval(this.rotateIcon,300)}stopRotatingIcons(){this.intervalId&&(this.intervalId=clearInterval(this.intervalId))}rotateIcon(){const e=(this.state.iconIndex+1)%this.props.icons.length;this.setState({iconIndex:e})}curIconMd5(){const e=this.props.iconMd5;if(this.props.icons&&this.state.isRotatingIcon&&this.state.iconIndex{const e=\"object\"==typeof Recolor?V.replace(/#855cd6/gi,Recolor.primary):V;return\"data:image/svg+xml;,\"+encodeURIComponent(e)};const Y='\\n \\n\\n';var Z=()=>{const e=\"object\"==typeof Recolor?Y.replace(/#855cd6/gi,Recolor.primary):Y;return\"data:image/svg+xml;,\"+encodeURIComponent(e)},K=i(159),Q=i.n(K);const X=e=>{const{className:t,onChange:i,onClear:n,placeholderText:a,filterQuery:r,inputClassName:s}=e;return c.a.createElement(\"div\",{className:o()(t,Q.a.filter,{[Q.a.isActive]:r.length>0})},c.a.createElement(W.a,{className:Q.a.filterIcon,src:q}),c.a.createElement(\"input\",{className:o()(Q.a.filterInput,s),placeholder:a,type:\"text\",value:r,onChange:i}),c.a.createElement(\"div\",{className:Q.a.xIconWrapper,onClick:n},c.a.createElement(W.a,{className:Q.a.xIcon,src:Z})))};X.propTypes={className:l.a.string,filterQuery:l.a.string,inputClassName:l.a.string,onChange:l.a.func,onClear:l.a.func,placeholderText:l.a.string},X.defaultProps={placeholderText:\"Search\"};var J=X,$=i(52),ee=i(274),te=i.n(ee);const ie=[\"active\",\"iconClassName\",\"className\",\"tag\",\"intlLabel\"];function ne(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function oe(e){for(var t=1;t{let{active:t,iconClassName:i,className:n,tag:a,intlLabel:r}=e,s=function(e,t){if(null==e)return{};var i,n,o=function(e,t){if(null==e)return{};var i={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;i[n]=e[n]}return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;nc.a.createElement(\"hr\",{className:be.a.separator}),ve=i(504),ke=i.n(ve);var we=()=>c.a.createElement(\"div\",{className:ke.a.removedTrademarks},c.a.createElement(d.b,{defaultMessage:\"Some items that contained Scratch trademarks are no longer listed here.\",id:\"tw.removedTrademarks\"})),Te=i(39),Se=i(85),Me=i.n(Se);function Ee(){return Ee=Object.assign?Object.assign.bind():function(e){for(var t=1;t{this.setState({canDisplay:!0})})),this.props.setStopHandler&&this.props.setStopHandler(this.handlePlayingEnd)}componentDidUpdate(e,t){if(t.filterQuery===this.state.filterQuery&&t.selectedTag===this.state.selectedTag||this.scrollToTop(),this.state.favorites!==t.favorites)try{localStorage.setItem(this.getFavoriteStorageKey(),JSON.stringify(this.state.favorites))}catch(e){}}handleSelect(e){this.handleClose(),this.props.onItemSelected(this.getFilteredData()[e])}readFavoritesFromStorage(){let e;try{e=JSON.parse(localStorage.getItem(this.getFavoriteStorageKey()))}catch(e){}return Array.isArray(e)||(e=[]),e}getFavoriteStorageKey(){return\"tw:library-favorites:\".concat(this.props.id)}handleFavorite(e){const t=this.getFilteredData()[e][this.props.persistableKey];this.setState((e=>({favorites:e.favorites.includes(t)?e.favorites.filter((e=>e!==t)):[...e.favorites,t]})))}handleClose(){this.props.onRequestClose()}handleTagClick(e){null===this.state.playingItem?this.setState({filterQuery:\"\",selectedTag:e.toLowerCase()}):(this.props.onItemMouseLeave(this.getFilteredData()[[this.state.playingItem]]),this.setState({filterQuery:\"\",playingItem:null,selectedTag:e.toLowerCase()}))}handleMouseEnter(e){this.props.onItemMouseEnter&&this.state.playingItem!==e&&(this.props.onItemMouseEnter(this.getFilteredData()[e]),this.setState({playingItem:e}))}handleMouseLeave(e){this.props.onItemMouseLeave&&(this.props.onItemMouseLeave(this.getFilteredData()[e]),this.setState({playingItem:null}))}handlePlayingEnd(){null!==this.state.playingItem&&this.setState({playingItem:null})}handleFilterChange(e){null===this.state.playingItem?this.setState({filterQuery:e.target.value,selectedTag:Ce.tag}):(this.props.onItemMouseLeave(this.getFilteredData()[[this.state.playingItem]]),this.setState({filterQuery:e.target.value,playingItem:null,selectedTag:Ce.tag}))}handleFilterClear(){this.setState({filterQuery:\"\"})}getFilteredData(){if(\"all\"===this.state.selectedTag&&!this.state.filterQuery){const e=this.props.data.filter((e=>this.state.initialFavorites.includes(e[this.props.persistableKey]))).map((e=>xe(xe({},e),{},{key:\"favorite-\".concat(e[this.props.persistableKey])})));return e.length&&e.push(\"---\"),[...e,...this.props.data]}const e=[],t=[];for(const i of this.props.data)\"---\"===i||(this.state.initialFavorites.includes(i[this.props.persistableKey])?e.push(i):t.push(i));let i=e.concat(t);return\"all\"!==this.state.selectedTag&&(i=i.filter((e=>e.tags&&e.tags.map((e=>e.toLowerCase())).includes(this.state.selectedTag)))),this.state.filterQuery&&(i=i.filter((e=>{const t=[...e.tags];return e.name&&(\"string\"==typeof e.name?t.push(e.name):t.push(this.props.intl.formatMessage(e.name.props,{APP_NAME:Te.APP_NAME}))),e.description&&(\"string\"==typeof e.description?t.push(e.description):t.push(this.props.intl.formatMessage(e.description.props,{APP_NAME:Te.APP_NAME}))),t.join(\"\\n\").toLowerCase().includes(this.state.filterQuery.toLowerCase())}))),i}scrollToTop(){this.filteredDataRef.scrollTop=0}setFilteredDataRef(e){this.filteredDataRef=e}render(){const e=this.state.canDisplay&&this.props.data&&this.getFilteredData();return c.a.createElement(H.a,{fullScreen:!0,contentLabel:this.props.title,id:this.props.id,onRequestClose:this.handleClose},(this.props.filterable||this.props.tags)&&c.a.createElement(\"div\",{className:Me.a.filterBar},this.props.filterable&&c.a.createElement(J,{className:o()(Me.a.filterBarItem,Me.a.filter),filterQuery:this.state.filterQuery,inputClassName:Me.a.filterInput,placeholderText:this.props.intl.formatMessage(Oe.filterPlaceholder),onChange:this.handleFilterChange,onClear:this.handleFilterClear}),this.props.filterable&&this.props.tags&&c.a.createElement(G.a,{className:o()(Me.a.filterBarItem,Me.a.divider)}),this.props.tags&&c.a.createElement(\"div\",{className:Me.a.tagWrapper},Ne.concat(this.props.tags).map(((e,t)=>c.a.createElement(ge,Ee({active:this.state.selectedTag===e.tag.toLowerCase(),className:o()(Me.a.filterBarItem,Me.a.tagButton,e.className),key:\"tag-button-\".concat(t),onClick:this.handleTagClick},e)))))),c.a.createElement(\"div\",{className:o()(Me.a.libraryScrollGrid,{[Me.a.withFilterBar]:this.props.filterable||this.props.tags}),ref:this.setFilteredDataRef},e&&this.getFilteredData().map(((e,t)=>\"---\"===e?c.a.createElement(ye,{key:t}):c.a.createElement(F,{bluetoothRequired:e.bluetoothRequired,collaborator:e.collaborator,description:e.description,disabled:e.disabled,extensionId:e.extensionId,href:e.href,featured:e.featured,hidden:e.hidden,iconMd5:e.costumes?e.costumes[0].md5ext:e.md5ext,iconRawURL:e.rawURL,icons:e.costumes,id:t,incompatibleWithScratch:e.incompatibleWithScratch,favorite:this.state.favorites.includes(e[this.props.persistableKey]),onFavorite:this.handleFavorite,insetIconURL:e.insetIconURL,internetConnectionRequired:e.internetConnectionRequired,isPlaying:this.state.playingItem===t,key:e.key||(\"string\"==typeof e.name?e.name:e.rawURL),name:e.name,credits:e.credits,samples:e.samples,docsURI:e.docsURI,showPlayButton:this.props.showPlayButton,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onSelect:this.handleSelect}))),e&&this.props.removedTrademarks&&c.a.createElement(c.a.Fragment,null,e.length>0&&c.a.createElement(ye,null),c.a.createElement(we,null)),!e&&c.a.createElement(\"div\",{className:Me.a.spinnerWrapper},c.a.createElement(he.a,{large:!0,level:\"primary\"}))))}}Ae.propTypes={data:l.a.oneOfType([l.a.arrayOf(l.a.oneOfType([l.a.shape({md5:l.a.string,name:l.a.oneOfType([l.a.string,l.a.node]),rawURL:l.a.string}),l.a.string])),l.a.instanceOf(Promise)]),filterable:l.a.bool,id:l.a.string.isRequired,persistableKey:l.a.string,intl:d.i.isRequired,onItemMouseEnter:l.a.func,onItemMouseLeave:l.a.func,onItemSelected:l.a.func,onRequestClose:l.a.func,setStopHandler:l.a.func,showPlayButton:l.a.bool,tags:l.a.arrayOf(l.a.shape(ge.propTypes)),title:l.a.string.isRequired,removedTrademarks:l.a.bool},Ae.defaultProps={filterable:!0,persistableKey:\"name\",showPlayButton:!1};t.a=Object(d.h)(Ae)},function(e,t){e.exports=\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iOHB4IiBoZWlnaHQ9IjVweCIgdmlld0JveD0iMCAwIDggNSIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNDguMiAoNDczMjcpIC0gaHR0cDovL3d3dy5ib2hlbWlhbmNvZGluZy5jb20vc2tldGNoIC0tPgogICAgPHRpdGxlPmRyb3Bkb3duLWNhcmV0PC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGRlZnM+PC9kZWZzPgogICAgPGcgaWQ9IlBhZ2UtMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9ImRyb3Bkb3duLWNhcmV0IiBmaWxsPSIjRkZGRkZGIj4KICAgICAgICAgICAgPHBhdGggZD0iTTQsNSBDMy43MjUyMDcwOCw1IDMuNDUxNjMwMDYsNC44OTY5NTA0NSAzLjI0MTI3OTczLDQuNjg5NjUzMTEgTDAuMzE0NjEzNTcyLDEuODA2NjYyMjcgQy0wLjEwNDg3MTE5MSwxLjM5MzI2NTgzIC0wLjEwNDg3MTE5MSwwLjcyNDY0MjAyMyAwLjMxNDYxMzU3MiwwLjMxMDA0NzMzMSBDMC43MzI4ODI0MzgsLTAuMTAzMzQ5MTEgNy4yNjcxMTc1NiwtMC4xMDMzNDkxMSA3LjY4NTM4NjQzLDAuMzEwMDQ3MzMxIEM4LjEwNDg3MTE5LDAuNzIzNDQzNzcyIDguMTA0ODcxMTksMS4zOTMyNjU4MyA3LjY4NTM4NjQzLDEuODA2NjYyMjcgTDQuNzU5OTM2MTcsNC42ODk2NTMxMSBDNC41NDk1ODU4Myw0Ljg5Njk1MDQ1IDQuMjc2MDA4ODIsNSA0LDUiPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==\"},function(e,t,i){\"use strict\";i.d(t,\"a\",(function(){return s})),i.d(t,\"e\",(function(){return r})),i.d(t,\"b\",(function(){return u})),i.d(t,\"c\",(function(){return l})),i.d(t,\"d\",(function(){return c}));const n=\"scratch-gui/vm-status/SET_RUNNING_STATE\",o=\"scratch-gui/vm-status/SET_TURBO_STATE\",a=\"scratch-gui/vm-status/SET_STARTED_STATE\",r={running:!1,started:!1,turbo:!1},s=function(e,t){switch(void 0===e&&(e=r),t.type){case a:return Object.assign({},e,{started:t.started});case n:return Object.assign({},e,{running:t.running});case o:return Object.assign({},e,{turbo:t.turbo});default:return e}},l=function(e){return{type:a,started:e}},u=function(e){return{type:n,running:e}},c=function(e){return{type:o,turbo:e}}},function(e,t,i){\"use strict\";i.d(t,\"a\",(function(){return u})),i.d(t,\"h\",(function(){return o})),i.d(t,\"e\",(function(){return c})),i.d(t,\"b\",(function(){return d})),i.d(t,\"c\",(function(){return p})),i.d(t,\"d\",(function(){return m})),i.d(t,\"f\",(function(){return g})),i.d(t,\"g\",(function(){return h}));const n=\"scratch-gui/time-travel/SET_TIME_TRAVEL\",o={year:\"NOW\"},a=\"2020\",r=\"1990\",s=\"1920\",l=\"220022BC\",u=function(e,t){return void 0===e&&(e=o),t.type===n?Object.assign({},e,{year:t.year}):e},c=function(e){return e.scratchGui.timeTravel.year===l},d=function(e){return e.scratchGui.timeTravel.year===s},p=function(e){return e.scratchGui.timeTravel.year===r},m=function(e){return e.scratchGui.timeTravel.year===a},g=function(e){return\"NOW\"===e.scratchGui.timeTravel.year},h=function(e){return{type:n,year:e}}},function(e,t,i){var n=i(1090);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1206);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1224);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1234);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n,o=i(701),a=(n=o)&&n.__esModule?n:{default:n};t.default=a.default,e.exports=t.default},function(e,t,i){\"use strict\";function n(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function o(e){this.setState(function(t){var i=this.constructor.getDerivedStateFromProps(e,t);return null!=i?i:null}.bind(this))}function a(e,t){try{var i=this.props,n=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(i,n)}finally{this.props=i,this.state=n}}function r(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error(\"Can only polyfill class components\");if(\"function\"!=typeof e.getDerivedStateFromProps&&\"function\"!=typeof t.getSnapshotBeforeUpdate)return e;var i=null,r=null,s=null;if(\"function\"==typeof t.componentWillMount?i=\"componentWillMount\":\"function\"==typeof t.UNSAFE_componentWillMount&&(i=\"UNSAFE_componentWillMount\"),\"function\"==typeof t.componentWillReceiveProps?r=\"componentWillReceiveProps\":\"function\"==typeof t.UNSAFE_componentWillReceiveProps&&(r=\"UNSAFE_componentWillReceiveProps\"),\"function\"==typeof t.componentWillUpdate?s=\"componentWillUpdate\":\"function\"==typeof t.UNSAFE_componentWillUpdate&&(s=\"UNSAFE_componentWillUpdate\"),null!==i||null!==r||null!==s){var l=e.displayName||e.name,u=\"function\"==typeof e.getDerivedStateFromProps?\"getDerivedStateFromProps()\":\"getSnapshotBeforeUpdate()\";throw Error(\"Unsafe legacy lifecycles will not be called for components using new component APIs.\\n\\n\"+l+\" uses \"+u+\" but also contains the following legacy lifecycles:\"+(null!==i?\"\\n \"+i:\"\")+(null!==r?\"\\n \"+r:\"\")+(null!==s?\"\\n \"+s:\"\")+\"\\n\\nThe above lifecycles should be removed. Learn more about this warning here:\\nhttps://fb.me/react-async-component-lifecycle-hooks\")}if(\"function\"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=n,t.componentWillReceiveProps=o),\"function\"==typeof t.getSnapshotBeforeUpdate){if(\"function\"!=typeof t.componentDidUpdate)throw new Error(\"Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype\");t.componentWillUpdate=a;var c=t.componentDidUpdate;t.componentDidUpdate=function(e,t,i){var n=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:i;c.call(this,e,t,n)}}return e}i.r(t),i.d(t,\"polyfill\",(function(){return r})),n.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,a.__suppressDeprecationWarning=!0},function(e,t,i){\"use strict\";i.d(t,\"a\",(function(){return a})),i.d(t,\"b\",(function(){return o})),i.d(t,\"c\",(function(){return r}));const n=\"scratch-gui/restore-deletion/RESTORE_UPDATE\",o={restoreFun:null,deletedItem:\"\"},a=function(e,t){return void 0===e&&(e=o),t.type===n?Object.assign({},e,t.state):e},r=function(e){return{type:n,state:{restoreFun:e.restoreFun,deletedItem:e.deletedItem}}}},function(e,t,i){\"use strict\";i.d(t,\"a\",(function(){return u})),i.d(t,\"c\",(function(){return l})),i.d(t,\"b\",(function(){return c}));var n=i(100);function o(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function a(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0;return t.type===s?a(a({},e),{},{theme:t.theme}):e},c=e=>({type:s,theme:e})},function(e,t,i){\"use strict\";i.d(t,\"b\",(function(){return u})),i.d(t,\"a\",(function(){return c})),i.d(t,\"c\",(function(){return d}));var n=i(16);const o=e=>window.matchMedia?window.matchMedia(e):null,a=o(\"(prefers-contrast: more)\"),r=o(\"(prefers-color-scheme: dark)\"),s=\"tw:theme\",l=()=>a&&a.matches?n.l.highContrast:r&&r.matches?n.l.dark:n.l.light,u=e=>a&&r&&a.addEventListener&&r.addEventListener?(a.addEventListener(\"change\",e),r.addEventListener(\"change\",e),()=>{a.removeEventListener(\"change\",e),r.removeEventListener(\"change\",e)}):()=>{},c=()=>{const e=l();try{const t=localStorage.getItem(s);if(\"dark\"===t)return n.l.dark;if(\"light\"===t)return n.l.light;const i=JSON.parse(t);return new n.l(i.accent||e.accent,i.gui||e.gui,i.blocks||e.blocks)}catch(e){}return e},d=e=>{const t=l(),i={};if(e.accent!==t.accent&&(i.accent=e.accent),e.gui!==t.gui&&(i.gui=e.gui),e.blocks!==t.blocks&&e.blocks!==n.f&&(i.blocks=e.blocks),0===Object.keys(i).length)try{localStorage.removeItem(s)}catch(e){}else try{localStorage.setItem(s,JSON.stringify(i))}catch(e){}}},function(e,t,i){\"use strict\";i.d(t,\"c\",(function(){return Se})),i.d(t,\"d\",(function(){return Me})),i.d(t,\"b\",(function(){return Ee}));var n=i(1),o=i.n(n),a=i(2),r=i(458),s=i.n(r),l=i(459),u=i.n(l),c=i(460),d=i.n(c),p=i(461),m=i.n(p),g=i(462),h=i.n(g),f=i(463),b=i.n(f),y=i(464),v=i.n(y),k=i(465),w=i.n(k),T=i(466),S=i.n(T),M=i(467),E=i.n(M),I=i(468),x=i.n(I),_=i(469),O=i.n(_),C=i(470),N=i.n(C),A=i(471),P=i.n(A),D=i(472),L=i.n(D),R=i(241),j=i.n(R),z=i(473),B=i.n(z),U=i(474),F=i.n(U),H=i(242),G=i.n(H),W=i(475),V=i.n(W),q=i(476),Y=i.n(q),Z=i(243),K=i.n(Z),Q=i(477),X=i.n(Q),J=i(478),$=i.n(J),ee=i(479),te=i.n(ee),ie=i(244),ne=i.n(ie),oe=i(480),ae=i.n(oe),re=i(481),se=i.n(re),le=i(482),ue=i.n(le),ce=i(245),de=i.n(ce),pe=i(483),me=i.n(pe),ge=i(484),he=i.n(ge),fe=i(485),be=i.n(fe),ye=i(486),ve=i.n(ye),ke=i(271),we=i.n(ke),Te=i(39);t.a=[{name:o.a.createElement(a.b,{defaultMessage:\"Music\",id:\"gui.extension.music.name\"}),extensionId:\"music\",iconURL:s.a,insetIconURL:u.a,description:o.a.createElement(a.b,{defaultMessage:\"Play instruments and drums.\",id:\"gui.extension.music.description\"}),tags:[\"scratch\"],featured:!0},{name:o.a.createElement(a.b,{defaultMessage:\"Pen\",id:\"gui.extension.pen.name\"}),extensionId:\"pen\",iconURL:d.a,insetIconURL:m.a,description:o.a.createElement(a.b,{defaultMessage:\"Draw with your sprites.\",id:\"gui.extension.pen.description\"}),tags:[\"scratch\"],featured:!0},{name:o.a.createElement(a.b,{defaultMessage:\"Video Sensing\",id:\"gui.extension.videosensing.name\"}),extensionId:\"videoSensing\",iconURL:h.a,insetIconURL:b.a,description:o.a.createElement(a.b,{defaultMessage:\"Sense motion with the camera.\",id:\"gui.extension.videosensing.description\"}),tags:[\"scratch\"],featured:!0},{name:o.a.createElement(a.b,{defaultMessage:\"Face Sensing\",id:\"tw.extension.faceSensing.name\"}),extensionId:\"faceSensing\",extensionURL:\"https://extensions.turbowarp.org/lab/face-sensing.js\",iconURL:v.a,insetIconURL:w.a,description:o.a.createElement(a.b,{defaultMessage:\"Sense faces with the camera.\",id:\"tw.extension.faceSensing.description\"}),tags:[\"scratch\"],featured:!0},{name:o.a.createElement(a.b,{defaultMessage:\"Text to Speech\",id:\"gui.extension.text2speech.name\"}),extensionId:\"text2speech\",collaborator:\"Amazon Web Services\",iconURL:S.a,insetIconURL:E.a,description:o.a.createElement(a.b,{defaultMessage:\"Make your projects talk.\",id:\"gui.extension.text2speech.description\"}),tags:[\"scratch\"],featured:!0,internetConnectionRequired:!0},{name:o.a.createElement(a.b,{defaultMessage:\"Translate\",id:\"gui.extension.translate.name\"}),extensionId:\"translate\",collaborator:\"Google\",iconURL:x.a,insetIconURL:O.a,description:o.a.createElement(a.b,{defaultMessage:\"Translate text into many languages.\",id:\"gui.extension.translate.description\"}),tags:[\"scratch\"],featured:!0,internetConnectionRequired:!0},{name:\"Makey Makey\",extensionId:\"makeymakey\",collaborator:\"JoyLabz\",iconURL:N.a,insetIconURL:P.a,description:o.a.createElement(a.b,{defaultMessage:\"Make anything into a key.\",id:\"gui.extension.makeymakey.description\"}),tags:[\"scratch\"],featured:!0},{name:\"micro:bit\",extensionId:\"microbit\",collaborator:\"micro:bit\",iconURL:L.a,insetIconURL:j.a,description:o.a.createElement(a.b,{defaultMessage:\"Connect your projects with the world.\",id:\"gui.extension.microbit.description\"}),tags:[\"scratch\"],featured:!0,disabled:!1,bluetoothRequired:!0,internetConnectionRequired:!0,launchPeripheralConnectionFlow:!0,useAutoScan:!1,connectionIconURL:B.a,connectionSmallIconURL:j.a,connectingMessage:o.a.createElement(a.b,{defaultMessage:\"Connecting\",id:\"gui.extension.microbit.connectingMessage\"}),helpLink:\"https://scratch.mit.edu/microbit\"},{name:\"LEGO MINDSTORMS EV3\",extensionId:\"ev3\",collaborator:\"LEGO\",iconURL:F.a,insetIconURL:G.a,description:o.a.createElement(a.b,{defaultMessage:\"Build interactive robots and more.\",id:\"gui.extension.ev3.description\"}),tags:[\"scratch\"],featured:!0,disabled:!1,bluetoothRequired:!0,internetConnectionRequired:!0,launchPeripheralConnectionFlow:!0,useAutoScan:!1,connectionIconURL:V.a,connectionSmallIconURL:G.a,connectingMessage:o.a.createElement(a.b,{defaultMessage:\"Connecting. Make sure the pin on your EV3 is set to 1234.\",id:\"gui.extension.ev3.connectingMessage\"}),helpLink:\"https://scratch.mit.edu/ev3\"},{name:\"LEGO BOOST\",extensionId:\"boost\",collaborator:\"LEGO\",iconURL:te.a,insetIconURL:ne.a,description:o.a.createElement(a.b,{defaultMessage:\"Bring robotic creations to life.\",id:\"gui.extension.boost.description\"}),tags:[\"scratch\"],featured:!0,disabled:!1,bluetoothRequired:!0,internetConnectionRequired:!0,launchPeripheralConnectionFlow:!0,useAutoScan:!0,connectionIconURL:ae.a,connectionSmallIconURL:ne.a,connectionTipIconURL:se.a,connectingMessage:o.a.createElement(a.b,{defaultMessage:\"Connecting\",id:\"gui.extension.boost.connectingMessage\"}),helpLink:\"https://scratch.mit.edu/boost\"},{name:\"LEGO Education WeDo 2.0\",extensionId:\"wedo2\",collaborator:\"LEGO\",iconURL:Y.a,insetIconURL:K.a,description:o.a.createElement(a.b,{defaultMessage:\"Build with motors and sensors.\",id:\"gui.extension.wedo2.description\"}),tags:[\"scratch\"],featured:!0,disabled:!1,bluetoothRequired:!0,internetConnectionRequired:!0,launchPeripheralConnectionFlow:!0,useAutoScan:!0,connectionIconURL:X.a,connectionSmallIconURL:K.a,connectionTipIconURL:$.a,connectingMessage:o.a.createElement(a.b,{defaultMessage:\"Connecting\",id:\"gui.extension.wedo2.connectingMessage\"}),helpLink:\"https://scratch.mit.edu/wedo\"},{name:\"Go Direct Force & Acceleration\",extensionId:\"gdxfor\",collaborator:\"Vernier\",iconURL:ue.a,insetIconURL:de.a,description:o.a.createElement(a.b,{defaultMessage:\"Sense push, pull, motion, and spin.\",id:\"gui.extension.gdxfor.description\"}),tags:[\"scratch\"],featured:!0,disabled:!1,bluetoothRequired:!0,internetConnectionRequired:!0,launchPeripheralConnectionFlow:!0,useAutoScan:!1,connectionIconURL:me.a,connectionSmallIconURL:de.a,connectingMessage:o.a.createElement(a.b,{defaultMessage:\"Connecting\",id:\"gui.extension.gdxfor.connectingMessage\"}),helpLink:\"https://scratch.mit.edu/vernier\"},{name:o.a.createElement(a.b,{defaultMessage:\"Custom Reporters\",id:\"tw.customReporters.name\"}),extensionId:\"procedures_enable_return\",iconURL:ve.a,description:o.a.createElement(a.b,{defaultMessage:\"Allow custom blocks to output values and be used as inputs.\",id:\"tw.customReporters.description\"}),tags:[\"tw\"],incompatibleWithScratch:!0,featured:!0},{name:o.a.createElement(a.b,{defaultMessage:\"{APP_NAME} Blocks\",id:\"tw.twExtension.name\",values:{APP_NAME:Te.APP_NAME}}),extensionId:\"tw\",iconURL:he.a,description:o.a.createElement(a.b,{defaultMessage:\"Weird new blocks.\",id:\"tw.twExtension.description\"}),incompatibleWithScratch:!0,tags:[\"tw\"],featured:!0},{name:o.a.createElement(a.b,{defaultMessage:\"Custom Extension\",id:\"tw.customExtension.name\"}),extensionId:\"custom_extension\",iconURL:be.a,description:o.a.createElement(a.b,{defaultMessage:\"Load custom extensions from URLs, files, or JavaScript source code.\",id:\"tw.customExtension.description\"}),tags:[\"tw\"],featured:!0}];const Se={name:o.a.createElement(a.b,{defaultMessage:\"{APP_NAME} Extension Gallery\",id:\"tw.extensionGallery.name\",values:{APP_NAME:Te.APP_NAME}}),href:\"https://extensions.turbowarp.org/\",extensionId:\"gallery\",iconURL:we.a,description:o.a.createElement(a.b,{defaultMessage:\"Loading extension gallery...\",id:\"tw.extensionGallery.loading\"}),tags:[\"tw\"],featured:!0},Me={name:o.a.createElement(a.b,{defaultMessage:\"{APP_NAME} Extension Gallery\",id:\"tw.extensionGallery.name\",values:{APP_NAME:Te.APP_NAME}}),href:\"https://extensions.turbowarp.org/\",extensionId:\"gallery\",iconURL:we.a,description:o.a.createElement(a.b,{defaultMessage:\"Learn more about extensions at extensions.turbowarp.org.\",id:\"tw.extensionGallery.more\"}),tags:[\"tw\"],featured:!0},Ee={name:o.a.createElement(a.b,{defaultMessage:\"{APP_NAME} Extension Gallery\",id:\"tw.extensionGallery.name\",values:{APP_NAME:Te.APP_NAME}}),href:\"https://extensions.turbowarp.org/\",extensionId:\"gallery\",iconURL:we.a,description:o.a.createElement(a.b,{defaultMessage:\"Error loading extension gallery. Visit extensions.turbowarp.org to find more extensions.\",id:\"tw.extensionGallery.error\"}),tags:[\"tw\"],featured:!0}},function(e,t,i){\"use strict\";i.d(t,\"b\",(function(){return d})),i.d(t,\"d\",(function(){return u})),i.d(t,\"a\",(function(){return m})),i.d(t,\"c\",(function(){return p})),i.d(t,\"e\",(function(){return g})),i.d(t,\"h\",(function(){return h})),i.d(t,\"f\",(function(){return f})),i.d(t,\"g\",(function(){return b}));var n=i(11);const o=\"scratch-gui/monitors/ADD_MONITOR_RECT\",a=\"scratch-gui/monitors/MOVE_MONITOR_RECT\",r=\"scratch-gui/monitors/RESIZE_MONITOR_RECT\",s=\"scratch-gui/monitors/REMOVE_MONITOR_RECT\",l=\"scratch-gui/monitors/RESET_MONITOR_LAYOUT\",u={monitors:{},savedMonitorPositions:{}},c=function(e,t){return Object.prototype.hasOwnProperty.call(e.monitors,t.monitorId)?(n.default.error(\"Can't add monitor, monitor with id \".concat(t.monitorId,\" already exists.\")),e):(i=t.upperStart,o=t.lowerEnd,!(isNaN(i.x)||isNaN(i.y)||isNaN(o.x)||isNaN(o.y))&&i.xe-t)),a.sort(((e,t)=>e-t));let l=null;for(const t of o)if(t!==r){r=t;e:for(const o of a){if(o===s)continue;s=o;const a={upperStart:{x:t+5,y:o+5},lowerEnd:{x:t+5+i,y:o+5+n}},r={upperStart:{x:t,y:o},lowerEnd:{x:t+i+10,y:o+n+10}};for(const t in e.monitors)if(u=e.monitors[t],c=r,!(u.upperStart.x>=c.lowerEnd.x||c.upperStart.x>=u.lowerEnd.x||u.upperStart.y>=c.lowerEnd.y||c.upperStart.y>=u.lowerEnd.y))continue e;if(!(r.lowerEnd.x>400||r.lowerEnd.y>300))return a;l||r.upperStart.x+40>400||r.upperStart.y+40>300||(l=a)}}var u,c;if(l)return l;const d=Math.ceil(200*Math.random()),p=Math.ceil(260*Math.random());return{upperStart:{x:d,y:p},lowerEnd:{x:d+i,y:p+n}}},m=function(e,t,i,n){return{type:o,monitorId:e,upperStart:t,lowerEnd:i,savePosition:n}},g=function(e,t,i){return{type:a,monitorId:e,newX:t,newY:i}},h=function(e,t,i){return{type:r,monitorId:e,newWidth:t,newHeight:i}},f=function(e){return{type:s,monitorId:e}},b=function(){return{type:l}}},function(e,t,i){\"use strict\";const n={event(){}};t.a=n},function(e,t,i){var n=i(1030);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1091);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1213);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t){const i=\"!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";e.exports=function(){const e=i.length,t=[];for(let n=0;n<20;n++)t[n]=i.charAt(Math.random()*e);return t.join(\"\")}},function(e,t,i){\"use strict\";(function(e){var n=i(709),o=i(710),a=i(711);function r(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(r()=r())throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+r().toString(16)+\" bytes\");return 0|e}function g(e,t){if(l.isBuffer(e))return e.length;if(\"undefined\"!=typeof ArrayBuffer&&\"function\"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;\"string\"!=typeof e&&(e=\"\"+e);var i=e.length;if(0===i)return 0;for(var n=!1;;)switch(t){case\"ascii\":case\"latin1\":case\"binary\":return i;case\"utf8\":case\"utf-8\":case void 0:return F(e).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*i;case\"hex\":return i>>>1;case\"base64\":return H(e).length;default:if(n)return F(e).length;t=(\"\"+t).toLowerCase(),n=!0}}function h(e,t,i){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return\"\";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return\"\";if((i>>>=0)<=(t>>>=0))return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return C(this,t,i);case\"utf8\":case\"utf-8\":return I(this,t,i);case\"ascii\":return _(this,t,i);case\"latin1\":case\"binary\":return O(this,t,i);case\"base64\":return E(this,t,i);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return N(this,t,i);default:if(n)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),n=!0}}function f(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function b(e,t,i,n,o){if(0===e.length)return-1;if(\"string\"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=o?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(o)return-1;i=e.length-1}else if(i<0){if(!o)return-1;i=0}if(\"string\"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:y(e,t,i,n,o);if(\"number\"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&\"function\"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):y(e,[t],i,n,o);throw new TypeError(\"val must be string, number or Buffer\")}function y(e,t,i,n,o){var a,r=1,s=e.length,l=t.length;if(void 0!==n&&(\"ucs2\"===(n=String(n).toLowerCase())||\"ucs-2\"===n||\"utf16le\"===n||\"utf-16le\"===n)){if(e.length<2||t.length<2)return-1;r=2,s/=2,l/=2,i/=2}function u(e,t){return 1===r?e[t]:e.readUInt16BE(t*r)}if(o){var c=-1;for(a=i;as&&(i=s-l),a=i;a>=0;a--){for(var d=!0,p=0;po&&(n=o):n=o;var a=t.length;if(a%2!=0)throw new TypeError(\"Invalid hex string\");n>a/2&&(n=a/2);for(var r=0;r>8,o=i%256,a.push(o),a.push(n);return a}(t,e.length-i),e,i,n)}function E(e,t,i){return 0===t&&i===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,i))}function I(e,t,i){i=Math.min(e.length,i);for(var n=[],o=t;o239?4:u>223?3:u>191?2:1;if(o+d<=i)switch(d){case 1:u<128&&(c=u);break;case 2:128==(192&(a=e[o+1]))&&(l=(31&u)<<6|63&a)>127&&(c=l);break;case 3:a=e[o+1],r=e[o+2],128==(192&a)&&128==(192&r)&&(l=(15&u)<<12|(63&a)<<6|63&r)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:a=e[o+1],r=e[o+2],s=e[o+3],128==(192&a)&&128==(192&r)&&128==(192&s)&&(l=(15&u)<<18|(63&a)<<12|(63&r)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,d=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),o+=d}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var i=\"\",n=0;for(;n0&&(e=this.toString(\"hex\",0,i).match(/.{2}/g).join(\" \"),this.length>i&&(e+=\" ... \")),\"\"},l.prototype.compare=function(e,t,i,n,o){if(!l.isBuffer(e))throw new TypeError(\"Argument must be a Buffer\");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||i>e.length||n<0||o>this.length)throw new RangeError(\"out of range index\");if(n>=o&&t>=i)return 0;if(n>=o)return-1;if(t>=i)return 1;if(this===e)return 0;for(var a=(o>>>=0)-(n>>>=0),r=(i>>>=0)-(t>>>=0),s=Math.min(a,r),u=this.slice(n,o),c=e.slice(t,i),d=0;do)&&(i=o),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");n||(n=\"utf8\");for(var a=!1;;)switch(n){case\"hex\":return v(this,e,t,i);case\"utf8\":case\"utf-8\":return k(this,e,t,i);case\"ascii\":return w(this,e,t,i);case\"latin1\":case\"binary\":return T(this,e,t,i);case\"base64\":return S(this,e,t,i);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return M(this,e,t,i);default:if(a)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),a=!0}},l.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function _(e,t,i){var n=\"\";i=Math.min(e.length,i);for(var o=t;on)&&(i=n);for(var o=\"\",a=t;ai)throw new RangeError(\"Trying to access beyond buffer length\")}function P(e,t,i,n,o,a){if(!l.isBuffer(e))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError(\"Index out of range\")}function D(e,t,i,n){t<0&&(t=65535+t+1);for(var o=0,a=Math.min(e.length-i,2);o>>8*(n?o:1-o)}function L(e,t,i,n){t<0&&(t=4294967295+t+1);for(var o=0,a=Math.min(e.length-i,4);o>>8*(n?o:3-o)&255}function R(e,t,i,n,o,a){if(i+n>e.length)throw new RangeError(\"Index out of range\");if(i<0)throw new RangeError(\"Index out of range\")}function j(e,t,i,n,a){return a||R(e,0,i,4),o.write(e,t,i,n,23,4),i+4}function z(e,t,i,n,a){return a||R(e,0,i,8),o.write(e,t,i,n,52,8),i+8}l.prototype.slice=function(e,t){var i,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(o*=256);)n+=this[e+--t]*o;return n},l.prototype.readUInt8=function(e,t){return t||A(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||A(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||A(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||A(e,t,this.length);for(var n=this[e],o=1,a=0;++a=(o*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||A(e,t,this.length);for(var n=t,o=1,a=this[e+--n];n>0&&(o*=256);)a+=this[e+--n]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readInt8=function(e,t){return t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||A(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt16BE=function(e,t){t||A(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt32LE=function(e,t){return t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||A(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||A(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||A(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||A(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,i,n){(e=+e,t|=0,i|=0,n)||P(this,e,t,i,Math.pow(2,8*i)-1,0);var o=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+o]=e/a&255;return t+i},l.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):L(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*i-1);P(this,e,t,i,o-1,-o)}var a=0,r=1,s=0;for(this[t]=255&e;++a=0&&(r*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/r|0)-s&255;return t+i},l.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):L(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,i){return j(this,e,t,!0,i)},l.prototype.writeFloatBE=function(e,t,i){return j(this,e,t,!1,i)},l.prototype.writeDoubleLE=function(e,t,i){return z(this,e,t,!0,i)},l.prototype.writeDoubleBE=function(e,t,i){return z(this,e,t,!1,i)},l.prototype.copy=function(e,t,i,n){if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError(\"sourceStart out of bounds\");if(n<0)throw new RangeError(\"sourceEnd out of bounds\");n>this.length&&(n=this.length),e.length-t=0;--o)e[o+t]=this[o+i];else if(a<1e3||!l.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),\"number\"==typeof e)for(a=t;a55295&&i<57344){if(!o){if(i>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(r+1===n){(t-=3)>-1&&a.push(239,191,189);continue}o=i;continue}if(i<56320){(t-=3)>-1&&a.push(239,191,189),o=i;continue}i=65536+(o-55296<<10|i-56320)}else o&&(t-=3)>-1&&a.push(239,191,189);if(o=null,i<128){if((t-=1)<0)break;a.push(i)}else if(i<2048){if((t-=2)<0)break;a.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;a.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error(\"Invalid code point\");if((t-=4)<0)break;a.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return a}function H(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\\s+|\\s+$/g,\"\")}(e).replace(B,\"\")).length<2)return\"\";for(;e.length%4!=0;)e+=\"=\";return e}(e))}function G(e,t,i,n){for(var o=0;o=t.length||o>=e.length);++o)t[o+i]=e[o];return o}}).call(this,i(53))},function(e,t,i){var n=i(74),o=i(57),a=i(197),r=i(149),s=i(148),l=\"prototype\",u=function(e,t,i){var c,d,p,m=e&u.F,g=e&u.G,h=e&u.S,f=e&u.P,b=e&u.B,y=e&u.W,v=g?o:o[t]||(o[t]={}),k=v[l],w=g?n:h?n[t]:(n[t]||{})[l];for(c in g&&(i=t),i)(d=!m&&w&&void 0!==w[c])&&s(v,c)||(p=d?w[c]:i[c],v[c]=g&&\"function\"!=typeof w[c]?i[c]:b&&d?a(p,n):y&&w[c]==p?function(e){var t=function(t,i,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,i)}return new e(t,i,n)}return e.apply(this,arguments)};return t[l]=e[l],t}(p):f&&\"function\"==typeof p?a(Function.call,p):p,f&&((v.virtual||(v.virtual={}))[c]=p,e&u.R&&k&&!k[c]&&r(k,c,p)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,i){var n=i(127);e.exports=function(e){if(!n(e))throw TypeError(e+\" is not an object!\");return e}},function(e,t,i){\"use strict\";i.r(t),i.d(t,\"TextEncoder\",(function(){return n})),i.d(t,\"TextDecoder\",(function(){return o}));const n=\"function\"==typeof TextEncoder?TextEncoder:class{constructor(e){if(null!=e&&\"utf-8\"!==e&&\"utf8\"!==e)throw new Error(\"Encoding is not supported\");this.encoding=\"utf-8\"}encode(e){if(\"string\"!=typeof e)throw new TypeError(\"Argument is not a string\");e=unescape(encodeURIComponent(e));const t=new Uint8Array(e.length);for(let i=0;ir.a.createElement(\"div\",{\"aria-label\":\"Close\",className:l()(c.a.closeButton,e.className,{[c.a.small]:e.size===y.SIZE_SMALL,[c.a.large]:e.size===y.SIZE_LARGE,[c.a.orange]:e.color===y.COLOR_ORANGE}),role:\"button\",tabIndex:\"0\",onClick:e.onClick},\"back\"===e.buttonType?r.a.createElement(\"img\",{className:c.a.backIcon,src:f.a,draggable:!1}):r.a.createElement(\"img\",{className:l()(c.a.closeIcon,{[c.a[e.color]]:e.color!==y.COLOR_NEUTRAL}),src:e.color&&b[e.color]?b[e.color]:p.a,draggable:!1}));y.SIZE_SMALL=\"small\",y.SIZE_LARGE=\"large\",y.COLOR_NEUTRAL=\"neutral\",y.COLOR_GREEN=\"green\",y.COLOR_ORANGE=\"orange\",b={[y.COLOR_NEUTRAL]:p.a,[y.COLOR_GREEN]:p.a,[y.COLOR_ORANGE]:g.a},y.propTypes={buttonType:o.a.oneOf([\"back\",\"close\"]),className:o.a.string,color:o.a.string,onClick:o.a.func.isRequired,size:o.a.oneOf([y.SIZE_SMALL,y.SIZE_LARGE])},y.defaultProps={color:y.COLOR_NEUTRAL,size:y.SIZE_LARGE,buttonType:\"close\"},t.a=y},function(e,t,i){var n=i(1201);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){const n=i(107),o=i(223);class a{constructor(e,t,i,o){switch(this.id=e||n(),this.name=t,this.type=i,this.isCloud=o,this.type){case a.SCALAR_TYPE:this.value=0;break;case a.LIST_TYPE:this.value=[];break;case a.BROADCAST_MESSAGE_TYPE:this.value=this.name;break;default:throw new Error(\"Invalid variable type: \".concat(this.type))}}toXML(e){return e=!0===e,'').concat(o(this.name),\"\")}static get SCALAR_TYPE(){return\"\"}static get LIST_TYPE(){return\"list\"}static get BROADCAST_MESSAGE_TYPE(){return\"broadcast_msg\"}}e.exports=a},function(e,t,i){const n=i(46),{InputOpcode:o,InputType:a}=i(125),r=i(38);class s{static getNumberInputType(e){if(\"number\"!=typeof e)throw new Error(\"Expected a number.\");return e===1/0?a.NUMBER_POS_INF:e===-1/0?a.NUMBER_NEG_INF:e<0?Number.isInteger(e)?a.NUMBER_NEG_INT:a.NUMBER_NEG_FRACT:e>0?Number.isInteger(e)?a.NUMBER_POS_INT:a.NUMBER_POS_FRACT:Number.isNaN(e)?a.NUMBER_NAN:Object.is(e,-0)?a.NUMBER_NEG_ZERO:a.NUMBER_ZERO}constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.opcode=e,this.type=t,this.inputs=i,this.yields=n}isConstant(e){if(this.opcode!==o.CONSTANT)return!1;let t=this.inputs.value===e;return t||\"number\"!=typeof e||(t=+this.inputs.value===e),t}isAlwaysType(e){return(this.type&e)===this.type}isSometimesType(e){return 0!==(this.type&e)}toType(e){let t;switch(e){case a.BOOLEAN:t=o.CAST_BOOLEAN;break;case a.NUMBER:t=o.CAST_NUMBER;break;case a.NUMBER_INDEX:t=o.CAST_NUMBER_INDEX;break;case a.NUMBER_OR_NAN:t=o.CAST_NUMBER_OR_NAN;break;case a.STRING:t=o.CAST_STRING;break;case a.COLOR:t=o.CAST_COLOR;break;default:throw r.warn(\"Cannot cast to type: \".concat(e),this),new Error(\"Cannot cast to type: \".concat(e))}if(this.isAlwaysType(e))return this;if(this.opcode===o.CONSTANT){switch(t){case o.CAST_BOOLEAN:this.inputs.value=n.toBoolean(this.inputs.value),this.type=a.BOOLEAN;break;case o.CAST_NUMBER:case o.CAST_NUMBER_INDEX:case o.CAST_NUMBER_OR_NAN:{this.isAlwaysType(a.BOOLEAN_INTERPRETABLE)&&(this.type=a.NUMBER,this.inputs.value=+n.toBoolean(this.inputs.value));const e=+this.inputs.value;e?this.inputs.value=e:Object.is(e,-0)?this.inputs.value=-0:this.inputs.value=0,t===o.CAST_NUMBER_INDEX&&(this.inputs.value|=0),this.type=s.getNumberInputType(this.inputs.value);break}case o.CAST_STRING:this.inputs.value+=\"\",this.type=a.STRING;break;case o.CAST_COLOR:this.inputs.value=n.toRgbColorList(this.inputs.value),this.type=a.COLOR}return this}return new s(t,e,{target:this})}}e.exports={IntermediateStackBlock:class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.opcode=e,this.inputs=t,this.yields=i,this.ignoreState=!1,this.entryState=null,this.exitState=null}},IntermediateInput:s,IntermediateStack:class{constructor(e){this.blocks=null!=e?e:[]}},IntermediateScript:class{constructor(){this.topBlockId=null,this.stack=null,this.isProcedure=!1,this.procedureVariant=\"\",this.procedureCode=\"\",this.arguments=[],this.isWarp=!1,this.yields=!0,this.warpTimer=!1,this.dependedProcedures=[],this.cachedCompileResult=null,this.cachedAnalysisEndState=null,this.executableHat=!1}},IntermediateRepresentation:class{constructor(e,t){this.entry=e,this.procedures=t}getProcedure(e){return Object.values(this.procedures).find((t=>t.procedureCode===e))}},stringifyType:e=>{let t=[];for(const i in a){const n=a[i];if((n&e)===n){for(const e of t)a[e];t=t.filter((e=>(a[e]&n)!==a[e])),t.push(i)}}let i=null;for(const e of t)i=null===i?e:\"\".concat(i,\" | \").concat(e);return null===i?\"INVALID\":i}}},function(e,t,i){var n;\"undefined\"!=typeof self&&self,n=function(){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,\"a\",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p=\"\",i(i.s=9)}([function(e,t,i){\"use strict\";t.__esModule=!0,t.copyExistingProperties=function(e,t){Object.keys(t).forEach((function(i){t.hasOwnProperty(i)&&e.hasOwnProperty(i)&&(t[i]=e[i])}))},t.copyNamedProperties=function(e,t,i){e.forEach((function(e){var n=t[e];void 0!==n&&(i[e]=n)}))},t.isBuffer=function(e,t){return r||(r=e.createBuffer()),t instanceof r.constructor},t.isRenderbuffer=function(e,t){return s||(s=e.createRenderbuffer()),t instanceof s.constructor},t.isShader=function(e,t){return l||(l=e.createShader(e.VERTEX_SHADER)),t instanceof l.constructor},t.isTexture=function(e,t){return u||(u=e.createTexture()),t instanceof u.constructor},t.isSampler=function(e,t){if(!c){if(!e.createSampler)return!1;c=e.createSampler()}return t instanceof c.constructor},t.warn=t.error=void 0;var n,o=(n=i(2))&&n.__esModule?n:{default:n},a=o.default.console&&o.default.console.error&&\"function\"==typeof o.default.console.error?o.default.console.error.bind(o.default.console):function(){};t.error=a;var r,s,l,u,c,d=o.default.console&&o.default.console.warn&&\"function\"==typeof o.default.console.warn?o.default.console.warn.bind(o.default.console):function(){};t.warn=d},function(e,t,i){\"use strict\";t.__esModule=!0,t.getGLTypeForTypedArray=function(e){if(e instanceof Int8Array)return a;if(e instanceof Uint8Array)return r;if(e instanceof Uint8ClampedArray)return r;if(e instanceof Int16Array)return s;if(e instanceof Uint16Array)return l;if(e instanceof Int32Array)return u;if(e instanceof Uint32Array)return c;if(e instanceof Float32Array)return d;throw\"unsupported typed array type\"},t.getGLTypeForTypedArrayType=function(e){if(e===Int8Array)return a;if(e===Uint8Array)return r;if(e===Uint8ClampedArray)return r;if(e===Int16Array)return s;if(e===Uint16Array)return l;if(e===Int32Array)return u;if(e===Uint32Array)return c;if(e===Float32Array)return d;throw\"unsupported typed array type\"},t.getTypedArrayTypeForGLType=function(e){var t=p[e];if(!t)throw\"unknown gl type\";return t},t.isArrayBuffer=void 0;var n,o=(n=i(2))&&n.__esModule?n:{default:n},a=5120,r=5121,s=5122,l=5123,u=5124,c=5125,d=5126,p={},m=p;m[a]=Int8Array,m[r]=Uint8Array,m[s]=Int16Array,m[l]=Uint16Array,m[u]=Int32Array,m[c]=Uint32Array,m[d]=Float32Array,m[32819]=Uint16Array,m[32820]=Uint16Array,m[33635]=Uint16Array,m[5131]=Uint16Array,m[33640]=Uint32Array,m[35899]=Uint32Array,m[35902]=Uint32Array,m[36269]=Uint32Array,m[34042]=Uint32Array;var g=o.default.SharedArrayBuffer?function(e){return e&&e.buffer&&(e.buffer instanceof ArrayBuffer||e.buffer instanceof o.default.SharedArrayBuffer)}:function(e){return e&&e.buffer&&e.buffer instanceof ArrayBuffer};t.isArrayBuffer=g},function(e,t,i){\"use strict\";t.__esModule=!0,t.default=void 0;var n=void 0!==n?n:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{};t.default=n},function(e,t,i){\"use strict\";t.__esModule=!0,t.add=function(e,t,i){return(i=i||new n(3))[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i},t.copy=function(e,t){return(t=t||new n(3))[0]=e[0],t[1]=e[1],t[2]=e[2],t},t.create=function(e,t,i){var o=new n(3);return e&&(o[0]=e),t&&(o[1]=t),i&&(o[2]=i),o},t.cross=function(e,t,i){i=i||new n(3);var o=e[2]*t[0]-e[0]*t[2],a=e[0]*t[1]-e[1]*t[0];return i[0]=e[1]*t[2]-e[2]*t[1],i[1]=o,i[2]=a,i},t.distance=function(e,t){var i=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2];return Math.sqrt(i*i+n*n+o*o)},t.distanceSq=function(e,t){var i=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2];return i*i+n*n+o*o},t.divide=function(e,t,i){return(i=i||new n(3))[0]=e[0]/t[0],i[1]=e[1]/t[1],i[2]=e[2]/t[2],i},t.divScalar=function(e,t,i){return(i=i||new n(3))[0]=e[0]/t,i[1]=e[1]/t,i[2]=e[2]/t,i},t.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},t.lerp=function(e,t,i,o){return(o=o||new n(3))[0]=(1-i)*e[0]+i*t[0],o[1]=(1-i)*e[1]+i*t[1],o[2]=(1-i)*e[2]+i*t[2],o},t.length=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])},t.lengthSq=function(e){return e[0]*e[0]+e[1]*e[1]+e[2]*e[2]},t.mulScalar=function(e,t,i){return(i=i||new n(3))[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i},t.multiply=function(e,t,i){return(i=i||new n(3))[0]=e[0]*t[0],i[1]=e[1]*t[1],i[2]=e[2]*t[2],i},t.negate=function(e,t){return(t=t||new n(3))[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},t.normalize=function(e,t){t=t||new n(3);var i=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],o=Math.sqrt(i);return o>1e-5?(t[0]=e[0]/o,t[1]=e[1]/o,t[2]=e[2]/o):(t[0]=0,t[1]=0,t[2]=0),t},t.setDefaultType=function(e){var t=n;return n=e,t},t.subtract=function(e,t,i){return(i=i||new n(3))[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i};var n=Float32Array},function(e,t,i){\"use strict\";t.__esModule=!0,t.isWebGL1=function(e){return!e.texStorage2D},t.isWebGL2=function(e){return!!e.texStorage2D},t.glEnumToString=void 0;var n,o,a=(n={},o={},function(e,t){return function(e){var t=e.constructor.name;if(!n[t]){for(var i in e)if(\"number\"==typeof e[i]){var a=o[e[i]];o[e[i]]=a?\"\".concat(a,\" | \").concat(i):i}n[t]=!0}}(e),o[t]||\"0x\"+t.toString(16)});t.glEnumToString=a},function(e,t,i){\"use strict\";t.__esModule=!0,t.createAttributeSetters=q,t.createProgram=L,t.createProgramFromScripts=function(e,t,i,n,o){for(var a=N(i,n,o),r=[],s=0;s=0?_.FRAGMENT_SHADER:e.indexOf(\"vert\")>=0?_.VERTEX_SHADER:void 0}function D(e,t){t.forEach((function(t){e.deleteShader(t)}))}function L(e,t,i,n,o){for(var r=N(i,n,o),s=[],l=[],u=0;u1&&\"[0]\"===n.name.substr(-3),s=n.type,l=h[s];if(!l)throw\"unknown type: 0x\"+s.toString(16);if(l.bindPoint){var u=i;i+=n.size,o=r?l.arraySetter(e,s,u,a,n.size):l.setter(e,s,u,a,n.size)}else o=l.arraySetter&&r?l.arraySetter(e,a):l.setter(e,a);return o.location=a,o}for(var o={},a=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),r=0;r0)throw\"numComponents \"+a+\" not correct for length \"+o;return r}(t),i},t.createBufferFromArray=y,t.createBufferFromTypedArray=l,t.createBufferInfoFromArrays=function(e,t){var i={attribs:f(e,t)},o=t.indices;if(o){var a=h(o,\"indices\");i.indices=l(e,a,e.ELEMENT_ARRAY_BUFFER),i.numElements=a.length,i.elementType=n.getGLTypeForTypedArray(a)}else i.numElements=function(e,t){var i,n;for(n=0;n0)throw\"Can not guess numComponents for attribute '\"+e+\"'. Tried \"+i+\" but \"+t+\" values is not evenly divisible by \"+i+\". You should specify it.\";return i}function g(e,t){return e.numComponents||e.size||m(t,c(e).length)}function h(e,t){if(n.isArrayBuffer(e))return e;if(n.isArrayBuffer(e.data))return e.data;Array.isArray(e)&&(e={data:e});var i=e.type;return i||(i=u(t)?Uint16Array:Float32Array),new i(e.data)}function f(e,t){var i={};return Object.keys(t).forEach((function(o){if(!u(o)){var a,s,c,d,p,f=t[o],b=f.attrib||f.name||f.attribName||r.attribPrefix+o;if(\"number\"==typeof f||\"number\"==typeof f.data){p=f.data||f;var y=f.type||Float32Array,v=p*y.BYTES_PER_ELEMENT;s=n.getGLTypeForTypedArrayType(y),c=void 0!==f.normalize?f.normalize:(w=y)===Int8Array||w===Uint8Array,d=f.numComponents||f.size||m(o,p),a=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,a),e.bufferData(e.ARRAY_BUFFER,v,f.drawType||e.STATIC_DRAW)}else{var k=h(f,o);a=l(e,k,void 0,f.drawType),s=n.getGLTypeForTypedArray(k),c=void 0!==f.normalize?f.normalize:function(e){return e instanceof Int8Array||e instanceof Uint8Array}(k),d=g(f,o),p=k.length}i[b]={buffer:a,numComponents:d,type:s,normalize:c,stride:f.stride||0,offset:f.offset||0,divisor:void 0===f.divisor?void 0:f.divisor,drawType:f.drawType}}var w})),e.bindBuffer(e.ARRAY_BUFFER,null),i}var b=[\"position\",\"positions\",\"a_position\"];function y(e,t,i){var n=\"indices\"===i?e.ELEMENT_ARRAY_BUFFER:e.ARRAY_BUFFER;return l(e,h(t,i),n)}},function(e,t,i){\"use strict\";t.__esModule=!0,t.setTextureDefaults_=function(e){r.copyExistingProperties(e,u),e.textureColor&&W(e.textureColor)},t.createSampler=$,t.createSamplers=function(e,t){var i={};return Object.keys(t).forEach((function(n){i[n]=$(e,t[n])})),i},t.setSamplerParameters=J,t.createTexture=ge,t.setEmptyTexture=me,t.setTextureFromArray=pe,t.loadTextureFromUrl=ue,t.setTextureFromElement=oe,t.setTextureFilteringForSize=ee,t.setTextureParameters=X,t.setDefaultTextureColor=W,t.createTextures=function(e,t,i){i=i||ae;var n=0,o=[],a={},r={};function s(){0===n&&setTimeout((function(){i(o.length?o:void 0,a,r)}),0)}return Object.keys(t).forEach((function(i){var l,u,c=t[i];(\"string\"==typeof(u=c.src)||Array.isArray(u)&&\"string\"==typeof u[0])&&(l=function(e,t,a){r[i]=a,--n,e&&o.push(e),s()},++n),a[i]=ge(e,c,l)})),s(),a},t.resizeTexture=function(e,t,i,n,o){n=n||i.width,o=o||i.height;var a=i.target||e.TEXTURE_2D;e.bindTexture(a,t);var r,s=i.level||0,l=i.internalFormat||i.format||e.RGBA,u=U(l),d=i.format||u.format,p=i.src;if(r=p&&(c(p)||Array.isArray(p)&&\"number\"==typeof p[0])?i.type||H(e,p,u.type):i.type||u.type,a===e.TEXTURE_CUBE_MAP)for(var m=0;m<6;++m)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,s,l,n,o,0,d,r,null);else e.texImage2D(a,s,l,n,o,0,d,r,null)},t.getNumComponentsForFormat=function(e){var t=L[e];if(!t)throw\"unknown format: \"+e;return t.numColorComponents},t.getBytesPerElementForInternalFormat=B;var n,o=l(i(4)),a=l(i(1)),r=l(i(0)),s=(n=i(2))&&n.__esModule?n:{default:n};function l(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,i):{};n.get||n.set?Object.defineProperty(t,i,n):t[i]=e[i]}return t.default=e,t}var u={textureColor:new Uint8Array([128,192,255,255]),textureOptions:{},crossOrigin:void 0},c=a.isArrayBuffer,d=s.default.document&&s.default.document.createElement?s.default.document.createElement(\"canvas\").getContext(\"2d\"):null,p=6406,m=6407,g=6408,h=6409,f=6410,b=6402,y=34041,v=5120,k=5121,w=5122,T=5123,S=5124,M=5125,E=5126,I=5131,x=36193,_=33640,O=33319,C=33320,N=6403,A=36244,P=36248,D=36249,L={},R=L;R[6406]={numColorComponents:1},R[6409]={numColorComponents:1},R[6410]={numColorComponents:2},R[m]={numColorComponents:3},R[g]={numColorComponents:4},R[N]={numColorComponents:1},R[36244]={numColorComponents:1},R[O]={numColorComponents:2},R[33320]={numColorComponents:2},R[m]={numColorComponents:3},R[36248]={numColorComponents:3},R[g]={numColorComponents:4},R[36249]={numColorComponents:4},R[6402]={numColorComponents:1},R[34041]={numColorComponents:2};var j={},z=j;function B(e,t){var i=j[e];if(!i)throw\"unknown internal format\";var n=i.bytesPerElementMap[t];if(void 0===n)throw\"unknown internal format\";return n}function U(e){var t=j[e];if(!t)throw\"unknown internal format\";return{format:t.textureFormat,type:Array.isArray(t.type)?t.type[0]:t.type}}function F(e){return!(e&e-1)}function H(e,t,i){return c(t)?a.getGLTypeForTypedArray(t):i||e.UNSIGNED_BYTE}function G(e,t,i,n,o){if(o%1!=0)throw\"can't guess dimensions\";if(i||n){if(n){if(!i&&(i=o/n)%1)throw\"can't guess dimensions\"}else if((n=o/i)%1)throw\"can't guess dimensions\"}else{var a=Math.sqrt(o/(t===e.TEXTURE_CUBE_MAP?6:1));a%1==0?(i=a,n=a):(i=o,n=1)}return{width:i,height:n}}function W(e){u.textureColor=new Uint8Array([255*e[0],255*e[1],255*e[2],255*e[3]])}z[6406]={textureFormat:p,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[k,I,x,E]},z[6409]={textureFormat:h,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[k,I,x,E]},z[6410]={textureFormat:f,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2,4,4,8],type:[k,I,x,E]},z[m]={textureFormat:m,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,6,6,12,2],type:[k,I,x,E,33635]},z[g]={textureFormat:g,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,8,8,16,2,2],type:[k,I,x,E,32819,32820]},z[33321]={textureFormat:N,colorRenderable:!0,textureFilterable:!0,bytesPerElement:1,type:k},z[36756]={textureFormat:N,colorRenderable:!1,textureFilterable:!0,bytesPerElement:1,type:v},z[33325]={textureFormat:N,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4,2],type:[E,I]},z[33326]={textureFormat:N,colorRenderable:!1,textureFilterable:!1,bytesPerElement:4,type:E},z[33330]={textureFormat:A,colorRenderable:!0,textureFilterable:!1,bytesPerElement:1,type:k},z[33329]={textureFormat:A,colorRenderable:!0,textureFilterable:!1,bytesPerElement:1,type:v},z[33332]={textureFormat:A,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:T},z[33331]={textureFormat:A,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:w},z[33334]={textureFormat:A,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:M},z[33333]={textureFormat:A,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:S},z[33323]={textureFormat:O,colorRenderable:!0,textureFilterable:!0,bytesPerElement:2,type:k},z[36757]={textureFormat:O,colorRenderable:!1,textureFilterable:!0,bytesPerElement:2,type:v},z[33327]={textureFormat:O,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[8,4],type:[E,I]},z[33328]={textureFormat:O,colorRenderable:!1,textureFilterable:!1,bytesPerElement:8,type:E},z[33336]={textureFormat:C,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:k},z[33335]={textureFormat:C,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:v},z[33338]={textureFormat:C,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:T},z[33337]={textureFormat:C,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:w},z[33340]={textureFormat:C,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:M},z[33339]={textureFormat:C,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:S},z[32849]={textureFormat:m,colorRenderable:!0,textureFilterable:!0,bytesPerElement:3,type:k},z[35905]={textureFormat:m,colorRenderable:!1,textureFilterable:!0,bytesPerElement:3,type:k},z[36194]={textureFormat:m,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,2],type:[k,33635]},z[36758]={textureFormat:m,colorRenderable:!1,textureFilterable:!0,bytesPerElement:3,type:v},z[35898]={textureFormat:m,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[E,I,35899]},z[35901]={textureFormat:m,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[E,I,35902]},z[34843]={textureFormat:m,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6],type:[E,I]},z[34837]={textureFormat:m,colorRenderable:!1,textureFilterable:!1,bytesPerElement:12,type:E},z[36221]={textureFormat:P,colorRenderable:!1,textureFilterable:!1,bytesPerElement:3,type:k},z[36239]={textureFormat:P,colorRenderable:!1,textureFilterable:!1,bytesPerElement:3,type:v},z[36215]={textureFormat:P,colorRenderable:!1,textureFilterable:!1,bytesPerElement:6,type:T},z[36233]={textureFormat:P,colorRenderable:!1,textureFilterable:!1,bytesPerElement:6,type:w},z[36209]={textureFormat:P,colorRenderable:!1,textureFilterable:!1,bytesPerElement:12,type:M},z[36227]={textureFormat:P,colorRenderable:!1,textureFilterable:!1,bytesPerElement:12,type:S},z[32856]={textureFormat:g,colorRenderable:!0,textureFilterable:!0,bytesPerElement:4,type:k},z[35907]={textureFormat:g,colorRenderable:!0,textureFilterable:!0,bytesPerElement:4,type:k},z[36759]={textureFormat:g,colorRenderable:!1,textureFilterable:!0,bytesPerElement:4,type:v},z[32855]={textureFormat:g,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2,4],type:[k,32820,_]},z[32854]={textureFormat:g,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2],type:[k,32819]},z[32857]={textureFormat:g,colorRenderable:!0,textureFilterable:!0,bytesPerElement:4,type:_},z[34842]={textureFormat:g,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[16,8],type:[E,I]},z[34836]={textureFormat:g,colorRenderable:!1,textureFilterable:!1,bytesPerElement:16,type:E},z[36220]={textureFormat:D,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:k},z[36238]={textureFormat:D,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:v},z[36975]={textureFormat:D,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:_},z[36214]={textureFormat:D,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:T},z[36232]={textureFormat:D,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:w},z[36226]={textureFormat:D,colorRenderable:!0,textureFilterable:!1,bytesPerElement:16,type:S},z[36208]={textureFormat:D,colorRenderable:!0,textureFilterable:!1,bytesPerElement:16,type:M},z[33189]={textureFormat:b,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[T,M]},z[33190]={textureFormat:b,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:M},z[36012]={textureFormat:b,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:E},z[35056]={textureFormat:y,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:34042},z[36013]={textureFormat:y,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:36269},Object.keys(z).forEach((function(e){var t=z[e];if(t.bytesPerElementMap={},Array.isArray(t.bytesPerElement))t.bytesPerElement.forEach((function(e,i){var n=t.type[i];t.bytesPerElementMap[n]=e}));else{var i=t.type;t.bytesPerElementMap[i]=t.bytesPerElement}}));var V={};function q(e,t){void 0!==t.colorspaceConversion&&(V.colorspaceConversion=e.getParameter(e.UNPACK_COLORSPACE_CONVERSION_WEBGL),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.colorspaceConversion)),void 0!==t.premultiplyAlpha&&(V.premultiplyAlpha=e.getParameter(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha)),void 0!==t.flipY&&(V.flipY=e.getParameter(e.UNPACK_FLIP_Y_WEBGL),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t.flipY))}function Y(e,t){void 0!==t.colorspaceConversion&&e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,V.colorspaceConversion),void 0!==t.premultiplyAlpha&&e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,V.premultiplyAlpha),void 0!==t.flipY&&e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,V.flipY)}function Z(e){V.unpackAlignment=e.getParameter(e.UNPACK_ALIGNMENT),o.isWebGL2(e)&&(V.unpackRowLength=e.getParameter(e.UNPACK_ROW_LENGTH),V.unpackImageHeight=e.getParameter(e.UNPACK_IMAGE_HEIGHT),V.unpackSkipPixels=e.getParameter(e.UNPACK_SKIP_PIXELS),V.unpackSkipRows=e.getParameter(e.UNPACK_SKIP_ROWS),V.unpackSkipImages=e.getParameter(e.UNPACK_SKIP_IMAGES))}function K(e){e.pixelStorei(e.UNPACK_ALIGNMENT,V.unpackAlignment),o.isWebGL2(e)&&(e.pixelStorei(e.UNPACK_ROW_LENGTH,V.unpackRowLength),e.pixelStorei(e.UNPACK_IMAGE_HEIGHT,V.unpackImageHeight),e.pixelStorei(e.UNPACK_SKIP_PIXELS,V.unpackSkipPixels),e.pixelStorei(e.UNPACK_SKIP_ROWS,V.unpackSkipRows),e.pixelStorei(e.UNPACK_SKIP_IMAGES,V.unpackSkipImages))}function Q(e,t,i,n){n.minMag&&(i.call(e,t,e.TEXTURE_MIN_FILTER,n.minMag),i.call(e,t,e.TEXTURE_MAG_FILTER,n.minMag)),n.min&&i.call(e,t,e.TEXTURE_MIN_FILTER,n.min),n.mag&&i.call(e,t,e.TEXTURE_MAG_FILTER,n.mag),n.wrap&&(i.call(e,t,e.TEXTURE_WRAP_S,n.wrap),i.call(e,t,e.TEXTURE_WRAP_T,n.wrap),(t===e.TEXTURE_3D||r.isSampler(e,t))&&i.call(e,t,e.TEXTURE_WRAP_R,n.wrap)),n.wrapR&&i.call(e,t,e.TEXTURE_WRAP_R,n.wrapR),n.wrapS&&i.call(e,t,e.TEXTURE_WRAP_S,n.wrapS),n.wrapT&&i.call(e,t,e.TEXTURE_WRAP_T,n.wrapT),n.minLod&&i.call(e,t,e.TEXTURE_MIN_LOD,n.minLod),n.maxLod&&i.call(e,t,e.TEXTURE_MAX_LOD,n.maxLod),n.baseLevel&&i.call(e,t,e.TEXTURE_BASE_LEVEL,n.baseLevel),n.maxLevel&&i.call(e,t,e.TEXTURE_MAX_LEVEL,n.maxLevel)}function X(e,t,i){var n=i.target||e.TEXTURE_2D;e.bindTexture(n,t),Q(e,n,e.texParameteri,i)}function J(e,t,i){Q(e,t,e.samplerParameteri,i)}function $(e,t){var i=e.createSampler();return J(e,i,t),i}function ee(e,t,i,n,a,r,s){i=i||u.textureOptions,r=r||e.RGBA,s=s||e.UNSIGNED_BYTE;var l=i.target||e.TEXTURE_2D;if(n=n||i.width,a=a||i.height,e.bindTexture(l,t),function(e,t,i,n){if(!o.isWebGL2(e))return F(t)&&F(i);var a=j[n];if(!a)throw\"unknown internal format\";return a.colorRenderable&&a.textureFilterable}(e,n,a,r))e.generateMipmap(l);else{var c=function(e){var t=j[e];if(!t)throw\"unknown internal format\";return t.textureFilterable}(r)?e.LINEAR:e.NEAREST;e.texParameteri(l,e.TEXTURE_MIN_FILTER,c),e.texParameteri(l,e.TEXTURE_MAG_FILTER,c),e.texParameteri(l,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(l,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)}}function te(e){return!0===e.auto||void 0===e.auto&&void 0===e.level}function ie(e,t){return(t=t||{}).cubeFaceOrder||[e.TEXTURE_CUBE_MAP_POSITIVE_X,e.TEXTURE_CUBE_MAP_NEGATIVE_X,e.TEXTURE_CUBE_MAP_POSITIVE_Y,e.TEXTURE_CUBE_MAP_NEGATIVE_Y,e.TEXTURE_CUBE_MAP_POSITIVE_Z,e.TEXTURE_CUBE_MAP_NEGATIVE_Z]}function ne(e,t){var i=ie(e,t).map((function(e,t){return{face:e,ndx:t}}));return i.sort((function(e,t){return e.face-t.face})),i}function oe(e,t,i,n){var o=(n=n||u.textureOptions).target||e.TEXTURE_2D,a=n.level||0,r=i.width,l=i.height,c=n.internalFormat||n.format||e.RGBA,p=U(c),m=n.format||p.format,g=n.type||p.type;if(q(e,n),e.bindTexture(o,t),o===e.TEXTURE_CUBE_MAP){var h,f,b=i.width,y=i.height;if(b/6===y)h=y,f=[0,0,1,0,2,0,3,0,4,0,5,0];else if(y/6===b)h=b,f=[0,0,0,1,0,2,0,3,0,4,0,5];else if(b/3==y/2)h=b/3,f=[0,0,1,0,2,0,0,1,1,1,2,1];else{if(b/2!=y/3)throw\"can't figure out cube map from element: \"+(i.src?i.src:i.nodeName);h=b/2,f=[0,0,1,0,0,1,1,1,0,2,1,2]}d?(d.canvas.width=h,d.canvas.height=h,r=h,l=h,ne(e,n).forEach((function(t){var n=f[2*t.ndx+0]*h,o=f[2*t.ndx+1]*h;d.drawImage(i,n,o,h,h,0,0,h,h),e.texImage2D(t.face,a,c,m,g,d.canvas)})),d.canvas.width=1,d.canvas.height=1):s.default.createImageBitmap&&(r=h,l=h,ne(e,n).forEach((function(u){var d=f[2*u.ndx+0]*h,p=f[2*u.ndx+1]*h;e.texImage2D(u.face,a,c,h,h,0,m,g,null),s.default.createImageBitmap(i,d,p,h,h,{premultiplyAlpha:\"none\",colorSpaceConversion:\"none\"}).then((function(i){q(e,n),e.bindTexture(o,t),e.texImage2D(u.face,a,c,m,g,i),Y(e,n),te(n)&&ee(e,t,n,r,l,c,g)}))})))}else if(o===e.TEXTURE_3D||o===e.TEXTURE_2D_ARRAY){var v=Math.min(i.width,i.height),k=Math.max(i.width,i.height),w=k/v;if(w%1!=0)throw\"can not compute 3D dimensions of element\";var T=i.width===k?1:0,S=i.height===k?1:0;Z(e),e.pixelStorei(e.UNPACK_ALIGNMENT,1),e.pixelStorei(e.UNPACK_ROW_LENGTH,i.width),e.pixelStorei(e.UNPACK_IMAGE_HEIGHT,0),e.pixelStorei(e.UNPACK_SKIP_IMAGES,0),e.texImage3D(o,a,c,v,v,v,0,m,g,null);for(var M=0;M=0?y(n,t):i.indexOf(\"tan\")>=0||i.indexOf(\"binorm\")>=0?f(n,t):i.indexOf(\"norm\")>=0&&b(n,t)})),e}function k(e,t,i){return e=e||2,{position:{numComponents:2,data:[(t=t||0)+-1*(e*=.5),(i=i||0)+-1*e,t+1*e,i+-1*e,t+-1*e,i+1*e,t+1*e,i+1*e]},normal:[0,0,1,0,0,1,0,0,1,0,0,1],texcoord:[0,0,1,0,0,1,1,1],indices:[0,1,2,2,1,3]}}function w(e,t,i,n,o){e=e||1,t=t||1,i=i||1,n=n||1,o=o||r.identity();for(var a=(i+1)*(n+1),s=p(3,a),l=p(3,a),u=p(2,a),c=0;c<=n;c++)for(var d=0;d<=i;d++){var m=d/i,g=c/n;s.push(e*m-.5*e,0,t*g-.5*t),l.push(0,1,0),u.push(m,g)}for(var h=i+1,f=p(3,i*n*2,Uint16Array),b=0;b 0\");n=n||0,a=a||0;for(var s=(o=o||Math.PI)-n,l=(r=r||2*Math.PI)-a,u=(t+1)*(i+1),c=p(3,u),d=p(3,u),m=p(2,u),g=0;g<=i;g++)for(var h=0;h<=t;h++){var f=h/t,b=g/i,y=l*f,v=s*b,k=Math.sin(y),w=Math.cos(y),T=Math.sin(v),S=w*T,M=Math.cos(v),E=k*T;c.push(e*S,e*M,e*E),d.push(S,M,E),m.push(1-f,b)}for(var I=t+1,x=p(3,t*i*2,Uint16Array),_=0;_o?(S=i,T=1,M=t):M=e+w/o*(t-e),-2!==w&&w!==o+2||(M=0,T=0),S-=i/2;for(var E=0;Eo?0:I*y,w<0?-1:w>o?1:v,w<0||w>o?0:x*y),g.push(E/n,1-T)}}for(var _=0;_ 0\");var l=(r=r||1)-(a=a||0),u=2*(o+1)*4,c=p(3,u),d=p(3,u),m=p(2,u);function g(e,t,i){return e+(t-e)*i}function h(t,i,r,u,p,h){for(var f=0;f<=o;f++){var b=i/1,y=f/o,v=2*(b-.5),k=(a+y*l)*Math.PI,w=Math.sin(k),T=Math.cos(k),S=g(e,t,w),M=v*n,E=T*e,I=w*S;c.push(M,E,I);var x=s.add(s.multiply([0,w,T],r),u);d.push(x),m.push(b*p+h,y)}}for(var f=0;f<2;f++){var b=2*(f/1-.5);h(t,f,[1,1,1],[0,0,0],1,0),h(t,f,[0,0,0],[b,0,0],0,0),h(i,f,[1,1,1],[0,0,0],1,0),h(i,f,[0,0,0],[b,0,0],0,1)}var y=p(3,2*o*4,Uint16Array);function v(e,t){for(var i=0;i0&&f!==t){var k=c+(f+1),w=c+f,T=c+f-m,S=c+(f+1)-m;u.push(k,w,T),u.push(k,T,S)}}c+=t+1}return{position:r,normal:s,texcoord:l,indices:u}}function A(e){return function(t){var i=e.apply(this,Array.prototype.slice.call(arguments,1));return n.createBuffersFromArrays(t,i)}}function P(e){return function(t){var i=e.apply(null,Array.prototype.slice.call(arguments,1));return n.createBufferInfoFromArrays(t,i)}}var D=[\"numComponents\",\"size\",\"type\",\"normalize\",\"stride\",\"offset\",\"attrib\",\"name\",\"attribName\"];function L(e,t,i,n){n=n||0;for(var o=e.length,a=0;a-1},X.prototype.set=function(e,t){var i=this.__data__,n=ne(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this},J.prototype.clear=function(){this.size=0,this.__data__={hash:new Q,map:new(Y||X),string:new Q}},J.prototype.delete=function(e){var t=he(this,e).delete(e);return this.size-=t?1:0,t},J.prototype.get=function(e){return he(this,e).get(e)},J.prototype.has=function(e){return he(this,e).has(e)},J.prototype.set=function(e,t){var i=he(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this},$.prototype.clear=function(){this.__data__=new X,this.size=0},$.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},$.prototype.get=function(e){return this.__data__.get(e)},$.prototype.has=function(e){return this.__data__.has(e)},$.prototype.set=function(e,t){var i=this.__data__;if(i instanceof X){var n=i.__data__;if(!Y||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new J(n)}return i.set(e,t),this.size=i.size,this};var ae,re=function(e,t,i){for(var n=-1,o=Object(e),a=i(e),r=a.length;r--;){var s=a[ae?r:++n];if(!1===t(o[s],s,o))break}return e};function se(e){return null==e?void 0===e?\"[object Undefined]\":\"[object Null]\":H&&H in Object(e)?function(e){var t=O.call(e,H),i=e[H];try{e[H]=void 0;var n=!0}catch(e){}var o=N.call(e);n&&(t?e[H]=i:delete e[H]);return o}(e):function(e){return N.call(e)}(e)}function le(e){return Oe(e)&&se(e)==a}function ue(e){return!(!_e(e)||function(e){return!!C&&C in e}(e))&&(Ie(e)?P:l).test(function(e){if(null!=e){try{return _.call(e)}catch(e){}try{return e+\"\"}catch(e){}}return\"\"}(e))}function ce(e){if(!_e(e))return function(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t}(e);var t=ye(e),i=[];for(var n in e)(\"constructor\"!=n||!t&&O.call(e,n))&&i.push(n);return i}function de(e,t,i,n,o){e!==t&&re(t,(function(a,r){if(o||(o=new $),_e(a))!function(e,t,i,n,o,a,r){var l=ve(e,i),u=ve(t,i),c=r.get(u);if(c)return void te(e,i,c);var d=a?a(l,u,i+\"\",e,t,r):void 0,p=void 0===d;if(p){var m=Se(u),g=!m&&Ee(u),h=!m&&!g&&Ce(u);d=u,m||g||h?Se(l)?d=l:Oe(k=l)&&Me(k)?d=function(e,t){var i=-1,n=e.length;t||(t=Array(n));for(;++i-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(me);function we(e,t){return e===t||e!=e&&t!=t}var Te=le(function(){return arguments}())?le:function(e){return Oe(e)&&O.call(e,\"callee\")&&!U.call(e,\"callee\")},Se=Array.isArray;function Me(e){return null!=e&&xe(e.length)&&!Ie(e)}var Ee=W||function(){return!1};function Ie(e){if(!_e(e))return!1;var t=se(e);return t==r||\"[object GeneratorFunction]\"==t||\"[object AsyncFunction]\"==t||\"[object Proxy]\"==t}function xe(e){return\"number\"==typeof e&&e>-1&&e%1==0&&e<=o}function _e(e){var t=typeof e;return null!=e&&(\"object\"==t||\"function\"==t)}function Oe(e){return null!=e&&\"object\"==typeof e}var Ce=v?function(e){return function(t){return e(t)}}(v):function(e){return Oe(e)&&xe(e.length)&&!!c[se(e)]};var Ne=pe((function(e){return e.push(void 0,ge),k(De,void 0,e)}));function Ae(e){return Me(e)?ee(e,!0):ce(e)}var Pe,De=(Pe=function(e,t,i,n){de(e,t,i,n)},pe((function(e,t){var i=-1,n=t.length,o=n>1?t[n-1]:void 0,a=n>2?t[2]:void 0;for(o=Pe.length>3&&\"function\"==typeof o?(n--,o):void 0,a&&function(e,t,i){if(!_e(i))return!1;var n=typeof t;return!!(\"number\"==n?Me(i)&&be(t,i.length):\"string\"==n&&t in i)&&we(i[t],e)}(t[0],t[1],a)&&(o=n<3?void 0:o,n=1),e=Object(e);++i=0||Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n]);return i}},function(e,t,i){\"use strict\";e.exports=function(e,t,i,n,o,a,r,s){if(!e){var l;if(void 0===t)l=new Error(\"Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.\");else{var u=[i,n,o,a,r,s],c=0;(l=new Error(t.replace(/%s/g,(function(){return u[c++]})))).name=\"Invariant Violation\"}throw l.framesToPop=1,l}}},function(e,t){var i,n,o=e.exports={};function a(){throw new Error(\"setTimeout has not been defined\")}function r(){throw new Error(\"clearTimeout has not been defined\")}function s(e){if(i===setTimeout)return setTimeout(e,0);if((i===a||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}!function(){try{i=\"function\"==typeof setTimeout?setTimeout:a}catch(e){i=a}try{n=\"function\"==typeof clearTimeout?clearTimeout:r}catch(e){n=r}}();var l,u=[],c=!1,d=-1;function p(){c&&l&&(c=!1,l.length?u=l.concat(u):d=-1,u.length&&m())}function m(){if(!c){var e=s(p);c=!0;for(var t=u.length;t;){for(l=u,u=[];++d1)for(var i=1;i0&&void 0!==arguments[0]?arguments[0]:i.nowObj;this.startTime=0,this.nowObj=e}static get USE_PERFORMANCE(){return!1}static get legacyDateCode(){return{now:function(){return(new Date).getTime()}}}static get nowObj(){return i.USE_PERFORMANCE&&\"undefined\"!=typeof self&&self.performance&&\"now\"in self.performance?self.performance:Date.now?Date:i.legacyDateCode}time(){return this.nowObj.now()}start(){this.startTime=this.nowObj.now()}timeElapsed(){return this.nowObj.now()-this.startTime}setTimeout(e,i){return t.setTimeout(e,i)}clearTimeout(e){t.clearTimeout(e)}}e.exports=i}).call(this,i(53))},function(e,t){e.exports={StackOpcode:{NOP:\"noop\",ADDON_CALL:\"addons.call\",DEBUGGER:\"tw.debugger\",VISUAL_REPORT:\"visualReport\",COMPATIBILITY_LAYER:\"compat\",OLD_COMPILER_COMPATIBILITY_LAYER:\"oldCompiler\",HAT_EDGE:\"hat.edge\",HAT_PREDICATE:\"hat.predicate\",CONTROL_IF_ELSE:\"control.if\",CONTROL_CLONE_CREATE:\"control.createClone\",CONTROL_CLONE_DELETE:\"control.deleteClone\",CONTROL_WHILE:\"control.while\",CONTROL_FOR:\"control.for\",CONTROL_REPEAT:\"control.repeat\",CONTROL_STOP_ALL:\"control.stopAll\",CONTROL_STOP_OTHERS:\"control.stopOthers\",CONTROL_STOP_SCRIPT:\"control.stopScript\",CONTROL_WAIT:\"control.wait\",CONTROL_WAIT_UNTIL:\"control.waitUntil\",CONTROL_CLEAR_COUNTER:\"control.counterClear\",CONTORL_INCR_COUNTER:\"control.counterIncr\",LIST_ADD:\"list.add\",LIST_INSERT:\"list.instert\",LIST_REPLACE:\"list.replace\",LIST_DELETE_ALL:\"list.deleteAll\",LIST_DELETE:\"list.delete\",LIST_SHOW:\"list.show\",LIST_HIDE:\"list.hide\",VAR_SET:\"var.set\",VAR_SHOW:\"var.show\",VAR_HIDE:\"var.hide\",EVENT_BROADCAST:\"event.broadcast\",EVENT_BROADCAST_AND_WAIT:\"event.broadcastAndWait\",LOOKS_EFFECT_SET:\"looks.setEffect\",LOOKS_EFFECT_CHANGE:\"looks.changeEffect\",LOOKS_EFFECT_CLEAR:\"looks.clearEffects\",LOOKS_SIZE_CHANGE:\"looks.changeSize\",LOOKS_SIZE_SET:\"looks.setSize\",LOOKS_LAYER_FORWARD:\"looks.forwardLayers\",LOOKS_LAYER_BACKWARD:\"looks.backwardLayers\",LOOKS_LAYER_FRONT:\"looks.goToFront\",LOOKS_LAYER_BACK:\"looks.goToBack\",LOOKS_HIDE:\"looks.hide\",LOOKS_SHOW:\"looks.show\",LOOKS_BACKDROP_NEXT:\"looks.nextBackdrop\",LOOKS_BACKDROP_SET:\"looks.switchBackdrop\",LOOKS_COSTUME_NEXT:\"looks.nextCostume\",LOOKS_COSTUME_SET:\"looks.switchCostume\",LOOKS_SAY:\"looks.say\",LOOKS_THINK:\"looks.think\",MOTION_X_SET:\"motion.setX\",MOTION_X_CHANGE:\"motion.changeX\",MOTION_Y_SET:\"motion.setY\",MOTION_Y_CHANGE:\"motion.changeY\",MOTION_XY_SET:\"motion.setXY\",MOTION_IF_ON_EDGE_BOUNCE:\"motion.ifOnEdgeBounce\",MOTION_STEP:\"motion.step\",MOTION_ROTATION_STYLE_SET:\"motion.setRotationStyle\",MOTION_DIRECTION_SET:\"motion.setDirection\",PEN_UP:\"pen.up\",PEN_DOWN:\"pen.down\",PEN_CLEAR:\"pen.clear\",PEN_COLOR_PARAM_SET:\"pen.setParam\",PEN_COLOR_PARAM_CHANGE:\"pen.changeParam\",PEN_COLOR_HUE_CHANGE_LEGACY:\"pen.legacyChangeHue\",PEN_COLOR_HUE_SET_LEGACY:\"pen_setPenHueToNumber\",PEN_COLOR_SHADE_CHANGE_LEGACY:\"pen.legacyChangeShade\",PEN_COLOR_SHADE_SET_LEGACY:\"pen.legacySetShade\",PEN_COLOR_SET:\"pen.setColor\",PEN_SIZE_SET:\"pen.setSize\",PEN_SIZE_CHANGE:\"pen.changeSize\",PEN_STAMP:\"pen.stamp\",SENSING_TIMER_RESET:\"timer.reset\",PROCEDURE_RETURN:\"procedures.return\",PROCEDURE_CALL:\"procedures.call\"},InputOpcode:{NOP:\"noop\",ADDON_CALL:\"addons.call\",CONSTANT:\"constant\",CAST_NUMBER:\"cast.toNumber\",CAST_NUMBER_INDEX:\"cast.toInteger\",CAST_NUMBER_OR_NAN:\"cast.toNumberOrNaN\",CAST_STRING:\"cast.toString\",CAST_BOOLEAN:\"cast.toBoolean\",CAST_COLOR:\"cast.toColor\",COMPATIBILITY_LAYER:\"compat\",OLD_COMPILER_COMPATIBILITY_LAYER:\"oldCompiler\",LOOKS_BACKDROP_NUMBER:\"looks.backdropNumber\",LOOKS_BACKDROP_NAME:\"looks.backdropName\",LOOKS_COSTUME_NUMBER:\"looks.costumeNumber\",LOOKS_COSTUME_NAME:\"looks.costumeName\",LOOKS_SIZE_GET:\"looks.size\",VAR_GET:\"var.get\",LIST_GET:\"list.get\",LIST_LENGTH:\"list.length\",LIST_CONTAINS:\"list.contains\",LIST_INDEX_OF:\"list.indexOf\",LIST_CONTENTS:\"list.contents\",MOTION_X_GET:\"motion.x\",MOTION_Y_GET:\"motion.y\",MOTION_DIRECTION_GET:\"motion.direction\",OP_ADD:\"op.add\",OP_AND:\"op.and\",OP_CONTAINS:\"op.contains\",OP_DIVIDE:\"op.divide\",OP_EQUALS:\"op.equals\",OP_GREATER:\"op.greater\",OP_LESS:\"op.less\",OP_JOIN:\"op.join\",OP_LENGTH:\"op.length\",OP_LETTER_OF:\"op.letterOf\",OP_ABS:\"op.abs\",OP_FLOOR:\"op.floor\",OP_CEILING:\"op.ceiling\",OP_SQRT:\"op.sqrt\",OP_SIN:\"op.sin\",OP_COS:\"op.cos\",OP_TAN:\"op.tan\",OP_ASIN:\"op.asin\",OP_ACOS:\"op.acos\",OP_ATAN:\"op.atan\",OP_LOG_E:\"op.ln\",OP_LOG_10:\"op.log\",OP_POW_E:\"op.e^\",OP_POW_10:\"op.10^\",OP_MOD:\"op.mod\",OP_MULTIPLY:\"op.multiply\",OP_NOT:\"op.not\",OP_OR:\"op.or\",OP_RANDOM:\"op.random\",OP_ROUND:\"op.round\",OP_SUBTRACT:\"op.subtract\",SENSING_ANSWER:\"sensing.answer\",SENSING_COLOR_TOUCHING_COLOR:\"sensing.colorTouchingColor\",SENSING_TIME_YEAR:\"sensing.year\",SENSING_TIME_MONTH:\"sensing.month\",SENSING_TIME_DATE:\"sensing.date\",SENSING_TIME_WEEKDAY:\"sensing.dayofweek\",SENSING_TIME_HOUR:\"sensing.hour\",SENSING_TIME_MINUTE:\"sensing.minute\",SENSING_TIME_SECOND:\"sensing.second\",SENSING_TIME_DAYS_SINCE_2000:\"sensing.daysSince2000\",SENSING_DISTANCE:\"sensing.distance\",SENSING_KEY_DOWN:\"keyboard.pressed\",SENSING_MOUSE_DOWN:\"mouse.down\",SENSING_MOUSE_X:\"mouse.x\",SENSING_MOUSE_Y:\"mouse.y\",SENSING_OF:\"sensing.of\",SENSING_OF_BACKDROP_NAME:\"sensing.of.backdropName\",SENSING_OF_BACKDROP_NUMBER:\"sensing.of.backdropNumber\",SENSING_OF_COSTUME_NAME:\"sensing.of.costumeName\",SENSING_OF_COSTUME_NUMBER:\"sensing.of.costumeNumber\",SENSING_OF_VOLUME:\"sensing.of.volume\",SENSING_OF_POS_X:\"sensing.of.x\",SENSING_OF_POS_Y:\"sensing.of.y\",SENSING_OF_DIRECTION:\"sensing.of.direction\",SENSING_OF_SIZE:\"sensing.of.size\",SENSING_OF_VAR:\"sensing.of.var\",SENSING_TIMER_GET:\"timer.get\",SENSING_TOUCHING_COLOR:\"sensing.touchingColor\",SENSING_TOUCHING_OBJECT:\"sensing.touching\",SENSING_USERNAME:\"sensing.username\",PROCEDURE_CALL:\"procedures.call\",PROCEDURE_ARGUMENT:\"procedures.argument\",CONTROL_COUNTER:\"control.counter\",TW_KEY_LAST_PRESSED:\"tw.lastKeyPressed\"},InputType:{NUMBER_POS_INF:1,NUMBER_POS_INT:2,NUMBER_POS_FRACT:4,NUMBER_POS_REAL:6,NUMBER_ZERO:8,NUMBER_NEG_ZERO:16,NUMBER_NEG_INT:32,NUMBER_NEG_FRACT:64,NUMBER_NEG_REAL:96,NUMBER_NEG_INF:128,NUMBER_NAN:256,NUMBER_ANY_ZERO:24,NUMBER_INF:129,NUMBER_POS:7,NUMBER_NEG:224,NUMBER_WHOLE:10,NUMBER_INT:58,NUMBER_INDEX:443,NUMBER_FRACT:68,NUMBER_REAL:126,NUMBER:255,NUMBER_OR_NAN:511,NUMBER_INTERPRETABLE:4863,STRING_NUM:512,STRING_NAN:1024,STRING_BOOLEAN:2048,STRING:3584,BOOLEAN:4096,BOOLEAN_INTERPRETABLE:6144,ANY:8191,COLOR:8192}}},function(e,t,i){var n=i(110),o=i(430),a=i(318),r=Object.defineProperty;t.f=i(128)?Object.defineProperty:function(e,t,i){if(n(e),t=a(t,!0),n(i),o)try{return r(e,t,i)}catch(e){}if(\"get\"in i||\"set\"in i)throw TypeError(\"Accessors not supported!\");return\"value\"in i&&(e[t]=i.value),e}},function(e,t){e.exports=function(e){return\"object\"==typeof e?null!==e:\"function\"==typeof e}},function(e,t,i){e.exports=!i(168)((function(){return 7!=Object.defineProperty({},\"a\",{get:function(){return 7}}).a}))},function(e,t,i){\"use strict\";i.r(t),i.d(t,\"default\",(function(){return X})),i.d(t,\"guiInitialState\",(function(){return V})),i.d(t,\"guiMiddleware\",(function(){return W})),i.d(t,\"initEmbedded\",(function(){return Z})),i.d(t,\"initFullScreen\",(function(){return Y})),i.d(t,\"initPlayer\",(function(){return q})),i.d(t,\"initTelemetryModal\",(function(){return Q})),i.d(t,\"initTutorialCard\",(function(){return K}));var n=i(55),o=i(24),a=i(207),r=i(71),s=i(136),l=i(152),u=i(181),c=i(202),d=i(35),p=i(117),m=i(21),g=i(204),h=i(14),f=i(69),b=i(203),y=i(102),v=i(79),k=i(13),w=i(78),T=i(200),S=i(98),M=i(156),E=i(151),I=i(99),x=i(201),_=i(91),O=i(205),C=i(32),N=i(134),A=i(12),P=i.n(A),D=i(28),L=i(173);const R=\"scratch-gui/vm/SET_VM\",j=new P.a;j.setCompatibilityMode(!0),j.runtime.cloudOptions.limit=L.a,j.attachStorage(D.a);const z=j;var B=i(90),U=i(206),F=i(697),H=i.n(F),G=i(84);const W=Object(n.d)(Object(n.a)(H()(300,{leading:!0,trailing:!0}))),V={alerts:o.a,assetDrag:a.a,blockDrag:c.a,cards:r.b,colorPicker:s.b,connectionModal:l.a,customStageSize:N.a,customProcedures:u.b,editorTab:d.f,mode:f.b,hoveredTarget:p.b,stageSize:M.c,menus:m.s,micIndicator:g.b,modals:h.s,monitors:b.b,monitorLayout:y.d,projectChanged:v.b,projectState:k.y,projectTitle:w.b,fontsLoaded:T.b,restoreDeletion:S.b,targets:E.c,theme:I.c,timeout:x.c,timeTravel:_.h,toolbox:O.b,tw:C.t,vm:z,vmStatus:B.e,workspaceMetrics:U.c},q=function(e){return Object.assign({},e,{mode:{isEmbedded:!1,isFullScreen:e.mode.isFullScreen,isPlayerOnly:!0,hasEverEnteredEditor:!1}})},Y=function(e){return Object.assign({},e,{mode:{isEmbedded:!1,isFullScreen:!0,isPlayerOnly:e.mode.isPlayerOnly,hasEverEnteredEditor:e.mode.hasEverEnteredEditor}})},Z=function(e){return Object.assign({},e,{mode:{isEmbedded:!0,isFullScreen:!1,isPlayerOnly:!0,hasEverEnteredEditor:!1}})},K=function(e,t){return Object.assign({},e,{cards:{visible:!0,content:G.a,activeDeckId:t,expanded:!0,step:0,x:0,y:0,dragging:!1}})},Q=function(e){return Object.assign({},e,{modals:{telemetryModal:!0}})},X=Object(n.c)({alerts:o.d,assetDrag:a.b,blockDrag:c.b,cards:r.d,colorPicker:s.d,connectionModal:l.b,customStageSize:N.b,customProcedures:u.d,editorTab:d.e,mode:f.a,hoveredTarget:p.a,stageSize:M.a,menus:m.m,micIndicator:g.a,modals:h.r,monitors:b.a,monitorLayout:y.b,projectChanged:v.a,projectState:k.d,projectTitle:w.a,fontsLoaded:T.a,restoreDeletion:S.a,targets:E.a,theme:I.a,timeout:x.a,timeTravel:_.a,toolbox:O.a,tw:C.c,vm:function(e,t){return void 0===e&&(e=z),t.type===R?t.vm:e},vmStatus:B.a,workspaceMetrics:U.a})},function(e,t){e.exports=\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDQ4LjIgKDQ3MzI3KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5maWxlLXVwbG9hZDwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPjwvZGVmcz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJmaWxlLXVwbG9hZCIgZmlsbD0iI0ZGRkZGRiI+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik01LjkxNzM3MDk4LDYuODg2MTI0NjMgTDkuNjM4ODg5OTcsMy4xNjQ2MDU2NSBDOS44NTcwMDA5NywyLjk0NTEzMTQ1IDEwLjE5Nzc5OTQsMi45NDUxMzE0NSAxMC40MTU5MTA0LDMuMTY0NjA1NjUgTDE0LjEzNzQyOTQsNi44ODYxMjQ2MyBDMTQuNDkxODU5OCw3LjI0MDU1NTAxIDE0LjIzMjg1Myw3LjgyNTM2NTE0IDEzLjc0MjEwMzIsNy44MjUzNjUxNCBMMTEuODg4MTU5Nyw3LjgyNTM2NTE0IEwxMC43ODM5NzI3LDEyLjIwMTIxNzEgQzEwLjY3NDkxNzIsMTIuNjI1MTcwNCAxMC4yMzg2OTUyLDEyLjg4MjgxNCA5LjgxNjEwNTE2LDEyLjc3Mzc1ODUgQzkuNTE2MjAyNTMsMTIuNzA2OTYyIDkuMjk4MDkxNTMsMTIuNDc1MjE5MSA5LjIyOTkzMTg0LDEyLjIwMTIxNzEgTDguMTI1NzQ0ODksNy44MjUzNjUxNCBMNi4zMTI2OTcxOCw3LjgyNTM2NTE0IEM1LjgyMTk0NzQyLDcuODI1MzY1MTQgNS41NjI5NDA2LDcuMjQwNTU1MDEgNS45MTczNzA5OCw2Ljg4NjEyNDYzIFogTTE3LDExLjYwMTc1MyBMMTcsMTMuODUxMDIyNyBDMTcsMTUuNTgyMjc4OCAxNS41OTU5MTA0LDE3LjAwMDAwMDMgMTMuODY0NjU0MywxNy4wMDAwMDAzIEw2LjE0ODk3NzYsMTcuMDAwMDAwMyBDNC40MDQwODk1OCwxNy4wMDAwMDAzIDMsMTUuNTgyMjc4OCAzLDEzLjg1MTAyMjcgTDMsMTEuNjAxNzUzIEMzLDExLjAyOTIxMTYgMy40NjM0ODU4OCwxMC41NzkzNTc2IDQuMDIyMzk1MzMsMTAuNTc5MzU3NiBDNC41ODEzMDQ3NywxMC41NzkzNTc2IDUuMDQ0NzkwNjUsMTEuMDI5MjExNiA1LjA0NDc5MDY1LDExLjYwMTc1MyBMNS4wNDQ3OTA2NSwxMy44NTEwMjI3IEM1LjA0NDc5MDY1LDE0LjQ1MDgyNzkgNS41MzU1NDA0MSwxNC45NTUyMDk2IDYuMTQ4OTc3NiwxNC45NTUyMDk2IEwxMy44NjQ2NTQzLDE0Ljk1NTIwOTYgQzE0LjQ2NDQ1OTYsMTQuOTU1MjA5NiAxNC45NTUyMDkzLDE0LjQ1MDgyNzkgMTQuOTU1MjA5MywxMy44NTEwMjI3IEwxNC45NTUyMDkzLDExLjYwMTc1MyBDMTQuOTU1MjA5MywxMS4wMjkyMTE2IDE1LjQxODY5NTIsMTAuNTc5MzU3NiAxNS45Nzc2MDQ3LDEwLjU3OTM1NzYgQzE2LjU1MDE0NjEsMTAuNTc5MzU3NiAxNywxMS4wMjkyMTE2IDE3LDExLjYwMTc1MyBaIiBpZD0iZmlsZS11cGxvYWQtaWNvbiI+PC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+\"},function(e,t){e.exports=\"/static/assets/00aa0c4320b93631ab3c223604ead431.svg\"},function(e,t){e.exports=\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDUwLjIgKDU1MDQ3KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5zZWFyY2gtc3ByaXRlLWxpYnJhcnk8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz48L2RlZnM+CiAgICA8ZyBpZD0ic2VhcmNoLXNwcml0ZS1saWJyYXJ5IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8cGF0aCBkPSJNOS4wODkyMDMyNSw1LjI4MjQ5NDIyIEMxMS4xNzQ0OTY3LDUuMjgyNDk0MjIgMTIuODk0NDgzMyw2Ljk4NzI1OTcgMTIuODk0NDgzMyw5LjA4Nzc3NDMgQzEyLjg5NDQ4MzMsMTEuMTg4Mjg4OSAxMS4xNzQ0OTY3LDEyLjg5MzA1NDQgOS4wODkyMDMyNSwxMi44OTMwNTQ0IEM2Ljk4ODY4ODY1LDEyLjg5MzA1NDQgNS4yODM5MjMxOCwxMS4xODgyODg5IDUuMjgzOTIzMTgsOS4wODc3NzQzIEM1LjI4MzkyMzE4LDYuOTg3MjU5NyA2Ljk4ODY4ODY1LDUuMjgyNDk0MjIgOS4wODkyMDMyNSw1LjI4MjQ5NDIyIE0xNi42Njc3OTksMTUuMDU0NDUzNSBMMTQuNTQ1OTc0OSwxMi45MzExMDcyIEMxNC4zMDA5MTQ4LDEyLjY4NDUyNSAxNC4yNjc0Mjg0LDEyLjMxMTYwNzYgMTQuNDM0ODYwNywxMi4wMDU2NjMxIEMxNS4yODcyNDM0LDEwLjQyNzIzMjkgMTUuNDk1NzcyOCw4LjQxMzQ3ODY3IDE0LjU3OTQ2MTMsNi40Mzc3NzcyNSBDMTMuODQ3MzI1NSw0Ljg1NjMwMjg1IDEyLjM5OTc5NjksMy42NDQ3MDE2OCAxMC43MTE3NzQ3LDMuMjA5Mzc3NjQgQzYuMjU5NTk2OTksMi4wNjAxODMwNiAyLjMwNjY3MjA1LDUuODE1MjMzNDMgMy4xMDI3MzY2NCwxMC4yMjYzMTQxIEMzLjUwNDU3NDIyLDEyLjQ0ODU5NzcgNS4yMDMyNTEyNCwxNC4zMTkyNzMzIDcuMzc1MzA1MTEsMTQuOTM0MjA2NiBDOS4wNTg3NjEwMSwxNS40MTIxNDk4IDEwLjY3MDY3NzcsMTUuMTUwMzQ2NSAxMS45OTE4NzA5LDE0LjQzMzQzMTcgQzEyLjI5NzgxNTQsMTQuMjY1OTk5NCAxMi42NzIyNTUsMTQuMjk5NDg1OSAxMi45MjAzNTkyLDE0LjU0NDU0NTkgTDE1LjA1NTg4MjQsMTYuNjY3ODkyMiBDMTUuMjY4OTc4MSwxNi44OTYyMDkgMTUuNTU4MTc5NCwxNy4wMDI3NTY5IDE1Ljg2MjYwMTgsMTcuMDAyNzU2OSBDMTYuMTUxODAzMSwxNy4wMDI3NTY5IDE2LjQ0MTAwNDQsMTYuODk2MjA5IDE2LjY2Nzc5OSwxNi42Njc4OTIyIEMxNy4xMTA3MzM3LDE2LjIyNjQ3OTcgMTcuMTEwNzMzNywxNS40OTU4NjU5IDE2LjY2Nzc5OSwxNS4wNTQ0NTM1IiBpZD0ic2VhcmNoIiBmaWxsPSIjRkZGRkZGIj48L3BhdGg+CiAgICA8L2c+Cjwvc3ZnPg==\"},function(e,t){e.exports=\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDUwLjIgKDU1MDQ3KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5iYWNrPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGRlZnM+PC9kZWZzPgogICAgPGcgaWQ9ImJhY2siIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxwYXRoIGQ9Ik0xMC4xNTc1OTIyLDE2Ljk5NDEwMyBDOS44NDY1MDAyMSwxNi45OTQxMDMgOS41NTYxNDc2OCwxNi44NzUxOTY3IDkuMzQwNDU3MjMsMTYuNjYwODg4OSBMNC45OTg5OTU1OSwxMi4zMTk0MjcyIEM0LjY2MzAxNjIzLDExLjk2MjcwODQgNC41NzMxNDUyMSwxMS40NjIxOTU5IDQuNzU5ODAwNDEsMTEuMDMyMTk3NyBDNC45NDUwNzI5OCwxMC42MDIxOTk0IDUuMzU0MzMxNzgsMTAuMzM2NzM0MiA1LjgyODU3NDI1LDEwLjMzNjczNDIgTDcuNDc1Mjg3ODgsMTAuMzM2NzM0MiBMOC4zMTQ1NDQ5Niw0LjI5NDYzNjMzIEM4LjQzNDgzMzg2LDMuMzY5NjU2MTMgOS4yMzk1MjUxNiwyLjY2NTg5NjkgMTAuMTg2NjI3NSwyLjY2NTg5NjkgQzEwLjI2ODIwMjcsMi42NjU4OTY5IDEwLjM1MTE2MDYsMi42NzE0Mjc0MiAxMC40MzI3MzU4LDIuNjgxMTA1ODQgQzExLjI4NzIwMTgsMi44MTUyMjEwNiAxMS45NDY3MTY4LDMuNDgxNjQ5MjQgMTIuMDUwNDE0Miw0LjMwMTU0OTQ4IEwxMi45MTE3OTM0LDEwLjMzNjczNDIgTDE0LjQ4NjYxMDIsMTAuMzM2NzM0MiBDMTQuOTY2MzgzMiwxMC4zMzY3MzQyIDE1LjM5MzYxNjIsMTAuNjE4NzkxIDE1LjU3NDc0MDgsMTEuMDU0MzE5OCBDMTUuNzU1ODY1NSwxMS40OTI2MTM4IDE1LjY1NzY5ODcsMTEuOTc3OTE3MyAxNS4zMTYxODg4LDEyLjMxOTQyNzIgTDEwLjk3NDcyNzIsMTYuNjYwODg4OSBDMTAuNzU5MDM2NywxNi44NzUxOTY3IDEwLjQ2ODY4NDIsMTYuOTk0MTAzIDEwLjE1NzU5MjIsMTYuOTk0MTAzIiBpZD0iRmlsbC0xIiBmaWxsPSIjRkZGRkZGIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMC4xNjQxMDMsIDkuODMwMDAwKSByb3RhdGUoLTI3MC4wMDAwMDApIHRyYW5zbGF0ZSgtMTAuMTY0MTAzLCAtOS44MzAwMDApICI+PC9wYXRoPgogICAgPC9nPgo8L3N2Zz4=\"},function(e,t,i){\"use strict\";i.d(t,\"b\",(function(){return r})),i.d(t,\"a\",(function(){return a})),i.d(t,\"c\",(function(){return o})),i.d(t,\"d\",(function(){return s}));const n=\"tw/custom-stage-size/SET\",o={width:480,height:360},a=(()=>{if(\"undefined\"==typeof URLSearchParams)return null;const e=new URLSearchParams(location.search).get(\"size\");if(null===e)return null;const t=e.match(/^(\\d+)[^\\d]+(\\d+)$/);if(!t)return alert(\"Could not parse custom stage size\"),null;const[i,n,o]=t;if(!n||!o)return null;return{width:Math.max(0,Math.min(4096,+n)),height:Math.max(0,Math.min(4096,+o))}})()||o,r=function(e,t){return void 0===e&&(e=a),t.type===n?Object.assign({},e,{width:t.width,height:t.height}):e},s=function(e,t){return{type:n,width:e,height:t}}},function(e,t){e.exports=\"data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA3LjQ4IDcuNDgiPjxkZWZzPjxzdHlsZT4uY2xzLTF7ZmlsbDpub25lO3N0cm9rZTojZmZmO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2Utd2lkdGg6MnB4O308L3N0eWxlPjwvZGVmcz48dGl0bGU+aWNvbi0tYWRkPC90aXRsZT48bGluZSBjbGFzcz0iY2xzLTEiIHgxPSIzLjc0IiB5MT0iNi40OCIgeDI9IjMuNzQiIHkyPSIxIi8+PGxpbmUgY2xhc3M9ImNscy0xIiB4MT0iMSIgeTE9IjMuNzQiIHgyPSI2LjQ4IiB5Mj0iMy43NCIvPjwvc3ZnPg==\"},function(e,t,i){\"use strict\";i.d(t,\"d\",(function(){return s})),i.d(t,\"b\",(function(){return r})),i.d(t,\"a\",(function(){return l})),i.d(t,\"c\",(function(){return u}));const n=\"scratch-gui/color-picker/ACTIVATE_COLOR_PICKER\",o=\"scratch-gui/color-picker/DEACTIVATE_COLOR_PICKER\",a=\"scratch-gui/color-picker/SET_CALLBACK\",r={active:!1,callback:()=>{throw new Error(\"Color picker callback not initialized\")}},s=function(e,t){switch(void 0===e&&(e=r),t.type){case n:return Object.assign({},e,{active:!0,callback:t.callback});case o:return\"string\"==typeof t.color&&e.callback(t.color),Object.assign({},e,{active:!1});case a:return Object.assign({},e,{callback:t.callback});default:return e}},l=e=>({type:n,callback:e}),u=e=>({type:o,color:e})},function(e,t,i){\"use strict\";var n=i(973).default;i(980),(t=e.exports=n).default=t},function(e,t){e.exports=\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDUyLjIgKDY3MTQ1KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5BbGVydHMvQ2hlY2s8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZyBpZD0iQWxlcnRzL0NoZWNrIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8cGF0aCBkPSJNMTUuMjI0NzgyLDQuNTE0MjQ3MzIgQzE1LjgyNDQzMDEsMy44NjUxOTU4MiAxNi44MzY3MDEyLDMuODI1MTQ2NDUgMTcuNDg1NzUyNyw0LjQyNDc5NDU1IEMxOC4xMzQ4MDQyLDUuMDI0NDQyNjUgMTguMTc0ODUzNSw2LjAzNjcxMzY4IDE3LjU3NTIwNTUsNi42ODU3NjUxOCBMOS40NDUwMzY5LDE1LjQ4NTc1NjYgQzguODExNTczNTcsMTYuMTcxNDA5MyA3LjcyODA3NjgyLDE2LjE3MTQwOTMgNy4wOTQ2MTM0OSwxNS40ODU3NTY2IEwyLjQyNDc5NDU1LDEwLjQzMTIwMzcgQzEuODI1MTQ2NDUsOS43ODIxNTIyNCAxLjg2NTE5NTgyLDguNzY5ODgxMjEgMi41MTQyNDczMiw4LjE3MDIzMzExIEMzLjE2MzI5ODgzLDcuNTcwNTg1MDEgNC4xNzU1Njk4Niw3LjYxMDYzNDM5IDQuNzc1MjE3OTYsOC4yNTk2ODU4OSBMOC4yNjk4MjUxOSwxMi4wNDIyMDQ1IEwxNS4yMjQ3ODIsNC41MTQyNDczMiBaIiBpZD0iQ2hlY2siIGZpbGw9IiMwRUJEOEMiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPgogICAgPC9nPgo8L3N2Zz4=\"},function(e,t,i){var n=i(1014);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1031);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1207);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1210);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1217);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1225);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){\"use strict\";var n,o=\"object\"==typeof Reflect?Reflect:null,a=o&&\"function\"==typeof o.apply?o.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};n=o&&\"function\"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(i,n){function o(i){e.removeListener(t,a),n(i)}function a(){\"function\"==typeof e.removeListener&&e.removeListener(\"error\",o),i([].slice.call(arguments))}b(e,t,a,{once:!0}),\"error\"!==t&&function(e,t,i){\"function\"==typeof e.on&&b(e,\"error\",t,i)}(e,o,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var l=10;function u(e){if(\"function\"!=typeof e)throw new TypeError('The \"listener\" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function d(e,t,i,n){var o,a,r,s;if(u(i),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit(\"newListener\",t,i.listener?i.listener:i),a=e._events),r=a[t]),void 0===r)r=a[t]=i,++e._eventsCount;else if(\"function\"==typeof r?r=a[t]=n?[i,r]:[r,i]:n?r.unshift(i):r.push(i),(o=c(e))>0&&r.length>o&&!r.warned){r.warned=!0;var l=new Error(\"Possible EventEmitter memory leak detected. \"+r.length+\" \"+String(t)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");l.name=\"MaxListenersExceededWarning\",l.emitter=e,l.type=t,l.count=r.length,s=l,console&&console.warn&&console.warn(s)}return e}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function m(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},o=p.bind(n);return o.listener=i,n.wrapFn=o,o}function g(e,t,i){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:\"function\"==typeof o?i?[o.listener||o]:[o]:i?function(e){for(var t=new Array(e.length),i=0;i0&&(r=t[0]),r instanceof Error)throw r;var s=new Error(\"Unhandled error.\"+(r?\" (\"+r.message+\")\":\"\"));throw s.context=r,s}var l=o[e];if(void 0===l)return!1;if(\"function\"==typeof l)a(l,this,t);else{var u=l.length,c=f(l,u);for(i=0;i=0;a--)if(i[a]===t||i[a].listener===t){r=i[a].listener,o=a;break}if(o<0)return this;0===o?i.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return g(this,e,!0)},s.prototype.rawListeners=function(e){return g(this,e,!1)},s.listenerCount=function(e,t){return\"function\"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,i){const n=i(723),o=i(724);class a{static base64ToUint8Array(e){const t=n(e),i=t.length,o=new Uint8Array(i);for(let e=0;e1&&(n+=t);const o=i.inputs[n];return void 0===o?null:o.block}getOpcode(e){return void 0===e?null:e.opcode}getFields(e){return void 0===e?null:e.fields}getInputs(e){if(void 0===e)return null;let t=this._cache.inputs[e.id];if(void 0!==t)return t;t={};for(const i in e.inputs)i.substring(0,m.BRANCH_INPUT_PREFIX.length)!==m.BRANCH_INPUT_PREFIX&&(t[i]=e.inputs[i]);return this._cache.inputs[e.id]=t,t}getMutation(e){return void 0===e?null:e.mutation}getTopLevelScript(e){let t=this._blocks[e];if(void 0===t)return null;for(;null!==t.parent;)t=this._blocks[t.parent];return t.id}getProcedureDefinition(e){const t=this._cache.procedureDefinitions[e];if(void 0!==t)return t;for(const t in this._blocks){if(!Object.prototype.hasOwnProperty.call(this._blocks,t))continue;const i=this._blocks[t];if(\"procedures_definition\"===i.opcode){const n=this._getCustomBlockInternal(i);if(n&&n.mutation.proccode===e)return this._cache.procedureDefinitions[e]=t,t}}return this._cache.procedureDefinitions[e]=null,null}getProcedureParamNamesAndIds(e){return this.getProcedureParamNamesIdsAndDefaults(e).slice(0,2)}getProcedureParamNamesIdsAndDefaults(e){const t=this._cache.procedureParamNames[e];if(void 0!==t)return t;for(const t in this._blocks){if(!Object.prototype.hasOwnProperty.call(this._blocks,t))continue;const i=this._blocks[t];if(\"procedures_prototype\"===i.opcode&&i.mutation.proccode===e){const t=JSON.parse(i.mutation.argumentnames),n=JSON.parse(i.mutation.argumentids),o=JSON.parse(i.mutation.argumentdefaults);return this._cache.procedureParamNames[e]=[t,n,o],this._cache.procedureParamNames[e]}}const i=this.runtime.getAddonBlock(e);return i?(this._cache.procedureParamNames[e]=i.namesIdsDefaults,i.namesIdsDefaults):(this._cache.procedureParamNames[e]=null,null)}populateProcedureCache(){if(!this._cache.proceduresPopulated){for(const e in this._blocks){if(!Object.prototype.hasOwnProperty.call(this._blocks,e))continue;const t=this._blocks[e];if(\"procedures_prototype\"!==t.opcode){if(\"procedures_definition\"===t.opcode){const i=this._getCustomBlockInternal(t);if(i){const t=i.mutation.proccode;this._cache.procedureDefinitions[t]||(this._cache.procedureDefinitions[t]=e);continue}}}else{const e=t.mutation.proccode;if(!this._cache.procedureParamNames[e]){const i=JSON.parse(t.mutation.argumentnames),n=JSON.parse(t.mutation.argumentids),o=JSON.parse(t.mutation.argumentdefaults);this._cache.procedureParamNames[e]=[i,n,o]}}}this._cache.proceduresPopulated=!0}}duplicate(){const e=new m(this.runtime,this.forceNoGlow);return e._blocks=s.simple(this._blocks),e._scripts=s.simple(this._scripts),e}blocklyListen(e){if(\"object\"!=typeof e)return;if(\"string\"!=typeof e.blockId&&\"string\"!=typeof e.varId&&\"string\"!=typeof e.commentId)return;const t=this.runtime.getTargetForStage(),i=this.runtime.getEditingTarget();if(\"stackclick\"!==e.element)switch(e.type){case\"create\":{const t=n(e);for(let e=0;ee.isOriginal));for(const t of i)if(t.lookupVariableByNameAndType(e.varName,e.varType,!0))return;t.createVariable(e.varId,e.varName,e.varType,e.isCloud),this.emitProjectChanged()}break;case\"var_rename\":if(i&&Object.prototype.hasOwnProperty.call(i.variables,e.varId))i.renameVariable(e.varId,e.newName),i.blocks.updateBlocksAfterVarRename(e.varId,e.newName);else{t.renameVariable(e.varId,e.newName);const i=this.runtime.targets;for(let t=0;t0&&\"data_variable\"!==t.opcode&&\"data_listcontents\"!==t.opcode){const e=p(t.id,t.fields);let i=this.runtime.monitorBlocks.getBlock(e);i||(i=JSON.parse(JSON.stringify(t)),i.id=e,this.runtime.monitorBlocks.createBlock(i)),t=i}const i=t.isMonitored;t.isMonitored=e.value;let n=!1;\"data_variable\"===t.opcode?n=!this.runtime.getTargetForStage().variables[t.fields.VARIABLE.id]:\"data_listcontents\"===t.opcode&&(n=!this.runtime.getTargetForStage().variables[t.fields.LIST.id]);const o=n||Object.prototype.hasOwnProperty.call(this.runtime.monitorBlockInfo,t.opcode)&&this.runtime.monitorBlockInfo[t.opcode].isSpriteSpecific;t.targetId=o?t.targetId||this.runtime.getEditingTarget().id:null,i&&!t.isMonitored?this.runtime.requestHideMonitor(t.id):!i&&t.isMonitored&&(this.runtime.requestShowMonitor(t.id)||this.runtime.requestAddMonitor(new r({id:t.id,targetId:t.targetId,spriteName:t.targetId?this.runtime.getTargetById(t.targetId).getName():null,opcode:t.opcode,params:this._getBlockParams(t),value:\"\",mode:\"data_listcontents\"===t.opcode?\"list\":\"default\"})));break}}this.emitProjectChanged(),this.resetCache()}}moveBlock(e){if(!Object.prototype.hasOwnProperty.call(this._blocks,e.id))return;const t=this._blocks[e.id];let i=!1;if(e.newCoordinate&&(i=t.x!==e.newCoordinate.x||t.y!==e.newCoordinate.y,t.x=e.newCoordinate.x,t.y=e.newCoordinate.y),void 0!==e.oldParent){const t=this._blocks[e.oldParent];void 0!==e.oldInput&&t.inputs[e.oldInput].block===e.id?t.inputs[e.oldInput].block=null:t.next===e.id&&(t.next=null),this._blocks[e.id].parent=null,i=!0}if(void 0===e.newParent)this._addScript(e.id);else{if(this._deleteScript(e.id),void 0===e.newInput)this._blocks[e.newParent].next=e.id;else{let t=null;Object.prototype.hasOwnProperty.call(this._blocks[e.newParent].inputs,e.newInput)&&(t=this._blocks[e.newParent].inputs[e.newInput].shadow),this._blocks[e.id].shadow&&(t=e.id),this._blocks[e.newParent].inputs[e.newInput]={name:e.newInput,block:e.id,shadow:t}}this._blocks[e.id].parent=e.newParent,i=!0}this.resetCache(),i&&this.emitProjectChanged()}runAllMonitored(e){null===this._cache._monitored&&(this._cache._monitored=Object.keys(this._blocks).filter((e=>this.getBlock(e).isMonitored)).map((t=>{const i=this.getBlock(t).targetId;return{blockId:t,target:i?e.getTargetById(i):null}})));const t=this._cache._monitored;for(let i=0;ithis.deleteBlock(e)))}getAllVariableAndListReferences(e,t){const i=e||this._blocks,n=Object.create(null);for(const e in i){let o=null,a=null;if(i[e].fields.VARIABLE?(o=i[e].fields.VARIABLE,a=d.SCALAR_TYPE):i[e].fields.LIST?(o=i[e].fields.LIST,a=d.LIST_TYPE):t&&i[e].fields.BROADCAST_OPTION&&(o=i[e].fields.BROADCAST_OPTION,a=d.BROADCAST_MESSAGE_TYPE),o){const e=o.id;n[e]?n[e].push({referencingField:o,type:a}):n[e]=[{referencingField:o,type:a}]}}return n}updateBlocksAfterVarRename(e,t){const i=this._blocks;for(const n in i){let o=null;if(i[n].fields.VARIABLE?o=i[n].fields.VARIABLE:i[n].fields.LIST&&(o=i[n].fields.LIST),o){e===o.id&&(o.value=t)}}}updateTargetSpecificBlocks(e){const t=this._blocks;for(const i in t)e&&\"event_whenthisspriteclicked\"===t[i].opcode?t[i].opcode=\"event_whenstageclicked\":e||\"event_whenstageclicked\"!==t[i].opcode||(t[i].opcode=\"event_whenthisspriteclicked\")}updateAssetName(e,t,i){let n;if(\"costume\"===i)n=this._getCostumeField.bind(this);else if(\"sound\"===i)n=this._getSoundField.bind(this);else if(\"backdrop\"===i)n=this._getBackdropField.bind(this);else{if(\"sprite\"!==i)return;n=this._getSpriteField.bind(this)}const o=this._blocks;for(const i in o){const o=n(i);o&&o.value===e&&(o.value=t)}this.resetCache()}updateSensingOfReference(e,t,i){const n=this._blocks;let o=!1;for(const a in n){const r=n[a];if(\"sensing_of\"===r.opcode&&r.fields.PROPERTY.value===e&&r.inputs.OBJECT.block===r.inputs.OBJECT.shadow){this.getBlock(r.inputs.OBJECT.block).fields.OBJECT.value===i&&(r.fields.PROPERTY.value=t,o=!0)}}return o&&this.resetCache(),o}_getCostumeField(e){const t=this.getBlock(e);return t&&Object.prototype.hasOwnProperty.call(t.fields,\"COSTUME\")?t.fields.COSTUME:null}_getSoundField(e){const t=this.getBlock(e);return t&&Object.prototype.hasOwnProperty.call(t.fields,\"SOUND_MENU\")?t.fields.SOUND_MENU:null}_getBackdropField(e){const t=this.getBlock(e);return t&&Object.prototype.hasOwnProperty.call(t.fields,\"BACKDROP\")?t.fields.BACKDROP:null}_getSpriteField(e){const t=this.getBlock(e);if(!t)return null;const i=[\"TOWARDS\",\"TO\",\"OBJECT\",\"VIDEOONMENU2\",\"DISTANCETOMENU\",\"TOUCHINGOBJECTMENU\",\"CLONE_OPTION\"];for(let e=0;ethis.blockToXML(t,e))).join()}blockToXML(e,t){const i=this._blocks[e];if(!i)return;const n=i.shadow?\"shadow\":\"block\";let o=\"<\".concat(n,'\\n id=\"').concat(a(i.id),'\"\\n type=\"').concat(a(i.opcode),'\"\\n ').concat(i.topLevel?'x=\"'.concat(i.x,'\" y=\"').concat(i.y,'\"'):\"\",\"\\n >\");const r=i.comment;r&&(t?Object.prototype.hasOwnProperty.call(t,r)?o+=t[r].toXML():c.warn(\"Could not find comment with id: \".concat(r,\" in provided comment descriptions.\")):c.warn(\"Cannot serialize comment with id: \".concat(r,\"; no comment descriptions provided.\"))),i.mutation&&(o+=this.mutationToXML(i.mutation));for(const e in i.inputs){if(!Object.prototype.hasOwnProperty.call(i.inputs,e))continue;const n=i.inputs[e];(n.block||n.shadow)&&(o+=''),n.block&&(o+=this.blockToXML(n.block,t)),n.shadow&&n.shadow!==n.block&&(o+=this.blockToXML(n.shadow,t)),o+=\"\")}for(const e in i.fields){if(!Object.prototype.hasOwnProperty.call(i.fields,e))continue;const t=i.fields[e];o+='\".concat(s,\"\")}return i.next&&(o+=\"\".concat(this.blockToXML(i.next,t),\"\")),o+=\"\"),o}mutationToXML(e){let t=\"<\".concat(e.tagName);for(const i in e){if(\"children\"===i||\"tagName\"===i)continue;let n=\"string\"==typeof e[i]?a(e[i]):e[i];\"blockInfo\"===i&&(n=a(JSON.stringify(e[i]))),t+=\" \".concat(i,'=\"').concat(n,'\"')}t+=\">\";for(let i=0;i\"),t}_getBlockParams(e){const t={};for(const i in e.fields)t[i]=e.fields[i].value;for(const i in e.inputs){const n=this._blocks[e.inputs[i].block];for(const e in n.fields)t[e]=n.fields[e].value}return t}_getCustomBlockInternal(e){if(e.inputs&&e.inputs.custom_block)return this._blocks[e.inputs.custom_block.block]}_addScript(e){this._scripts.indexOf(e)>-1||(this._scripts.push(e),this._blocks[e].topLevel=!0)}_deleteScript(e){const t=this._scripts.indexOf(e);t>-1&&this._scripts.splice(t,1),this._blocks[e]&&(this._blocks[e].topLevel=!1)}}l.getCached=function(e,t,i){let n=e._cache._executeCached[t];if(void 0!==n)return n;const o=e.getBlock(t);return void 0===o?null:(n=void 0===i?{id:t,opcode:e.getOpcode(o),fields:e.getFields(o),inputs:e.getInputs(o),mutation:e.getMutation(o)}:new i(e,{id:t,opcode:e.getOpcode(o),fields:e.getFields(o),inputs:e.getInputs(o),mutation:e.getMutation(o)}),e._cache._executeCached[t]=n,n)};const g=u._RuntimeScriptCache;u.getScripts=function(e,t){let i=e._cache.scripts[t];if(!i){i=e._cache.scripts[t]=[];const n=e._scripts;for(let o=0;o!e.isStage)).reduce(((e,t,i)=>Object.assign(e,{[t.id]:o({order:i},t)})),{}),stage:t.targets.filter((e=>e.isStage))[0]||{},editingTarget:t.editingTarget});case s:return Object.assign({},e,{highlightedTargetId:t.targetId,highlightedTargetTime:t.updateTime});default:return e}},c=function(e,t){return{type:r,targets:e,editingTarget:t}},d=function(e){return{type:s,targetId:e,updateTime:Date.now()}}},function(e,t,i){\"use strict\";i.d(t,\"b\",(function(){return a})),i.d(t,\"a\",(function(){return o})),i.d(t,\"c\",(function(){return r}));const n=\"scratch-gui/connection-modal/setId\",o={extensionId:null},a=function(e,t){return void 0===e&&(e=o),t.type===n?Object.assign({},e,{extensionId:t.extensionId}):e},r=function(e){return{type:n,extensionId:e}}},function(e,t,i){\"use strict\";var n=i(996),o=i(997),a=i(998),r=i(999);function s(e,t,i){var n=e;return o(t)?(i=t,\"string\"==typeof e&&(n={uri:e})):n=r(t,{uri:e}),n.callback=i,n}function l(e,t,i){return u(t=s(e,t,i))}function u(e){if(void 0===e.callback)throw new Error(\"callback argument missing\");var t=!1,i=function(i,n,o){t||(t=!0,e.callback(i,n,o))};function n(){var e=void 0;if(e=c.response?c.response:c.responseText||function(e){try{if(\"document\"===e.responseType)return e.responseXML;var t=e.responseXML&&\"parsererror\"===e.responseXML.documentElement.nodeName;if(\"\"===e.responseType&&!t)return e.responseXML}catch(e){}return null}(c),b)try{e=JSON.parse(e)}catch(e){}return e}function o(e){return clearTimeout(d),e instanceof Error||(e=new Error(\"\"+(e||\"Unknown XMLHttpRequest Error\"))),e.statusCode=0,i(e,y)}function r(){if(!u){var t;clearTimeout(d),t=e.useXDR&&void 0===c.status?200:1223===c.status?204:c.status;var o=y,r=null;return 0!==t?(o={body:n(),statusCode:t,method:m,headers:{},url:p,rawRequest:c},c.getAllResponseHeaders&&(o.headers=a(c.getAllResponseHeaders()))):r=new Error(\"Internal XMLHttpRequest Error\"),i(r,o,o.body)}}var s,u,c=e.xhr||null;c||(c=e.cors||e.useXDR?new l.XDomainRequest:new l.XMLHttpRequest);var d,p=c.url=e.uri||e.url,m=c.method=e.method||\"GET\",g=e.body||e.data,h=c.headers=e.headers||{},f=!!e.sync,b=!1,y={body:void 0,headers:{},statusCode:0,method:m,url:p,rawRequest:c};if(\"json\"in e&&!1!==e.json&&(b=!0,h.accept||h.Accept||(h.Accept=\"application/json\"),\"GET\"!==m&&\"HEAD\"!==m&&(h[\"content-type\"]||h[\"Content-Type\"]||(h[\"Content-Type\"]=\"application/json\"),g=JSON.stringify(!0===e.json?g:e.json))),c.onreadystatechange=function(){4===c.readyState&&setTimeout(r,0)},c.onload=r,c.onerror=o,c.onprogress=function(){},c.onabort=function(){u=!0},c.ontimeout=o,c.open(m,p,!f,e.username,e.password),f||(c.withCredentials=!!e.withCredentials),!f&&e.timeout>0&&(d=setTimeout((function(){if(!u){u=!0,c.abort(\"timeout\");var e=new Error(\"XMLHttpRequest timeout\");e.code=\"ETIMEDOUT\",o(e)}}),e.timeout)),c.setRequestHeader)for(s in h)h.hasOwnProperty(s)&&c.setRequestHeader(s,h[s]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error(\"Headers cannot be set on an XDomainRequest object\");return\"responseType\"in e&&(c.responseType=e.responseType),\"beforeSend\"in e&&\"function\"==typeof e.beforeSend&&e.beforeSend(c),c.send(g||null),c}e.exports=l,e.exports.default=l,l.XMLHttpRequest=n.XMLHttpRequest||function(){},l.XDomainRequest=\"withCredentials\"in new l.XMLHttpRequest?l.XMLHttpRequest:n.XDomainRequest,function(e,t){for(var i=0;i0,i=c.default.Children.count(this.props.children);return this.props.component||null==this.props.children||t&&i>1?c.default.createElement(this.props.component||\"div\",e,this.props.children):t?c.default.cloneElement(this.props.children,e):i?this.props.children:null}}]),t}(c.default.Component);k.displayName=\"MediaQuery\",k.defaultProps={values:{}},t.default=k,t.toQuery=h.default},function(e,t){e.exports=n},function(e,t,i){\"use strict\";function n(){return null}var o=i(7),a=i(1),r=i(8),s=function(){};s=function(e){var t=\"Warning: \"+e;\"undefined\"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}},e.exports=function(e,t){function i(e){var t=e&&(E&&e[E]||e[I]);if(\"function\"==typeof t)return t}function l(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function u(e){this.message=e,this.stack=\"\"}function c(e){function i(i,r,l,c,d,p,m){if(c=c||x,p=p||l,m!==a){if(t){var g=new Error(\"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types\");throw g.name=\"Invariant Violation\",g}if(\"undefined\"!=typeof console){var h=c+\":\"+l;!n[h]&&o<3&&(s(\"You are manually calling a React.PropTypes validation function for the `\"+p+\"` prop on `\"+c+\"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.\"),n[h]=!0,o++)}}return null==r[l]?i?new u(null===r[l]?\"The \"+d+\" `\"+p+\"` is marked as required in `\"+c+\"`, but its value is `null`.\":\"The \"+d+\" `\"+p+\"` is marked as required in `\"+c+\"`, but its value is `undefined`.\"):null:e(r,l,c,d,p)}var n={},o=0,r=i.bind(null,!1);return r.isRequired=i.bind(null,!0),r}function d(e){function t(t,i,n,o,a,r){var s=t[i];return w(s)!==e?new u(\"Invalid \"+o+\" `\"+a+\"` of type `\"+T(s)+\"` supplied to `\"+n+\"`, expected `\"+e+\"`.\"):null}return c(t)}function p(e){function t(t,i,n,o,r){if(\"function\"!=typeof e)return new u(\"Property `\"+r+\"` of component `\"+n+\"` has invalid PropType notation inside arrayOf.\");var s=t[i];if(!Array.isArray(s))return new u(\"Invalid \"+o+\" `\"+r+\"` of type `\"+w(s)+\"` supplied to `\"+n+\"`, expected an array.\");for(var l=0;l>\",_={array:d(\"array\"),bool:d(\"boolean\"),func:d(\"function\"),number:d(\"number\"),object:d(\"object\"),string:d(\"string\"),symbol:d(\"symbol\"),any:c(n),arrayOf:p,element:function(){function t(t,i,n,o,a){var r=t[i];return e(r)?null:new u(\"Invalid \"+o+\" `\"+a+\"` of type `\"+w(r)+\"` supplied to `\"+n+\"`, expected a single ReactElement.\")}return c(t)}(),instanceOf:m,node:function(){function e(e,t,i,n,o){return v(e[t])?null:new u(\"Invalid \"+n+\" `\"+o+\"` supplied to `\"+i+\"`, expected a ReactNode.\")}return c(e)}(),objectOf:h,oneOf:g,oneOfType:f,shape:b,exact:y};return u.prototype=Error.prototype,_.checkPropTypes=r,_.PropTypes=_,_}},function(e,t,i){\"use strict\";function n(e){if(null==e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}var o=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String(\"abc\");if(e[5]=\"de\",\"5\"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},i=0;i<10;i++)t[\"_\"+String.fromCharCode(i)]=i;if(\"0123456789\"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(\"\"))return!1;var n={};return\"abcdefghijklmnopqrst\".split(\"\").forEach((function(e){n[e]=e})),\"abcdefghijklmnopqrst\"===Object.keys(Object.assign({},n)).join(\"\")}catch(e){return!1}}()?Object.assign:function(e,t){for(var i,s,l=n(e),u=1;u=o;case\"max\":return l<=o;default:return l===o}}));return o&&!i||!o&&i}))}function o(e){return e.split(\",\").map((function(e){var t=(e=e.trim()).match(l),i=t[1],n=t[2],o=t[3]||\"\",a={};return a.inverse=!!i&&\"not\"===i.toLowerCase(),a.type=n?n.toLowerCase():\"all\",o=o.match(/\\([^\\)]+\\)/g)||[],a.expressions=o.map((function(e){var t=e.match(u),i=t[1].toLowerCase().match(c);return{modifier:i[1],feature:i[2],value:t[2]}})),a}))}function a(e){var t,i=Number(e);return i||(i=(t=e.match(/^(\\d+)\\s*\\/\\s*(\\d+)$/))[1]/t[2]),i}function r(e){var t=parseFloat(e);switch(String(e).match(p)[1]){case\"dpcm\":return t/2.54;case\"dppx\":return 96*t;default:return t}}function s(e){var t=parseFloat(e);switch(String(e).match(d)[1]){case\"em\":case\"rem\":return 16*t;case\"cm\":return 96*t/2.54;case\"mm\":return 96*t/2.54/10;case\"in\":return 96*t;case\"pt\":return 72*t;case\"pc\":return 72*t/12;default:return t}}t.match=n,t.parse=o;var l=/(?:(only|not)?\\s*([^\\s\\(\\)]+)(?:\\s*and)?\\s*)?(.+)?/i,u=/\\(\\s*([^\\s\\:\\)]+)\\s*(?:\\:\\s*([^\\s\\)]+))?\\s*\\)/,c=/^(?:(min|max)-)?(.+)/,d=/(em|rem|px|cm|mm|in|pt|pc)?$/,p=/(dpi|dpcm|dppx)?$/},function(e,t,i){\"use strict\";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var i=(0,r.default)(e);return\"number\"==typeof t&&(t+=\"px\"),!0===t?e:!1===t?l(e):\"(\"+i+\": \"+t+\")\"}function a(e){return e.join(\" and \")}Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=function(e){var t=[];return Object.keys(s.default.all).forEach((function(i){var n=e[i];null!=n&&t.push(o(i,n))})),a(t)};var r=n(i(2)),s=n(i(3)),l=function(e){return\"not \"+e};e.exports=t.default}]))},function(e,t,i){\"use strict\";var n,o,a,r=Object.assign||function(e){for(var t=1;t0||r){var i=!t.state.show;t.setState({currentEvent:e,currentTarget:l,show:!0},(function(){t.updatePosition(),i&&a&&a()}))}};clearTimeout(this.delayShowLoop),n?this.delayShowLoop=setTimeout(u,s):u()}}},{key:\"listenForTooltipExit\",value:function(){this.state.show&&this.tooltipRef&&this.tooltipRef.addEventListener(\"mouseleave\",this.hideTooltip)}},{key:\"removeListenerForTooltipExit\",value:function(){this.state.show&&this.tooltipRef&&this.tooltipRef.removeEventListener(\"mouseleave\",this.hideTooltip)}},{key:\"hideTooltip\",value:function(e,t){var i=this,n=this.state,o=n.delayHide,a=n.disable,r=this.props.afterHide,s=this.getTooltipContent();if(this.mount&&!this.isEmptyTip(s)&&!a){if(t)if(!this.getTargetArray(this.props.id).some((function(t){return t===e.currentTarget}))||!this.state.show)return;var l=function(){var e=i.state.show;i.mouseOnToolTip()?i.listenForTooltipExit():(i.removeListenerForTooltipExit(),i.setState({show:!1},(function(){i.removeScrollListener(),e&&r&&r()})))};this.clearTimer(),o?this.delayHideLoop=setTimeout(l,parseInt(o,10)):l()}}},{key:\"addScrollListener\",value:function(e){var t=this.isCapture(e);window.addEventListener(\"scroll\",this.hideTooltip,t)}},{key:\"removeScrollListener\",value:function(){window.removeEventListener(\"scroll\",this.hideTooltip)}},{key:\"updatePosition\",value:function(){var e=this,t=this.state,i=t.currentEvent,n=t.currentTarget,o=t.place,a=t.desiredPlace,r=t.effect,s=t.offset,l=c.default.findDOMNode(this),u=(0,y.default)(i,n,l,o,a,r,s);if(u.isNewState)return this.setState(u.newState,(function(){e.updatePosition()}));l.style.left=u.position.left+\"px\",l.style.top=u.position.top+\"px\"}},{key:\"setStyleHeader\",value:function(){var e=document.getElementsByTagName(\"head\")[0];if(!e.querySelector('style[id=\"react-tooltip\"]')){var t=document.createElement(\"style\");t.id=\"react-tooltip\",t.innerHTML=T.default,i.nc&&t.setAttribute(\"nonce\",i.nc),e.insertBefore(t,e.firstChild)}}},{key:\"clearTimer\",value:function(){clearTimeout(this.delayShowLoop),clearTimeout(this.delayHideLoop),clearTimeout(this.delayReshow),clearInterval(this.intervalUpdateContent)}},{key:\"render\",value:function(){var e=this,i=this.state,n=i.extraClass,o=i.html,a=i.ariaProps,s=i.disable,u=this.getTooltipContent(),c=this.isEmptyTip(u),p=(0,d.default)(\"__react_component_tooltip\",{show:this.state.show&&!s&&!c},{border:this.state.border},{\"place-top\":\"top\"===this.state.place},{\"place-bottom\":\"bottom\"===this.state.place},{\"place-left\":\"left\"===this.state.place},{\"place-right\":\"right\"===this.state.place},{\"type-dark\":\"dark\"===this.state.type},{\"type-success\":\"success\"===this.state.type},{\"type-warning\":\"warning\"===this.state.type},{\"type-error\":\"error\"===this.state.type},{\"type-info\":\"info\"===this.state.type},{\"type-light\":\"light\"===this.state.type},{allow_hover:this.props.delayUpdate}),m=this.props.wrapper;return t.supportedWrappers.indexOf(m)<0&&(m=t.defaultProps.wrapper),o?l.default.createElement(m,r({className:p+\" \"+n,id:this.props.id,ref:function(t){return e.tooltipRef=t}},a,{\"data-id\":\"tooltip\",dangerouslySetInnerHTML:{__html:u}})):l.default.createElement(m,r({className:p+\" \"+n,id:this.props.id},a,{ref:function(t){return e.tooltipRef=t},\"data-id\":\"tooltip\"}),u)}}]),t}(l.default.Component),o.propTypes={children:u.default.any,place:u.default.string,type:u.default.string,effect:u.default.string,offset:u.default.object,multiline:u.default.bool,border:u.default.bool,insecure:u.default.bool,class:u.default.string,className:u.default.string,id:u.default.string,html:u.default.bool,delayHide:u.default.number,delayUpdate:u.default.number,delayShow:u.default.number,event:u.default.string,eventOff:u.default.string,watchWindow:u.default.bool,isCapture:u.default.bool,globalEventOff:u.default.string,getContent:u.default.any,afterShow:u.default.func,afterHide:u.default.func,disable:u.default.bool,scrollHide:u.default.bool,resizeHide:u.default.bool,wrapper:u.default.string},o.defaultProps={insecure:!0,resizeHide:!0,wrapper:\"div\"},o.supportedWrappers=[\"div\",\"span\"],o.displayName=\"ReactTooltip\",n=a))||n)||n)||n)||n)||n)||n;e.exports=M},function(e,t,i){\"use strict\";i.d(t,\"a\",(function(){return r})),i.d(t,\"c\",(function(){return a})),i.d(t,\"b\",(function(){return s}));var n=i(18);const o=\"scratch-gui/StageSize/SET_STAGE_SIZE\",a={stageSize:n.d.full},r=function(e,t){return void 0===e&&(e=a),t.type===o?{stageSize:t.stageSize}:e},s=function(e){return{type:o,stageSize:e}}},function(e,t,i){e.exports={default:i(1175),__esModule:!0}},function(e,t,i){var n=i(992);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1021);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1049);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1069);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1087);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1093);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(370),o=i(798);function a(t,i){return delete e.exports[t],e.exports[t]=i,i}e.exports={Parser:n,Tokenizer:i(371),ElementType:i(191),DomHandler:o,get FeedHandler(){return a(\"FeedHandler\",i(800))},get Stream(){return a(\"Stream\",i(801))},get WritableStream(){return a(\"WritableStream\",i(373))},get ProxyHandler(){return a(\"ProxyHandler\",i(805))},get DomUtils(){return a(\"DomUtils\",i(806))},get CollectingHandler(){return a(\"CollectingHandler\",i(820))},DefaultHandler:o,get RssHandler(){return a(\"RssHandler\",this.FeedHandler)},parseDOM:function(e,t){var i=new o(t);return new n(i,t).end(e),i.dom},parseFeed:function(t,i){var o=new e.exports.FeedHandler(i);return new n(o,i).end(t),o.dom},createDomStream:function(e,t,i){var a=new o(e,t,i);return new n(a,t)},EVENTS:{attribute:2,cdatastart:0,cdataend:0,text:1,processinginstruction:2,comment:1,commentend:0,closetag:1,opentag:2,opentagname:1,error:1,end:0}}},function(e,t,i){const n=i(38),o=[];class a{constructor(e){this.isLoop=!1,this.warpMode=e,this.justReported=null,this.reporting=\"\",this.reported=null,this.waitingReporter=null,this.params=null,this.executionContext=null,this.op=null}reset(){return this.isLoop=!1,this.warpMode=!1,this.justReported=null,this.reported=null,this.waitingReporter=null,this.params=null,this.executionContext=null,this.op=null,this}reuse(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.warpMode;return this.reset(),this.warpMode=Boolean(e),this}static create(e){const t=o.pop();return void 0!==t?(t.warpMode=Boolean(e),t):new a(e)}static release(e){void 0!==e&&o.push(e.reset())}}class r{constructor(e){this.topBlock=e,this.stack=[],this.stackFrames=[],this.status=0,this.isKilled=!1,this.target=null,this.blockContainer=null,this.requestScriptGlowInFrame=!1,this.blockGlowInFrame=null,this.warpTimer=null,this.justReported=null,this.triedToCompile=!1,this.isCompiled=!1,this.timer=null,this.generator=null,this.procedures=null,this.executableHat=!1,this.compatibilityStackFrame=null}static get STATUS_RUNNING(){return 0}static get STATUS_PROMISE_WAIT(){return 1}static get STATUS_YIELD(){return 2}static get STATUS_YIELD_TICK(){return 3}static get STATUS_DONE(){return 4}static getIdFromTargetAndBlock(e,t){return\"\".concat(e.id,\"&\").concat(t)}getId(){return r.getIdFromTargetAndBlock(this.target,this.topBlock)}pushStack(e){if(this.stack.push(e),this.stack.length>this.stackFrames.length){const e=this.stackFrames[this.stackFrames.length-1];this.stackFrames.push(a.create(void 0!==e&&e.warpMode))}}reuseStackForNextBlock(e){this.stack[this.stack.length-1]=e,this.stackFrames[this.stackFrames.length-1].reuse()}popStack(){return a.release(this.stackFrames.pop()),this.stack.pop()}stopThisScript(){let e=this.peekStack();for(;null!==e;){const t=this.target.blocks.getBlock(e);if(this.peekStackFrame().waitingReporter)break;if(void 0!==t&&\"procedures_call\"===t.opcode){this.goToNextBlock();break}this.popStack(),e=this.peekStack()}0===this.stack.length&&(this.requestScriptGlowInFrame=!1,this.status=r.STATUS_DONE)}peekStack(){return this.stack.length>0?this.stack[this.stack.length-1]:null}peekStackFrame(){return this.stackFrames.length>0?this.stackFrames[this.stackFrames.length-1]:null}peekParentStackFrame(){return this.stackFrames.length>1?this.stackFrames[this.stackFrames.length-2]:null}pushReportedValue(e){this.justReported=void 0===e?null:e}initParams(){const e=this.peekStackFrame();null===e.params&&(e.params={})}pushParam(e,t){this.peekStackFrame().params[e]=t}getParam(e){for(let t=this.stackFrames.length-1;t>=0;t--){const i=this.stackFrames[t];if(null!==i.params)return Object.prototype.hasOwnProperty.call(i.params,e)?i.params[e]:null}return null}getAllparams(){return this.peekStackFrame().params}atStackTop(){return this.peekStack()===this.topBlock}goToNextBlock(){const e=this.target.blocks.getNextBlock(this.peekStack());this.reuseStackForNextBlock(e)}isRecursiveCall(e){let t=5;for(let i=this.stackFrames.length-1-1;i>=0;i--){const n=this.target.blocks.getBlock(this.stackFrames[i].op.id)||this.target.runtime.flyoutBlocks.getBlock(this.stackFrames[i].op.id);if(\"procedures_call\"===n.opcode&&n.mutation.proccode===e)return!0;if(--t<0)return!1}return!1}tryCompile(){if(!this.blockContainer)return;const e=i(824);this.triedToCompile=!0;const t=!this.stackClick,o=this.topBlock,a=this.blockContainer.getBlock(o)?this.blockContainer:this.target.runtime.flyoutBlocks,r=t&&a.getCachedCompileResult(o);if(r&&!r.success)return;let s;if(r)s=r.value;else try{s=e(this),t&&a.cacheCompileResult(o,s)}catch(e){return n.error(\"cannot compile script\",this.target.getName(),e),t&&a.cacheCompileError(o,e),void this.target.runtime.emitCompileError(this.target,e)}this.procedures={};for(const e of Object.keys(s.procedures))this.procedures[e]=s.procedures[e](this);this.generator=s.startingFunction(this)(),this.executableHat=s.executableHat,this.blockContainer.forceNoGlow||(this.blockGlowInFrame=this.topBlock,this.requestScriptGlowInFrame=!0),this.isCompiled=!0}}r._StackFrame=a,e.exports=r},function(e,t,i){\"use strict\";e.exports=TypeError},function(e,t,i){\"use strict\";function n(e,t,i){var n=i?\" !== \":\" === \",o=i?\" || \":\" && \",a=i?\"!\":\"\",r=i?\"\":\"!\";switch(e){case\"null\":return t+n+\"null\";case\"array\":return a+\"Array.isArray(\"+t+\")\";case\"object\":return\"(\"+a+t+o+\"typeof \"+t+n+'\"object\"'+o+r+\"Array.isArray(\"+t+\"))\";case\"integer\":return\"(typeof \"+t+n+'\"number\"'+o+r+\"(\"+t+\" % 1)\"+o+t+n+t+\")\";default:return\"typeof \"+t+n+'\"'+e+'\"'}}e.exports={copy:function(e,t){for(var i in t=t||{},e)t[i]=e[i];return t},checkDataType:n,checkDataTypes:function(e,t){if(1===e.length)return n(e[0],t,!0);var i=\"\",o=a(e);for(var r in o.array&&o.object&&(i=o.null?\"(\":\"(!\"+t+\" || \",i+=\"typeof \"+t+' !== \"object\")',delete o.null,delete o.array,delete o.object),o.number&&delete o.integer,o)i+=(i?\" && \":\"\")+n(r,t,!0);return i},coerceToTypes:function(e,t){if(Array.isArray(t)){for(var i=[],n=0;n=t)throw new Error(\"Cannot access property/index \"+n+\" levels up, current level is \"+t);return i[t-n]}if(n>t)throw new Error(\"Cannot access data \"+n+\" levels up, current level is \"+t);if(a=\"data\"+(t-n||\"\"),!o)return a}for(var s=a,u=o.split(\"/\"),c=0;c>2,s=(3&t)<<4|i>>4,l=1>6:64,u=2>4,i=(15&r)<<4|(s=a.indexOf(e.charAt(u++)))>>2,n=(3&s)<<6|(l=a.indexOf(e.charAt(u++))),p[c++]=t,64!==s&&(p[c++]=i),64!==l&&(p[c++]=n);return p}},{\"./support\":30,\"./utils\":32}],2:[function(e,t,i){\"use strict\";var n=e(\"./external\"),o=e(\"./stream/DataWorker\"),a=e(\"./stream/Crc32Probe\"),r=e(\"./stream/DataLengthProbe\");function s(e,t,i,n,o){this.compressedSize=e,this.uncompressedSize=t,this.crc32=i,this.compression=n,this.compressedContent=o}s.prototype={getContentWorker:function(){var e=new o(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new r(\"data_length\")),t=this;return e.on(\"end\",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error(\"Bug : uncompressed data size mismatch\")})),e},getCompressedWorker:function(){return new o(n.Promise.resolve(this.compressedContent)).withStreamInfo(\"compressedSize\",this.compressedSize).withStreamInfo(\"uncompressedSize\",this.uncompressedSize).withStreamInfo(\"crc32\",this.crc32).withStreamInfo(\"compression\",this.compression)}},s.createWorkerFrom=function(e,t,i){return e.pipe(new a).pipe(new r(\"uncompressedSize\")).pipe(t.compressWorker(i)).pipe(new r(\"compressedSize\")).withStreamInfo(\"compression\",t)},t.exports=s},{\"./external\":6,\"./stream/Crc32Probe\":25,\"./stream/DataLengthProbe\":26,\"./stream/DataWorker\":27}],3:[function(e,t,i){\"use strict\";var n=e(\"./stream/GenericWorker\");i.STORE={magic:\"\\0\\0\",compressWorker:function(){return new n(\"STORE compression\")},uncompressWorker:function(){return new n(\"STORE decompression\")}},i.DEFLATE=e(\"./flate\")},{\"./flate\":7,\"./stream/GenericWorker\":28}],4:[function(e,t,i){\"use strict\";var n=e(\"./utils\"),o=function(){for(var e,t=[],i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?\"string\"!==n.getTypeOf(e)?function(e,t,i,n){var a=o,r=n+i;e^=-1;for(var s=n;s>>8^a[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):function(e,t,i,n){var a=o,r=n+i;e^=-1;for(var s=n;s>>8^a[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):0}},{\"./utils\":32}],5:[function(e,t,i){\"use strict\";i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(e,t,i){\"use strict\";var n=null;n=\"undefined\"!=typeof Promise?Promise:e(\"lie\"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,i){\"use strict\";var n=\"undefined\"!=typeof Uint8Array&&\"undefined\"!=typeof Uint16Array&&\"undefined\"!=typeof Uint32Array,o=e(\"./utils\"),a=e(\"./stream/GenericWorker\"),r=n?\"uint8array\":\"array\";function s(e,t){a.call(this,\"FlateWorker/\"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}i.magic=\"\\b\\0\",o.inherits(s,a),s.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(r,e.data),!1)},s.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},s.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},s.prototype._createPako=function(){var t=e(\"pako\");this._pako=new t[this._pakoAction]({chunkSize:65536,raw:!0,level:this._pakoOptions.level||-1});var i=this;this._pako.onData=function(e){i.push({data:e,meta:i.meta})}},i.compressWorker=function(e){return new s(\"Deflate\",e)},i.uncompressWorker=function(){return new s(\"Inflate\",{})}},{\"./stream/GenericWorker\":28,\"./utils\":32,pako:38}],8:[function(e,t,i){\"use strict\";function n(e,t){var i,n=\"\";for(i=0;i>>=8;return n}function o(e,t,i,o,r,c){var d,p,m=e.file,g=e.compression,h=c!==s.utf8encode,f=a.transformTo(\"string\",c(m.name)),b=a.transformTo(\"string\",s.utf8encode(m.name)),y=m.comment,v=a.transformTo(\"string\",c(y)),k=a.transformTo(\"string\",s.utf8encode(y)),w=b.length!==m.name.length,T=k.length!==y.length,S=\"\",M=\"\",E=\"\",I=m.dir,x=m.date,_={crc32:0,compressedSize:0,uncompressedSize:0};t&&!i||(_.crc32=e.crc32,_.compressedSize=e.compressedSize,_.uncompressedSize=e.uncompressedSize);var O=0;t&&(O|=8),h||!w&&!T||(O|=2048);var C=0,N=0;I&&(C|=16),\"UNIX\"===r?(N=798,C|=function(e,t){var i=e;return e||(i=t?16893:33204),(65535&i)<<16}(m.unixPermissions,I)):(N=20,C|=function(e){return 63&(e||0)}(m.dosPermissions)),d=x.getUTCHours(),d<<=6,d|=x.getUTCMinutes(),d<<=5,d|=x.getUTCSeconds()/2,p=x.getUTCFullYear()-1980,p<<=4,p|=x.getUTCMonth()+1,p<<=5,p|=x.getUTCDate(),w&&(M=n(1,1)+n(l(f),4)+b,S+=\"up\"+n(M.length,2)+M),T&&(E=n(1,1)+n(l(v),4)+k,S+=\"uc\"+n(E.length,2)+E);var A=\"\";return A+=\"\\n\\0\",A+=n(O,2),A+=g.magic,A+=n(d,2),A+=n(p,2),A+=n(_.crc32,4),A+=n(_.compressedSize,4),A+=n(_.uncompressedSize,4),A+=n(f.length,2),A+=n(S.length,2),{fileRecord:u.LOCAL_FILE_HEADER+A+f+S,dirRecord:u.CENTRAL_FILE_HEADER+n(N,2)+A+n(v.length,2)+\"\\0\\0\\0\\0\"+n(C,4)+n(o,4)+f+S+v}}var a=e(\"../utils\"),r=e(\"../stream/GenericWorker\"),s=e(\"../utf8\"),l=e(\"../crc32\"),u=e(\"../signature\");function c(e,t,i,n){r.call(this,\"ZipFileWorker\"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=i,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(c,r),c.prototype.push=function(e){var t=e.meta.percent||0,i=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,r.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:i?(t+100*(i-n-1))/i:100}}))},c.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var i=o(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:i.fileRecord,meta:{percent:0}})}else this.accumulate=!0},c.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,i=o(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(i.dirRecord),t)this.push({data:function(e){return u.DATA_DESCRIPTOR+n(e.crc32,4)+n(e.compressedSize,4)+n(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:i.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},c.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)i=(i<<8)+this.byteAt(t);return this.index+=e,i},readString:function(e){return n.transformTo(\"string\",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=o},{\"../utils\":32}],19:[function(e,t,i){\"use strict\";var n=e(\"./Uint8ArrayReader\");function o(e){n.call(this,e)}e(\"../utils\").inherits(o,n),o.prototype.readData=function(e){this.checkOffset(e);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=o},{\"../utils\":32,\"./Uint8ArrayReader\":21}],20:[function(e,t,i){\"use strict\";var n=e(\"./DataReader\");function o(e){n.call(this,e)}e(\"../utils\").inherits(o,n),o.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},o.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},o.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},o.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=o},{\"../utils\":32,\"./DataReader\":18}],21:[function(e,t,i){\"use strict\";var n=e(\"./ArrayReader\"),o=e(\"./DataReader\");function a(e){o.call(this,e)}e(\"../utils\").inherits(a,n),a.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=a},{\"../utils\":32,\"./ArrayReader\":17,\"./DataReader\":18}],22:[function(e,t,i){\"use strict\";var n=e(\"../utils\"),o=e(\"../support\"),a=e(\"./ArrayReader\"),r=e(\"./StringReader\"),s=e(\"./NodeBufferReader\"),l=e(\"./Uint8ArrayReader\");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),\"string\"!==t||o.uint8array?\"nodebuffer\"===t?new s(e):o.uint8array?new l(n.transformTo(\"uint8array\",e)):new a(n.transformTo(\"array\",e)):new r(e)}},{\"../support\":30,\"../utils\":32,\"./ArrayReader\":17,\"./NodeBufferReader\":19,\"./StringReader\":20,\"./Uint8ArrayReader\":21}],23:[function(e,t,i){\"use strict\";i.LOCAL_FILE_HEADER=\"PK\u0003\u0004\",i.CENTRAL_FILE_HEADER=\"PK\u0001\u0002\",i.CENTRAL_DIRECTORY_END=\"PK\u0005\u0006\",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR=\"PK\u0006\u0007\",i.ZIP64_CENTRAL_DIRECTORY_END=\"PK\u0006\u0006\",i.DATA_DESCRIPTOR=\"PK\u0007\\b\"},{}],24:[function(e,t,i){\"use strict\";var n=e(\"./GenericWorker\"),o=e(\"../utils\");function a(e){n.call(this,\"ConvertWorker to \"+e),this.destType=e}o.inherits(a,n),a.prototype.processChunk=function(e){this.push({data:o.transformTo(this.destType,e.data),meta:e.meta})},t.exports=a},{\"../utils\":32,\"./GenericWorker\":28}],25:[function(e,t,i){\"use strict\";var n=e(\"./GenericWorker\"),o=e(\"../crc32\");function a(){n.call(this,\"Crc32Probe\"),this.withStreamInfo(\"crc32\",0)}e(\"../utils\").inherits(a,n),a.prototype.processChunk=function(e){this.streamInfo.crc32=o(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=a},{\"../crc32\":4,\"../utils\":32,\"./GenericWorker\":28}],26:[function(e,t,i){\"use strict\";var n=e(\"../utils\"),o=e(\"./GenericWorker\");function a(e){o.call(this,\"DataLengthProbe for \"+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(a,o),a.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}o.prototype.processChunk.call(this,e)},t.exports=a},{\"../utils\":32,\"./GenericWorker\":28}],27:[function(e,t,i){\"use strict\";var n=e(\"../utils\"),o=e(\"./GenericWorker\");function a(e){o.call(this,\"DataWorker\");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=\"\",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}n.inherits(a,o),a.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+65536);if(this.index>=this.max)return this.end();switch(this.type){case\"string\":e=this.data.substring(this.index,t);break;case\"uint8array\":case\"nodebuffer\":e=this.data.subarray(this.index,t);break;case\"array\":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=a},{\"../utils\":32,\"./GenericWorker\":28}],28:[function(e,t,i){\"use strict\";function n(e){this.name=e||\"default\",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit(\"data\",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit(\"end\"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit(\"error\",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit(\"error\",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var i=0;i \"+e:e}},t.exports=n},{}],29:[function(e,i,n){\"use strict\";var o=e(\"../utils\"),a=e(\"./ConvertWorker\"),r=e(\"./GenericWorker\"),s=e(\"../base64\"),l=e(\"../support\"),u=e(\"../external\"),c=null;if(l.nodestream)try{c=e(\"../nodejs/NodejsStreamOutputAdapter\")}catch(e){}function d(e,i){return new u.Promise((function(n,a){var r=[],l=e._internalType,u=e._outputType,c=e._mimeType;e.on(\"data\",(function(e,t){r.push(e),i&&i(t)})).on(\"error\",(function(e){r=[],a(e)})).on(\"end\",(function(){try{var e=function(e,t,i){switch(e){case\"blob\":return o.newBlob(o.transformTo(\"arraybuffer\",t),i);case\"base64\":return s.encode(t);default:return o.transformTo(e,t)}}(u,function(e,i){var n,o=0,a=null,r=0;for(n=0;n>>6:(i<65536?t[r++]=224|i>>>12:(t[r++]=240|i>>>18,t[r++]=128|i>>>12&63),t[r++]=128|i>>>6&63),t[r++]=128|63&i);return t}(e)},i.utf8decode=function(e){return o.nodebuffer?n.transformTo(\"nodebuffer\",e).toString(\"utf-8\"):function(e){var t,i,o,a,r=e.length,l=new Array(2*r);for(t=i=0;t>10&1023,l[i++]=56320|1023&o)}return l.length!==i&&(l.subarray?l=l.subarray(0,i):l.length=i),n.applyFromCharCode(l)}(e=n.transformTo(o.uint8array?\"uint8array\":\"array\",e))},n.inherits(u,r),u.prototype.processChunk=function(e){var t=n.transformTo(o.uint8array?\"uint8array\":\"array\",e.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var a=t;(t=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),t.set(a,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var r=function(e,t){var i;for((t=t||e.length)>e.length&&(t=e.length),i=t-1;0<=i&&128==(192&e[i]);)i--;return i<0||0===i?t:i+s[e[i]]>t?i:t}(t),l=t;r!==t.length&&(o.uint8array?(l=t.subarray(0,r),this.leftOver=t.subarray(r,t.length)):(l=t.slice(0,r),this.leftOver=t.slice(r,t.length))),this.push({data:i.utf8decode(l),meta:e.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=u,n.inherits(c,r),c.prototype.processChunk=function(e){this.push({data:i.utf8encode(e.data),meta:e.meta})},i.Utf8EncodeWorker=c},{\"./nodejsUtils\":14,\"./stream/GenericWorker\":28,\"./support\":30,\"./utils\":32}],32:[function(e,t,n){\"use strict\";var o=e(\"./support\"),a=e(\"./base64\"),r=e(\"./nodejsUtils\"),s=e(\"./external\");function l(e){return e}function u(e,t){for(var i=0;i>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||\"/\"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=o(this.extraFields[1].value);this.uncompressedSize===a.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===a.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===a.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===a.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,i,n,o=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4>>6:(i<65536?t[r++]=224|i>>>12:(t[r++]=240|i>>>18,t[r++]=128|i>>>12&63),t[r++]=128|i>>>6&63),t[r++]=128|63&i);return t},i.buf2binstring=function(e){return l(e,e.length)},i.binstring2buf=function(e){for(var t=new n.Buf8(e.length),i=0,o=t.length;i>10&1023,u[n++]=56320|1023&o)}return l(u,n)},i.utf8border=function(e,t){var i;for((t=t||e.length)>e.length&&(t=e.length),i=t-1;0<=i&&128==(192&e[i]);)i--;return i<0||0===i?t:i+r[e[i]]>t?i:t}},{\"./common\":41}],43:[function(e,t,i){\"use strict\";t.exports=function(e,t,i,n){for(var o=65535&e,a=e>>>16&65535,r=0;0!==i;){for(i-=r=2e3>>1:e>>>1;t[i]=e}return t}();t.exports=function(e,t,i,o){var a=n,r=o+i;e^=-1;for(var s=o;s>>8^a[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,i){\"use strict\";var n,o=e(\"../utils/common\"),a=e(\"./trees\"),r=e(\"./adler32\"),s=e(\"./crc32\"),l=e(\"./messages\"),u=0,c=4,d=0,p=-2,m=-1,g=4,h=2,f=8,b=9,y=286,v=30,k=19,w=2*y+1,T=15,S=3,M=258,E=M+S+1,I=42,x=113,_=1,O=2,C=3,N=4;function A(e,t){return e.msg=l[t],t}function P(e){return(e<<1)-(4e.avail_out&&(i=e.avail_out),0!==i&&(o.arraySet(e.output,t.pending_buf,t.pending_out,i,e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending&&(t.pending_out=0))}function R(e,t){a._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,L(e.strm)}function j(e,t){e.pending_buf[e.pending++]=t}function z(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function B(e,t){var i,n,o=e.max_chain_length,a=e.strstart,r=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-E?e.strstart-(e.w_size-E):0,u=e.window,c=e.w_mask,d=e.prev,p=e.strstart+M,m=u[a+r-1],g=u[a+r];e.prev_length>=e.good_match&&(o>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(i=t)+r]===g&&u[i+r-1]===m&&u[i]===u[a]&&u[++i]===u[a+1]){a+=2,i++;do{}while(u[++a]===u[++i]&&u[++a]===u[++i]&&u[++a]===u[++i]&&u[++a]===u[++i]&&u[++a]===u[++i]&&u[++a]===u[++i]&&u[++a]===u[++i]&&u[++a]===u[++i]&&al&&0!=--o);return r<=e.lookahead?r:e.lookahead}function U(e){var t,i,n,a,l,u,c,d,p,m,g=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=g+(g-E)){for(o.arraySet(e.window,e.window,g,g,0),e.match_start-=g,e.strstart-=g,e.block_start-=g,t=i=e.hash_size;n=e.head[--t],e.head[t]=g<=n?n-g:0,--i;);for(t=i=g;n=e.prev[--t],e.prev[t]=g<=n?n-g:0,--i;);a+=g}if(0===e.strm.avail_in)break;if(u=e.strm,c=e.window,d=e.strstart+e.lookahead,m=void 0,(p=a)<(m=u.avail_in)&&(m=p),i=0===m?0:(u.avail_in-=m,o.arraySet(c,u.input,u.next_in,m,d),1===u.state.wrap?u.adler=r(u.adler,c,m,d):2===u.state.wrap&&(u.adler=s(u.adler,c,m,d)),u.next_in+=m,u.total_in+=m,m),e.lookahead+=i,e.lookahead+e.insert>=S)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<=S&&(e.ins_h=(e.ins_h<=S)if(n=a._tr_tally(e,e.strstart-e.match_start,e.match_length-S),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=S){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=S&&(e.ins_h=(e.ins_h<=S&&e.match_length<=e.prev_length){for(o=e.strstart+e.lookahead-S,n=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-S),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=o&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(i=e.pending_buf_size-5);;){if(e.lookahead<=1){if(U(e),0===e.lookahead&&t===u)return _;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+i;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,R(e,!1),0===e.strm.avail_out))return _;if(e.strstart-e.block_start>=e.w_size-E&&(R(e,!1),0===e.strm.avail_out))return _}return e.insert=0,t===c?(R(e,!0),0===e.strm.avail_out?C:N):(e.strstart>e.block_start&&(R(e,!1),e.strm.avail_out),_)})),new G(4,4,8,4,F),new G(4,5,16,8,F),new G(4,6,32,32,F),new G(4,4,16,16,H),new G(8,16,32,32,H),new G(8,16,128,128,H),new G(8,32,128,256,H),new G(32,128,258,1024,H),new G(32,258,258,4096,H)],i.deflateInit=function(e,t){return Y(e,t,f,15,8,0)},i.deflateInit2=Y,i.deflateReset=q,i.deflateResetKeep=V,i.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?p:(e.state.gzhead=t,d):p},i.deflate=function(e,t){var i,o,r,l;if(!e||!e.state||5>8&255),j(o,o.gzhead.time>>16&255),j(o,o.gzhead.time>>24&255),j(o,9===o.level?2:2<=o.strategy||o.level<2?4:0),j(o,255&o.gzhead.os),o.gzhead.extra&&o.gzhead.extra.length&&(j(o,255&o.gzhead.extra.length),j(o,o.gzhead.extra.length>>8&255)),o.gzhead.hcrc&&(e.adler=s(e.adler,o.pending_buf,o.pending,0)),o.gzindex=0,o.status=69):(j(o,0),j(o,0),j(o,0),j(o,0),j(o,0),j(o,9===o.level?2:2<=o.strategy||o.level<2?4:0),j(o,3),o.status=x);else{var m=f+(o.w_bits-8<<4)<<8;m|=(2<=o.strategy||o.level<2?0:o.level<6?1:6===o.level?2:3)<<6,0!==o.strstart&&(m|=32),m+=31-m%31,o.status=x,z(o,m),0!==o.strstart&&(z(o,e.adler>>>16),z(o,65535&e.adler)),e.adler=1}if(69===o.status)if(o.gzhead.extra){for(r=o.pending;o.gzindex<(65535&o.gzhead.extra.length)&&(o.pending!==o.pending_buf_size||(o.gzhead.hcrc&&o.pending>r&&(e.adler=s(e.adler,o.pending_buf,o.pending-r,r)),L(e),r=o.pending,o.pending!==o.pending_buf_size));)j(o,255&o.gzhead.extra[o.gzindex]),o.gzindex++;o.gzhead.hcrc&&o.pending>r&&(e.adler=s(e.adler,o.pending_buf,o.pending-r,r)),o.gzindex===o.gzhead.extra.length&&(o.gzindex=0,o.status=73)}else o.status=73;if(73===o.status)if(o.gzhead.name){r=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>r&&(e.adler=s(e.adler,o.pending_buf,o.pending-r,r)),L(e),r=o.pending,o.pending===o.pending_buf_size)){l=1;break}l=o.gzindexr&&(e.adler=s(e.adler,o.pending_buf,o.pending-r,r)),0===l&&(o.gzindex=0,o.status=91)}else o.status=91;if(91===o.status)if(o.gzhead.comment){r=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>r&&(e.adler=s(e.adler,o.pending_buf,o.pending-r,r)),L(e),r=o.pending,o.pending===o.pending_buf_size)){l=1;break}l=o.gzindexr&&(e.adler=s(e.adler,o.pending_buf,o.pending-r,r)),0===l&&(o.status=103)}else o.status=103;if(103===o.status&&(o.gzhead.hcrc?(o.pending+2>o.pending_buf_size&&L(e),o.pending+2<=o.pending_buf_size&&(j(o,255&e.adler),j(o,e.adler>>8&255),e.adler=0,o.status=x)):o.status=x),0!==o.pending){if(L(e),0===e.avail_out)return o.last_flush=-1,d}else if(0===e.avail_in&&P(t)<=P(i)&&t!==c)return A(e,-5);if(666===o.status&&0!==e.avail_in)return A(e,-5);if(0!==e.avail_in||0!==o.lookahead||t!==u&&666!==o.status){var g=2===o.strategy?function(e,t){for(var i;;){if(0===e.lookahead&&(U(e),0===e.lookahead)){if(t===u)return _;break}if(e.match_length=0,i=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(R(e,!1),0===e.strm.avail_out))return _}return e.insert=0,t===c?(R(e,!0),0===e.strm.avail_out?C:N):e.last_lit&&(R(e,!1),0===e.strm.avail_out)?_:O}(o,t):3===o.strategy?function(e,t){for(var i,n,o,r,s=e.window;;){if(e.lookahead<=M){if(U(e),e.lookahead<=M&&t===u)return _;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=S&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=S?(i=a._tr_tally(e,1,e.match_length-S),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(R(e,!1),0===e.strm.avail_out))return _}return e.insert=0,t===c?(R(e,!0),0===e.strm.avail_out?C:N):e.last_lit&&(R(e,!1),0===e.strm.avail_out)?_:O}(o,t):n[o.level].func(o,t);if(g!==C&&g!==N||(o.status=666),g===_||g===C)return 0===e.avail_out&&(o.last_flush=-1),d;if(g===O&&(1===t?a._tr_align(o):5!==t&&(a._tr_stored_block(o,0,0,!1),3===t&&(D(o.head),0===o.lookahead&&(o.strstart=0,o.block_start=0,o.insert=0))),L(e),0===e.avail_out))return o.last_flush=-1,d}return t!==c?d:o.wrap<=0?1:(2===o.wrap?(j(o,255&e.adler),j(o,e.adler>>8&255),j(o,e.adler>>16&255),j(o,e.adler>>24&255),j(o,255&e.total_in),j(o,e.total_in>>8&255),j(o,e.total_in>>16&255),j(o,e.total_in>>24&255)):(z(o,e.adler>>>16),z(o,65535&e.adler)),L(e),0=i.w_size&&(0===s&&(D(i.head),i.strstart=0,i.block_start=0,i.insert=0),m=new o.Buf8(i.w_size),o.arraySet(m,t,g-i.w_size,i.w_size,0),t=m,g=i.w_size),l=e.avail_in,u=e.next_in,c=e.input,e.avail_in=g,e.next_in=0,e.input=t,U(i);i.lookahead>=S;){for(n=i.strstart,a=i.lookahead-(S-1);i.ins_h=(i.ins_h<>>=k=v>>>24,g-=k,0==(k=v>>>16&255))I[a++]=65535&v;else{if(!(16&k)){if(!(64&k)){v=h[(65535&v)+(m&(1<>>=k,g-=k),g<15&&(m+=E[n++]<>>=k=v>>>24,g-=k,!(16&(k=v>>>16&255))){if(!(64&k)){v=f[(65535&v)+(m&(1<>>=k,g-=k,(k=a-r)>3,m&=(1<<(g-=w<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function f(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function b(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=\"\",t.wrap&&(e.adler=1&t.wrap),t.mode=p,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(m),t.distcode=t.distdyn=new n.Buf32(g),t.sane=1,t.back=-1,c):d}function y(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,b(e)):d}function v(e,t){var i,n;return e&&e.state?(n=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=r.wsize?(n.arraySet(r.window,t,i-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):(o<(a=r.wsize-r.wnext)&&(a=o),n.arraySet(r.window,t,i-o,a,r.wnext),(o-=a)?(n.arraySet(r.window,t,i-o,o,0),r.wnext=o,r.whave=r.wsize):(r.wnext+=a,r.wnext===r.wsize&&(r.wnext=0),r.whave>>8&255,i.check=a(i.check,U,2,0),w=k=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&k)<<8)+(k>>8))%31){e.msg=\"incorrect header check\",i.mode=30;break}if(8!=(15&k)){e.msg=\"unknown compression method\",i.mode=30;break}if(w-=4,L=8+(15&(k>>>=4)),0===i.wbits)i.wbits=L;else if(L>i.wbits){e.msg=\"invalid window size\",i.mode=30;break}i.dmax=1<>8&1),512&i.flags&&(U[0]=255&k,U[1]=k>>>8&255,i.check=a(i.check,U,2,0)),w=k=0,i.mode=3;case 3:for(;w<32;){if(0===y)break e;y--,k+=m[f++]<>>8&255,U[2]=k>>>16&255,U[3]=k>>>24&255,i.check=a(i.check,U,4,0)),w=k=0,i.mode=4;case 4:for(;w<16;){if(0===y)break e;y--,k+=m[f++]<>8),512&i.flags&&(U[0]=255&k,U[1]=k>>>8&255,i.check=a(i.check,U,2,0)),w=k=0,i.mode=5;case 5:if(1024&i.flags){for(;w<16;){if(0===y)break e;y--,k+=m[f++]<>>8&255,i.check=a(i.check,U,2,0)),w=k=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&(y<(I=i.length)&&(I=y),I&&(i.head&&(L=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),n.arraySet(i.head.extra,m,f,I,L)),512&i.flags&&(i.check=a(i.check,m,I,f)),y-=I,f+=I,i.length-=I),i.length))break e;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===y)break e;for(I=0;L=m[f+I++],i.head&&L&&i.length<65536&&(i.head.name+=String.fromCharCode(L)),L&&I>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=12;break;case 10:for(;w<32;){if(0===y)break e;y--,k+=m[f++]<>>=7&w,w-=7&w,i.mode=27;break}for(;w<3;){if(0===y)break e;y--,k+=m[f++]<>>=1)){case 0:i.mode=14;break;case 1:if(M(i),i.mode=20,6!==t)break;k>>>=2,w-=2;break e;case 2:i.mode=17;break;case 3:e.msg=\"invalid block type\",i.mode=30}k>>>=2,w-=2;break;case 14:for(k>>>=7&w,w-=7&w;w<32;){if(0===y)break e;y--,k+=m[f++]<>>16^65535)){e.msg=\"invalid stored block lengths\",i.mode=30;break}if(i.length=65535&k,w=k=0,i.mode=15,6===t)break e;case 15:i.mode=16;case 16:if(I=i.length){if(y>>=5,w-=5,i.ndist=1+(31&k),k>>>=5,w-=5,i.ncode=4+(15&k),k>>>=4,w-=4,286>>=3,w-=3}for(;i.have<19;)i.lens[F[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,j={bits:i.lenbits},R=s(0,i.lens,0,19,i.lencode,0,i.work,j),i.lenbits=j.bits,R){e.msg=\"invalid code lengths set\",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have>>16&255,N=65535&B,!((O=B>>>24)<=w);){if(0===y)break e;y--,k+=m[f++]<>>=O,w-=O,i.lens[i.have++]=N;else{if(16===N){for(z=O+2;w>>=O,w-=O,0===i.have){e.msg=\"invalid bit length repeat\",i.mode=30;break}L=i.lens[i.have-1],I=3+(3&k),k>>>=2,w-=2}else if(17===N){for(z=O+3;w>>=O)),k>>>=3,w-=3}else{for(z=O+7;w>>=O)),k>>>=7,w-=7}if(i.have+I>i.nlen+i.ndist){e.msg=\"invalid bit length repeat\",i.mode=30;break}for(;I--;)i.lens[i.have++]=L}}if(30===i.mode)break;if(0===i.lens[256]){e.msg=\"invalid code -- missing end-of-block\",i.mode=30;break}if(i.lenbits=9,j={bits:i.lenbits},R=s(l,i.lens,0,i.nlen,i.lencode,0,i.work,j),i.lenbits=j.bits,R){e.msg=\"invalid literal/lengths set\",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,j={bits:i.distbits},R=s(u,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,j),i.distbits=j.bits,R){e.msg=\"invalid distances set\",i.mode=30;break}if(i.mode=20,6===t)break e;case 20:i.mode=21;case 21:if(6<=y&&258<=v){e.next_out=b,e.avail_out=v,e.next_in=f,e.avail_in=y,i.hold=k,i.bits=w,r(e,S),b=e.next_out,g=e.output,v=e.avail_out,f=e.next_in,m=e.input,y=e.avail_in,k=i.hold,w=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;C=(B=i.lencode[k&(1<>>16&255,N=65535&B,!((O=B>>>24)<=w);){if(0===y)break e;y--,k+=m[f++]<>A)])>>>16&255,N=65535&B,!(A+(O=B>>>24)<=w);){if(0===y)break e;y--,k+=m[f++]<>>=A,w-=A,i.back+=A}if(k>>>=O,w-=O,i.back+=O,i.length=N,0===C){i.mode=26;break}if(32&C){i.back=-1,i.mode=12;break}if(64&C){e.msg=\"invalid literal/length code\",i.mode=30;break}i.extra=15&C,i.mode=22;case 22:if(i.extra){for(z=i.extra;w>>=i.extra,w-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;C=(B=i.distcode[k&(1<>>16&255,N=65535&B,!((O=B>>>24)<=w);){if(0===y)break e;y--,k+=m[f++]<>A)])>>>16&255,N=65535&B,!(A+(O=B>>>24)<=w);){if(0===y)break e;y--,k+=m[f++]<>>=A,w-=A,i.back+=A}if(k>>>=O,w-=O,i.back+=O,64&C){e.msg=\"invalid distance code\",i.mode=30;break}i.offset=N,i.extra=15&C,i.mode=24;case 24:if(i.extra){for(z=i.extra;w>>=i.extra,w-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg=\"invalid distance too far back\",i.mode=30;break}i.mode=25;case 25:if(0===v)break e;if(I=S-v,i.offset>I){if((I=i.offset-I)>i.whave&&i.sane){e.msg=\"invalid distance too far back\",i.mode=30;break}x=I>i.wnext?(I-=i.wnext,i.wsize-I):i.wnext-I,I>i.length&&(I=i.length),_=i.window}else _=g,x=b-i.offset,I=i.length;for(vy?(k=j[z+d[M]],P[D+d[M]]):(k=96,0),m=1<>O)+(g-=m)]=v<<24|k<<16|w,0!==g;);for(m=1<>=1;if(0!==m?(A&=m-1,A+=m):A=0,M++,0==--L[S]){if(S===I)break;S=t[i+d[M]]}if(x>>7)]}function j(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function z(e,t,i){e.bi_valid>h-i?(e.bi_buf|=t<>h-e.bi_valid,e.bi_valid+=i-h):(e.bi_buf|=t<>>=1,i<<=1,0<--t;);return i>>>1}function F(e,t,i){var n,o,a=new Array(g+1),r=0;for(n=1;n<=g;n++)a[n]=r=r+i[n-1]<<1;for(o=0;o<=t;o++){var s=e[2*o+1];0!==s&&(e[2*o]=U(a[s]++,s))}}function H(e){var t;for(t=0;t>1;1<=i;i--)V(e,a,i);for(o=l;i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],V(e,a,1),n=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=n,a[2*o]=a[2*i]+a[2*n],e.depth[o]=(e.depth[i]>=e.depth[n]?e.depth[i]:e.depth[n])+1,a[2*i+1]=a[2*n+1]=o,e.heap[1]=o++,V(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var i,n,o,a,r,s,l=t.dyn_tree,u=t.max_code,c=t.stat_desc.static_tree,d=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,f=t.stat_desc.max_length,b=0;for(a=0;a<=g;a++)e.bl_count[a]=0;for(l[2*e.heap[e.heap_max]+1]=0,i=e.heap_max+1;i>=7;n>>=1)if(1&i&&0!==e.dyn_ltree[2*t])return o;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return a;for(t=32;t>>3,(s=e.static_len+3+7>>>3)<=r&&(r=s)):r=s=i+5,i+4<=r&&-1!==t?X(e,t,i,n):4===e.strategy||s===r?(z(e,2+(n?1:0),3),q(e,E,I)):(z(e,4+(n?1:0),3),function(e,t,i,n){var o;for(z(e,t-257,5),z(e,i-1,5),z(e,n-4,4),o=0;o>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&i,e.last_lit++,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(_[i]+u+1)]++,e.dyn_dtree[2*R(t)]++),e.last_lit===e.lit_bufsize-1},i._tr_align=function(e){z(e,2,3),B(e,b,E),function(e){16===e.bi_valid?(j(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{\"../utils/common\":41}],53:[function(e,t,i){\"use strict\";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,i){(function(e){!function(e,t){\"use strict\";if(!e.setImmediate){var i,n,a,r,s=1,l={},u=!1,c=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,i=\"[object process]\"==={}.toString.call(e.process)?function(e){o.nextTick((function(){m(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,i=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage(\"\",\"*\"),e.onmessage=i,t}}()?(r=\"setImmediate$\"+Math.random()+\"$\",e.addEventListener?e.addEventListener(\"message\",g,!1):e.attachEvent(\"onmessage\",g),function(t){e.postMessage(r+t,\"*\")}):e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){m(e.data)},function(e){a.port2.postMessage(e)}):c&&\"onreadystatechange\"in c.createElement(\"script\")?(n=c.documentElement,function(e){var t=c.createElement(\"script\");t.onreadystatechange=function(){m(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):function(e){setTimeout(m,0,e)},d.setImmediate=function(e){\"function\"!=typeof e&&(e=new Function(\"\"+e));for(var t=new Array(arguments.length-1),n=0;n>2]|=e[a]<>6,l[o++]=128|63&n):n<55296||n>=57344?(l[o++]=224|n>>12,l[o++]=128|n>>6&63,l[o++]=128|63&n):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++a)),l[o++]=240|n>>18,l[o++]=128|n>>12&63,l[o++]=128|n>>6&63,l[o++]=128|63&n);else for(o=this.start;a>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(s[o>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=64?(this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=EXTRA[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var e,t,i,n,o,a,r=this.blocks;this.first?t=((t=((e=((e=r[0]-680876937)<<7|e>>>25)-271733879|0)^(i=((i=(-271733879^(n=((n=(-1732584194^2004318071&e)+r[1]-117830708)<<12|n>>>20)+e|0)&(-271733879^e))+r[2]-1126478375)<<17|i>>>15)+n|0)&(n^e))+r[3]-1316259209)<<22|t>>>10)+i|0:(e=this.h0,t=this.h1,i=this.h2,t=((t+=((e=((e+=((n=this.h3)^t&(i^n))+r[0]-680876936)<<7|e>>>25)+t|0)^(i=((i+=(t^(n=((n+=(i^e&(t^i))+r[1]-389564586)<<12|n>>>20)+e|0)&(e^t))+r[2]+606105819)<<17|i>>>15)+n|0)&(n^e))+r[3]-1044525330)<<22|t>>>10)+i|0),t=((t+=((e=((e+=(n^t&(i^n))+r[4]-176418897)<<7|e>>>25)+t|0)^(i=((i+=(t^(n=((n+=(i^e&(t^i))+r[5]+1200080426)<<12|n>>>20)+e|0)&(e^t))+r[6]-1473231341)<<17|i>>>15)+n|0)&(n^e))+r[7]-45705983)<<22|t>>>10)+i|0,t=((t+=((e=((e+=(n^t&(i^n))+r[8]+1770035416)<<7|e>>>25)+t|0)^(i=((i+=(t^(n=((n+=(i^e&(t^i))+r[9]-1958414417)<<12|n>>>20)+e|0)&(e^t))+r[10]-42063)<<17|i>>>15)+n|0)&(n^e))+r[11]-1990404162)<<22|t>>>10)+i|0,t=((t+=((e=((e+=(n^t&(i^n))+r[12]+1804603682)<<7|e>>>25)+t|0)^(i=((i+=(t^(n=((n+=(i^e&(t^i))+r[13]-40341101)<<12|n>>>20)+e|0)&(e^t))+r[14]-1502002290)<<17|i>>>15)+n|0)&(n^e))+r[15]+1236535329)<<22|t>>>10)+i|0,t=((t+=((n=((n+=(t^i&((e=((e+=(i^n&(t^i))+r[1]-165796510)<<5|e>>>27)+t|0)^t))+r[6]-1069501632)<<9|n>>>23)+e|0)^e&((i=((i+=(e^t&(n^e))+r[11]+643717713)<<14|i>>>18)+n|0)^n))+r[0]-373897302)<<20|t>>>12)+i|0,t=((t+=((n=((n+=(t^i&((e=((e+=(i^n&(t^i))+r[5]-701558691)<<5|e>>>27)+t|0)^t))+r[10]+38016083)<<9|n>>>23)+e|0)^e&((i=((i+=(e^t&(n^e))+r[15]-660478335)<<14|i>>>18)+n|0)^n))+r[4]-405537848)<<20|t>>>12)+i|0,t=((t+=((n=((n+=(t^i&((e=((e+=(i^n&(t^i))+r[9]+568446438)<<5|e>>>27)+t|0)^t))+r[14]-1019803690)<<9|n>>>23)+e|0)^e&((i=((i+=(e^t&(n^e))+r[3]-187363961)<<14|i>>>18)+n|0)^n))+r[8]+1163531501)<<20|t>>>12)+i|0,t=((t+=((n=((n+=(t^i&((e=((e+=(i^n&(t^i))+r[13]-1444681467)<<5|e>>>27)+t|0)^t))+r[2]-51403784)<<9|n>>>23)+e|0)^e&((i=((i+=(e^t&(n^e))+r[7]+1735328473)<<14|i>>>18)+n|0)^n))+r[12]-1926607734)<<20|t>>>12)+i|0,t=((t+=((a=(n=((n+=((o=t^i)^(e=((e+=(o^n)+r[5]-378558)<<4|e>>>28)+t|0))+r[8]-2022574463)<<11|n>>>21)+e|0)^e)^(i=((i+=(a^t)+r[11]+1839030562)<<16|i>>>16)+n|0))+r[14]-35309556)<<23|t>>>9)+i|0,t=((t+=((a=(n=((n+=((o=t^i)^(e=((e+=(o^n)+r[1]-1530992060)<<4|e>>>28)+t|0))+r[4]+1272893353)<<11|n>>>21)+e|0)^e)^(i=((i+=(a^t)+r[7]-155497632)<<16|i>>>16)+n|0))+r[10]-1094730640)<<23|t>>>9)+i|0,t=((t+=((a=(n=((n+=((o=t^i)^(e=((e+=(o^n)+r[13]+681279174)<<4|e>>>28)+t|0))+r[0]-358537222)<<11|n>>>21)+e|0)^e)^(i=((i+=(a^t)+r[3]-722521979)<<16|i>>>16)+n|0))+r[6]+76029189)<<23|t>>>9)+i|0,t=((t+=((a=(n=((n+=((o=t^i)^(e=((e+=(o^n)+r[9]-640364487)<<4|e>>>28)+t|0))+r[12]-421815835)<<11|n>>>21)+e|0)^e)^(i=((i+=(a^t)+r[15]+530742520)<<16|i>>>16)+n|0))+r[2]-995338651)<<23|t>>>9)+i|0,t=((t+=((n=((n+=(t^((e=((e+=(i^(t|~n))+r[0]-198630844)<<6|e>>>26)+t|0)|~i))+r[7]+1126891415)<<10|n>>>22)+e|0)^((i=((i+=(e^(n|~t))+r[14]-1416354905)<<15|i>>>17)+n|0)|~e))+r[5]-57434055)<<21|t>>>11)+i|0,t=((t+=((n=((n+=(t^((e=((e+=(i^(t|~n))+r[12]+1700485571)<<6|e>>>26)+t|0)|~i))+r[3]-1894986606)<<10|n>>>22)+e|0)^((i=((i+=(e^(n|~t))+r[10]-1051523)<<15|i>>>17)+n|0)|~e))+r[1]-2054922799)<<21|t>>>11)+i|0,t=((t+=((n=((n+=(t^((e=((e+=(i^(t|~n))+r[8]+1873313359)<<6|e>>>26)+t|0)|~i))+r[15]-30611744)<<10|n>>>22)+e|0)^((i=((i+=(e^(n|~t))+r[6]-1560198380)<<15|i>>>17)+n|0)|~e))+r[13]+1309151649)<<21|t>>>11)+i|0,t=((t+=((n=((n+=(t^((e=((e+=(i^(t|~n))+r[4]-145523070)<<6|e>>>26)+t|0)|~i))+r[11]-1120210379)<<10|n>>>22)+e|0)^((i=((i+=(e^(n|~t))+r[2]+718787259)<<15|i>>>17)+n|0)|~e))+r[9]-343485551)<<21|t>>>11)+i|0,this.first?(this.h0=e+1732584193|0,this.h1=t-271733879|0,this.h2=i-1732584194|0,this.h3=n+271733878|0,this.first=!1):(this.h0=this.h0+e|0,this.h1=this.h1+t|0,this.h2=this.h2+i|0,this.h3=this.h3+n|0)},Md5.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,i=this.h2,n=this.h3;return HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,i=this.h2,n=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&i,i>>8&255,i>>16&255,i>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var e,t,i,n=\"\",o=this.array(),a=0;a<15;)e=o[a++],t=o[a++],i=o[a++],n+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[63&(e<<4|t>>>4)]+BASE64_ENCODE_CHAR[63&(t<<2|i>>>6)]+BASE64_ENCODE_CHAR[63&i];return e=o[a],n+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[e<<4&63]+\"==\"};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))})()}).call(this,__webpack_require__(121),__webpack_require__(53))},function(e,t,i){var n=i(989),o=i(0);e.exports=function(e,t,i){var o=e[t];if(o){var a=[];if(Object.keys(o).forEach((function(e){-1===n.indexOf(e)&&a.push(e)})),a.length)throw new Error(\"Prop \"+t+\" passed to \"+i+\". Has invalid keys \"+a.join(\", \"))}},e.exports.isRequired=function(t,i,n){if(!t[i])throw new Error(\"Prop \"+i+\" passed to \"+n+\" is required\");return e.exports(t,i,n)},e.exports.supportingArrays=o.oneOfType([o.arrayOf(e.exports),e.exports])},function(e,t,i){\"use strict\";i.d(t,\"a\",(function(){return n})),i.d(t,\"b\",(function(){return o}));const n=1/0,o=10},function(e,t,i){\"use strict\";var n=i(4),o=i.n(n),a=i(0),r=i.n(a),s=i(1),l=i.n(s),u=i(211),c=i.n(u);const d=function(e){const{className:t,level:i,small:n,large:a}=e;return l.a.createElement(\"div\",{className:o()(t,c.a.spinner,c.a[i],{[c.a.small]:n,[c.a.large]:a})})};d.propTypes={className:r.a.string,large:r.a.bool,level:r.a.string,small:r.a.bool},d.defaultProps={className:\"\",large:!1,level:\"info\",small:!1},t.a=d},function(e,t,i){const n=i(1055);e.exports=n.default},function(e,t,i){\"use strict\";function n(e,t){if(t=t||{},null===(e=function(e){var t={};if(\"number\"!=typeof e.sampleRate)return null;if(!Array.isArray(e.channelData))return null;if(!(e.channelData[0]instanceof Float32Array))return null;return t.numberOfChannels=e.channelData.length,t.length=0|e.channelData[0].length,t.sampleRate=0|e.sampleRate,t.channelData=e.channelData,t}(e)))throw new TypeError(\"Invalid AudioData\");var i=!(!t.floatingPoint&&!t.float),n=i?32:0|t.bitDepth||16,o=n>>3,a=e.length*e.numberOfChannels*o,r=new DataView(new Uint8Array(44+a).buffer),s=function(e){var t=0;return{int16:function(i){e.setInt16(t,i,!0),t+=2},uint16:function(i){e.setUint16(t,i,!0),t+=2},uint32:function(i){e.setUint32(t,i,!0),t+=4},string:function(i){for(var n=0,o=i.length;n>8&255,a=i>>16&255;e.setUint8(t+0,n),e.setUint8(t+1,o),e.setUint8(t+2,a),t+=3},pcm24s:function(i){i=Math.round(8388608*i);var n=255&(i=Math.max(-8388608,Math.min(i,8388607))),o=i>>8&255,a=i>>16&255;e.setUint8(t+0,n),e.setUint8(t+1,o),e.setUint8(t+2,a),t+=3},pcm32:function(i){i=(i=Math.max(-1,Math.min(i,1)))<0?2147483648*i:2147483647*i,i=0|Math.round(i),e.setInt32(t,i,!0),t+=4},pcm32s:function(i){i=Math.round(2147483648*i),i=Math.max(-2147483648,Math.min(i,2147483647)),e.setInt32(t,i,!0),t+=4},pcm32f:function(i){e.setFloat32(t,i,!0),t+=4}}}(r),l={formatId:i?3:1,floatingPoint:i,numberOfChannels:e.numberOfChannels,sampleRate:e.sampleRate,bitDepth:n};!function(e,t,i){var n=t.bitDepth>>3;e.string(\"RIFF\"),e.uint32(i),e.string(\"WAVE\"),e.string(\"fmt \"),e.uint32(16),e.uint16(t.floatingPoint?3:1),e.uint16(t.numberOfChannels),e.uint32(t.sampleRate),e.uint32(t.sampleRate*t.numberOfChannels*n),e.uint16(t.numberOfChannels*n),e.uint16(t.bitDepth)}(s,l,r.buffer.byteLength-8);var u=function(e,t,i,n,o){var a=t.bitDepth,r=t.floatingPoint?\"f\":o.symmetric?\"s\":\"\",s=\"pcm\"+a+r;if(!e[s])return new TypeError(\"Not supported bit depth: \"+a);var l=e[s].bind(e),u=t.numberOfChannels,c=n.channelData;e.string(\"data\"),e.uint32(i);for(var d=0,p=n.length;d({type:n,mutator:e,callback:t}),l=e=>({type:o,mutator:e})},function(e,t){e.exports=\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjIwcHgiIGhlaWdodD0iMjBweCIgdmlld0JveD0iMCAwIDIwIDIwIiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA0My4yICgzOTA2OSkgLSBodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2ggLS0+CiAgICA8dGl0bGU+bm8tZmlsbDwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPjwvZGVmcz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiPgogICAgICAgIDxnIGlkPSJuby1maWxsIiBzdHJva2U9IiNGRjY2MUEiIHN0cm9rZS13aWR0aD0iMiI+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0zLDE3IEwxNywzIiBpZD0iTGluZSI+PC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+\"},function(e,t,i){\"use strict\";var n=i(981).default;i(986),(t=e.exports=n).default=t},function(e,t,i){var n=i(1012);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1044);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1078);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1203);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1243);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1244);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t){class i{static get RGB_BLACK(){return{r:0,g:0,b:0}}static get RGB_WHITE(){return{r:255,g:255,b:255}}static decimalToHex(e){e<0&&(e+=16777216);let t=Number(e).toString(16);return t=\"#\".concat(\"000000\".substr(0,6-t.length)).concat(t),t}static decimalToRgb(e){const t=e>>24&255;return{r:e>>16&255,g:e>>8&255,b:255&e,a:t>0?t:255}}static hexToRgb(e){e.startsWith(\"#\")&&(e=e.substring(1));const t=parseInt(e,16);if(isNaN(t))return null;if(6===e.length)return{r:t>>16&255,g:t>>8&255,b:255&t};if(3===e.length){const e=t>>8&15,i=t>>4&15,n=15&t;return{r:e<<4|e,g:i<<4|i,b:n<<4|n}}return null}static rgbToHex(e){return i.decimalToHex(i.rgbToDecimal(e))}static rgbToDecimal(e){return(e.r<<16)+(e.g<<8)+e.b}static hexToDecimal(e){return i.rgbToDecimal(i.hexToRgb(e))}static hsvToRgb(e){let t=e.h%360;t<0&&(t+=360);const i=Math.max(0,Math.min(e.s,1)),n=Math.max(0,Math.min(e.v,1)),o=Math.floor(t/60),a=t/60-o,r=n*(1-i),s=n*(1-i*a),l=n*(1-i*(1-a));let u,c,d;switch(o){default:case 0:u=n,c=l,d=r;break;case 1:u=s,c=n,d=r;break;case 2:u=r,c=n,d=l;break;case 3:u=r,c=s,d=n;break;case 4:u=l,c=r,d=n;break;case 5:u=n,c=r,d=s}return{r:Math.floor(255*u),g:Math.floor(255*c),b:Math.floor(255*d)}}static rgbToHsv(e){const t=e.r/255,i=e.g/255,n=e.b/255,o=Math.min(Math.min(t,i),n),a=Math.max(Math.max(t,i),n);let r=0,s=0;if(o!==a){r=60*((t===o?3:i===o?5:1)-(t===o?i-n:i===o?n-t:t-i)/(a-o))%360,s=(a-o)/a}return{h:r,s:s,v:a}}static mixRgb(e,t,i){if(i<=0)return e;if(i>=1)return t;const n=1-i;return{r:n*e.r+i*t.r,g:n*e.g+i*t.g,b:n*e.b+i*t.b}}}e.exports=i},function(e,t){e.exports={Text:\"text\",Directive:\"directive\",Comment:\"comment\",Script:\"script\",Style:\"style\",Tag:\"tag\",CDATA:\"cdata\",Doctype:\"doctype\",isTag:function(e){return\"tag\"===e.type||\"script\"===e.type||\"style\"===e.type}}},function(e,t){const i=e=>null!=e;class n{constructor(e){var t,i,n,o,a,r,s,l,u,c,d,p,m,g,h;this.id=null!==(t=e.id)&&void 0!==t?t:null,this.spriteName=null!==(i=e.spriteName)&&void 0!==i?i:null,this.targetId=null!==(n=e.targetId)&&void 0!==n?n:null,this.opcode=null!==(o=e.opcode)&&void 0!==o?o:null,this.value=null!==(a=e.value)&&void 0!==a?a:null,this.params=null!==(r=e.params)&&void 0!==r?r:null,this.mode=null!==(s=e.mode)&&void 0!==s?s:\"default\",this.sliderMin=null!==(l=e.sliderMin)&&void 0!==l?l:0,this.sliderMax=null!==(u=e.sliderMax)&&void 0!==u?u:100,this.isDiscrete=null===(c=e.isDiscrete)||void 0===c||c,this.x=null!==(d=e.x)&&void 0!==d?d:null,this.y=null!==(p=e.y)&&void 0!==p?p:null,this.width=null!==(m=e.width)&&void 0!==m?m:0,this.height=null!==(g=e.height)&&void 0!==g?g:0,this.visible=null===(h=e.visible)||void 0===h||h}get(e){switch(e){case\"id\":return this.id;case\"spriteName\":return this.spriteName;case\"targetId\":return this.targetId;case\"opcode\":return this.opcode;case\"value\":return this.value;case\"params\":return this.params;case\"mode\":return this.mode;case\"sliderMin\":return this.sliderMin;case\"sliderMax\":return this.sliderMax;case\"isDiscrete\":return this.isDiscrete;case\"x\":return this.x;case\"y\":return this.y;case\"width\":return this.width;case\"height\":return this.height;case\"visible\":return this.visible}return null}merge(e){let t=!1;return i(e.id)&&!Object.is(this.id,e.id)&&(this.id=e.id,t=!0),i(e.spriteName)&&!Object.is(this.spriteName,e.spriteName)&&(this.spriteName=e.spriteName,t=!0),i(e.targetId)&&!Object.is(this.targetId,e.targetId)&&(this.targetId=e.targetId,t=!0),i(e.opcode)&&!Object.is(this.opcode,e.opcode)&&(this.opcode=e.opcode,t=!0),i(e.value)&&!Object.is(this.value,e.value)&&(this.value=e.value,t=!0),i(e.params)&&!Object.is(this.params,e.params)&&(this.params=e.params,t=!0),i(e.mode)&&!Object.is(this.mode,e.mode)&&(this.mode=e.mode,t=!0),i(e.sliderMin)&&!Object.is(this.sliderMin,e.sliderMin)&&(this.sliderMin=e.sliderMin,t=!0),i(e.sliderMax)&&!Object.is(this.sliderMax,e.sliderMax)&&(this.sliderMax=e.sliderMax,t=!0),i(e.isDiscrete)&&!Object.is(this.isDiscrete,e.isDiscrete)&&(this.isDiscrete=e.isDiscrete,t=!0),i(e.x)&&!Object.is(this.x,e.x)&&(this.x=e.x,t=!0),i(e.y)&&!Object.is(this.y,e.y)&&(this.y=e.y,t=!0),i(e.width)&&!Object.is(this.width,e.width)&&(this.width=e.width,t=!0),i(e.height)&&!Object.is(this.height,e.height)&&(this.height=e.height,t=!0),i(e.visible)&&!Object.is(this.visible,e.visible)&&(this.visible=e.visible,t=!0),t}}n.externalDeltaToJS=e=>\"function\"==typeof e.toJS?e.toJS():e instanceof Map?Object.fromEntries(Array.from(e.entries())):e,e.exports=n},function(e,t,i){const n=i(293),o=i(147),a=i(300),r=i(114),s=i(299),l=i(192),u=i(123),c=i(38),d=i(107),p=i(64),m=i(87),g=i(386),h=i(970),{loadCostume:f}=i(226),{loadSound:b}=i(225),{deserializeCostume:y,deserializeSound:v}=i(411),k=Object.prototype.hasOwnProperty,w=[\"argument\",\"colour\",\"control\",\"data\",\"event\",\"looks\",\"math\",\"motion\",\"operator\",\"procedures\",\"sensing\",\"sound\"],T=12,S=13,M={math_number:[4,\"NUM\"],math_positive_number:[5,\"NUM\"],math_whole_number:[6,\"NUM\"],math_integer:[7,\"NUM\"],math_angle:[8,\"NUM\"],colour_picker:[9,\"COLOUR\"],text:[10,\"TEXT\"],event_broadcast_menu:[11,\"BROADCAST_OPTION\"],data_variable:[T,\"VARIABLE\"],data_listcontents:[S,\"LIST\"]},E=8e3,I=function(e){const t=function(e){if(k.call(M,e.opcode)){const t=M[e.opcode],i=t[0],n=t[1],o=e.fields[n],a=[i,o.value];return\"event_broadcast_menu\"===e.opcode?a.push(o.id):\"data_variable\"!==e.opcode&&\"data_listcontents\"!==e.opcode||(a.push(o.id),e.topLevel&&(a.push(e.x?Math.round(e.x):0),a.push(e.y?Math.round(e.y):0))),a}return null}(e);if(t)return t;const i=Object.create(null);return i.opcode=e.opcode,i.next=e.next,i.parent=e.parent,i.inputs=function(e){const t=Object.create(null);for(const i in e)k.call(e,i)&&(e[i].block===e[i].shadow?t[i]=[1,e[i].block]:null===e[i].shadow?t[i]=[2,e[i].block]:t[i]=[3,e[i].block,e[i].shadow]);return t}(e.inputs),i.fields=function(e){const t=Object.create(null);for(const i in e)k.call(e,i)&&(t[i]=[e[i].value],Object.prototype.hasOwnProperty.call(e[i],\"id\")&&t[i].push(e[i].id));return t}(e.fields),i.shadow=e.shadow,e.topLevel?(i.topLevel=!0,i.x=e.x?Math.round(e.x):0,i.y=e.y?Math.round(e.y):0):i.topLevel=!1,e.mutation&&(i.mutation=e.mutation),e.comment&&(i.comment=e.comment),i},x=function(e,t){const i=e.inputs;for(const e in i){const n=i[e];for(let e=1;e{if(!t.extensionManager)return null;const i=t.extensionManager.getExtensionURLs(),n={};for(const t of e){const e=i[t];\"string\"==typeof e&&(n[t]=e)}return 0===Object.keys(n).length?null:n},C=function(e){const t=Object.create(null),i=new Set;for(const n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;t[n]=I(e[n]);const o=_(e[n].opcode);o&&i.add(o)}for(const e in t){const i=t[e];t[e]=x(i,t)}for(const e in t){const i=t[e];Array.isArray(i)&&[T,S].indexOf(i[0])<0&&(c.warn(\"Found an unexpected top level primitive with block ID: \".concat(e,\"; deleting it from serialized blocks.\")),delete t[e])}return[t,Array.from(i)]},N=function(e){const t=Object.create(null);t.name=e.name;const i=e.broken||e;return t.bitmapResolution=i.bitmapResolution,t.dataFormat=i.dataFormat.toLowerCase(),t.assetId=i.assetId,t.md5ext=i.md5,t.rotationCenterX=i.rotationCenterX,t.rotationCenterY=i.rotationCenterY,t},A=function(e){const t=Object.create(null);t.name=e.name;const i=e.broken||e;return t.assetId=i.assetId,t.dataFormat=i.dataFormat.toLowerCase(),t.format=i.format,t.rate=i.rate,t.sampleCount=i.sampleCount,t.md5ext=i.md5,t},P=function(e,t){const i=Object.create(null);let n=[];i.isStage=e.isStage,i.name=i.isStage?\"Stage\":e.name;const o=function(e){const t=Object.create(null);t.variables=Object.create(null),t.lists=Object.create(null),t.broadcasts=Object.create(null);for(const i in e){const n=e[i];n.type!==r.BROADCAST_MESSAGE_TYPE?n.type!==r.LIST_TYPE?(t.variables[i]=[n.name,n.value],n.isCloud&&t.variables[i].push(!0)):t.lists[i]=[n.name,n.value]:t.broadcasts[i]=n.value}return t}(e.variables);return i.variables=o.variables,i.lists=o.lists,i.broadcasts=o.broadcasts,[i.blocks,n]=C(e.blocks),i.comments=function(e){const t=Object.create(null);for(const i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;const n=e[i],o=Object.create(null);o.blockId=n.blockId,o.x=n.x,o.y=n.y,o.width=n.width,o.height=n.height,o.minimized=n.minimized,n.text.length>E?(o.text=n.text.substring(0,E),o.extraText=n.text.substring(E)):o.text=n.text,t[i]=o}return t}(e.comments),(e.currentCostume<0||e.currentCostume>=e.costumes.length)&&(c.warn(\"currentCostume property for target \".concat(e.name,\" is out of range\")),e.currentCostume=p.clamp(e.currentCostume,0,e.costumes.length-1)),i.currentCostume=e.currentCostume,i.costumes=e.costumes.map(N),i.sounds=e.sounds.map(A),Object.prototype.hasOwnProperty.call(e,\"volume\")&&(i.volume=e.volume),Object.prototype.hasOwnProperty.call(e,\"layerOrder\")&&(i.layerOrder=e.layerOrder),i.isStage?(Object.prototype.hasOwnProperty.call(e,\"tempo\")&&(i.tempo=e.tempo),Object.prototype.hasOwnProperty.call(e,\"videoTransparency\")&&(i.videoTransparency=e.videoTransparency),Object.prototype.hasOwnProperty.call(e,\"videoState\")&&(i.videoState=e.videoState),Object.prototype.hasOwnProperty.call(e,\"textToSpeechLanguage\")&&(i.textToSpeechLanguage=e.textToSpeechLanguage)):(i.visible=e.visible,i.x=e.x,i.y=e.y,i.size=e.size,i.direction=e.direction,i.draggable=e.draggable,i.rotationStyle=e.rotationStyle),n.forEach((e=>{t.add(e)})),i},D=(e,t)=>{const i={};let n=!0;for(const[o,a]of Object.entries(e))t.has(o)&&null!=a&&(n=!1,i[o]=e[o]);return n?null:i},L=function(e,t,i,n){if(!Array.isArray(e))return e;const o=Object.create(null),a=d();switch(o.id=a,o.next=null,o.parent=t,o.shadow=i,o.inputs=Object.create(null),e[0]){case 4:o.opcode=\"math_number\",o.fields={NUM:{name:\"NUM\",value:e[1]}},o.topLevel=!1;break;case 5:o.opcode=\"math_positive_number\",o.fields={NUM:{name:\"NUM\",value:e[1]}},o.topLevel=!1;break;case 6:o.opcode=\"math_whole_number\",o.fields={NUM:{name:\"NUM\",value:e[1]}},o.topLevel=!1;break;case 7:o.opcode=\"math_integer\",o.fields={NUM:{name:\"NUM\",value:e[1]}},o.topLevel=!1;break;case 8:o.opcode=\"math_angle\",o.fields={NUM:{name:\"NUM\",value:e[1]}},o.topLevel=!1;break;case 9:o.opcode=\"colour_picker\",o.fields={COLOUR:{name:\"COLOUR\",value:e[1]}},o.topLevel=!1;break;case 10:o.opcode=\"text\",o.fields={TEXT:{name:\"TEXT\",value:e[1]}},o.topLevel=!1;break;case 11:o.opcode=\"event_broadcast_menu\",o.fields={BROADCAST_OPTION:{name:\"BROADCAST_OPTION\",value:e[1],id:e[2],variableType:r.BROADCAST_MESSAGE_TYPE}},o.topLevel=!1;break;case T:o.opcode=\"data_variable\",o.fields={VARIABLE:{name:\"VARIABLE\",value:e[1],id:e[2],variableType:r.SCALAR_TYPE}},e.length>3&&(o.topLevel=!0,o.x=e[3],o.y=e[4]);break;case S:o.opcode=\"data_listcontents\",o.fields={LIST:{name:\"LIST\",value:e[1],id:e[2],variableType:r.LIST_TYPE}},e.length>3&&(o.topLevel=!0,o.x=e[3],o.y=e[4]);break;default:return c.error(\"Found unknown primitive type during deserialization: \".concat(JSON.stringify(e))),null}return n[a]=o,a},R=function(e,t,i){const n={};for(const o in e){if(!k.call(e,o))continue;const a=e[o];if(!Array.isArray(a))continue;let r=null,s=null;const l=a[0];1===l?r=s=L(a[1],t,!0,i):2===l?r=L(a[1],t,!1,i):(r=L(a[1],t,!1,i),s=L(a[2],t,!0,i)),n[o]={name:o,block:r,shadow:s}}return n},j=function(e){const t={};for(const i in e){if(!k.call(e,i))continue;const n=e[i];Array.isArray(n)&&(t[i]={name:i,value:n[0]},n.length>1&&(t[i].id=n[1]),\"BROADCAST_OPTION\"===i?t[i].variableType=r.BROADCAST_MESSAGE_TYPE:\"VARIABLE\"===i?t[i].variableType=r.SCALAR_TYPE:\"LIST\"===i&&(t[i].variableType=r.LIST_TYPE))}return t},z=function(e){for(const t in e){if(!Object.prototype.hasOwnProperty.call(e,t))continue;const i=e[t];Array.isArray(i)?(delete e[t],L(i,null,!1,e)):(i.id=t,i.inputs=R(i.inputs,t,e),i.fields=j(i.fields))}return e},B=function(e,t,i,n,l){if(!Object.prototype.hasOwnProperty.call(e,\"name\"))return Promise.resolve(null);const c=new o(t),d=new a(c,t);if(Object.prototype.hasOwnProperty.call(e,\"name\")&&(d.name=e.name),Object.prototype.hasOwnProperty.call(e,\"blocks\")){z(e.blocks);for(const t in e.blocks){if(!Object.prototype.hasOwnProperty.call(e.blocks,t))continue;const n=e.blocks[t];c.createBlock(n);const o=_(n.opcode);o&&i.extensionIDs.add(o)}!function(e){for(const t in e){if(!Object.prototype.hasOwnProperty.call(e,t))continue;const i=e[t];if(\"procedures_prototype\"===i.opcode)i.shadow=!0;else if(\"argument_reporter_string_number\"===i.opcode||\"argument_reporter_boolean\"===i.opcode){const t=e[i.parent];t&&\"procedures_prototype\"===t.opcode&&(i.shadow=!0)}}}(e.blocks)}const{costumePromises:m}=l,{soundBank:g,soundPromises:h}=l,f=d.createClone(e.isStage?u.BACKGROUND_LAYER:u.SPRITE_LAYER);if(Object.prototype.hasOwnProperty.call(e,\"tempo\")&&(f.tempo=e.tempo),Object.prototype.hasOwnProperty.call(e,\"volume\")&&(f.volume=e.volume),Object.prototype.hasOwnProperty.call(e,\"videoTransparency\")&&(f.videoTransparency=e.videoTransparency),Object.prototype.hasOwnProperty.call(e,\"videoState\")&&(f.videoState=e.videoState),Object.prototype.hasOwnProperty.call(e,\"textToSpeechLanguage\")&&(f.textToSpeechLanguage=e.textToSpeechLanguage),Object.prototype.hasOwnProperty.call(e,\"variables\"))for(const i in e.variables){const n=e.variables[i],o=3===n.length&&n[2]&&e.isStage&&t.canAddCloudVariable(),a=new r(i,n[0],r.SCALAR_TYPE,o);o&&t.addCloudVariable(),a.value=n[1],f.variables[a.id]=a}if(Object.prototype.hasOwnProperty.call(e,\"lists\"))for(const t in e.lists){const i=e.lists[t],n=new r(t,i[0],r.LIST_TYPE,!1);n.value=i[1],f.variables[n.id]=n}if(Object.prototype.hasOwnProperty.call(e,\"broadcasts\"))for(const t in e.broadcasts){const i=e.broadcasts[t],n=new r(t,i,r.BROADCAST_MESSAGE_TYPE,!1);f.variables[n.id]=n}if(Object.prototype.hasOwnProperty.call(e,\"comments\"))for(const t in e.comments){const i=e.comments[t],n=new s(t,i.text+(\"string\"==typeof i.extraText?i.extraText:\"\"),i.x,i.y,i.width,i.height,i.minimized);i.blockId&&(n.blockId=i.blockId),f.comments[n.id]=n}return Object.prototype.hasOwnProperty.call(e,\"x\")&&(f.x=e.x),Object.prototype.hasOwnProperty.call(e,\"y\")&&(f.y=e.y),Object.prototype.hasOwnProperty.call(e,\"direction\")&&(f.direction=p.wrapClamp(e.direction,-179,180)),Object.prototype.hasOwnProperty.call(e,\"size\")&&(f.size=e.size),Object.prototype.hasOwnProperty.call(e,\"visible\")&&(f.visible=e.visible),Object.prototype.hasOwnProperty.call(e,\"currentCostume\")&&(f.currentCostume=p.clamp(e.currentCostume,0,e.costumes.length-1)),Object.prototype.hasOwnProperty.call(e,\"rotationStyle\")&&(f.rotationStyle=e.rotationStyle),Object.prototype.hasOwnProperty.call(e,\"isStage\")&&(f.isStage=e.isStage),Object.prototype.hasOwnProperty.call(e,\"targetPaneOrder\")&&(f.targetPaneOrder=e.targetPaneOrder),Object.prototype.hasOwnProperty.call(e,\"draggable\")&&(f.draggable=e.draggable),Object.prototype.hasOwnProperty.call(e,\"extensionStorage\")&&(f.extensionStorage=e.extensionStorage),Promise.all(m).then((e=>{d.costumes=e})),Promise.all(h).then((e=>{d.sounds=e,d.soundBank=g||null})),Promise.all(m.concat(h)).then((()=>f))};e.exports={serialize:function(e,t){let{allowOptimization:i=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=Object.create(null),o=new Set,a=t?[e.getTargetById(t)]:e.targets.filter((e=>e.isOriginal)),r=function(e){const t=e.map((e=>e.getLayerOrder()));return p.reducedSortOrdering(t)}(a),s=a.map((e=>e.toJSON()));e.renderer&&!t&&s.forEach(((e,t)=>{e.layerOrder=r[t]}));const l=s.map((e=>P(e,o))).map(((e,t)=>{const i=a[t],n=D(i.extensionStorage,o);return n&&(e.extensionStorage=n),e})),u=e.fontManager.serializeJSON();if(t){const t=l[0];o.size&&(t.extensions=Array.from(o));const i=O(o,e);return i&&(t.extensionURLs=i),u&&(t.customFonts=u),l[0]}const c=D(e.extensionStorage,o);c&&(n.extensionStorage=c),n.targets=l,n.monitors=function(e,t,i){const n=(t.stageWidth-480)/2,o=(t.stageHeight-360)/2;return e.valueSeq().filter((e=>{const t=_(e.opcode);return!t||!!e.visible&&(i.add(t),!0)})).map((e=>{const t={id:e.id,mode:e.mode,opcode:e.opcode,params:e.params,spriteName:e.spriteName,value:Array.isArray(e.value)?[]:0,width:e.width,height:e.height,x:e.x-n,y:e.y-o,visible:e.visible};return\"list\"!==e.mode&&(t.sliderMin=e.sliderMin,t.sliderMax=e.sliderMax,t.isDiscrete=e.isDiscrete),t}))}(e.getMonitorState(),e,o),n.extensions=Array.from(o);const d=O(o,e);d&&(n.extensionURLs=d),u&&(n.customFonts=u);const m=Object.create(null);return m.semver=\"3.0.0\",m.vm=\"0.2.0\",e.origin&&(m.origin=e.origin),m.agent=\"\",m.platform=Object.assign({},e.platform),n.meta=m,i&&h(n),n},deserialize:async function(e,t,i,o){await((e,t)=>{if(!e.meta||!e.meta.platform)return;if(e.meta.platform.name===t.platform.name)return;let i=t.listenerCount(n.PLATFORM_MISMATCH);return 0!==i?new Promise((o=>{t.emit(n.PLATFORM_MISMATCH,e.meta.platform,(()=>{i--,0===i&&o()}))})):void 0})(e,t);const a={extensionIDs:new Set,extensionURLs:new Map};if(e.meta&&e.meta.origin?t.origin=e.meta.origin:t.origin=null,e.extensionURLs)for(const[t,i]of Object.entries(e.extensionURLs))a.extensionURLs.set(t,i);let s;s=e.customFonts?t.fontManager.deserialize(e.customFonts,i,o):Promise.resolve();const u=((o?[e]:e.targets)||[]).map(((e,t)=>Object.assign(e,{targetPaneOrder:t}))).sort(((e,t)=>e.layerOrder-t.layerOrder)),d=e.monitors||[];return s.then((()=>u.map((e=>function(e,t,i){if(!Object.prototype.hasOwnProperty.call(e,\"name\"))return Promise.resolve(null);const n={costumePromises:null,soundPromises:null,soundBank:t.audioEngine&&t.audioEngine.createBank()};return n.costumePromises=(e.costumes||[]).map((e=>{const n={asset:e.asset,assetId:e.assetId,skinId:null,name:e.name,bitmapResolution:e.bitmapResolution,rotationCenterX:e.rotationCenterX,rotationCenterY:e.rotationCenterY},o=e.dataFormat||e.assetType&&e.assetType.runtimeFormat||\"png\",a=Object.prototype.hasOwnProperty.call(e,\"md5ext\")?e.md5ext:\"\".concat(e.assetId,\".\").concat(o);return n.md5=a,n.dataFormat=o,t.wrapAssetRequest((()=>y(n,t,i).then((()=>f(a,n,t)))))})),n.soundPromises=(e.sounds||[]).map((e=>{const o={assetId:e.assetId,format:e.format,rate:e.rate,sampleCount:e.sampleCount,name:e.name,md5:e.md5ext,dataFormat:e.dataFormat,data:null};return t.wrapAssetRequest((()=>v(o,t,i).then((()=>b(o,t,n.soundBank)))))})),n}(e,t,i))))).then((e=>Promise.resolve(e))).then((e=>Promise.all(u.map(((i,n)=>B(i,t,a,0,e[n])))))).then((e=>e.map(((e,t)=>(e.layerOrder=t,e))).sort(((e,t)=>e.targetPaneOrder-t.targetPaneOrder)).map((e=>(delete e.targetPaneOrder,e))))).then((e=>function(e){const t=g.getAllVarRefsForTargets(e,!0);e.forEach((e=>{Object.keys(e.variables).forEach((t=>{const i=m.replaceUnsafeChars(t);i!==t&&(e.variables[t].id=i,e.variables[i]=e.variables[t],delete e.variables[t])}))}));for(const e in t){const i=m.replaceUnsafeChars(e);e!==i&&g.updateVariableIdentifiers(t[e],i)}return e}(e))).then((i=>(d.map((e=>function(e,t,i,n){const o=(t.stageWidth-480)/2,a=(t.stageHeight-360)/2;if(e.x+=o,e.y+=a,e.x=p.clamp(e.x,0,t.stageWidth),e.y=p.clamp(e.y,0,t.stageHeight),e.spriteName){const t=i.filter((t=>t.sprite.name===e.spriteName));t&&t.length>0?e.targetId=t[0].id:c.warn(\"Tried to deserialize sprite specific monitor \".concat(e.opcode,\" but could not find sprite \").concat(e.spriteName,\".\"))}const s=t.monitorBlockInfo[e.opcode];if(\"data_listcontents\"===e.opcode){const t=e.targetId?i.find((t=>t.id===e.targetId)):i.find((e=>e.isStage));t&&Object.prototype.hasOwnProperty.call(t.variables,e.id)&&(e.params.LIST=t.variables[e.id].name)}const u={};for(const t in e.params){const i={name:t,value:e.params[t]};u[t]=i}\"data_variable\"!==e.opcode&&\"data_listcontents\"!==e.opcode&&s&&s.isSpriteSpecific?e.id=s.getId(e.targetId,u):e.id=m.replaceUnsafeChars(e.id);const d=t.monitorBlocks._blocks[e.id];if(d)d.isMonitored=e.visible,d.targetId=e.targetId;else{const i={id:e.id,opcode:e.opcode,inputs:{},fields:u,topLevel:!0,next:null,parent:null,shadow:!1,x:0,y:0,isMonitored:e.visible,targetId:e.targetId};if(\"data_variable\"===e.opcode){const t=i.fields.VARIABLE;t.id=e.id,t.variableType=r.SCALAR_TYPE}else if(\"data_listcontents\"===e.opcode){const t=i.fields.LIST;t.id=e.id,t.variableType=r.LIST_TYPE}t.monitorBlocks.createBlock(i);const o=_(i.opcode);o&&n.extensionIDs.add(o)}t.requestAddMonitor(new l(e))}(e,t,i,a))),Object.prototype.hasOwnProperty.call(e,\"extensionStorage\")&&(t.extensionStorage=e.extensionStorage),i))).then((e=>({targets:e,extensions:a})))},deserializeBlocks:z,serializeBlocks:C,deserializeStandaloneBlocks:e=>{if((e=JSON.parse(JSON.stringify(e))).extensionURLs){const t=new Map;for(const[i,n]of Object.entries(e.extensionURLs))t.set(i,n);return{blocks:e.blocks,extensionURLs:t}}return{blocks:e,extensionURLs:new Map}},serializeStandaloneBlocks:(e,t)=>{const i=new Set;for(const t of e){const e=_(t.opcode);e&&i.add(e)}const n=O(i,t);return n?{blocks:e,extensionURLs:n}:e},getExtensionIdForOpcode:_}},function(e,t,i){const n=i(116),o=i(231),a=i(1113);e.exports=class{constructor(e,t){this._renderer=t,this._id=e,this._rotationCenter=n.v3.create(0,0),this._texture=null,this._uniforms={u_skinSize:[0,0],u_skin:null},this._silhouette=new a,this.private=!1}dispose(){this._id=o.ID_NONE}get id(){return this._id}get rotationCenter(){return this._rotationCenter}get size(){return[0,0]}useNearest(e,t){return!0}calculateRotationCenter(){return[this.size[0]/2,this.size[1]/2]}getTexture(e){return this._emptyImageTexture}isMetricsReady(){return!!this.getTexture([100,100])}getFenceBounds(e,t){return e.getAABB(t)}getUniforms(e){return this._uniforms.u_skin=this.getTexture(e),this._uniforms.u_skinSize=this.size,this._uniforms}emitWasAltered(){this._renderer.skinWasAltered(this)}updateSilhouette(){this._silhouette.unlazy()}_setTexture(e){const t=this._renderer.gl;t.bindTexture(t.TEXTURE_2D,this._texture),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),this._silhouette.update(e)}setEmptyImageData(){if(this._texture=null,!this._emptyImageData){this._emptyImageData=new ImageData(1,1);const e=this._renderer.gl,t={auto:!0,wrap:e.CLAMP_TO_EDGE,src:this._emptyImageData};this._emptyImageTexture=n.createTexture(e,t)}this._rotationCenter[0]=0,this._rotationCenter[1]=0,this._silhouette.update(this._emptyImageData),this.emitWasAltered()}isTouchingNearest(e){return this._silhouette.isTouchingNearest(e)}isTouchingLinear(e){return this._silhouette.isTouchingLinear(e)}}},function(e,t,i){const n=i(116);class o{constructor(e){this._gl=e,this._shaderCache={};for(const e in o.DRAW_MODE)Object.prototype.hasOwnProperty.call(o.DRAW_MODE,e)&&(this._shaderCache[e]=[])}getShader(e,t){const i=this._shaderCache[e];e===o.DRAW_MODE.silhouette&&(t&=~(o.EFFECT_INFO.color.mask|o.EFFECT_INFO.brightness.mask));let n=i[t];return n||(n=i[t]=this._buildShader(e,t)),n}_buildShader(e,t){const a=o.EFFECTS.length,r=[\"#define DRAW_MODE_\".concat(e)];for(let e=0;e{console.error(e);const t=e.match(/\\*\\*\\* Error compiling shader: ([\\s\\S]+)/);c=t?t[1].trim():e}));if(!d)throw new Error(\"Failed to compile shader (mode \".concat(e,\", effects \").concat(t,\"): \").concat(c));return d}}o.EFFECT_INFO={color:{uniformName:\"u_color\",mask:1,converter:e=>e/200%1,shapeChanges:!1},fisheye:{uniformName:\"u_fisheye\",mask:2,converter:e=>Math.max(0,(e+100)/100),shapeChanges:!0},whirl:{uniformName:\"u_whirl\",mask:4,converter:e=>-e*Math.PI/180,shapeChanges:!0},pixelate:{uniformName:\"u_pixelate\",mask:8,converter:e=>Math.abs(e)/10,shapeChanges:!0},mosaic:{uniformName:\"u_mosaic\",mask:16,converter:e=>(e=Math.round((Math.abs(e)+10)/10),Math.max(1,Math.min(e,512))),shapeChanges:!0},brightness:{uniformName:\"u_brightness\",mask:32,converter:e=>Math.max(-100,Math.min(e,100))/100,shapeChanges:!1},ghost:{uniformName:\"u_ghost\",mask:64,converter:e=>1-Math.max(0,Math.min(e,100))/100,shapeChanges:!1}},o.EFFECTS=Object.keys(o.EFFECT_INFO),o.DRAW_MODE={default:\"default\",straightAlpha:\"straightAlpha\",silhouette:\"silhouette\",colorMask:\"colorMask\",line:\"line\",background:\"background\"},e.exports=o},function(e,t){e.exports=!0},function(e,t,i){var n=i(234);e.exports=function(e,t,i){if(n(e),void 0===t)return e;switch(i){case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,o){return e.call(t,i,n,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,i){var n=i(435),o=i(321);e.exports=Object.keys||function(e){return n(e,o)}},function(e,t){var i={}.toString;e.exports=function(e){return i.call(e).slice(8,-1)}},function(e,t,i){\"use strict\";i.d(t,\"a\",(function(){return a})),i.d(t,\"b\",(function(){return o})),i.d(t,\"c\",(function(){return r}));const n=\"fontsLoaded/SET_FONTS_LOADED\",o=!1,a=function(e,t){return void 0===e&&(e=o),t.type===n?t.loaded:e},r=()=>({type:n,loaded:!0})},function(e,t,i){\"use strict\";i.d(t,\"a\",(function(){return a})),i.d(t,\"c\",(function(){return o})),i.d(t,\"b\",(function(){return r}));const n=\"timeout/SET_AUTOSAVE_TIMEOUT_ID\",o={autoSaveTimeoutId:null},a=function(e,t){return void 0===e&&(e=o),t.type===n?Object.assign({},e,{autoSaveTimeoutId:t.id}):e},r=e=>({type:n,id:e})},function(e,t,i){\"use strict\";i.d(t,\"b\",(function(){return a})),i.d(t,\"a\",(function(){return o})),i.d(t,\"c\",(function(){return r}));const n=\"scratch-gui/block-drag/BLOCK_DRAG_UPDATE\",o=!1,a=function(e,t){return void 0===e&&(e=o),t.type===n?t.areBlocksOverGui:e},r=function(e){return{type:n,areBlocksOverGui:e,meta:{throttle:30}}}},function(e,t,i){\"use strict\";i.d(t,\"a\",(function(){return a})),i.d(t,\"b\",(function(){return o})),i.d(t,\"c\",(function(){return r}));const n=\"scratch-gui/monitors/UPDATE_MONITORS\",o=null,a=function(e,t){return void 0===e&&(e=o),t.type===n?t.monitors:e},r=function(e){return{type:n,monitors:e}}},function(e,t,i){\"use strict\";i.d(t,\"a\",(function(){return a})),i.d(t,\"b\",(function(){return o})),i.d(t,\"c\",(function(){return r}));const n=\"scratch-gui/mic-indicator/UPDATE\",o=!1,a=function(e,t){return void 0===e&&(e=o),t.type===n?t.visible:e},r=function(e){return{type:n,visible:e}}},function(e,t,i){\"use strict\";i.d(t,\"a\",(function(){return r})),i.d(t,\"b\",(function(){return a})),i.d(t,\"c\",(function(){return s}));var n=i(247);const o=\"scratch-gui/toolbox/UPDATE_TOOLBOX\",a={toolboxXML:Object(n.a)(!0)},r=function(e,t){return void 0===e&&(e=a),t.type===o?Object.assign({},e,{toolboxXML:t.toolboxXML}):e},s=function(e){return{type:o,toolboxXML:e}}},function(e,t,i){\"use strict\";function n(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function o(e,t,i){return(t=function(e){var t=function(e,t){if(\"object\"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||\"default\");if(\"object\"!=typeof n)return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(\"string\"===t?String:Number)(e)}(e,\"string\");return\"symbol\"==typeof t?t:t+\"\"}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}i.d(t,\"a\",(function(){return s})),i.d(t,\"c\",(function(){return r})),i.d(t,\"b\",(function(){return l}));const a=\"scratch-gui/workspace-metrics/UPDATE_METRICS\",r={targets:{}},s=function(e,t){return void 0===e&&(e=r),t.type===a?Object.assign({},e,{targets:Object.assign({},e.targets,{[t.targetID]:{scrollX:t.scrollX,scrollY:t.scrollY,scale:t.scale}})}):e},l=function(e){return function(e){for(var t=1;t4&&void 0!==arguments[4]?arguments[4]:null;super(),this._socket=e.getScratchLinkSocket(\"BLE\"),this._socket.setOnOpen(this.requestPeripheral.bind(this)),this._socket.setOnClose(this.handleDisconnectError.bind(this)),this._socket.setOnError(this._handleRequestError.bind(this)),this._socket.setHandleMessage(this._handleMessage.bind(this)),this._sendMessage=this._socket.sendMessage.bind(this._socket),this._availablePeripherals={},this._connectCallback=n,this._connected=!1,this._characteristicDidChangeCallback=null,this._resetCallback=o,this._discoverTimeoutID=null,this._extensionId=t,this._peripheralOptions=i,this._runtime=e,this._socket.open()}requestPeripheral(){this._availablePeripherals={},this._discoverTimeoutID&&window.clearTimeout(this._discoverTimeoutID),this._discoverTimeoutID=window.setTimeout(this._handleDiscoverTimeout.bind(this),15e3),this.sendRemoteRequest(\"discover\",this._peripheralOptions).catch((e=>{this._handleRequestError(e)}))}connectPeripheral(e){this.sendRemoteRequest(\"connect\",{peripheralId:e}).then((()=>{this._connected=!0,this._runtime.emit(this._runtime.constructor.PERIPHERAL_CONNECTED),this._connectCallback()})).catch((e=>{this._handleRequestError(e)}))}disconnect(){this._connected&&(this._connected=!1),this._socket.isOpen()&&this._socket.close(),this._discoverTimeoutID&&window.clearTimeout(this._discoverTimeoutID),this._runtime.emit(this._runtime.constructor.PERIPHERAL_DISCONNECTED)}isConnected(){return this._connected}startNotifications(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n={serviceId:e,characteristicId:t};return this._characteristicDidChangeCallback=i,this.sendRemoteRequest(\"startNotifications\",n).catch((e=>{this.handleDisconnectError(e)}))}read(e,t){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const n={serviceId:e,characteristicId:t};return arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&(n.startNotifications=!0),i&&(this._characteristicDidChangeCallback=i),this.sendRemoteRequest(\"read\",n).catch((e=>{this.handleDisconnectError(e)}))}write(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;const a={serviceId:e,characteristicId:t,message:i};return n&&(a.encoding=n),null!==o&&(a.withResponse=o),this.sendRemoteRequest(\"write\",a).catch((e=>{this.handleDisconnectError(e)}))}didReceiveCall(e,t){switch(e){case\"didDiscoverPeripheral\":this._availablePeripherals[t.peripheralId]=t,this._runtime.emit(this._runtime.constructor.PERIPHERAL_LIST_UPDATE,this._availablePeripherals),this._discoverTimeoutID&&window.clearTimeout(this._discoverTimeoutID);break;case\"userDidPickPeripheral\":this._availablePeripherals[t.peripheralId]=t,this._runtime.emit(this._runtime.constructor.USER_PICKED_PERIPHERAL,this._availablePeripherals),this._discoverTimeoutID&&window.clearTimeout(this._discoverTimeoutID);break;case\"userDidNotPickPeripheral\":this._runtime.emit(this._runtime.constructor.PERIPHERAL_SCAN_TIMEOUT),this._discoverTimeoutID&&window.clearTimeout(this._discoverTimeoutID);break;case\"characteristicDidChange\":this._characteristicDidChangeCallback&&this._characteristicDidChangeCallback(t.message);break;case\"ping\":return 42}}handleDisconnectError(){this._connected&&(this.disconnect(),this._resetCallback&&this._resetCallback(),this._runtime.emit(this._runtime.constructor.PERIPHERAL_CONNECTION_LOST_ERROR,{message:\"Scratch lost connection to\",extensionId:this._extensionId}))}_handleRequestError(){this._runtime.emit(this._runtime.constructor.PERIPHERAL_REQUEST_ERROR,{message:\"Scratch lost connection to\",extensionId:this._extensionId})}_handleDiscoverTimeout(){this._discoverTimeoutID&&window.clearTimeout(this._discoverTimeoutID),this._runtime.emit(this._runtime.constructor.PERIPHERAL_SCAN_TIMEOUT)}}},function(e,t){\"function\"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}},function(e,t,i){const n=i(38);e.exports=function(e){if(\"string\"!=typeof e){if(!Array.isArray(e))return n.error(\"Unexpected input recieved in replaceUnsafeChars\"),e;e=String(e)}return e.replace(/[<>&'\"]/g,(e=>{switch(e){case\"<\":return\"<\";case\">\":return\">\";case\"&\":return\"&\";case\"'\":return\"'\";case'\"':return\""\"}}))}},function(e,t,i){const n=i(381),o=i(378),a=i(38),r=i(165),s=i(46),l=new n;let u=-1;const c=function(e,t,i,n,o){const a=n.id,l=n.opcode,u=n._isHat,c=n._isConditional,d=n._isLoop;if(i.pushReportedValue(e),u)if(i.stackClick)i.status=r.STATUS_RUNNING;else if(t.runtime.getIsEdgeActivatedHat(l)){const n=i.target.hasEdgeActivatedValue(a),o=i.target.updateEdgeActivatedValue(a,e);(n?!o&&e:e)?i.status=r.STATUS_RUNNING:t.retireThread(i)}else e?i.status=r.STATUS_RUNNING:t.retireThread(i);else if((c||d)&&void 0!==e)t.stepToBranch(i,s.toNumber(e),d);else{if(o&&void 0!==e&&i.atStackTop()&&(i.stackClick&&t.runtime.visualReport(i.target,a,e),i.updateMonitor)){const i=t.runtime.monitorBlocks.getBlock(a).targetId;if(i&&!t.runtime.getTargetById(i))return;t.runtime.requestUpdateMonitor({id:a,spriteName:i?t.runtime.getTargetById(i).getName():null,value:e})}i.status=r.STATUS_RUNNING}},d=(e,t,i,n,o)=>{if(c(e,t,i,n,o),o&&(!n._isHat||i.stackClick)){let e,t;do{const n=i.popStack();if(null===n)return;if(t=i.target.blocks.getNextBlock(n),null!==t)break;e=i.peekStackFrame()}while(null!==e&&!e.isLoop);i.pushStack(t)}},p=(e,t,i,n,o)=>{i.status===r.STATUS_RUNNING&&(i.status=r.STATUS_PROMISE_WAIT),e.then((e=>{d(e,t,i,n,o)}),(e=>{a.warn(\"Primitive rejected promise: \",e),d(\"\".concat(e),t,i,n,o)}))};class m{constructor(e,t){this.id=t.id,this.opcode=t.opcode,this.fields=t.fields,this.inputs=t.inputs,this.mutation=t.mutation,this._profiler=null,this._profilerFrame=null,this._isHat=!1,this._blockFunction=null,this._definedBlockFunction=!1,this._isShadowBlock=!1,this._shadowValue=null,this._fields=Object.assign({},this.fields),this._inputs=Object.assign({},this.inputs),this._argValues={mutation:this.mutation},this._parentKey=null,this._parentValues=null,this._ops=[];const{runtime:i}=l.sequencer,{opcode:n,fields:a,inputs:r}=this;this._isHat=i.getIsHat(n),this._blockFunction=i.getOpcodeFunction(n),this._definedBlockFunction=void 0!==this._blockFunction;const s=i._flowing[n];this._isConditional=!(!s||!s.conditional),this._isLoop=!(!s||!s.loop);const u=Object.keys(a);this._isShadowBlock=!this._definedBlockFunction&&1===u.length&&0===Object.keys(r).length,this._shadowValue=this._isShadowBlock&&a[u[0]].value;for(const e in a)this._argValues[e]=\"VARIABLE\"===e||\"LIST\"===e||\"BROADCAST_OPTION\"===e?{id:a[e].id,name:a[e].value}:a[e].value;if(delete this._inputs.custom_block,\"BROADCAST_INPUT\"in this._inputs){this._argValues.BROADCAST_OPTION={id:null,name:null};const t=this._inputs.BROADCAST_INPUT;if(t.block===t.shadow){const i=e.getBlock(t.shadow).fields.BROADCAST_OPTION;this._argValues.BROADCAST_OPTION.id=i.id,this._argValues.BROADCAST_OPTION.name=i.value,delete this._inputs.BROADCAST_INPUT}}for(const t in this._inputs){const i=this._inputs[t];if(i.block){const n=o.getCached(e,i.block,m);if(n._isHat)continue;this._ops.push(...n._ops),n._parentKey=t,n._parentValues=this._argValues,n._isShadowBlock&&(this._argValues[t]=n._shadowValue)}}this._definedBlockFunction&&this._ops.push(this)}}e.exports=function(e,t){const i=e.runtime;l.sequencer=e,l.thread=t;const n=t.peekStack(),a=t.peekStackFrame();let d=t.blockContainer,g=o.getCached(d,n,m);if(null===g&&(d=i.flyoutBlocks,g=o.getCached(d,n,m),null===g))return void e.retireThread(t);const h=g._ops,f=h.length;let b=0;if(null!==a.reported){const e=a.reported;for(;be.id===t));if(n){const e=n._parentKey,t=n._parentValues;\"BROADCAST_INPUT\"===e?(t.BROADCAST_OPTION.id=null,t.BROADCAST_OPTION.name=s.toString(i)):t[e]=i}}if(e.length>0){const t=e.reverse().find((e=>h.find((t=>t.id===e.opCached))));b=t?h.findIndex((e=>e.id===t.opCached))+1:0}if(null!==t.justReported&&h[b]&&h[b].id===a.reporting){const e=h[b],i=t.justReported;t.justReported=null;const n=e._parentKey,o=e._parentValues;\"BROADCAST_INPUT\"===n?(o.BROADCAST_OPTION.id=null,o.BROADCAST_OPTION.name=s.toString(i)):o[n]=i,b+=1}a.reporting=null,a.reported=null,a.waitingReporter=!1}const y=b;for(;b{const t=e._parentKey,i=e._parentValues;return\"BROADCAST_INPUT\"===t?{opCached:e.id,inputValue:i[t].BROADCAST_OPTION.name}:{opCached:e.id,inputValue:i[t]}}));break}if(t.status===r.STATUS_RUNNING)if(i)c(m,e,t,n,i);else{const e=n._parentKey,t=n._parentValues;\"BROADCAST_INPUT\"===e?(t.BROADCAST_OPTION.id=null,t.BROADCAST_OPTION.name=s.toString(m)):t[e]=m}else if(t.status===r.STATUS_DONE)break}var v;if(null!==i.profiler){g._profiler!==i.profiler&&function(e,t){t._profiler=e,-1===u&&(u=e.idByName(\"blockFunction\"));const i=t._ops;for(let t=0;t{e.soundId=t.id;const o=t.buffer;return e.rate=o.sampleRate,e.sampleCount=o.length,null!==n&&n.addSoundPlayer(t),i.isPackaged&&(e.asset=null),e})):(o.warn(\"No audio engine present; cannot load sound asset: \",e.md5),Promise.resolve(e))},r=function(e,t,i){const n=e.asset,o=e.assetId,r=e.sampleCount,s=e.rate,l=e.format,u=e.dataFormat;return e.assetId=t.storage.defaultAssetId.Sound,e.asset=t.storage.get(e.assetId),e.md5=\"\".concat(e.assetId,\".\").concat(e.asset.dataFormat),a(e,e.asset,t,i).then((e=>(e.broken={},e.broken.assetId=o,e.broken.md5=\"\".concat(o,\".\").concat(u),e.broken.asset=n,e.broken.sampleCount=r,e.broken.rate=s,e.broken.format=l,e.broken.dataFormat=u,e)))};e.exports={loadSound:function(e,t,i){if(!t.storage)return o.warn(\"No storage module present; cannot load sound asset: \",e.md5),Promise.resolve(e);const s=n.splitFirst(e.md5,\".\"),l=s[0],u=s[1].toLowerCase();return e.dataFormat=u,(e.asset&&Promise.resolve(e.asset)||t.storage.load(t.storage.AssetType.Sound,l,u)).then((n=>(e.asset=n,n?a(e,n,t,i):(o.warn(\"Failed to find sound data: \",e.md5),r(e,t,i))))).catch((n=>(o.warn(\"Failed to load sound: \".concat(e.md5,\" with error: \").concat(n)),r(e,t,i))))},loadSoundFromAsset:a}},function(e,t,i){const n=i(87),o=i(38),a=i(385),{loadSvgString:r,serializeSvgToString:s}=i(77),{parseVectorMetadata:l}=i(392),u=function(e,t,i,n){return new Promise((o=>{let a=e.asset.decodeText();if(void 0===i){const t=l(a);t&&(i=t,e.rotationCenterX=i[0],e.rotationCenterY=i[1])}if(n&&2===n){const i=s(r(a,!0));if(a!==i){a=i;const n=t.storage;e.asset.encodeTextData(i,n.DataFormat.SVG,!0),e.assetId=e.asset.assetId,e.md5=\"\".concat(e.assetId,\".\").concat(e.dataFormat)}}e.skinId=t.renderer.createSVGSkin(a,i),e.size=t.renderer.getSkinSize(e.skinId),i||(i=t.renderer.getSkinRotationCenter(e.skinId),e.rotationCenterX=i[0],e.rotationCenterY=i[1],e.bitmapResolution=1),t.isPackaged&&(e.asset=null),o(e)}))},c=new class{constructor(){this.pool=[],this.clearSoon=null}clear(){this.clearSoon||(this.clearSoon=new Promise((e=>setTimeout(e,1e3))).then((()=>{this.pool.length=0,this.clearSoon=null})))}create(){return this.pool.pop()||document.createElement(\"canvas\")}release(e){this.clear(),this.pool.push(e)}},d=e=>new Promise(((t,i)=>{const n=new Image;n.onload=function(){t(n),n.onload=null,n.onerror=null},n.onerror=function(){i(new Error(\"Costume load failed. Asset could not be read.\")),n.onload=null,n.onerror=null},n.src=e})),p=new a((async e=>{let t;for(let i=0;i<3;i++)try{if(\"function\"==typeof createImageBitmap){const t=await createImageBitmap(new Blob([e.data.buffer],{type:e.assetType.contentType}));if(!t)throw new Error(\"createImageBitmap resolved with \".concat(t));return t}return await d(e.encodeDataURI())}catch(e){t||(t=e),o.warn(e),await new Promise((e=>setTimeout(e,2e3*Math.random())))}throw t}),25),m=function(e,t,i){return function(e,t,i){return e&&e.asset?t.v2BitmapAdapter?Promise.all([e.asset,e.textLayerAsset].map((e=>e?p.do(e):null))).then((n=>{let[o,a]=n;if(!o)throw new Error(\"Loading bitmap costume base failed.\");const r=1===e.bitmapResolution?2:1;let s,l;if(a){l=c.create(),l.width=o.width,l.height=o.height;const e=l.getContext(\"2d\");e.drawImage(o,0,0),e.drawImage(a,0,0),s=l}else s=o;return 1!==r&&(s=t.v2BitmapAdapter.resize(s,s.width*r,s.height*r),l&&c.release(l)),s.reusable=!1,i&&(i[0]=i[0]*r,i[1]=i[1]*r,e.rotationCenterX=i[0],e.rotationCenterY=i[1]),e.bitmapResolution=2,delete e.textLayerMD5,delete e.textLayerAsset,{image:s,rotationCenter:i,assetMatchesBase:1===r&&!a}})).finally((()=>{delete e.textLayerMD5,delete e.textLayerAsset})):Promise.reject(\"No V2 Bitmap adapter present.\"):Promise.reject(\"Costume load failed. Assets were missing.\")}(e,t,i).then((i=>(i.assetMatchesBase||function(i){if(!t.v2BitmapAdapter)return Promise.reject(\"No V2 Bitmap adapter present.\");const n=t.storage;e.asset=n.createAsset(n.AssetType.ImageBitmap,n.DataFormat.PNG,t.v2BitmapAdapter.convertDataURIToBinary(i),null,!0),e.dataFormat=n.DataFormat.PNG,e.assetId=e.asset.assetId,e.md5=\"\".concat(e.assetId,\".\").concat(e.dataFormat)}((e=>{if(e instanceof HTMLCanvasElement)return e.toDataURL();const t=c.create();t.width=e.width,t.height=e.height,t.getContext(\"2d\").drawImage(e,0,0);const i=t.toDataURL();return c.release(t),i})(i.image)),i))).then((i=>{let n,{image:o,rotationCenter:a}=i;a&&(n=[a[0]/2,a[1]/2]),e.skinId=t.renderer.createBitmapSkin(o,e.bitmapResolution,n);const r=t.renderer.getSkinSize(e.skinId);return e.size=[2*r[0],2*r[1]],a||(a=t.renderer.getSkinRotationCenter(e.skinId),e.rotationCenterX=2*a[0],e.rotationCenterY=2*a[1],e.bitmapResolution=2),t.isPackaged&&(e.asset=null),e}))},g=function(e,t){const i=e.asset,n=e.assetId,o=e.rotationCenterX,a=e.rotationCenterY,r=e.bitmapResolution,s=e.dataFormat,l=t.storage.AssetType,c=e.dataFormat===l.ImageVector.runtimeFormat;e.assetId=c?t.storage.defaultAssetId.ImageVector:t.storage.defaultAssetId.ImageBitmap,e.asset=t.storage.get(e.assetId),e.md5=\"\".concat(e.assetId,\".\").concat(e.asset.dataFormat);return(c?u(e,t):m(e,t)).then((e=>(e.broken={},e.broken.assetId=n,e.broken.md5=\"\".concat(n,\".\").concat(s),e.broken.asset=i,e.broken.dataFormat=s,e.broken.rotationCenterX=o,e.broken.rotationCenterY=a,e.broken.bitmapResolution=r,e)))},h=function(e,t,i){e.assetId=e.asset.assetId;if(!t.renderer)return o.warn(\"No rendering module present; cannot load costume: \",e.name),Promise.resolve(e);const n=t.storage.AssetType;let a;return\"number\"!=typeof e.rotationCenterX||isNaN(e.rotationCenterX)||\"number\"!=typeof e.rotationCenterY||isNaN(e.rotationCenterY)||(a=[e.rotationCenterX,e.rotationCenterY]),e.asset.assetType.runtimeFormat===n.ImageVector.runtimeFormat?u(e,t,a,i).catch((i=>(o.warn(\"Error loading vector image: \".concat(i)),g(e,t)))):m(e,t,a).catch((i=>(o.warn(\"Error loading bitmap image: \".concat(i)),g(e,t))))};e.exports={loadCostume:function(e,t,i,a){const r=n.splitFirst(e,\".\"),s=r[0],l=r[1].toLowerCase();if(t.dataFormat=l,t.asset)return h(t,i,a);if(!i.storage)return o.warn(\"No storage module present; cannot load costume asset: \",e),Promise.resolve(t);if(!i.storage.defaultAssetId)return o.warn(\"No default assets found\"),Promise.resolve(t);const u=i.storage.AssetType,c=\"svg\"===l?u.ImageVector:u.ImageBitmap,d=i.storage.load(c,s,l);let p;return p=t.textLayerMD5?i.storage.load(u.ImageBitmap,t.textLayerMD5,\"png\"):Promise.resolve(null),Promise.all([d,p]).then((e=>e[0]?(t.asset=e[0],e[1]&&(t.textLayerAsset=e[1]),h(t,i,a)):g(t,i))).catch((e=>(o.warn(\"Error loading costume: \",e),g(t,i))))},loadCostumeFromAsset:h}},function(e,t,i){(function(t){var n=\"function\"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,\"size\"):null,a=n&&o&&\"function\"==typeof o.get?o.get:null,r=n&&Map.prototype.forEach,s=\"function\"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,\"size\"):null,u=s&&l&&\"function\"==typeof l.get?l.get:null,c=s&&Set.prototype.forEach,d=\"function\"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p=\"function\"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,m=\"function\"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,g=Boolean.prototype.valueOf,h=Object.prototype.toString,f=Function.prototype.toString,b=String.prototype.match,y=String.prototype.slice,v=String.prototype.replace,k=String.prototype.toUpperCase,w=String.prototype.toLowerCase,T=RegExp.prototype.test,S=Array.prototype.concat,M=Array.prototype.join,E=Array.prototype.slice,I=Math.floor,x=\"function\"==typeof BigInt?BigInt.prototype.valueOf:null,_=Object.getOwnPropertySymbols,O=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?Symbol.prototype.toString:null,C=\"function\"==typeof Symbol&&\"object\"==typeof Symbol.iterator,N=\"function\"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===C||\"symbol\")?Symbol.toStringTag:null,A=Object.prototype.propertyIsEnumerable,P=(\"function\"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function D(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||T.call(/e/,t))return t;var i=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(\"number\"==typeof e){var n=e<0?-I(-e):I(e);if(n!==e){var o=String(n),a=y.call(t,o.length+1);return v.call(o,i,\"$&_\")+\".\"+v.call(v.call(a,/([0-9]{3})/g,\"$&_\"),/_$/,\"\")}}return v.call(t,i,\"$&_\")}var L=i(903),R=L.custom,j=V(R)?R:null,z={__proto__:null,double:'\"',single:\"'\"},B={__proto__:null,double:/([\"\\\\])/g,single:/(['\\\\])/g};function U(e,t,i){var n=i.quoteStyle||t,o=z[n];return o+e+o}function F(e){return v.call(String(e),/\"/g,\""\")}function H(e){return!N||!(\"object\"==typeof e&&(N in e||void 0!==e[N]))}function G(e){return\"[object Array]\"===Z(e)&&H(e)}function W(e){return\"[object RegExp]\"===Z(e)&&H(e)}function V(e){if(C)return e&&\"object\"==typeof e&&e instanceof Symbol;if(\"symbol\"==typeof e)return!0;if(!e||\"object\"!=typeof e||!O)return!1;try{return O.call(e),!0}catch(e){}return!1}e.exports=function e(i,n,o,s){var l=n||{};if(Y(l,\"quoteStyle\")&&!Y(z,l.quoteStyle))throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');if(Y(l,\"maxStringLength\")&&(\"number\"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');var h=!Y(l,\"customInspect\")||l.customInspect;if(\"boolean\"!=typeof h&&\"symbol\"!==h)throw new TypeError(\"option \\\"customInspect\\\", if provided, must be `true`, `false`, or `'symbol'`\");if(Y(l,\"indent\")&&null!==l.indent&&\"\\t\"!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');if(Y(l,\"numericSeparator\")&&\"boolean\"!=typeof l.numericSeparator)throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');var k=l.numericSeparator;if(void 0===i)return\"undefined\";if(null===i)return\"null\";if(\"boolean\"==typeof i)return i?\"true\":\"false\";if(\"string\"==typeof i)return Q(i,l);if(\"number\"==typeof i){if(0===i)return 1/0/i>0?\"0\":\"-0\";var T=String(i);return k?D(i,T):T}if(\"bigint\"==typeof i){var I=String(i)+\"n\";return k?D(i,I):I}var _=void 0===l.depth?5:l.depth;if(void 0===o&&(o=0),o>=_&&_>0&&\"object\"==typeof i)return G(i)?\"[Array]\":\"[Object]\";var R=function(e,t){var i;if(\"\\t\"===e.indent)i=\"\\t\";else{if(!(\"number\"==typeof e.indent&&e.indent>0))return null;i=M.call(Array(e.indent+1),\" \")}return{base:i,prev:M.call(Array(t+1),i)}}(l,o);if(void 0===s)s=[];else if(K(s,i)>=0)return\"[Circular]\";function B(t,i,n){if(i&&(s=E.call(s)).push(i),n){var a={depth:l.depth};return Y(l,\"quoteStyle\")&&(a.quoteStyle=l.quoteStyle),e(t,a,o+1,s)}return e(t,l,o+1,s)}if(\"function\"==typeof i&&!W(i)){var q=function(e){if(e.name)return e.name;var t=b.call(f.call(e),/^function\\s*([\\w$]+)/);if(t)return t[1];return null}(i),X=ie(i,B);return\"[Function\"+(q?\": \"+q:\" (anonymous)\")+\"]\"+(X.length>0?\" { \"+M.call(X,\", \")+\" }\":\"\")}if(V(i)){var ne=C?v.call(String(i),/^(Symbol\\(.*\\))_[^)]*$/,\"$1\"):O.call(i);return\"object\"!=typeof i||C?ne:J(ne)}if(function(e){if(!e||\"object\"!=typeof e)return!1;if(\"undefined\"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return\"string\"==typeof e.nodeName&&\"function\"==typeof e.getAttribute}(i)){for(var oe=\"<\"+w.call(String(i.nodeName)),ae=i.attributes||[],re=0;re\",i.childNodes&&i.childNodes.length&&(oe+=\"...\"),oe+=\"\"}if(G(i)){if(0===i.length)return\"[]\";var se=ie(i,B);return R&&!function(e){for(var t=0;t=0)return!1;return!0}(se)?\"[\"+te(se,R)+\"]\":\"[ \"+M.call(se,\", \")+\" ]\"}if(function(e){return\"[object Error]\"===Z(e)&&H(e)}(i)){var le=ie(i,B);return\"cause\"in Error.prototype||!(\"cause\"in i)||A.call(i,\"cause\")?0===le.length?\"[\"+String(i)+\"]\":\"{ [\"+String(i)+\"] \"+M.call(le,\", \")+\" }\":\"{ [\"+String(i)+\"] \"+M.call(S.call(\"[cause]: \"+B(i.cause),le),\", \")+\" }\"}if(\"object\"==typeof i&&h){if(j&&\"function\"==typeof i[j]&&L)return L(i,{depth:_-o});if(\"symbol\"!==h&&\"function\"==typeof i.inspect)return i.inspect()}if(function(e){if(!a||!e||\"object\"!=typeof e)return!1;try{a.call(e);try{u.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(i)){var ue=[];return r&&r.call(i,(function(e,t){ue.push(B(t,i,!0)+\" => \"+B(e,i))})),ee(\"Map\",a.call(i),ue,R)}if(function(e){if(!u||!e||\"object\"!=typeof e)return!1;try{u.call(e);try{a.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(i)){var ce=[];return c&&c.call(i,(function(e){ce.push(B(e,i))})),ee(\"Set\",u.call(i),ce,R)}if(function(e){if(!d||!e||\"object\"!=typeof e)return!1;try{d.call(e,d);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(i))return $(\"WeakMap\");if(function(e){if(!p||!e||\"object\"!=typeof e)return!1;try{p.call(e,p);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(i))return $(\"WeakSet\");if(function(e){if(!m||!e||\"object\"!=typeof e)return!1;try{return m.call(e),!0}catch(e){}return!1}(i))return $(\"WeakRef\");if(function(e){return\"[object Number]\"===Z(e)&&H(e)}(i))return J(B(Number(i)));if(function(e){if(!e||\"object\"!=typeof e||!x)return!1;try{return x.call(e),!0}catch(e){}return!1}(i))return J(B(x.call(i)));if(function(e){return\"[object Boolean]\"===Z(e)&&H(e)}(i))return J(g.call(i));if(function(e){return\"[object String]\"===Z(e)&&H(e)}(i))return J(B(String(i)));if(\"undefined\"!=typeof window&&i===window)return\"{ [object Window] }\";if(\"undefined\"!=typeof globalThis&&i===globalThis||void 0!==t&&i===t)return\"{ [object globalThis] }\";if(!function(e){return\"[object Date]\"===Z(e)&&H(e)}(i)&&!W(i)){var de=ie(i,B),pe=P?P(i)===Object.prototype:i instanceof Object||i.constructor===Object,me=i instanceof Object?\"\":\"null prototype\",ge=!pe&&N&&Object(i)===i&&N in i?y.call(Z(i),8,-1):me?\"Object\":\"\",he=(pe||\"function\"!=typeof i.constructor?\"\":i.constructor.name?i.constructor.name+\" \":\"\")+(ge||me?\"[\"+M.call(S.call([],ge||[],me||[]),\": \")+\"] \":\"\");return 0===de.length?he+\"{}\":R?he+\"{\"+te(de,R)+\"}\":he+\"{ \"+M.call(de,\", \")+\" }\"}return String(i)};var q=Object.prototype.hasOwnProperty||function(e){return e in this};function Y(e,t){return q.call(e,t)}function Z(e){return h.call(e)}function K(e,t){if(e.indexOf)return e.indexOf(t);for(var i=0,n=e.length;it.maxStringLength){var i=e.length-t.maxStringLength,n=\"... \"+i+\" more character\"+(i>1?\"s\":\"\");return Q(y.call(e,0,t.maxStringLength),t)+n}var o=B[t.quoteStyle||\"single\"];return o.lastIndex=0,U(v.call(v.call(e,o,\"\\\\$1\"),/[\\x00-\\x1f]/g,X),\"single\",t)}function X(e){var t=e.charCodeAt(0),i={8:\"b\",9:\"t\",10:\"n\",12:\"f\",13:\"r\"}[t];return i?\"\\\\\"+i:\"\\\\x\"+(t<16?\"0\":\"\")+k.call(t.toString(16))}function J(e){return\"Object(\"+e+\")\"}function $(e){return e+\" { ? }\"}function ee(e,t,i,n){return e+\" (\"+t+\") {\"+(n?te(i,n):M.call(i,\", \"))+\"}\"}function te(e,t){if(0===e.length)return\"\";var i=\"\\n\"+t.prev+t.base;return i+M.call(e,\",\"+i)+\"\\n\"+t.prev}function ie(e,t){var i=G(e),n=[];if(i){n.length=e.length;for(var o=0;o=t.length?{value:void 0,done:!0}:(e=n(t,i),this._i+=e.length,{value:e,done:!1})}))},function(e,t,i){var n=i(126).f,o=i(148),a=i(75)(\"toStringTag\");e.exports=function(e,t,i){e&&!o(e=i?e:e.prototype,a)&&n(e,a,{configurable:!0,value:t})}},function(e,t,i){i(1153);for(var n=i(74),o=i(149),a=i(169),r=i(75)(\"toStringTag\"),s=\"CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList\".split(\",\"),l=0;l0?t.join(\"=\"):void 0;r=void 0===r?null:a(r),i(a(o),r,n)})),Object.keys(n).sort().reduce((function(e,t){var i=n[t];return Boolean(i)&&\"object\"==typeof i&&!Array.isArray(i)?e[t]=s(i):e[t]=i,e}),Object.create(null))):n}t.extract=l,t.parse=u,t.stringify=function(e,t){!1===(t=o({encode:!0,strict:!0,arrayFormat:\"none\"},t)).sort&&(t.sort=function(){});var i=function(e){switch(e.arrayFormat){case\"index\":return function(t,i,n){return null===i?[r(t,e),\"[\",n,\"]\"].join(\"\"):[r(t,e),\"[\",r(n,e),\"]=\",r(i,e)].join(\"\")};case\"bracket\":return function(t,i){return null===i?r(t,e):[r(t,e),\"[]=\",r(i,e)].join(\"\")};default:return function(t,i){return null===i?r(t,e):[r(t,e),\"=\",r(i,e)].join(\"\")}}}(t);return e?Object.keys(e).sort(t.sort).map((function(n){var o=e[n];if(void 0===o)return\"\";if(null===o)return r(n,t);if(Array.isArray(o)){var a=[];return o.slice().forEach((function(e){void 0!==e&&a.push(i(n,e,a.length))})),a.join(\"&\")}return r(n,t)+\"=\"+r(o,t)})).filter((function(e){return e.length>0})).join(\"&\"):\"\"},t.parseUrl=function(e,t){return{url:e.split(\"?\")[0]||\"\",query:u(l(e),t)}}},function(e,t){e.exports=\"/static/assets/7d043362c1c4cabd22aeb93b43fc5fc6.svg\"},function(e,t){e.exports=\"/static/assets/40167d33efb7d0929a3bcbc591fc78b0.svg\"},function(e,t){e.exports=\"/static/assets/86f568a0ecc0badac2c4952b39fff148.svg\"},function(e,t){e.exports=\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBzdHJva2U9IiM3Qzg3QTUiIGZpbGw9IiNGRkYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTEgMTJoMzh2MTZIMXoiLz48cGF0aCBzdHJva2U9IiNFNkU3RTgiIGZpbGw9IiNFNkU3RTgiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTE2IDEydjJoMXYtMWgydjFoMXYtMnoiLz48cGF0aCBkPSJNMTQuNSAxMkgyMiIgc3Ryb2tlPSIjN0M4N0E1IiBzdHJva2UtbGluZWNhcD0ic3F1YXJlIi8+PHBhdGggc3Ryb2tlPSIjN0M4N0E1IiBmaWxsPSIjRkZGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Ik0xIDE2aDE5djZoNHY0aC00djJIMXoiLz48cGF0aCBzdHJva2U9IiM3Qzg3QTUiIGZpbGw9IiNFNkU3RTgiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTEgMjZoMzh2Mkgxek0xIDE5aDlsMyAzaDR2NEgxeiIvPjxjaXJjbGUgZmlsbD0iI0ZGNjYxQSIgY3g9IjQuNSIgY3k9IjIyLjUiIHI9IjEuNSIvPjxjaXJjbGUgZmlsbD0iIzdDODdBNSIgY3g9IjIyIiBjeT0iMjQiIHI9IjEiLz48cGF0aCBzdHJva2U9IiM3Qzg3QTUiIGZpbGw9IiNGRkYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTI5IDIyaDEwdjRIMjl6Ii8+PGNpcmNsZSBmaWxsPSIjN0M4N0E1IiBjeD0iMzEiIGN5PSIyNCIgcj0iMSIvPjxjaXJjbGUgZmlsbD0iIzdDODdBNSIgY3g9IjM0IiBjeT0iMjQiIHI9IjEiLz48Y2lyY2xlIGZpbGw9IiM3Qzg3QTUiIGN4PSIzNyIgY3k9IjI0IiByPSIxIi8+PGcgc3Ryb2tlPSIjN0M4N0E1IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0zIDE2di0uNU01IDE2di0uNU03IDE2di0uNU05IDE2di0uNU0xMSAxNnYtLjVNMTMgMTZ2LS41Ii8+PC9nPjxnIHN0cm9rZT0iIzdDODdBNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNMjEgMjJ2LS41TTIzIDIydi0uNSIvPjwvZz48ZyBzdHJva2U9IiM3Qzg3QTUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PHBhdGggZD0iTTMgMTJ2LS41TTUgMTJ2LS41TTcgMTJ2LS41TTkgMTJ2LS41TTExIDEydi0uNU0xMyAxMnYtLjUiLz48L2c+PGcgc3Ryb2tlPSIjN0M4N0E1IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0yOCAxMnYtLjVNMjYgMTJ2LS41TTI0IDEydi0uNU0zMCAxMnYtLjVNMzIgMTJ2LS41TTM0IDEydi0uNU0zNiAxMnYtLjVNMzggMTJ2LS41Ii8+PC9nPjxnIHN0cm9rZT0iIzdDODdBNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNMzEgMjJ2LS41TTMzIDIydi0uNU0zNSAyMnYtLjVNMzcgMjJ2LS41Ii8+PC9nPjwvZz48L3N2Zz4=\"},function(e,t){e.exports=\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoOCAuNSkiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHBhdGggZD0iTTEyIDM5YTMgMyAwIDAgMS0zLTNjMC0uNi40LTEgMS0xIC41IDAgMSAuNCAxIDFhMSAxIDAgMSAwIDIgMHYtLjJhMSAxIDAgMCAwLS4zLS43bC0uOC0uOGEzIDMgMCAwIDEtMS0yLjFWMzBjMC0uNi41LTEgMS0xIC42IDAgMSAuNCAxIDF2Mi4ybC40LjcuOC44Yy42LjYuOSAxLjMuOSAyLjF2LjJhMyAzIDAgMCAxLTMgM3oiIHN0cm9rZS1vcGFjaXR5PSIuMSIgc3Ryb2tlPSIjMDAwIiBmaWxsPSIjRTZFN0U4Ii8+PHBhdGggZD0iTTIzLjcuM0ExIDEgMCAwIDAgMjMgMEgxYTEgMSAwIDAgMC0uNy4zQTEgMSAwIDAgMCAwIDF2MjZjMCAuMy4xLjUuMy43LjIuMi40LjMuNy4zaDIyYy4zIDAgLjUtLjEuNy0uMy4yLS4yLjMtLjQuMy0uN1YxYTEgMSAwIDAgMC0uMy0uN3pNMTIgNGMyIDAgMy4zIDIgMi42IDMuOEwxMy4zIDExYTEuNCAxLjQgMCAwIDEtMi43IDBMOS41IDcuN2wtLjItMUM5LjIgNS40IDEwLjQgNCAxMiA0eiIgc3Ryb2tlPSIjN0M4N0E1IiBmaWxsPSIjODU5MkFGIiBmaWxsLXJ1bGU9Im5vbnplcm8iIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjxwYXRoIGQ9Ik0yIDJ2MjRoMjBWMkgyem0xMCAyYzIgMCAzLjMgMiAyLjYgMy44TDEzLjMgMTFhMS40IDEuNCAwIDAgMS0yLjcgMEw5LjUgNy43bC0uMi0xQzkuMiA1LjQgMTAuNCA0IDEyIDR6IiBzdHJva2U9IiM3Qzg3QTUiIGZpbGw9IiM1Q0IxRDYiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PHBhdGggc3Ryb2tlPSIjN0M4N0E1IiBmaWxsPSIjODU5MkFGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Ik0yMiAyNkgydi02bDIwLTR6Ii8+PHBhdGggZD0iTS4zIDI3LjdMMiAyNk0uMy4zTDIgMk0yMiAyTDIzLjcuM00yMy43IDI3LjdMMjIgMjYiIHN0cm9rZT0iIzdDODdBNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PGNpcmNsZSBmaWxsPSIjRkZCRjAwIiBjeD0iMTIiIGN5PSIxNC44IiByPSIxLjIiLz48cGF0aCBzdHJva2U9IiM3Qzg3QTUiIGZpbGw9IiNFNkU3RTgiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTEwIDI4aDR2NGgtNHoiLz48cGF0aCBkPSJNMTUuNSAyMmgtN2EuNS41IDAgMCAxLS41LS41YzAtLjMuMi0uNS41LS41aDdjLjMgMCAuNS4yLjUuNXMtLjIuNS0uNS41ek0xNy41IDI0aC0xMWEuNS41IDAgMCAxLS41LS41YzAtLjMuMi0uNS41LS41aDExYy4zIDAgLjUuMi41LjVzLS4yLjUtLjUuNXoiIGZpbGw9IiNGRkJGMDAiLz48L2c+PC9zdmc+\"},function(e,t,i){const n=i(1e3);e.exports=n},function(e,t,i){\"use strict\";var n=i(80),o=i(16);const a='',r='',s=(e,t)=>n.a.isLoaded()?n.a.get().ScratchMsgs.translate(e,t):t,l=function(e){return e.replace(/[<>&'\"]/g,(e=>{switch(e){case\"<\":return\"<\";case\">\":return\">\";case\"&\":return\"&\";case\"'\":return\"'\";case'\"':return\""\"}}))},u='\\nis compiled?\\nis TurboWarp?\\n';t.a=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:\"\",d=arguments.length>5&&void 0!==arguments[5]?arguments[5]:\"\",p=arguments.length>6&&void 0!==arguments[6]?arguments[6]:\"\",m=arguments.length>7&&void 0!==arguments[7]?arguments[7]:o.m;t=e||t;const g=[a];c=l(c),d=l(d),p=l(p),n=n.slice();const h=e=>{const t=n.findIndex((t=>t.id===e));if(t>=0){const[e]=n.splice(t,1);return e.xml}},f=h(\"motion\")||function(e,t,i,n){const o=s(\"MOTION_STAGE_SELECTED\",\"Stage selected: no motion blocks\");return'\\n \\n ').concat(t?'\\n \\n '):'\\n \\n \\n \\n 10\\n \\n \\n \\n \\n \\n \\n 15\\n \\n \\n \\n \\n \\n \\n 15\\n \\n \\n \\n '.concat(r,'\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n 0\\n \\n \\n \\n \\n 0\\n \\n \\n \\n \\n \\n \\n 1\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n 1\\n \\n \\n \\n \\n 0\\n \\n \\n \\n \\n 0\\n \\n \\n \\n ').concat(r,'\\n \\n \\n \\n 90\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n ').concat(r,'\\n \\n \\n \\n 10\\n \\n \\n \\n \\n \\n \\n 0\\n \\n \\n \\n \\n \\n \\n 10\\n \\n \\n \\n \\n \\n \\n 0\\n \\n \\n \\n ').concat(r,'\\n \\n ').concat(r,'\\n \\n ').concat(r,'\\n \\n \\n '),\"\\n \").concat(a,\"\\n \\n \")}(0,t,i,m.motion),b=h(\"looks\")||function(e,t,i,n,o,l){const u=s(\"LOOKS_HELLO\",\"Hello!\"),c=s(\"LOOKS_HMM\",\"Hmm...\");return'\\n \\n ').concat(t?\"\":'\\n \\n \\n \\n '.concat(u,'\\n \\n \\n \\n \\n 2\\n \\n \\n \\n \\n \\n \\n ').concat(u,'\\n \\n \\n \\n \\n \\n \\n ').concat(c,'\\n \\n \\n \\n \\n 2\\n \\n \\n \\n \\n \\n \\n ').concat(c,\"\\n \\n \\n \\n \").concat(r,\"\\n \"),\"\\n \").concat(t?'\\n \\n \\n \\n '.concat(o,'\\n \\n \\n \\n \\n \\n \\n ').concat(o,'\\n \\n \\n \\n \\n '):'\\n \\n \\n \\n ').concat(n,'\\n \\n \\n \\n \\n \\n \\n \\n ').concat(o,'\\n \\n \\n \\n \\n ').concat(r,'\\n \\n \\n \\n 10\\n \\n \\n \\n \\n \\n \\n 100\\n \\n \\n \\n '),\"\\n \").concat(r,'\\n \\n \\n \\n 25\\n \\n \\n \\n \\n \\n \\n 0\\n \\n \\n \\n \\n ').concat(r,\"\\n \").concat(t?\"\":'\\n \\n \\n '.concat(r,'\\n \\n \\n \\n \\n 1\\n \\n \\n \\n '),\"\\n \").concat(t?'\\n \\n ':'\\n \\n \\n \\n '),\"\\n \").concat(a,\"\\n \\n \")}(0,t,i,c,d,m.looks),y=h(\"sound\")||function(e,t,i,n,o){return'\\n \\n \\n \\n \\n ').concat(n,'\\n \\n \\n \\n \\n \\n \\n ').concat(n,'\\n \\n \\n \\n \\n ').concat(r,'\\n \\n \\n \\n 10\\n \\n \\n \\n \\n \\n \\n 100\\n \\n \\n \\n \\n ').concat(r,'\\n \\n \\n \\n -10\\n \\n \\n \\n \\n \\n \\n 100\\n \\n \\n \\n \\n ').concat(a,\"\\n \\n \")}(0,0,i,p,m.sounds),v=h(\"event\")||function(e,t,i,n){return'\\n \\n \\n \\n \\n ').concat(t?'\\n \\n ':'\\n \\n ','\\n \\n \\n ').concat(r,'\\n \\n \\n \\n 10\\n \\n \\n \\n ').concat(r,'\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n ').concat(a,\"\\n \\n \")}(0,t,0,m.event),k=h(\"control\")||function(e,t,i,n){return'\\n \\n \\n \\n \\n 1\\n \\n \\n \\n ').concat(r,'\\n \\n \\n \\n 10\\n \\n \\n \\n \\n ').concat(r,'\\n \\n \\n \\n \\n \\n ').concat(r,'\\n \\n ').concat(r,\"\\n \").concat(t?'\\n \\n \\n \\n \\n \\n ':'\\n \\n \\n \\n \\n \\n \\n \\n ',\"\\n \").concat(a,\"\\n \\n \")}(0,t,0,m.control),w=h(\"sensing\")||function(e,t,i,n){const o=s(\"SENSING_ASK_TEXT\",\"What's your name?\");return'\\n \\n ').concat(t?\"\":'\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n '.concat(r,\"\\n \"),\"\\n \").concat(e?\"\":'\\n \\n \\n \\n '.concat(o,\"\\n \\n \\n \\n \"),'\\n \\n ').concat(r,'\\n \\n \\n \\n \\n \\n \\n \\n \\n ').concat(t?\"\":\"\\n \".concat(r,'\\n \\'\\'+\\n ').concat(r,\"\\n \"),\"\\n \").concat(r,'\\n \\n ').concat(r,'\\n \\n \\n ').concat(r,'\\n \\n \\n \\n \\n \\n ').concat(r,'\\n \\n \\n ').concat(r,'\\n \\n \\n ').concat(a,\"\\n \\n \")}(e,t,0,m.sensing),T=h(\"operators\")||function(e,t,i,n){const o=s(\"OPERATORS_JOIN_APPLE\",\"apple\"),l=s(\"OPERATORS_JOIN_BANANA\",\"banana\"),u=s(\"OPERATORS_LETTEROF_APPLE\",\"a\");return'\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n ').concat(r,'\\n \\n \\n \\n 1\\n \\n \\n \\n \\n 10\\n \\n \\n \\n ').concat(r,'\\n \\n \\n \\n \\n \\n \\n \\n \\n 50\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n 50\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n 50\\n \\n \\n \\n ').concat(r,'\\n \\n \\n \\n ').concat(r,\"\\n \").concat(e?\"\":'\\n \\n \\n \\n '.concat(o,' \\n \\n \\n \\n \\n ').concat(l,'\\n \\n \\n \\n \\n \\n \\n 1\\n \\n \\n \\n \\n ').concat(o,'\\n \\n \\n \\n \\n \\n \\n ').concat(o,'\\n \\n \\n \\n \\n \\n \\n ').concat(o,'\\n \\n \\n \\n \\n ').concat(u,\"\\n \\n \\n \\n \"),\"\\n \").concat(r,'\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n ').concat(r,'\\n \\n \\n \\n \\n \\n \\n \\n ').concat(a,\"\\n \\n \")}(e,0,0,m.operators),S=h(\"data\")||function(e,t,i,n){return'\\n \\n \\n ')}(0,0,0,m.data),M=h(\"procedures\")||function(e,t,i,n){return'\\n \\n \\n ')}(0,0,0,m.more);let E=h(\"tw\");E&&!E.includes(u)&&(E=E.replace(\"',f,g,b,g,y,g,v,g,k,g,w,g,T,g,S,g,M];E&&I.push(g,E);for(const e of n)I.push(g,e.xml);return I.push(\"\"),I.join(\"\\n\")}},function(e,t){e.exports=\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDQ4LjIgKDQ3MzI3KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5iYWNrLWljb248L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz48L2RlZnM+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iYmFjay1pY29uIiBmaWxsPSIjRkZGRkZGIj4KICAgICAgICAgICAgPHBhdGggZD0iTTQuMTA4MDQ5MTIsOC41Nzc2NTA1NSBMOS4zMzIwMzYzOCwzLjM1MzY2MzI5IEM5LjYzODIwNDEzLDMuMDQ1NTgxOTkgMTAuMTE2NTkxMiwzLjA0NTU4MTk5IDEwLjQyMjc1OSwzLjM1MzY2MzI5IEwxNS42NDY3NDYyLDguNTc3NjUwNTUgQzE2LjE0NDI2ODgsOS4wNzUxNzMxNCAxNS43ODA2OTQ2LDkuODk2MDg1NDMgMTUuMDkxODE3Miw5Ljg5NjA4NTQzIEwxMi40ODkzOTEzLDkuODk2MDg1NDMgTDEwLjkzOTQxNzEsMTYuMDM4NTc1OSBDMTAuNzg2MzMzMiwxNi42MzM2ODk1IDEwLjE3Mzk5NzcsMTYuOTk1MzUwMiA5LjU4MDc5NzY4LDE2Ljg0MjI2NjMgQzkuMTU5ODE3MDIsMTYuNzQ4NTAyNCA4Ljg1MzY0OTI3LDE2LjQyMzE5OTIgOC43NTc5NzE4NCwxNi4wMzg1NzU5IEw3LjIwNzk5NzYsOS44OTYwODU0MyBMNC42NjI5NzgxNyw5Ljg5NjA4NTQzIEMzLjk3NDEwMDczLDkuODk2MDg1NDMgMy42MTA1MjY1Myw5LjA3NTE3MzE0IDQuMTA4MDQ5MTIsOC41Nzc2NTA1NSIgaWQ9IkZpbGwtMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoOS44NzczOTgsIDEwLjAwMDAwMCkgcm90YXRlKC05MC4wMDAwMDApIHRyYW5zbGF0ZSgtOS44NzczOTgsIC0xMC4wMDAwMDApICI+PC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+\"},function(e,t,i){\"use strict\";var n=i(4),o=i.n(n),a=i(0),r=i.n(a),s=i(1),l=i.n(s),u=i(502),c=i.n(u);const d=e=>{let{className:t}=e;return l.a.createElement(\"div\",{className:o()(c.a.divider,t)})};d.propTypes={className:r.a.string},t.a=d},function(e,t){e.exports=\"/static/assets/78e3f697df85275aa8d384ca6fc0e288.svg\"},function(e,t){e.exports=\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDQ5LjMgKDUxMTY3KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5icnVzaDwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPjwvZGVmcz4KICAgIDxnIGlkPSJicnVzaCIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPHBhdGggZD0iTTkuNTAwNjI2NjMsMTEuNDk4MTczNCBMMTAuNDk5NTczNCwxMS40OTgxNzM0IEwxMC40OTk1NzM0LDE0LjQ5OTAxMzQgTDkuNDk5NjI2NjksMTQuNDk5MDEzNCBMOS40OTk2MjY2OSwxMS40OTkxNzM0IEw2LjQ5OTc4NjY4LDExLjQ5OTE3MzQgTDYuNDk5Nzg2NjgsMTAuNDk5MjI2NyBMOS41MDA2MjY2MywxMC40OTkyMjY3IEw5LjUwMDYyNjYzLDExLjQ5ODE3MzQgWiBNMTMuNDk5MjEzNCwzLjUgTDE2LjUwMDA1MzMsMy41IEwxNi41MDAwNTMzLDQuNDk5OTQ2NjcgTDE3LjUsNC40OTk5NDY2NyBMMTcuNSw3LjQ5OTc4NjY4IEwxNi41MDAwNTMzLDcuNDk5Nzg2NjggTDE2LjUwMDA1MzMsOC40OTg3MzM0IEwxNS40OTkxMDY3LDguNDk4NzMzNCBMMTUuNDk5MTA2Nyw5LjQ5ODY4MDA3IEwxNC40OTkxNiw5LjQ5ODY4MDA3IEwxNC40OTkxNiwxMC40OTg2MjY3IEwxMi40OTkyNjY3LDEwLjQ5ODYyNjcgTDEyLjQ5OTI2NjcsMTEuNDk4NTczNCBMMTEuNDk5MzIsMTEuNDk4NTczNCBMMTEuNDk5MzIsMTAuNDk4NjI2NyBMMTAuNDk5MzczNCwxMC40OTg2MjY3IEwxMC40OTkzNzM0LDkuNDk4NjgwMDcgTDkuNDk5NDI2Nyw5LjQ5ODY4MDA3IEw5LjQ5OTQyNjcsNy40OTk3ODY2OCBMMTAuNDk5MzczNCw3LjQ5OTc4NjY4IEwxMC40OTkzNzM0LDYuNDk5ODQwMDEgTDExLjQ5OTMyLDYuNDk5ODQwMDEgTDExLjQ5OTMyLDUuNDk5ODkzMzQgTDEyLjQ5OTI2NjcsNS40OTk4OTMzNCBMMTIuNDk5MjY2Nyw0LjQ5OTk0NjY3IEwxMy40OTkyMTM0LDQuNDk5OTQ2NjcgTDEzLjQ5OTIxMzQsMy41IFogTTUuNDk5NTQwMDIsMTEuNDk4NzczNCBMNi40OTk0ODY2OSwxMS40OTg3NzM0IEw2LjQ5OTQ4NjY5LDEyLjQ5OTcyIEw3LjUwMDQzMzMxLDEyLjQ5OTcyIEw3LjUwMDQzMzMxLDEzLjQ5OTY2NjcgTDguNTAwMzc5OTgsMTMuNDk5NjY2NyBMOC41MDAzNzk5OCwxNC40OTk2MTM0IEw5LjUwMDMyNjY1LDE0LjQ5OTYxMzQgTDkuNTAwMzI2NjUsMTUuNDk5NTYgTDguNTAwMzc5OTgsMTUuNDk5NTYgTDguNTAwMzc5OTgsMTYuNDk4NTA2NyBMNC40OTk1OTMzNiwxNi40OTg1MDY3IEw0LjQ5OTU5MzM2LDE1LjQ5OTU2IEwzLjQ5OTY0NjY5LDE1LjQ5OTU2IEwzLjQ5OTY0NjY5LDEzLjQ5OTY2NjcgTDUuNDk5NTQwMDIsMTMuNDk5NjY2NyBMNS40OTk1NDAwMiwxMS40OTg3NzM0IFogTTIuNSwxMy40OTkwNjY3IEwyLjUsMTIuNDk5MTIgTDMuNDk5OTQ2NjcsMTIuNDk5MTIgTDMuNDk5OTQ2NjcsMTMuNDk5MDY2NyBMMi41LDEzLjQ5OTA2NjcgWiIgaWQ9IkNvbWJpbmVkLVNoYXBlIiBmaWxsPSIjNTc1RTc1Ij48L3BhdGg+CiAgICA8L2c+Cjwvc3ZnPg==\"},function(e,t){e.exports=\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDQ5LjMgKDUxMTY3KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5saW5lPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGRlZnM+PC9kZWZzPgogICAgPGcgaWQ9ImxpbmUiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxwYXRoIGQ9Ik0xMiw3Ljk5OCBMMTIsNiBMMTQsNiBMMTQsOCBMMTIuMDAyLDggTDEyLjAwMiwxMCBMMTAsMTAgTDEwLDcuOTk4IEwxMiw3Ljk5OCBaIE04LDEyIEw4LDEwIEwxMCwxMCBMMTAsMTIgTDgsMTIgWiBNMTQsNiBMMTQsNCBMMTYsNCBMMTYsNiBMMTQsNiBaIE00LDE2IEw0LDE0IEw2LDE0IEw2LDE2IEw0LDE2IFogTTYsMTQgTDYsMTIgTDgsMTIgTDgsMTQgTDYsMTQgWiIgaWQ9IkNvbWJpbmVkLVNoYXBlIiBmaWxsPSIjNTc1RTc1Ij48L3BhdGg+CiAgICA8L2c+Cjwvc3ZnPg==\"},function(e,t){e.exports=\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDQ5LjMgKDUxMTY3KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5vdmFsPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGRlZnM+PC9kZWZzPgogICAgPGcgaWQ9Im92YWwiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxwb2x5Z29uIGlkPSJQYWdlLTEiIGZpbGw9IiM1NzVFNzUiIHBvaW50cz0iNi42NjY2NjY2NyA0IDYuNjY2NjY2NjcgNS4zMzMzMzMzMyA1LjMzMzMzMzMzIDUuMzMzMzMzMzMgNS4zMzMzMzMzMyA2LjY2NjY2NjY3IDQgNi42NjY2NjY2NyA0IDEzLjMzMzMzMzMgNS4zMzMzMzMzMyAxMy4zMzMzMzMzIDUuMzMzMzMzMzMgMTQuNjY2NjY2NyA2LjY2NjY2NjY3IDE0LjY2NjY2NjcgNi42NjY2NjY2NyAxNiAxMy4zMzMzMzMzIDE2IDEzLjMzMzMzMzMgMTQuNjY2NjY2NyAxNC42NjY2NjY3IDE0LjY2NjY2NjcgMTQuNjY2NjY2NyAxMy4zMzMzMzMzIDE2IDEzLjMzMzMzMzMgMTYgNi42NjY2NjY2NyAxNC42NjY2NjY3IDYuNjY2NjY2NjcgMTQuNjY2NjY2NyA1LjMzMzMzMzMzIDEzLjMzMzMzMzMgNS4zMzMzMzMzMyAxMy4zMzMzMzMzIDQiPjwvcG9seWdvbj4KICAgIDwvZz4KPC9zdmc+\"},function(e,t){e.exports=\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDQ5LjMgKDUxMTY3KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5yZWN0YW5nZTwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPjwvZGVmcz4KICAgIDxnIGlkPSJyZWN0YW5nZSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPHJlY3QgaWQ9InJlY3RhbmdsZS1pY29uIiBmaWxsPSIjNTc1RTc1IiB4PSI0IiB5PSI0IiB3aWR0aD0iMTIiIGhlaWdodD0iMTIiPjwvcmVjdD4KICAgIDwvZz4KPC9zdmc+\"},function(e,t){e.exports=\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDQ5LjMgKDUxMTY3KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5lcmFzZXI8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz48L2RlZnM+CiAgICA8ZyBpZD0iZXJhc2VyIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8cGF0aCBkPSJNOS4zMDAyMjkwNCwxNC4xOTk2OTQ2IEw3Ljg5OTg0NzIzLDE0LjE5OTY5NDYgTDcuODk5ODQ3MjMsMTIuNzk5NzMyNyBMNi40OTk4ODU0MSwxMi43OTk3MzI3IEw2LjQ5OTg4NTQxLDExLjM5OTc3MDkgTDUuMDk5OTIzNTksMTEuMzk5NzcwOSBMNS4wOTk5MjM1OSw5Ljk5ODQwOTEzIEwzLjY5OTk2MTc3LDkuOTk4NDA5MTMgTDMuNjk5OTYxNzcsOC41OTk4NDcyOCBMMi4yOTk5OTk5NSw4LjU5OTg0NzI4IEwyLjI5OTk5OTk1LDcuMTk5ODg1NDYgTDMuNjk5OTYxNzcsNy4xOTk4ODU0NiBMMy42OTk5NjE3Nyw1Ljc5OTkyMzY0IEw1LjA5OTkyMzU5LDUuNzk5OTIzNjQgTDUuMDk5OTIzNTksNC4zOTk5NjE4MiBMNi40OTk4ODU0MSw0LjM5OTk2MTgyIEw2LjQ5OTg4NTQxLDMgTDcuODk5ODQ3MjMsMyBMNy44OTk4NDcyMyw0LjM5OTk2MTgyIEw5LjMwMTIwOTAxLDQuMzk5OTYxODIgTDkuMzAxMjA5MDEsNS43OTk5MjM2NCBMMTAuNzAxMTcwOCw1Ljc5OTkyMzY0IEwxMC43MDExNzA4LDcuMTk5ODg1NDYgTDEyLjEwMTEzMjYsNy4xOTk4ODU0NiBMMTIuMTAxMTMyNiw4LjU5OTg0NzI4IEwxMy40OTk2OTQ1LDguNTk5ODQ3MjggTDEzLjQ5OTY5NDUsOS45OTg0MDkxMyBMMTIuMTAxMTMyNiw5Ljk5ODQwOTEzIEwxMi4xMDExMzI2LDExLjM5OTc3MDkgTDEwLjcwMTE3MDgsMTEuMzk5NzcwOSBMMTAuNzAxMTcwOCwxMi43OTk3MzI3IEw5LjMwMTIwOTAxLDEyLjc5OTczMjcgTDkuMzAxMjA5MDEsMTQuMTk5NTU0NiBMMTAuNzAwMTkwOSwxNC4xOTk1NTQ2IEwxMC43MDAxOTA5LDE1LjU5OTUxNjQgTDkuMzAwMjI5MDQsMTUuNTk5NTE2NCBMOS4zMDAyMjkwNCwxNC4xOTk2OTQ2IFogTTEwLjcwMDE5MDksMTYuOTk5NDc4MiBMMTAuNzAwMTkwOSwxNS41OTk1MTY0IEwxNC45MDAwNzYzLDE1LjU5OTUxNjQgTDE0LjkwMDA3NjMsMTYuOTk5NDc4MiBMMTAuNzAwMTkwOSwxNi45OTk0NzgyIFogTTE0LjkwMDA3NjMsMTUuNTk5NTE2NCBMMTQuOTAwMDc2MywxNC4xOTk1NTQ2IEwxNi4zMDAwMzgxLDE0LjE5OTU1NDYgTDE2LjMwMDAzODEsMTUuNTk5NTE2NCBMMTQuOTAwMDc2MywxNS41OTk1MTY0IFogTTE0LjkwMDA3NjMsMTIuNzk5NTkyNyBMMTQuOTAwMDc2MywxMS4zOTk2MzA5IEwxNi4zMDAwMzgxLDExLjM5OTYzMDkgTDE2LjMwMDAzODEsMTIuNzk5NTkyNyBMMTQuOTAwMDc2MywxMi43OTk1OTI3IFogTTE2LjMwMDAzODEsMTQuMTk5NTU0NiBMMTYuMzAwMDM4MSwxMi43OTk1OTI3IEwxNy43LDEyLjc5OTU5MjcgTDE3LjcsMTQuMTk5NTU0NiBMMTYuMzAwMDM4MSwxNC4xOTk1NTQ2IFogTTEzLjUwMDExNDUsMTEuMzk5NjMwOSBMMTMuNTAwMTE0NSw5Ljk5ODI2OTE0IEwxNC45MDAwNzYzLDkuOTk4MjY5MTQgTDE0LjkwMDA3NjMsMTEuMzk5NjMwOSBMMTMuNTAwMTE0NSwxMS4zOTk2MzA5IFoiIGlkPSJDb21iaW5lZC1TaGFwZSIgZmlsbD0iIzU3NUU3NSI+PC9wYXRoPgogICAgPC9nPgo8L3N2Zz4=\"},function(e,t,i){\"use strict\";(function(e){var n=i(0),o=i.n(n),a=i(1),r=i.n(a),s=i(172),l=i.n(s);const u=[\"alignContent\",\"alignItems\",\"alignSelf\",\"basis\",\"children\",\"className\",\"componentRef\",\"direction\",\"element\",\"grow\",\"height\",\"justifyContent\",\"width\",\"wrap\",\"shrink\",\"style\"];function c(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function d(e,t,i){return(t=function(e){var t=function(e,t){if(\"object\"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||\"default\");if(\"object\"!=typeof n)return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(\"string\"===t?String:Number)(e)}(e,\"string\");return\"symbol\"==typeof t?t:t+\"\"}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const p=function(){const e=function(){let e=601,t=987654321;const i=4294967295;return function(){t=36969*(65535&t)+(t>>16)&i,e=18e3*(65535&e)+(e>>16)&i;let n=(t<<16)+e&i;return n/=4294967296,n+1}}();return function(){const t=Math.max(parseInt(100*e(),10)%256,1),i=Math.max(parseInt(100*e(),10)%256,1),n=Math.max(parseInt(100*e(),10)%256,1);return\"rgb(\".concat(t,\",\").concat(i,\",\").concat(n,\")\")}}(),m=t=>{const{alignContent:i,alignItems:n,alignSelf:o,basis:a,children:s,className:l,componentRef:m,direction:g,element:h,grow:f,height:b,justifyContent:y,width:v,wrap:k,shrink:w,style:T}=t,S=function(e,t){if(null==e)return{};var i,n,o=function(e,t){if(null==e)return{};var i={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;i[n]=e[n]}return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n1&&i[1]||\"\"}function n(e){var i=t.match(e);return i&&i.length>1&&i[2]||\"\"}var o,r=i(/(ipod|iphone|ipad)/i).toLowerCase(),s=!/like android/i.test(t)&&/android/i.test(t),l=/nexus\\s*[0-6]\\s*/i.test(t),u=!l&&/nexus\\s*[0-9]+/i.test(t),c=/CrOS/.test(t),d=/silk/i.test(t),p=/sailfish/i.test(t),m=/tizen/i.test(t),g=/(web|hpw)(o|0)s/i.test(t),h=/windows phone/i.test(t),f=(/SamsungBrowser/i.test(t),!h&&/windows/i.test(t)),b=!r&&!d&&/macintosh/i.test(t),y=!s&&!p&&!m&&!g&&/linux/i.test(t),v=n(/edg([ea]|ios)\\/(\\d+(\\.\\d+)?)/i),k=i(/version\\/(\\d+(\\.\\d+)?)/i),w=/tablet/i.test(t)&&!/tablet pc/i.test(t),T=!w&&/[^-]mobi/i.test(t),S=/xbox/i.test(t);/opera/i.test(t)?o={name:\"Opera\",opera:e,version:k||i(/(?:opera|opr|opios)[\\s\\/](\\d+(\\.\\d+)?)/i)}:/opr\\/|opios/i.test(t)?o={name:\"Opera\",opera:e,version:i(/(?:opr|opios)[\\s\\/](\\d+(\\.\\d+)?)/i)||k}:/SamsungBrowser/i.test(t)?o={name:\"Samsung Internet for Android\",samsungBrowser:e,version:k||i(/(?:SamsungBrowser)[\\s\\/](\\d+(\\.\\d+)?)/i)}:/Whale/i.test(t)?o={name:\"NAVER Whale browser\",whale:e,version:i(/(?:whale)[\\s\\/](\\d+(?:\\.\\d+)+)/i)}:/MZBrowser/i.test(t)?o={name:\"MZ Browser\",mzbrowser:e,version:i(/(?:MZBrowser)[\\s\\/](\\d+(?:\\.\\d+)+)/i)}:/coast/i.test(t)?o={name:\"Opera Coast\",coast:e,version:k||i(/(?:coast)[\\s\\/](\\d+(\\.\\d+)?)/i)}:/focus/i.test(t)?o={name:\"Focus\",focus:e,version:i(/(?:focus)[\\s\\/](\\d+(?:\\.\\d+)+)/i)}:/yabrowser/i.test(t)?o={name:\"Yandex Browser\",yandexbrowser:e,version:k||i(/(?:yabrowser)[\\s\\/](\\d+(\\.\\d+)?)/i)}:/ucbrowser/i.test(t)?o={name:\"UC Browser\",ucbrowser:e,version:i(/(?:ucbrowser)[\\s\\/](\\d+(?:\\.\\d+)+)/i)}:/mxios/i.test(t)?o={name:\"Maxthon\",maxthon:e,version:i(/(?:mxios)[\\s\\/](\\d+(?:\\.\\d+)+)/i)}:/epiphany/i.test(t)?o={name:\"Epiphany\",epiphany:e,version:i(/(?:epiphany)[\\s\\/](\\d+(?:\\.\\d+)+)/i)}:/puffin/i.test(t)?o={name:\"Puffin\",puffin:e,version:i(/(?:puffin)[\\s\\/](\\d+(?:\\.\\d+)?)/i)}:/sleipnir/i.test(t)?o={name:\"Sleipnir\",sleipnir:e,version:i(/(?:sleipnir)[\\s\\/](\\d+(?:\\.\\d+)+)/i)}:/k-meleon/i.test(t)?o={name:\"K-Meleon\",kMeleon:e,version:i(/(?:k-meleon)[\\s\\/](\\d+(?:\\.\\d+)+)/i)}:h?(o={name:\"Windows Phone\",osname:\"Windows Phone\",windowsphone:e},v?(o.msedge=e,o.version=v):(o.msie=e,o.version=i(/iemobile\\/(\\d+(\\.\\d+)?)/i))):/msie|trident/i.test(t)?o={name:\"Internet Explorer\",msie:e,version:i(/(?:msie |rv:)(\\d+(\\.\\d+)?)/i)}:c?o={name:\"Chrome\",osname:\"Chrome OS\",chromeos:e,chromeBook:e,chrome:e,version:i(/(?:chrome|crios|crmo)\\/(\\d+(\\.\\d+)?)/i)}:/edg([ea]|ios)/i.test(t)?o={name:\"Microsoft Edge\",msedge:e,version:v}:/vivaldi/i.test(t)?o={name:\"Vivaldi\",vivaldi:e,version:i(/vivaldi\\/(\\d+(\\.\\d+)?)/i)||k}:p?o={name:\"Sailfish\",osname:\"Sailfish OS\",sailfish:e,version:i(/sailfish\\s?browser\\/(\\d+(\\.\\d+)?)/i)}:/seamonkey\\//i.test(t)?o={name:\"SeaMonkey\",seamonkey:e,version:i(/seamonkey\\/(\\d+(\\.\\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(t)?(o={name:\"Firefox\",firefox:e,version:i(/(?:firefox|iceweasel|fxios)[ \\/](\\d+(\\.\\d+)?)/i)},/\\((mobile|tablet);[^\\)]*rv:[\\d\\.]+\\)/i.test(t)&&(o.firefoxos=e,o.osname=\"Firefox OS\")):d?o={name:\"Amazon Silk\",silk:e,version:i(/silk\\/(\\d+(\\.\\d+)?)/i)}:/phantom/i.test(t)?o={name:\"PhantomJS\",phantom:e,version:i(/phantomjs\\/(\\d+(\\.\\d+)?)/i)}:/slimerjs/i.test(t)?o={name:\"SlimerJS\",slimer:e,version:i(/slimerjs\\/(\\d+(\\.\\d+)?)/i)}:/blackberry|\\bbb\\d+/i.test(t)||/rim\\stablet/i.test(t)?o={name:\"BlackBerry\",osname:\"BlackBerry OS\",blackberry:e,version:k||i(/blackberry[\\d]+\\/(\\d+(\\.\\d+)?)/i)}:g?(o={name:\"WebOS\",osname:\"WebOS\",webos:e,version:k||i(/w(?:eb)?osbrowser\\/(\\d+(\\.\\d+)?)/i)},/touchpad\\//i.test(t)&&(o.touchpad=e)):/bada/i.test(t)?o={name:\"Bada\",osname:\"Bada\",bada:e,version:i(/dolfin\\/(\\d+(\\.\\d+)?)/i)}:m?o={name:\"Tizen\",osname:\"Tizen\",tizen:e,version:i(/(?:tizen\\s?)?browser\\/(\\d+(\\.\\d+)?)/i)||k}:/qupzilla/i.test(t)?o={name:\"QupZilla\",qupzilla:e,version:i(/(?:qupzilla)[\\s\\/](\\d+(?:\\.\\d+)+)/i)||k}:/chromium/i.test(t)?o={name:\"Chromium\",chromium:e,version:i(/(?:chromium)[\\s\\/](\\d+(?:\\.\\d+)?)/i)||k}:/chrome|crios|crmo/i.test(t)?o={name:\"Chrome\",chrome:e,version:i(/(?:chrome|crios|crmo)\\/(\\d+(\\.\\d+)?)/i)}:s?o={name:\"Android\",version:k}:/safari|applewebkit/i.test(t)?(o={name:\"Safari\",safari:e},k&&(o.version=k)):r?(o={name:\"iphone\"==r?\"iPhone\":\"ipad\"==r?\"iPad\":\"iPod\"},k&&(o.version=k)):o=/googlebot/i.test(t)?{name:\"Googlebot\",googlebot:e,version:i(/googlebot\\/(\\d+(\\.\\d+))/i)||k}:{name:i(/^(.*)\\/(.*) /),version:n(/^(.*)\\/(.*) /)},!o.msedge&&/(apple)?webkit/i.test(t)?(/(apple)?webkit\\/537\\.36/i.test(t)?(o.name=o.name||\"Blink\",o.blink=e):(o.name=o.name||\"Webkit\",o.webkit=e),!o.version&&k&&(o.version=k)):!o.opera&&/gecko\\//i.test(t)&&(o.name=o.name||\"Gecko\",o.gecko=e,o.version=o.version||i(/gecko\\/(\\d+(\\.\\d+)?)/i)),o.windowsphone||!s&&!o.silk?!o.windowsphone&&r?(o[r]=e,o.ios=e,o.osname=\"iOS\"):b?(o.mac=e,o.osname=\"macOS\"):S?(o.xbox=e,o.osname=\"Xbox\"):f?(o.windows=e,o.osname=\"Windows\"):y&&(o.linux=e,o.osname=\"Linux\"):(o.android=e,o.osname=\"Android\");var M=\"\";o.windows?M=function(e){switch(e){case\"NT\":return\"NT\";case\"XP\":case\"NT 5.1\":return\"XP\";case\"NT 5.0\":return\"2000\";case\"NT 5.2\":return\"2003\";case\"NT 6.0\":return\"Vista\";case\"NT 6.1\":return\"7\";case\"NT 6.2\":return\"8\";case\"NT 6.3\":return\"8.1\";case\"NT 10.0\":return\"10\";default:return}}(i(/Windows ((NT|XP)( \\d\\d?.\\d)?)/i)):o.windowsphone?M=i(/windows phone (?:os)?\\s?(\\d+(\\.\\d+)*)/i):o.mac?M=(M=i(/Mac OS X (\\d+([_\\.\\s]\\d+)*)/i)).replace(/[_\\s]/g,\".\"):r?M=(M=i(/os (\\d+([_\\s]\\d+)*) like mac os x/i)).replace(/[_\\s]/g,\".\"):s?M=i(/android[ \\/-](\\d+(\\.\\d+)*)/i):o.webos?M=i(/(?:web|hpw)os\\/(\\d+(\\.\\d+)*)/i):o.blackberry?M=i(/rim\\stablet\\sos\\s(\\d+(\\.\\d+)*)/i):o.bada?M=i(/bada\\/(\\d+(\\.\\d+)*)/i):o.tizen&&(M=i(/tizen[\\/\\s](\\d+(\\.\\d+)*)/i)),M&&(o.osversion=M);var E=!o.windows&&M.split(\".\")[0];return w||u||\"ipad\"==r||s&&(3==E||E>=4&&!T)||o.silk?o.tablet=e:(T||\"iphone\"==r||\"ipod\"==r||s||l||o.blackberry||o.webos||o.bada)&&(o.mobile=e),o.msedge||o.msie&&o.version>=10||o.yandexbrowser&&o.version>=15||o.vivaldi&&o.version>=1||o.chrome&&o.version>=20||o.samsungBrowser&&o.version>=4||o.whale&&1===a([o.version,\"1.0\"])||o.mzbrowser&&1===a([o.version,\"6.0\"])||o.focus&&1===a([o.version,\"1.0\"])||o.firefox&&o.version>=20||o.safari&&o.version>=6||o.opera&&o.version>=10||o.ios&&o.osversion&&o.osversion.split(\".\")[0]>=6||o.blackberry&&o.version>=10.1||o.chromium&&o.version>=20?o.a=e:o.msie&&o.version<10||o.chrome&&o.version<20||o.firefox&&o.version<20||o.safari&&o.version<6||o.opera&&o.version<10||o.ios&&o.osversion&&o.osversion.split(\".\")[0]<6||o.chromium&&o.version<20?o.c=e:o.x=e,o}var i=t(\"undefined\"!=typeof navigator&&navigator.userAgent||\"\");function n(e){return e.split(\".\").length}function o(e,t){var i,n=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(i=0;i=0;){if(i[0][t]>i[1][t])return 1;if(i[0][t]!==i[1][t])return-1;if(0===t)return 0}}function r(e,n,o){var r=i;\"string\"==typeof n&&(o=n,n=void 0),void 0===n&&(n=!1),o&&(r=t(o));var s=\"\"+r.version;for(var l in e)if(e.hasOwnProperty(l)&&r[l]){if(\"string\"!=typeof e[l])throw new Error(\"Browser version in the minVersion map should be a string: \"+l+\": \"+String(e));return a([s,e[l]])<0}return n}return i.test=function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{};return n({touchAction:\"none\"},e)},t.addClassName=c,t.removeClassName=d;var o,a=i(0),r=i(19),s=(o=r)&&o.__esModule?o:{default:o},l=\"\";function u(e,t){return l||(l=(0,a.findInArray)([\"matches\",\"webkitMatchesSelector\",\"mozMatchesSelector\",\"msMatchesSelector\",\"oMatchesSelector\"],(function(t){return(0,a.isFunction)(e[t])}))),!!(0,a.isFunction)(e[l])&&e[l](t)}function c(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp(\"(?:^|\\\\s)\"+t+\"(?!\\\\S)\"))||(e.className+=\" \"+t)}function d(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(\"(?:^|\\\\s)\"+t+\"(?!\\\\S)\",\"g\"),\"\")}},function(e,i){e.exports=t},function(e,t,i){if(\"production\"!==Object({DRAGGABLE_DEBUG:void 0}).NODE_ENV){var n=\"function\"==typeof Symbol&&Symbol.for&&Symbol.for(\"react.element\")||60103;e.exports=i(14)((function(e){return\"object\"==typeof e&&null!==e&&e.$$typeof===n}),!0)}else e.exports=i(17)()},function(e,t,i){\"use strict\";var n=i(1);if(\"production\"!==Object({DRAGGABLE_DEBUG:void 0}).NODE_ENV){var o=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n2?i-2:0),a=2;a: Unmounted during event!\");return t}},function(e,t,i){\"use strict\";(function(e){Object.defineProperty(t,\"__esModule\",{value:!0});var n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],n=!0,o=!1,a=void 0;try{for(var r,s=e[Symbol.iterator]();!(n=(r=s.next()).done)&&(i.push(r.value),!t||i.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return i}(e,t);throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")},o=function(){function e(e,t){for(var i=0;i not mounted on DragStart!\");var i=t.ownerDocument;if(!(o.props.disabled||!(e.target instanceof i.defaultView.Node)||o.props.handle&&!(0,l.matchesSelectorAndParentsTo)(e.target,o.props.handle,t)||o.props.cancel&&(0,l.matchesSelectorAndParentsTo)(e.target,o.props.cancel,t))){var n=(0,l.getTouchIdentifier)(e);o.setState({touchIdentifier:n});var a=(0,u.getControlPosition)(e,n,o);if(null!=a){var r=a.x,c=a.y,p=(0,u.createCoreData)(o,r,c);(0,d.default)(\"DraggableCore: handleDragStart: %j\",p),(0,d.default)(\"calling\",o.props.onStart),!1!==o.props.onStart(e,p)&&(o.props.enableUserSelectHack&&(0,l.addUserSelectStyles)(i),o.setState({dragging:!0,lastX:r,lastY:c}),(0,l.addEvent)(i,f.move,o.handleDrag),(0,l.addEvent)(i,f.stop,o.handleDragStop))}}},o.handleDrag=function(e){\"touchmove\"===e.type&&e.preventDefault();var t=(0,u.getControlPosition)(e,o.state.touchIdentifier,o);if(null!=t){var i=t.x,a=t.y;if(Array.isArray(o.props.grid)){var r=i-o.state.lastX,s=a-o.state.lastY,l=(0,u.snapToGrid)(o.props.grid,r,s),c=n(l,2);if(r=c[0],s=c[1],!r&&!s)return;i=o.state.lastX+r,a=o.state.lastY+s}var p=(0,u.createCoreData)(o,i,a);if((0,d.default)(\"DraggableCore: handleDrag: %j\",p),!1!==o.props.onDrag(e,p))o.setState({lastX:i,lastY:a});else try{o.handleDragStop(new MouseEvent(\"mouseup\"))}catch(e){var m=document.createEvent(\"MouseEvents\");m.initMouseEvent(\"mouseup\",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),o.handleDragStop(m)}}},o.handleDragStop=function(e){if(o.state.dragging){var t=(0,u.getControlPosition)(e,o.state.touchIdentifier,o);if(null!=t){var i=t.x,n=t.y,a=(0,u.createCoreData)(o,i,n),r=s.default.findDOMNode(o);r&&o.props.enableUserSelectHack&&(0,l.removeUserSelectStyles)(r.ownerDocument),(0,d.default)(\"DraggableCore: handleDragStop: %j\",a),o.setState({dragging:!1,lastX:NaN,lastY:NaN}),o.props.onStop(e,a),r&&((0,d.default)(\"DraggableCore: Removing handlers\"),(0,l.removeEvent)(r.ownerDocument,f.move,o.handleDrag),(0,l.removeEvent)(r.ownerDocument,f.stop,o.handleDragStop))}}},o.onMouseDown=function(e){return f=h,o.handleDragStart(e)},o.onMouseUp=function(e){return f=h,o.handleDragStop(e)},o.onTouchStart=function(e){return f=g,o.handleDragStart(e)},o.onTouchEnd=function(e){return f=g,o.handleDragStop(e)},m(o,i)}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:\"componentWillUnmount\",value:function(){var e=s.default.findDOMNode(this);if(e){var t=e.ownerDocument;(0,l.removeEvent)(t,h.move,this.handleDrag),(0,l.removeEvent)(t,g.move,this.handleDrag),(0,l.removeEvent)(t,h.stop,this.handleDragStop),(0,l.removeEvent)(t,g.stop,this.handleDragStop),this.props.enableUserSelectHack&&(0,l.removeUserSelectStyles)(t)}}},{key:\"render\",value:function(){return a.default.cloneElement(a.default.Children.only(this.props.children),{style:(0,l.styleHacks)(this.props.children.props.style),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}]),t}(a.default.Component);b.displayName=\"DraggableCore\",b.propTypes={allowAnyClick:r.default.bool,disabled:r.default.bool,enableUserSelectHack:r.default.bool,offsetParent:function(t,i){if(!0===e.browser&&t[i]&&1!==t[i].nodeType)throw new Error(\"Draggable's offsetParent must be a DOM Node.\")},grid:r.default.arrayOf(r.default.number),handle:r.default.string,cancel:r.default.string,onStart:r.default.func,onDrag:r.default.func,onStop:r.default.func,onMouseDown:r.default.func,className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe},b.defaultProps={allowAnyClick:!1,cancel:null,disabled:!1,enableUserSelectHack:!0,offsetParent:null,handle:null,grid:null,transform:null,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){}},t.default=b}).call(t,i(20))},function(e,t,i){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=function(){}},function(e,t,i){\"use strict\";var n=i(13).default;e.exports=n,e.exports.default=n,e.exports.DraggableCore=i(10).default},function(e,t,i){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=Object.assign||function(e){for(var t=1;t, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.\")}},{key:\"componentDidMount\",value:function(){void 0!==window.SVGElement&&l.default.findDOMNode(this)instanceof window.SVGElement&&this.setState({isElementSVG:!0})}},{key:\"componentWillReceiveProps\",value:function(e){!e.position||this.props.position&&e.position.x===this.props.position.x&&e.position.y===this.props.position.y||this.setState({x:e.position.x,y:e.position.y})}},{key:\"componentWillUnmount\",value:function(){this.setState({dragging:!1})}},{key:\"render\",value:function(){var e,t={},i=null,o=!Boolean(this.props.position)||this.state.dragging,a=this.props.position||this.props.defaultPosition,s={x:(0,d.canDragX)(this)&&o?this.state.x:a.x,y:(0,d.canDragY)(this)&&o?this.state.y:a.y};this.state.isElementSVG?i=(0,c.createSVGTransform)(s):t=(0,c.createCSSTransform)(s);var l=this.props,p=l.defaultClassName,g=l.defaultClassNameDragging,h=l.defaultClassNameDragged,b=r.default.Children.only(this.props.children),y=(0,u.default)(b.props.className||\"\",p,(f(e={},g,this.state.dragging),f(e,h,this.state.dragged),e));return r.default.createElement(m.default,n({},this.props,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),r.default.cloneElement(b,{className:y,style:n({},b.props.style,t),transform:i}))}}]),t}(r.default.Component);b.displayName=\"Draggable\",b.propTypes=n({},m.default.propTypes,{axis:s.default.oneOf([\"both\",\"x\",\"y\",\"none\"]),bounds:s.default.oneOfType([s.default.shape({left:s.default.number,right:s.default.number,top:s.default.number,bottom:s.default.number}),s.default.string,s.default.oneOf([!1])]),defaultClassName:s.default.string,defaultClassNameDragging:s.default.string,defaultClassNameDragged:s.default.string,defaultPosition:s.default.shape({x:s.default.number,y:s.default.number}),position:s.default.shape({x:s.default.number,y:s.default.number}),className:p.dontSetMe,style:p.dontSetMe,transform:p.dontSetMe}),b.defaultProps=n({},m.default.defaultProps,{axis:\"both\",bounds:!1,defaultClassName:\"react-draggable\",defaultClassNameDragging:\"react-draggable-dragging\",defaultClassNameDragged:\"react-draggable-dragged\",defaultPosition:{x:0,y:0},position:null}),t.default=b},function(e,t,i){\"use strict\";var n=i(1),o=i(2),a=i(8),r=i(15),s=i(3),l=i(16);e.exports=function(e,t){var i=\"function\"==typeof Symbol&&Symbol.iterator,u=\"<>\",c={array:g(\"array\"),bool:g(\"boolean\"),func:g(\"function\"),number:g(\"number\"),object:g(\"object\"),string:g(\"string\"),symbol:g(\"symbol\"),any:m(n.thatReturnsNull),arrayOf:function(e){return m((function(t,i,n,o,a){if(\"function\"!=typeof e)return new p(\"Property `\"+a+\"` of component `\"+n+\"` has invalid PropType notation inside arrayOf.\");var r=t[i];if(!Array.isArray(r))return new p(\"Invalid \"+o+\" `\"+a+\"` of type `\"+f(r)+\"` supplied to `\"+n+\"`, expected an array.\");for(var l=0;l0&&void 0!==arguments[0]?arguments[0]:\"transform\";if(\"undefined\"==typeof window||void 0===window.document)return\"\";var t=window.document.documentElement.style;if(e in t)return\"\";for(var i=0;i1)for(var i=1;i div, .contract-trigger:before { content: \" \"; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',n=e.head||e.getElementsByTagName(\"head\")[0],o=e.createElement(\"style\");o.id=\"detectElementResize\",o.type=\"text/css\",null!=t&&o.setAttribute(\"nonce\",t),o.styleSheet?o.styleSheet.cssText=i:o.appendChild(e.createTextNode(i)),n.appendChild(o)}}(o),e.__resizeLast__={},e.__resizeListeners__=[],(e.__resizeTriggers__=o.createElement(\"div\")).className=\"resize-triggers\",e.__resizeTriggers__.innerHTML='
',e.appendChild(e.__resizeTriggers__),l(e),e.addEventListener(\"scroll\",u,!0),p&&(e.__resizeTriggers__.__animationListener__=function(t){t.animationName==b&&l(e)},e.__resizeTriggers__.addEventListener(p,e.__resizeTriggers__.__animationListener__))}e.__resizeListeners__.push(n)}},removeResizeListener:function(e,t){if(a)e.detachEvent(\"onresize\",t);else if(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),!e.__resizeListeners__.length){e.removeEventListener(\"scroll\",u,!0),e.__resizeTriggers__.__animationListener__&&(e.__resizeTriggers__.removeEventListener(p,e.__resizeTriggers__.__animationListener__),e.__resizeTriggers__.__animationListener__=null);try{e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)}catch(e){}}}}}i.d(t,\"a\",(function(){return n}))}).call(this,i(53))},function(e,t){e.exports=\"/static/assets/b3a6f3783f393f641dc3e51211dd50f4.svg\"},function(e,t,i){var n=i(1212);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t){e.exports=\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS43ODQgNS41ODd2Ni4xNGMtLjAxNS40OS0uMzA1LjkwNy0uNzQxIDEuMDhhMS4xNDMgMS4xNDMgMCAwIDEtMS4yNDgtLjI2NWwtMS4xNjQtMS4xNjQtNC44NjYgMy42NzlhMS44ODcgMS44ODcgMCAwIDEtMi42MzktLjM1N2MtLjUxLS42OTktLjUwNC0xLjYzNi4wMDItMi4yOWwzLjY1OC00Ljg3Nkw3LjY3MyA2LjQyYy0uMzQtLjMzOS0uNDQyLS44NC0uMjYyLTEuMjc3YTEuMTQ1IDEuMTQ1IDAgMCAxIDEuMDc3LS43MTFoNi4xNGMuMzA0IDAgLjU5NC4xMjIuODEzLjM0Mi4yMi4yMi4zNDIuNTEuMzQzLjgxM3oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=\"},function(e,t){e.exports=\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDQiIGhlaWdodD0iNDQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsdGVyPSJ1cmwoI2ZpbHRlcjBfZF8yODI4XzI2NDM0KSI+PHJlY3QgeD0iNCIgeT0iNCIgd2lkdGg9IjM2IiBoZWlnaHQ9IjM2IiByeD0iMTgiIGZpbGw9IiNGRjhDMUEiLz48Y2lyY2xlIGN4PSIyMiIgY3k9IjIyIiByPSIxMCIgZmlsbD0iI0ZGOEMxQSIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMjIgMjMuNDI0YTEuNDQgMS40NCAwIDAgMC0xLjQ1MiAxLjQzYzAgLjc5MS42NSAxLjQzMSAxLjQ1MiAxLjQzMWExLjQ0IDEuNDQgMCAwIDAgMS40NTItMS40M2MwLS43OS0uNjUtMS40My0xLjQ1Mi0xLjQzem0uODM0LTEuMzAzYy0uMzcuODE1LTEuMjk4LjgxNS0xLjY2OCAwbC0xLjE4LTIuNTg2Yy0uMzY4LS44MS4wOTQtMS44MjEuODM1LTEuODIxaDIuMzU4Yy43NCAwIDEuMjAzIDEuMDExLjgzNCAxLjgybC0xLjE4IDIuNTg3eiIgZmlsbD0iI2ZmZiIvPjwvZz48ZGVmcz48ZmlsdGVyIGlkPSJmaWx0ZXIwX2RfMjgyOF8yNjQzNCIgeD0iMCIgeT0iMCIgd2lkdGg9IjQ0IiBoZWlnaHQ9IjQ0IiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+PGZlRmxvb2QgZmxvb2Qtb3BhY2l0eT0iMCIgcmVzdWx0PSJCYWNrZ3JvdW5kSW1hZ2VGaXgiLz48ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHZhbHVlcz0iMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMTI3IDAiIHJlc3VsdD0iaGFyZEFscGhhIi8+PGZlTW9ycGhvbG9neSByYWRpdXM9IjQiIG9wZXJhdG9yPSJkaWxhdGUiIGluPSJTb3VyY2VBbHBoYSIgcmVzdWx0PSJlZmZlY3QxX2Ryb3BTaGFkb3dfMjgyOF8yNjQzNCIvPjxmZU9mZnNldC8+PGZlQ29tcG9zaXRlIGluMj0iaGFyZEFscGhhIiBvcGVyYXRvcj0ib3V0Ii8+PGZlQ29sb3JNYXRyaXggdmFsdWVzPSIwIDAgMCAwIDEgMCAwIDAgMCAwLjU0OTAyIDAgMCAwIDAgMC4xMDE5NjEgMCAwIDAgMC4xNSAwIi8+PGZlQmxlbmQgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzI4MjhfMjY0MzQiLz48ZmVCbGVuZCBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJlZmZlY3QxX2Ryb3BTaGFkb3dfMjgyOF8yNjQzNCIgcmVzdWx0PSJzaGFwZSIvPjwvZmlsdGVyPjwvZGVmcz48L3N2Zz4=\"},function(e,t){e.exports=\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDUwLjIgKDU1MDQ3KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5oZWxwPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGRlZnM+PC9kZWZzPgogICAgPGcgaWQ9ImhlbHAiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxwYXRoIGQ9Ik05Ljk5OTA1NDQ5LDE4IEM1LjU4MTYwOTc0LDE4IDIsMTQuNDE3MzQ2MSAyLDEwLjAwMDk0NTMgQzIsNS41ODI2NTM5MSA1LjU4MTYwOTc0LDIgOS45OTkwNTQ0OSwyIEMxNC40MTgzOTAzLDIgMTgsNS41ODI2NTM5MSAxOCwxMC4wMDA5NDUzIEMxOCwxNC40MTczNDYxIDE0LjQxODM5MDMsMTggOS45OTkwNTQ0OSwxOCBaIE05Ljg1MzI1NjEyLDEyLjM2MTUyNjYgQzkuMjY4OTI4MDIsMTIuMzYxNTI2NiA4LjgwNTYyNTgxLDEyLjgzNjA2MjkgOC44MDU2MjU4MSwxMy40MjIxNDM0IEM4LjgwNTYyNTgxLDEzLjk5MzA5OTQgOS4yNjg5MjgwMiwxNC40Njc2MzU2IDkuODUzMjU2MTIsMTQuNDY3NjM1NiBDMTAuNDM5NDc1MiwxNC40Njc2MzU2IDEwLjkxNDEyMzYsMTMuOTkzMDk5NCAxMC45MTQxMjM2LDEzLjQyMjE0MzQgQzEwLjkxNDEyMzYsMTIuODM2MDYyOSAxMC40Mzk0NzUyLDEyLjM2MTUyNjYgOS44NTMyNTYxMiwxMi4zNjE1MjY2IFogTTkuNDYxODEzMDIsMTEuNjQzMTA1MyBMMTAuMTU5NjAyOSwxMS42NDMxMDUzIEMxMC4zNDg3MDU4LDExLjY0MzEwNTMgMTAuNTI0NTcxNiwxMS41MjM5OTg2IDEwLjU2OTk1NjMsMTEuMzQwNjEyMSBDMTAuNjU4ODM0NywxMC45NzAwNTc5IDEwLjkxNDEyMzYsMTAuNzE2NzE5OCAxMS4yNTQ1MDg5LDEwLjQ2MTQ5MTIgTDExLjcxNTkyMDEsMTAuMTIxMTg2MyBDMTIuNDQ1ODU3NSw5LjU3MjkxNzQxIDEyLjg5NzgxMzUsOC45MDU1NDE3NyAxMi44OTc4MTM1LDcuOTMwMDAxMTggQzEyLjg5NzgxMzUsNi43MTQzNTY2MSAxMS45MTA2OTYxLDUuNTMyNzQyNTMgOS45MzgzNTI0NCw1LjUzMjc0MjUzIEM4LjE2MDc4NDc4LDUuNTMyNzQyNTMgNy4xMDE4MDgzLDYuNzM3MDQzNiA3LjEwMTgwODMsOC4xNjA2NTIyNSBDNy4xMDE4MDgzLDguMTk4NDYzOSA3LjEwMzY5OTMzLDguMjM2Mjc1NTUgNy4xMDM2OTkzMyw4LjI3NTk3Nzc5IEM3LjExMzE1NDQ3LDguNDk3MTc1OTQgNy4yODkwMjAyMSw4LjY3ODY3MTg3IDcuNTEwMjcwNjUsOC42ODYyMzQyIEw4LjM4MzkyNjI1LDguNzE2NDgzNTIgQzguNjI0MDg2OTksOC43MjU5MzY0MyA4LjgxODg2MzAyLDguNTMzMDk3MDEgOC44MTg4NjMwMiw4LjI5Mjk5MzAzIEw4LjgxODg2MzAyLDguMjgzNTQwMTIgQzguODE4ODYzMDIsNy43MTI1ODQxOSA5LjIzMjk5ODQ2LDcuMTM5NzM3NjggOS45MzgzNTI0NCw3LjEzOTczNzY4IEMxMC42NzAxODA4LDcuMTM5NzM3NjggMTEuMDIxOTEyMyw3LjYwMTAzOTgyIDExLjAyMTkxMjMsOC4wNzU1NzYwNCBDMTEuMDIxOTEyMyw4LjM5MzE5MzkgMTAuOTE0MTIzNiw4LjY4NjIzNDIgMTAuNTg1MDg0NSw4LjkzMDExOTM0IEw5Ljk2NDgyNjg1LDkuMzkzMzEyMDYgQzkuMjY4OTI4MDIsOS45MTUxMTI4NCA5LjAzNjMzMTQsMTAuNTM1MjIzOSA5LjAzNjMzMTQsMTEuMTA4MDcwNCBDOS4wMzYzMzE0LDExLjE1MTU1MzggOS4wMzgyMjI0MywxMS4xOTUwMzcyIDkuMDM4MjIyNDMsMTEuMjM0NzM5NSBDOS4wNDU3ODY1NSwxMS40NjM0OTk5IDkuMjMyOTk4NDYsMTEuNjQzMTA1MyA5LjQ2MTgxMzAyLDExLjY0MzEwNTMgWiIgaWQ9ImhlbHAtaWNvbiIgZmlsbD0iI0ZGRkZGRiI+PC9wYXRoPgogICAgPC9nPgo8L3N2Zz4=\"},function(e,t){e.exports=\"/static/assets/5b36d8cf15d803226e2fe4c0737be43f.svg\"},function(e,t,i){var n=i(1013);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1018);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1022);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1029);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1045);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1050);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1051);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1070);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1073);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1076);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1086);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1103);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1211);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1219);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){var n=i(1229);\"string\"==typeof n&&(n=[[e.i,n,\"\"]]);var o={hmr:!0,transform:undefined,insertInto:void 0};i(10)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,i){\"use strict\";(function(e){i.d(t,\"a\",(function(){return I})),i.d(t,\"b\",(function(){return _}));var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};function o(e,t){function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}function a(e,t,i,n){return new(i||(i=Promise))((function(o,a){function r(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,s)}l((n=n.apply(e,t||[])).next())}))}function r(e,t){var i,n,o,a,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},\"function\"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(i)throw new TypeError(\"Generator is already executing.\");for(;r;)try{if(i=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,n=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0&&r.length>o){r.warned=!0;var c=new Error(\"Possible EventEmitter memory leak detected. \"+r.length+\" \"+t+\" listeners added. Use emitter.setMaxListeners() to increase limit\");c.name=\"MaxListenersExceededWarning\",c.emitter=e,c.type=t,c.count=r.length,l=c,\"function\"==typeof console.warn?console.warn(l):console.log(l)}}else r=a[t]=i,++e._eventsCount;return e}function f(e,t,i){var n=!1;function o(){e.removeListener(t,o),n||(n=!0,i.apply(e,arguments))}return o.listener=i,o}function b(e){var t=this._events;if(t){var i=t[e];if(\"function\"==typeof i)return 1;if(i)return i.length}return 0}function y(e,t){for(var i=new Array(t);t--;)i[t]=e[t];return i}s.prototype=Object.create(null),l.EventEmitter=l,l.usingDomains=!1,l.prototype.domain=void 0,l.prototype._events=void 0,l.prototype._maxListeners=void 0,l.defaultMaxListeners=10,l.init=function(){this.domain=null,l.usingDomains&&(void 0).active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new s,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},l.prototype.setMaxListeners=function(e){if(\"number\"!=typeof e||e<0||isNaN(e))throw new TypeError('\"n\" argument must be a positive number');return this._maxListeners=e,this},l.prototype.getMaxListeners=function(){return u(this)},l.prototype.emit=function(e){var t,i,n,o,a,r,s,l=\"error\"===e;if(r=this._events)l=l&&null==r.error;else if(!l)return!1;if(s=this.domain,l){if(t=arguments[1],!s){if(t instanceof Error)throw t;var u=new Error('Uncaught, unspecified \"error\" event. ('+t+\")\");throw u.context=t,u}return t||(t=new Error('Uncaught, unspecified \"error\" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit(\"error\",t),!1}if(!(i=r[e]))return!1;var h=\"function\"==typeof i;switch(n=arguments.length){case 1:c(i,h,this);break;case 2:d(i,h,this,arguments[1]);break;case 3:p(i,h,this,arguments[1],arguments[2]);break;case 4:m(i,h,this,arguments[1],arguments[2],arguments[3]);break;default:for(o=new Array(n-1),a=1;a0;)if(i[a]===t||i[a].listener&&i[a].listener===t){r=i[a].listener,o=a;break}if(o<0)return this;if(1===i.length){if(i[0]=void 0,0==--this._eventsCount)return this._events=new s,this;delete n[e]}else!function(e,t){for(var i=t,n=i+1,o=e.length;n0?Reflect.ownKeys(this._events):[]};var v,k=function(){function e(){this.locked=!1}return e.prototype.lock=function(){return a(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return this.locked?[4,new Promise((function(e){return setTimeout(e,1)}))]:[3,2];case 1:return e.sent(),[3,0];case 2:return this.locked=!0,[2]}}))}))},e.prototype.unlock=function(){this.locked=!1},e}(),w=function(e){function t(t,i,n){void 0===i&&(i=0),void 0===n&&(n=1e7);var o=e.call(this)||this;o.transport=t,o.mode=i,o.clockFrequency=n,o.connected=!1,o.sendMutex=new k,o.blockSize=o.transport.packetSize-4-1;var a=o.transport.packetSize-2-1;return o.operationCount=Math.floor(a/5),o}return o(t,e),t.prototype.bufferSourceToUint8Array=function(e,t){if(!t)return new Uint8Array([e]);var i=void 0!==t.buffer?t.buffer:t,n=new Uint8Array(i.byteLength+1);return n.set([e]),n.set(new Uint8Array(i),1),n},t.prototype.selectProtocol=function(e){return a(this,void 0,void 0,(function(){var t;return r(this,(function(i){switch(i.label){case 0:return t=2===e?59196:59294,[4,this.swjSequence(new Uint8Array([255,255,255,255,255,255,255]))];case 1:return i.sent(),[4,this.swjSequence(new Uint16Array([t]))];case 2:return i.sent(),[4,this.swjSequence(new Uint8Array([255,255,255,255,255,255,255]))];case 3:return i.sent(),[4,this.swjSequence(new Uint8Array([0]))];case 4:return i.sent(),[2]}}))}))},t.prototype.send=function(e,t){return a(this,void 0,void 0,(function(){var i,n;return r(this,(function(o){switch(o.label){case 0:return i=this.bufferSourceToUint8Array(e,t),[4,this.sendMutex.lock()];case 1:o.sent(),o.label=2;case 2:return o.trys.push([2,,5,6]),[4,this.transport.write(i)];case 3:return o.sent(),[4,this.transport.read()];case 4:if((n=o.sent()).getUint8(0)!==e)throw new Error(\"Bad response for \"+e+\" -> \"+n.getUint8(0));switch(e){case 3:case 8:case 9:case 10:case 17:case 18:case 19:case 29:case 23:case 24:case 26:case 21:case 22:case 4:if(0!==n.getUint8(1))throw new Error(\"Bad status for \"+e+\" -> \"+n.getUint8(1))}return[2,n];case 5:return this.sendMutex.unlock(),[7];case 6:return[2]}}))}))},t.prototype.clearAbort=function(e){return void 0===e&&(e=30),a(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.send(8,new Uint8Array([0,e]))];case 1:return t.sent(),[2]}}))}))},t.prototype.dapInfo=function(e){return a(this,void 0,void 0,(function(){var t,i,n,o;return r(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,4]),[4,this.send(0,new Uint8Array([e]))];case 1:if(t=a.sent(),0===(i=t.getUint8(1)))return[2,\"\"];switch(e){case 240:case 254:case 255:case 253:if(1===i)return[2,t.getUint8(2)];if(2===i)return[2,t.getUint16(2)];if(4===i)return[2,t.getUint32(2)]}return n=Array.prototype.slice.call(new Uint8Array(t.buffer,2,i)),[2,String.fromCharCode.apply(null,n)];case 2:return o=a.sent(),[4,this.clearAbort()];case 3:throw a.sent(),o;case 4:return[2]}}))}))},t.prototype.swjSequence=function(e,t){return void 0===t&&(t=8*e.byteLength),a(this,void 0,void 0,(function(){var i,n;return r(this,(function(o){switch(o.label){case 0:i=this.bufferSourceToUint8Array(t,e),o.label=1;case 1:return o.trys.push([1,3,,5]),[4,this.send(18,i)];case 2:return o.sent(),[3,5];case 3:return n=o.sent(),[4,this.clearAbort()];case 4:throw o.sent(),n;case 5:return[2]}}))}))},t.prototype.swjClock=function(e){return a(this,void 0,void 0,(function(){var t;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,4]),[4,this.send(17,new Uint8Array([255&e,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24]))];case 1:return i.sent(),[3,4];case 2:return t=i.sent(),[4,this.clearAbort()];case 3:throw i.sent(),t;case 4:return[2]}}))}))},t.prototype.swjPins=function(e,t,i){return a(this,void 0,void 0,(function(){var n;return r(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,4]),[4,this.send(16,new Uint8Array([e,t,255&i,(65280&i)>>8,(16711680&i)>>16,(4278190080&i)>>24]))];case 1:return[2,o.sent().getUint8(1)];case 2:return n=o.sent(),[4,this.clearAbort()];case 3:throw o.sent(),n;case 4:return[2]}}))}))},t.prototype.dapDelay=function(e){return a(this,void 0,void 0,(function(){var t;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,4]),[4,this.send(9,new Uint8Array([255&e,(65280&e)>>8]))];case 1:return i.sent(),[3,4];case 2:return t=i.sent(),[4,this.clearAbort()];case 3:throw i.sent(),t;case 4:return[2]}}))}))},t.prototype.configureTransfer=function(e,t,i){return a(this,void 0,void 0,(function(){var n,o,a;return r(this,(function(r){switch(r.label){case 0:n=new Uint8Array(5),(o=new DataView(n.buffer)).setUint8(0,e),o.setUint16(1,t,!0),o.setUint16(3,i,!0),r.label=1;case 1:return r.trys.push([1,3,,5]),[4,this.send(4,n)];case 2:return r.sent(),[3,5];case 3:return a=r.sent(),[4,this.clearAbort()];case 4:throw r.sent(),a;case 5:return[2]}}))}))},t.prototype.connect=function(){return a(this,void 0,void 0,(function(){var e,t,i;return r(this,(function(n){switch(n.label){case 0:return!0===this.connected?[2]:[4,this.transport.open()];case 1:n.sent(),n.label=2;case 2:return n.trys.push([2,5,,8]),[4,this.send(17,new Uint32Array([this.clockFrequency]))];case 3:return n.sent(),[4,this.send(2,new Uint8Array([this.mode]))];case 4:if(0===(e=n.sent()).getUint8(1)||0!==this.mode&&e.getUint8(1)!==this.mode)throw new Error(\"Mode not enabled.\");return[3,8];case 5:return t=n.sent(),[4,this.clearAbort()];case 6:return n.sent(),[4,this.transport.close()];case 7:throw n.sent(),t;case 8:return n.trys.push([8,11,,13]),[4,this.configureTransfer(0,100,0)];case 9:return n.sent(),[4,this.selectProtocol(1)];case 10:return n.sent(),[3,13];case 11:return i=n.sent(),[4,this.transport.close()];case 12:throw n.sent(),i;case 13:return this.connected=!0,[2]}}))}))},t.prototype.disconnect=function(){return a(this,void 0,void 0,(function(){var e;return r(this,(function(t){switch(t.label){case 0:if(!1===this.connected)return[2];t.label=1;case 1:return t.trys.push([1,3,,5]),[4,this.send(3)];case 2:return t.sent(),[3,5];case 3:return e=t.sent(),[4,this.clearAbort()];case 4:throw t.sent(),e;case 5:return[4,this.transport.close()];case 6:return t.sent(),this.connected=!1,[2]}}))}))},t.prototype.reconnect=function(){return a(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.disconnect()];case 1:return e.sent(),[4,new Promise((function(e){return setTimeout(e,100)}))];case 2:return e.sent(),[4,this.connect()];case 3:return e.sent(),[2]}}))}))},t.prototype.reset=function(){return a(this,void 0,void 0,(function(){var e;return r(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,4]),[4,this.send(10)];case 1:return[2,1===t.sent().getUint8(2)];case 2:return e=t.sent(),[4,this.clearAbort()];case 3:throw t.sent(),e;case 4:return[2]}}))}))},t.prototype.transfer=function(e,t,i,n){return void 0===t&&(t=2),void 0===i&&(i=0),void 0===n&&(n=0),a(this,void 0,void 0,(function(){var o,a,s,l,u,c,d;return r(this,(function(r){switch(r.label){case 0:o=\"number\"==typeof e?[{port:e,mode:t,register:i,value:n}]:e,a=new Uint8Array(2+5*o.length),(s=new DataView(a.buffer)).setUint8(0,0),s.setUint8(1,o.length),o.forEach((function(e,t){var i=2+5*t;s.setUint8(i,e.port|e.mode|e.register),s.setUint32(i+1,e.value||0,!0)})),r.label=1;case 1:return r.trys.push([1,3,,5]),[4,this.send(5,a)];case 2:if((l=r.sent()).getUint8(1)!==o.length)throw new Error(\"Transfer count mismatch\");if(2===(u=l.getUint8(2)))throw new Error(\"Transfer response WAIT\");if(4===u)throw new Error(\"Transfer response FAULT\");if(8===u)throw new Error(\"Transfer response PROTOCOL_ERROR\");if(16===u)throw new Error(\"Transfer response VALUE_MISMATCH\");if(7===u)throw new Error(\"Transfer response NO_ACK\");return\"number\"==typeof e?[2,l.getUint32(3,!0)]:(c=4*o.length,[2,new Uint32Array(l.buffer.slice(3,3+c))]);case 3:return d=r.sent(),[4,this.clearAbort()];case 4:throw r.sent(),d;case 5:return[2]}}))}))},t.prototype.transferBlock=function(e,t,i){return a(this,void 0,void 0,(function(){var n,o,a,s,l,u,c,d;return r(this,(function(r){switch(r.label){case 0:a=4,\"number\"==typeof i?(n=i,o=2):(n=i.length,o=0,a+=i.byteLength),s=new Uint8Array(a),(l=new DataView(s.buffer)).setUint8(0,0),l.setUint16(1,n,!0),l.setUint8(3,e|o|t),\"number\"!=typeof i&&i.forEach((function(e,t){var i=4+4*t;l.setUint32(i,e,!0)})),r.label=1;case 1:return r.trys.push([1,3,,5]),[4,this.send(6,l)];case 2:if((u=r.sent()).getUint16(1,!0)!==n)throw new Error(\"Transfer count mismatch\");if(2===(c=u.getUint8(3)))throw new Error(\"Transfer response WAIT\");if(4===c)throw new Error(\"Transfer response FAULT\");if(8===c)throw new Error(\"Transfer response PROTOCOL_ERROR\");if(7===c)throw new Error(\"Transfer response NO_ACK\");return\"number\"==typeof i?[2,new Uint32Array(u.buffer.slice(4,4+4*n))]:[3,5];case 3:return d=r.sent(),[4,this.clearAbort()];case 4:throw r.sent(),d;case 5:return[2,void 0]}}))}))},t}(l),T=/[\\xc0-\\xff][\\x80-\\xbf]*$/g,S=/[\\xc0-\\xff][\\x80-\\xbf]*/g,M=function(){function e(){}return e.prototype.decode=function(e){var t=Array.prototype.slice.call(new Uint8Array(e)),i=String.fromCodePoint.apply(void 0,t);this.partialChar&&(i=\"\"+this.partialChar+i,this.partialChar=void 0);var n=i.match(T);if(n){var o=n[0].length;this.partialChar=i.slice(-o),i=i.slice(0,-o)}return i.replace(S,this.decoderReplacer)},e.prototype.decoderReplacer=function(e){var t=e.codePointAt(0)<<24,i=Math.clz32(~t),n=0,o=e.length,a=\"\";if(i<5&&o>=i){for(t=t<>>24+i,n=1;n>10),56320+(1023&t))):n=0}for(;n0&&setTimeout((function(){if(n)throw n=!1,new Error(\"Wait timed out\")}),t),o.label=1;case 1:return n?[4,e()]:[3,5];case 2:return!0===o.sent()?(n=!1,[2]):i>0?[4,new Promise((function(e){return setTimeout(e,t)}))]:[3,4];case 3:o.sent(),o.label=4;case 4:return[3,1];case 5:return[2]}}))}))},e.prototype.concatTypedArray=function(e){if(1===e.length)return e[0];for(var t=0,i=0,n=e;i0?(o=Math.min(n,Math.floor(this.proxy.blockSize/4)),[4,this.proxy.transferBlock(1,12,o)]):[3,4];case 3:return a=r.sent(),i.push(a),n-=o,[3,2];case 4:return[2,this.concatTypedArray(i)]}}))}))},e.prototype.writeBlock=function(e,t){return a(this,void 0,void 0,(function(){var i,n;return r(this,(function(o){switch(o.label){case 0:return[4,this.transferSequence([this.writeAPCommand(0,587202642),this.writeAPCommand(4,e)])];case 1:o.sent(),i=0,o.label=2;case 2:return i0})))||(t=e[0]),this.interfaceNumber=t.interfaceNumber,!this.alwaysControlTransfer){for(i=t.endpoints,this.endpointIn=void 0,this.endpointOut=void 0,n=0,o=i;n0})))||(t=e[0]),this.interfaceNumber=t.interfaceNumber,!this.alwaysControlTransfer)for(i=t.alternates[0].endpoints,this.endpointIn=void 0,this.endpointOut=void 0,n=0,o=i;n0&&(this._lastUpdateTime=e),this._count=Math.min(this._maxTokens,this._count+i),this._count>0&&(this._count--,!0)}}},function(e,t,i){(function(t){let i=t.fetch;e.exports={fetchWithTimeout:(e,t,n)=>{let o=null;const a=window.AbortController?new window.AbortController:null,r=a?a.signal:null;return Promise.race([i(e,Object.assign({signal:r},t)).then((e=>(clearTimeout(o),e)),(e=>{throw clearTimeout(o),e})),new Promise(((e,t)=>{o=setTimeout((()=>{a&&a.abort(),t(new Error(\"Fetch timed out after \".concat(n,\" ms\")))}),n)}))])},setFetch:e=>{i=e}}}).call(this,i(53))},function(e,t,i){function n(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function o(e,t,i){return(t=function(e){var t=function(e,t){if(\"object\"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||\"default\");if(\"object\"!=typeof n)return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(\"string\"===t?String:Number)(e)}(e,\"string\");return\"symbol\"==typeof t?t:t+\"\"}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const a=i(145),r=i(368),s=i(1256),l=i(58),u=i(147),c=i(379),d=i(45),p=i(822),m=i(823),g=i(224),h=i(297),f=i(382),b=i(289),y=i(165),v=i(38),k=i(362),w=i(123),T=i(114),S=i(223),M=i(830),E=i(831),I=i(292),x=i(833),_=i(834),O=i(835),C=i(836),N=i(837),A=i(838),P=i(839),D=i(840),L=i(841),R=i(383),j=i(87),z=i(107),B={scratch3_control:i(842),scratch3_event:i(843),scratch3_looks:i(844),scratch3_motion:i(845),scratch3_operators:i(846),scratch3_sound:i(847),scratch3_sensing:i(848),scratch3_data:i(849),scratch3_procedures:i(850)},U=i(851),F=i(852),H=i(192),G=[\"#0FBD8C\",\"#0DA57A\",\"#0B8E69\"],W=\" // _twconfig_\",V=(()=>{const e={};return e[l.ANGLE]={shadow:{type:\"math_angle\",fieldName:\"NUM\"}},e[l.COLOR]={shadow:{type:\"colour_picker\",fieldName:\"COLOUR\"}},e[l.NUMBER]={shadow:{type:\"math_number\",fieldName:\"NUM\"}},e[l.STRING]={shadow:{type:\"text\",fieldName:\"TEXT\"}},e[l.BOOLEAN]={check:\"Boolean\"},e[l.MATRIX]={shadow:{type:\"matrix\",fieldName:\"MATRIX\"}},e[l.NOTE]={shadow:{type:\"note\",fieldName:\"NOTE\"}},e[l.IMAGE]={fieldType:\"field_image\"},e[l.COSTUME]={shadow:{type:\"looks_costume\",fieldName:\"COSTUME\"}},e[l.SOUND]={shadow:{type:\"sound_sounds_menu\",fieldName:\"SOUND_MENU\"}},e})(),q=e=>{let t=0;return{canAddCloudVariable:()=>t{t++},removeCloudVariable:()=>{t--},hasCloudVariables:()=>t>0,getNumberOfCloudVariables:()=>t}};let Y=-1,Z=-1,K=-1;class Q extends a{constructor(){super(),this.targets=[],this.executableTargets=[],this.threads=[],this.threadMap=new Map,this.sequencer=new m(this),this.flyoutBlocks=new u(this,!0),this.monitorBlocks=new u(this,!0),this._editingTarget=null,this._primitives={},this._blockInfo=[],this._hats={},this._flowing={},this._scriptGlowsPreviousFrame=[],this._nonMonitorThreadCount=0,this._lastStepDoneThreads=null,this._cloneCounter=0,this._refreshTargets=!1,this.monitorBlockInfo={},this._monitorState=new O,this.turboMode=!1,this.frameLoop=new F(this),this.currentStepTime=1e3/30,this.updateCurrentMSecs(),this.redrawRequested=!1,this._registerBlockPackages(),this.ioDevices={clock:new C(this),cloud:new N(this),keyboard:new A(this),mouse:new P(this),mouseWheel:new D(this),userData:new L,video:new R(this)},this.peripheralExtensions={},this.profiler=null,this.cloudOptions={limit:10};const e=q(this.cloudOptions);this.hasCloudData=e.hasCloudVariables,this.canAddCloudVariable=e.canAddCloudVariable,this.getNumberOfCloudVariables=e.getNumberOfCloudVariables,this.addCloudVariable=this._initializeAddCloudVariable(e),this.removeCloudVariable=this._initializeRemoveCloudVariable(e),this.origin=null,this.platform=Object.assign({},x),this._initScratchLink(),this.resetRunId(),this._stageTarget=null,this.addonBlocks={},this.stageWidth=Q.STAGE_WIDTH,this.stageHeight=Q.STAGE_HEIGHT,this.runtimeOptions={maxClones:Q.MAX_CLONES,miscLimits:!0,fencing:!0},this.compilerOptions={enabled:!0,warpTimer:!1},this.debug=!1,this._lastStepTime=Date.now(),this.interpolationEnabled=!1,this._defaultStoredSettings=this._generateAllProjectOptions(),this.isPackaged=!1,this.externalCommunicationMethods={cloudVariables:!1,customExtensions:!1},this.on(Q.HAS_CLOUD_DATA_UPDATE,(e=>{this.setExternalCommunicationMethod(\"cloudVariables\",e)})),this.enforcePrivacy=!0,this.privacyRestrictionsActive=!1,this.extensionButtons=new Map,this.fontManager=new E(this),this.extensionStorage={},this.totalAssetRequests=0,this.finishedAssetRequests=0}static get STAGE_WIDTH(){return 480}static get STAGE_HEIGHT(){return 360}static get SCRIPT_GLOW_ON(){return\"SCRIPT_GLOW_ON\"}static get SCRIPT_GLOW_OFF(){return\"SCRIPT_GLOW_OFF\"}static get BLOCK_GLOW_ON(){return\"BLOCK_GLOW_ON\"}static get BLOCK_GLOW_OFF(){return\"BLOCK_GLOW_OFF\"}static get HAS_CLOUD_DATA_UPDATE(){return\"HAS_CLOUD_DATA_UPDATE\"}static get TURBO_MODE_ON(){return\"TURBO_MODE_ON\"}static get TURBO_MODE_OFF(){return\"TURBO_MODE_OFF\"}static get RUNTIME_OPTIONS_CHANGED(){return\"RUNTIME_OPTIONS_CHANGED\"}static get COMPILER_OPTIONS_CHANGED(){return\"COMPILER_OPTIONS_CHANGED\"}static get FRAMERATE_CHANGED(){return\"FRAMERATE_CHANGED\"}static get INTERPOLATION_CHANGED(){return\"INTERPOLATION_CHANGED\"}static get STAGE_SIZE_CHANGED(){return\"STAGE_SIZE_CHANGED\"}static get COMPILE_ERROR(){return\"COMPILE_ERROR\"}static get BEFORE_EXECUTE(){return\"BEFORE_EXECUTE\"}static get AFTER_EXECUTE(){return\"AFTER_EXECUTE\"}static get ASSET_PROGRESS(){return\"ASSET_PROGRESS\"}static get PROJECT_START(){return\"PROJECT_START\"}static get PROJECT_RUN_START(){return\"PROJECT_RUN_START\"}static get PROJECT_RUN_STOP(){return\"PROJECT_RUN_STOP\"}static get PROJECT_STOP_ALL(){return\"PROJECT_STOP_ALL\"}static get STOP_FOR_TARGET(){return\"STOP_FOR_TARGET\"}static get VISUAL_REPORT(){return\"VISUAL_REPORT\"}static get PROJECT_LOADED(){return\"PROJECT_LOADED\"}static get PROJECT_CHANGED(){return\"PROJECT_CHANGED\"}static get TOOLBOX_EXTENSIONS_NEED_UPDATE(){return\"TOOLBOX_EXTENSIONS_NEED_UPDATE\"}static get TARGETS_UPDATE(){return\"TARGETS_UPDATE\"}static get MONITORS_UPDATE(){return\"MONITORS_UPDATE\"}static get BLOCK_DRAG_UPDATE(){return\"BLOCK_DRAG_UPDATE\"}static get BLOCK_DRAG_END(){return\"BLOCK_DRAG_END\"}static get EXTENSION_ADDED(){return\"EXTENSION_ADDED\"}static get EXTENSION_FIELD_ADDED(){return\"EXTENSION_FIELD_ADDED\"}static get PERIPHERAL_LIST_UPDATE(){return\"PERIPHERAL_LIST_UPDATE\"}static get USER_PICKED_PERIPHERAL(){return\"USER_PICKED_PERIPHERAL\"}static get PERIPHERAL_CONNECTED(){return\"PERIPHERAL_CONNECTED\"}static get PERIPHERAL_DISCONNECTED(){return\"PERIPHERAL_DISCONNECTED\"}static get PERIPHERAL_REQUEST_ERROR(){return\"PERIPHERAL_REQUEST_ERROR\"}static get PERIPHERAL_CONNECTION_LOST_ERROR(){return\"PERIPHERAL_CONNECTION_LOST_ERROR\"}static get PERIPHERAL_SCAN_TIMEOUT(){return\"PERIPHERAL_SCAN_TIMEOUT\"}static get MIC_LISTENING(){return\"MIC_LISTENING\"}static get BLOCKSINFO_UPDATE(){return\"BLOCKSINFO_UPDATE\"}static get RUNTIME_STARTED(){return\"RUNTIME_STARTED\"}static get RUNTIME_STOPPED(){return\"RUNTIME_STOPPED\"}static get RUNTIME_DISPOSED(){return\"RUNTIME_DISPOSED\"}static get BLOCKS_NEED_UPDATE(){return\"BLOCKS_NEED_UPDATE\"}static get PLATFORM_MISMATCH(){return\"PLATFORM_MISMATCH\"}static get THREAD_STEP_INTERVAL(){return 1e3/60}static get THREAD_STEP_INTERVAL_COMPATIBILITY(){return 1e3/30}static get MAX_CLONES(){return 300}_initializeAddCloudVariable(e){return()=>{const t=this.hasCloudData();e.addCloudVariable(),!t&&this.hasCloudData()&&this.emit(Q.HAS_CLOUD_DATA_UPDATE,!0)}}_initializeRemoveCloudVariable(e){return()=>{const t=this.hasCloudData();e.removeCloudVariable(),t&&!this.hasCloudData()&&this.emit(Q.HAS_CLOUD_DATA_UPDATE,!1)}}_registerBlockPackages(){for(const e in B)if(Object.prototype.hasOwnProperty.call(B,e)){const t=new B[e](this);if(t.getPrimitives){const e=t.getPrimitives();for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(this._primitives[i]=e[i].bind(t))}if(t.getHats){const e=t.getHats();for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this._hats[t]=e[t])}t.getMonitored&&(this.monitorBlockInfo=Object.assign({},this.monitorBlockInfo,t.getMonitored())),this.compilerRegisterExtension(e,t)}}compilerRegisterExtension(e,t){this[\"ext_\".concat(e)]=t}getMonitorState(){return this._monitorState}_makeExtensionMenuId(e,t){return\"\".concat(t,\"_menu_\").concat(e)}makeMessageContextForTarget(e){const t={};(e=e||this.getEditingTarget()||this.getTargetForStage())&&(t.targetType=e.isStage?b.STAGE:b.SPRITE)}_registerExtensionPrimitives(e){const t={id:e.id,name:k(e.name),showStatusButton:e.showStatusButton,blockIconURI:e.blockIconURI,menuIconURI:e.menuIconURI};e.color1?(t.color1=e.color1,t.color2=e.color2,t.color3=e.color3):(t.color1=G[0],t.color2=G[1],t.color3=G[2]),this._blockInfo.push(t),this._fillExtensionCategory(t,e);for(const i in t.customFieldTypes)if(Object.prototype.hasOwnProperty.call(e.customFieldTypes,i)){const e=t.customFieldTypes[i];this.emit(Q.EXTENSION_FIELD_ADDED,{name:\"field_\".concat(e.extendedName),implementation:e.fieldImplementation})}this.emit(Q.EXTENSION_ADDED,t)}_refreshExtensionPrimitives(e){const t=this._blockInfo.find((t=>t.id===e.id));t&&(t.name=k(e.name),this._fillExtensionCategory(t,e),this.emit(Q.BLOCKSINFO_UPDATE,t))}_fillExtensionCategory(e,t){e.blocks=[],e.customFieldTypes={},e.menus=[],e.menuInfo={};for(const i in t.menus)if(Object.prototype.hasOwnProperty.call(t.menus,i)){const n=t.menus[i],o=this._buildMenuForScratchBlocks(i,n,e);e.menus.push(o),e.menuInfo[i]=n}for(const i in t.customFieldTypes)if(Object.prototype.hasOwnProperty.call(t.customFieldTypes,i)){const n=t.customFieldTypes[i],o=this._buildCustomFieldInfo(i,n,t.id,e);e.customFieldTypes[i]=o}if(t.docsURI){const i={info:{},xml:\"')};e.blocks.push(i)}for(const i of t.blocks)try{const t=this._convertForScratchBlocks(i,e);if(e.blocks.push(t),t.json){const e=t.json.type;i.blockType!==d.EVENT&&(this._primitives[e]=t.info.func),i.blockType===d.EVENT||i.blockType===d.HAT?this._hats[e]={edgeActivated:i.isEdgeActivated,restartExistingThreads:i.shouldRestartExistingThreads}:i.blockType===d.CONDITIONAL?this._flowing[e]={conditional:!0,loop:!1}:i.blockType===d.LOOP&&(this._flowing[e]={conditional:!1,loop:!0})}}catch(e){v.error(\"Error parsing block: \",{block:i,error:e})}}_convertMenuItems(e){if(\"function\"!=typeof e){const t=this.makeMessageContextForTarget();return e.map((e=>{const i=k(e,t);switch(typeof i){case\"string\":return[i,i];case\"object\":return[k(e.text,t),e.value];default:throw new Error(\"Can't interpret menu item: \".concat(JSON.stringify(e)))}}))}return e}_buildMenuForScratchBlocks(e,t,i){const n=this._makeExtensionMenuId(e,i.id),o=this._convertMenuItems(t.items);return{json:{message0:\"%1\",type:n,inputsInline:!0,output:\"String\",colour:i.color1,colourSecondary:i.color2,colourTertiary:i.color3,outputShape:t.acceptReporters?f.OUTPUT_SHAPE_ROUND:f.OUTPUT_SHAPE_SQUARE,args0:[{type:\"field_dropdown\",name:e,options:o}]}}}_buildCustomFieldInfo(e,t,i,n){const o=\"\".concat(i,\"_\").concat(e);return{fieldName:e,extendedName:o,argumentTypeInfo:{shadow:{type:o,fieldName:\"field_\".concat(o)}},scratchBlocksDefinition:this._buildCustomFieldTypeForScratchBlocks(o,t.output,t.outputShape,n),fieldImplementation:t.implementation}}_buildCustomFieldTypeForScratchBlocks(e,t,i,n){return{json:{type:e,message0:\"%1\",inputsInline:!0,output:t,colour:n.color1,colourSecondary:n.color2,colourTertiary:n.color3,outputShape:i,args0:[{name:\"field_\".concat(e),type:\"field_\".concat(e)}]}}}_convertForScratchBlocks(e,t){return\"---\"===e?this._convertSeparatorForScratchBlocks(e):e.blockType===d.LABEL?this._convertLabelForScratchBlocks(e):e.blockType===d.BUTTON?this._convertButtonForScratchBlocks(e,t):e.blockType===d.XML?this._convertXmlForScratchBlocks(e):this._convertBlockForScratchBlocks(e,t)}_convertBlockForScratchBlocks(e,t){var i,n,o;const a=\"\".concat(t.id,\"_\").concat(e.opcode),r={type:a,inputsInline:!0,category:t.name,extensions:[],colour:null!==(i=e.color1)&&void 0!==i?i:t.color1,colourSecondary:null!==(n=e.color2)&&void 0!==n?n:t.color2,colourTertiary:null!==(o=e.color3)&&void 0!==o?o:t.color3},s={argsMap:{},blockJSON:r,categoryInfo:t,blockInfo:e,inputList:[]},l=e.blockIconURI||t.blockIconURI;if(r.extensions.push(\"from_extension\"),r.colour===G[0]&&r.colourSecondary===G[1]&&r.colourTertiary===G[2]&&r.extensions.push(\"default_extension_colors\"),l){r.extensions.push(\"scratch_extension\"),r.message0=\"%1 %2\";const e={type:\"field_image\",src:l,width:40,height:40},t={type:\"field_vertical_separator\"};r.args0=[e,t]}switch(e.blockType){case d.COMMAND:r.outputShape=f.OUTPUT_SHAPE_SQUARE,r.previousStatement=null,e.isTerminal||(r.nextStatement=null);break;case d.REPORTER:r.output=e.allowDropAnywhere?null:\"String\",r.outputShape=f.OUTPUT_SHAPE_ROUND;break;case d.BOOLEAN:r.output=\"Boolean\",r.outputShape=f.OUTPUT_SHAPE_HEXAGONAL;break;case d.HAT:case d.EVENT:Object.prototype.hasOwnProperty.call(e,\"isEdgeActivated\")||(e.isEdgeActivated=!0),r.outputShape=f.OUTPUT_SHAPE_SQUARE,r.nextStatement=null;break;case d.CONDITIONAL:case d.LOOP:e.branchCount=e.branchCount||1,r.outputShape=f.OUTPUT_SHAPE_SQUARE,r.previousStatement=null,e.isTerminal||(r.nextStatement=null)}e.blockShape&&(r.outputShape=e.blockShape);const u=Array.isArray(e.text)?e.text:[e.text];let c=0,p=0,m=0;const g=this._convertPlaceholders.bind(this,s),h=this.makeMessageContextForTarget();for(;c0?p+1:\"\")}],++p,++m)}if(e.blockType===d.REPORTER||e.blockType===d.BOOLEAN)e.disableMonitor||0!==s.inputList.length||(r.checkboxInFlyout=!0);else if(e.branchIconURI||e.blockType===d.LOOP&&!Object.prototype.hasOwnProperty.call(e,\"branchIconURI\")){var b;r[\"lastDummyAlign\".concat(m)]=\"RIGHT\",r[\"message\".concat(m)]=\"%1\",r[\"args\".concat(m)]=[{type:\"field_image\",src:null!==(b=e.branchIconURI)&&void 0!==b?b:\"media://repeat.svg\",width:24,height:24,alt:\"*\",flip_rtl:!0}],++m}const y=e.isDynamic?''):\"\",v=s.inputList.join(\"\"),w='').concat(y).concat(v,\"\");if(e.extensions)for(const t of e.extensions)r.extensions.includes(t)||r.extensions.push(t);return{info:s.blockInfo,json:s.blockJSON,xml:w}}_convertSeparatorForScratchBlocks(e){return{info:e,xml:''}}_convertLabelForScratchBlocks(e){return{info:e,xml:'')}}_convertButtonForScratchBlocks(e,t){const i=this.makeMessageContextForTarget(),n=k(e.text,i);if([\"MAKE_A_LIST\",\"MAKE_A_PROCEDURE\",\"MAKE_A_VARIABLE\"].includes(e.func))return{info:e,xml:'')};const o=\"\".concat(t.id,\"_\").concat(e.func);return this.extensionButtons.set(o,e.callFunc),{info:e,xml:'')}}_convertXmlForScratchBlocks(e){return{info:e,xml:e.xml}}handleExtensionButtonPress(e){this.extensionButtons.get(e)()}_constructInlineImageJson(e){return e.dataURI||v.warn(\"Missing data URI in extension block with argument type IMAGE\"),{type:\"field_image\",src:e.dataURI||\"\",width:24,height:24,flip_rtl:e.flipRTL||!1}}_convertPlaceholders(e,t,i){const n=e.blockInfo.arguments[i]||{};let o,a=V[n.type]||{};if(!V[n.type]&&e.categoryInfo.customFieldTypes[n.type]&&(a=e.categoryInfo.customFieldTypes[n.type].argumentTypeInfo),\"field_image\"===a.fieldType)o=this._constructInlineImageJson(n);else{o={type:\"input_value\",name:i};const t=void 0===n.defaultValue?null:k(n.defaultValue,this.makeMessageContextForTarget()).toString();let r,s,l;if(a.check&&(o.check=a.check),n.menu){const t=e.categoryInfo.menuInfo[n.menu];t.acceptReporters?(r=i,s=this._makeExtensionMenuId(n.menu,e.categoryInfo.id),l=n.menu):(o.type=\"field_dropdown\",o.options=this._convertMenuItems(t.items),r=null,s=null,l=i)}else r=i,s=a.shadow&&a.shadow.type||null,l=a.shadow&&a.shadow.fieldName||null;r&&e.inputList.push('')),s&&e.inputList.push('')),null!==t&&l&&e.inputList.push('').concat(S(t),\"\")),s&&e.inputList.push(\"\"),r&&e.inputList.push(\"\")}const r=\"args\".concat(e.outLineNum),s=e.blockJSON[r]=e.blockJSON[r]||[];o&&s.push(o);const l=s.length;return e.argsMap[i]=l,\"%\".concat(l)}getBlocksXML(e){return this._blockInfo.map((t=>{const{name:i,color1:n,color2:o}=t,a=t.blocks.filter((t=>{let i=!0;return e&&t.info.filter&&(i=t.info.filter.includes(e.isStage?b.STAGE:b.SPRITE)),i&&!t.info.hideFromPalette})),r='colour=\"'.concat(S(n),'\" secondaryColour=\"').concat(S(o),'\"');let s=\"\";t.menuIconURI?s=t.menuIconURI:t.blockIconURI&&(s=t.blockIconURI);const l=s?'iconURI=\"'.concat(S(s),'\"'):\"\";let u=\"\";t.showStatusButton&&(u='showStatusButton=\"true\"');let c='\"),c+=a.map((e=>e.xml)).join(\"\"),c+=\"\",{id:t.id,xml:c}}))}getBlocksJSON(){return this._blockInfo.reduce(((e,t)=>e.concat(t.blocks.map((e=>e.json)))),[])}_initScratchLink(){if(\"undefined\"!=typeof self&&\"undefined\"!=typeof document&&document.getElementById&&self.origin&&\"null\"!==self.origin&&self.navigator&&self.navigator.userAgent&&!self.navigator.userAgent.includes(\"Node.js\")&&!self.navigator.userAgent.includes(\"jsdom\")){if(!document.getElementById(\"scratch-link-extension-script\")){const e=document.createElement(\"script\");e.id=\"scratch-link-extension-script\",document.body.appendChild(e),self.postMessage(\"inject-scratch-link-script\",self.origin)}}}getScratchLinkSocket(e){return(this._linkSocketFactory||this._defaultScratchLinkSocketFactory)(e)}configureScratchLinkSocketFactory(e){this._linkSocketFactory=e}_defaultScratchLinkSocketFactory(e){const t=self.Scratch,i=t&&t.ScratchLinkSafariSocket;return i&&i.isSafariHelperCompatible()?new i(e):new M(e)}registerPeripheralExtension(e,t){this.peripheralExtensions[e]=t}scanForPeripheral(e){this.peripheralExtensions[e]&&this.peripheralExtensions[e].scan()}connectPeripheral(e,t){this.peripheralExtensions[e]&&this.peripheralExtensions[e].connect(t)}disconnectPeripheral(e){this.peripheralExtensions[e]&&this.peripheralExtensions[e].disconnect()}getPeripheralIsConnected(e){let t=!1;return this.peripheralExtensions[e]&&(t=this.peripheralExtensions[e].isConnected()),t}emitMicListening(e){this.emit(Q.MIC_LISTENING,e)}getOpcodeFunction(e){return this._primitives[e]}getIsHat(e){return Object.prototype.hasOwnProperty.call(this._hats,e)}getIsEdgeActivatedHat(e){return Object.prototype.hasOwnProperty.call(this._hats,e)&&this._hats[e].edgeActivated}attachAudioEngine(e){this.audioEngine=e}attachRenderer(e){this.renderer=e,this.renderer.setLayerGroupOrdering(w.LAYER_GROUPS),this.renderer.offscreenTouching=!this.runtimeOptions.fencing,this.updatePrivacy()}attachV2BitmapAdapter(e){this.v2BitmapAdapter=e}attachStorage(e){if(this.storage=e,this.isPackaged){const t=e.createAsset;let i=0;e.createAsset=function(e,n,o,a,r){return a||(a=(++i).toString()),t.call(this,e,n,o,a,!1)}}I.setFetch(e.scratchFetch.scratchFetch),this.resetRunId()}_pushThread(e,t,i){const n=new y(e);return n.target=t,n.stackClick=Boolean(i&&i.stackClick),n.updateMonitor=Boolean(i&&i.updateMonitor),n.blockContainer=n.updateMonitor?this.monitorBlocks:t.blocks,n.pushStack(e),this.threads.push(n),n.stackClick||n.updateMonitor||this.threadMap.set(n.getId(),n),i&&i.updateMonitor||!this.compilerOptions.enabled||n.tryCompile(),n}_stopThread(e){e.isKilled=!0,this.sequencer.retireThread(e)}_restartThread(e){const t=new y(e.topBlock);t.target=e.target,t.stackClick=e.stackClick,t.updateMonitor=e.updateMonitor,t.blockContainer=e.blockContainer,t.pushStack(e.topBlock),e.triedToCompile&&this.compilerOptions.enabled&&t.tryCompile(),t.stackClick||t.updateMonitor||this.threadMap.set(t.getId(),t);const i=this.threads.indexOf(e);return i>-1?(this.threads[i]=t,t):(this.threads.push(e),e)}emitCompileError(e,t){this.emit(Q.COMPILE_ERROR,e,t)}isActiveThread(e){return e.stack.length>0&&e.status!==y.STATUS_DONE&&this.threads.indexOf(e)>-1}isWaitingThread(e){return e.status===y.STATUS_PROMISE_WAIT||e.status===y.STATUS_YIELD_TICK||!this.isActiveThread(e)}toggleScript(e,t){t=Object.assign({target:this._editingTarget,stackClick:!1},t);for(let i=0;i=0;t--){const n=i[t],o=n.blocks.getScripts();for(let t=0;t=0;i--){const o=n[i],a=c.getScripts(o.blocks,e);for(let e=0;e{const{blockId:r,fieldsOfInputs:s}=e;for(const e in t)if(s[e].value!==t[e])return;if(o.restartExistingThreads){const e=this.threadMap.get(y.getIdFromTargetAndBlock(i,r));if(e)return void n.push(this._restartThread(e))}else for(let e=0;e{e.isCompiled?e.executableHat&&(h.saveGlobalState(),h(e),h.restoreGlobalState()):(g(this.sequencer,e),e.goToNextBlock())})),n}dispose(){this.stopAll(),this.targets.forEach((e=>{e.isOriginal&&e.deleteMonitors()})),this.targets.map(this.disposeTarget,this),this.extensionStorage={},this._monitorState.empty()||(this._monitorState=new O,this.emit(Q.MONITORS_UPDATE,this._monitorState.shallowClone())),this.emit(Q.RUNTIME_DISPOSED),this.ioDevices.clock.resetProjectTimer(),this.fontManager.clear(),this.hasCloudData()&&this.emit(Q.HAS_CLOUD_DATA_UPDATE,!1),this.ioDevices.cloud.clear();const e=q(this.cloudOptions);this.hasCloudData=e.hasCloudVariables,this.canAddCloudVariable=e.canAddCloudVariable,this.getNumberOfCloudVariables=e.getNumberOfCloudVariables,this.addCloudVariable=this._initializeAddCloudVariable(e),this.removeCloudVariable=this._initializeRemoveCloudVariable(e),this.resetProgress()}addTarget(e){this.targets.push(e),this.executableTargets.push(e),e.isStage&&!this._stageTarget&&(this._stageTarget=e)}moveExecutable(e,t){const i=this.executableTargets.indexOf(e);this.executableTargets.splice(i,1);let n=i+t;return n>this.executableTargets.length&&(n=this.executableTargets.length),n<=0&&(n=this.executableTargets.length>0&&this.executableTargets[0].isStage?1:0),this.executableTargets.splice(n,0,e),n}setExecutablePosition(e,t){const i=this.executableTargets.indexOf(e);return this.moveExecutable(e,t-i)}removeExecutable(e){const t=this.executableTargets.indexOf(e);t>-1&&this.executableTargets.splice(t,1)}disposeTarget(e){this.targets=this.targets.filter((t=>e!==t||(t.dispose(),!1))),this._stageTarget===e&&(this._stageTarget=null)}stopForTarget(e,t){this.emit(Q.STOP_FOR_TARGET,e,t);for(let i=0;ie.clearEdgeActivatedValues()));for(let e=0;e!e.isKilled)),this.updateThreadMap();for(const e in this._hats){if(!Object.prototype.hasOwnProperty.call(this._hats,e))continue;this._hats[e].edgeActivated&&this.startHats(e)}this.redrawRequested=!1,this._pushMonitors(),null!==this.profiler&&(-1===Z&&(Z=this.profiler.idByName(\"Sequencer.stepThreads\")),this.profiler.start(Z)),this.emit(Q.BEFORE_EXECUTE);const e=this.sequencer.stepThreads();null!==this.profiler&&this.profiler.stop(),this.emit(Q.AFTER_EXECUTE),this._updateGlows(e),this._emitProjectRunStatus(this.threads.length+e.length-this._getMonitorThreadCount([...this.threads,...e])),this._lastStepDoneThreads=e,this.renderer&&(null!==this.profiler&&(-1===K&&(K=this.profiler.idByName(\"RenderWebGL.draw\")),this.profiler.start(K)),document.hidden||this.frameLoop._interpolationAnimation||this.renderer.draw(),null!==this.profiler&&this.profiler.stop()),this._refreshTargets&&(this.emit(Q.TARGETS_UPDATE,!1),this._refreshTargets=!1),this._monitorState.dirty&&(this.emit(Q.MONITORS_UPDATE,this._monitorState.shallowClone()),this._monitorState.dirty=!1),null!==this.profiler&&(this.profiler.stop(),this.profiler.reportFrames()),this.interpolationEnabled&&(this._lastStepTime=Date.now())}_getMonitorThreadCount(e){let t=0;return e.forEach((e=>{e.updateMonitor&&t++})),t}_pushMonitors(){this.monitorBlocks.runAllMonitored(this)}setEditingTarget(e){const t=this._editingTarget;this._editingTarget=e,this._scriptGlowsPreviousFrame=[],this._updateGlows(),t!==this._editingTarget&&this.requestToolboxExtensionsUpdate()}setCompatibilityMode(e){e?this.setFramerate(30):this.setFramerate(60)}setFramerate(e){e>250&&(e=250),e<0&&(e=1),this.frameLoop.setFramerate(e),this.emit(Q.FRAMERATE_CHANGED,e)}setInterpolation(e){this.interpolationEnabled=e,this.frameLoop.setInterpolation(this.interpolationEnabled),this.emit(Q.INTERPOLATION_CHANGED,e)}setRuntimeOptions(e){this.runtimeOptions=Object.assign({},this.runtimeOptions,e),this.emit(Q.RUNTIME_OPTIONS_CHANGED,this.runtimeOptions),this.renderer&&(this.renderer.offscreenTouching=!this.runtimeOptions.fencing)}setCompilerOptions(e){this.compilerOptions=Object.assign({},this.compilerOptions,e),this.resetAllCaches(),this.emit(Q.COMPILER_OPTIONS_CHANGED,this.compilerOptions)}setStageSize(e,t){if(e=Math.round(Math.max(1,e)),t=Math.round(Math.max(1,t)),this.stageWidth!==e||this.stageHeight!==t){const i=e-this.stageWidth,n=t-this.stageHeight;if(this._monitorState.size>0){const e=i/2,t=n/2;for(const i of this._monitorState.valueSeq())this.requestUpdateMonitor({id:i.id,x:i.get(\"x\")+e,y:i.get(\"y\")+t});this.emit(Q.MONITORS_UPDATE,this._monitorState.shallowClone())}this.stageWidth=e,this.stageHeight=t,this.renderer&&this.renderer.setStageSize(-e/2,e/2,-t/2,t/2),this.emit(Q.STAGE_SIZE_CHANGED,e,t)}}setInEditor(e){}convertToPackagedRuntime(){if(this.storage)throw new Error(\"convertToPackagedRuntime must be called before attachStorage\");this.isPackaged=!0}resetAllCaches(){for(const e of this.targets)e.isOriginal&&e.blocks.resetCache();this.flyoutBlocks.resetCache(),this.monitorBlocks.resetCache()}addAddonBlock(e){const t=e.procedureCode,i=e.arguments||[],a=i,r=i.map(((e,t)=>\"arg\".concat(t))),s=i.map((()=>\"\"));if(this.addonBlocks[t]=function(e){for(var t=1;te.id===i));if(!n){const e='';n={id:i,name:k({id:\"tw.blocks.addons\",default:\"Addons\",description:\"Name of the addon block category in the extension list\"}),color1:\"#29beb8\",color2:\"#3aa8a4\",color3:\"#3aa8a4\",menuIconURI:\"data:image/svg+xml;,\".concat(encodeURIComponent(e)),blocks:[],customFieldTypes:{},menus:[]},this._blockInfo.unshift(n)}n.blocks.push({info:{},xml:'\"})}this.resetAllCaches()}getAddonBlock(e){return Object.prototype.hasOwnProperty.call(this.addonBlocks,e)?this.addonBlocks[e]:null}findProjectOptionsComment(){const e=this.getTargetForStage().comments;for(const t of Object.values(e))if(t.text.includes(W))return t;return null}parseProjectOptions(){const e=this.findProjectOptionsComment();if(!e)return;const t=e.text.split(\"\\n\").find((e=>e.endsWith(W)));if(!t)return void v.warn(\"Config comment does not contain valid line\");const i=t.substr(0,t.length-14);let n;try{if(n=r.parse(i),!n||\"object\"!=typeof n)throw new Error(\"Invalid object\")}catch(e){return void v.warn(\"Config comment has invalid JSON\",e)}\"number\"==typeof n.framerate&&this.setFramerate(n.framerate),n.turbo&&(this.turboMode=!0,this.emit(Q.TURBO_MODE_ON)),n.interpolation&&this.setInterpolation(!0),n.runtimeOptions&&this.setRuntimeOptions(n.runtimeOptions),n.hq&&this.renderer&&this.renderer.setUseHighQualityRender(!0);const o=+n.width||this.stageWidth,a=+n.height||this.stageHeight;o===this.stageWidth&&a===this.stageHeight||this.setStageSize(o,a)}_generateAllProjectOptions(){return{framerate:this.frameLoop.framerate,runtimeOptions:this.runtimeOptions,interpolation:this.interpolationEnabled,turbo:this.turboMode,hq:!!this.renderer&&this.renderer.useHighQualityRender,width:this.stageWidth,height:this.stageHeight}}generateDifferingProjectOptions(){const e=(t,i)=>{const n={};for(const o of Object.keys(i)){const a=i[o],r=t[o];if(\"object\"==typeof a&&a){const t=e(r,a);Object.keys(t).length>0&&(n[o]=t)}else a!==r&&(n[o]=a)}return n};return e(this._defaultStoredSettings,this._generateAllProjectOptions())}storeProjectOptions(){const e=this.generateDifferingProjectOptions(),t=\"Configuration for https://turbowarp.org/\\nYou can move, resize, and minimize this comment, but don't edit it by hand. This comment can be deleted to remove the stored settings.\\n\".concat(r.stringify(e)).concat(W),i=this.findProjectOptionsComment();if(i)i.text=t;else{this.getTargetForStage().createComment(z(),null,t,50,50,350,170,!1)}this.emitProjectChanged()}precompile(){this.allScriptsDo(((e,t)=>{const i=t.blocks.getBlock(e);if(this.getIsHat(i.opcode)){const i=new y(e);i.target=t,i.blockContainer=t.blocks,i.tryCompile()}}))}enableDebug(){this.resetAllCaches(),this.debug=!0}_updateGlows(e){const t=[];t.push(...this.threads),e&&t.push(...e);const i=[],n=[];for(let e=0;e0&&this.emit(Q.PROJECT_RUN_START),this._nonMonitorThreadCount>0&&0===e&&this.emit(Q.PROJECT_RUN_STOP),this._nonMonitorThreadCount=e}quietGlow(e){const t=this._scriptGlowsPreviousFrame.indexOf(e);t>-1&&this._scriptGlowsPreviousFrame.splice(t,1)}glowBlock(e,t){t?this.emit(Q.BLOCK_GLOW_ON,{id:e}):this.emit(Q.BLOCK_GLOW_OFF,{id:e})}glowScript(e,t){t?this.emit(Q.SCRIPT_GLOW_ON,{id:e}):this.emit(Q.SCRIPT_GLOW_OFF,{id:e})}emitBlockDragUpdate(e){this.emit(Q.BLOCK_DRAG_UPDATE,e)}emitBlockEndDrag(e,t){this.emit(Q.BLOCK_DRAG_END,e,t)}visualReport(e,t,i){e===this.getEditingTarget()&&this.emit(Q.VISUAL_REPORT,{id:t,value:_(i)})}requestAddMonitor(e){this.requestUpdateMonitor(e)||this._monitorState.set(e.id,e)}requestUpdateMonitor(e){const t=(e=H.externalDeltaToJS(e)).id;return!!this._monitorState.has(t)&&(this._monitorState.set(t,e),!0)}requestRemoveMonitor(e){this._monitorState.delete(e)}requestHideMonitor(e){return this.requestUpdateMonitor({id:e,visible:!1})}requestShowMonitor(e){return this.requestUpdateMonitor({id:e,visible:!0})}requestRemoveMonitorByTargetId(e){this._monitorState.filter((t=>t.targetId!==e))}getTargetById(e){for(let t=0;te.id===t));if(!n)return;const o=n.blocks.find((e=>e.info.opcode===i));return o?{category:\"extension\",label:\"\".concat(n.name,\": \").concat(o.info.text)}:void 0}createNewGlobalVariable(e,t,i){const n=\"string\"==typeof i?i:T.SCALAR_TYPE,o=this.getAllVarNamesOfType(n),a=j.unusedName(e,o),r=new T(t||z(),a,n);return this.getTargetForStage().variables[r.id]=r,r}requestRedraw(){this.redrawRequested=!0}requestTargetsUpdate(e){e.isOriginal&&(this._refreshTargets=!0)}requestBlocksUpdate(){this.emit(Q.BLOCKS_NEED_UPDATE)}requestToolboxExtensionsUpdate(){this.emit(Q.TOOLBOX_EXTENSIONS_NEED_UPDATE)}start(){this.frameLoop.running||(this.frameLoop.start(),this.emit(Q.RUNTIME_STARTED))}stop(){this.quit()}quit(){this.frameLoop.running&&(this.frameLoop.stop(),this.emit(Q.RUNTIME_STOPPED))}enableProfiling(e){p.available()&&(this.profiler=new p(e))}disableProfiling(){this.profiler=null}updateCurrentMSecs(){this.currentMSecs=Date.now()}updatePrivacy(){this.privacyRestrictionsActive=this.enforcePrivacy&&Object.values(this.externalCommunicationMethods).some((e=>e)),this.renderer&&this.renderer.setPrivateSkinAccess&&this.renderer.setPrivateSkinAccess(!this.privacyRestrictionsActive)}setEnforcePrivacy(e){this.enforcePrivacy=e,this.updatePrivacy()}setExternalCommunicationMethod(e,t){if(!Object.prototype.hasOwnProperty.call(this.externalCommunicationMethods,e))throw new Error(\"Unknown method: \".concat(e));this.externalCommunicationMethods[e]=t,this.updatePrivacy()}emitAssetProgress(){this.emit(Q.ASSET_PROGRESS,this.finishedAssetRequests,this.totalAssetRequests)}resetProgress(){this.finishedAssetRequests=0,this.totalAssetRequests=0,this.emitAssetProgress()}wrapAssetRequest(e){this.totalAssetRequests++,this.emitAssetProgress();return e().then((e=>(this.finishedAssetRequests++,this.emitAssetProgress(),e)),(e=>{throw this.finishedAssetRequests++,this.emitAssetProgress(),e}))}}e.exports=Q},function(e,t){e.exports=function(e,t){let i=\"\";for(const e in t){let n=t[e].value;\"CURRENTMENU\"===e&&(n=n.toLowerCase()),i+=\"_\".concat(n)}return\"\".concat(e).concat(i)}},function(e,t,i){const n=i(46),o=i(87),a=i(45),r=i(114),s=i(38),l=i(825),{StackOpcode:u,InputOpcode:c,InputType:d}=i(125),{IntermediateStackBlock:p,IntermediateInput:m,IntermediateStack:g,IntermediateScript:h,IntermediateRepresentation:f}=i(115),b=i(296),y=\"\",v=\"list\",k=e=>e.substring(1);class w{constructor(e){this.thread=e,this.target=e.target,this.blocks=e.blockContainer,this.runtime=this.target.runtime,this.stage=this.runtime.getTargetForStage(),this.script=new h,this.script.warpTimer=this.target.runtime.compilerOptions.warpTimer,this.variableCache={},this.usesTimer=!1,this.namesOfCostumesAndSounds=new Set;for(const e of this.runtime.targets)if(e.isOriginal){const t=e.sprite;for(const e of t.costumes)this.namesOfCostumesAndSounds.add(e.name);for(const e of t.sounds)this.namesOfCostumesAndSounds.add(e.name)}this.oldCompilerStub=b.enabled?new b.ScriptTreeGeneratorStub(this):null}setProcedureVariant(e){const t=k(e);this.script.procedureVariant=e,this.script.procedureCode=t,this.script.isProcedure=!0,this.script.yields=!1;const i=this.blocks.getProcedureParamNamesIdsAndDefaults(t);if(null===i)throw new Error(\"IR: cannot find procedure: \".concat(e));const[n,o,a]=i;this.script.arguments=n}enableWarp(){this.script.isWarp=!0}getBlockById(e){return this.blocks.getBlock(e)||this.blocks.runtime.flyoutBlocks.getBlock(e)}getBlockInfo(e){const[t,i]=o.splitFirst(e,\"_\");if(!t||!i)return null;const n=this.runtime._blockInfo.find((e=>e.id===t));if(!n)return null;const a=n.blocks.find((e=>e.info.opcode===i));return a||null}createConstantInput(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null===e)throw new Error(\"IR: Constant cannot have a null value.\");const i=+(e+=\"\"),n=t&&this.namesOfCostumesAndSounds.has(e);if(!Number.isNaN(i)&&(\"\"!==e.trim()||e.includes(\"\\t\")))return n||i.toString()!==e?new m(c.CONSTANT,d.STRING_NUM,{value:e}):new m(c.CONSTANT,m.getNumberInputType(i),{value:i});if(!n){if(\"true\"===e)return new m(c.CONSTANT,d.STRING_BOOLEAN,{value:e});if(\"false\"===e)return new m(c.CONSTANT,d.STRING_BOOLEAN,{value:e})}return new m(c.CONSTANT,d.STRING_NAN,{value:e})}descendInputOfBlock(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=e.inputs[t];if(!n)return s.warn(\"IR: \".concat(e.opcode,\": missing input \").concat(t),e),this.createConstantInput(0);const o=n.block,a=this.getBlockById(o);if(!a)return s.warn(\"IR: \".concat(e.opcode,\": could not find input \").concat(t,\" with ID \").concat(o)),this.createConstantInput(0);const r=this.descendInput(a,i);return this.script.yields=this.script.yields||r.yields,r}descendInput(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.oldCompilerStub){const t=this.oldCompilerStub.descendInputFromNewCompiler(e);if(t)return t}switch(e.opcode){case\"colour_picker\":return this.createConstantInput(e.fields.COLOUR.value,!0);case\"math_angle\":case\"math_integer\":case\"math_number\":case\"math_positive_number\":case\"math_whole_number\":return this.createConstantInput(e.fields.NUM.value,t);case\"text\":return this.createConstantInput(e.fields.TEXT.value,t);case\"argument_reporter_string_number\":{const t=e.fields.VALUE.value,i=this.script.arguments.lastIndexOf(t);return-1===i&&\"last key pressed\"===t.toLowerCase()?new m(c.TW_KEY_LAST_PRESSED,d.STRING):-1===i?this.createConstantInput(0):new m(c.PROCEDURE_ARGUMENT,d.ANY,{index:i})}case\"argument_reporter_boolean\":{const t=e.fields.VALUE.value,i=this.script.arguments.lastIndexOf(t);return-1===i?\"is compiled?\"===t.toLowerCase()||\"is turbowarp?\"===t.toLowerCase()?this.createConstantInput(!0).toType(d.BOOLEAN):this.createConstantInput(0):new m(c.PROCEDURE_ARGUMENT,d.ANY,{index:i})}case\"data_variable\":return new m(c.VAR_GET,d.ANY,{variable:this.descendVariable(e,\"VARIABLE\",y)});case\"data_itemoflist\":return new m(c.LIST_GET,d.ANY,{list:this.descendVariable(e,\"LIST\",v),index:this.descendInputOfBlock(e,\"INDEX\")});case\"data_lengthoflist\":return new m(c.LIST_LENGTH,d.NUMBER_POS_INT|d.NUMBER_ZERO,{list:this.descendVariable(e,\"LIST\",v)});case\"data_listcontainsitem\":return new m(c.LIST_CONTAINS,d.BOOLEAN,{list:this.descendVariable(e,\"LIST\",v),item:this.descendInputOfBlock(e,\"ITEM\")});case\"data_itemnumoflist\":return new m(c.LIST_INDEX_OF,d.NUMBER_POS_INT|d.NUMBER_ZERO,{list:this.descendVariable(e,\"LIST\",v),item:this.descendInputOfBlock(e,\"ITEM\")});case\"data_listcontents\":return new m(c.LIST_CONTENTS,d.STRING,{list:this.descendVariable(e,\"LIST\",v)});case\"event_broadcast_menu\":{const t=e.fields.BROADCAST_OPTION,i=this.target.lookupBroadcastMsg(t.id,t.value),n=i?i.name:\"\";return this.createConstantInput(n)}case\"looks_backdropnumbername\":return\"number\"===e.fields.NUMBER_NAME.value?new m(c.LOOKS_BACKDROP_NUMBER,d.NUMBER_POS_INT):new m(c.LOOKS_BACKDROP_NAME,d.STRING);case\"looks_costumenumbername\":return\"number\"===e.fields.NUMBER_NAME.value?new m(c.LOOKS_COSTUME_NUMBER,d.NUMBER_POS_INT):new m(c.LOOKS_COSTUME_NAME,d.STRING);case\"looks_size\":return new m(c.LOOKS_SIZE_GET,d.NUMBER_POS|d.NUMBER_ZERO);case\"motion_direction\":return new m(c.MOTION_DIRECTION_GET,d.NUMBER_REAL);case\"motion_xposition\":return new m(c.MOTION_X_GET,d.NUMBER);case\"motion_yposition\":return new m(c.MOTION_Y_GET,d.NUMBER);case\"operator_add\":return new m(c.OP_ADD,d.NUMBER_OR_NAN,{left:this.descendInputOfBlock(e,\"NUM1\").toType(d.NUMBER),right:this.descendInputOfBlock(e,\"NUM2\").toType(d.NUMBER)});case\"operator_and\":return new m(c.OP_AND,d.BOOLEAN,{left:this.descendInputOfBlock(e,\"OPERAND1\").toType(d.BOOLEAN),right:this.descendInputOfBlock(e,\"OPERAND2\").toType(d.BOOLEAN)});case\"operator_contains\":return new m(c.OP_CONTAINS,d.BOOLEAN,{string:this.descendInputOfBlock(e,\"STRING1\").toType(d.STRING),contains:this.descendInputOfBlock(e,\"STRING2\").toType(d.STRING)});case\"operator_divide\":return new m(c.OP_DIVIDE,d.NUMBER_OR_NAN,{left:this.descendInputOfBlock(e,\"NUM1\").toType(d.NUMBER),right:this.descendInputOfBlock(e,\"NUM2\").toType(d.NUMBER)});case\"operator_equals\":return new m(c.OP_EQUALS,d.BOOLEAN,{left:this.descendInputOfBlock(e,\"OPERAND1\"),right:this.descendInputOfBlock(e,\"OPERAND2\")});case\"operator_gt\":return new m(c.OP_GREATER,d.BOOLEAN,{left:this.descendInputOfBlock(e,\"OPERAND1\"),right:this.descendInputOfBlock(e,\"OPERAND2\")});case\"operator_join\":return new m(c.OP_JOIN,d.STRING,{left:this.descendInputOfBlock(e,\"STRING1\").toType(d.STRING),right:this.descendInputOfBlock(e,\"STRING2\").toType(d.STRING)});case\"operator_length\":return new m(c.OP_LENGTH,d.NUMBER_POS_INT|d.NUMBER_ZERO,{string:this.descendInputOfBlock(e,\"STRING\").toType(d.STRING)});case\"operator_letter_of\":return new m(c.OP_LETTER_OF,d.STRING,{letter:this.descendInputOfBlock(e,\"LETTER\").toType(d.NUMBER_INDEX),string:this.descendInputOfBlock(e,\"STRING\").toType(d.STRING)});case\"operator_lt\":return new m(c.OP_LESS,d.BOOLEAN,{left:this.descendInputOfBlock(e,\"OPERAND1\"),right:this.descendInputOfBlock(e,\"OPERAND2\")});case\"operator_mathop\":{const t=this.descendInputOfBlock(e,\"NUM\").toType(d.NUMBER);switch(e.fields.OPERATOR.value.toLowerCase()){case\"abs\":return new m(c.OP_ABS,d.NUMBER_POS|d.NUMBER_ZERO,{value:t});case\"floor\":return new m(c.OP_FLOOR,d.NUMBER_INT|d.NUMBER_INF,{value:t});case\"ceiling\":return new m(c.OP_CEILING,d.NUMBER_INT|d.NUMBER_INF,{value:t});case\"sqrt\":return new m(c.OP_SQRT,d.NUMBER_OR_NAN,{value:t});case\"sin\":return new m(c.OP_SIN,d.NUMBER_OR_NAN,{value:t});case\"cos\":return new m(c.OP_COS,d.NUMBER_OR_NAN,{value:t});case\"tan\":return new m(c.OP_TAN,d.NUMBER_OR_NAN,{value:t});case\"asin\":return new m(c.OP_ASIN,d.NUMBER_OR_NAN,{value:t});case\"acos\":return new m(c.OP_ACOS,d.NUMBER_OR_NAN,{value:t});case\"atan\":return new m(c.OP_ATAN,d.NUMBER,{value:t});case\"ln\":return new m(c.OP_LOG_E,d.NUMBER_OR_NAN,{value:t});case\"log\":return new m(c.OP_LOG_10,d.NUMBER_OR_NAN,{value:t});case\"e ^\":return new m(c.OP_POW_E,d.NUMBER,{value:t});case\"10 ^\":return new m(c.OP_POW_10,d.NUMBER,{value:t});default:return this.createConstantInput(0)}}case\"operator_mod\":return new m(c.OP_MOD,d.NUMBER_OR_NAN,{left:this.descendInputOfBlock(e,\"NUM1\").toType(d.NUMBER),right:this.descendInputOfBlock(e,\"NUM2\").toType(d.NUMBER)});case\"operator_multiply\":return new m(c.OP_MULTIPLY,d.NUMBER_OR_NAN,{left:this.descendInputOfBlock(e,\"NUM1\").toType(d.NUMBER),right:this.descendInputOfBlock(e,\"NUM2\").toType(d.NUMBER)});case\"operator_not\":return new m(c.OP_NOT,d.BOOLEAN,{operand:this.descendInputOfBlock(e,\"OPERAND\").toType(d.BOOLEAN)});case\"operator_or\":return new m(c.OP_OR,d.BOOLEAN,{left:this.descendInputOfBlock(e,\"OPERAND1\").toType(d.BOOLEAN),right:this.descendInputOfBlock(e,\"OPERAND2\").toType(d.BOOLEAN)});case\"operator_random\":{const t=this.descendInputOfBlock(e,\"FROM\"),i=this.descendInputOfBlock(e,\"TO\");if(t.opcode===c.CONSTANT&&i.opcode===c.CONSTANT){const e=t.inputs.value,o=i.inputs.value,a=n.toNumber(e),r=n.toNumber(o);return a===r?this.createConstantInput(a):n.isInt(e)&&n.isInt(o)?new m(c.OP_RANDOM,d.NUMBER,{low:(a<=r?t:i).toType(d.NUMBER),high:(a<=r?i:t).toType(d.NUMBER),useInts:!0,useFloats:!1}):new m(c.OP_RANDOM,d.NUMBER_OR_NAN,{low:(a<=r?t:i).toType(d.NUMBER),high:(a<=r?i:t).toType(d.NUMBER),useInts:!1,useFloats:!0})}if(t.opcode===c.CONSTANT){if(!n.isInt(n.toNumber(t.inputs.value)))return new m(c.OP_RANDOM,d.NUMBER_OR_NAN,{low:t.toType(d.NUMBER),high:i.toType(d.NUMBER),useInts:!1,useFloats:!0})}else if(i.opcode===c.CONSTANT&&!n.isInt(n.toNumber(t.inputs.value)))return new m(c.OP_RANDOM,d.NUMBER_OR_NAN,{low:t.toType(d.NUMBER),high:i.toType(d.NUMBER),useInts:!1,useFloats:!0});return new m(c.OP_RANDOM,d.NUMBER_OR_NAN,{low:t,high:i,useInts:!1,useFloats:!1})}case\"operator_round\":return new m(c.OP_ROUND,d.NUMBER_INT|d.NUMBER_INF,{value:this.descendInputOfBlock(e,\"NUM\").toType(d.NUMBER)});case\"operator_subtract\":return new m(c.OP_SUBTRACT,d.NUMBER_OR_NAN,{left:this.descendInputOfBlock(e,\"NUM1\").toType(d.NUMBER),right:this.descendInputOfBlock(e,\"NUM2\").toType(d.NUMBER)});case\"procedures_call\":{const t=this.getProcedureInfo(e);return new m(t.opcode,d.ANY,t.inputs,t.yields)}case\"sensing_answer\":return new m(c.SENSING_ANSWER,d.STRING);case\"sensing_coloristouchingcolor\":return new m(c.SENSING_COLOR_TOUCHING_COLOR,d.BOOLEAN,{target:this.descendInputOfBlock(e,\"COLOR2\").toType(d.COLOR),mask:this.descendInputOfBlock(e,\"COLOR\").toType(d.COLOR)});case\"sensing_current\":switch(e.fields.CURRENTMENU.value.toLowerCase()){case\"year\":return new m(c.SENSING_TIME_YEAR,d.NUMBER_POS_INT|d.NUMBER_ZERO);case\"month\":return new m(c.SENSING_TIME_MONTH,d.NUMBER_POS_INT);case\"date\":return new m(c.SENSING_TIME_DATE,d.NUMBER_POS_INT);case\"dayofweek\":return new m(c.SENSING_TIME_WEEKDAY,d.NUMBER_POS_INT);case\"hour\":return new m(c.SENSING_TIME_HOUR,d.NUMBER_POS_INT|d.NUMBER_ZERO);case\"minute\":return new m(c.SENSING_TIME_MINUTE,d.NUMBER_POS_INT|d.NUMBER_ZERO);case\"second\":return new m(c.SENSING_TIME_SECOND,d.NUMBER_POS_INT|d.NUMBER_ZERO);default:return this.createConstantInput(0)}case\"sensing_dayssince2000\":return new m(c.SENSING_TIME_DAYS_SINCE_2000,d.NUMBER);case\"sensing_distanceto\":return new m(c.SENSING_DISTANCE,d.NUMBER_POS|d.NUMBER_ZERO,{target:this.descendInputOfBlock(e,\"DISTANCETOMENU\").toType(d.STRING)});case\"sensing_keypressed\":return new m(c.SENSING_KEY_DOWN,d.BOOLEAN,{key:this.descendInputOfBlock(e,\"KEY_OPTION\",!0)});case\"sensing_mousedown\":return new m(c.SENSING_MOUSE_DOWN,d.BOOLEAN);case\"sensing_mousex\":return new m(c.SENSING_MOUSE_X,d.NUMBER);case\"sensing_mousey\":return new m(c.SENSING_MOUSE_Y,d.NUMBER);case\"sensing_of\":{const t=e.fields.PROPERTY.value,i=this.descendInputOfBlock(e,\"OBJECT\").toType(d.STRING);if(i.opcode!==c.CONSTANT)return new m(c.SENSING_OF,d.ANY,{object:i,property:t});if(\"volume\"===t)return new m(c.SENSING_OF_VOLUME,d.NUMBER_POS_REAL|d.NUMBER_ZERO,{object:i,property:t});if(i.isConstant(\"_stage_\"))switch(t){case\"background #\":case\"backdrop #\":return new m(c.SENSING_OF_BACKDROP_NUMBER,d.NUMBER_POS_INT);case\"backdrop name\":return new m(c.SENSING_OF_BACKDROP_NAME,d.STRING)}else switch(t){case\"x position\":return new m(c.SENSING_OF_POS_X,d.NUMBER,{object:i});case\"y position\":return new m(c.SENSING_OF_POS_Y,d.NUMBER,{object:i});case\"direction\":return new m(c.SENSING_OF_DIRECTION,d.NUMBER_REAL,{object:i});case\"costume #\":return new m(c.SENSING_OF_COSTUME_NUMBER,d.NUMBER_POS_INT|d.NUMBER_ZERO,{object:i});case\"costume name\":return new m(c.SENSING_OF_COSTUME_NAME,d.STRING|d.NUMBER_ZERO,{object:i});case\"size\":return new m(c.SENSING_OF_SIZE,d.NUMBER_POS|d.NUMBER_ZERO,{object:i})}return new m(c.SENSING_OF_VAR,d.ANY,{object:i,property:t})}case\"sensing_timer\":return this.usesTimer=!0,new m(c.SENSING_TIMER_GET,d.NUMBER_POS_REAL|d.NUMBER_ZERO);case\"sensing_touchingcolor\":return new m(c.SENSING_TOUCHING_COLOR,d.BOOLEAN,{color:this.descendInputOfBlock(e,\"COLOR\").toType(d.COLOR)});case\"sensing_touchingobject\":return new m(c.SENSING_TOUCHING_OBJECT,d.BOOLEAN,{object:this.descendInputOfBlock(e,\"TOUCHINGOBJECTMENU\")});case\"sensing_username\":return new m(c.SENSING_USERNAME,d.STRING);case\"sound_sounds_menu\":return this.createConstantInput(e.fields.SOUND_MENU.value,!0);case\"control_get_counter\":return new m(c.CONTROL_COUNTER,d.NUMBER_POS_INT|d.NUMBER_ZERO);case\"tw_getLastKeyPressed\":return new m(c.TW_KEY_LAST_PRESSED,d.STRING);default:{if(this.runtime.getOpcodeFunction(e.opcode)){if(l.inputs.includes(e.opcode))return this.descendCompatLayerInput(e);const t=this.getBlockInfo(e.opcode);if(t){const i=t.info.blockType;if(i===a.REPORTER||i===a.BOOLEAN)return this.descendCompatLayerInput(e)}}const i=Object.keys(e.inputs),n=Object.keys(e.fields);if(0===i.length&&1===n.length)return this.createConstantInput(e.fields[n[0]].value,t);throw s.warn(\"IR: Unknown input: \".concat(e.opcode),e),new Error(\"IR: Unknown input: \".concat(e.opcode))}}}descendStackedBlock(e){if(this.oldCompilerStub){const t=this.oldCompilerStub.descendStackedBlockFromNewCompiler(e);if(t)return t}switch(e.opcode){case\"control_all_at_once\":return new p(u.CONTROL_IF_ELSE,{condition:this.createConstantInput(!0).toType(d.BOOLEAN),whenTrue:this.descendSubstack(e,\"SUBSTACK\"),whenFalse:new g});case\"control_create_clone_of\":return new p(u.CONTROL_CLONE_CREATE,{target:this.descendInputOfBlock(e,\"CLONE_OPTION\").toType(d.STRING)});case\"control_delete_this_clone\":return new p(u.CONTROL_CLONE_DELETE,{},!0);case\"control_forever\":return new p(u.CONTROL_WHILE,{condition:this.createConstantInput(!0).toType(d.BOOLEAN),do:this.descendSubstack(e,\"SUBSTACK\")},this.analyzeLoop());case\"control_for_each\":return new p(u.CONTROL_FOR,{variable:this.descendVariable(e,\"VARIABLE\",y),count:this.descendInputOfBlock(e,\"VALUE\").toType(d.NUMBER),do:this.descendSubstack(e,\"SUBSTACK\")},this.analyzeLoop());case\"control_if\":return new p(u.CONTROL_IF_ELSE,{condition:this.descendInputOfBlock(e,\"CONDITION\").toType(d.BOOLEAN),whenTrue:this.descendSubstack(e,\"SUBSTACK\"),whenFalse:new g});case\"control_if_else\":return new p(u.CONTROL_IF_ELSE,{condition:this.descendInputOfBlock(e,\"CONDITION\").toType(d.BOOLEAN),whenTrue:this.descendSubstack(e,\"SUBSTACK\"),whenFalse:this.descendSubstack(e,\"SUBSTACK2\")});case\"control_repeat\":return new p(u.CONTROL_REPEAT,{times:this.descendInputOfBlock(e,\"TIMES\").toType(d.NUMBER),do:this.descendSubstack(e,\"SUBSTACK\")},this.analyzeLoop());case\"control_repeat_until\":{this.usesTimer=!1;const t=this.descendInputOfBlock(e,\"CONDITION\").toType(d.BOOLEAN),i=this.usesTimer;return new p(u.CONTROL_WHILE,{condition:new m(c.OP_NOT,d.BOOLEAN,{operand:t}),do:this.descendSubstack(e,\"SUBSTACK\"),warpTimer:i},this.analyzeLoop()||i)}case\"control_stop\":{const t=e.fields.STOP_OPTION.value;return\"all\"===t?new p(u.CONTROL_STOP_ALL,{},!0):new p(\"other scripts in sprite\"===t||\"other scripts in stage\"===t?u.CONTROL_STOP_OTHERS:\"this script\"===t?u.CONTROL_STOP_SCRIPT:u.NOP)}case\"control_wait\":return new p(u.CONTROL_WAIT,{seconds:this.descendInputOfBlock(e,\"DURATION\").toType(d.NUMBER)},!0);case\"control_wait_until\":return new p(u.CONTROL_WAIT_UNTIL,{condition:this.descendInputOfBlock(e,\"CONDITION\").toType(d.BOOLEAN)},!0);case\"control_while\":return new p(u.CONTROL_WHILE,{condition:this.descendInputOfBlock(e,\"CONDITION\").toType(d.BOOLEAN),do:this.descendSubstack(e,\"SUBSTACK\"),warpTimer:!1},this.analyzeLoop());case\"control_clear_counter\":return new p(u.CONTROL_CLEAR_COUNTER);case\"control_incr_counter\":return new p(u.CONTORL_INCR_COUNTER);case\"data_addtolist\":return new p(u.LIST_ADD,{list:this.descendVariable(e,\"LIST\",v),item:this.descendInputOfBlock(e,\"ITEM\",!0)});case\"data_changevariableby\":{const t=this.descendVariable(e,\"VARIABLE\",y);return new p(u.VAR_SET,{variable:t,value:new m(c.OP_ADD,d.NUMBER_OR_NAN,{left:new m(c.VAR_GET,d.ANY,{variable:t}).toType(d.NUMBER),right:this.descendInputOfBlock(e,\"VALUE\").toType(d.NUMBER)})})}case\"data_deletealloflist\":return new p(u.LIST_DELETE_ALL,{list:this.descendVariable(e,\"LIST\",v)});case\"data_deleteoflist\":{const t=this.descendInputOfBlock(e,\"INDEX\");return t.isConstant(\"all\")?new p(u.LIST_DELETE_ALL,{list:this.descendVariable(e,\"LIST\",v)}):new p(u.LIST_DELETE,{list:this.descendVariable(e,\"LIST\",v),index:t})}case\"data_hidelist\":return new p(u.LIST_HIDE,{list:this.descendVariable(e,\"LIST\",v)});case\"data_hidevariable\":return new p(u.VAR_HIDE,{variable:this.descendVariable(e,\"VARIABLE\",y)});case\"data_insertatlist\":return new p(u.LIST_INSERT,{list:this.descendVariable(e,\"LIST\",v),index:this.descendInputOfBlock(e,\"INDEX\"),item:this.descendInputOfBlock(e,\"ITEM\",!0)});case\"data_replaceitemoflist\":return new p(u.LIST_REPLACE,{list:this.descendVariable(e,\"LIST\",v),index:this.descendInputOfBlock(e,\"INDEX\"),item:this.descendInputOfBlock(e,\"ITEM\",!0)});case\"data_setvariableto\":return new p(u.VAR_SET,{variable:this.descendVariable(e,\"VARIABLE\",y),value:this.descendInputOfBlock(e,\"VALUE\",!0)});case\"data_showlist\":return new p(u.LIST_SHOW,{list:this.descendVariable(e,\"LIST\",v)});case\"data_showvariable\":return new p(u.VAR_SHOW,{variable:this.descendVariable(e,\"VARIABLE\",y)});case\"event_broadcast\":return new p(u.EVENT_BROADCAST,{broadcast:this.descendInputOfBlock(e,\"BROADCAST_INPUT\").toType(d.STRING)});case\"event_broadcastandwait\":return new p(u.EVENT_BROADCAST_AND_WAIT,{broadcast:this.descendInputOfBlock(e,\"BROADCAST_INPUT\").toType(d.STRING)},!0);case\"looks_changeeffectby\":return new p(u.LOOKS_EFFECT_CHANGE,{effect:e.fields.EFFECT.value.toLowerCase(),value:this.descendInputOfBlock(e,\"CHANGE\").toType(d.NUMBER)});case\"looks_changesizeby\":return new p(u.LOOKS_SIZE_CHANGE,{size:this.descendInputOfBlock(e,\"CHANGE\").toType(d.NUMBER)});case\"looks_cleargraphiceffects\":return new p(u.LOOKS_EFFECT_CLEAR);case\"looks_goforwardbackwardlayers\":return\"forward\"===e.fields.FORWARD_BACKWARD.value?new p(u.LOOKS_LAYER_FORWARD,{layers:this.descendInputOfBlock(e,\"NUM\").toType(d.NUMBER)}):new p(u.LOOKS_LAYER_BACKWARD,{layers:this.descendInputOfBlock(e,\"NUM\").toType(d.NUMBER)});case\"looks_gotofrontback\":return\"front\"===e.fields.FRONT_BACK.value?new p(u.LOOKS_LAYER_FRONT):new p(u.LOOKS_LAYER_BACK);case\"looks_hide\":return new p(u.LOOKS_HIDE);case\"looks_nextbackdrop\":return new p(u.LOOKS_BACKDROP_NEXT);case\"looks_nextcostume\":return new p(u.LOOKS_COSTUME_NEXT);case\"looks_say\":return new p(u.LOOKS_SAY,{message:this.descendInputOfBlock(e,\"MESSAGE\")});case\"looks_seteffectto\":return new p(u.LOOKS_EFFECT_SET,{effect:e.fields.EFFECT.value.toLowerCase(),value:this.descendInputOfBlock(e,\"VALUE\").toType(d.NUMBER)});case\"looks_setsizeto\":return new p(u.LOOKS_SIZE_SET,{size:this.descendInputOfBlock(e,\"SIZE\").toType(d.NUMBER)});case\"looks_show\":return new p(u.LOOKS_SHOW);case\"looks_switchbackdropto\":return new p(u.LOOKS_BACKDROP_SET,{backdrop:this.descendInputOfBlock(e,\"BACKDROP\",!0)});case\"looks_switchcostumeto\":return new p(u.LOOKS_COSTUME_SET,{costume:this.descendInputOfBlock(e,\"COSTUME\",!0)});case\"looks_think\":return new p(u.LOOKS_THINK,{message:this.descendInputOfBlock(e,\"MESSAGE\")});case\"motion_changexby\":return new p(u.MOTION_X_CHANGE,{dx:this.descendInputOfBlock(e,\"DX\").toType(d.NUMBER)});case\"motion_changeyby\":return new p(u.MOTION_Y_CHANGE,{dy:this.descendInputOfBlock(e,\"DY\").toType(d.NUMBER)});case\"motion_gotoxy\":return new p(u.MOTION_XY_SET,{x:this.descendInputOfBlock(e,\"X\").toType(d.NUMBER),y:this.descendInputOfBlock(e,\"Y\").toType(d.NUMBER)});case\"motion_ifonedgebounce\":return new p(u.MOTION_IF_ON_EDGE_BOUNCE);case\"motion_movesteps\":return new p(u.MOTION_STEP,{steps:this.descendInputOfBlock(e,\"STEPS\").toType(d.NUMBER)});case\"motion_pointindirection\":return new p(u.MOTION_DIRECTION_SET,{direction:this.descendInputOfBlock(e,\"DIRECTION\").toType(d.NUMBER)});case\"motion_setrotationstyle\":return new p(u.MOTION_ROTATION_STYLE_SET,{style:e.fields.STYLE.value});case\"motion_setx\":return new p(u.MOTION_X_SET,{x:this.descendInputOfBlock(e,\"X\").toType(d.NUMBER)});case\"motion_sety\":return new p(u.MOTION_Y_SET,{y:this.descendInputOfBlock(e,\"Y\").toType(d.NUMBER)});case\"motion_turnleft\":return new p(u.MOTION_DIRECTION_SET,{direction:new m(c.OP_SUBTRACT,d.NUMBER,{left:new m(c.MOTION_DIRECTION_GET,d.NUMBER),right:this.descendInputOfBlock(e,\"DEGREES\").toType(d.NUMBER)})});case\"motion_turnright\":return new p(u.MOTION_DIRECTION_SET,{direction:new m(c.OP_ADD,d.NUMBER,{left:new m(c.MOTION_DIRECTION_GET,d.NUMBER),right:this.descendInputOfBlock(e,\"DEGREES\").toType(d.NUMBER)})});case\"pen_clear\":return new p(u.PEN_CLEAR);case\"pen_changePenColorParamBy\":return new p(u.PEN_COLOR_PARAM_CHANGE,{param:this.descendInputOfBlock(e,\"COLOR_PARAM\").toType(d.STRING),value:this.descendInputOfBlock(e,\"VALUE\").toType(d.NUMBER)});case\"pen_changePenHueBy\":return new p(u.PEN_COLOR_HUE_CHANGE_LEGACY,{hue:this.descendInputOfBlock(e,\"HUE\").toType(d.NUMBER)});case\"pen_changePenShadeBy\":return new p(u.PEN_COLOR_SHADE_CHANGE_LEGACY,{shade:this.descendInputOfBlock(e,\"SHADE\").toType(d.NUMBER)});case\"pen_penDown\":return new p(u.PEN_DOWN);case\"pen_penUp\":return new p(u.PEN_UP);case\"pen_setPenColorParamTo\":return new p(u.PEN_COLOR_PARAM_SET,{param:this.descendInputOfBlock(e,\"COLOR_PARAM\").toType(d.STRING),value:this.descendInputOfBlock(e,\"VALUE\").toType(d.NUMBER)});case\"pen_setPenColorToColor\":return new p(u.PEN_COLOR_SET,{color:this.descendInputOfBlock(e,\"COLOR\")});case\"pen_setPenHueToNumber\":return new p(u.PEN_COLOR_HUE_SET_LEGACY,{hue:this.descendInputOfBlock(e,\"HUE\").toType(d.NUMBER)});case\"pen_setPenShadeToNumber\":return new p(u.PEN_COLOR_SHADE_SET_LEGACY,{shade:this.descendInputOfBlock(e,\"SHADE\").toType(d.NUMBER)});case\"pen_setPenSizeTo\":return new p(u.PEN_SIZE_SET,{size:this.descendInputOfBlock(e,\"SIZE\").toType(d.NUMBER)});case\"pen_changePenSizeBy\":return new p(u.PEN_SIZE_CHANGE,{size:this.descendInputOfBlock(e,\"SIZE\").toType(d.NUMBER)});case\"pen_stamp\":return new p(u.PEN_STAMP);case\"procedures_call\":{const t=e.mutation.proccode;if(e.mutation.return){const t=this.descendVisualReport(e);if(t)return t}if(\"tw:debugger;\"===t)return new p(u.DEBUGGER);const i=this.getProcedureInfo(e);return new p(i.opcode,i.inputs,i.yields)}case\"procedures_return\":return new p(u.PROCEDURE_RETURN,{value:this.descendInputOfBlock(e,\"VALUE\")});case\"sensing_resettimer\":return new p(u.SENSING_TIMER_RESET);default:{if(this.runtime.getOpcodeFunction(e.opcode)){if(l.stacked.includes(e.opcode))return this.descendCompatLayerStack(e);const t=this.getBlockInfo(e.opcode);if(t){const i=t.info.blockType;if(i===a.COMMAND||i===a.CONDITIONAL||i===a.LOOP)return this.descendCompatLayerStack(e)}}const t=this.descendVisualReport(e);if(t)return t;throw s.warn(\"IR: Unknown stacked block: \".concat(e.opcode),e),new Error(\"IR: Unknown stacked block: \".concat(e.opcode))}}}descendSubstack(e,t){const i=e.inputs[t];if(!i)return new g;const n=i.block;return this.walkStack(n)}walkStack(e){const t=new g;let i=e;for(;null!==i;){const e=this.getBlockById(i);if(!e)break;const n=this.descendStackedBlock(e);this.script.yields=this.script.yields||n.yields,t.blocks.push(n),i=e.next}return t}getProcedureInfo(e){const t=e.mutation.proccode,i=this.blocks.getProcedureParamNamesIdsAndDefaults(t);if(null===i)return{opcode:u.NOP,yields:!1};const[n,o,a]=i;if(this.runtime.getAddonBlock(t)){const i={};for(let t=0;t0;){this.compilingProcedures=this.proceduresToCompile,this.proceduresToCompile=new Map;for(const[e,i]of this.compilingProcedures.entries())if(t[e]){const i=t[e];this.procedures[e]=i,this.addProcedureDependencies(i.dependedProcedures)}else{const n=\"W\"===e.charAt(0),o=new w(this.thread);o.setProcedureVariant(e),n&&o.enableWarp();const a=this.generateScriptTree(o,i);this.procedures[e]=a,t[e]=a}}for(;this.analyzeScript(e);)this.analyzedProcedures=new Set;return new f(e,this.procedures)}}}},function(e,t,i){const{InputOpcode:n,InputType:o}=i(125),{IntermediateInput:a,IntermediateStackBlock:r,IntermediateStack:s}=i(115);class l{constructor(e,t){this.source=e,t instanceof a?(this.intermediate=t,this.type=4):(this.intermediate=null,this.type=t)}asNumber(){return\"(+\".concat(this.source,\" || 0)\")}asNumberOrNaN(){return\"(+\".concat(this.source,\")\")}asString(){return'(\"\" + '.concat(this.source,\")\")}asBoolean(){return\"toBoolean(\".concat(this.source,\")\")}asColor(){return this.asUnknown()}asUnknown(){return this.source}asSafe(){return this.asUnknown()}isAlwaysNumber(){return!1}isAlwaysNumberOrNaN(){return!1}isNeverNumber(){return!1}}class u{constructor(e){this.prefix=e,this.count=0}next(){return\"\".concat(this.prefix).concat(this.count++)}}class c{constructor(e){this.real=e,this.fakeThis={script:e.script,ir:e.ir,target:e.target,get frames(){return e.frames},get currentFrame(){return e.currentFrame},get source(){return e.source},set source(t){e.source=t},localVariables:new u(\"oldCompilerLocal\"),descendInput(t){const i=e.descendInput(t);return new l(i,t)},descendStack(t,i){e.descendStack(t,i)},yieldLoop:()=>e.yieldLoop(),yieldNotWarp:()=>e.yieldNotWarp(),yieldStuckOrNotWarp:()=>e.yieldStuckOrNotWarp(),yielded:()=>e.yielded(),requestRedraw:()=>e.requestRedraw()}}descendInput(e){throw new Error(\"Unknown input: \".concat(e.kind))}descendStackedBlock(e){throw new Error(\"Unknown stacked block: \".concat(e.kind))}descendInputFromNewCompiler(e){const t=e.inputs.oldNode;return this.descendInput.call(this.fakeThis,t).asSafe()}descendStackedBlockFromNewCompiler(e){const t=e.inputs.oldNode;this.descendStackedBlock.call(this.fakeThis,t)}}c.unstable_exports={TYPE_NUMBER:1,TYPE_STRING:2,TYPE_BOOLEAN:3,TYPE_UNKNOWN:4,TYPE_NUMBER_NAN:5,VariablePool:u,TypedInput:l,Frame:class{constructor(e){this.isLoop=e,this.isLastBlock=!1}}};const d={enabled:!1,IRGeneratorStub:class{},ScriptTreeGeneratorStub:class{constructor(e){this.real=e,this.fakeThis={thread:e.thread,target:e.target,blocks:e.blocks,runtime:e.runtime,stage:e.stage,script:e.script,descendInputOfBlock:(t,i)=>e.descendInputOfBlock(t,i,!0),descendSubstack:(t,i)=>e.descendSubstack(t,i),analyzeLoop(){e.script.yields=!0}}}descendInput(e){return null}descendStackedBlock(e){return null}descendInputFromNewCompiler(e){const t=this.descendInput.call(this.fakeThis,e);return t?new a(n.OLD_COMPILER_COMPATIBILITY_LAYER,o.ANY,{oldNode:t},!0):null}descendStackedBlockFromNewCompiler(e){const t=this.descendStackedBlock.call(this.fakeThis,e);return t?new r(n.OLD_COMPILER_COMPATIBILITY_LAYER,{oldNode:t},!0):null}},TypedInput:l,JSGeneratorStub:c};e.exports=d},function(e,t,i){const n={Timer:i(124),Cast:i(46),log:i(38),blockUtility:i(828),thread:null};let o=\"\";const a={};o+=\"let stuckCounter = 0;\\nconst isStuck = () => {\\n // The real time is not checked on every call for performance.\\n stuckCounter++;\\n if (stuckCounter === 100) {\\n stuckCounter = 0;\\n return globalState.thread.target.runtime.sequencer.timer.timeElapsed() > 500;\\n }\\n return false;\\n};\",a.startHats=\"const startHats = (requestedHat, optMatchFields) => {\\n const thread = globalState.thread;\\n const threads = thread.target.runtime.startHats(requestedHat, optMatchFields);\\n return threads;\\n}\",a.waitThreads=\"const waitThreads = function*(threads) {\\n const thread = globalState.thread;\\n const runtime = thread.target.runtime;\\n\\n while (true) {\\n // determine whether any threads are running\\n let anyRunning = false;\\n for (let i = 0; i < threads.length; i++) {\\n if (runtime.threads.indexOf(threads[i]) !== -1) {\\n anyRunning = true;\\n break;\\n }\\n }\\n if (!anyRunning) {\\n // all threads are finished, can resume\\n return;\\n }\\n\\n let allWaiting = true;\\n for (let i = 0; i < threads.length; i++) {\\n if (!runtime.isWaitingThread(threads[i])) {\\n allWaiting = false;\\n break;\\n }\\n }\\n if (allWaiting) {\\n thread.status = 3; // STATUS_YIELD_TICK\\n }\\n\\n yield;\\n }\\n}\",a.executeInCompatibilityLayer=\"let hasResumedFromPromise = false;\\nconst waitPromise = function*(promise) {\\n const thread = globalState.thread;\\n let returnValue;\\n\\n // enter STATUS_PROMISE_WAIT and yield\\n // this will stop script execution until the promise handlers reset the thread status\\n // because promise handlers might execute immediately, configure thread.status here\\n thread.status = 1; // STATUS_PROMISE_WAIT\\n\\n promise\\n .then(value => {\\n returnValue = value;\\n thread.status = 0; // STATUS_RUNNING\\n }, error => {\\n thread.status = 0; // STATUS_RUNNING\\n globalState.log.warn('Promise rejected in compiled script:', error);\\n returnValue = '' + error;\\n thread.status = 0; // STATUS_RUNNING\\n });\\n\\n yield;\\n\\n return returnValue;\\n};\\nconst isPromise = value => (\\n // see engine/execute.js\\n value !== null &&\\n typeof value === 'object' &&\\n typeof value.then === 'function'\\n);\\nconst executeInCompatibilityLayer = function*(inputs, blockFunction, isWarp, useFlags, blockId, branchInfo) {\\n const thread = globalState.thread;\\n const blockUtility = globalState.blockUtility;\\n const stackFrame = branchInfo ? branchInfo.stackFrame : {};\\n\\n const finish = (returnValue) => {\\n if (branchInfo) {\\n if (typeof returnValue === 'undefined' && blockUtility._startedBranch) {\\n branchInfo.isLoop = blockUtility._startedBranch[1];\\n return blockUtility._startedBranch[0];\\n }\\n branchInfo.isLoop = branchInfo.defaultIsLoop;\\n return returnValue;\\n }\\n return returnValue;\\n };\\n\\n const executeBlock = () => {\\n blockUtility.init(thread, blockId, stackFrame);\\n return blockFunction(inputs, blockUtility);\\n };\\n\\n let returnValue = executeBlock();\\n if (isPromise(returnValue)) {\\n returnValue = finish(yield* waitPromise(returnValue));\\n if (useFlags) hasResumedFromPromise = true;\\n return returnValue;\\n }\\n\\n if (thread.status === 1 /* STATUS_PROMISE_WAIT */ || thread.status === 4 /* STATUS_DONE */) {\\n // Something external is forcing us to stop\\n yield;\\n // Make up a return value because whatever is forcing us to stop can't specify one\\n return '';\\n }\\n\\n while (thread.status === 2 /* STATUS_YIELD */ || thread.status === 3 /* STATUS_YIELD_TICK */) {\\n // Yielded threads will run next iteration.\\n if (thread.status === 2 /* STATUS_YIELD */) {\\n thread.status = 0; // STATUS_RUNNING\\n // Yield back to the event loop when stuck or not in warp mode.\\n if (!isWarp || isStuck()) {\\n yield;\\n }\\n } else {\\n // status is STATUS_YIELD_TICK, always yield to the event loop\\n yield;\\n }\\n\\n returnValue = executeBlock();\\n if (isPromise(returnValue)) {\\n returnValue = finish(yield* waitPromise(returnValue));\\n if (useFlags) hasResumedFromPromise = true;\\n return returnValue;\\n }\\n\\n if (thread.status === 1 /* STATUS_PROMISE_WAIT */ || thread.status === 4 /* STATUS_DONE */) {\\n yield;\\n return finish('');\\n }\\n }\\n\\n // todo: do we have to do anything extra if status is STATUS_DONE?\\n\\n return finish(returnValue);\\n}\",a.createBranchInfo=\"const createBranchInfo = (isLoop) => ({\\n defaultIsLoop: isLoop,\\n isLoop: false,\\n branch: 0,\\n stackFrame: {}\\n});\",a.retire=\"const retire = () => {\\n const thread = globalState.thread;\\n thread.target.runtime.sequencer.retireThread(thread);\\n}\",a.toNotNaN=\"const toNotNaN = value => Number.isNaN(value) ? 0 : value\",a.toBoolean=\"const toBoolean = value => {\\n if (typeof value === 'boolean') {\\n return value;\\n }\\n if (typeof value === 'string') {\\n if (value === '' || value === '0' || value.toLowerCase() === 'false') {\\n return false;\\n }\\n return true;\\n }\\n return !!value;\\n}\",a.limitPrecision=\"const limitPrecision = value => {\\n const rounded = Math.round(value);\\n const delta = value - rounded;\\n return (Math.abs(delta) < 1e-9) ? rounded : value;\\n}\",o+=\"const isNotActuallyZero = val => {\\n if (typeof val !== 'string') return false;\\n for (let i = 0; i < val.length; i++) {\\n const code = val.charCodeAt(i);\\n if (code === 48 || code === 9) {\\n return false;\\n }\\n }\\n return true;\\n};\",o+=\"const compareEqualSlow = (v1, v2) => {\\n const n1 = +v1;\\n if (Number.isNaN(n1) || (n1 === 0 && isNotActuallyZero(v1))) return ('' + v1).toLowerCase() === ('' + v2).toLowerCase();\\n const n2 = +v2;\\n if (Number.isNaN(n2) || (n2 === 0 && isNotActuallyZero(v2))) return ('' + v1).toLowerCase() === ('' + v2).toLowerCase();\\n return n1 === n2;\\n};\\nconst compareEqual = (v1, v2) => (typeof v1 === 'number' && typeof v2 === 'number' && !Number.isNaN(v1) && !Number.isNaN(v2) || v1 === v2) ? v1 === v2 : compareEqualSlow(v1, v2);\",a.compareGreaterThan=\"const compareGreaterThanSlow = (v1, v2) => {\\n let n1 = +v1;\\n let n2 = +v2;\\n if (n1 === 0 && isNotActuallyZero(v1)) {\\n n1 = NaN;\\n } else if (n2 === 0 && isNotActuallyZero(v2)) {\\n n2 = NaN;\\n }\\n if (Number.isNaN(n1) || Number.isNaN(n2)) {\\n const s1 = ('' + v1).toLowerCase();\\n const s2 = ('' + v2).toLowerCase();\\n return s1 > s2;\\n }\\n return n1 > n2;\\n};\\nconst compareGreaterThan = (v1, v2) => typeof v1 === 'number' && typeof v2 === 'number' && !Number.isNaN(v1) ? v1 > v2 : compareGreaterThanSlow(v1, v2)\",a.compareLessThan=\"const compareLessThanSlow = (v1, v2) => {\\n let n1 = +v1;\\n let n2 = +v2;\\n if (n1 === 0 && isNotActuallyZero(v1)) {\\n n1 = NaN;\\n } else if (n2 === 0 && isNotActuallyZero(v2)) {\\n n2 = NaN;\\n }\\n if (Number.isNaN(n1) || Number.isNaN(n2)) {\\n const s1 = ('' + v1).toLowerCase();\\n const s2 = ('' + v2).toLowerCase();\\n return s1 < s2;\\n }\\n return n1 < n2;\\n};\\nconst compareLessThan = (v1, v2) => typeof v1 === 'number' && typeof v2 === 'number' && !Number.isNaN(v2) ? v1 < v2 : compareLessThanSlow(v1, v2)\",a.randomInt=\"const randomInt = (low, high) => low + Math.floor(Math.random() * ((high + 1) - low))\",a.randomFloat=\"const randomFloat = (low, high) => (Math.random() * (high - low)) + low\",a.timer=\"const timer = () => {\\n const t = new globalState.Timer({\\n now: () => globalState.thread.target.runtime.currentMSecs\\n });\\n t.start();\\n return t;\\n}\",a.daysSince2000=\"const daysSince2000 = () => (Date.now() - 946684800000) / (24 * 60 * 60 * 1000)\",a.distance=\"const distance = menu => {\\n const thread = globalState.thread;\\n if (thread.target.isStage) return 10000;\\n\\n let targetX = 0;\\n let targetY = 0;\\n if (menu === '_mouse_') {\\n targetX = thread.target.runtime.ioDevices.mouse.getScratchX();\\n targetY = thread.target.runtime.ioDevices.mouse.getScratchY();\\n } else {\\n const distTarget = thread.target.runtime.getSpriteTargetByName(menu);\\n if (!distTarget) return 10000;\\n targetX = distTarget.x;\\n targetY = distTarget.y;\\n }\\n\\n const dx = thread.target.x - targetX;\\n const dy = thread.target.y - targetY;\\n return Math.sqrt((dx * dx) + (dy * dy));\\n}\",o+=\"const listIndexSlow = (index, length) => {\\n if (index === 'last') {\\n return length - 1;\\n } else if (index === 'random' || index === 'any') {\\n if (length > 0) {\\n return (Math.random() * length) | 0;\\n }\\n return -1;\\n }\\n index = (+index || 0) | 0;\\n if (index < 1 || index > length) {\\n return -1;\\n }\\n return index - 1;\\n};\\nconst listIndex = (index, length) => {\\n if (typeof index !== 'number') {\\n return listIndexSlow(index, length);\\n }\\n index = index | 0;\\n return index < 1 || index > length ? -1 : index - 1;\\n};\",a.listGet=\"const listGet = (list, idx) => {\\n const index = listIndex(idx, list.length);\\n if (index === -1) {\\n return '';\\n }\\n return list[index];\\n}\",a.listReplace=\"const listReplace = (list, idx, value) => {\\n const index = listIndex(idx, list.value.length);\\n if (index === -1) {\\n return;\\n }\\n list.value[index] = value;\\n list._monitorUpToDate = false;\\n}\",a.listInsert=\"const listInsert = (list, idx, value) => {\\n const index = listIndex(idx, list.value.length + 1);\\n if (index === -1) {\\n return;\\n }\\n list.value.splice(index, 0, value);\\n list._monitorUpToDate = false;\\n}\",a.listDelete=\"const listDelete = (list, idx) => {\\n if (idx === 'all') {\\n list.value = [];\\n return;\\n }\\n const index = listIndex(idx, list.value.length);\\n if (index === -1) {\\n return;\\n }\\n list.value.splice(index, 1);\\n list._monitorUpToDate = false;\\n}\",a.listContains=\"const listContains = (list, item) => {\\n // TODO: evaluate whether indexOf is worthwhile here\\n if (list.value.indexOf(item) !== -1) {\\n return true;\\n }\\n for (let i = 0; i < list.value.length; i++) {\\n if (compareEqual(list.value[i], item)) {\\n return true;\\n }\\n }\\n return false;\\n}\",a.listIndexOf=\"const listIndexOf = (list, item) => {\\n for (let i = 0; i < list.value.length; i++) {\\n if (compareEqual(list.value[i], item)) {\\n return i + 1;\\n }\\n }\\n return 0;\\n}\",a.listContents=\"const listContents = list => {\\n for (let i = 0; i < list.value.length; i++) {\\n const listItem = list.value[i];\\n // this is an intentional break from what scratch 3 does to address our automatic string -> number conversions\\n // it fixes more than it breaks\\n if ((listItem + '').length !== 1) {\\n return list.value.join(' ');\\n }\\n }\\n return list.value.join('');\\n}\",a.colorToList=\"const colorToList = color => globalState.Cast.toRgbColorList(color)\",a.mod=\"const mod = (n, modulus) => {\\n let result = n % modulus;\\n if (result / modulus < 0) result += modulus;\\n return result;\\n}\",a.tan=\"const tan = (angle) => {\\n switch (angle % 360) {\\n case -270: case 90: return Infinity;\\n case -90: case 270: return -Infinity;\\n }\\n return Math.round(Math.tan((Math.PI * angle) / 180) * 1e10) / 1e10;\\n}\",a.yieldThenCall=\"const yieldThenCall = function* (callback, ...args) {\\n yield;\\n return callback(...args);\\n}\",a.yieldThenCallGenerator=\"const yieldThenCallGenerator = function* (callback, ...args) {\\n yield;\\n return yield* callback(...args);\\n}\";const r=e=>{n.thread=e,e.generator.next()},s=[];r.scopedEval=e=>{const t=(e=>{let t=\"let stuckCounter = 0;\\nconst isStuck = () => {\\n // The real time is not checked on every call for performance.\\n stuckCounter++;\\n if (stuckCounter === 100) {\\n stuckCounter = 0;\\n return globalState.thread.target.runtime.sequencer.timer.timeElapsed() > 500;\\n }\\n return false;\\n};const isNotActuallyZero = val => {\\n if (typeof val !== 'string') return false;\\n for (let i = 0; i < val.length; i++) {\\n const code = val.charCodeAt(i);\\n if (code === 48 || code === 9) {\\n return false;\\n }\\n }\\n return true;\\n};const compareEqualSlow = (v1, v2) => {\\n const n1 = +v1;\\n if (Number.isNaN(n1) || (n1 === 0 && isNotActuallyZero(v1))) return ('' + v1).toLowerCase() === ('' + v2).toLowerCase();\\n const n2 = +v2;\\n if (Number.isNaN(n2) || (n2 === 0 && isNotActuallyZero(v2))) return ('' + v1).toLowerCase() === ('' + v2).toLowerCase();\\n return n1 === n2;\\n};\\nconst compareEqual = (v1, v2) => (typeof v1 === 'number' && typeof v2 === 'number' && !Number.isNaN(v1) && !Number.isNaN(v2) || v1 === v2) ? v1 === v2 : compareEqualSlow(v1, v2);const listIndexSlow = (index, length) => {\\n if (index === 'last') {\\n return length - 1;\\n } else if (index === 'random' || index === 'any') {\\n if (length > 0) {\\n return (Math.random() * length) | 0;\\n }\\n return -1;\\n }\\n index = (+index || 0) | 0;\\n if (index < 1 || index > length) {\\n return -1;\\n }\\n return index - 1;\\n};\\nconst listIndex = (index, length) => {\\n if (typeof index !== 'number') {\\n return listIndexSlow(index, length);\\n }\\n index = index | 0;\\n return index < 1 || index > length ? -1 : index - 1;\\n};\";for(const i of Object.keys(a))e.includes(i)&&(t+=\"\".concat(a[i],\";\"));return t+=\"return \".concat(e),t})(e);try{return new Function(\"globalState\",t)(n)}catch(e){throw n.log.error(\"was unable to compile script\",t),e}},r.runtimeFunctions=a,r.saveGlobalState=()=>{s.push(n.thread)},r.restoreGlobalState=()=>{n.thread=s.pop()},e.exports=r},function(e,t,i){const n=i(64),o=i(87),a=i(46),r=i(122),s=i(871),l=i(123);class u extends s{constructor(e,t){super(t,e.blocks),this.sprite=e,this.renderer=null,this.runtime&&(this.renderer=this.runtime.renderer),this.drawableID=null,this.dragging=!1,this.effects={color:0,fisheye:0,whirl:0,pixelate:0,mosaic:0,brightness:0,ghost:0},this.isOriginal=!0,this.isStage=!1,this.x=0,this.y=0,this.direction=90,this.draggable=!1,this.visible=!0,this.size=100,this.currentCostume=0,this.rotationStyle=u.ROTATION_STYLE_ALL_AROUND,this.volume=100,this.tempo=60,this.videoTransparency=50,this.videoState=u.VIDEO_STATE.ON,this.textToSpeechLanguage=null,this.onTargetMoved=null,this.onTargetVisualChange=null,this.interpolationData=null}initDrawable(e){this.renderer&&(this.drawableID=this.renderer.createDrawable(e)),this.isOriginal||this.runtime.startHats(\"control_start_as_clone\",null,this)}get audioPlayer(){console.warn(\"get audioPlayer deprecated, please update to use .sprite.soundBank methods\"),console.warn(new Error(\"stack for debug\").stack);const e=this.sprite.soundBank,t={playSound:t=>e.play(this,t)};return Object.defineProperty(this,\"audioPlayer\",{configurable:!1,enumerable:!0,writable:!1,value:t}),t}initAudio(){}static get ROTATION_STYLE_ALL_AROUND(){return\"all around\"}static get ROTATION_STYLE_LEFT_RIGHT(){return\"left-right\"}static get ROTATION_STYLE_NONE(){return\"don't rotate\"}static get VIDEO_STATE(){return{OFF:\"off\",ON:\"on\",ON_FLIPPED:\"on-flipped\"}}emitVisualChange(){this.onTargetVisualChange&&this.onTargetVisualChange(this)}setXY(e,t,i){if(this.isStage)return;if(this.dragging&&!i)return;const n=this.x,o=this.y;if(this.renderer){const i=this.runtime.runtimeOptions.fencing?this.renderer.getFencedPositionOfDrawable(this.drawableID,[e,t]):[e,t];this.x=i[0],this.y=i[1],this.renderer.updateDrawablePosition(this.drawableID,i),this.visible&&(this.emitVisualChange(),this.runtime.requestRedraw())}else this.x=e,this.y=t;this.onTargetMoved&&this.onTargetMoved(this,n,o,i),this.runtime.requestTargetsUpdate(this)}_getRenderedDirectionAndScale(){let e=this.direction,t=[this.size,this.size];if(this.rotationStyle===u.ROTATION_STYLE_NONE)e=90;else if(this.rotationStyle===u.ROTATION_STYLE_LEFT_RIGHT){e=90;t=[(this.direction<0?-1:1)*this.size,this.size]}return{direction:e,scale:t}}setDirection(e){if(!this.isStage&&isFinite(e)){if(this.direction=n.wrapClamp(e,-179,180),this.renderer){const{direction:e,scale:t}=this._getRenderedDirectionAndScale();this.renderer.updateDrawableDirectionScale(this.drawableID,e,t),this.visible&&(this.emitVisualChange(),this.runtime.requestRedraw())}this.runtime.requestTargetsUpdate(this)}}setDraggable(e){this.isStage||(this.draggable=!!e,this.runtime.requestTargetsUpdate(this))}setVisible(e){this.isStage||(this.visible=!!e,this.renderer&&(this.renderer.updateDrawableVisible(this.drawableID,this.visible),this.visible&&(this.emitVisualChange(),this.runtime.requestRedraw())),this.runtime.requestTargetsUpdate(this))}setSize(e){if(!this.isStage){if(this.renderer){const t=this.renderer.getCurrentSkinSize(this.drawableID),i=t[0],o=t[1],a=this.runtime.runtimeOptions.fencing,r=a?Math.min(1,Math.max(5/i,5/o)):0,s=a?Math.min(1.5*this.runtime.stageWidth/i,1.5*this.runtime.stageHeight/o):1/0;this.size=100*n.clamp(e/100,r,s);const{direction:l,scale:u}=this._getRenderedDirectionAndScale();this.renderer.updateDrawableDirectionScale(this.drawableID,l,u),this.visible&&(this.emitVisualChange(),this.runtime.requestRedraw())}else this.size=e;this.runtime.requestTargetsUpdate(this)}}setEffect(e,t){Object.prototype.hasOwnProperty.call(this.effects,e)&&(this.effects[e]=t,this.renderer&&(this.renderer.updateDrawableEffect(this.drawableID,e,t),this.visible&&(this.emitVisualChange(),this.runtime.requestRedraw())))}clearEffects(){for(const e in this.effects)Object.prototype.hasOwnProperty.call(this.effects,e)&&(this.effects[e]=0);if(this.renderer){for(const e in this.effects)Object.prototype.hasOwnProperty.call(this.effects,e)&&this.renderer.updateDrawableEffect(this.drawableID,e,0);this.visible&&(this.emitVisualChange(),this.runtime.requestRedraw())}}setCostume(e){if((e=Math.round(e))!==1/0&&e!==-1/0&&e||(e=0),this.currentCostume=n.wrapClamp(e,0,this.sprite.costumes.length-1),this.renderer){const e=this.sprite.costumes[this.currentCostume];this.renderer.updateDrawableSkinId(this.drawableID,e.skinId),this.visible&&(this.emitVisualChange(),this.runtime.requestRedraw())}this.runtime.requestTargetsUpdate(this)}addCostume(e,t){\"number\"!=typeof t||isNaN(t)?this.sprite.addCostumeAt(e,this.sprite.costumes.length):this.sprite.addCostumeAt(e,t)}renameCostume(e,t){const i=this.sprite.costumes.filter(((t,i)=>e!==i)).map((e=>e.name)),n=this.getCostumes()[e].name,a=o.unusedName(t,i);if(this.getCostumes()[e].name=a,this.isStage){const e=this.runtime.targets;for(let t=0;t=t)return null;const i=this.sprite.deleteCostumeAt(e);return e===this.currentCostume&&e===t-1?this.setCostume(e-1):ee.name));e.name=o.unusedName(e.name,i),\"number\"!=typeof t||isNaN(t)?this.sprite.sounds.push(e):this.sprite.sounds.splice(t,0,e)}renameSound(e,t){const i=this.sprite.sounds.filter(((t,i)=>e!==i)).map((e=>e.name)),n=this.sprite.sounds[e].name,a=o.unusedName(t,i);this.sprite.sounds[e].name=a,this.blocks.updateAssetName(n,a,\"sound\")}deleteSound(e){if(e<0||e>=this.sprite.sounds.length)return null;const t=this.sprite.sounds.splice(e,1)[0];return this.runtime.requestTargetsUpdate(this),t}setRotationStyle(e){if(e===u.ROTATION_STYLE_NONE?this.rotationStyle=u.ROTATION_STYLE_NONE:e===u.ROTATION_STYLE_ALL_AROUND?this.rotationStyle=u.ROTATION_STYLE_ALL_AROUND:e===u.ROTATION_STYLE_LEFT_RIGHT&&(this.rotationStyle=u.ROTATION_STYLE_LEFT_RIGHT),this.renderer){const{direction:e,scale:t}=this._getRenderedDirectionAndScale();this.renderer.updateDrawableDirectionScale(this.drawableID,e,t),this.visible&&(this.emitVisualChange(),this.runtime.requestRedraw())}this.runtime.requestTargetsUpdate(this)}getCostumeIndexByName(e){const t=this.getCostumes();for(let i=0;ie/2||i.top>t/2||i.bottom<-t/2)return!0}return!1}isTouchingSprite(e){e=a.toString(e);const t=this.runtime.getSpriteTargetByName(e);if(!t||!this.renderer)return!1;const i=t.sprite.clones.filter((e=>!e.dragging)).map((e=>e.drawableID));return this.renderer.isTouchingDrawables(this.drawableID,i)}isTouchingColor(e){return!!this.renderer&&this.renderer.isTouchingColor(this.drawableID,e)}colorIsTouchingColor(e,t){return!!this.renderer&&this.renderer.isTouchingColor(this.drawableID,e,t)}getLayerOrder(){return this.renderer?this.renderer.getDrawableOrder(this.drawableID):null}goToFront(){this.renderer&&this.renderer.setDrawableOrder(this.drawableID,1/0,l.SPRITE_LAYER),this.runtime.setExecutablePosition(this,1/0)}goToBack(){this.renderer&&this.renderer.setDrawableOrder(this.drawableID,-1/0,l.SPRITE_LAYER,!1),this.runtime.setExecutablePosition(this,-1/0)}goForwardLayers(e){this.renderer&&this.renderer.setDrawableOrder(this.drawableID,e,l.SPRITE_LAYER,!0),this.runtime.moveExecutable(this,e)}goBackwardLayers(e){this.renderer&&this.renderer.setDrawableOrder(this.drawableID,-e,l.SPRITE_LAYER,!0),this.runtime.moveExecutable(this,-e)}goBehindOther(e){if(this.renderer){const t=this.renderer.setDrawableOrder(e.drawableID,0,l.SPRITE_LAYER,!0);this.renderer.setDrawableOrder(this.drawableID,t,l.SPRITE_LAYER)}const t=this.runtime.executableTargets.indexOf(e);this.runtime.setExecutablePosition(this,t)}keepInFence(e,t,i){let n=i;n||(n={left:-this.runtime.stageWidth/2,right:this.runtime.stageWidth/2,top:this.runtime.stageHeight/2,bottom:-this.runtime.stageHeight/2});const o=this.getBounds();if(!o)return;o.left+=e-this.x,o.right+=e-this.x,o.top+=t-this.y,o.bottom+=t-this.y;let a=0,r=0;return o.leftn.right&&(a+=n.right-o.right),o.top>n.top&&(r+=n.top-o.top),o.bottom{const t=e.createClone();return t.x=400*(Math.random()-.5)/2,t.y=300*(Math.random()-.5)/2,t.direction=this.direction,t.draggable=this.draggable,t.visible=this.visible,t.size=this.size,t.currentCostume=this.currentCostume,t.rotationStyle=this.rotationStyle,t.effects=JSON.parse(JSON.stringify(this.effects)),t.variables=this.duplicateVariables(t.blocks),t.updateAllDrawableProperties(),t}))}onGreenFlag(){this.clearEffects()}onStopAll(){this.clearEffects()}postSpriteInfo(e){const t=Object.prototype.hasOwnProperty.call(e,\"force\")?e.force:null,i=Object.prototype.hasOwnProperty.call(e,\"x\"),n=Object.prototype.hasOwnProperty.call(e,\"y\");(i||n)&&this.setXY(i?e.x:this.x,n?e.y:this.y,t),Object.prototype.hasOwnProperty.call(e,\"direction\")&&this.setDirection(e.direction),Object.prototype.hasOwnProperty.call(e,\"draggable\")&&this.setDraggable(e.draggable),Object.prototype.hasOwnProperty.call(e,\"rotationStyle\")&&this.setRotationStyle(e.rotationStyle),Object.prototype.hasOwnProperty.call(e,\"visible\")&&this.setVisible(e.visible),Object.prototype.hasOwnProperty.call(e,\"size\")&&this.setSize(e.size)}startDrag(){this.dragging=!0}stopDrag(){this.dragging=!1}toJSON(){const e=this.getCostumes();return{id:this.id,name:this.getName(),isStage:this.isStage,x:this.x,y:this.y,size:this.size,direction:this.direction,draggable:this.draggable,currentCostume:this.currentCostume,costume:e[this.currentCostume],costumeCount:e.length,visible:this.visible,rotationStyle:this.rotationStyle,comments:this.comments,blocks:this.blocks._blocks,variables:this.variables,costumes:e,sounds:this.getSounds(),textToSpeechLanguage:this.textToSpeechLanguage,tempo:this.tempo,volume:this.volume,videoTransparency:this.videoTransparency,videoState:this.videoState}}dispose(){this.isOriginal||this.runtime.changeCloneCounter(-1),this.runtime.stopForTarget(this),this.runtime.removeExecutable(this),this.sprite.removeClone(this),this.renderer&&null!==this.drawableID&&(this.renderer.destroyDrawable(this.drawableID,this.isStage?l.BACKGROUND_LAYER:l.SPRITE_LAYER),this.visible&&(this.emitVisualChange(),this.runtime.requestRedraw()))}}e.exports=u},function(e,t,i){const n=i(107),o=i(223);class a{constructor(e,t,i,o,r,s,l){this.id=e||n(),this.text=t,this.x=i,this.y=o,this.width=Math.max(Number(r),a.MIN_WIDTH),this.height=Math.max(Number(s),a.MIN_HEIGHT),this.minimized=l||!1,this.blockId=null}toXML(){return'').concat(o(this.text),\"\")}static get MIN_WIDTH(){return 20}static get MIN_HEIGHT(){return 20}static get DEFAULT_WIDTH(){return 100}static get DEFAULT_HEIGHT(){return 100}}e.exports=a},function(e,t,i){const n=i(298),o=i(147),{loadSoundFromAsset:a}=i(225),{loadCostumeFromAsset:r}=i(226),s=i(393),l=i(87),u=i(123);class c{constructor(e,t){this.runtime=t,e||(e=new o(t)),this.blocks=e,this.name=\"\",this.costumes_=[],this.sounds=[],this.clones=[],this.soundBank=null,this.runtime&&this.runtime.audioEngine&&(this.soundBank=this.runtime.audioEngine.createBank())}set costumes(e){this.costumes_=[];for(const t of e)this.addCostumeAt(t,this.costumes_.length)}get costumes(){return this.costumes_}addCostumeAt(e,t){e.name||(e.name=\"\");const i=this.costumes_.map((e=>e.name));e.name=l.unusedName(e.name,i),this.costumes_.splice(t,0,e)}deleteCostumeAt(e){return this.costumes.splice(e,1)[0]}createClone(e){const t=new n(this,this.runtime);if(t.isOriginal=0===this.clones.length,this.clones.push(t),t.initAudio(),t.isOriginal){const i=\"string\"==typeof e?e:u.SPRITE_LAYER;t.initDrawable(i),this.runtime.fireTargetWasCreated(t)}else this.runtime.fireTargetWasCreated(t,this.clones[0]);return t}removeClone(e){this.runtime.fireTargetWasRemoved(e);const t=this.clones.indexOf(e);t>=0&&this.clones.splice(t,1)}duplicate(){const e=new c(null,this.runtime),t=this.blocks._blocks,i=Object.keys(t).map((e=>t[e])),n=JSON.parse(JSON.stringify(i));s(n),n.forEach((t=>{e.blocks.createBlock(t)}));const o=this.runtime.targets.map((e=>e.sprite.name));e.name=l.unusedName(this.name,o);const u=[];return e.costumes=this.costumes_.map((e=>{const t=Object.assign({},e);return u.push(r(t,this.runtime)),t})),e.sounds=this.sounds.map((t=>{const i=Object.assign({},t),n=t.asset;return u.push(a(i,n,this.runtime,e.soundBank)),i})),Promise.all(u).then((()=>e))}dispose(){this.soundBank&&this.soundBank.dispose()}}e.exports=c},function(e,t,i){e.exports=function(){\"use strict\";function e(t){return e=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},e(t)}function t(e,i){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,i)}function i(){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(e){return!1}}function n(e,o,a){return n=i()?Reflect.construct:function(e,i,n){var o=[null];o.push.apply(o,i);var a=new(Function.bind.apply(e,o));return n&&t(a,n.prototype),a},n.apply(null,arguments)}function o(e){return a(e)||r(e)||s(e)||u()}function a(e){if(Array.isArray(e))return l(e)}function r(e){if(\"undefined\"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e[\"@@iterator\"])return Array.from(e)}function s(e,t){if(e){if(\"string\"==typeof e)return l(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return\"Object\"===i&&e.constructor&&(i=e.constructor.name),\"Map\"===i||\"Set\"===i?Array.from(e):\"Arguments\"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i1?i-1:0),o=1;o/gm),Q=f(/\\${[\\w\\W]*}/gm),X=f(/^data-[\\-\\w.\\u00B7-\\uFFFF]+$/),J=f(/^aria-[\\-\\w]+$/),$=f(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i),ee=f(/^(?:\\w+script|data):/i),te=f(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g),ie=f(/^html$/i),ne=f(/^[a-z][.\\w]*(-[.\\w]+)+$/i),oe=function(){return\"undefined\"==typeof window?null:window},ae=function(t,i){if(\"object\"!==e(t)||\"function\"!=typeof t.createPolicy)return null;var n=null,o=\"data-tt-policy-suffix\";i.currentScript&&i.currentScript.hasAttribute(o)&&(n=i.currentScript.getAttribute(o));var a=\"dompurify\"+(n?\"#\"+n:\"\");try{return t.createPolicy(a,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn(\"TrustedTypes policy \"+a+\" could not be created.\"),null}};function re(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oe(),i=function(e){return re(e)};if(i.version=\"2.5.8\",i.removed=[],!t||!t.document||9!==t.document.nodeType)return i.isSupported=!1,i;var n=t.document,a=t.document,r=t.DocumentFragment,s=t.HTMLTemplateElement,l=t.Node,u=t.Element,c=t.NodeFilter,d=t.NamedNodeMap,p=void 0===d?t.NamedNodeMap||t.MozNamedAttrMap:d,m=t.HTMLFormElement,g=t.DOMParser,f=t.trustedTypes,b=u.prototype,y=R(b,\"cloneNode\"),v=R(b,\"nextSibling\"),k=R(b,\"childNodes\"),A=R(b,\"parentNode\");if(\"function\"==typeof s){var P=a.createElement(\"template\");P.content&&P.content.ownerDocument&&(a=P.content.ownerDocument)}var se=ae(f,n),le=se?se.createHTML(\"\"):\"\",ue=a,ce=ue.implementation,de=ue.createNodeIterator,pe=ue.createDocumentFragment,me=ue.getElementsByTagName,ge=n.importNode,he={};try{he=L(a).documentMode?a.documentMode:{}}catch(e){}var fe={};i.isSupported=\"function\"==typeof A&&ce&&void 0!==ce.createHTMLDocument&&9!==he;var be,ye,ve=Z,ke=K,we=Q,Te=X,Se=J,Me=ee,Ee=te,Ie=ne,xe=$,_e=null,Oe=D({},[].concat(o(j),o(z),o(B),o(F),o(G))),Ce=null,Ne=D({},[].concat(o(W),o(V),o(q),o(Y))),Ae=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Pe=null,De=null,Le=!0,Re=!0,je=!1,ze=!0,Be=!1,Ue=!0,Fe=!1,He=!1,Ge=!1,We=!1,Ve=!1,qe=!1,Ye=!0,Ze=!1,Ke=\"user-content-\",Qe=!0,Xe=!1,Je={},$e=null,et=D({},[\"annotation-xml\",\"audio\",\"colgroup\",\"desc\",\"foreignobject\",\"head\",\"iframe\",\"math\",\"mi\",\"mn\",\"mo\",\"ms\",\"mtext\",\"noembed\",\"noframes\",\"noscript\",\"plaintext\",\"script\",\"style\",\"svg\",\"template\",\"thead\",\"title\",\"video\",\"xmp\"]),tt=null,it=D({},[\"audio\",\"video\",\"img\",\"source\",\"image\",\"track\"]),nt=null,ot=D({},[\"alt\",\"class\",\"for\",\"id\",\"label\",\"name\",\"pattern\",\"placeholder\",\"role\",\"summary\",\"title\",\"value\",\"style\",\"xmlns\"]),at=\"http://www.w3.org/1998/Math/MathML\",rt=\"http://www.w3.org/2000/svg\",st=\"http://www.w3.org/1999/xhtml\",lt=st,ut=!1,ct=null,dt=D({},[at,rt,st],E),pt=[\"application/xhtml+xml\",\"text/html\"],mt=\"text/html\",gt=null,ht=a.createElement(\"form\"),ft=function(e){return e instanceof RegExp||e instanceof Function},bt=function(t){gt&>===t||(t&&\"object\"===e(t)||(t={}),t=L(t),be=be=-1===pt.indexOf(t.PARSER_MEDIA_TYPE)?mt:t.PARSER_MEDIA_TYPE,ye=\"application/xhtml+xml\"===be?E:M,_e=\"ALLOWED_TAGS\"in t?D({},t.ALLOWED_TAGS,ye):Oe,Ce=\"ALLOWED_ATTR\"in t?D({},t.ALLOWED_ATTR,ye):Ne,ct=\"ALLOWED_NAMESPACES\"in t?D({},t.ALLOWED_NAMESPACES,E):dt,nt=\"ADD_URI_SAFE_ATTR\"in t?D(L(ot),t.ADD_URI_SAFE_ATTR,ye):ot,tt=\"ADD_DATA_URI_TAGS\"in t?D(L(it),t.ADD_DATA_URI_TAGS,ye):it,$e=\"FORBID_CONTENTS\"in t?D({},t.FORBID_CONTENTS,ye):et,Pe=\"FORBID_TAGS\"in t?D({},t.FORBID_TAGS,ye):{},De=\"FORBID_ATTR\"in t?D({},t.FORBID_ATTR,ye):{},Je=\"USE_PROFILES\"in t&&t.USE_PROFILES,Le=!1!==t.ALLOW_ARIA_ATTR,Re=!1!==t.ALLOW_DATA_ATTR,je=t.ALLOW_UNKNOWN_PROTOCOLS||!1,ze=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Be=t.SAFE_FOR_TEMPLATES||!1,Ue=!1!==t.SAFE_FOR_XML,Fe=t.WHOLE_DOCUMENT||!1,We=t.RETURN_DOM||!1,Ve=t.RETURN_DOM_FRAGMENT||!1,qe=t.RETURN_TRUSTED_TYPE||!1,Ge=t.FORCE_BODY||!1,Ye=!1!==t.SANITIZE_DOM,Ze=t.SANITIZE_NAMED_PROPS||!1,Qe=!1!==t.KEEP_CONTENT,Xe=t.IN_PLACE||!1,xe=t.ALLOWED_URI_REGEXP||xe,lt=t.NAMESPACE||st,Ae=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&ft(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ae.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&ft(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ae.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&\"boolean\"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ae.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Be&&(Re=!1),Ve&&(We=!0),Je&&(_e=D({},o(G)),Ce=[],!0===Je.html&&(D(_e,j),D(Ce,W)),!0===Je.svg&&(D(_e,z),D(Ce,V),D(Ce,Y)),!0===Je.svgFilters&&(D(_e,B),D(Ce,V),D(Ce,Y)),!0===Je.mathMl&&(D(_e,F),D(Ce,q),D(Ce,Y))),t.ADD_TAGS&&(_e===Oe&&(_e=L(_e)),D(_e,t.ADD_TAGS,ye)),t.ADD_ATTR&&(Ce===Ne&&(Ce=L(Ce)),D(Ce,t.ADD_ATTR,ye)),t.ADD_URI_SAFE_ATTR&&D(nt,t.ADD_URI_SAFE_ATTR,ye),t.FORBID_CONTENTS&&($e===et&&($e=L($e)),D($e,t.FORBID_CONTENTS,ye)),Qe&&(_e[\"#text\"]=!0),Fe&&D(_e,[\"html\",\"head\",\"body\"]),_e.table&&(D(_e,[\"tbody\"]),delete Pe.tbody),h&&h(t),gt=t)},yt=D({},[\"mi\",\"mo\",\"mn\",\"ms\",\"mtext\"]),vt=D({},[\"annotation-xml\"]),kt=D({},[\"title\",\"style\",\"font\",\"a\",\"script\"]),wt=D({},z);D(wt,B),D(wt,U);var Tt=D({},F);D(Tt,H);var St=function(e){var t=A(e);t&&t.tagName||(t={namespaceURI:lt,tagName:\"template\"});var i=M(e.tagName),n=M(t.tagName);return!!ct[e.namespaceURI]&&(e.namespaceURI===rt?t.namespaceURI===st?\"svg\"===i:t.namespaceURI===at?\"svg\"===i&&(\"annotation-xml\"===n||yt[n]):Boolean(wt[i]):e.namespaceURI===at?t.namespaceURI===st?\"math\"===i:t.namespaceURI===rt?\"math\"===i&&vt[n]:Boolean(Tt[i]):e.namespaceURI===st?!(t.namespaceURI===rt&&!vt[n])&&!(t.namespaceURI===at&&!yt[n])&&!Tt[i]&&(kt[i]||!wt[i]):!(\"application/xhtml+xml\"!==be||!ct[e.namespaceURI]))},Mt=function(e){S(i.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=le}catch(t){e.remove()}}},Et=function(e,t){try{S(i.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){S(i.removed,{attribute:null,from:t})}if(t.removeAttribute(e),\"is\"===e&&!Ce[e])if(We||Ve)try{Mt(t)}catch(e){}else try{t.setAttribute(e,\"\")}catch(e){}},It=function(e){var t,i;if(Ge)e=\"\"+e;else{var n=I(e,/^[\\r\\n\\t ]+/);i=n&&n[0]}\"application/xhtml+xml\"===be&<===st&&(e=''+e+\"\");var o=se?se.createHTML(e):e;if(lt===st)try{t=(new g).parseFromString(o,be)}catch(e){}if(!t||!t.documentElement){t=ce.createDocument(lt,\"template\",null);try{t.documentElement.innerHTML=ut?le:o}catch(e){}}var r=t.body||t.documentElement;return e&&i&&r.insertBefore(a.createTextNode(i),r.childNodes[0]||null),lt===st?me.call(t,Fe?\"html\":\"body\")[0]:Fe?t.documentElement:r},xt=function(e){return de.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null,!1)},_t=function(e){return e instanceof m&&(\"string\"!=typeof e.nodeName||\"string\"!=typeof e.textContent||\"function\"!=typeof e.removeChild||!(e.attributes instanceof p)||\"function\"!=typeof e.removeAttribute||\"function\"!=typeof e.setAttribute||\"string\"!=typeof e.namespaceURI||\"function\"!=typeof e.insertBefore||\"function\"!=typeof e.hasChildNodes)},Ot=function(t){return\"object\"===e(l)?t instanceof l:t&&\"object\"===e(t)&&\"number\"==typeof t.nodeType&&\"string\"==typeof t.nodeName},Ct=function(e,t,n){fe[e]&&w(fe[e],(function(e){e.call(i,t,n,gt)}))},Nt=function(e){var t;if(Ct(\"beforeSanitizeElements\",e,null),_t(e))return Mt(e),!0;if(C(/[\\u0080-\\uFFFF]/,e.nodeName))return Mt(e),!0;var n=ye(e.nodeName);if(Ct(\"uponSanitizeElement\",e,{tagName:n,allowedTags:_e}),e.hasChildNodes()&&!Ot(e.firstElementChild)&&(!Ot(e.content)||!Ot(e.content.firstElementChild))&&C(/<[/\\w]/g,e.innerHTML)&&C(/<[/\\w]/g,e.textContent))return Mt(e),!0;if(\"select\"===n&&C(/