mirror of
https://github.com/rreusser/rreusser.github.io.git
synced 2025-12-08 21:25:50 +00:00
1 line
136 KiB
JavaScript
1 line
136 KiB
JavaScript
!function(){return function e(t,n,r){function i(a,f){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!f&&u)return u(a,!0);if(o)return o(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return i(n||e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}}()({1:[function(e,t,n){"use strict";var r=e("es5-ext/object/assign"),i=e("es5-ext/object/normalize-options"),o=e("es5-ext/object/is-callable"),a=e("es5-ext/string/#/contains");(t.exports=function(e,t){var n,o,f,u,s;return arguments.length<2||"string"!=typeof e?(u=t,t=e,e=null):u=arguments[2],null==e?(n=f=!0,o=!1):(n=a.call(e,"c"),o=a.call(e,"e"),f=a.call(e,"w")),s={value:t,configurable:n,enumerable:o,writable:f},u?r(i(u),s):s}).gs=function(e,t,n){var f,u,s,c;return"string"!=typeof e?(s=n,n=t,t=e,e=null):s=arguments[3],null==t?t=void 0:o(t)?null==n?n=void 0:o(n)||(s=n,n=void 0):(s=t,t=n=void 0),null==e?(f=!0,u=!1):(f=a.call(e,"c"),u=a.call(e,"e")),c={get:t,set:n,configurable:f,enumerable:u},s?r(i(s),c):c}},{"es5-ext/object/assign":3,"es5-ext/object/is-callable":6,"es5-ext/object/normalize-options":11,"es5-ext/string/#/contains":14}],2:[function(e,t,n){"use strict";t.exports=function(){}},{}],3:[function(e,t,n){"use strict";t.exports=e("./is-implemented")()?Object.assign:e("./shim")},{"./is-implemented":4,"./shim":5}],4:[function(e,t,n){"use strict";t.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},{}],5:[function(e,t,n){"use strict";var r=e("../keys"),i=e("../valid-value"),o=Math.max;t.exports=function(e,t){var n,a,f,u=o(arguments.length,2);for(e=Object(i(e)),f=function(r){try{e[r]=t[r]}catch(e){n||(n=e)}},a=1;a<u;++a)t=arguments[a],r(t).forEach(f);if(void 0!==n)throw n;return e}},{"../keys":8,"../valid-value":13}],6:[function(e,t,n){"use strict";t.exports=function(e){return"function"==typeof e}},{}],7:[function(e,t,n){"use strict";var r=e("../function/noop")();t.exports=function(e){return e!==r&&null!==e}},{"../function/noop":2}],8:[function(e,t,n){"use strict";t.exports=e("./is-implemented")()?Object.keys:e("./shim")},{"./is-implemented":9,"./shim":10}],9:[function(e,t,n){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},{}],10:[function(e,t,n){"use strict";var r=e("../is-value"),i=Object.keys;t.exports=function(e){return i(r(e)?Object(e):e)}},{"../is-value":7}],11:[function(e,t,n){"use strict";var r=e("./is-value"),i=Array.prototype.forEach,o=Object.create;t.exports=function(e){var t=o(null);return i.call(arguments,function(e){r(e)&&function(e,t){var n;for(n in e)t[n]=e[n]}(Object(e),t)}),t}},{"./is-value":7}],12:[function(e,t,n){"use strict";t.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},{}],13:[function(e,t,n){"use strict";var r=e("./is-value");t.exports=function(e){if(!r(e))throw new TypeError("Cannot use null or undefined");return e}},{"./is-value":7}],14:[function(e,t,n){"use strict";t.exports=e("./is-implemented")()?String.prototype.contains:e("./shim")},{"./is-implemented":15,"./shim":16}],15:[function(e,t,n){"use strict";var r="razdwatrzy";t.exports=function(){return"function"==typeof r.contains&&(!0===r.contains("dwa")&&!1===r.contains("foo"))}},{}],16:[function(e,t,n){"use strict";var r=String.prototype.indexOf;t.exports=function(e){return r.call(this,e,arguments[1])>-1}},{}],17:[function(e,t,n){"use strict";var r,i,o,a,f,u,s,c=e("d"),l=e("es5-ext/object/valid-callable"),p=Function.prototype.apply,h=Function.prototype.call,d=Object.create,m=Object.defineProperty,x=Object.defineProperties,b=Object.prototype.hasOwnProperty,g={configurable:!0,enumerable:!1,writable:!0};f={on:r=function(e,t){var n;return l(t),b.call(this,"__ee__")?n=this.__ee__:(n=g.value=d(null),m(this,"__ee__",g),g.value=null),n[e]?"object"==typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},once:i=function(e,t){var n,i;return l(t),i=this,r.call(this,e,n=function(){o.call(i,e,n),p.call(t,this,arguments)}),n.__eeOnceListener__=t,this},off:o=function(e,t){var n,r,i,o;if(l(t),!b.call(this,"__ee__"))return this;if(!(n=this.__ee__)[e])return this;if("object"==typeof(r=n[e]))for(o=0;i=r[o];++o)i!==t&&i.__eeOnceListener__!==t||(2===r.length?n[e]=r[o?0:1]:r.splice(o,1));else r!==t&&r.__eeOnceListener__!==t||delete n[e];return this},emit:a=function(e){var t,n,r,i,o;if(b.call(this,"__ee__")&&(i=this.__ee__[e]))if("object"==typeof i){for(n=arguments.length,o=new Array(n-1),t=1;t<n;++t)o[t-1]=arguments[t];for(i=i.slice(),t=0;r=i[t];++t)p.call(r,this,o)}else switch(arguments.length){case 1:h.call(i,this);break;case 2:h.call(i,this,arguments[1]);break;case 3:h.call(i,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),t=1;t<n;++t)o[t-1]=arguments[t];p.call(i,this,o)}}},u={on:c(r),once:c(i),off:c(o),emit:c(a)},s=x({},u),t.exports=n=function(e){return null==e?d(s):x(Object(e),u)},n.methods=f},{d:1,"es5-ext/object/valid-callable":12}],18:[function(e,t,n){"use strict";var r=e("h");t.exports=function(e,t){return t=t||{},function(n,i){if(!n)return e&&e(i);if(n instanceof Error)n=n.name+": "+n.message;else if("string"!=typeof n)throw new Error("fail-nicely: Oops! the message must be a String or an Error. How ironic.");var o=void 0===t.zIndex?9999:parseInt(t.zIndex),a=void 0===t.bg?"#333":t.bg,f=void 0===t.fg?"#fff":t.fg,u=void 0===t.title?"Sorry!":t.title,s=void 0===t.fontFamily?"Helvetica, Arial, sans-serif":t.fontFamily,c=void 0===t.position?"fixed":t.position;if(void 0!==t.invert&&t.invert){var l=f;f=a,a=l}var p={position:c,top:0,right:0,bottom:0,left:0,"background-color":a,color:f,"text-align":"center","z-index":o},h={"font-family":s},d={"font-family":s,"max-width":"640px","margin-left":"auto","margin-right":"auto","line-height":"1.4",padding:"0 15px"};document.body.appendChild(r("div",{style:p},[r("div",{style:{transform:"translate(0, -50%)","margin-top":"50vh"}},[r("h1",u,{style:h}),r("p",n,{style:d})])]))}}},{h:20}],19:[function(e,t,n){t.exports=function(e){"string"==typeof e&&(e=[e]);for(var t=[].slice.call(arguments,1),n=[],r=0;r<e.length-1;r++)n.push(e[r],t[r]||"");return n.push(e[r]),n.join("")}},{}],20:[function(e,t,n){!function(){function e(){var e=[].slice.call(arguments),t=null;function n(e){if(null==e);else if("string"==typeof e)t?t.appendChild(document.createTextNode(e)):e.split(/([\.#]?[a-zA-Z0-9_-]+)/).forEach(function(e){var n=e.substring(1,e.length);e&&(t?"."===e[0]?t.classList.add(n):"#"===e[0]&&t.setAttribute("id",n):t=document.createElement(e))});else if("number"==typeof e||"boolean"==typeof e||e instanceof Date||e instanceof RegExp)t.appendChild(document.createTextNode(e.toString()));else if(Array.isArray(e))e.forEach(n);else if(e instanceof HTMLElement)t.appendChild(e);else if("object"==typeof e)for(var r in e)if("function"==typeof e[r])t.addEventListener(r,e[r]);else if("style"===r)for(var i in e[r])t.style.setProperty(i,e[r][i]);else t.setAttribute(r,e[r])}for(;e.length;)n(e.shift());return t}"object"==typeof t?t.exports=e:this.h=e}()},{}],21:[function(e,t,n){var r=[],i=[],o="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function a(e,t){if(t=t||{},void 0===e)throw new Error(o);var n,a=!0===t.prepend?"prepend":"append",f=void 0!==t.container?t.container:document.querySelector("head"),u=r.indexOf(f);return-1===u&&(u=r.push(f)-1,i[u]={}),void 0!==i[u]&&void 0!==i[u][a]?n=i[u][a]:(n=i[u][a]=function(){var e=document.createElement("style");return e.setAttribute("type","text/css"),e}(),"prepend"===a?f.insertBefore(n,f.childNodes[0]):f.appendChild(n)),65279===e.charCodeAt(0)&&(e=e.substr(1,e.length)),n.styleSheet?n.styleSheet.cssText+=e:n.textContent+=e,n}t.exports=a,t.exports.insertCss=a},{}],22:[function(e,t,n){"use strict";t.exports=function(e,t){t||(t=e,e=window);var n=0,i=0,o=0,a={shift:!1,alt:!1,control:!1,meta:!1},f=!1;function u(e){var t=!1;return"altKey"in e&&(t=t||e.altKey!==a.alt,a.alt=!!e.altKey),"shiftKey"in e&&(t=t||e.shiftKey!==a.shift,a.shift=!!e.shiftKey),"ctrlKey"in e&&(t=t||e.ctrlKey!==a.control,a.control=!!e.ctrlKey),"metaKey"in e&&(t=t||e.metaKey!==a.meta,a.meta=!!e.metaKey),t}function s(e,f){var s=r.x(f),c=r.y(f);"buttons"in f&&(e=0|f.buttons),(e!==n||s!==i||c!==o||u(f))&&(n=0|e,i=s||0,o=c||0,t&&t(n,i,o,a))}function c(e){s(0,e)}function l(){(n||i||o||a.shift||a.alt||a.meta||a.control)&&(i=o=0,n=0,a.shift=a.alt=a.control=a.meta=!1,t&&t(0,0,0,a))}function p(e){u(e)&&t&&t(n,i,o,a)}function h(e){0===r.buttons(e)?s(0,e):s(n,e)}function d(e){s(n|r.buttons(e),e)}function m(e){s(n&~r.buttons(e),e)}function x(){f||(f=!0,e.addEventListener("mousemove",h),e.addEventListener("mousedown",d),e.addEventListener("mouseup",m),e.addEventListener("mouseleave",c),e.addEventListener("mouseenter",c),e.addEventListener("mouseout",c),e.addEventListener("mouseover",c),e.addEventListener("blur",l),e.addEventListener("keyup",p),e.addEventListener("keydown",p),e.addEventListener("keypress",p),e!==window&&(window.addEventListener("blur",l),window.addEventListener("keyup",p),window.addEventListener("keydown",p),window.addEventListener("keypress",p)))}x();var b={element:e};return Object.defineProperties(b,{enabled:{get:function(){return f},set:function(t){t?x():f&&(f=!1,e.removeEventListener("mousemove",h),e.removeEventListener("mousedown",d),e.removeEventListener("mouseup",m),e.removeEventListener("mouseleave",c),e.removeEventListener("mouseenter",c),e.removeEventListener("mouseout",c),e.removeEventListener("mouseover",c),e.removeEventListener("blur",l),e.removeEventListener("keyup",p),e.removeEventListener("keydown",p),e.removeEventListener("keypress",p),e!==window&&(window.removeEventListener("blur",l),window.removeEventListener("keyup",p),window.removeEventListener("keydown",p),window.removeEventListener("keypress",p)))},enumerable:!0},buttons:{get:function(){return n},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return o},enumerable:!0},mods:{get:function(){return a},enumerable:!0}}),b};var r=e("mouse-event")},{"mouse-event":23}],23:[function(e,t,n){"use strict";function r(e){return e.target||e.srcElement||window}n.buttons=function(e){if("object"==typeof e){if("buttons"in e)return e.buttons;if("which"in e){if(2===(t=e.which))return 4;if(3===t)return 2;if(t>0)return 1<<t-1}else if("button"in e){var t;if(1===(t=e.button))return 4;if(2===t)return 2;if(t>=0)return 1<<t}}return 0},n.element=r,n.x=function(e){if("object"==typeof e){if("offsetX"in e)return e.offsetX;var t=r(e).getBoundingClientRect();return e.clientX-t.left}return 0},n.y=function(e){if("object"==typeof e){if("offsetY"in e)return e.offsetY;var t=r(e).getBoundingClientRect();return e.clientY-t.top}return 0}},{}],24:[function(e,t,n){var r,i,o=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function f(){throw new Error("clearTimeout has not been defined")}function u(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{i="function"==typeof clearTimeout?clearTimeout:f}catch(e){i=f}}();var s,c=[],l=!1,p=-1;function h(){l&&s&&(l=!1,s.length?c=s.concat(c):p=-1,c.length&&d())}function d(){if(!l){var e=u(h);l=!0;for(var t=c.length;t;){for(s=c,c=[];++p<t;)s&&s[p].run();p=-1,t=c.length}s=null,l=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===f||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function x(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new m(e,t)),1!==c.length||l||u(d)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=x,o.addListener=x,o.once=x,o.off=x,o.removeListener=x,o.removeAllListeners=x,o.emit=x,o.prependListener=x,o.prependOnceListener=x,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],25:[function(e,t,n){var r,i;r=this,i=function(){function e(e,t){this.id=R++,this.type=e,this.data=t}function t(e){return"["+function e(t){if(0===t.length)return[];var n=t.charAt(0),r=t.charAt(t.length-1);if(1<t.length&&n===r&&('"'===n||"'"===n))return['"'+t.substr(1,t.length-2).replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'];if(n=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t))return e(t.substr(0,n.index)).concat(e(n[1])).concat(e(t.substr(n.index+n[0].length)));if(1===(n=t.split(".")).length)return['"'+t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'];for(t=[],r=0;r<n.length;++r)t=t.concat(e(n[r]));return t}(e).join("][")+"]"}function n(e){return"string"==typeof e?e.split():e}function r(e){return"string"==typeof e?document.querySelector(e):e}function i(e){var t,i,o,a,f=e||{};e={};var u=[],s=[],c="undefined"==typeof window?1:window.devicePixelRatio,l=!1,p=function(e){},h=function(){};if("string"==typeof f?t=document.querySelector(f):"object"==typeof f&&("string"==typeof f.nodeName&&"function"==typeof f.appendChild&&"function"==typeof f.getBoundingClientRect?t=f:"function"==typeof f.drawArrays||"function"==typeof f.drawElements?o=(a=f).canvas:("gl"in f?a=f.gl:"canvas"in f?o=r(f.canvas):"container"in f&&(i=r(f.container)),"attributes"in f&&(e=f.attributes),"extensions"in f&&(u=n(f.extensions)),"optionalExtensions"in f&&(s=n(f.optionalExtensions)),"onDone"in f&&(p=f.onDone),"profile"in f&&(l=!!f.profile),"pixelRatio"in f&&(c=+f.pixelRatio))),t&&("canvas"===t.nodeName.toLowerCase()?o=t:i=t),!a){if(!o){if(!(t=function(e,t,n){function r(){var t=window.innerWidth,r=window.innerHeight;e!==document.body&&(t=(r=e.getBoundingClientRect()).right-r.left,r=r.bottom-r.top),i.width=n*t,i.height=n*r,U(i.style,{width:t+"px",height:r+"px"})}var i=document.createElement("canvas");return U(i.style,{border:0,margin:0,padding:0,top:0,left:0}),e.appendChild(i),e===document.body&&(i.style.position="absolute",U(e.style,{margin:0,padding:0})),window.addEventListener("resize",r,!1),r(),{canvas:i,onDestroy:function(){window.removeEventListener("resize",r),e.removeChild(i)}}}(i||document.body,0,c)))return null;o=t.canvas,h=t.onDestroy}a=function(e,t){function n(n){try{return e.getContext(n,t)}catch(e){return null}}return n("webgl")||n("experimental-webgl")||n("webgl-experimental")}(o,e)}return a?{gl:a,canvas:o,container:i,extensions:u,optionalExtensions:s,pixelRatio:c,profile:l,onDone:p,onDestroy:h}:(h(),p("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function o(e,t){for(var n=Array(e),r=0;r<e;++r)n[r]=t(r);return n}function a(e){var t,n;return t=(65535<e)<<4,t|=n=(255<(e>>>=t))<<3,(t|=n=(15<(e>>>=n))<<2)|(n=(3<(e>>>=n))<<1)|e>>>n>>1}function f(){function e(e){e:{for(var t=16;268435456>=t;t*=16)if(e<=t){e=t;break e}e=0}return 0<(t=n[a(e)>>2]).length?t.pop():new ArrayBuffer(e)}function t(e){n[a(e.byteLength)>>2].push(e)}var n=o(8,function(){return[]});return{alloc:e,free:t,allocType:function(t,n){var r=null;switch(t){case 5120:r=new Int8Array(e(n),0,n);break;case 5121:r=new Uint8Array(e(n),0,n);break;case 5122:r=new Int16Array(e(2*n),0,n);break;case 5123:r=new Uint16Array(e(2*n),0,n);break;case 5124:r=new Int32Array(e(4*n),0,n);break;case 5125:r=new Uint32Array(e(4*n),0,n);break;case 5126:r=new Float32Array(e(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(e){t(e.buffer)}}}function u(e){return!!e&&"object"==typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||Q(e.data))}function s(e,t,n,r,i,o){for(var a=0;a<t;++a)for(var f=e[a],u=0;u<n;++u)for(var s=f[u],c=0;c<r;++c)i[o++]=s[c]}function c(e){return 0|$[Object.prototype.toString.call(e)]}function l(e,t){for(var n=0;n<t.length;++n)e[n]=t[n]}function p(e,t,n,r,i,o,a){for(var f=0,u=0;u<n;++u)for(var s=0;s<r;++s)e[f++]=t[i*u+o*s+a]}function h(e,t,n,r){function i(t){this.id=s++,this.buffer=e.createBuffer(),this.type=t,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=5121,this.persistentData=null,n.profile&&(this.stats={size:0})}function o(t,n,r){t.byteLength=n.byteLength,e.bufferData(t.type,n,r)}function a(e,t,n,r,i,a){if(e.usage=n,Array.isArray(t)){if(e.dtype=r||5126,0<t.length)if(Array.isArray(t[0])){i=ee(t);for(var f=r=1;f<i.length;++f)r*=i[f];e.dimension=r,o(e,t=Z(t,i,e.dtype),n),a?e.persistentData=t:q.freeType(t)}else"number"==typeof t[0]?(e.dimension=i,l(i=q.allocType(e.dtype,t.length),t),o(e,i,n),a?e.persistentData=i:q.freeType(i)):Q(t[0])&&(e.dimension=t[0].length,e.dtype=r||c(t[0])||5126,o(e,t=Z(t,[t.length,t[0].length],e.dtype),n),a?e.persistentData=t:q.freeType(t))}else if(Q(t))e.dtype=r||c(t),e.dimension=i,o(e,t,n),a&&(e.persistentData=new Uint8Array(new Uint8Array(t.buffer)));else if(u(t)){i=t.shape;var s=t.stride,h=(f=t.offset,0),d=0,m=0,x=0;1===i.length?(h=i[0],d=1,m=s[0],x=0):2===i.length&&(h=i[0],d=i[1],m=s[0],x=s[1]),e.dtype=r||c(t.data)||5126,e.dimension=d,p(i=q.allocType(e.dtype,h*d),t.data,h,d,m,x,f),o(e,i,n),a?e.persistentData=i:q.freeType(i)}}function f(n){t.bufferCount--;for(var i=0;i<r.state.length;++i){var o=r.state[i];o.buffer===n&&(e.disableVertexAttribArray(i),o.buffer=null)}e.deleteBuffer(n.buffer),n.buffer=null,delete h[n.id]}var s=0,h={};i.prototype.bind=function(){e.bindBuffer(this.type,this.buffer)},i.prototype.destroy=function(){f(this)};var d=[];return n.profile&&(t.getTotalBufferSize=function(){var e=0;return Object.keys(h).forEach(function(t){e+=h[t].stats.size}),e}),{create:function(r,o,s,d){function m(t){var r=35044,i=null,o=0,f=0,s=1;return Array.isArray(t)||Q(t)||u(t)?i=t:"number"==typeof t?o=0|t:t&&("data"in t&&(i=t.data),"usage"in t&&(r=J[t.usage]),"type"in t&&(f=K[t.type]),"dimension"in t&&(s=0|t.dimension),"length"in t&&(o=0|t.length)),x.bind(),i?a(x,i,r,f,s,d):(o&&e.bufferData(x.type,o,r),x.dtype=f||5121,x.usage=r,x.dimension=s,x.byteLength=o),n.profile&&(x.stats.size=x.byteLength*te[x.dtype]),m}t.bufferCount++;var x=new i(o);return h[x.id]=x,s||m(r),m._reglType="buffer",m._buffer=x,m.subdata=function(t,n){var r,i=0|(n||0);if(x.bind(),Q(t))e.bufferSubData(x.type,i,t);else if(Array.isArray(t)){if(0<t.length)if("number"==typeof t[0]){var o=q.allocType(x.dtype,t.length);l(o,t),e.bufferSubData(x.type,i,o),q.freeType(o)}else(Array.isArray(t[0])||Q(t[0]))&&(r=ee(t),o=Z(t,r,x.dtype),e.bufferSubData(x.type,i,o),q.freeType(o))}else if(u(t)){r=t.shape;var a=t.stride,f=o=0,s=0,h=0;1===r.length?(o=r[0],f=1,s=a[0],h=0):2===r.length&&(o=r[0],f=r[1],s=a[0],h=a[1]),r=Array.isArray(t.data)?x.dtype:c(t.data),p(r=q.allocType(r,o*f),t.data,o,f,s,h,t.offset),e.bufferSubData(x.type,i,r),q.freeType(r)}return m},n.profile&&(m.stats=x.stats),m.destroy=function(){f(x)},m},createStream:function(e,t){var n=d.pop();return n||(n=new i(e)),n.bind(),a(n,t,35040,0,1,!1),n},destroyStream:function(e){d.push(e)},clear:function(){G(h).forEach(f),d.forEach(f)},getBuffer:function(e){return e&&e._buffer instanceof i?e._buffer:null},restore:function(){G(h).forEach(function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)})},_initBuffer:a}}function d(e,t,n,r){function i(e){this.id=s++,f[this.id]=this,this.buffer=e,this.primType=4,this.type=this.vertCount=0}function o(r,i,o,a,f,s,c){if(r.buffer.bind(),i){var l=c;c||Q(i)&&(!u(i)||Q(i.data))||(l=t.oes_element_index_uint?5125:5123),n._initBuffer(r.buffer,i,o,l,3)}else e.bufferData(34963,s,o),r.buffer.dtype=l||5121,r.buffer.usage=o,r.buffer.dimension=3,r.buffer.byteLength=s;if(l=c,!c){switch(r.buffer.dtype){case 5121:case 5120:l=5121;break;case 5123:case 5122:l=5123;break;case 5125:case 5124:l=5125}r.buffer.dtype=l}r.type=l,0>(i=f)&&(i=r.buffer.byteLength,5123===l?i>>=1:5125===l&&(i>>=2)),r.vertCount=i,i=a,0>a&&(i=4,1===(a=r.buffer.dimension)&&(i=0),2===a&&(i=1),3===a&&(i=4)),r.primType=i}function a(e){r.elementsCount--,delete f[e.id],e.buffer.destroy(),e.buffer=null}var f={},s=0,c={uint8:5121,uint16:5123};t.oes_element_index_uint&&(c.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var l=[];return{create:function(e,t){function f(e){if(e)if("number"==typeof e)s(e),l.primType=4,l.vertCount=0|e,l.type=5121;else{var t=null,n=35044,r=-1,i=-1,a=0,p=0;Array.isArray(e)||Q(e)||u(e)?t=e:("data"in e&&(t=e.data),"usage"in e&&(n=J[e.usage]),"primitive"in e&&(r=ne[e.primitive]),"count"in e&&(i=0|e.count),"type"in e&&(p=c[e.type]),"length"in e?a=0|e.length:(a=i,5123===p||5122===p?a*=2:5125!==p&&5124!==p||(a*=4))),o(l,t,n,r,i,a,p)}else s(),l.primType=4,l.vertCount=0,l.type=5121;return f}var s=n.create(null,34963,!0),l=new i(s._buffer);return r.elementsCount++,f(e),f._reglType="elements",f._elements=l,f.subdata=function(e,t){return s.subdata(e,t),f},f.destroy=function(){a(l)},f},createStream:function(e){var t=l.pop();return t||(t=new i(n.create(null,34963,!0,!1)._buffer)),o(t,e,35040,-1,-1,0,0),t},destroyStream:function(e){l.push(e)},getElements:function(e){return"function"==typeof e&&e._elements instanceof i?e._elements:null},clear:function(){G(f).forEach(a)}}}function m(e){for(var t=q.allocType(5123,e.length),n=0;n<e.length;++n)if(isNaN(e[n]))t[n]=65535;else if(1/0===e[n])t[n]=31744;else if(-1/0===e[n])t[n]=64512;else{re[0]=e[n];var r=(o=ie[0])>>>31<<15,i=(o<<1>>>24)-127,o=o>>13&1023;t[n]=-24>i?r:-14>i?r+(o+1024>>-14-i):15<i?r+31744:r+(i+15<<10)+o}return t}function x(e){return Array.isArray(e)||Q(e)}function b(e){return"[object "+e+"]"}function g(e){return Array.isArray(e)&&(0===e.length||"number"==typeof e[0])}function v(e){return!(!Array.isArray(e)||0===e.length||!x(e[0]))}function y(e){return Object.prototype.toString.call(e)}function _(e){if(!e)return!1;var t=y(e);return 0<=he.indexOf(t)||(g(e)||v(e)||u(e))}function w(e,t){36193===e.type?(e.data=m(t),q.freeType(t)):e.data=t}function k(e,t,n,r,i,o){if(e=void 0!==me[e]?me[e]:fe[e]*de[t],o&&(e*=6),i){for(r=0;1<=n;)r+=e*n*n,n/=2;return r}return e*n*r}function A(e,t,n,r,i,o,a){function f(){this.format=this.internalformat=6408,this.type=5121,this.flipY=this.premultiplyAlpha=this.compressed=!1,this.unpackAlignment=1,this.colorSpace=37444,this.channels=this.height=this.width=0}function s(e,t){e.internalformat=t.internalformat,e.format=t.format,e.type=t.type,e.compressed=t.compressed,e.premultiplyAlpha=t.premultiplyAlpha,e.flipY=t.flipY,e.unpackAlignment=t.unpackAlignment,e.colorSpace=t.colorSpace,e.width=t.width,e.height=t.height,e.channels=t.channels}function c(e,t){if("object"==typeof t&&t){"premultiplyAlpha"in t&&(e.premultiplyAlpha=t.premultiplyAlpha),"flipY"in t&&(e.flipY=t.flipY),"alignment"in t&&(e.unpackAlignment=t.alignment),"colorSpace"in t&&(e.colorSpace=H[t.colorSpace]),"type"in t&&(e.type=W[t.type]);var n=e.width,r=e.height,i=e.channels,o=!1;"shape"in t?(n=t.shape[0],r=t.shape[1],3===t.shape.length&&(i=t.shape[2],o=!0)):("radius"in t&&(n=r=t.radius),"width"in t&&(n=t.width),"height"in t&&(r=t.height),"channels"in t&&(i=t.channels,o=!0)),e.width=0|n,e.height=0|r,e.channels=0|i,n=!1,"format"in t&&(n=t.format,r=e.internalformat=V[n],e.format=ie[r],n in W&&!("type"in t)&&(e.type=W[n]),n in X&&(e.compressed=!0),n=!0),!o&&n?e.channels=fe[e.format]:o&&!n&&e.channels!==ae[e.format]&&(e.format=e.internalformat=ae[e.channels])}}function l(t){e.pixelStorei(37440,t.flipY),e.pixelStorei(37441,t.premultiplyAlpha),e.pixelStorei(37443,t.colorSpace),e.pixelStorei(3317,t.unpackAlignment)}function p(){f.call(this),this.yOffset=this.xOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function h(e,t){var n=null;if(_(t)?n=t:t&&(c(e,t),"x"in t&&(e.xOffset=0|t.x),"y"in t&&(e.yOffset=0|t.y),_(t.data)&&(n=t.data)),t.copy){var r=i.viewportWidth,o=i.viewportHeight;e.width=e.width||r-e.xOffset,e.height=e.height||o-e.yOffset,e.needsCopy=!0}else if(n){if(Q(n))e.channels=e.channels||4,e.data=n,"type"in t||5121!==e.type||(e.type=0|$[Object.prototype.toString.call(n)]);else if(g(n)){switch(e.channels=e.channels||4,o=(r=n).length,e.type){case 5121:case 5123:case 5125:case 5126:(o=q.allocType(e.type,o)).set(r),e.data=o;break;case 36193:e.data=m(r)}e.alignment=1,e.needsFree=!0}else if(u(n)){r=n.data,Array.isArray(r)||5121!==e.type||(e.type=0|$[Object.prototype.toString.call(r)]);o=n.shape;var a,f,s,l,p=n.stride;3===o.length?(s=o[2],l=p[2]):l=s=1,a=o[0],f=o[1],o=p[0],p=p[1],e.alignment=1,e.width=a,e.height=f,e.channels=s,e.format=e.internalformat=ae[s],e.needsFree=!0,a=l,n=n.offset,s=e.width,l=e.height,f=e.channels;for(var h=q.allocType(36193===e.type?5126:e.type,s*l*f),d=0,b=0;b<l;++b)for(var k=0;k<s;++k)for(var A=0;A<f;++A)h[d++]=r[o*k+p*b+a*A+n];w(e,h)}else if(y(n)===ue||y(n)===se)y(n)===ue?e.element=n:e.element=n.canvas,e.width=e.element.width,e.height=e.element.height,e.channels=4;else if(y(n)===ce)e.element=n,e.width=n.width,e.height=n.height,e.channels=4;else if(y(n)===le)e.element=n,e.width=n.naturalWidth,e.height=n.naturalHeight,e.channels=4;else if(y(n)===pe)e.element=n,e.width=n.videoWidth,e.height=n.videoHeight,e.channels=4;else if(v(n)){for(r=e.width||n[0].length,o=e.height||n.length,p=e.channels,p=x(n[0][0])?p||n[0][0].length:p||1,a=Y.shape(n),s=1,l=0;l<a.length;++l)s*=a[l];s=q.allocType(36193===e.type?5126:e.type,s),Y.flatten(n,a,"",s),w(e,s),e.alignment=1,e.width=r,e.height=o,e.channels=p,e.format=e.internalformat=ae[p],e.needsFree=!0}}else e.width=e.width||1,e.height=e.height||1,e.channels=e.channels||4}function d(t,n,i,o,a){var f=t.element,u=t.data,s=t.internalformat,c=t.format,p=t.type,h=t.width,d=t.height;l(t),f?e.texSubImage2D(n,a,i,o,c,p,f):t.compressed?e.compressedTexSubImage2D(n,a,i,o,s,h,d,u):t.needsCopy?(r(),e.copyTexSubImage2D(n,a,i,o,t.xOffset,t.yOffset,h,d)):e.texSubImage2D(n,a,i,o,h,d,c,p,u)}function b(){return he.pop()||new p}function A(e){e.needsFree&&q.freeType(e.data),p.call(e),he.push(e)}function E(e,t,n){var r=e.images[0]=b();e.mipmask=1,r.width=e.width=t,r.height=e.height=n,r.channels=e.channels=4}function T(e,t){var n=null;if(_(t))s(n=e.images[0]=b(),e),h(n,t),e.mipmask=1;else if(c(e,t),Array.isArray(t.mipmap))for(var r=t.mipmap,i=0;i<r.length;++i)s(n=e.images[i]=b(),e),n.width>>=i,n.height>>=i,h(n,r[i]),e.mipmask|=1<<i;else s(n=e.images[0]=b(),e),h(n,t),e.mipmask=1;s(e,e.images[0])}function C(t,n){for(var i=t.images,o=0;o<i.length&&i[o];++o){var a=i[o],f=n,u=o,s=a.element,c=a.data,p=a.internalformat,h=a.format,d=a.type,m=a.width,x=a.height,b=a.channels;l(a),s?e.texImage2D(f,u,h,h,d,s):a.compressed?e.compressedTexImage2D(f,u,p,m,x,0,c):a.needsCopy?(r(),e.copyTexImage2D(f,u,h,a.xOffset,a.yOffset,m,x,0)):((a=!c)&&(c=q.zero.allocType(d,m*x*b)),e.texImage2D(f,u,h,m,x,0,h,d,c),a&&c&&q.zero.freeType(c))}}function S(){var e=de.pop()||new function(){f.call(this),this.genMipmaps=!1,this.mipmapHint=4352,this.mipmask=0,this.images=Array(16)};f.call(e);for(var t=e.mipmask=0;16>t;++t)e.images[t]=null;return e}function D(e){for(var t=e.images,n=0;n<t.length;++n)t[n]&&A(t[n]),t[n]=null;de.push(e)}function j(){this.magFilter=this.minFilter=9728,this.wrapT=this.wrapS=33071,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=4352}function O(e,t){"min"in t&&(e.minFilter=R[t.min],0<=oe.indexOf(e.minFilter)&&!("faces"in t)&&(e.genMipmaps=!0)),"mag"in t&&(e.magFilter=N[t.mag]);var n=e.wrapS,r=e.wrapT;if("wrap"in t){var i=t.wrap;"string"==typeof i?n=r=I[i]:Array.isArray(i)&&(n=I[i[0]],r=I[i[1]])}else"wrapS"in t&&(n=I[t.wrapS]),"wrapT"in t&&(r=I[t.wrapT]);if(e.wrapS=n,e.wrapT=r,"anisotropic"in t&&(e.anisotropic=t.anisotropic),"mipmap"in t){switch(n=!1,typeof t.mipmap){case"string":e.mipmapHint=M[t.mipmap],n=e.genMipmaps=!0;break;case"boolean":n=e.genMipmaps=t.mipmap;break;case"object":e.genMipmaps=!1,n=!0}!n||"min"in t||(e.minFilter=9984)}}function F(n,r){e.texParameteri(r,10241,n.minFilter),e.texParameteri(r,10240,n.magFilter),e.texParameteri(r,10242,n.wrapS),e.texParameteri(r,10243,n.wrapT),t.ext_texture_filter_anisotropic&&e.texParameteri(r,34046,n.anisotropic),n.genMipmaps&&(e.hint(33170,n.mipmapHint),e.generateMipmap(r))}function L(t){f.call(this),this.mipmask=0,this.internalformat=6408,this.id=me++,this.refCount=1,this.target=t,this.texture=e.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new j,a.profile&&(this.stats={size:0})}function P(t){e.activeTexture(33984),e.bindTexture(t.target,t.texture)}function z(){var t=ge[0];t?e.bindTexture(t.target,t.texture):e.bindTexture(3553,null)}function B(t){var n=t.texture,r=t.unit,i=t.target;0<=r&&(e.activeTexture(33984+r),e.bindTexture(i,null),ge[r]=null),e.deleteTexture(n),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete xe[t.id],o.textureCount--}var M={"don't care":4352,"dont care":4352,nice:4354,fast:4353},I={repeat:10497,clamp:33071,mirror:33648},N={nearest:9728,linear:9729},R=U({mipmap:9987,"nearest mipmap nearest":9984,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":9987},N),H={none:0,browser:37444},W={uint8:5121,rgba4:32819,rgb565:33635,"rgb5 a1":32820},V={alpha:6406,luminance:6409,"luminance alpha":6410,rgb:6407,rgba:6408,rgba4:32854,"rgb5 a1":32855,rgb565:36194},X={};t.ext_srgb&&(V.srgb=35904,V.srgba=35906),t.oes_texture_float&&(W.float32=W.float=5126),t.oes_texture_half_float&&(W.float16=W["half float"]=36193),t.webgl_depth_texture&&(U(V,{depth:6402,"depth stencil":34041}),U(W,{uint16:5123,uint32:5125,"depth stencil":34042})),t.webgl_compressed_texture_s3tc&&U(X,{"rgb s3tc dxt1":33776,"rgba s3tc dxt1":33777,"rgba s3tc dxt3":33778,"rgba s3tc dxt5":33779}),t.webgl_compressed_texture_atc&&U(X,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),t.webgl_compressed_texture_pvrtc&&U(X,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),t.webgl_compressed_texture_etc1&&(X["rgb etc1"]=36196);var K=Array.prototype.slice.call(e.getParameter(34467));Object.keys(X).forEach(function(e){var t=X[e];0<=K.indexOf(t)&&(V[e]=t)});var J=Object.keys(V);n.textureFormats=J;var Z=[];Object.keys(V).forEach(function(e){Z[V[e]]=e});var ee=[];Object.keys(W).forEach(function(e){ee[W[e]]=e});var te=[];Object.keys(N).forEach(function(e){te[N[e]]=e});var ne=[];Object.keys(R).forEach(function(e){ne[R[e]]=e});var re=[];Object.keys(I).forEach(function(e){re[I[e]]=e});var ie=J.reduce(function(e,t){var n=V[t];return 6409===n||6406===n||6409===n||6410===n||6402===n||34041===n?e[n]=n:32855===n||0<=t.indexOf("rgba")?e[n]=6408:e[n]=6407,e},{}),he=[],de=[],me=0,xe={},be=n.maxTextureUnits,ge=Array(be).map(function(){return null});return U(L.prototype,{bind:function(){this.bindCount+=1;var t=this.unit;if(0>t){for(var n=0;n<be;++n){var r=ge[n];if(r){if(0<r.bindCount)continue;r.unit=-1}ge[n]=this,t=n;break}a.profile&&o.maxTextureUnits<t+1&&(o.maxTextureUnits=t+1),this.unit=t,e.activeTexture(33984+t),e.bindTexture(this.target,this.texture)}return t},unbind:function(){--this.bindCount},decRef:function(){0>=--this.refCount&&B(this)}}),a.profile&&(o.getTotalTextureSize=function(){var e=0;return Object.keys(xe).forEach(function(t){e+=xe[t].stats.size}),e}),{create2D:function(t,n){function r(e,t){var n=i.texInfo;j.call(n);var o=S();return"number"==typeof e?E(o,0|e,"number"==typeof t?0|t:0|e):e?(O(n,e),T(o,e)):E(o,1,1),n.genMipmaps&&(o.mipmask=(o.width<<1)-1),i.mipmask=o.mipmask,s(i,o),i.internalformat=o.internalformat,r.width=o.width,r.height=o.height,P(i),C(o,3553),F(n,3553),z(),D(o),a.profile&&(i.stats.size=k(i.internalformat,i.type,o.width,o.height,n.genMipmaps,!1)),r.format=Z[i.internalformat],r.type=ee[i.type],r.mag=te[n.magFilter],r.min=ne[n.minFilter],r.wrapS=re[n.wrapS],r.wrapT=re[n.wrapT],r}var i=new L(3553);return xe[i.id]=i,o.textureCount++,r(t,n),r.subimage=function(e,t,n,o){t|=0,n|=0,o|=0;var a=b();return s(a,i),a.width=0,a.height=0,h(a,e),a.width=a.width||(i.width>>o)-t,a.height=a.height||(i.height>>o)-n,P(i),d(a,3553,t,n,o),z(),A(a),r},r.resize=function(t,n){var o=0|t,f=0|n||o;if(o===i.width&&f===i.height)return r;r.width=i.width=o,r.height=i.height=f,P(i);for(var u,s=i.channels,c=i.type,l=0;i.mipmask>>l;++l){var p=o>>l,h=f>>l;if(!p||!h)break;u=q.zero.allocType(c,p*h*s),e.texImage2D(3553,l,i.format,p,h,0,i.format,i.type,u),u&&q.zero.freeType(u)}return z(),a.profile&&(i.stats.size=k(i.internalformat,i.type,o,f,!1,!1)),r},r._reglType="texture2d",r._texture=i,a.profile&&(r.stats=i.stats),r.destroy=function(){i.decRef()},r},createCube:function(t,n,r,i,f,u){function l(e,t,n,r,i,o){var f,u=p.texInfo;for(j.call(u),f=0;6>f;++f)m[f]=S();if("number"!=typeof e&&e){if("object"==typeof e)if(t)T(m[0],e),T(m[1],t),T(m[2],n),T(m[3],r),T(m[4],i),T(m[5],o);else if(O(u,e),c(p,e),"faces"in e)for(e=e.faces,f=0;6>f;++f)s(m[f],p),T(m[f],e[f]);else for(f=0;6>f;++f)T(m[f],e)}else for(e=0|e||1,f=0;6>f;++f)E(m[f],e,e);for(s(p,m[0]),p.mipmask=u.genMipmaps?(m[0].width<<1)-1:m[0].mipmask,p.internalformat=m[0].internalformat,l.width=m[0].width,l.height=m[0].height,P(p),f=0;6>f;++f)C(m[f],34069+f);for(F(u,34067),z(),a.profile&&(p.stats.size=k(p.internalformat,p.type,l.width,l.height,u.genMipmaps,!0)),l.format=Z[p.internalformat],l.type=ee[p.type],l.mag=te[u.magFilter],l.min=ne[u.minFilter],l.wrapS=re[u.wrapS],l.wrapT=re[u.wrapT],f=0;6>f;++f)D(m[f]);return l}var p=new L(34067);xe[p.id]=p,o.cubeCount++;var m=Array(6);return l(t,n,r,i,f,u),l.subimage=function(e,t,n,r,i){n|=0,r|=0,i|=0;var o=b();return s(o,p),o.width=0,o.height=0,h(o,t),o.width=o.width||(p.width>>i)-n,o.height=o.height||(p.height>>i)-r,P(p),d(o,34069+e,n,r,i),z(),A(o),l},l.resize=function(t){if((t|=0)!==p.width){l.width=p.width=t,l.height=p.height=t,P(p);for(var n=0;6>n;++n)for(var r=0;p.mipmask>>r;++r)e.texImage2D(34069+n,r,p.format,t>>r,t>>r,0,p.format,p.type,null);return z(),a.profile&&(p.stats.size=k(p.internalformat,p.type,l.width,l.height,!1,!0)),l}},l._reglType="textureCube",l._texture=p,a.profile&&(l.stats=p.stats),l.destroy=function(){p.decRef()},l},clear:function(){for(var t=0;t<be;++t)e.activeTexture(33984+t),e.bindTexture(3553,null),ge[t]=null;G(xe).forEach(B),o.cubeCount=0,o.textureCount=0},getTexture:function(e){return null},restore:function(){G(xe).forEach(function(t){t.texture=e.createTexture(),e.bindTexture(t.target,t.texture);for(var n=0;32>n;++n)if(0!=(t.mipmask&1<<n))if(3553===t.target)e.texImage2D(3553,n,t.internalformat,t.width>>n,t.height>>n,0,t.internalformat,t.type,null);else for(var r=0;6>r;++r)e.texImage2D(34069+r,n,t.internalformat,t.width>>n,t.height>>n,0,t.internalformat,t.type,null);F(t.texInfo,t.target)})}}}function E(e,t,n,r,i,o){function a(e,t,n){this.target=e,this.texture=t,this.renderbuffer=n;var r=e=0;t?(e=t.width,r=t.height):n&&(e=n.width,r=n.height),this.width=e,this.height=r}function f(e){e&&(e.texture&&e.texture._texture.decRef(),e.renderbuffer&&e.renderbuffer._renderbuffer.decRef())}function u(e,t,n){e&&(e.texture?e.texture._texture.refCount+=1:e.renderbuffer._renderbuffer.refCount+=1)}function s(t,n){n&&(n.texture?e.framebufferTexture2D(36160,t,n.target,n.texture._texture.texture,0):e.framebufferRenderbuffer(36160,t,36161,n.renderbuffer._renderbuffer.renderbuffer))}function c(e){var t=3553,n=null,r=null,i=e;return"object"==typeof e&&(i=e.data,"target"in e&&(t=0|e.target)),"texture2d"===(e=i._reglType)?n=i:"textureCube"===e?n=i:"renderbuffer"===e&&(r=i,t=36161),new a(t,n,r)}function l(e,t,n,o,f){return n?((e=r.create2D({width:e,height:t,format:o,type:f}))._texture.refCount=0,new a(3553,e,null)):((e=i.create({width:e,height:t,format:o}))._renderbuffer.refCount=0,new a(36161,null,e))}function p(e){return e&&(e.texture||e.renderbuffer)}function h(e,t,n){e&&(e.texture?e.texture.resize(t,n):e.renderbuffer&&e.renderbuffer.resize(t,n))}function d(){this.id=k++,A[this.id]=this,this.framebuffer=e.createFramebuffer(),this.height=this.width=0,this.colorAttachments=[],this.depthStencilAttachment=this.stencilAttachment=this.depthAttachment=null}function m(e){e.colorAttachments.forEach(f),f(e.depthAttachment),f(e.stencilAttachment),f(e.depthStencilAttachment)}function x(t){e.deleteFramebuffer(t.framebuffer),t.framebuffer=null,o.framebufferCount--,delete A[t.id]}function b(t){var r;e.bindFramebuffer(36160,t.framebuffer);var i=t.colorAttachments;for(r=0;r<i.length;++r)s(36064+r,i[r]);for(r=i.length;r<n.maxColorAttachments;++r)e.framebufferTexture2D(36160,36064+r,3553,null,0);e.framebufferTexture2D(36160,33306,3553,null,0),e.framebufferTexture2D(36160,36096,3553,null,0),e.framebufferTexture2D(36160,36128,3553,null,0),s(36096,t.depthAttachment),s(36128,t.stencilAttachment),s(33306,t.depthStencilAttachment),e.checkFramebufferStatus(36160),e.bindFramebuffer(36160,v.next?v.next.framebuffer:null),v.cur=v.next,e.getError()}function g(e,t){function n(e,t){var i,o=0,a=0,f=!0,s=!0;i=null;var h=!0,d="rgba",x="uint8",g=1,v=null,w=null,k=null,A=!1;"number"==typeof e?(o=0|e,a=0|t||o):e?("shape"in e?(o=(a=e.shape)[0],a=a[1]):("radius"in e&&(o=a=e.radius),"width"in e&&(o=e.width),"height"in e&&(a=e.height)),("color"in e||"colors"in e)&&(i=e.color||e.colors,Array.isArray(i)),i||("colorCount"in e&&(g=0|e.colorCount),"colorTexture"in e&&(h=!!e.colorTexture,d="rgba4"),"colorType"in e&&(x=e.colorType,!h)&&("half float"===x||"float16"===x?d="rgba16f":"float"!==x&&"float32"!==x||(d="rgba32f")),"colorFormat"in e&&(d=e.colorFormat,0<=y.indexOf(d)?h=!0:0<=_.indexOf(d)&&(h=!1))),("depthTexture"in e||"depthStencilTexture"in e)&&(A=!(!e.depthTexture&&!e.depthStencilTexture)),"depth"in e&&("boolean"==typeof e.depth?f=e.depth:(v=e.depth,s=!1)),"stencil"in e&&("boolean"==typeof e.stencil?s=e.stencil:(w=e.stencil,f=!1)),"depthStencil"in e&&("boolean"==typeof e.depthStencil?f=s=e.depthStencil:(k=e.depthStencil,s=f=!1))):o=a=1;var E=null,T=null,C=null,S=null;if(Array.isArray(i))E=i.map(c);else if(i)E=[c(i)];else for(E=Array(g),i=0;i<g;++i)E[i]=l(o,a,h,d,x);for(o=o||E[0].width,a=a||E[0].height,v?T=c(v):f&&!s&&(T=l(o,a,A,"depth","uint32")),w?C=c(w):s&&!f&&(C=l(o,a,!1,"stencil","uint8")),k?S=c(k):!v&&!w&&s&&f&&(S=l(o,a,A,"depth stencil","depth stencil")),f=null,i=0;i<E.length;++i)u(E[i]),E[i]&&E[i].texture&&(s=ge[E[i].texture._texture.format]*ve[E[i].texture._texture.type],null===f&&(f=s));return u(T),u(C),u(S),m(r),r.width=o,r.height=a,r.colorAttachments=E,r.depthAttachment=T,r.stencilAttachment=C,r.depthStencilAttachment=S,n.color=E.map(p),n.depth=p(T),n.stencil=p(C),n.depthStencil=p(S),n.width=r.width,n.height=r.height,b(r),n}var r=new d;return o.framebufferCount++,n(e,t),U(n,{resize:function(e,t){var i=0|e,o=0|t||i;if(i===r.width&&o===r.height)return n;for(var a=r.colorAttachments,f=0;f<a.length;++f)h(a[f],i,o);return h(r.depthAttachment,i,o),h(r.stencilAttachment,i,o),h(r.depthStencilAttachment,i,o),r.width=n.width=i,r.height=n.height=o,b(r),n},_reglType:"framebuffer",_framebuffer:r,destroy:function(){x(r),m(r)},use:function(e){v.setFBO({framebuffer:n},e)}})}var v={cur:null,next:null,dirty:!1,setFBO:null},y=["rgba"],_=["rgba4","rgb565","rgb5 a1"];t.ext_srgb&&_.push("srgba"),t.ext_color_buffer_half_float&&_.push("rgba16f","rgb16f"),t.webgl_color_buffer_float&&_.push("rgba32f");var w=["uint8"];t.oes_texture_half_float&&w.push("half float","float16"),t.oes_texture_float&&w.push("float","float32");var k=0,A={};return U(v,{getFramebuffer:function(e){return"function"==typeof e&&"framebuffer"===e._reglType&&(e=e._framebuffer)instanceof d?e:null},create:g,createCube:function(e){function t(e){var i,o={color:null},a=0,f=null;i="rgba";var u="uint8",s=1;if("number"==typeof e?a=0|e:e?("shape"in e?a=e.shape[0]:("radius"in e&&(a=0|e.radius),"width"in e?a=0|e.width:"height"in e&&(a=0|e.height)),("color"in e||"colors"in e)&&(f=e.color||e.colors,Array.isArray(f)),f||("colorCount"in e&&(s=0|e.colorCount),"colorType"in e&&(u=e.colorType),"colorFormat"in e&&(i=e.colorFormat)),"depth"in e&&(o.depth=e.depth),"stencil"in e&&(o.stencil=e.stencil),"depthStencil"in e&&(o.depthStencil=e.depthStencil)):a=1,f)if(Array.isArray(f))for(e=[],i=0;i<f.length;++i)e[i]=f[i];else e=[f];else for(e=Array(s),f={radius:a,format:i,type:u},i=0;i<s;++i)e[i]=r.createCube(f);for(o.color=Array(e.length),i=0;i<e.length;++i)s=e[i],a=a||s.width,o.color[i]={target:34069,data:e[i]};for(i=0;6>i;++i){for(s=0;s<e.length;++s)o.color[s].target=34069+i;0<i&&(o.depth=n[0].depth,o.stencil=n[0].stencil,o.depthStencil=n[0].depthStencil),n[i]?n[i](o):n[i]=g(o)}return U(t,{width:a,height:a,color:e})}var n=Array(6);return t(e),U(t,{faces:n,resize:function(e){var r=0|e;if(r===t.width)return t;var i=t.color;for(e=0;e<i.length;++e)i[e].resize(r);for(e=0;6>e;++e)n[e].resize(r);return t.width=t.height=r,t},_reglType:"framebufferCube",destroy:function(){n.forEach(function(e){e.destroy()})}})},clear:function(){G(A).forEach(x)},restore:function(){G(A).forEach(function(t){t.framebuffer=e.createFramebuffer(),b(t)})}})}function T(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function C(e,t,n,r){function i(e,t,n,r){this.name=e,this.id=t,this.location=n,this.info=r}function o(e,t){for(var n=0;n<e.length;++n)if(e[n].id===t.id)return void(e[n].location=t.location);e.push(t)}function a(n,r,i){if(!(a=(i=35632===n?s:c)[r])){var o=t.str(r),a=e.createShader(n);e.shaderSource(a,o),e.compileShader(a),i[r]=a}return a}function f(e,t){this.id=h++,this.fragId=e,this.vertId=t,this.program=null,this.uniforms=[],this.attributes=[],r.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function u(n,f){var u,s;u=a(35632,n.fragId),s=a(35633,n.vertId);var c=n.program=e.createProgram();e.attachShader(c,u),e.attachShader(c,s),e.linkProgram(c);var l=e.getProgramParameter(c,35718);r.profile&&(n.stats.uniformsCount=l);var p=n.uniforms;for(u=0;u<l;++u)if(s=e.getActiveUniform(c,u))if(1<s.size)for(var h=0;h<s.size;++h){var d=s.name.replace("[0]","["+h+"]");o(p,new i(d,t.id(d),e.getUniformLocation(c,d),s))}else o(p,new i(s.name,t.id(s.name),e.getUniformLocation(c,s.name),s));for(l=e.getProgramParameter(c,35721),r.profile&&(n.stats.attributesCount=l),p=n.attributes,u=0;u<l;++u)(s=e.getActiveAttrib(c,u))&&o(p,new i(s.name,t.id(s.name),e.getAttribLocation(c,s.name),s))}var s={},c={},l={},p=[],h=0;return r.profile&&(n.getMaxUniformsCount=function(){var e=0;return p.forEach(function(t){t.stats.uniformsCount>e&&(e=t.stats.uniformsCount)}),e},n.getMaxAttributesCount=function(){var e=0;return p.forEach(function(t){t.stats.attributesCount>e&&(e=t.stats.attributesCount)}),e}),{clear:function(){var t=e.deleteShader.bind(e);G(s).forEach(t),s={},G(c).forEach(t),c={},p.forEach(function(t){e.deleteProgram(t.program)}),p.length=0,l={},n.shaderCount=0},program:function(e,t,r){var i=l[t];i||(i=l[t]={});var o=i[e];return o||(o=new f(t,e),n.shaderCount++,u(o),i[e]=o,p.push(o)),o},restore:function(){s={},c={};for(var e=0;e<p.length;++e)u(p[e])},shader:a,frag:-1,vert:-1}}function S(e,t,n,r,i,o,a){function f(i){var o;o=null===t.next?5121:t.next.colorAttachments[0].texture._texture.type;var a=0,f=0,u=r.framebufferWidth,s=r.framebufferHeight,c=null;return Q(i)?c=i:i&&(a=0|i.x,f=0|i.y,u=0|(i.width||r.framebufferWidth-a),s=0|(i.height||r.framebufferHeight-f),c=i.data||null),n(),i=u*s*4,c||(5121===o?c=new Uint8Array(i):5126===o&&(c=c||new Float32Array(i))),e.pixelStorei(3333,4),e.readPixels(a,f,u,s,6408,o,c),c}return function(e){return e&&"framebuffer"in e?function(e){var n;return t.setFBO({framebuffer:e.framebuffer},function(){n=f(e)}),n}(e):f(e)}}function D(e){return Array.prototype.slice.call(e)}function j(e){return D(e).join("")}function O(){function e(){var e=[],t=[];return U(function(){e.push.apply(e,D(arguments))},{def:function(){var r="v"+n++;return t.push(r),0<arguments.length&&(e.push(r,"="),e.push.apply(e,D(arguments)),e.push(";")),r},toString:function(){return j([0<t.length?"var "+t+";":"",j(e)])}})}function t(){function t(e,t){r(e,t,"=",n.def(e,t),";")}var n=e(),r=e(),i=n.toString,o=r.toString;return U(function(){n.apply(n,D(arguments))},{def:n.def,entry:n,exit:r,save:t,set:function(e,r,i){t(e,r),n(e,r,"=",i,";")},toString:function(){return i()+o()}})}var n=0,r=[],i=[],o=e(),a={};return{global:o,link:function(e){for(var t=0;t<i.length;++t)if(i[t]===e)return r[t];return t="g"+n++,r.push(t),i.push(e),t},block:e,proc:function(e,n){function r(){var e="a"+i.length;return i.push(e),e}var i=[];n=n||0;for(var o=0;o<n;++o)r();var f=(o=t()).toString;return a[e]=U(o,{arg:r,toString:function(){return j(["function(",i.join(),"){",f(),"}"])}})},scope:t,cond:function(){var e=j(arguments),n=t(),r=t(),i=n.toString,o=r.toString;return U(n,{then:function(){return n.apply(n,D(arguments)),this},else:function(){return r.apply(r,D(arguments)),this},toString:function(){var t=o();return t&&(t="else{"+t+"}"),j(["if(",e,"){",i(),"}",t])}})},compile:function(){var e=['"use strict";',o,"return {"];Object.keys(a).forEach(function(t){e.push('"',t,'":',a[t].toString(),",")}),e.push("}");var t=j(e).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,r.concat(t)).apply(null,i)}}}function F(e){return Array.isArray(e)||Q(e)||u(e)}function L(e){return e.sort(function(e,t){return"viewport"===e?-1:"viewport"===t?1:e<t?-1:1})}function P(e,t,n,r){this.thisDep=e,this.contextDep=t,this.propDep=n,this.append=r}function z(e){return e&&!(e.thisDep||e.contextDep||e.propDep)}function B(e){return new P(!1,!1,!1,e)}function M(e,t){var n=e.type;return 0===n?new P(!0,1<=(n=e.data.length),2<=n,t):4===n?new P((n=e.data).thisDep,n.contextDep,n.propDep,t):new P(3===n,2===n,1===n,t)}function I(e,t,n,r,i,a,f,u,s,c,l,p,h,d,m){function b(e){return e.replace(".","_")}function g(e,t,n){var r=b(e);re.push(e),te[r]=ee[r]=!!n,ie[r]=t}function v(e,t,n){var r=b(e);re.push(e),Array.isArray(n)?(ee[r]=n.slice(),te[r]=n.slice()):ee[r]=te[r]=n,oe[r]=t}function y(){var e=O(),n=e.link,r=e.global;e.id=ue++,e.batchId="0";var i=n(ae),o=e.shared={props:"a0"};Object.keys(ae).forEach(function(e){o[e]=r.def(i,".",e)});var a=e.next={},f=e.current={};Object.keys(oe).forEach(function(e){Array.isArray(ee[e])&&(a[e]=r.def(o.next,".",e),f[e]=r.def(o.current,".",e))});var u=e.constants={};Object.keys(fe).forEach(function(e){u[e]=r.def(JSON.stringify(fe[e]))}),e.invoke=function(t,r){switch(r.type){case 0:var i=["this",o.context,o.props,e.batchId];return t.def(n(r.data),".call(",i.slice(0,Math.max(r.data.length+1,4)),")");case 1:return t.def(o.props,r.data);case 2:return t.def(o.context,r.data);case 3:return t.def("this",r.data);case 4:return r.data.append(e,t),r.data.ref}},e.attribCache={};var s={};return e.scopeAttrib=function(e){if((e=t.id(e))in s)return s[e];var r=c.scope[e];return r||(r=c.scope[e]=new Y),s[e]=n(r)},e}function _(e,t){var n=e.static,r=e.dynamic;if("framebuffer"in n){var i=n.framebuffer;return i?(i=u.getFramebuffer(i),B(function(e,t){var n=e.link(i),r=e.shared;return t.set(r.framebuffer,".next",n),r=r.context,t.set(r,".framebufferWidth",n+".width"),t.set(r,".framebufferHeight",n+".height"),n})):B(function(e,t){var n=e.shared;return t.set(n.framebuffer,".next","null"),n=n.context,t.set(n,".framebufferWidth",n+".drawingBufferWidth"),t.set(n,".framebufferHeight",n+".drawingBufferHeight"),"null"})}if("framebuffer"in r){var o=r.framebuffer;return M(o,function(e,t){var n=e.invoke(t,o),r=e.shared,i=r.framebuffer;n=t.def(i,".getFramebuffer(",n,")");return t.set(i,".next",n),r=r.context,t.set(r,".framebufferWidth",n+"?"+n+".width:"+r+".drawingBufferWidth"),t.set(r,".framebufferHeight",n+"?"+n+".height:"+r+".drawingBufferHeight"),n})}return null}function w(e){function n(e){if(e in r){var n=t.id(r[e]);return(e=B(function(){return n})).id=n,e}if(e in i){var o=i[e];return M(o,function(e,t){var n=e.invoke(t,o);return t.def(e.shared.strings,".id(",n,")")})}return null}var r=e.static,i=e.dynamic,o=n("frag"),a=n("vert"),f=null;return z(o)&&z(a)?(f=l.program(a.id,o.id),e=B(function(e,t){return e.link(f)})):e=new P(o&&o.thisDep||a&&a.thisDep,o&&o.contextDep||a&&a.contextDep,o&&o.propDep||a&&a.propDep,function(e,t){var n,r,i=e.shared.shader;return n=o?o.append(e,t):t.def(i,".","frag"),r=a?a.append(e,t):t.def(i,".","vert"),t.def(i+".program("+r+","+n+")")}),{frag:o,vert:a,progVar:e,program:f}}function k(e,t){function n(e,t){if(e in r){var n=0|r[e];return B(function(e,r){return t&&(e.OFFSET=n),n})}if(e in i){var a=i[e];return M(a,function(e,n){var r=e.invoke(n,a);return t&&(e.OFFSET=r),r})}return t&&o?B(function(e,t){return e.OFFSET="0",0}):null}var r=e.static,i=e.dynamic,o=function(){if("elements"in r){var e=r.elements;F(e)?e=a.getElements(a.create(e,!0)):e&&(e=a.getElements(e));var t=B(function(t,n){if(e){var r=t.link(e);return t.ELEMENTS=r}return t.ELEMENTS=null});return t.value=e,t}if("elements"in i){var n=i.elements;return M(n,function(e,t){var r=(i=e.shared).isBufferArgs,i=i.elements,o=e.invoke(t,n),a=t.def("null");r=t.def(r,"(",o,")"),o=e.cond(r).then(a,"=",i,".createStream(",o,");").else(a,"=",i,".getElements(",o,");");return t.entry(o),t.exit(e.cond(r).then(i,".destroyStream(",a,");")),e.ELEMENTS=a})}return null}(),f=n("offset",!0);return{elements:o,primitive:function(){if("primitive"in r){var e=r.primitive;return B(function(t,n){return ne[e]})}if("primitive"in i){var t=i.primitive;return M(t,function(e,n){var r=e.constants.primTypes,i=e.invoke(n,t);return n.def(r,"[",i,"]")})}return o?z(o)?o.value?B(function(e,t){return t.def(e.ELEMENTS,".primType")}):B(function(){return 4}):new P(o.thisDep,o.contextDep,o.propDep,function(e,t){var n=e.ELEMENTS;return t.def(n,"?",n,".primType:",4)}):null}(),count:function(){if("count"in r){var e=0|r.count;return B(function(){return e})}if("count"in i){var t=i.count;return M(t,function(e,n){return e.invoke(n,t)})}return o?z(o)?o?f?new P(f.thisDep,f.contextDep,f.propDep,function(e,t){return t.def(e.ELEMENTS,".vertCount-",e.OFFSET)}):B(function(e,t){return t.def(e.ELEMENTS,".vertCount")}):B(function(){return-1}):new P(o.thisDep||f.thisDep,o.contextDep||f.contextDep,o.propDep||f.propDep,function(e,t){var n=e.ELEMENTS;return e.OFFSET?t.def(n,"?",n,".vertCount-",e.OFFSET,":-1"):t.def(n,"?",n,".vertCount:-1")}):null}(),instances:n("instances",!1),offset:f}}function A(e,n){var r=e.static,o=e.dynamic,a={};return Object.keys(r).forEach(function(e){var n=r[e],o=t.id(e),f=new Y;if(F(n))f.state=1,f.buffer=i.getBuffer(i.create(n,34962,!1,!0)),f.type=0;else if(s=i.getBuffer(n))f.state=1,f.buffer=s,f.type=0;else if("constant"in n){var u=n.constant;f.buffer="null",f.state=2,"number"==typeof u?f.x=u:ye.forEach(function(e,t){t<u.length&&(f[e]=u[t])})}else{var s=F(n.buffer)?i.getBuffer(i.create(n.buffer,34962,!1,!0)):i.getBuffer(n.buffer),c=0|n.offset,l=0|n.stride,p=0|n.size,h=!!n.normalized,d=0;"type"in n&&(d=K[n.type]),n=0|n.divisor,f.buffer=s,f.state=1,f.size=p,f.normalized=h,f.type=d||s.dtype,f.offset=c,f.stride=l,f.divisor=n}a[e]=B(function(e,t){var n=e.attribCache;if(o in n)return n[o];var r={isStream:!1};return Object.keys(f).forEach(function(e){r[e]=f[e]}),f.buffer&&(r.buffer=e.link(f.buffer),r.type=r.type||r.buffer+".dtype"),n[o]=r})}),Object.keys(o).forEach(function(e){var t=o[e];a[e]=M(t,function(e,n){function r(e){n(u[e],"=",i,".",e,"|0;")}var i=e.invoke(n,t),o=e.shared,a=o.isBufferArgs,f=o.buffer,u={isStream:n.def(!1)},s=new Y;s.state=1,Object.keys(s).forEach(function(e){u[e]=n.def(""+s[e])});var c=u.buffer,l=u.type;return n("if(",a,"(",i,")){",u.isStream,"=true;",c,"=",f,".createStream(",34962,",",i,");",l,"=",c,".dtype;","}else{",c,"=",f,".getBuffer(",i,");","if(",c,"){",l,"=",c,".dtype;",'}else if("constant" in ',i,"){",u.state,"=",2,";","if(typeof "+i+'.constant === "number"){',u[ye[0]],"=",i,".constant;",ye.slice(1).map(function(e){return u[e]}).join("="),"=0;","}else{",ye.map(function(e,t){return u[e]+"="+i+".constant.length>"+t+"?"+i+".constant["+t+"]:0;"}).join(""),"}}else{","if(",a,"(",i,".buffer)){",c,"=",f,".createStream(",34962,",",i,".buffer);","}else{",c,"=",f,".getBuffer(",i,".buffer);","}",l,'="type" in ',i,"?",o.glTypes,"[",i,".type]:",c,".dtype;",u.normalized,"=!!",i,".normalized;"),r("size"),r("offset"),r("stride"),r("divisor"),n("}}"),n.exit("if(",u.isStream,"){",f,".destroyStream(",c,");","}"),u})}),a}function E(e,t,n,r,i){var a=_(e),f=function(e,t,n){function r(e){if(e in i){var n=i[e];e=!0;var r,a,f=0|n.x,u=0|n.y;return"width"in n?r=0|n.width:e=!1,"height"in n?a=0|n.height:e=!1,new P(!e&&t&&t.thisDep,!e&&t&&t.contextDep,!e&&t&&t.propDep,function(e,t){var i=e.shared.context,o=r;"width"in n||(o=t.def(i,".","framebufferWidth","-",f));var s=a;return"height"in n||(s=t.def(i,".","framebufferHeight","-",u)),[f,u,o,s]})}if(e in o){var s=o[e];return e=M(s,function(e,t){var n=e.invoke(t,s),r=e.shared.context,i=t.def(n,".x|0"),o=t.def(n,".y|0");return[i,o,t.def('"width" in ',n,"?",n,".width|0:","(",r,".","framebufferWidth","-",i,")"),n=t.def('"height" in ',n,"?",n,".height|0:","(",r,".","framebufferHeight","-",o,")")]}),t&&(e.thisDep=e.thisDep||t.thisDep,e.contextDep=e.contextDep||t.contextDep,e.propDep=e.propDep||t.propDep),e}return t?new P(t.thisDep,t.contextDep,t.propDep,function(e,t){var n=e.shared.context;return[0,0,t.def(n,".","framebufferWidth"),t.def(n,".","framebufferHeight")]}):null}var i=e.static,o=e.dynamic;if(e=r("viewport")){var a=e;e=new P(e.thisDep,e.contextDep,e.propDep,function(e,t){var n=a.append(e,t),r=e.shared.context;return t.set(r,".viewportWidth",n[2]),t.set(r,".viewportHeight",n[3]),n})}return{viewport:e,scissor_box:r("scissor.box")}}(e,a),u=k(e),s=function(e,t){var n=e.static,r=e.dynamic,i={};return re.forEach(function(e){function t(t,o){if(e in n){var f=t(n[e]);i[a]=B(function(){return f})}else if(e in r){var u=r[e];i[a]=M(u,function(e,t){return o(e,t,e.invoke(t,u))})}}var a=b(e);switch(e){case"cull.enable":case"blend.enable":case"dither":case"stencil.enable":case"depth.enable":case"scissor.enable":case"polygonOffset.enable":case"sample.alpha":case"sample.enable":case"depth.mask":return t(function(e){return e},function(e,t,n){return n});case"depth.func":return t(function(e){return ke[e]},function(e,t,n){return t.def(e.constants.compareFuncs,"[",n,"]")});case"depth.range":return t(function(e){return e},function(e,t,n){return[t.def("+",n,"[0]"),t=t.def("+",n,"[1]")]});case"blend.func":return t(function(e){return[we["srcRGB"in e?e.srcRGB:e.src],we["dstRGB"in e?e.dstRGB:e.dst],we["srcAlpha"in e?e.srcAlpha:e.src],we["dstAlpha"in e?e.dstAlpha:e.dst]]},function(e,t,n){function r(e,r){return t.def('"',e,r,'" in ',n,"?",n,".",e,r,":",n,".",e)}e=e.constants.blendFuncs;var i=r("src","RGB"),o=r("dst","RGB"),a=(i=t.def(e,"[",i,"]"),t.def(e,"[",r("src","Alpha"),"]"));return[i,o=t.def(e,"[",o,"]"),a,e=t.def(e,"[",r("dst","Alpha"),"]")]});case"blend.equation":return t(function(e){return"string"==typeof e?[$[e],$[e]]:"object"==typeof e?[$[e.rgb],$[e.alpha]]:void 0},function(e,t,n){var r=e.constants.blendEquations,i=t.def(),o=t.def();return(e=e.cond("typeof ",n,'==="string"')).then(i,"=",o,"=",r,"[",n,"];"),e.else(i,"=",r,"[",n,".rgb];",o,"=",r,"[",n,".alpha];"),t(e),[i,o]});case"blend.color":return t(function(e){return o(4,function(t){return+e[t]})},function(e,t,n){return o(4,function(e){return t.def("+",n,"[",e,"]")})});case"stencil.mask":return t(function(e){return 0|e},function(e,t,n){return t.def(n,"|0")});case"stencil.func":return t(function(e){return[ke[e.cmp||"keep"],e.ref||0,"mask"in e?e.mask:-1]},function(e,t,n){return[e=t.def('"cmp" in ',n,"?",e.constants.compareFuncs,"[",n,".cmp]",":",7680),t.def(n,".ref|0"),t=t.def('"mask" in ',n,"?",n,".mask|0:-1")]});case"stencil.opFront":case"stencil.opBack":return t(function(t){return["stencil.opBack"===e?1029:1028,Ae[t.fail||"keep"],Ae[t.zfail||"keep"],Ae[t.zpass||"keep"]]},function(t,n,r){function i(e){return n.def('"',e,'" in ',r,"?",o,"[",r,".",e,"]:",7680)}var o=t.constants.stencilOps;return["stencil.opBack"===e?1029:1028,i("fail"),i("zfail"),i("zpass")]});case"polygonOffset.offset":return t(function(e){return[0|e.factor,0|e.units]},function(e,t,n){return[t.def(n,".factor|0"),t=t.def(n,".units|0")]});case"cull.face":return t(function(e){var t=0;return"front"===e?t=1028:"back"===e&&(t=1029),t},function(e,t,n){return t.def(n,'==="front"?',1028,":",1029)});case"lineWidth":return t(function(e){return e},function(e,t,n){return n});case"frontFace":return t(function(e){return Ee[e]},function(e,t,n){return t.def(n+'==="cw"?2304:2305')});case"colorMask":return t(function(e){return e.map(function(e){return!!e})},function(e,t,n){return o(4,function(e){return"!!"+n+"["+e+"]"})});case"sample.coverage":return t(function(e){return["value"in e?e.value:1,!!e.invert]},function(e,t,n){return[t.def('"value" in ',n,"?+",n,".value:1"),t=t.def("!!",n,".invert")]})}}),i}(e),c=w(e),l=f.viewport;return l&&(s.viewport=l),(f=f[l=b("scissor.box")])&&(s[l]=f),(a={framebuffer:a,draw:u,shader:c,state:s,dirty:f=0<Object.keys(s).length}).profile=function(e){var t,n=e.static;if(e=e.dynamic,"profile"in n){var r=!!n.profile;(t=B(function(e,t){return r})).enable=r}else if("profile"in e){var i=e.profile;t=M(i,function(e,t){return e.invoke(t,i)})}return t}(e),a.uniforms=function(e,t){var n=e.static,r=e.dynamic,i={};return Object.keys(n).forEach(function(e){var t,r=n[e];if("number"==typeof r||"boolean"==typeof r)t=B(function(){return r});else if("function"==typeof r){var a=r._reglType;"texture2d"===a||"textureCube"===a?t=B(function(e){return e.link(r)}):"framebuffer"!==a&&"framebufferCube"!==a||(t=B(function(e){return e.link(r.color[0])}))}else x(r)&&(t=B(function(e){return e.global.def("[",o(r.length,function(e){return r[e]}),"]")}));t.value=r,i[e]=t}),Object.keys(r).forEach(function(e){var t=r[e];i[e]=M(t,function(e,n){return e.invoke(n,t)})}),i}(n),a.attributes=A(t),a.context=function(e){var t=e.static,n=e.dynamic,r={};return Object.keys(t).forEach(function(e){var n=t[e];r[e]=B(function(e,t){return"number"==typeof n||"boolean"==typeof n?""+n:e.link(n)})}),Object.keys(n).forEach(function(e){var t=n[e];r[e]=M(t,function(e,n){return e.invoke(n,t)})}),r}(r),a}function T(e,t,n){var r=e.shared.context,i=e.scope();Object.keys(n).forEach(function(o){t.save(r,"."+o),i(r,".",o,"=",n[o].append(e,t),";")}),t(i)}function C(e,t,n,r){var i,o=(f=e.shared).gl,a=f.framebuffer;Z&&(i=t.def(f.extensions,".webgl_draw_buffers"));var f=(u=e.constants).drawBuffer,u=u.backBuffer;e=n?n.append(e,t):t.def(a,".next"),r||t("if(",e,"!==",a,".cur){"),t("if(",e,"){",o,".bindFramebuffer(",36160,",",e,".framebuffer);"),Z&&t(i,".drawBuffersWEBGL(",f,"[",e,".colorAttachments.length]);"),t("}else{",o,".bindFramebuffer(",36160,",null);"),Z&&t(i,".drawBuffersWEBGL(",u,");"),t("}",a,".cur=",e,";"),r||t("}")}function S(e,t,n){var r=e.shared,i=r.gl,a=e.current,f=e.next,u=r.current,s=r.next,c=e.cond(u,".dirty");re.forEach(function(t){var r,l;if(!((t=b(t))in n.state))if(t in f){r=f[t],l=a[t];var p=o(ee[t].length,function(e){return c.def(r,"[",e,"]")});c(e.cond(p.map(function(e,t){return e+"!=="+l+"["+t+"]"}).join("||")).then(i,".",oe[t],"(",p,");",p.map(function(e,t){return l+"["+t+"]="+e}).join(";"),";"))}else r=c.def(s,".",t),p=e.cond(r,"!==",u,".",t),c(p),t in ie?p(e.cond(r).then(i,".enable(",ie[t],");").else(i,".disable(",ie[t],");"),u,".",t,"=",r,";"):p(i,".",oe[t],"(",r,");",u,".",t,"=",r,";")}),0===Object.keys(n.state).length&&c(u,".dirty=false;"),t(c)}function D(e,t,n,r){var i=e.shared,o=e.current,a=i.current,f=i.gl;L(Object.keys(n)).forEach(function(i){var u=n[i];if(!r||r(u)){var s=u.append(e,t);if(ie[i]){var c=ie[i];z(u)?t(f,s?".enable(":".disable(",c,");"):t(e.cond(s).then(f,".enable(",c,");").else(f,".disable(",c,");")),t(a,".",i,"=",s,";")}else if(x(s)){var l=o[i];t(f,".",oe[i],"(",s,");",s.map(function(e,t){return l+"["+t+"]="+e}).join(";"),";")}else t(f,".",oe[i],"(",s,");",a,".",i,"=",s,";")}})}function j(e,t){J&&(e.instancing=t.def(e.shared.extensions,".angle_instanced_arrays"))}function I(e,t,n,r,i){function o(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function a(e){e(s=t.def(),"=",o(),";"),"string"==typeof i?e(p,".count+=",i,";"):e(p,".count++;"),d&&(r?e(c=t.def(),"=",m,".getNumPendingQueries();"):e(m,".beginQuery(",p,");"))}function f(e){e(p,".cpuTime+=",o(),"-",s,";"),d&&(r?e(m,".pushScopeStats(",c,",",m,".getNumPendingQueries(),",p,");"):e(m,".endQuery();"))}function u(e){var n=t.def(h,".profile");t(h,".profile=",e,";"),t.exit(h,".profile=",n,";")}var s,c,l=e.shared,p=e.stats,h=l.current,m=l.timer;if(n=n.profile){if(z(n))return void(n.enable?(a(t),f(t.exit),u("true")):u("false"));u(n=n.append(e,t))}else n=t.def(h,".profile");a(l=e.block()),t("if(",n,"){",l,"}"),f(e=e.block()),t.exit("if(",n,"){",e,"}")}function N(e,t,n,r,i){function o(n,r,i){function o(){t("if(!",c,".buffer){",u,".enableVertexAttribArray(",s,");}");var n,o=i.type;n=i.size?t.def(i.size,"||",r):r,t("if(",c,".type!==",o,"||",c,".size!==",n,"||",h.map(function(e){return c+"."+e+"!=="+i[e]}).join("||"),"){",u,".bindBuffer(",34962,",",l,".buffer);",u,".vertexAttribPointer(",[s,n,o,i.normalized,i.stride,i.offset],");",c,".type=",o,";",c,".size=",n,";",h.map(function(e){return c+"."+e+"="+i[e]+";"}).join(""),"}"),J&&(o=i.divisor,t("if(",c,".divisor!==",o,"){",e.instancing,".vertexAttribDivisorANGLE(",[s,o],");",c,".divisor=",o,";}"))}function f(){t("if(",c,".buffer){",u,".disableVertexAttribArray(",s,");","}if(",ye.map(function(e,t){return c+"."+e+"!=="+p[t]}).join("||"),"){",u,".vertexAttrib4f(",s,",",p,");",ye.map(function(e,t){return c+"."+e+"="+p[t]+";"}).join(""),"}")}var u=a.gl,s=t.def(n,".location"),c=t.def(a.attributes,"[",s,"]");n=i.state;var l=i.buffer,p=[i.x,i.y,i.z,i.w],h=["buffer","normalized","offset","stride"];1===n?o():2===n?f():(t("if(",n,"===",1,"){"),o(),t("}else{"),f(),t("}"))}var a=e.shared;r.forEach(function(r){var a,f=r.name,u=n.attributes[f];if(u){if(!i(u))return;a=u.append(e,t)}else{if(!i(Te))return;var s=e.scopeAttrib(f);a={},Object.keys(new Y).forEach(function(e){a[e]=t.def(s,".",e)})}o(e.link(r),function(e){switch(e){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(r.info.type),a)})}function U(e,n,r,i,a){for(var f,u=e.shared,s=u.gl,c=0;c<i.length;++c){var l,p=(m=i[c]).name,h=m.info.type,d=r.uniforms[p],m=e.link(m)+".location";if(d){if(!a(d))continue;if(z(d)){if(p=d.value,35678===h||35680===h)n(s,".uniform1i(",m,",",(h=e.link(p._texture||p.color[0]._texture))+".bind());"),n.exit(h,".unbind();");else if(35674===h||35675===h||35676===h)p=e.global.def("new Float32Array(["+Array.prototype.slice.call(p)+"])"),d=2,35675===h?d=3:35676===h&&(d=4),n(s,".uniformMatrix",d,"fv(",m,",false,",p,");");else{switch(h){case 5126:f="1f";break;case 35664:f="2f";break;case 35665:f="3f";break;case 35666:f="4f";break;case 35670:case 5124:f="1i";break;case 35671:case 35667:f="2i";break;case 35672:case 35668:f="3i";break;case 35673:f="4i";break;case 35669:f="4i"}n(s,".uniform",f,"(",m,",",x(p)?Array.prototype.slice.call(p):p,");")}continue}l=d.append(e,n)}else{if(!a(Te))continue;l=n.def(u.uniforms,"[",t.id(p),"]")}switch(35678===h?n("if(",l,"&&",l,'._reglType==="framebuffer"){',l,"=",l,".color[0];","}"):35680===h&&n("if(",l,"&&",l,'._reglType==="framebufferCube"){',l,"=",l,".color[0];","}"),p=1,h){case 35678:case 35680:n(s,".uniform1i(",m,",",h=n.def(l,"._texture"),".bind());"),n.exit(h,".unbind();");continue;case 5124:case 35670:f="1i";break;case 35667:case 35671:f="2i",p=2;break;case 35668:case 35672:f="3i",p=3;break;case 35669:case 35673:f="4i",p=4;break;case 5126:f="1f";break;case 35664:f="2f",p=2;break;case 35665:f="3f",p=3;break;case 35666:f="4f",p=4;break;case 35674:f="Matrix2fv";break;case 35675:f="Matrix3fv";break;case 35676:f="Matrix4fv"}if(n(s,".uniform",f,"(",m,","),"M"===f.charAt(0)){m=Math.pow(h-35674+2,2);var b=e.global.def("new Float32Array(",m,")");n("false,(Array.isArray(",l,")||",l," instanceof Float32Array)?",l,":(",o(m,function(e){return b+"["+e+"]="+l+"["+e+"]"}),",",b,")")}else n(1<p?o(p,function(e){return l+"["+e+"]"}):l);n(");")}}function R(e,t,n,r){function i(i){var o=p[i];return o?o.contextDep&&r.contextDynamic||o.propDep?o.append(e,n):o.append(e,t):t.def(l,".",i)}function o(){function e(){n(u,".drawElementsInstancedANGLE(",[d,x,b,m+"<<(("+b+"-5121)>>1)",f],");")}function t(){n(u,".drawArraysInstancedANGLE(",[d,m,x,f],");")}h?g?e():(n("if(",h,"){"),e(),n("}else{"),t(),n("}")):t()}function a(){function e(){n(c+".drawElements("+[d,x,b,m+"<<(("+b+"-5121)>>1)"]+");")}function t(){n(c+".drawArrays("+[d,m,x]+");")}h?g?e():(n("if(",h,"){"),e(),n("}else{"),t(),n("}")):t()}var f,u,s=e.shared,c=s.gl,l=s.draw,p=r.draw,h=function(){var i=p.elements,o=t;return i?((i.contextDep&&r.contextDynamic||i.propDep)&&(o=n),i=i.append(e,o)):i=o.def(l,".","elements"),i&&o("if("+i+")"+c+".bindBuffer(34963,"+i+".buffer.buffer);"),i}(),d=i("primitive"),m=i("offset"),x=function(){var i=p.count,o=t;return i?((i.contextDep&&r.contextDynamic||i.propDep)&&(o=n),i=i.append(e,o)):i=o.def(l,".","count"),i}();if("number"==typeof x){if(0===x)return}else n("if(",x,"){"),n.exit("}");J&&(f=i("instances"),u=e.instancing);var b=h+".type",g=p.elements&&z(p.elements);J&&("number"!=typeof f||0<=f)?"string"==typeof f?(n("if(",f,">0){"),o(),n("}else if(",f,"<0){"),a(),n("}")):o():a()}function W(e,t,n,r,i){return i=(t=y()).proc("body",i),J&&(t.instancing=i.def(t.shared.extensions,".angle_instanced_arrays")),e(t,i,n,r),t.compile().body}function V(e,t,n,r){j(e,t),N(e,t,n,r.attributes,function(){return!0}),U(e,t,n,r.uniforms,function(){return!0}),R(e,t,t,n)}function q(e,t,n,r){function i(){return!0}e.batchId="a1",j(e,t),N(e,t,n,r.attributes,i),U(e,t,n,r.uniforms,i),R(e,t,t,n)}function X(e,t,n,r){function i(e){return e.contextDep&&a||e.propDep}function o(e){return!i(e)}j(e,t);var a=n.contextDep,f=t.def(),u=t.def();e.shared.props=u,e.batchId=f;var s=e.scope(),c=e.scope();t(s.entry,"for(",f,"=0;",f,"<","a1",";++",f,"){",u,"=","a0","[",f,"];",c,"}",s.exit),n.needsContext&&T(e,c,n.context),n.needsFramebuffer&&C(e,c,n.framebuffer),D(e,c,n.state,i),n.profile&&i(n.profile)&&I(e,c,n,!1,!0),r?(N(e,s,n,r.attributes,o),N(e,c,n,r.attributes,i),U(e,s,n,r.uniforms,o),U(e,c,n,r.uniforms,i),R(e,s,c,n)):(t=e.global.def("{}"),r=n.shader.progVar.append(e,c),u=c.def(r,".id"),s=c.def(t,"[",u,"]"),c(e.shared.gl,".useProgram(",r,".program);","if(!",s,"){",s,"=",t,"[",u,"]=",e.link(function(t){return W(q,e,n,t,2)}),"(",r,");}",s,".call(this,a0[",f,"],",f,");"))}function Q(e,n){function r(t){var r=n.shader[t];r&&i.set(o.shader,"."+t,r.append(e,i))}var i=e.proc("scope",3);e.batchId="a2";var o=e.shared,a=o.current;T(e,i,n.context),n.framebuffer&&n.framebuffer.append(e,i),L(Object.keys(n.state)).forEach(function(t){var r=n.state[t].append(e,i);x(r)?r.forEach(function(n,r){i.set(e.next[t],"["+r+"]",n)}):i.set(o.next,"."+t,r)}),I(e,i,n,!0,!0),["elements","offset","count","instances","primitive"].forEach(function(t){var r=n.draw[t];r&&i.set(o.draw,"."+t,""+r.append(e,i))}),Object.keys(n.uniforms).forEach(function(r){i.set(o.uniforms,"["+t.id(r)+"]",n.uniforms[r].append(e,i))}),Object.keys(n.attributes).forEach(function(t){var r=n.attributes[t].append(e,i),o=e.scopeAttrib(t);Object.keys(new Y).forEach(function(e){i.set(o,"."+e,r[e])})}),r("vert"),r("frag"),0<Object.keys(n.state).length&&(i(a,".dirty=true;"),i.exit(a,".dirty=true;")),i("a1(",e.shared.context,",a0,",e.batchId,");")}function G(e,t,n){var r=t.static[n];if(r&&function(e){if("object"==typeof e&&!x(e)){for(var t=Object.keys(e),n=0;n<t.length;++n)if(H.isDynamic(e[t[n]]))return!0;return!1}}(r)){var i=e.global,o=Object.keys(r),a=!1,f=!1,u=!1,s=e.global.def("{}");o.forEach(function(t){var n=r[t];if(H.isDynamic(n))"function"==typeof n&&(n=r[t]=H.unbox(n)),t=M(n,null),a=a||t.thisDep,u=u||t.propDep,f=f||t.contextDep;else{switch(i(s,".",t,"="),typeof n){case"number":i(n);break;case"string":i('"',n,'"');break;case"object":Array.isArray(n)&&i("[",n.join(),"]");break;default:i(e.link(n))}i(";")}}),t.dynamic[n]=new H.DynamicVariable(4,{thisDep:a,contextDep:f,propDep:u,ref:s,append:function(e,t){o.forEach(function(n){var i=r[n];H.isDynamic(i)&&(i=e.invoke(t,i),t(s,".",n,"=",i,";"))})}}),delete t.static[n]}}var Y=c.Record,$={add:32774,subtract:32778,"reverse subtract":32779};n.ext_blend_minmax&&($.min=32775,$.max=32776);var J=n.angle_instanced_arrays,Z=n.webgl_draw_buffers,ee={dirty:!0,profile:m.profile},te={},re=[],ie={},oe={};g("dither",3024),g("blend.enable",3042),v("blend.color","blendColor",[0,0,0,0]),v("blend.equation","blendEquationSeparate",[32774,32774]),v("blend.func","blendFuncSeparate",[1,0,1,0]),g("depth.enable",2929,!0),v("depth.func","depthFunc",513),v("depth.range","depthRange",[0,1]),v("depth.mask","depthMask",!0),v("colorMask","colorMask",[!0,!0,!0,!0]),g("cull.enable",2884),v("cull.face","cullFace",1029),v("frontFace","frontFace",2305),v("lineWidth","lineWidth",1),g("polygonOffset.enable",32823),v("polygonOffset.offset","polygonOffset",[0,0]),g("sample.alpha",32926),g("sample.enable",32928),v("sample.coverage","sampleCoverage",[1,!1]),g("stencil.enable",2960),v("stencil.mask","stencilMask",-1),v("stencil.func","stencilFunc",[519,0,-1]),v("stencil.opFront","stencilOpSeparate",[1028,7680,7680,7680]),v("stencil.opBack","stencilOpSeparate",[1029,7680,7680,7680]),g("scissor.enable",3089),v("scissor.box","scissor",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]),v("viewport","viewport",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]);var ae={gl:e,context:h,strings:t,next:te,current:ee,draw:p,elements:a,buffer:i,shader:l,attributes:c.state,uniforms:s,framebuffer:u,extensions:n,timer:d,isBufferArgs:F},fe={primTypes:ne,compareFuncs:ke,blendFuncs:we,blendEquations:$,stencilOps:Ae,glTypes:K,orientationType:Ee};Z&&(fe.backBuffer=[1029],fe.drawBuffer=o(r.maxDrawbuffers,function(e){return 0===e?[0]:o(e,function(e){return 36064+e})}));var ue=0;return{next:te,current:ee,procs:function(){var e=y(),t=e.proc("poll"),n=e.proc("refresh"),i=e.block();t(i),n(i);var a,f=e.shared,u=f.gl,s=f.next,c=f.current;i(c,".dirty=false;"),C(e,t),C(e,n,null,!0),J&&(a=e.link(J));for(var l=0;l<r.maxAttributes;++l){var p=n.def(f.attributes,"[",l,"]"),h=e.cond(p,".buffer");h.then(u,".enableVertexAttribArray(",l,");",u,".bindBuffer(",34962,",",p,".buffer.buffer);",u,".vertexAttribPointer(",l,",",p,".size,",p,".type,",p,".normalized,",p,".stride,",p,".offset);").else(u,".disableVertexAttribArray(",l,");",u,".vertexAttrib4f(",l,",",p,".x,",p,".y,",p,".z,",p,".w);",p,".buffer=null;"),n(h),J&&n(a,".vertexAttribDivisorANGLE(",l,",",p,".divisor);")}return Object.keys(ie).forEach(function(r){var o=ie[r],a=i.def(s,".",r),f=e.block();f("if(",a,"){",u,".enable(",o,")}else{",u,".disable(",o,")}",c,".",r,"=",a,";"),n(f),t("if(",a,"!==",c,".",r,"){",f,"}")}),Object.keys(oe).forEach(function(r){var a,f,l=oe[r],p=ee[r],h=e.block();h(u,".",l,"("),x(p)?(l=p.length,a=e.global.def(s,".",r),f=e.global.def(c,".",r),h(o(l,function(e){return a+"["+e+"]"}),");",o(l,function(e){return f+"["+e+"]="+a+"["+e+"];"}).join("")),t("if(",o(l,function(e){return a+"["+e+"]!=="+f+"["+e+"]"}).join("||"),"){",h,"}")):(a=i.def(s,".",r),f=i.def(c,".",r),h(a,");",c,".",r,"=",a,";"),t("if(",a,"!==",f,"){",h,"}")),n(h)}),e.compile()}(),compile:function(e,t,n,r,i){var o=y();return o.stats=o.link(i),Object.keys(t.static).forEach(function(e){G(o,t,e)}),_e.forEach(function(t){G(o,e,t)}),n=E(e,t,n,r),function(e,t){var n=e.proc("draw",1);j(e,n),T(e,n,t.context),C(e,n,t.framebuffer),S(e,n,t),D(e,n,t.state),I(e,n,t,!1,!0);var r=t.shader.progVar.append(e,n);if(n(e.shared.gl,".useProgram(",r,".program);"),t.shader.program)V(e,n,t,t.shader.program);else{var i=e.global.def("{}"),o=n.def(r,".id"),a=n.def(i,"[",o,"]");n(e.cond(a).then(a,".call(this,a0);").else(a,"=",i,"[",o,"]=",e.link(function(n){return W(V,e,t,n,1)}),"(",r,");",a,".call(this,a0);"))}0<Object.keys(t.state).length&&n(e.shared.current,".dirty=true;")}(o,n),Q(o,n),function(e,t){function n(e){return e.contextDep&&i||e.propDep}var r=e.proc("batch",2);e.batchId="0",j(e,r);var i=!1,o=!0;Object.keys(t.context).forEach(function(e){i=i||t.context[e].propDep}),i||(T(e,r,t.context),o=!1);var a=!1;if((f=t.framebuffer)?(f.propDep?i=a=!0:f.contextDep&&i&&(a=!0),a||C(e,r,f)):C(e,r,null),t.state.viewport&&t.state.viewport.propDep&&(i=!0),S(e,r,t),D(e,r,t.state,function(e){return!n(e)}),t.profile&&n(t.profile)||I(e,r,t,!1,"a1"),t.contextDep=i,t.needsContext=o,t.needsFramebuffer=a,(o=t.shader.progVar).contextDep&&i||o.propDep)X(e,r,t,null);else if(o=o.append(e,r),r(e.shared.gl,".useProgram(",o,".program);"),t.shader.program)X(e,r,t,t.shader.program);else{var f=e.global.def("{}"),u=(a=r.def(o,".id"),r.def(f,"[",a,"]"));r(e.cond(u).then(u,".call(this,a0,a1);").else(u,"=",f,"[",a,"]=",e.link(function(n){return W(X,e,t,n,2)}),"(",o,");",u,".call(this,a0,a1);"))}0<Object.keys(t.state).length&&r(e.shared.current,".dirty=true;")}(o,n),o.compile()}}}function N(e,t){for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}var U=function(e,t){for(var n=Object.keys(t),r=0;r<n.length;++r)e[n[r]]=t[n[r]];return e},R=0,H={DynamicVariable:e,define:function(n,r){return new e(n,t(r+""))},isDynamic:function(t){return"function"==typeof t&&!t._reglType||t instanceof e},unbox:function(t,n){return"function"==typeof t?new e(0,t):t},accessor:t},W={next:"function"==typeof requestAnimationFrame?function(e){return requestAnimationFrame(e)}:function(e){return setTimeout(e,16)},cancel:"function"==typeof cancelAnimationFrame?function(e){return cancelAnimationFrame(e)}:clearTimeout},V="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date},q=f();q.zero=f();var X=function(e,t){var n=1;t.ext_texture_filter_anisotropic&&(n=e.getParameter(34047));var r=1,i=1;t.webgl_draw_buffers&&(r=e.getParameter(34852),i=e.getParameter(36063));var o=!!t.oes_texture_float;if(o){o=e.createTexture(),e.bindTexture(3553,o),e.texImage2D(3553,0,6408,1,1,0,6408,5126,null);var a=e.createFramebuffer();if(e.bindFramebuffer(36160,a),e.framebufferTexture2D(36160,36064,3553,o,0),e.bindTexture(3553,null),36053!==e.checkFramebufferStatus(36160))o=!1;else{e.viewport(0,0,1,1),e.clearColor(1,0,0,1),e.clear(16384);var f=q.allocType(5126,4);e.readPixels(0,0,1,1,6408,5126,f),e.getError()?o=!1:(e.deleteFramebuffer(a),e.deleteTexture(o),o=1===f[0]),q.freeType(f)}}return f=!0,f=e.createTexture(),a=q.allocType(5121,36),e.activeTexture(33984),e.bindTexture(34067,f),e.texImage2D(34069,0,6408,3,3,0,6408,5121,a),q.freeType(a),e.bindTexture(34067,null),e.deleteTexture(f),f=!e.getError(),{colorBits:[e.getParameter(3410),e.getParameter(3411),e.getParameter(3412),e.getParameter(3413)],depthBits:e.getParameter(3414),stencilBits:e.getParameter(3415),subpixelBits:e.getParameter(3408),extensions:Object.keys(t).filter(function(e){return!!t[e]}),maxAnisotropic:n,maxDrawbuffers:r,maxColorAttachments:i,pointSizeDims:e.getParameter(33901),lineWidthDims:e.getParameter(33902),maxViewportDims:e.getParameter(3386),maxCombinedTextureUnits:e.getParameter(35661),maxCubeMapSize:e.getParameter(34076),maxRenderbufferSize:e.getParameter(34024),maxTextureUnits:e.getParameter(34930),maxTextureSize:e.getParameter(3379),maxAttributes:e.getParameter(34921),maxVertexUniforms:e.getParameter(36347),maxVertexTextureUnits:e.getParameter(35660),maxVaryingVectors:e.getParameter(36348),maxFragmentUniforms:e.getParameter(36349),glsl:e.getParameter(35724),renderer:e.getParameter(7937),vendor:e.getParameter(7936),version:e.getParameter(7938),readFloat:o,npotTextureCube:f}},Q=function(e){return e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof Float64Array||e instanceof Uint8ClampedArray},G=function(e){return Object.keys(e).map(function(t){return e[t]})},Y={shape:function(e){for(var t=[];e.length;e=e[0])t.push(e.length);return t},flatten:function(e,t,n,r){var i=1;if(t.length)for(var o=0;o<t.length;++o)i*=t[o];else i=0;switch(n=r||q.allocType(n,i),t.length){case 0:break;case 1:for(r=t[0],t=0;t<r;++t)n[t]=e[t];break;case 2:for(r=t[0],t=t[1],o=i=0;o<r;++o)for(var a=e[o],f=0;f<t;++f)n[i++]=a[f];break;case 3:s(e,t[0],t[1],t[2],n,0);break;default:!function e(t,n,r,i,o){for(var a=1,f=r+1;f<n.length;++f)a*=n[f];var u=n[r];if(4==n.length-r){var c=n[r+1],l=n[r+2];for(n=n[r+3],f=0;f<u;++f)s(t[f],c,l,n,i,o),o+=a}else for(f=0;f<u;++f)e(t[f],n,r+1,i,o),o+=a}(e,t,0,n,0)}return n}},$={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},K={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},J={dynamic:35048,stream:35040,static:35044},Z=Y.flatten,ee=Y.shape,te=[];te[5120]=1,te[5122]=2,te[5124]=4,te[5121]=1,te[5123]=2,te[5125]=4,te[5126]=4;var ne={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},re=new Float32Array(1),ie=new Uint32Array(re.buffer),oe=[9984,9986,9985,9987],ae=[0,6409,6410,6407,6408],fe={};fe[6409]=fe[6406]=fe[6402]=1,fe[34041]=fe[6410]=2,fe[6407]=fe[35904]=3,fe[6408]=fe[35906]=4;var ue=b("HTMLCanvasElement"),se=b("CanvasRenderingContext2D"),ce=b("ImageBitmap"),le=b("HTMLImageElement"),pe=b("HTMLVideoElement"),he=Object.keys($).concat([ue,se,ce,le,pe]),de=[];de[5121]=1,de[5126]=4,de[36193]=2,de[5123]=2,de[5125]=4;var me=[];me[32854]=2,me[32855]=2,me[36194]=2,me[34041]=4,me[33776]=.5,me[33777]=.5,me[33778]=1,me[33779]=1,me[35986]=.5,me[35987]=1,me[34798]=1,me[35840]=.5,me[35841]=.25,me[35842]=.5,me[35843]=.25,me[36196]=.5;var xe=[];xe[32854]=2,xe[32855]=2,xe[36194]=2,xe[33189]=2,xe[36168]=1,xe[34041]=4,xe[35907]=4,xe[34836]=16,xe[34842]=8,xe[34843]=6;var be=function(e,t,n,r,i){function o(e){this.id=s++,this.refCount=1,this.renderbuffer=e,this.format=32854,this.height=this.width=0,i.profile&&(this.stats={size:0})}function a(t){var n=t.renderbuffer;e.bindRenderbuffer(36161,null),e.deleteRenderbuffer(n),t.renderbuffer=null,t.refCount=0,delete c[t.id],r.renderbufferCount--}var f={rgba4:32854,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};t.ext_srgb&&(f.srgba=35907),t.ext_color_buffer_half_float&&(f.rgba16f=34842,f.rgb16f=34843),t.webgl_color_buffer_float&&(f.rgba32f=34836);var u=[];Object.keys(f).forEach(function(e){u[f[e]]=e});var s=0,c={};return o.prototype.decRef=function(){0>=--this.refCount&&a(this)},i.profile&&(r.getTotalRenderbufferSize=function(){var e=0;return Object.keys(c).forEach(function(t){e+=c[t].stats.size}),e}),{create:function(t,n){function a(t,n){var r=0,o=0,c=32854;if("object"==typeof t&&t?("shape"in t?(r=0|(o=t.shape)[0],o=0|o[1]):("radius"in t&&(r=o=0|t.radius),"width"in t&&(r=0|t.width),"height"in t&&(o=0|t.height)),"format"in t&&(c=f[t.format])):"number"==typeof t?(r=0|t,o="number"==typeof n?0|n:r):t||(r=o=1),r!==s.width||o!==s.height||c!==s.format)return a.width=s.width=r,a.height=s.height=o,s.format=c,e.bindRenderbuffer(36161,s.renderbuffer),e.renderbufferStorage(36161,c,r,o),i.profile&&(s.stats.size=xe[s.format]*s.width*s.height),a.format=u[s.format],a}var s=new o(e.createRenderbuffer());return c[s.id]=s,r.renderbufferCount++,a(t,n),a.resize=function(t,n){var r=0|t,o=0|n||r;return r===s.width&&o===s.height?a:(a.width=s.width=r,a.height=s.height=o,e.bindRenderbuffer(36161,s.renderbuffer),e.renderbufferStorage(36161,s.format,r,o),i.profile&&(s.stats.size=xe[s.format]*s.width*s.height),a)},a._reglType="renderbuffer",a._renderbuffer=s,i.profile&&(a.stats=s.stats),a.destroy=function(){s.decRef()},a},clear:function(){G(c).forEach(a)},restore:function(){G(c).forEach(function(t){t.renderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,t.renderbuffer),e.renderbufferStorage(36161,t.format,t.width,t.height)}),e.bindRenderbuffer(36161,null)}}},ge=[];ge[6408]=4,ge[6407]=3;var ve=[];ve[5121]=1,ve[5126]=4,ve[36193]=2;var ye=["x","y","z","w"],_e="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),we={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},ke={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Ae={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ee={cw:2304,ccw:2305},Te=new P(!1,!1,!1,function(){});return function(e){function t(){if(0===Y.length)w&&w.update(),Z=null;else{Z=W.next(t),l();for(var e=Y.length-1;0<=e;--e){var n=Y[e];n&&n(O,null,0)}x.flush(),w&&w.update()}}function n(){!Z&&0<Y.length&&(Z=W.next(t))}function r(){Z&&(W.cancel(t),Z=null)}function o(e){e.preventDefault(),r(),$.forEach(function(e){e()})}function a(e){x.getError(),g.restore(),z.restore(),L.restore(),B.restore(),M.restore(),R.restore(),w&&w.restore(),q.procs.refresh(),n(),K.forEach(function(e){e()})}function f(e){function t(e){var t={},n={};return Object.keys(e).forEach(function(r){var i=e[r];H.isDynamic(i)?n[r]=H.unbox(i,r):t[r]=i}),{dynamic:n,static:t}}var n=t(e.context||{}),r=t(e.uniforms||{}),i=t(e.attributes||{}),o=t(function(e){function t(e){if(e in n){var t=n[e];delete n[e],Object.keys(t).forEach(function(r){n[e+"."+r]=t[r]})}}var n=U({},e);return delete n.uniforms,delete n.attributes,delete n.context,"stencil"in n&&n.stencil.op&&(n.stencil.opBack=n.stencil.opFront=n.stencil.op,delete n.stencil.op),t("blend"),t("depth"),t("cull"),t("stencil"),t("polygonOffset"),t("scissor"),t("sample"),n}(e));e={gpuTime:0,cpuTime:0,count:0};var a=(n=q.compile(o,i,r,n,e)).draw,f=n.batch,u=n.scope,s=[];return U(function(e,t){var n;if("function"==typeof e)return u.call(this,null,e,0);if("function"==typeof t)if("number"==typeof e)for(n=0;n<e;++n)u.call(this,null,t,n);else{if(!Array.isArray(e))return u.call(this,e,t,0);for(n=0;n<e.length;++n)u.call(this,e[n],t,n)}else if("number"==typeof e){if(0<e)return f.call(this,function(e){for(;s.length<e;)s.push(null);return s}(0|e),0|e)}else{if(!Array.isArray(e))return a.call(this,e);if(e.length)return f.call(this,e,e.length)}},{stats:e})}function u(e,t){var n=0;q.procs.poll();var r=t.color;r&&(x.clearColor(+r[0]||0,+r[1]||0,+r[2]||0,+r[3]||0),n|=16384),"depth"in t&&(x.clearDepth(+t.depth),n|=256),"stencil"in t&&(x.clearStencil(0|t.stencil),n|=1024),x.clear(n)}function s(e){return Y.push(e),n(),{cancel:function(){var t=N(Y,e);Y[t]=function e(){var t=N(Y,e);Y[t]=Y[Y.length-1],--Y.length,0>=Y.length&&r()}}}}function c(){var e=Q.viewport,t=Q.scissor_box;e[0]=e[1]=t[0]=t[1]=0,O.viewportWidth=O.framebufferWidth=O.drawingBufferWidth=e[2]=t[2]=x.drawingBufferWidth,O.viewportHeight=O.framebufferHeight=O.drawingBufferHeight=e[3]=t[3]=x.drawingBufferHeight}function l(){O.tick+=1,O.time=m(),c(),q.procs.poll()}function p(){c(),q.procs.refresh(),w&&w.update()}function m(){return(V()-k)/1e3}if(!(e=i(e)))return null;var x=e.gl,b=x.getContextAttributes();x.isContextLost();var g=function(e,t){function n(t){var n;t=t.toLowerCase();try{n=r[t]=e.getExtension(t)}catch(e){}return!!n}for(var r={},i=0;i<t.extensions.length;++i){var o=t.extensions[i];if(!n(o))return t.onDestroy(),t.onDone('"'+o+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return t.optionalExtensions.forEach(n),{extensions:r,restore:function(){Object.keys(r).forEach(function(e){if(!n(e))throw Error("(regl): error restoring extension "+e)})}}}(x,e);if(!g)return null;var v=function(){var e={"":0},t=[""];return{id:function(n){var r=e[n];return r||(r=e[n]=t.length,t.push(n),r)},str:function(e){return t[e]}}}(),y={bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},_=g.extensions,w=function(e,t){function n(e,t,n){var r=a.pop()||new function(){this.endQueryIndex=this.startQueryIndex=-1,this.sum=0,this.stats=null};r.startQueryIndex=e,r.endQueryIndex=t,r.sum=0,r.stats=n,f.push(r)}var r=t.ext_disjoint_timer_query;if(!r)return null;var i=[],o=[],a=[],f=[],u=[],s=[];return{beginQuery:function(e){var t=i.pop()||r.createQueryEXT();r.beginQueryEXT(35007,t),o.push(t),n(o.length-1,o.length,e)},endQuery:function(){r.endQueryEXT(35007)},pushScopeStats:n,update:function(){var e,t;if(0!==(e=o.length)){s.length=Math.max(s.length,e+1),u.length=Math.max(u.length,e+1),u[0]=0;var n=s[0]=0;for(t=e=0;t<o.length;++t){var c=o[t];r.getQueryObjectEXT(c,34919)?(n+=r.getQueryObjectEXT(c,34918),i.push(c)):o[e++]=c,u[t+1]=n,s[t+1]=e}for(o.length=e,t=e=0;t<f.length;++t){var l=(n=f[t]).startQueryIndex;c=n.endQueryIndex,n.sum+=u[c]-u[l],l=s[l],(c=s[c])===l?(n.stats.gpuTime+=n.sum/1e6,a.push(n)):(n.startQueryIndex=l,n.endQueryIndex=c,f[e++]=n)}f.length=e}},getNumPendingQueries:function(){return o.length},clear:function(){i.push.apply(i,o);for(var e=0;e<i.length;e++)r.deleteQueryEXT(i[e]);o.length=0,i.length=0},restore:function(){o.length=0,i.length=0}}}(0,_),k=V(),D=x.drawingBufferWidth,j=x.drawingBufferHeight,O={tick:0,time:0,viewportWidth:D,viewportHeight:j,framebufferWidth:D,framebufferHeight:j,drawingBufferWidth:D,drawingBufferHeight:j,pixelRatio:e.pixelRatio},F=X(x,_),L=(D=function(e,t,n,r){for(e=n.maxAttributes,t=Array(e),n=0;n<e;++n)t[n]=new T;return{Record:T,scope:{},state:t}}(x,_,F),h(x,y,e,D)),P=d(x,_,L,y),z=C(x,v,y,e),B=A(x,_,F,function(){q.procs.poll()},O,y,e),M=be(x,_,0,y,e),R=E(x,_,F,B,M,y),q=I(x,v,_,F,L,P,0,R,{},D,z,{elements:null,primitive:4,count:-1,offset:0,instances:-1},O,w,e),Q=(v=S(x,R,q.procs.poll,O),q.next),G=x.canvas,Y=[],$=[],K=[],J=[e.onDestroy],Z=null;G&&(G.addEventListener("webglcontextlost",o,!1),G.addEventListener("webglcontextrestored",a,!1));var ee=R.setFBO=f({framebuffer:H.define.call(null,1,"framebuffer")});return p(),b=U(f,{clear:function(e){if("framebuffer"in e)if(e.framebuffer&&"framebufferCube"===e.framebuffer_reglType)for(var t=0;6>t;++t)ee(U({framebuffer:e.framebuffer.faces[t]},e),u);else ee(e,u);else u(0,e)},prop:H.define.bind(null,1),context:H.define.bind(null,2),this:H.define.bind(null,3),draw:f({}),buffer:function(e){return L.create(e,34962,!1,!1)},elements:function(e){return P.create(e,!1)},texture:B.create2D,cube:B.createCube,renderbuffer:M.create,framebuffer:R.create,framebufferCube:R.createCube,attributes:b,frame:s,on:function(e,t){var n;switch(e){case"frame":return s(t);case"lost":n=$;break;case"restore":n=K;break;case"destroy":n=J}return n.push(t),{cancel:function(){for(var e=0;e<n.length;++e)if(n[e]===t){n[e]=n[n.length-1],n.pop();break}}}},limits:F,hasExtension:function(e){return 0<=F.extensions.indexOf(e.toLowerCase())},read:v,destroy:function(){Y.length=0,r(),G&&(G.removeEventListener("webglcontextlost",o),G.removeEventListener("webglcontextrestored",a)),z.clear(),R.clear(),M.clear(),B.clear(),P.clear(),L.clear(),w&&w.clear(),J.forEach(function(e){e()})},_gl:x,_refresh:p,poll:function(){l(),w&&w.update()},now:m,stats:y}),e.onDone(null,b),b}},"object"==typeof n&&void 0!==t?t.exports=i():"function"==typeof define&&define.amd?define(i):r.createREGL=i()},{}],26:[function(e,t,n){var r=e("preact"),i=e("preact-classless-component"),o=e("insert-css");t.exports=function(e,t){var n=r.h,a=r.render,f=i({render:function(){var e=this.props.field;return n("fieldset",{className:"section"},[n("legend",null,e.name),Object.keys(e.value).map(function(t){return n(h,{field:e.value.$path[t].$field})})])}}),u=i({render:function(){var e=this,t=this.props.field;return n("div",{className:"control"},[n("label",{htmlFor:t.path},t.name),n("select",{name:t.path,id:t.path,onChange:function(t){return e.props.field.value=t.target.value}},t.options.map(function(e){return n("option",{value:e,selected:e===t.value},e)}))])}}),s=i({render:function(){var e=this,t=this.props.field;return n("div",{className:"control"},[n("label",{htmlFor:t.path},t.name),n("input",{id:t.path,type:"text",value:t.value,onInput:function(t){return e.props.field.value=t.target.value}})])}}),c=i({render:function(){var e=this,t=this.props.field;return n("div",{className:"control"},[n("label",{htmlFor:t.path},t.name),n("input",{id:t.path,type:"checkbox",checked:t.value,onInput:function(t){return e.props.field.value=t.target.checked}})])}}),l=i({render:function(){var e=this,t=this.props.field;return n("div",{className:"control"},[n("label",{htmlFor:t.path},t.name),n("div",{className:"control-container"},[n("input",{id:t.path,type:"range",min:t.min,max:t.max,step:t.step,value:t.value,onInput:function(t){return e.props.field.value=parseFloat(t.target.value)}}),n("span",{className:"control-value"},t.value.toFixed(4).replace(/\.?0*$/,""))])])}}),p=i({getInitialState:function(){return{expanded:!0}},toggle:function(){this.setState({expanded:!this.state.expanded})},render:function(){return this.state.expanded?n("div",{className:"container"},[n("button",{className:"control-heading",onClick:this.toggle},"Controls ▼"),this.props.children]):n("div",{className:"container"},n("button",{className:"control-heading",onClick:this.toggle},"Controls ▲"))}}),h=i({render:function(){switch(this.props.field.type){case"checkbox":return n(c,{field:this.props.field});case"textinput":return n(s,{field:this.props.field});case"slider":return n(l,{field:this.props.field});case"select":return n(u,{field:this.props.field});case"section":return n(f,{field:this.props.field});default:throw new Error('Unknown field type, "'+this.props.field.type+'"')}}}),d=i({getRef:function(e){e&&this.props.content&&(this.c=e,e.appendChild(this.props.content))},componentWillUnmount:function(){this.c&&this.c.removeChild(this.props.content)},render:function(){return n("div",{ref:this.getRef})}}),m=i({componentDidMount:function(){var e=this;this.props.state.$field.onChanges(function(t){e.setState({foo:Math.random()})})},getRef:function(e){for(var t=["mousedown","mouseup","mousemove","touchstart","touchmove","touchend","wheel"],n=0;n<t.length;n++)e.addEventListener(t[n],function(e){e.stopPropagation()})},render:function(){var e=this,t=Object.keys(this.props.state).map(function(t){return n(h,{field:e.props.state.$path[t].$field})});return this.props.extras&&t.push(n(d,{content:this.props.extras})),n("div",{className:"control-panel",ref:this.getRef},n(p,null,n("div",{className:"controls"},t)))}});return o('\n .control-panel {\n background-color: rgba(50, 50, 50, 0.8);\n font-family: sans-serif;\n font-size: 13px;\n font-weight: 200;\n color: white;\n max-width: 350px;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 10;\n }\n\n .control-panel a {\n color: #cde;\n }\n\n .control-panel .control-heading {\n background: transparent;\n border: none;\n border-radius: 0;\n outline: none;\n display: block;\n background-color: black;\n color: white;\n width: 100%;\n text-align: left;\n padding: 8px;\n cursor: pointer;\n font-weight: 700;\n font-style: italic;\n }\n .control-panel .control-heading:hover {\n background-color: rgba(30, 30, 30, 0.4);\n }\n\n .control-panel .controls {\n padding: 8px;\n width: 270px;\n }\n\n .control-panel p {\n line-height: 1.8;\n }\n\n .control-panel .control:not(:last-child) {\n margin-bottom: 10px;\n }\n\n .control-panel label {\n display: inline-block;\n width: 25%;\n line-height: 25px;\n }\n\n .control input[type="range"] {\n width: 100%;\n }\n\n .control-panel input,\n .control-panel select {\n margin: .4rem;\n }\n\n .control-panel legend {\n background-color: #000;\n color: #fff;\n padding: 3px 6px;\n }\n\n .control-panel fieldset:not(:last-child) {\n margin-bottom: 1.0rem;\n }\n\n .control-panel .control {\n display: flex;\n flex-direction: row;\n }\n\n .control-panel .control-container {\n flex: 1;\n position: relative;\n height: 22px;\n }\n\n .control-panel .control-container {\n display: inline-block;\n }\n\n .control-panel .control-value {\n position: absolute;\n pointer-events: none;\n top: 0;\n z-index: 1;\n line-height: 22px;\n right: 10px;\n }\n\n\t\t.control-panel input[type=range] {\n\t\t\t-webkit-appearance: none;\n\t\t\twidth: 100%;\n\t\t\tmargin: 0px 0;\n\t\t}\n\n\t\t.control-panel input[type=range]:focus {\n\t\t\toutline: none;\n\t\t}\n\n\t\t.control-panel input[type=range]::-webkit-slider-runnable-track {\n\t\t\twidth: 100%;\n\t\t\theight: 22px;\n\t\t\tcursor: ew-resize;\n\t\t\tbackground: #181818;\n\t\t}\n\n\t\t.control-panel input[type=range]::-webkit-slider-thumb {\n\t\t\theight: 22px;\n\t\t\twidth: 22px;\n\t\t\tbackground: #666;\n\t\t\tcursor: ew-resize;\n\t\t\t-webkit-appearance: none;\n\t\t\tmargin-top: 0px;\n\t\t}\n\n\t\t.control-panel input[type=range]:focus::-webkit-slider-runnable-track {\n\t\t\tbackground: #181818;\n\t\t\toutline: none;\n\t\t}\n\n\t\t.control-panel input[type=range]::-moz-range-track {\n\t\t\twidth: 100%;\n\t\t\theight: 22px;\n\t\t\tcursor: ew-resize;\n\t\t\tbackground: #181818;\n\t\t}\n\n\t\t.control-panel input[type=range]::-moz-range-thumb {\n\t\t\theight: 22px;\n\t\t\twidth: 10px;\n\t\t\tbackground: #666;\n\t\t\tcursor: ew-resize;\n\t\t}\n\n\t\t.control-panel input[type=range]::-ms-track {\n\t\t\twidth: 100%;\n\t\t\theight: 22px;\n\t\t\tcursor: ew-resize;\n\t\t\tbackground: transparent;\n\t\t\tborder-color: transparent;\n\t\t\tcolor: transparent;\n\t\t}\n\n\t\t.control-panel input[type=range]::-ms-fill-lower {\n\t\t\tbackground: #181818;\n\t\t}\n\n\t\t.control-panel input[type=range]::-ms-fill-upper {\n\t\t\tbackground: #181818;\n\t\t}\n\n\t\t.control-panel input[type=range]::-ms-thumb {\n\t\t\twidth: 10px;\n\t\t\tborder-radius: 0px;\n\t\t\tbackground: #666;\n\t\t\tcursor: ew-resize;\n\t\t\theight: 22px;\n\t\t}\n\n\t\t.control-panel input[type=range]:focus::-ms-fill-lower {\n\t\t\tbackground: #181818;\n\t\t\toutline: none;\n\t\t}\n\n\t\t.control-panel input[type=range]:focus::-ms-fill-upper {\n\t\t\tbackground: #181818;\n\t\t\toutline: none;\n\t\t}\n\n\t\t.control-panel input[type=range] {\n\t\t\t-webkit-appearance: none;\n\t\t\twidth: 100%;\n\t\t\tmargin: 0px 0;\n\t\t}\n\n\t\t.control-panel input[type=range]:focus {\n\t\t\toutline: none;\n\t\t}\n\n\t\t.control-panel input[type=range]::-webkit-slider-runnable-track {\n\t\t\twidth: 100%;\n\t\t\theight: 22px;\n\t\t\tcursor: ew-resize;\n\t\t\tbackground: #181818;\n\t\t}\n '),a(n(m,{state:e,extras:t}),document.body),e}},{"insert-css":28,preact:31,"preact-classless-component":30}],27:[function(e,t,n){"use strict";var r=e("./src/section"),i=e("./src/checkbox"),o=e("./src/slider"),a=e("./src/rangeslider"),f=e("./src/textinput"),u=e("./src/color"),s=e("./src/select");function c(e,t){return new r("",e,t).value}c.Slider=function(e,t){return new o(null,e,t)},c.Rangeslider=function(e,t){return new a(null,e,t)},c.Textinput=function(e,t){return new f(null,e,t)},c.Select=function(e,t){return new s(null,e,t)},c.Checkbox=function(e,t){return new i(null,e,t)},c.Color=function(e,t){return new u(null,e,t)},c.Section=function(e,t){return new r(null,e,t)},t.exports=c},{"./src/checkbox":33,"./src/color":34,"./src/rangeslider":36,"./src/section":37,"./src/select":38,"./src/slider":39,"./src/textinput":40}],28:[function(e,t,n){arguments[4][21][0].apply(n,arguments)},{dup:21}],29:[function(e,t,n){(function(e){(function(){var n,r,i,o,a,f;"undefined"!=typeof performance&&null!==performance&&performance.now?t.exports=function(){return performance.now()}:void 0!==e&&null!==e&&e.hrtime?(t.exports=function(){return(n()-a)/1e6},r=e.hrtime,o=(n=function(){var e;return 1e9*(e=r())[0]+e[1]})(),f=1e9*e.uptime(),a=o-f):Date.now?(t.exports=function(){return Date.now()-i},i=Date.now()):(t.exports=function(){return(new Date).getTime()-i},i=(new Date).getTime())}).call(this)}).call(this,e("_process"))},{_process:24}],30:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};n.default=function(e){function t(){for(var t in i.Component.apply(this,arguments),e)"render"!==t&&"function"==typeof e[t]&&(this[t]=e[t].bind(this));e.init&&e.init.call(this)}return t.prototype=r(Object.create(i.Component.prototype),e),t.prototype.constructor=t,t};var i=e("preact");t.exports=n.default},{preact:31}],31:[function(e,t,n){!function(){"use strict";function e(e,t){var n,r,i,o,a=A;for(o=arguments.length;o-- >2;)k.push(arguments[o]);for(t&&null!=t.children&&(k.length||k.push(t.children),delete t.children);k.length;)if((r=k.pop())&&void 0!==r.pop)for(o=r.length;o--;)k.push(r[o]);else"boolean"==typeof r&&(r=null),(i="function"!=typeof e)&&(null==r?r="":"number"==typeof r?r=String(r):"string"!=typeof r&&(i=!1)),i&&n?a[a.length-1]+=r:a===A?a=[r]:a.push(r),n=i;var f=new _;return f.nodeName=e,f.children=a,f.attributes=null==t?void 0:t,f.key=null==t?void 0:t.key,void 0!==w.vnode&&w.vnode(f),f}function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==C.push(e)&&(w.debounceRendering||E)(i)}function i(){var e,t=C;for(C=[];e=t.pop();)e.__d&&g(e)}function o(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=n({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var i in r)void 0===t[i]&&(t[i]=r[i]);return t}function f(e){var t=e.parentNode;t&&t.removeChild(e)}function u(e,t,n,r,i){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||i)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var o in n)o in r||(e.style[o]="");for(var o in r)e.style[o]="number"==typeof r[o]&&!1===T.test(o)?r[o]+"px":r[o]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,s,a):e.removeEventListener(t,s,a),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!i&&t in e){try{e[t]=null==r?"":r}catch(e){}null!=r&&!1!==r||"spellcheck"==t||e.removeAttribute(t)}else{var f=i&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?f?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(f?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function s(e){return this.__l[e.type](w.event&&w.event(e)||e)}function c(){for(var e;e=S.pop();)w.afterMount&&w.afterMount(e),e.componentDidMount&&e.componentDidMount()}function l(e,t,n,r,i,o){D++||(j=null!=i&&void 0!==i.ownerSVGElement,O=null!=e&&!("__preactattr_"in e));var a=p(e,t,n,r,o);return i&&a.parentNode!==i&&i.appendChild(a),--D||(O=!1,o||c()),a}function p(e,t,n,r,i){var s=e,c=j;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||i)?e.nodeValue!=t&&(e.nodeValue=t):(s=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(s,e),h(e,!0))),s.__preactattr_=!0,s;var l,d,x=t.nodeName;if("function"==typeof x)return function(e,t,n,r){var i=e&&e._component,o=i,f=e,u=i&&e._componentConstructor===t.nodeName,s=u,c=a(t);for(;i&&!s&&(i=i.__u);)s=i.constructor===t.nodeName;i&&s&&(!r||i._component)?(b(i,c,3,n,r),e=i.base):(o&&!u&&(v(o),e=f=null),i=m(t.nodeName,c,n),e&&!i.__b&&(i.__b=e,f=null),b(i,c,1,n,r),e=i.base,f&&e!==f&&(f._component=null,h(f,!1)));return e}(e,t,n,r);if(j="svg"===x||"foreignObject"!==x&&j,x=String(x),(!e||!o(e,x))&&(l=x,(d=j?document.createElementNS("http://www.w3.org/2000/svg",l):document.createElement(l)).__n=l,s=d,e)){for(;e.firstChild;)s.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(s,e),h(e,!0)}var g=s.firstChild,y=s.__preactattr_,_=t.children;if(null==y){y=s.__preactattr_={};for(var w=s.attributes,k=w.length;k--;)y[w[k].name]=w[k].value}return!O&&_&&1===_.length&&"string"==typeof _[0]&&null!=g&&void 0!==g.splitText&&null==g.nextSibling?g.nodeValue!=_[0]&&(g.nodeValue=_[0]):(_&&_.length||null!=g)&&function(e,t,n,r,i){var a,u,s,c,l,d=e.childNodes,m=[],x={},b=0,g=0,v=d.length,y=0,_=t?t.length:0;if(0!==v)for(var w=0;w<v;w++){var k=d[w],A=k.__preactattr_,E=_&&A?k._component?k._component.__k:A.key:null;null!=E?(b++,x[E]=k):(A||(void 0!==k.splitText?!i||k.nodeValue.trim():i))&&(m[y++]=k)}if(0!==_)for(var w=0;w<_;w++){c=t[w],l=null;var E=c.key;if(null!=E)b&&void 0!==x[E]&&(l=x[E],x[E]=void 0,b--);else if(g<y)for(a=g;a<y;a++)if(void 0!==m[a]&&(T=u=m[a],S=i,"string"==typeof(C=c)||"number"==typeof C?void 0!==T.splitText:"string"==typeof C.nodeName?!T._componentConstructor&&o(T,C.nodeName):S||T._componentConstructor===C.nodeName)){l=u,m[a]=void 0,a===y-1&&y--,a===g&&g++;break}l=p(l,c,n,r),s=d[w],l&&l!==e&&l!==s&&(null==s?e.appendChild(l):l===s.nextSibling?f(s):e.insertBefore(l,s))}var T,C,S;if(b)for(var w in x)void 0!==x[w]&&h(x[w],!1);for(;g<=y;)void 0!==(l=m[y--])&&h(l,!1)}(s,_,n,r,O||null!=y.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||u(e,r,n[r],n[r]=void 0,j);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||u(e,r,n[r],n[r]=t[r],j)}(s,t.attributes,y),j=c,s}function h(e,t){var n=e._component;n?v(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||f(e),d(e))}function d(e){for(e=e.lastChild;e;){var t=e.previousSibling;h(e,!0),e=t}}function m(e,t,n){var r,i=F.length;for(e.prototype&&e.prototype.render?(r=new e(t,n),y.call(r,t,n)):((r=new y(t,n)).constructor=e,r.render=x);i--;)if(F[i].constructor===e)return r.__b=F[i].__b,F.splice(i,1),r;return r}function x(e,t,n){return this.constructor(e,n)}function b(e,t,n,i,o){e.__x||(e.__x=!0,e.__r=t.ref,e.__k=t.key,delete t.ref,delete t.key,void 0===e.constructor.getDerivedStateFromProps&&(!e.base||o?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,i)),i&&i!==e.context&&(e.__c||(e.__c=e.context),e.context=i),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===w.syncComponentUpdates&&e.base?r(e):g(e,1,o)),e.__r&&e.__r(e))}function g(e,t,r,i){if(!e.__x){var o,f,u,s=e.props,p=e.state,d=e.context,x=e.__p||s,y=e.__s||p,_=e.__c||d,k=e.base,A=e.__b,E=k||A,T=e._component,C=!1,j=_;if(e.constructor.getDerivedStateFromProps&&(p=n(n({},p),e.constructor.getDerivedStateFromProps(s,p)),e.state=p),k&&(e.props=x,e.state=y,e.context=_,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(s,p,d)?C=!0:e.componentWillUpdate&&e.componentWillUpdate(s,p,d),e.props=s,e.state=p,e.context=d),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!C){o=e.render(s,p,d),e.getChildContext&&(d=n(n({},d),e.getChildContext())),k&&e.getSnapshotBeforeUpdate&&(j=e.getSnapshotBeforeUpdate(x,y));var O,F,L=o&&o.nodeName;if("function"==typeof L){var P=a(o);(f=T)&&f.constructor===L&&P.key==f.__k?b(f,P,1,d,!1):(O=f,e._component=f=m(L,P,d),f.__b=f.__b||A,f.__u=e,b(f,P,0,d,!1),g(f,1,r,!0)),F=f.base}else u=E,(O=T)&&(u=e._component=null),(E||1===t)&&(u&&(u._component=null),F=l(u,o,d,r||!k,E&&E.parentNode,!0));if(E&&F!==E&&f!==T){var z=E.parentNode;z&&F!==z&&(z.replaceChild(F,E),O||(E._component=null,h(E,!1)))}if(O&&v(O),e.base=F,F&&!i){for(var B=e,M=e;M=M.__u;)(B=M).base=F;F._component=B,F._componentConstructor=B.constructor}}for(!k||r?S.unshift(e):C||(e.componentDidUpdate&&e.componentDidUpdate(x,y,j),w.afterUpdate&&w.afterUpdate(e));e.__h.length;)e.__h.pop().call(e);D||i||c()}}function v(e){w.beforeUnmount&&w.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?v(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,f(t),F.push(e),d(t)),e.__r&&e.__r(null)}function y(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{},this.__h=[]}var _=function(){},w={},k=[],A=[],E="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,T=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,C=[],S=[],D=0,j=!1,O=!1,F=[];n(y.prototype,{setState:function(e,t){var i=this.__s=this.state;"function"==typeof e&&(e=e(i,this.props)),this.state=n(n({},i),e),t&&this.__h.push(t),r(this)},forceUpdate:function(e){e&&this.__h.push(e),g(this,2)},render:function(){}});var L={h:e,createElement:e,cloneElement:function(t,r){return e(t.nodeName,n(n({},t.attributes),r),arguments.length>2?[].slice.call(arguments,2):t.children)},Component:y,render:function(e,t,n){return l(n,e,{},!1,t,!1)},rerender:i,options:w};void 0!==t?t.exports=L:self.preact=L}()},{}],32:[function(e,t,n){(function(n){for(var r=e("performance-now"),i="undefined"==typeof window?n:window,o=["moz","webkit"],a="AnimationFrame",f=i["request"+a],u=i["cancel"+a]||i["cancelRequest"+a],s=0;!f&&s<o.length;s++)f=i[o[s]+"Request"+a],u=i[o[s]+"Cancel"+a]||i[o[s]+"CancelRequest"+a];if(!f||!u){var c=0,l=0,p=[];f=function(e){if(0===p.length){var t=r(),n=Math.max(0,1e3/60-(t-c));c=n+t,setTimeout(function(){var e=p.slice(0);p.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(c)}catch(e){setTimeout(function(){throw e},0)}},Math.round(n))}return p.push({handle:++l,callback:e,cancelled:!1}),l},u=function(e){for(var t=0;t<p.length;t++)p[t].handle===e&&(p[t].cancelled=!0)}}t.exports=function(e){return f.call(i,e)},t.exports.cancel=function(){u.apply(i,arguments)},t.exports.polyfill=function(e){e||(e=i),e.requestAnimationFrame=f,e.cancelAnimationFrame=u}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"performance-now":29}],33:[function(e,t,n){"use strict";var r=e("./field");function i(e,t,n,o,a){if(!(this instanceof i))return new i(e,t,a);t=void 0===t||!!t,r.call(this,e,t,o,a),this.type="checkbox"}t.exports=i,i.prototype=Object.create(r.prototype)},{"./field":35}],34:[function(e,t,n){"use strict";var r=e("./field");function i(e,t,n,o,a){if(!(this instanceof i))return new i(e,t,a);t=void 0===t?"#ffffff":t,r.call(this,e,t,o,a),this.type="color"}t.exports=i,i.prototype=Object.create(r.prototype)},{"./field":35}],35:[function(e,t,n){"use strict";var r=e("event-emitter"),i=e("raf");function o(e,t,n,i){if(/\./.test(e))throw new Error("Field names may not contain a period");var o=t;this.parent=n||null,this.context=i?Object.create(i):null,this.events=new r,this.type=null,this.name=e,this.context&&(this.context.parentContext=i,this.context.field=this),this.batchedUpdates={},this.batchUpdatePaths=[],this.batchUpdateRaf=null,Object.defineProperty(this,"$field",{enumerable:!1,value:this}),Object.defineProperty(this,"value",{get:function(){return o},set:function(e){var t={field:this,path:this.path,oldValue:o,value:e},n=this;do{var r={};r[t.path]=Object.assign({},t);n.path;n.events.emit&&(n.events.emit("change",Object.assign({},t)),n.events.emit("changes",r)),n._batchEmit&&n._batchEmit(n.path,Object.assign({},t))}while(n=n.parent);o=e}}),Object.defineProperty(this,"path",{enumerable:!0,get:function(){var e=(this.parent||{}).path;return this.name?(e?e+".":"")+this.name:null}})}t.exports=o,o.prototype={onFinishChange:function(e){return this.events.on("finishChange",e),this},offFinishChange:function(e){return this.events.off("finishChange",e),this},onChange:function(e){return this.events.on("change",e),this},offChange:function(e){return this.events.off("change",e),this},onFinishChanges:function(e){return this.events.on("finishChanges",e),this},offFinishChanges:function(e){return this.events.off("finishChanges",e),this},onChanges:function(e){return this.events.on("changes",e),this},offChanges:function(e){return this.events.off("changes",e),this},_emitUpdate:function(){for(this.events.emit("finishChanges",Object.assign({},this.batchedUpdates));this.batchUpdatePaths.length;)for(var e=Object.keys(this.batchedUpdates),t=0;t<e.length;t++){var n=this.batchedUpdates[e[t]];this.events.emit("finishChange:"+this.batchUpdatePaths.pop(),n)}this.batchedUpdates={},this.batchUpdateRaf=null},_batchEmit:function(e,t){var n=this.batchedUpdates[t.path];n&&(t.oldValue=n.oldValue),this.batchUpdatePaths.push(e),this.batchedUpdates[e]=t,this.batchUpdateRaf||(this.batchUpdateRaf=i(this._emitUpdate.bind(this)))}}},{"event-emitter":17,raf:32}],36:[function(e,t,n){"use strict";var r=e("./field");function i(e,t,n,o,a){if(!(this instanceof i))return new i(e,t,a);t=void 0===t?0:t,n=n||{},r.call(this,e,t,o,a);var f=void 0===n.min?Math.min(t,0):n.min,u=void 0===n.max?Math.max(t,1):n.max,s=void 0===n.step?1:n.step;this.type="rangeslider",this.min=f,this.max=u,this.step=s}t.exports=i,i.prototype=Object.create(r.prototype)},{"./field":35}],37:[function(e,t,n){"use strict";t.exports=c;var r=/(#(?:[0-9a-fA-F]{2,4}){2,4}|(#[0-9a-fA-F]{3})|(rgb|hsl)a?((-?\d+%?[,\s]+){2,3}\s*[\d.]+%?))/;var i=e("./field"),o=e("./slider"),a=e("./textinput"),f=e("./color"),u=e("./checkbox");function s(e,t,n,i){switch(function(e){if(e&&e.type)return e.type+"field";switch(typeof e){case"string":return r.test(e)?"color":"textinput";case"number":return"number";case"boolean":return"boolean";case"object":return"object"}}(t)){case"colorfield":case"textfield":case"sliderfield":case"selectfield":case"rangesliderfield":case"checkboxfield":case"sectionfield":if(t.path)throw new Error("You may only add an field to a set of controls once.");return t.$field.context=Object.assign(Object.create(i),t.context),t.$field.context.parentContext=i,t.$field.parent=n,t.name=e,t;case"color":return new f(e,t,{},n,i);case"textinput":return new a(e,t,{},n,i);case"number":return new o(e,t,{},n,i);case"boolean":return new u(e,t,{},n,i);case"object":return new c(e,t,{},n,i);default:return null}}function c(e,t,n,r,o){var a=this,f={},u={},c={};i.call(this,e,c,r,o),this.type="section",Object.defineProperty(u,"$field",{enumerable:!1,value:this}),Object.defineProperty(c,"$field",{enumerable:!1,value:this}),Object.defineProperty(c,"$path",{enumerable:!1,value:u}),Object.keys(t).forEach(function(e){var n=f[e]=s(e,t[e],a,a.context);"section"===n.type?(Object.defineProperty(c,e,{enumerable:!0,value:n.value}),Object.defineProperty(u,e,{enumerable:!0,value:n.value.$path})):(Object.defineProperty(c,e,{enumerable:!0,get:function(){return n.value},set:function(e){n.value=e}}),Object.defineProperty(u,e,{enumerable:!0,get:function(){return n}}))})}c.prototype=Object.create(i.prototype)},{"./checkbox":33,"./color":34,"./field":35,"./slider":39,"./textinput":40}],38:[function(e,t,n){"use strict";var r=e("./field");function i(e,t,n,o,a){if(!(this instanceof i))return new i(e,t,a);t=void 0===t?null:t,r.call(this,e,t,o,a),this.options=n.options,this.type="select"}t.exports=i,i.prototype=Object.create(r.prototype)},{"./field":35}],39:[function(e,t,n){"use strict";var r=e("./field");function i(e,t,n,o,a){if(!(this instanceof i))return new i(e,t,a);t=void 0===t?0:t,n=n||{},r.call(this,e,t,o,a);var f=void 0===n.min?Math.min(t,0):n.min,u=void 0===n.max?Math.max(t,1):n.max,s=void 0===n.step?1:n.step;this.type="slider",this.min=f,this.max=u,this.step=s}t.exports=i,i.prototype=Object.create(r.prototype)},{"./field":35}],40:[function(e,t,n){"use strict";var r=e("./field");function i(e,t,n,o){if(!(this instanceof i))return new i(e,t,o);t=void 0===t?"":t,r.call(this,e,t,o),this.type="textinput"}t.exports=i,i.prototype=Object.create(r.prototype)},{"./field":35}],41:[function(e,t,n){"use strict";var r=e("glslify"),i=e("h"),o=e("./control-panel-2"),a=e("./control-panel-2/gui");e("insert-css")("\ncanvas {\n cursor: move;\n}\n"),e("regl")({pixelRatio:Math.min(window.devicePixelRatio,1.5),extensions:["oes_texture_float","oes_texture_float_linear"],attributes:{antialias:!1},onDone:e("fail-nicely")(function(t){var n=0,f=.5,u=n/f;window.innerWidth,window.innerHeight;function s(){v=!0}var c=window.state=o({hbar:o.Slider(.005,{min:1e-4,max:.1,step:1e-4}).onChange(s),aperture:o.Slider(.2,{min:.001,max:1,step:.001}).onChange(s)});a(c,i("p",null,["This page plots Eq. 3.40 from Feynman and Hibbs' ",i("a",{href:"http://store.doverpublications.com/0486477223.html",target:"blank"},"Quantum Mechanic and Path Integrals"),". It depicts the magnitude of the wavefunction for a particle passing through a known aperture at a known time. The function is computed by adding up all paths passing through the slit and taking into account interference of the particle with itself. Two slits aren't required for a particle to interfere with itself! As ℏ approaches zero, it approaches a sharp shadow."])),e("mouse-change")(function(e,t,r){0!==e&&(u=2*t/window.innerWidth,n=h+(d-h)*t/window.innerWidth,f=l+(p-l)*(1-r/window.innerHeight),u=n/f,v=!0)}),t._gl.canvas.addEventListener("touchmove",function(e){if(1===e.touches.length){e.preventDefault();var t=e.touches[0],r=t.clientX,i=t.clientY;u=2*r/window.innerWidth,n=h+(d-h)*r/window.innerWidth,f=l+(p-l)*(1-i/window.innerHeight),u=n/f,v=!0}}),window.addEventListener("wheel",function(e){e.preventDefault(),c.aperture=Math.min(1,Math.max(.001,c.aperture*Math.exp(.01*-e.deltaY)))}),document.body.appendChild(i("div",{class:"x-axis axis-label"},"Space ⟶")),document.body.appendChild(i("div",{class:"y-axis axis-label"},"Time ⟶"));var l=0,p=2,h=-2,d=2,m=t.texture([e("./plasma")]),x=t({uniforms:{uColormap:m,uAxes:[h,d,l,p],uT:function(){return f},uV:function(){return u},uX0:function(){return n},uB:function(){return c.aperture},uHbar:function(){return c.hbar},uM:1,uColorScaleFactor:function(){return.5*f/c.aperture},uRes:function(e){return[1/e.framebufferWidth,1/e.framebufferHeight]}}}),b=t({vert:"\n precision highp float;\n attribute vec2 xy;\n uniform vec4 uAxes;\n varying vec2 vXt;\n void main () {\n vec2 uv = xy * 0.5 + 0.5;\n vXt = uAxes.xz + (uAxes.yw - uAxes.xz) * uv;\n gl_Position = vec4(xy, 0, 1);\n }\n ",frag:r(["\n precision highp float;\n#define GLSLIFY 1\n\n\n highp float random(vec2 co)\n{\n highp float a = 12.9898;\n highp float b = 78.233;\n highp float c = 43758.5453;\n highp float dt= dot(co.xy ,vec2(a,b));\n highp float sn= mod(dt,3.14);\n return fract(sin(sn) * c);\n}\n\n #define PI 3.1415926535\n#define HALF_PI (3.1415926535 * 0.5)\n\nvec4 allpoly (float x_0) {\n vec4 s1, s2;\n\n return s1;\n}\nfloat polyF (float x_0) {\n float s1, s2;\n if (x_0 == 0.0) return 2.999999999999634;\n float ax = x_0 < 0.0 ? -x_0 : x_0;\n if (ax <= 1.0) {\n s1 = 3.763297112699879e-20 + (\n x_0 * (1.3428327623306275e-16 + (\n x_0 * (1.7201074326816183e-13 + (\n x_0 * (1.0230451416490724e-10 + (\n x_0 * (3.055689837902576e-8 + (\n x_0 * (0.0000046361374928786735 + (\n x_0 * (0.000345017939782574 + (\n x_0 * (0.011522095507358577 + (\n x_0 * (0.1434079197807589 + (\n x_0 * (0.4215435550436775))))))))))))))))));\n s2 = 1.2544323709001127e-20 + (\n x_0 * (4.5200143407412973e-17 + (\n x_0 * (5.887545336215784e-14 + (\n x_0 * (3.6014002958937136e-11 + (\n x_0 * (1.1269922476399903e-8 + (\n x_0 * (0.0000018462756734893055 + (\n x_0 * (0.00015593440916415301 + (\n x_0 * (0.0064405152650885865 + (\n x_0 * (0.11688892585919138 + (\n x_0 * (0.7515863983533789 + (\n x_0 * (1.0)\n )))))))))))))))))));\n } else {\n x_0 = 1.0 / x_0;\n s1 = 0.0 + (\n x_0 * (0.4215435550436775 + (\n x_0 * (0.1434079197807589 + (\n x_0 * (0.011522095507358577 + (\n x_0 * (0.000345017939782574 + (\n x_0 * (0.0000046361374928786735 + (\n x_0 * (3.055689837902576e-8 + (\n x_0 * (1.0230451416490724e-10 + (\n x_0 * (1.7201074326816183e-13 + (\n x_0 * (1.3428327623306275e-16 + (\n x_0 * 3.763297112699879e-20\n )))))))))))))))))));\n s2 = 1.0 + (\n x_0 * (0.7515863983533789 + (\n x_0 * (0.11688892585919138 + (\n x_0 * (0.0064405152650885865 + (\n x_0 * (0.00015593440916415301 + (\n x_0 * (0.0000018462756734893055 + (\n x_0 * (1.1269922476399903e-8 + (\n x_0 * (3.6014002958937136e-11 + (\n x_0 * (5.887545336215784e-14 + (\n x_0 * (4.5200143407412973e-17 + (\n x_0 * 1.2544323709001127e-20\n )))))))))))))))))));\n }\n return s1 / s2;\n}\n\nfloat polyC (float x_0) {\n float s1, s2;\n if (x_0 == 0.0) return 1.0;\n float ax = x_0 < 0.0 ? -x_0 : x_0;\n if (ax <= 1.0) {\n s1 = 1.0 + (x_0 * (-0.20552590095501388 + (x_0 * (0.018884331939670384 + (x_0 * (-0.0006451914356839651 + (x_0 * (0.000009504280628298596 + (x_0 * (-4.9884311457357354e-8))))))))));\n s2 = 1.0 + (x_0 * (0.04121420907221998 + (x_0 * (0.0008680295429417843 + (x_0 * (0.000012226278902417902 + (x_0 * (1.2500186247959882e-7 + (x_0 * (9.154392157746574e-10 + (x_0 * 3.99982968972496e-12)))))))))));\n } else {\n x_0 = 1.0 / x_0;\n s1 = 0.0 + (x_0 * (-4.9884311457357354e-8 + (x_0 * (0.000009504280628298596 + (x_0 * (-0.0006451914356839651 + (x_0 * (0.018884331939670384 + (x_0 * (-0.20552590095501388 + x_0))))))))));\n s2 = 3.99982968972496e-12 + (x_0 * (9.154392157746574e-10 + (x_0 * (1.2500186247959882e-7 + (x_0 * (0.000012226278902417902 + (x_0 * (0.0008680295429417843 + (x_0 * (0.04121420907221998 + x_0))))))))));\n }\n return s1 / s2;\n}\n\nfloat polyG (float x_0) {\n float s1, s2;\n if (x_0 == 0.0) return 1.0;\n float ax = x_0 < 0.0 ? -x_0 : x_0;\n if (ax <= 1.0) {\n s1 = 1.8695871016278324e-22 + (x_0 * (8.363544356306774e-19 + (x_0 * (1.375554606332618e-15 + (x_0 * (1.0826804113902088e-12 + (x_0 * (4.4534441586175015e-10 + (x_0 * (9.828524436884223e-8 + (x_0 * (0.000011513882611188428 + (x_0 * (0.0006840793809153931 + (x_0 * (0.018764858409257526 + (x_0 * (0.1971028335255234 + (x_0 * (0.5044420736433832))))))))))))))))))));\n s2 = 1.8695871016278324e-22 + (x_0 * (8.391588162831187e-19 + (x_0 * (1.3879653125957886e-15 + (x_0 * (1.1027321506624028e-12 + (x_0 * (4.6068072814652043e-10 + (x_0 * (1.0431458965757199e-7 + (x_0 * (0.000012754507566772912 + (x_0 * (0.0008146791071843061 + (x_0 * (0.02536037414203388 + (x_0 * (0.33774898912002 + (x_0 * (1.4749575992512833 + x_0))))))))))))))))))));\n } else {\n x_0 = 1.0 / x_0;\n s1 = 0.0 + (x_0 * (0.5044420736433832 + (x_0 * (0.1971028335255234 + (x_0 * (0.018764858409257526 + (x_0 * (0.0006840793809153931 + (x_0 * (0.000011513882611188428 + (x_0 * (9.828524436884223e-8 + (x_0 * (4.4534441586175015e-10 + (x_0 * (1.0826804113902088e-12 + (x_0 * (1.375554606332618e-15 + (x_0 * (8.363544356306774e-19 + (x_0 * 1.8695871016278324e-22)))))))))))))))))))));\n s2 = 1.0 + (x_0 * (1.4749575992512833 + (x_0 * (0.33774898912002 + (x_0 * (0.02536037414203388 + (x_0 * (0.0008146791071843061 + (x_0 * (0.000012754507566772912 + (x_0 * (1.0431458965757199e-7 + (x_0 * (4.6068072814652043e-10 + (x_0 * (1.1027321506624028e-12 + (x_0 * (1.3879653125957886e-15 + (x_0 * (8.391588162831187e-19 + (x_0 * 1.8695871016278324e-22)))))))))))))))))))));\n }\n return s1 / s2;\n}\n\nfloat polyS (float x_0) {\n float s1, s2;\n if (x_0 == 0.0) return 0.5235987755982989;\n float ax = x_0 < 0.0 ? -x_0 : x_0;\n if (ax <= 1.0) {\n s1 = 318016297876.5678 + (x_0 * (-44297951805.96978 + (x_0 * (2548908805.7337637 + (x_0 * (-62974148.62058625 + (x_0 * (708840.0452577386 + (x_0 * (-2991.8191940101983 + x_0))))))))));\n s2 = 607366389490.0846 + (x_0 * (22441179564.534092 + (x_0 * (419320245.8981112 + (x_0 * (5173438.887700964 + (x_0 * (45584.78108065326 + (x_0 * (281.3762688899943 + x_0))))))))));\n } else {\n x_0 = 1.0 / x_0;\n s1 = 0.0 + (x_0 * (-2991.8191940101983 + (x_0 * (708840.0452577386 + (x_0 * (-62974148.62058625 + (x_0 * (2548908805.7337637 + (x_0 * (-44297951805.96978 + (x_0 * 318016297876.5678)))))))))));\n s2 = 1.0 + (x_0 * (281.3762688899943 + (x_0 * (45584.78108065326 + (x_0 * (5173438.887700964 + (x_0 * (419320245.8981112 + (x_0 * (22441179564.534092 + (x_0 * 607366389490.0846)))))))))));\n }\n return s1 / s2;\n}\n\nvec2 fresnel(float x) {\n float x2, a, f, g, t, u;\n vec2 result = vec2(0.5);\n\n float xa = abs( x );\n x2 = xa * xa;\n if (x2 < 2.5625) {\n t = x2 * x2;\n result = xa * vec2(x2 * polyS(t), polyC(t));\n } else if (xa <= 36974.0) {\n x2 = xa * xa;\n t = PI * x2;\n u = 1.0 / (t * t);\n t = 1.0 / t;\n f = 1.0 - u * polyF(u);\n g = t * polyG(u);\n t = HALF_PI * x2;\n float st = sin(t);\n float ct = cos(t);\n t = PI * xa;\n result = 0.5 - (ct * vec2(f, g) + st * vec2(g, -f)) / t;\n }\n return x < 0.0 ? -result : result;\n}\n\n uniform sampler2D uColormap;//, uSrc;\n uniform float uT, uV, uB, uHbar, uM, uX0, uColorScaleFactor;\n varying vec2 vXt;\n\n #define PI 3.1415926535\n\n vec4 colormap (float x) {\n x = sqrt(x);\n return texture2D(uColormap, vec2(x + 1.0 / 256.0 * (random(gl_FragCoord.xy) - 0.5), 0.5), 1.0);\n //return texture2D(uColormap, vec2(x, 0.5), 1.0);\n }\n\n float u (vec2 xt, float sgn) {\n float k = 1.0 + xt.y / uT;\n return ((xt.x - uV * xt.y) + sgn * uB * k) / sqrt(PI * uHbar * xt.y / uM * k);\n }\n\n float psi(vec2 xt) {\n vec2 SC = fresnel(u(xt, 1.0)) - fresnel(u(xt, -1.0));\n return uM / (2.0 * PI * (uT + xt.y)) * 0.5 * dot(SC, SC);\n }\n\n void main () {\n gl_FragColor = colormap(psi(vXt - vec2(uX0, uT)) * uColorScaleFactor);\n }\n ",""]),attributes:{xy:[-4,-4,0,4,4,-4]},scissor:{enable:!0,box:{x:0,y:function(e){return Math.max(0,Math.floor((f-l)/(p-l)*e.framebufferHeight))},width:function(e){return e.framebufferWidth},height:function(e){return e.framebufferHeight}}},depth:{enable:!1},count:3}),g=t({vert:"\n precision highp float;\n attribute vec2 xy;\n uniform vec4 uAxes;\n varying vec2 vXt;\n void main () {\n vec2 uv = xy * 0.5 + 0.5;\n vXt = uAxes.xz + (uAxes.yw - uAxes.xz) * uv;\n gl_Position = vec4(xy, 0, 1);\n }\n ",frag:r(["\n precision highp float;\n#define GLSLIFY 1\n\n\n highp float random(vec2 co)\n{\n highp float a = 12.9898;\n highp float b = 78.233;\n highp float c = 43758.5453;\n highp float dt= dot(co.xy ,vec2(a,b));\n highp float sn= mod(dt,3.14);\n return fract(sin(sn) * c);\n}\n\n #define PI 3.1415926535\n#define HALF_PI (3.1415926535 * 0.5)\n\nvec4 allpoly (float x_0) {\n vec4 s1, s2;\n\n return s1;\n}\nfloat polyF (float x_0) {\n float s1, s2;\n if (x_0 == 0.0) return 2.999999999999634;\n float ax = x_0 < 0.0 ? -x_0 : x_0;\n if (ax <= 1.0) {\n s1 = 3.763297112699879e-20 + (\n x_0 * (1.3428327623306275e-16 + (\n x_0 * (1.7201074326816183e-13 + (\n x_0 * (1.0230451416490724e-10 + (\n x_0 * (3.055689837902576e-8 + (\n x_0 * (0.0000046361374928786735 + (\n x_0 * (0.000345017939782574 + (\n x_0 * (0.011522095507358577 + (\n x_0 * (0.1434079197807589 + (\n x_0 * (0.4215435550436775))))))))))))))))));\n s2 = 1.2544323709001127e-20 + (\n x_0 * (4.5200143407412973e-17 + (\n x_0 * (5.887545336215784e-14 + (\n x_0 * (3.6014002958937136e-11 + (\n x_0 * (1.1269922476399903e-8 + (\n x_0 * (0.0000018462756734893055 + (\n x_0 * (0.00015593440916415301 + (\n x_0 * (0.0064405152650885865 + (\n x_0 * (0.11688892585919138 + (\n x_0 * (0.7515863983533789 + (\n x_0 * (1.0)\n )))))))))))))))))));\n } else {\n x_0 = 1.0 / x_0;\n s1 = 0.0 + (\n x_0 * (0.4215435550436775 + (\n x_0 * (0.1434079197807589 + (\n x_0 * (0.011522095507358577 + (\n x_0 * (0.000345017939782574 + (\n x_0 * (0.0000046361374928786735 + (\n x_0 * (3.055689837902576e-8 + (\n x_0 * (1.0230451416490724e-10 + (\n x_0 * (1.7201074326816183e-13 + (\n x_0 * (1.3428327623306275e-16 + (\n x_0 * 3.763297112699879e-20\n )))))))))))))))))));\n s2 = 1.0 + (\n x_0 * (0.7515863983533789 + (\n x_0 * (0.11688892585919138 + (\n x_0 * (0.0064405152650885865 + (\n x_0 * (0.00015593440916415301 + (\n x_0 * (0.0000018462756734893055 + (\n x_0 * (1.1269922476399903e-8 + (\n x_0 * (3.6014002958937136e-11 + (\n x_0 * (5.887545336215784e-14 + (\n x_0 * (4.5200143407412973e-17 + (\n x_0 * 1.2544323709001127e-20\n )))))))))))))))))));\n }\n return s1 / s2;\n}\n\nfloat polyC (float x_0) {\n float s1, s2;\n if (x_0 == 0.0) return 1.0;\n float ax = x_0 < 0.0 ? -x_0 : x_0;\n if (ax <= 1.0) {\n s1 = 1.0 + (x_0 * (-0.20552590095501388 + (x_0 * (0.018884331939670384 + (x_0 * (-0.0006451914356839651 + (x_0 * (0.000009504280628298596 + (x_0 * (-4.9884311457357354e-8))))))))));\n s2 = 1.0 + (x_0 * (0.04121420907221998 + (x_0 * (0.0008680295429417843 + (x_0 * (0.000012226278902417902 + (x_0 * (1.2500186247959882e-7 + (x_0 * (9.154392157746574e-10 + (x_0 * 3.99982968972496e-12)))))))))));\n } else {\n x_0 = 1.0 / x_0;\n s1 = 0.0 + (x_0 * (-4.9884311457357354e-8 + (x_0 * (0.000009504280628298596 + (x_0 * (-0.0006451914356839651 + (x_0 * (0.018884331939670384 + (x_0 * (-0.20552590095501388 + x_0))))))))));\n s2 = 3.99982968972496e-12 + (x_0 * (9.154392157746574e-10 + (x_0 * (1.2500186247959882e-7 + (x_0 * (0.000012226278902417902 + (x_0 * (0.0008680295429417843 + (x_0 * (0.04121420907221998 + x_0))))))))));\n }\n return s1 / s2;\n}\n\nfloat polyG (float x_0) {\n float s1, s2;\n if (x_0 == 0.0) return 1.0;\n float ax = x_0 < 0.0 ? -x_0 : x_0;\n if (ax <= 1.0) {\n s1 = 1.8695871016278324e-22 + (x_0 * (8.363544356306774e-19 + (x_0 * (1.375554606332618e-15 + (x_0 * (1.0826804113902088e-12 + (x_0 * (4.4534441586175015e-10 + (x_0 * (9.828524436884223e-8 + (x_0 * (0.000011513882611188428 + (x_0 * (0.0006840793809153931 + (x_0 * (0.018764858409257526 + (x_0 * (0.1971028335255234 + (x_0 * (0.5044420736433832))))))))))))))))))));\n s2 = 1.8695871016278324e-22 + (x_0 * (8.391588162831187e-19 + (x_0 * (1.3879653125957886e-15 + (x_0 * (1.1027321506624028e-12 + (x_0 * (4.6068072814652043e-10 + (x_0 * (1.0431458965757199e-7 + (x_0 * (0.000012754507566772912 + (x_0 * (0.0008146791071843061 + (x_0 * (0.02536037414203388 + (x_0 * (0.33774898912002 + (x_0 * (1.4749575992512833 + x_0))))))))))))))))))));\n } else {\n x_0 = 1.0 / x_0;\n s1 = 0.0 + (x_0 * (0.5044420736433832 + (x_0 * (0.1971028335255234 + (x_0 * (0.018764858409257526 + (x_0 * (0.0006840793809153931 + (x_0 * (0.000011513882611188428 + (x_0 * (9.828524436884223e-8 + (x_0 * (4.4534441586175015e-10 + (x_0 * (1.0826804113902088e-12 + (x_0 * (1.375554606332618e-15 + (x_0 * (8.363544356306774e-19 + (x_0 * 1.8695871016278324e-22)))))))))))))))))))));\n s2 = 1.0 + (x_0 * (1.4749575992512833 + (x_0 * (0.33774898912002 + (x_0 * (0.02536037414203388 + (x_0 * (0.0008146791071843061 + (x_0 * (0.000012754507566772912 + (x_0 * (1.0431458965757199e-7 + (x_0 * (4.6068072814652043e-10 + (x_0 * (1.1027321506624028e-12 + (x_0 * (1.3879653125957886e-15 + (x_0 * (8.391588162831187e-19 + (x_0 * 1.8695871016278324e-22)))))))))))))))))))));\n }\n return s1 / s2;\n}\n\nfloat polyS (float x_0) {\n float s1, s2;\n if (x_0 == 0.0) return 0.5235987755982989;\n float ax = x_0 < 0.0 ? -x_0 : x_0;\n if (ax <= 1.0) {\n s1 = 318016297876.5678 + (x_0 * (-44297951805.96978 + (x_0 * (2548908805.7337637 + (x_0 * (-62974148.62058625 + (x_0 * (708840.0452577386 + (x_0 * (-2991.8191940101983 + x_0))))))))));\n s2 = 607366389490.0846 + (x_0 * (22441179564.534092 + (x_0 * (419320245.8981112 + (x_0 * (5173438.887700964 + (x_0 * (45584.78108065326 + (x_0 * (281.3762688899943 + x_0))))))))));\n } else {\n x_0 = 1.0 / x_0;\n s1 = 0.0 + (x_0 * (-2991.8191940101983 + (x_0 * (708840.0452577386 + (x_0 * (-62974148.62058625 + (x_0 * (2548908805.7337637 + (x_0 * (-44297951805.96978 + (x_0 * 318016297876.5678)))))))))));\n s2 = 1.0 + (x_0 * (281.3762688899943 + (x_0 * (45584.78108065326 + (x_0 * (5173438.887700964 + (x_0 * (419320245.8981112 + (x_0 * (22441179564.534092 + (x_0 * 607366389490.0846)))))))))));\n }\n return s1 / s2;\n}\n\nvec2 fresnel(float x) {\n float x2, a, f, g, t, u;\n vec2 result = vec2(0.5);\n\n float xa = abs( x );\n x2 = xa * xa;\n if (x2 < 2.5625) {\n t = x2 * x2;\n result = xa * vec2(x2 * polyS(t), polyC(t));\n } else if (xa <= 36974.0) {\n x2 = xa * xa;\n t = PI * x2;\n u = 1.0 / (t * t);\n t = 1.0 / t;\n f = 1.0 - u * polyF(u);\n g = t * polyG(u);\n t = HALF_PI * x2;\n float st = sin(t);\n float ct = cos(t);\n t = PI * xa;\n result = 0.5 - (ct * vec2(f, g) + st * vec2(g, -f)) / t;\n }\n return x < 0.0 ? -result : result;\n}\n\n uniform sampler2D uColormap;//, uSrc;\n uniform float uT, uV, uB, uHbar, uM, uX0, uColorScaleFactor;\n uniform vec4 uAxes;\n uniform vec2 uRes;\n varying vec2 vXt;\n\n #define PI 3.1415926535\n\n vec4 colormap (float x) {\n x = sqrt(x);\n return texture2D(uColormap, vec2(x + 1.0 / 256.0 * (random(gl_FragCoord.xy) - 0.5), 0.5), 1.0);\n //return texture2D(uColormap, vec2(x, 0.5), 1.0);\n }\n\n float u (vec2 xt, float sgn) {\n float k = 1.0 + xt.y / uT;\n return ((xt.x - uV * xt.y) + sgn * uB * k) / sqrt(PI * uHbar * (xt.y + uT) / uM * k);\n }\n\n float step (float x) {\n return x > 0.0 ? 1.0 : 0.0;\n }\n\n float psi(vec2 xt) {\n return uM / (2.0 * PI * (uT + xt.y)) * (step(u(xt, 1.0)) - step(u(xt, -1.0)));\n }\n\n void main () {\n gl_FragColor = colormap(psi(vXt - vec2(uX0, uT)) * uColorScaleFactor);\n if (vXt.y - uT > (-uRes.y * 5.0 * (uAxes.w - uAxes.z)) && ((vXt.x - uV * uT) < -uB || (vXt.x - uV * uT) > uB)) gl_FragColor = vec4(1);\n }\n ",""]),attributes:{xy:[-4,-4,0,4,4,-4]},scissor:{enable:!0,box:{x:0,y:0,width:function(e){return e.framebufferWidth},height:function(e){return Math.max(0,Math.ceil((f-l)/(p-l)*e.framebufferHeight))}}},depth:{enable:!1},count:3}),v=!0;t.frame(function(){v&&(x(function(){b(),g()}),v=!1)})})}),e("insert-css")("\n.axis-label {\n font-family: sans-serif;\n color: white;\n position: fixed;\n font-weight: 200;\n font-style: italic;\n}\n.x-axis {\n bottom: 8px;\n right: 10px;\n}\n.y-axis {\n transform: translate(0, 100%) rotate(-90deg) translate(-50%, 0);\n transform-origin: 0% 0%;\n left: 8px;\n bottom: 50%;\n}\n.\n")},{"./control-panel-2":27,"./control-panel-2/gui":26,"./plasma":42,"fail-nicely":18,glslify:19,h:20,"insert-css":21,"mouse-change":22,regl:25}],42:[function(e,t,n){t.exports=[[.050383,.029803,.527975,1],[.063536,.028426,.533124,1],[.075353,.027206,.538007,1],[.086222,.026125,.542658,1],[.096379,.025165,.547103,1],[.10598,.024309,.551368,1],[.115124,.023556,.555468,1],[.123903,.022878,.559423,1],[.132381,.022258,.56325,1],[.140603,.021687,.566959,1],[.148607,.021154,.570562,1],[.156421,.020651,.574065,1],[.16407,.020171,.577478,1],[.171574,.019706,.580806,1],[.17895,.019252,.584054,1],[.186213,.018803,.587228,1],[.193374,.018354,.59033,1],[.200445,.017902,.593364,1],[.207435,.017442,.596333,1],[.21435,.016973,.599239,1],[.221197,.016497,.602083,1],[.227983,.016007,.604867,1],[.234715,.015502,.607592,1],[.241396,.014979,.610259,1],[.248032,.014439,.612868,1],[.254627,.013882,.615419,1],[.261183,.013308,.617911,1],[.267703,.012716,.620346,1],[.274191,.012109,.622722,1],[.280648,.011488,.625038,1],[.287076,.010855,.627295,1],[.293478,.010213,.62949,1],[.299855,.009561,.631624,1],[.30621,.008902,.633694,1],[.312543,.008239,.6357,1],[.318856,.007576,.63764,1],[.32515,.006915,.639512,1],[.331426,.006261,.641316,1],[.337683,.005618,.643049,1],[.343925,.004991,.64471,1],[.35015,.004382,.646298,1],[.356359,.003798,.64781,1],[.362553,.003243,.649245,1],[.368733,.002724,.650601,1],[.374897,.002245,.651876,1],[.381047,.001814,.653068,1],[.387183,.001434,.654177,1],[.393304,.001114,.655199,1],[.399411,859e-6,.656133,1],[.405503,678e-6,.656977,1],[.41158,577e-6,.65773,1],[.417642,564e-6,.65839,1],[.423689,646e-6,.658956,1],[.429719,831e-6,.659425,1],[.435734,.001127,.659797,1],[.441732,.00154,.660069,1],[.447714,.00208,.66024,1],[.453677,.002755,.66031,1],[.459623,.003574,.660277,1],[.46555,.004545,.660139,1],[.471457,.005678,.659897,1],[.477344,.00698,.659549,1],[.48321,.00846,.659095,1],[.489055,.010127,.658534,1],[.494877,.01199,.657865,1],[.500678,.014055,.657088,1],[.506454,.016333,.656202,1],[.512206,.018833,.655209,1],[.517933,.021563,.654109,1],[.523633,.024532,.652901,1],[.529306,.027747,.651586,1],[.534952,.031217,.650165,1],[.54057,.03495,.64864,1],[.546157,.038954,.64701,1],[.551715,.043136,.645277,1],[.557243,.047331,.643443,1],[.562738,.051545,.641509,1],[.568201,.055778,.639477,1],[.573632,.060028,.637349,1],[.579029,.064296,.635126,1],[.584391,.068579,.632812,1],[.589719,.072878,.630408,1],[.595011,.07719,.627917,1],[.600266,.081516,.625342,1],[.605485,.085854,.622686,1],[.610667,.090204,.619951,1],[.615812,.094564,.61714,1],[.620919,.098934,.614257,1],[.625987,.103312,.611305,1],[.631017,.107699,.608287,1],[.636008,.112092,.605205,1],[.640959,.116492,.602065,1],[.645872,.120898,.598867,1],[.650746,.125309,.595617,1],[.65558,.129725,.592317,1],[.660374,.134144,.588971,1],[.665129,.138566,.585582,1],[.669845,.142992,.582154,1],[.674522,.147419,.578688,1],[.67916,.151848,.575189,1],[.683758,.156278,.57166,1],[.688318,.160709,.568103,1],[.69284,.165141,.564522,1],[.697324,.169573,.560919,1],[.701769,.174005,.557296,1],[.706178,.178437,.553657,1],[.710549,.182868,.550004,1],[.714883,.187299,.546338,1],[.719181,.191729,.542663,1],[.723444,.196158,.538981,1],[.72767,.200586,.535293,1],[.731862,.205013,.531601,1],[.736019,.209439,.527908,1],[.740143,.213864,.524216,1],[.744232,.218288,.520524,1],[.748289,.222711,.516834,1],[.752312,.227133,.513149,1],[.756304,.231555,.509468,1],[.760264,.235976,.505794,1],[.764193,.240396,.502126,1],[.76809,.244817,.498465,1],[.771958,.249237,.494813,1],[.775796,.253658,.491171,1],[.779604,.258078,.487539,1],[.783383,.2625,.483918,1],[.787133,.266922,.480307,1],[.790855,.271345,.476706,1],[.794549,.27577,.473117,1],[.798216,.280197,.469538,1],[.801855,.284626,.465971,1],[.805467,.289057,.462415,1],[.809052,.293491,.45887,1],[.812612,.297928,.455338,1],[.816144,.302368,.451816,1],[.819651,.306812,.448306,1],[.823132,.311261,.444806,1],[.826588,.315714,.441316,1],[.830018,.320172,.437836,1],[.833422,.324635,.434366,1],[.836801,.329105,.430905,1],[.840155,.33358,.427455,1],[.843484,.338062,.424013,1],[.846788,.342551,.420579,1],[.850066,.347048,.417153,1],[.853319,.351553,.413734,1],[.856547,.356066,.410322,1],[.85975,.360588,.406917,1],[.862927,.365119,.403519,1],[.866078,.36966,.400126,1],[.869203,.374212,.396738,1],[.872303,.378774,.393355,1],[.875376,.383347,.389976,1],[.878423,.387932,.3866,1],[.881443,.392529,.383229,1],[.884436,.397139,.37986,1],[.887402,.401762,.376494,1],[.89034,.406398,.37313,1],[.89325,.411048,.369768,1],[.896131,.415712,.366407,1],[.898984,.420392,.363047,1],[.901807,.425087,.359688,1],[.904601,.429797,.356329,1],[.907365,.434524,.35297,1],[.910098,.439268,.34961,1],[.9128,.444029,.346251,1],[.915471,.448807,.34289,1],[.918109,.453603,.339529,1],[.920714,.458417,.336166,1],[.923287,.463251,.332801,1],[.925825,.468103,.329435,1],[.928329,.472975,.326067,1],[.930798,.477867,.322697,1],[.933232,.48278,.319325,1],[.93563,.487712,.315952,1],[.93799,.492667,.312575,1],[.940313,.497642,.309197,1],[.942598,.502639,.305816,1],[.944844,.507658,.302433,1],[.947051,.512699,.299049,1],[.949217,.517763,.295662,1],[.951344,.52285,.292275,1],[.953428,.52796,.288883,1],[.95547,.533093,.28549,1],[.957469,.53825,.282096,1],[.959424,.543431,.278701,1],[.961336,.548636,.275305,1],[.963203,.553865,.271909,1],[.965024,.559118,.268513,1],[.966798,.564396,.265118,1],[.968526,.5697,.261721,1],[.970205,.575028,.258325,1],[.971835,.580382,.254931,1],[.973416,.585761,.25154,1],[.974947,.591165,.248151,1],[.976428,.596595,.244767,1],[.977856,.602051,.241387,1],[.979233,.607532,.238013,1],[.980556,.613039,.234646,1],[.981826,.618572,.231287,1],[.983041,.624131,.227937,1],[.984199,.629718,.224595,1],[.985301,.63533,.221265,1],[.986345,.640969,.217948,1],[.987332,.646633,.214648,1],[.98826,.652325,.211364,1],[.989128,.658043,.2081,1],[.989935,.663787,.204859,1],[.990681,.669558,.201642,1],[.991365,.675355,.198453,1],[.991985,.681179,.195295,1],[.992541,.68703,.19217,1],[.993032,.692907,.189084,1],[.993456,.69881,.186041,1],[.993814,.704741,.183043,1],[.994103,.710698,.180097,1],[.994324,.716681,.177208,1],[.994474,.722691,.174381,1],[.994553,.728728,.171622,1],[.994561,.734791,.168938,1],[.994495,.74088,.166335,1],[.994355,.746995,.163821,1],[.994141,.753137,.161404,1],[.993851,.759304,.159092,1],[.993482,.765499,.156891,1],[.993033,.77172,.154808,1],[.992505,.777967,.152855,1],[.991897,.784239,.151042,1],[.991209,.790537,.149377,1],[.990439,.796859,.14787,1],[.989587,.803205,.146529,1],[.988648,.809579,.145357,1],[.987621,.815978,.144363,1],[.986509,.822401,.143557,1],[.985314,.828846,.142945,1],[.984031,.835315,.142528,1],[.982653,.841812,.142303,1],[.98119,.848329,.142279,1],[.979644,.854866,.142453,1],[.977995,.861432,.142808,1],[.976265,.868016,.143351,1],[.974443,.874622,.144061,1],[.97253,.88125,.144923,1],[.970533,.887896,.145919,1],[.968443,.894564,.147014,1],[.966271,.901249,.14818,1],[.964021,.90795,.14937,1],[.961681,.914672,.15052,1],[.959276,.921407,.151566,1],[.956808,.928152,.152409,1],[.954287,.934908,.152921,1],[.951726,.941671,.152925,1],[.949151,.948435,.152178,1],[.946602,.95519,.150328,1],[.944152,.961916,.146861,1],[.941896,.96859,.140956,1],[.940015,.975158,.131326,1]].map(function(e){return e.map(function(e){return Math.max(0,Math.min(255,256*e))})})},{}]},{},[41]); |