/*! p5.js v1.2.0 December 19, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function a(o,s,l){function u(t,e){if(!s[t]){if(!o[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};o[t][0].call(n.exports,function(e){return u(o[t][1][e]||e)},n,n.exports,a,o,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,o[s++]=t>>8&255,o[s++]=255&t;2===a&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,o[s++]=255&t);1===a&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,o[s++]=t>>8&255,o[s++]=255&t);return o},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],a=0,o=r-i;a>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,a=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return a.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],2:[function(e,t,r){},{}],3:[function(e,t,r){arguments[4][2][0].apply(r,arguments)},{dup:2}],4:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),a=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function o(e){if(r>>1;case"base64":return D(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var a,o=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=o=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var h=-1;for(a=r;a>8,n=r%256,a.push(n),a.push(i);return a}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var a=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var a,o,s,l,u,h,c=!1;;)switch(i){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,k(R(e,(l=this).length-u),l,u,h);case"ascii":return y(this,e,t,r);case"latin1":case"binary":return y(this,e,t,r);case"base64":return a=this,o=t,s=r,k(D(e),a,o,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function L(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(e,t,r,i,n){return t=+t,r>>>=0,n||L(e,0,r,4),a.write(e,t,r,i,23,4),r+4}function P(e,t,r,i,n){return t=+t,r>>>=0,n||L(e,0,r,8),a.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||E(e,t,this.length);for(var i=this[e],n=1,a=0;++a>>=0,t>>>=0,r||E(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||E(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||E(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||E(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||E(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||E(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||E(e,t,this.length);for(var i=this[e],n=1,a=0;++a>>=0,t>>>=0,r||E(e,t,this.length);for(var i=t,n=1,a=this[e+--i];0>>=0,t||E(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||E(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||E(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||E(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||E(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||E(e,4,this.length),a.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||E(e,4,this.length),a.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||E(e,8,this.length),a.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||E(e,8,this.length),a.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,a=1;for(this[t+n]=255&e;0<=--n&&(a*=256);)this[t+n]=e/a&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;0<=--a&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return O(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return O(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return P(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return P(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(a=t;a>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function D(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function k(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":1,buffer:4,ieee754:9}],5:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":6}],6:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,o=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):g())};var e="undefined"!=typeof window?window:void 0,a=e||{},s=a.MutationObserver||a.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,a=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:a-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),2<=(t+=1<=o+c?f/l:f*Math.pow(2,1-c))*l&&(o++,l/=2),h<=o+c?(s=0,o=h):1<=o+c?(s=(t*l-1)*Math.pow(2,n),o+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),o=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(o=o<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function L(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?y(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=g(t.b.a,e,t.a),(e=g(r.b.a,e,r.a))<=t)}function O(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function P(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function D(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[o[u]])?le(r,u):ue(r,u)),s[a]=null,l[a]=r.b,r.b=a}else for(r.c[-(a+1)]=null;0Math.max(o.a,l.a))return!1;if(y(a,o)){if(0i.f&&(i.f*=2,i.c=ae(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&y(oe(e.b),t))return se(e.b);for(;--e.a,0e.a||y(i[o],i[l])){n[r[a]=o]=a;break}n[r[a]=l]=a,a=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,a=t,o=r[a];;){var s=a>>1,l=r[s];if(0==s||y(i[l],i[o])){n[r[a]=o]=a;break}n[r[a]=l]=a,a=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=X.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var a=e[n];a<-1e150&&(a=-1e150,r=!0),1e150n[u]&&(n[u]=h,o[u]=l)}if(l=0,n[1]-a[1]>n[0]-a[0]&&(l=1),n[2]-a[2]>n[l]-a[l]&&(l=2),a[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,a=s[l],o=o[l],s=[0,0,0],a=[a.g[0]-o.g[0],a.g[1]-o.g[1],a.g[2]-o.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-o.g[0],u[1]=l.g[1]-o.g[1],u[2]=l.g[2]-o.g[2],s[0]=a[1]*u[2]-a[2]*u[1],s[1]=a[2]*u[0]-a[0]*u[2],s[2]=a[0]*u[1]-a[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[E(a)]=1)}r=!0}for(s=E(i),l=this.b.c,n=(s+1)%3,o=(s+2)%3,s=0>=l,h-=l,v!=a){if(v==o)break;for(var y=v>8,++g;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=v}else s=1+o,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(y,e,t,r){var g=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(o=1<>8&255,y[g++]=255&t,y[g++]=t>>8&255,y[g++]=(null!==b?128:0)|n,y[g++]=a,y[g++]=0,null!==b)for(var s=0,l=b.length;s>16&255,y[g++]=u>>8&255,y[g++]=255&u}if(null!==i){if(i<0||65535>8&255,y[g++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,a){if(!0===x&&(--g,x=!1),a=void 0===a?{}:a,e<0||t<0||65535>=1;)++u;l=1<>8&255,y[g++]=d,y[g++]=0),y[g++]=44,y[g++]=255&e,y[g++]=e>>8&255,y[g++]=255&t,y[g++]=t>>8&255,y[g++]=255&r,y[g++]=r>>8&255,y[g++]=255&i,y[g++]=i>>8&255,y[g++]=!0===o?128|u-1:0,!0===o)for(var p=0,m=s.length;p>16&255,y[g++]=v>>8&255,y[g++]=255&v}return g=function(t,r,e,i){t[r++]=e;var n=r++,a=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(a),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var a=null,o=null;i&&(a=e,e+=3*(o=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++]|x[e++]<<8,g=x[e++],b=g>>6&1,_=1<<1+(7&g),S=a,M=o,T=!1;if(g>>7){T=!0;S=e,e+=3*(M=_)}var E=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:v,height:y,has_local_palette:T,palette_offset:S,palette_size:M,data_offset:E,data_length:e-E,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);L(x,r.data_offset,n,i);var a=r.palette_offset,o=r.transparent_index;null===o&&(o=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,v=n.length;m>=1)),y===o)f+=4;else{var g=x[a+3*y],b=x[a+3*y+1],_=x[a+3*y+2];t[f++]=_,t[f++]=b,t[f++]=g,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);L(x,r.data_offset,n,i);var a=r.palette_offset,o=r.transparent_index;null===o&&(o=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,v=n.length;m>=1)),y===o)f+=4;else{var g=x[a+3*y],b=x[a+3*y+1],_=x[a+3*y+2];t[f++]=g,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],12:[function(jr,t,r){(function(Gr){var e;e=this,function(T){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,a=t.charCodeAt(i);return 55296<=a&&a<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=a,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,a,o,s,l;for(i=_(e,5,257),n=_(e,5,1),a=_(e,4,4),o=0;o<19;++o)v[o]=0;for(o=0;othis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,a,o,s){var l=this,u=[e,t],h=[r,i],c=[n,a],f=[o,s];this.addPoint(e,t),this.addPoint(o,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],v=3*h[d]-3*u[d];if(0!=m){var y=Math.pow(p,2)-4*v*m;if(!(y<0)){var g=(-p+Math.sqrt(y))/(2*m);0>8&255,255&e]},A.USHORT=U(2),k.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),k.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),k.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),k.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),k.FIXED=k.ULONG,A.FIXED=A.ULONG,k.FWORD=k.SHORT,A.FWORD=A.SHORT,k.UFWORD=k.USHORT,A.UFWORD=A.USHORT,k.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),k.TAG=function(e){return P.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),k.Card8=k.BYTE,A.Card8=A.BYTE,k.Card16=k.USHORT,A.Card16=A.USHORT,k.OffSize=k.BYTE,A.OffSize=A.BYTE,k.SID=k.USHORT,A.SID=A.USHORT,k.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?k.NUMBER16(e):k.NUMBER32(e)},A.NUMBER=function(e){return k.NUMBER(e).length},k.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),k.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),k.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",a=0,o=t.length;a>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};D.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var a="",o=0;o>8&255,l+256&255)}return a}k.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var a={},o=0;o>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var o=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*a),l=new se.Parser(r,i+n+16+4*a),u=new se.Parser(r,i+n+16+6*a),h=i+n+16+8*a,c=0;c>4,a=15&i;if(15==n)break;if(t+=r[n],15==a)break;t+=r[a]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Ee(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],a=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,E.length=0,L=!0}return function e(t){for(var r,i,n,a,o,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?P=f+E.shift():R=d+E.shift(),T.curveTo(g,b,_,x,l,u),T.curveTo(h,c,f,d,P,R);break;default:console.log("Glyph "+y.index+": unknown operator 1200"+m),E.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:o=E.pop()+v.gsubrsBias,(s=v.gsubrs[o])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var o=i.parseChar();r.names.push(i.parseString(o))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function vt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,a=e[n].tag;if(a===t)return n;a>>1,a=e[n];if(a===t)return n;a>>1,o=(r=e[a]).start;if(o===t)return r;o(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var o=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=Pt([s],l)[0],l.dx=o.x-s.x,l.dy=o.y-s.y,a=Pt(n.points,l)}t.points=t.points.concat(a)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:gt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),a={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(a),o.push(u),a.feature}}},getLookupTables:function(e,t,r,i,n){var a=this.getFeatureTable(e,t,r,n),o=[];if(a){for(var s,l=a.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function yr(e,t){var r=t.stack,i=r.pop(),n=t.fv,a=t.pv,o=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;T.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===o){var d=(15&f)-8;0<=d&&d++,T.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,a)}}}function gr(e,t){var r=t.stack,i=r.pop();T.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,a=t.deltaBase+16*(e-1),o=t.deltaShift;T.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*o;T.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,a=n.pop(),o=n.pop(),s=t.z2[a],l=t.z1[o];T.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",a,o),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;T.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var a=0;a":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+a.cvt[c]+","+u+")":"",f,"(d =",o,"->",l*s,")"),a.rp1=a.rp0,a.rp2=f,t&&(a.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,a,o,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,a=e.fv,o=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];T.DEBUG&&console.log(e.step,(1").concat(t,"");this.dummyDOM||(this.dummyDOM=document.getElementById(i).parentNode),this.descriptions?this.descriptions.fallbackElements||(this.descriptions.fallbackElements={}):this.descriptions={fallbackElements:{}},this.descriptions.fallbackElements[e]?this.descriptions.fallbackElements[e].innerHTML!==a&&(this.descriptions.fallbackElements[e].innerHTML=a):this._describeElementHTML("fallback",e,a),r===this.LABEL&&(this.descriptions.labelElements||(this.descriptions.labelElements={}),this.descriptions.labelElements[e]?this.descriptions.labelElements[e].innerHTML!==a&&(this.descriptions.labelElements[e].innerHTML=a):this._describeElementHTML("label",e,a))}},o.default.prototype._describeHTML=function(e,t){var r=this.canvas.id;if("fallback"===e){if(this.dummyDOM.querySelector("#".concat(r+l)))this.dummyDOM.querySelector("#"+r+h).insertAdjacentHTML("beforebegin",'

'));else{var i='

');this.dummyDOM.querySelector("#".concat(r,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(r,"accessibleOutput")).insertAdjacentHTML("beforebegin",i):this.dummyDOM.querySelector("#".concat(r)).innerHTML=i}return this.descriptions.fallback=this.dummyDOM.querySelector("#".concat(r).concat(u)),void(this.descriptions.fallback.innerHTML=t)}if("label"===e){if(this.dummyDOM.querySelector("#".concat(r+c)))this.dummyDOM.querySelector("#".concat(r+d))&&this.dummyDOM.querySelector("#".concat(r+d)).insertAdjacentHTML("beforebegin",'

'));else{var n='

');this.dummyDOM.querySelector("#".concat(r,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(r,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",n):this.dummyDOM.querySelector("#"+r).insertAdjacentHTML("afterend",n)}return this.descriptions.label=this.dummyDOM.querySelector("#"+r+f),void(this.descriptions.label.innerHTML=t)}},o.default.prototype._describeElementHTML=function(e,t,r){var i=this.canvas.id;if("fallback"===e){if(this.dummyDOM.querySelector("#".concat(i+l)))this.dummyDOM.querySelector("#"+i+h)||this.dummyDOM.querySelector("#"+i+u).insertAdjacentHTML("afterend",'
Canvas elements and their descriptions
'));else{var n='
Canvas elements and their descriptions
');this.dummyDOM.querySelector("#".concat(i,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(i,"accessibleOutput")).insertAdjacentHTML("beforebegin",n):this.dummyDOM.querySelector("#"+i).innerHTML=n}var a=document.createElement("tr");return a.id=i+"_fte_"+t,this.dummyDOM.querySelector("#"+i+h).appendChild(a),this.descriptions.fallbackElements[t]=this.dummyDOM.querySelector("#".concat(i).concat("_fte_").concat(t)),void(this.descriptions.fallbackElements[t].innerHTML=r)}if("label"===e){if(this.dummyDOM.querySelector("#".concat(i+c)))this.dummyDOM.querySelector("#".concat(i+d))||this.dummyDOM.querySelector("#"+i+f).insertAdjacentHTML("afterend",'
'));else{var o='
');this.dummyDOM.querySelector("#".concat(i,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(i,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",o):this.dummyDOM.querySelector("#"+i).insertAdjacentHTML("afterend",o)}var s=document.createElement("tr");s.id=i+"_lte_"+t,this.dummyDOM.querySelector("#"+i+d).appendChild(s),this.descriptions.labelElements[t]=this.dummyDOM.querySelector("#".concat(i).concat("_lte_").concat(t)),this.descriptions.labelElements[t].innerHTML=r}};var n=o.default;r.default=n},{"../core/main":36}],18:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,n=(i=e("../core/main"))&&i.__esModule?i:{default:i};n.default.prototype._updateGridOutput=function(e){if(this.dummyDOM.querySelector("#".concat(e,"_summary"))){var t=this._accessibleOutputs[e],r=function(e,t){var r="",i="",n=0;for(var a in t){var o=0;for(var s in t[a]){var l='
  • ').concat(t[a][s].color," ").concat(a,",");"line"===a?l+=" location = ".concat(t[a][s].pos,", length = ").concat(t[a][s].length," pixels"):(l+=" location = ".concat(t[a][s].pos),"point"!==a&&(l+=", area = ".concat(t[a][s].area," %")),l+="
  • "),r+=l,o++,n++}i=1').concat(t[o][s].color," ").concat(o,""):'').concat(t[o][s].color," ").concat(o," midpoint"),n[t[o][s].loc.locY][t[o][s].loc.locX]?n[t[o][s].loc.locY][t[o][s].loc.locX]=n[t[o][s].loc.locY][t[o][s].loc.locX]+" "+l:n[t[o][s].loc.locY][t[o][s].loc.locX]=l,r++}for(var u in n){var h="";for(var c in n[u])h+="",void 0!==n[u][c]&&(h+=n[u][c]),h+="";i=i+h+""}return i}(e,this.ingredients.shapes);i!==t.summary.innerHTML&&(t.summary.innerHTML=i),n!==t.map.innerHTML&&(t.map.innerHTML=n),r.details!==t.shapeDetails.innerHTML&&(t.shapeDetails.innerHTML=r.details),this._accessibleOutputs[e]=t}};var a=n.default;r.default=a},{"../core/main":36}],19:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,n=(i=e("../core/main"))&&i.__esModule?i:{default:i};function l(e,t,r){return e[0]<.4*t?e[1]<.4*r?"top left":e[1]>.6*r?"bottom left":"mid left":e[0]>.6*t?e[1]<.4*r?"top right":e[1]>.6*r?"bottom right":"mid right":e[1]<.4*r?"top middle":e[1]>.6*r?"bottom middle":"middle"}function u(e,t,r){var i=Math.floor(e[0]/t*10),n=Math.floor(e[1]/r*10);return 10===i&&--i,10===n&&--n,{locX:i,locY:n}}n.default.prototype.textOutput=function(e){n.default._validateParameters("textOutput",arguments),this._accessibleOutputs.text||(this._accessibleOutputs.text=!0,this._createOutput("textOutput","Fallback"),e===this.LABEL&&(this._accessibleOutputs.textLabel=!0,this._createOutput("textOutput","Label")))},n.default.prototype.gridOutput=function(e){n.default._validateParameters("gridOutput",arguments),this._accessibleOutputs.grid||(this._accessibleOutputs.grid=!0,this._createOutput("gridOutput","Fallback"),e===this.LABEL&&(this._accessibleOutputs.gridLabel=!0,this._createOutput("gridOutput","Label")))},n.default.prototype._addAccsOutput=function(){return this._accessibleOutputs||(this._accessibleOutputs={text:!1,grid:!1,textLabel:!1,gridLabel:!1}),this._accessibleOutputs.grid||this._accessibleOutputs.text},n.default.prototype._createOutput=function(e,t){var r,i,n,a=this.canvas.id;this.ingredients||(this.ingredients={shapes:{},colors:{background:"white",fill:"white",stroke:"black"},pShapes:""}),this.dummyDOM||(this.dummyDOM=document.getElementById(a).parentNode);var o="";"Fallback"===t?(r=a+e,i=a+"accessibleOutput",this.dummyDOM.querySelector("#".concat(i))||(this.dummyDOM.querySelector("#".concat(a,"_Description"))?this.dummyDOM.querySelector("#".concat(a,"_Description")).insertAdjacentHTML("afterend",'
    ')):this.dummyDOM.querySelector("#".concat(a)).innerHTML='
    '))):"Label"===t&&(r=a+e+(o=t),i=a+"accessibleOutput"+t,this.dummyDOM.querySelector("#".concat(i))||(this.dummyDOM.querySelector("#".concat(a,"_Label"))?this.dummyDOM.querySelector("#".concat(a,"_Label")).insertAdjacentHTML("afterend",'
    ')):this.dummyDOM.querySelector("#".concat(a)).insertAdjacentHTML("afterend",'
    ')))),this._accessibleOutputs[r]={},"textOutput"===e?(o="#".concat(a,"gridOutput").concat(o),n='
    Text Output

      '),this.dummyDOM.querySelector(o)?this.dummyDOM.querySelector(o).insertAdjacentHTML("beforebegin",n):this.dummyDOM.querySelector("#".concat(i)).innerHTML=n,this._accessibleOutputs[r].list=this.dummyDOM.querySelector("#".concat(r,"_list"))):"gridOutput"===e&&(o="#".concat(a,"textOutput").concat(o),n='
      Grid Output

        '),this.dummyDOM.querySelector(o)?this.dummyDOM.querySelector(o).insertAdjacentHTML("afterend",n):this.dummyDOM.querySelector("#".concat(i)).innerHTML=n,this._accessibleOutputs[r].map=this.dummyDOM.querySelector("#".concat(r,"_map"))),this._accessibleOutputs[r].shapeDetails=this.dummyDOM.querySelector("#".concat(r,"_shapeDetails")),this._accessibleOutputs[r].summary=this.dummyDOM.querySelector("#".concat(r,"_summary"))},n.default.prototype._updateAccsOutput=function(){var e=this.canvas.id;JSON.stringify(this.ingredients.shapes)!==this.ingredients.pShapes&&(this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this._accessibleOutputs.text&&this._updateTextOutput(e+"textOutput"),this._accessibleOutputs.grid&&this._updateGridOutput(e+"gridOutput"),this._accessibleOutputs.textLabel&&this._updateTextOutput(e+"textOutputLabel"),this._accessibleOutputs.gridLabel&&this._updateGridOutput(e+"gridOutputLabel"))},n.default.prototype._accsBackground=function(e){this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this.ingredients.shapes={},this.ingredients.colors.backgroundRGBA!==e&&(this.ingredients.colors.backgroundRGBA=e,this.ingredients.colors.background=this._rgbColorName(e))},n.default.prototype._accsCanvasColors=function(e,t){"fill"===e?this.ingredients.colors.fillRGBA!==t&&(this.ingredients.colors.fillRGBA=t,this.ingredients.colors.fill=this._rgbColorName(t)):"stroke"===e&&this.ingredients.colors.strokeRGBA!==t&&(this.ingredients.colors.strokeRGBA=t,this.ingredients.colors.stroke=this._rgbColorName(t))},n.default.prototype._accsOutput=function(e,t){"ellipse"===e&&t[2]===t[3]?e="circle":"rectangle"===e&&t[2]===t[3]&&(e="square");var r={},i=!0,n=function(e,t){var r,i;i="rectangle"===e||"ellipse"===e||"arc"===e||"circle"===e||"square"===e?(r=Math.round(t[0]+t[2]/2),Math.round(t[1]+t[3]/2)):"triangle"===e?(r=(t[0]+t[2]+t[4])/3,(t[1]+t[3]+t[5])/3):"quadrilateral"===e?(r=(t[0]+t[2]+t[4]+t[6])/4,(t[1]+t[3]+t[5]+t[7])/4):"line"===e?(r=(t[0]+t[2])/2,(t[1]+t[3])/2):(r=t[0],t[1]);return[r,i]}(e,t);if("line"===e){r.color=this.ingredients.colors.stroke,r.length=Math.round(this.dist(t[0],t[1],t[2],t[3]));var a=l([t[0],[1]],this.width,this.height),o=l([t[2],[3]],this.width,this.height);r.loc=u(n,this.width,this.height),r.pos=a===o?"at ".concat(a):"from ".concat(a," to ").concat(o)}else"point"===e?r.color=this.ingredients.colors.stroke:(r.color=this.ingredients.colors.fill,r.area=function(e,t,r,i){var n=0;if("arc"===e){var a=((t[5]-t[4])%(2*Math.PI)+2*Math.PI)%(2*Math.PI);if(n=a*t[2]*t[3]/8,"open"===t[6]||"chord"===t[6]){var o=t[0],s=t[1],l=t[0]+t[2]/2*Math.cos(t[4]).toFixed(2),u=t[1]+t[3]/2*Math.sin(t[4]).toFixed(2),h=t[0]+t[2]/2*Math.cos(t[5]).toFixed(2),c=t[1]+t[3]/2*Math.sin(t[5]).toFixed(2),f=Math.abs(o*(u-c)+l*(c-s)+h*(s-u))/2;a>Math.PI?n+=f:n-=f}}else"ellipse"===e||"circle"===e?n=3.14*t[2]/2*t[3]/2:"line"===e?n=0:"point"===e?n=0:"quadrilateral"===e?n=Math.abs((t[6]+t[0])*(t[7]-t[1])+(t[0]+t[2])*(t[1]-t[3])+(t[2]+t[4])*(t[3]-t[5])+(t[4]+t[6])*(t[5]-t[7]))/2:"rectangle"===e||"square"===e?n=t[2]*t[3]:"triangle"===e&&(n=Math.abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2);return Math.round(100*n/(r*i))}(e,t,this.width,this.height)),r.pos=l(n,this.width,this.height),r.loc=u(n,this.width,this.height);if(this.ingredients.shapes[e]){if(this.ingredients.shapes[e]!==[r]){for(var s in this.ingredients.shapes[e])JSON.stringify(this.ingredients.shapes[e][s])===JSON.stringify(r)&&(i=!1);!0===i&&this.ingredients.shapes[e].push(r)}}else this.ingredients.shapes[e]=[r]};var a=n.default;r.default=a},{"../core/main":36}],20:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,n=(i=e("../core/main"))&&i.__esModule?i:{default:i};n.default.prototype._updateTextOutput=function(e){if(this.dummyDOM.querySelector("#".concat(e,"_summary"))){var t=this._accessibleOutputs[e],r=function(e,t){var r="",i=0;for(var n in t)for(var a in t[n]){var o='
      • ').concat(t[n][a].color," ").concat(n,"");"line"===n?o+=", ".concat(t[n][a].pos,", ").concat(t[n][a].length," pixels long.
      • "):(o+=", at ".concat(t[n][a].pos),"point"!==n&&(o+=", covering ".concat(t[n][a].area,"% of the canvas")),o+="."),r+=o,i++}return{numShapes:i,listShapes:r}}(e,this.ingredients.shapes),i=function(e,t,r,i){var n="Your output is a, ".concat(r," by ").concat(i," pixels, ").concat(t," canvas containing the following");n=1===e?"".concat(n," shape:"):"".concat(n," ").concat(e," shapes:");return n}(r.numShapes,this.ingredients.colors.background,this.width,this.height),n=function(e,t){var r="",i=0;for(var n in t)for(var a in t[n]){var o='').concat(t[n][a].color," ").concat(n,"");"line"===n?o+="location = ".concat(t[n][a].pos,"length = ").concat(t[n][a].length," pixels"):(o+="location = ".concat(t[n][a].pos,""),"point"!==n&&(o+=" area = ".concat(t[n][a].area,"%")),o+=""),r+=o,i++}return r}(e,this.ingredients.shapes);i!==t.summary.innerHTML&&(t.summary.innerHTML=i),r.listShapes!==t.list.innerHTML&&(t.list.innerHTML=r.listShapes),n!==t.shapeDetails.innerHTML&&(t.shapeDetails.innerHTML=n),this._accessibleOutputs[e]=t}};var a=n.default;r.default=a},{"../core/main":36}],21:[function(e,t,r){"use strict";var i,n=(i=e("./core/main"))&&i.__esModule?i:{default:i};e("./core/constants"),e("./core/environment"),e("./core/friendly_errors/stacktrace"),e("./core/friendly_errors/validate_params"),e("./core/friendly_errors/file_errors"),e("./core/friendly_errors/fes_core"),e("./core/helpers"),e("./core/legacy"),e("./core/preload"),e("./core/p5.Element"),e("./core/p5.Graphics"),e("./core/p5.Renderer"),e("./core/p5.Renderer2D"),e("./core/rendering"),e("./core/shim"),e("./core/structure"),e("./core/transform"),e("./core/shape/2d_primitives"),e("./core/shape/attributes"),e("./core/shape/curves"),e("./core/shape/vertex"),e("./accessibility/outputs"),e("./accessibility/textOutput"),e("./accessibility/gridOutput"),e("./accessibility/color_namer"),e("./color/color_conversion"),e("./color/creating_reading"),e("./color/p5.Color"),e("./color/setting"),e("./data/p5.TypedDict"),e("./data/local_storage.js"),e("./dom/dom"),e("./accessibility/describe"),e("./events/acceleration"),e("./events/keyboard"),e("./events/mouse"),e("./events/touch"),e("./image/filters"),e("./image/image"),e("./image/loading_displaying"),e("./image/p5.Image"),e("./image/pixels"),e("./io/files"),e("./io/p5.Table"),e("./io/p5.TableRow"),e("./io/p5.XML"),e("./math/calculation"),e("./math/math"),e("./math/noise"),e("./math/p5.Vector"),e("./math/random"),e("./math/trigonometry"),e("./typography/attributes"),e("./typography/loading_displaying"),e("./typography/p5.Font"),e("./utilities/array_functions"),e("./utilities/conversion"),e("./utilities/string_functions"),e("./utilities/time_date"),e("./webgl/3d_primitives"),e("./webgl/interaction"),e("./webgl/light"),e("./webgl/loading"),e("./webgl/material"),e("./webgl/p5.Camera"),e("./webgl/p5.Geometry"),e("./webgl/p5.Matrix"),e("./webgl/p5.RendererGL.Immediate"),e("./webgl/p5.RendererGL"),e("./webgl/p5.RendererGL.Retained"),e("./webgl/p5.Shader"),e("./webgl/p5.RenderBuffer"),e("./webgl/p5.Texture"),e("./webgl/text"),e("./core/init"),t.exports=n.default},{"./accessibility/color_namer":16,"./accessibility/describe":17,"./accessibility/gridOutput":18,"./accessibility/outputs":19,"./accessibility/textOutput":20,"./color/color_conversion":22,"./color/creating_reading":23,"./color/p5.Color":24,"./color/setting":25,"./core/constants":26,"./core/environment":27,"./core/friendly_errors/fes_core":28,"./core/friendly_errors/file_errors":29,"./core/friendly_errors/stacktrace":30,"./core/friendly_errors/validate_params":31,"./core/helpers":32,"./core/init":33,"./core/legacy":35,"./core/main":36,"./core/p5.Element":37,"./core/p5.Graphics":38,"./core/p5.Renderer":39,"./core/p5.Renderer2D":40,"./core/preload":41,"./core/rendering":42,"./core/shape/2d_primitives":43,"./core/shape/attributes":44,"./core/shape/curves":45,"./core/shape/vertex":46,"./core/shim":47,"./core/structure":48,"./core/transform":49,"./data/local_storage.js":50,"./data/p5.TypedDict":51,"./dom/dom":52,"./events/acceleration":53,"./events/keyboard":54,"./events/mouse":55,"./events/touch":56,"./image/filters":57,"./image/image":58,"./image/loading_displaying":59,"./image/p5.Image":60,"./image/pixels":61,"./io/files":62,"./io/p5.Table":63,"./io/p5.TableRow":64,"./io/p5.XML":65,"./math/calculation":66,"./math/math":67,"./math/noise":68,"./math/p5.Vector":69,"./math/random":70,"./math/trigonometry":71,"./typography/attributes":72,"./typography/loading_displaying":73,"./typography/p5.Font":74,"./utilities/array_functions":75,"./utilities/conversion":76,"./utilities/string_functions":77,"./utilities/time_date":78,"./webgl/3d_primitives":79,"./webgl/interaction":80,"./webgl/light":81,"./webgl/loading":82,"./webgl/material":83,"./webgl/p5.Camera":84,"./webgl/p5.Geometry":85,"./webgl/p5.Matrix":86,"./webgl/p5.RenderBuffer":87,"./webgl/p5.RendererGL":90,"./webgl/p5.RendererGL.Immediate":88,"./webgl/p5.RendererGL.Retained":89,"./webgl/p5.Shader":91,"./webgl/p5.Texture":92,"./webgl/text":93}],22:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,n=(i=e("../core/main"))&&i.__esModule?i:{default:i};n.default.ColorConversion={},n.default.ColorConversion._hsbaToHSLA=function(e){var t=e[0],r=e[1],i=e[2],n=(2-r)*i/2;return 0!=n&&(1==n?r=0:n<.5?r/=2-r:r=r*i/(2-2*n)),[t,r,n,e[3]]},n.default.ColorConversion._hsbaToRGBA=function(e){var t=6*e[0],r=e[1],i=e[2],n=[];if(0===r)n=[i,i,i,e[3]];else{var a,o,s,l=Math.floor(t),u=i*(1-r),h=i*(1-r*(t-l)),c=i*(1-r*(1+l-t));s=1===l?(a=h,o=i,u):2===l?(a=u,o=i,c):3===l?(a=u,o=h,i):4===l?(a=c,o=u,i):5===l?(a=i,o=u,h):(a=i,o=c,u),n=[a,o,s,e[3]]}return n},n.default.ColorConversion._hslaToHSBA=function(e){var t,r=e[0],i=e[1],n=e[2];return[r,i=2*((t=n<.5?(1+i)*n:n+i-n*i)-n)/t,t,e[3]]},n.default.ColorConversion._hslaToRGBA=function(e){var t=6*e[0],r=e[1],i=e[2],n=[];if(0===r)n=[i,i,i,e[3]];else{var a,o=2*i-(a=i<.5?(1+r)*i:i+r-i*r),s=function(e,t,r){return e<0?e+=6:6<=e&&(e-=6),e<1?t+(r-t)*e:e<3?r:e<4?t+(r-t)*(4-e):t};n=[s(2+t,o,a),s(t,o,a),s(t-2,o,a),e[3]]}return n},n.default.ColorConversion._rgbaToHSBA=function(e){var t,r,i=e[0],n=e[1],a=e[2],o=Math.max(i,n,a),s=o-Math.min(i,n,a);return 0==s?r=t=0:(r=s/o,i===o?t=(n-a)/s:n===o?t=2+(a-i)/s:a===o&&(t=4+(i-n)/s),t<0?t+=6:6<=t&&(t-=6)),[t/6,r,o,e[3]]},n.default.ColorConversion._rgbaToHSLA=function(e){var t,r,i=e[0],n=e[1],a=e[2],o=Math.max(i,n,a),s=Math.min(i,n,a),l=o+s,u=o-s;return 0==u?r=t=0:(r=l<1?u/l:u/(2-l),i===o?t=(n-a)/u:n===o?t=2+(a-i)/u:a===o&&(t=4+(i-n)/u),t<0?t+=6:6<=t&&(t-=6)),[t/6,r,l/2,e[3]]};var a=n.default.ColorConversion;r.default=a},{"../core/main":36}],23:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,c=(i=e("../core/main"))&&i.__esModule?i:{default:i},f=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var a=i?Object.getOwnPropertyDescriptor(e,n):null;a&&(a.get||a.set)?Object.defineProperty(r,n,a):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}e("./p5.Color"),e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),c.default.prototype.alpha=function(e){return c.default._validateParameters("alpha",arguments),this.color(e)._getAlpha()},c.default.prototype.blue=function(e){return c.default._validateParameters("blue",arguments),this.color(e)._getBlue()},c.default.prototype.brightness=function(e){return c.default._validateParameters("brightness",arguments),this.color(e)._getBrightness()},c.default.prototype.color=function(){if(c.default._validateParameters("color",arguments),arguments[0]instanceof c.default.Color)return arguments[0];var e=arguments[0]instanceof Array?arguments[0]:arguments;return new c.default.Color(this,e)},c.default.prototype.green=function(e){return c.default._validateParameters("green",arguments),this.color(e)._getGreen()},c.default.prototype.hue=function(e){return c.default._validateParameters("hue",arguments),this.color(e)._getHue()},c.default.prototype.lerpColor=function(e,t,r){c.default._validateParameters("lerpColor",arguments);var i,n,a,o,s,l,u=this._colorMode,h=this._colorMaxes;if(u===f.RGB)s=e.levels.map(function(e){return e/255}),l=t.levels.map(function(e){return e/255});else if(u===f.HSB)e._getBrightness(),t._getBrightness(),s=e.hsba,l=t.hsba;else{if(u!==f.HSL)throw new Error("".concat(u,"cannot be used for interpolation."));e._getLightness(),t._getLightness(),s=e.hsla,l=t.hsla}return r=Math.max(Math.min(r,1),0),void 0===this.lerp&&(this.lerp=function(e,t,r){return r*(t-e)+e}),i=this.lerp(s[0],l[0],r),n=this.lerp(s[1],l[1],r),a=this.lerp(s[2],l[2],r),o=this.lerp(s[3],l[3],r),i*=h[u][0],n*=h[u][1],a*=h[u][2],o*=h[u][3],this.color(i,n,a,o)},c.default.prototype.lightness=function(e){return c.default._validateParameters("lightness",arguments),this.color(e)._getLightness()},c.default.prototype.red=function(e){return c.default._validateParameters("red",arguments),this.color(e)._getRed()},c.default.prototype.saturation=function(e){return c.default._validateParameters("saturation",arguments),this.color(e)._getSaturation()};var n=c.default;r.default=n},{"../core/constants":26,"../core/friendly_errors/fes_core":28,"../core/friendly_errors/file_errors":29,"../core/friendly_errors/validate_params":31,"../core/main":36,"./p5.Color":24}],24:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var c=i(e("../core/main")),f=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var a=i?Object.getOwnPropertyDescriptor(e,n):null;a&&(a.get||a.set)?Object.defineProperty(r,n,a):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants")),d=i(e("./color_conversion"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}c.default.Color=function(e,t){if(this._storeModeAndMaxes(e._colorMode,e._colorMaxes),this.mode!==f.RGB&&this.mode!==f.HSL&&this.mode!==f.HSB)throw new Error("".concat(this.mode," is an invalid colorMode."));return this._array=c.default.Color._parseInputs.apply(this,t),this._calculateLevels(),this},c.default.Color.prototype.toString=function(e){var t=this.levels,r=this._array,i=r[3];switch(e){case"#rrggbb":return"#".concat(t[0]<16?"0".concat(t[0].toString(16)):t[0].toString(16),t[1]<16?"0".concat(t[1].toString(16)):t[1].toString(16),t[2]<16?"0".concat(t[2].toString(16)):t[2].toString(16));case"#rrggbbaa":return"#".concat(t[0]<16?"0".concat(t[0].toString(16)):t[0].toString(16),t[1]<16?"0".concat(t[1].toString(16)):t[1].toString(16),t[2]<16?"0".concat(t[2].toString(16)):t[2].toString(16),t[3]<16?"0".concat(t[2].toString(16)):t[3].toString(16));case"#rgb":return"#".concat(Math.round(15*r[0]).toString(16),Math.round(15*r[1]).toString(16),Math.round(15*r[2]).toString(16));case"#rgba":return"#".concat(Math.round(15*r[0]).toString(16),Math.round(15*r[1]).toString(16),Math.round(15*r[2]).toString(16),Math.round(15*r[3]).toString(16));case"rgb":return"rgb(".concat(t[0],", ",t[1],", ",t[2],")");case"rgb%":return"rgb(".concat((100*r[0]).toPrecision(3),"%, ",(100*r[1]).toPrecision(3),"%, ",(100*r[2]).toPrecision(3),"%)");case"rgba%":return"rgba(".concat((100*r[0]).toPrecision(3),"%, ",(100*r[1]).toPrecision(3),"%, ",(100*r[2]).toPrecision(3),"%, ",(100*r[3]).toPrecision(3),"%)");case"hsb":case"hsv":return this.hsba||(this.hsba=d.default._rgbaToHSBA(this._array)),"hsb(".concat(this.hsba[0]*this.maxes[f.HSB][0],", ",this.hsba[1]*this.maxes[f.HSB][1],", ",this.hsba[2]*this.maxes[f.HSB][2],")");case"hsb%":case"hsv%":return this.hsba||(this.hsba=d.default._rgbaToHSBA(this._array)),"hsb(".concat((100*this.hsba[0]).toPrecision(3),"%, ",(100*this.hsba[1]).toPrecision(3),"%, ",(100*this.hsba[2]).toPrecision(3),"%)");case"hsba":case"hsva":return this.hsba||(this.hsba=d.default._rgbaToHSBA(this._array)),"hsba(".concat(this.hsba[0]*this.maxes[f.HSB][0],", ",this.hsba[1]*this.maxes[f.HSB][1],", ",this.hsba[2]*this.maxes[f.HSB][2],", ",i,")");case"hsba%":case"hsva%":return this.hsba||(this.hsba=d.default._rgbaToHSBA(this._array)),"hsba(".concat((100*this.hsba[0]).toPrecision(3),"%, ",(100*this.hsba[1]).toPrecision(3),"%, ",(100*this.hsba[2]).toPrecision(3),"%, ",(100*i).toPrecision(3),"%)");case"hsl":return this.hsla||(this.hsla=d.default._rgbaToHSLA(this._array)),"hsl(".concat(this.hsla[0]*this.maxes[f.HSL][0],", ",this.hsla[1]*this.maxes[f.HSL][1],", ",this.hsla[2]*this.maxes[f.HSL][2],")");case"hsl%":return this.hsla||(this.hsla=d.default._rgbaToHSLA(this._array)),"hsl(".concat((100*this.hsla[0]).toPrecision(3),"%, ",(100*this.hsla[1]).toPrecision(3),"%, ",(100*this.hsla[2]).toPrecision(3),"%)");case"hsla":return this.hsla||(this.hsla=d.default._rgbaToHSLA(this._array)),"hsla(".concat(this.hsla[0]*this.maxes[f.HSL][0],", ",this.hsla[1]*this.maxes[f.HSL][1],", ",this.hsla[2]*this.maxes[f.HSL][2],", ",i,")");case"hsla%":return this.hsla||(this.hsla=d.default._rgbaToHSLA(this._array)),"hsl(".concat((100*this.hsla[0]).toPrecision(3),"%, ",(100*this.hsla[1]).toPrecision(3),"%, ",(100*this.hsla[2]).toPrecision(3),"%, ",(100*i).toPrecision(3),"%)");case"rgba":default:return"rgba(".concat(t[0],",",t[1],",",t[2],",",i,")")}},c.default.Color.prototype.setRed=function(e){this._array[0]=e/this.maxes[f.RGB][0],this._calculateLevels()},c.default.Color.prototype.setGreen=function(e){this._array[1]=e/this.maxes[f.RGB][1],this._calculateLevels()},c.default.Color.prototype.setBlue=function(e){this._array[2]=e/this.maxes[f.RGB][2],this._calculateLevels()},c.default.Color.prototype.setAlpha=function(e){this._array[3]=e/this.maxes[this.mode][3],this._calculateLevels()},c.default.Color.prototype._calculateLevels=function(){for(var e=this._array,t=this.levels=new Array(e.length),r=e.length-1;0<=r;--r)t[r]=Math.round(255*e[r])},c.default.Color.prototype._getAlpha=function(){return this._array[3]*this.maxes[this.mode][3]},c.default.Color.prototype._storeModeAndMaxes=function(e,t){this.mode=e,this.maxes=t},c.default.Color.prototype._getMode=function(){return this.mode},c.default.Color.prototype._getMaxes=function(){return this.maxes},c.default.Color.prototype._getBlue=function(){return this._array[2]*this.maxes[f.RGB][2]},c.default.Color.prototype._getBrightness=function(){return this.hsba||(this.hsba=d.default._rgbaToHSBA(this._array)),this.hsba[2]*this.maxes[f.HSB][2]},c.default.Color.prototype._getGreen=function(){return this._array[1]*this.maxes[f.RGB][1]},c.default.Color.prototype._getHue=function(){return this.mode===f.HSB?(this.hsba||(this.hsba=d.default._rgbaToHSBA(this._array)),this.hsba[0]*this.maxes[f.HSB][0]):(this.hsla||(this.hsla=d.default._rgbaToHSLA(this._array)),this.hsla[0]*this.maxes[f.HSL][0])},c.default.Color.prototype._getLightness=function(){return this.hsla||(this.hsla=d.default._rgbaToHSLA(this._array)),this.hsla[2]*this.maxes[f.HSL][2]},c.default.Color.prototype._getRed=function(){return this._array[0]*this.maxes[f.RGB][0]},c.default.Color.prototype._getSaturation=function(){return this.mode===f.HSB?(this.hsba||(this.hsba=d.default._rgbaToHSBA(this._array)),this.hsba[1]*this.maxes[f.HSB][1]):(this.hsla||(this.hsla=d.default._rgbaToHSLA(this._array)),this.hsla[1]*this.maxes[f.HSL][1])};var p={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},n=/\s*/,a=/(\d{1,3})/,l=/((?:\d+(?:\.\d+)?)|(?:\.\d+))/,u=new RegExp("".concat(l.source,"%")),m={HEX3:/^#([a-f0-9])([a-f0-9])([a-f0-9])$/i,HEX4:/^#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])$/i,HEX6:/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i,HEX8:/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i,RGB:new RegExp(["^rgb\\(",a.source,",",a.source,",",a.source,"\\)$"].join(n.source),"i"),RGB_PERCENT:new RegExp(["^rgb\\(",u.source,",",u.source,",",u.source,"\\)$"].join(n.source),"i"),RGBA:new RegExp(["^rgba\\(",a.source,",",a.source,",",a.source,",",l.source,"\\)$"].join(n.source),"i"),RGBA_PERCENT:new RegExp(["^rgba\\(",u.source,",",u.source,",",u.source,",",l.source,"\\)$"].join(n.source),"i"),HSL:new RegExp(["^hsl\\(",a.source,",",u.source,",",u.source,"\\)$"].join(n.source),"i"),HSLA:new RegExp(["^hsla\\(",a.source,",",u.source,",",u.source,",",l.source,"\\)$"].join(n.source),"i"),HSB:new RegExp(["^hsb\\(",a.source,",",u.source,",",u.source,"\\)$"].join(n.source),"i"),HSBA:new RegExp(["^hsba\\(",a.source,",",u.source,",",u.source,",",l.source,"\\)$"].join(n.source),"i")};c.default.Color._parseInputs=function(e,t,r,i){var n,a=arguments.length,o=this.mode,s=this.maxes[o],l=[];if(3<=a){for(l[0]=e/s[0],l[1]=t/s[1],l[2]=r/s[2],l[3]="number"==typeof i?i/s[3]:1,n=l.length-1;0<=n;--n){var u=l[n];u<0?l[n]=0:1"].indexOf(n[0])?void 0:n[0],lineNumber:n[1],columnNumber:n[2],source:e}},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(i)},this).map(function(e){if(-1 eval")&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return{functionName:e};var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(e.replace(t,""));return{functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2],source:e}},this)},parseOpera:function(e){return!e.stacktrace||-1e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],n=2,a=r.length;n/,"$2").replace(/\([^)]*\)/g,"")||void 0;return n.match(/\(([^)]*)\)/)&&(t=n.replace(/^[^(]+\(([^)]*)\)$/,"$1")),{functionName:a,args:void 0===t||"[arguments not available]"===t?void 0:t.split(","),fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:e}},this)}}}n.default._getErrorStackParser=function(){return new a};var o=n.default;r.default=o},{"../main":36}],31:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,n=(i=e("../main"))&&i.__esModule?i:{default:i};(function(e){if(e&&e.__esModule)return;if(null===e||"object"!==s(e)&&"function"!=typeof e)return;var t=o();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var a=i?Object.getOwnPropertyDescriptor(e,n):null;a&&(a.get||a.set)?Object.defineProperty(r,n,a):r[n]=e[n]}r.default=e,t&&t.set(e,r)})(e("../constants")),e("../internationalization");function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.default._validateParameters=n.default._clearValidateParamsCache=function(){};var a=n.default;r.default=a},{"../../../docs/parameterData.json":void 0,"../constants":26,"../internationalization":34,"../main":36}],32:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var a=i?Object.getOwnPropertyDescriptor(e,n):null;a&&(a.get||a.set)?Object.defineProperty(r,n,a):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("./constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}var i={modeAdjust:function(e,t,r,i,n){return n===a.CORNER?{x:e,y:t,w:r,h:i}:n===a.CORNERS?{x:e,y:t,w:r-e,h:i-t}:n===a.RADIUS?{x:e-r,y:t-i,w:2*r,h:2*i}:n===a.CENTER?{x:e-.5*r,y:t-.5*i,w:r,h:i}:void 0}};r.default=i},{"./constants":26}],33:[function(e,t,r){"use strict";var i,n=(i=e("../core/main"))&&i.__esModule?i:{default:i};e("./internationalization");var a=Promise.resolve();Promise.all([new Promise(function(e,t){"complete"===document.readyState?e():window.addEventListener("load",e,!1)}),a]).then(function(){void 0===window._setupDone?window.mocha||(window.setup&&"function"==typeof window.setup||window.draw&&"function"==typeof window.draw)&&!n.default.instance&&new n.default:console.warn("p5.js seems to have been imported multiple times. Please remove the duplicate import")})},{"../core/main":36,"./internationalization":34}],34:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.initialize=r.translator=void 0;var a,o,i=s(e("i18next")),n=s(e("i18next-browser-languagedetector"));function s(e){return e&&e.__esModule?e:{default:e}}function l(e,t){for(var r=0;r=o.width||t>=o.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(o,e,t,r*a,i*a,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*T._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==T.NORMAL&&e!==T.ITALIC&&e!==T.BOLD&&e!==T.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var a,o,s,l,u,h,c,f,d,p=this._pInst,m=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),a=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tm||Math.abs(this.accelerationY-this.pAccelerationY)>m||Math.abs(this.accelerationZ-this.pAccelerationZ)>m)&&r.deviceMoved(),"function"==typeof r.deviceTurned){var i=this.rotationX+180,n=this.pRotationX+180,a=u+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],a+=x[255&C],r+=P[_],s++}w[l=E+g]=o/r,S[l]=i/r,M[l]=n/r,T[l]=a/r}E+=d}for(h=(u=-L)*d,b=E=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},D._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},D._createImageData=function(e,t){return D._tmpCanvas=document.createElement("canvas"),D._tmpCtx=D._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},D.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),a=t(n,r);a instanceof ImageData?i.putImageData(a,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},D.threshold=function(e,t){var r=D._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(o*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},D.dilate=function(e){for(var t,r,i,n,a,o,s,l,u,h,c,f,d,p,m,v,y,g=D._toPixels(e),b=0,_=g.length?g.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,a=m),a<(p=77*((h=D._getARGB(g,o))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,a=p),a<(v=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,a=v),a<(y=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,a=y),x[b++]=n;D._setPixels(g,x)},D.erode=function(e){for(var t,r,i,n,a,o,s,l,u,h,c,f,d,p,m,v,y,g=D._toPixels(e),b=0,_=g.length?g.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(a=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,a=m),(p=77*((h=D._getARGB(g,o))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=i){var n=Math.floor(t.timeDisplayed/i);if(t.timeDisplayed=0,t.lastChangeTime=r,t.displayIndex+=n,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var a=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[a].image,0,0),t.displayIndex=a,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),y.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==a[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
        "),n.print(""),n.print("")}n.close(),n.clear()},y.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";y.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});y.default.prototype.downloadFile(n,t,r)},y.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var a=document.createElement("a");if(a.href=e,a.download=n,a.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},a.style.display="none",document.body.appendChild(a),y.default.prototype._isSafari()){var o="Hello, Safari user! To download this file...\n";o+="1. Go to File --\x3e Save As.\n",o+='2. Choose "Page Source" as the Format.\n',o+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(o)}a.click()}},y.default.prototype._checkFileExtension=l,y.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var a=0;a<4096;a++)_[a]=n.rand()};var a=n.default;r.default=a},{"../core/main":36}],69:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},a=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var a=i?Object.getOwnPropertyDescriptor(e,n):null;a&&(a.get||a.set)?Object.defineProperty(r,n,a):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,a;a=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=a},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),a=parseFloat(e.z);h.call(this,i,n,a)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var o=Array.prototype.slice.call(arguments);o.every(function(e){return Number.isFinite(e)})&&2===o.length&&u.call(this,o[0],o[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e,t,r){if(e instanceof l.default.Vector)return Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z?(this.x*=e.x,this.y*=e.y,this.z*=e.z):console.warn("p5.Vector.prototype.mult:","x contains components that are either undefined or not finite numbers"),this;if(e instanceof Array)return e.every(function(e){return Number.isFinite(e)})&&e.every(function(e){return"number"==typeof e})?1===e.length?(this.x*=e[0],this.y*=e[0],this.z*=e[0]):2===e.length?(this.x*=e[0],this.y*=e[1]):3===e.length&&(this.x*=e[0],this.y*=e[1],this.z*=e[2]):console.warn("p5.Vector.prototype.mult:","x contains elements that are either undefined or not finite numbers"),this;var i=Array.prototype.slice.call(arguments);return i.every(function(e){return Number.isFinite(e)})&&i.every(function(e){return"number"==typeof e})?(1===arguments.length&&(this.x*=e,this.y*=e,this.z*=e),2===arguments.length&&(this.x*=e,this.y*=t),3===arguments.length&&(this.x*=e,this.y*=t,this.z*=r)):console.warn("p5.Vector.prototype.mult:","x, y, or z arguments are either undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z){if(0===e.x||0===e.y||0===e.z)return console.warn("p5.Vector.prototype.div:","divide by 0"),this;this.x/=e.x,this.y/=e.y,this.z/=e.z}else console.warn("p5.Vector.prototype.div:","x contains components that are either undefined or not finite numbers");return this}if(e instanceof Array){if(e.every(function(e){return Number.isFinite(e)})&&e.every(function(e){return"number"==typeof e})){if(e.some(function(e){return 0===e}))return console.warn("p5.Vector.prototype.div:","divide by 0"),this;1===e.length?(this.x/=e[0],this.y/=e[0],this.z/=e[0]):2===e.length?(this.x/=e[0],this.y/=e[1]):3===e.length&&(this.x/=e[0],this.y/=e[1],this.z/=e[2])}else console.warn("p5.Vector.prototype.div:","x contains components that are either undefined or not finite numbers");return this}var i=Array.prototype.slice.call(arguments);if(i.every(function(e){return Number.isFinite(e)})&&i.every(function(e){return"number"==typeof e})){if(i.some(function(e){return 0===e}))return console.warn("p5.Vector.prototype.div:","divide by 0"),this;1===arguments.length&&(this.x/=e,this.y/=e,this.z/=e),2===arguments.length&&(this.x/=e,this.y/=t),3===arguments.length&&(this.x/=e,this.y/=t,this.z/=r)}else console.warn("p5.Vector.prototype.div:","x, y, or z arguments are either undefined or not a finite number");return this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(a,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[a]?this._lcg(a):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var L=p,O=l,P=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var a=n.default;r.default=a},{"../core/main":36}],77:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,o=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),a=n.indexOf("."),o=-1!==a?n.substring(0,a):n,s=-1!==a?n.substring(a+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==a||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var a=t-(i+=-1===r?".":"").length+1,o=0;o=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(o,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new E.default.Geometry(u,1,function(){if(this.strokeIndices=[],o.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new E.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-o)*(e/u)+o,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new E.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(g>>10&31)/31):(r=o,i=s,l)}for(var b=new S.default.Vector(m,v,y),_=1;_<=3;_++){var x=p+12*_,w=new S.default.Vector(u.getFloat32(x,!0),u.getFloat32(4+x,!0),u.getFloat32(8+x,!0));e.vertices.push(w),e.vertexNormals.push(b),c&&a.push(r,i,n)}e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",a=[],o=0;oMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*o*Math.sin(s),h=Math.cos(l)*o,c=Math.sin(l)*o*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":36}],85:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,a=0;athis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._pInst._setProperty("drawingContext",this.drawingContext),this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=a.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=a.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:a.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=a.IMAGE,this.textureWrapX=a.CLAMP,this.textureWrapY=a.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,a=this._pInst instanceof u.default.Graphics;if(a){var o=this._pInst;o.canvas.parentNode.removeChild(o.canvas),o.canvas=document.createElement("canvas"),(o._pInst._userNode||document.body).appendChild(o.canvas),u.default.Element.call(o,o.canvas,o._pInst),o.width=r,o.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!a);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),a||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,a=t.levels[3]/255;this.GL.clearColor(r,i,n,a),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=a.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===a.DARKEST||e===a.LIGHTEST||e===a.ADD||e===a.BLEND||e===a.SUBTRACT||e===a.SCREEN||e===a.EXCLUSION||e===a.REPLACE||e===a.MULTIPLY||e===a.REMOVE?this.curBlendMode=e:e!==a.BURN&&e!==a.OVERLAY&&e!==a.HARD_LIGHT&&e!==a.SOFT_LIGHT&&e!==a.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._applyBlendMode(a.REMOVE),this._isErasing=!0,this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255])},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this._isErasing=!1,this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode))},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,a){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,a,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var a,o=t[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize*this._pInst._pixelDensity)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var a=new(i||Float32Array)(r);this.GL.bufferData(t,a,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:a,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var a=this._doStroke,o=this.drawMode;this._doStroke=!1,this.drawMode=k.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var v=!0,y=!1,g=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){b.value._prepareBuffer(p,d)}}catch(e){y=!0,g=e}finally{try{v||null==_.return||_.return()}finally{if(y)throw g}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,T=!1,E=void 0;try{for(var C,L=S[Symbol.iterator]();!(M=(C=L.next()).done);M=!0){var O=C.value;w&&(x+=s.getKerningValue(w,O));var P=l.getGlyphInfo(O);if(P.uGlyphRect){var R=P.rowInfo,D=P.colInfo;d.setUniform("uSamplerStrokes",P.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",D.cellImageInfo.imageData),d.setUniform("uSamplerCols",D.dimImageInfo.imageData),d.setUniform("uGridOffset",P.uGridOffset),d.setUniform("uGlyphRect",P.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=O.advanceWidth,w=O}}catch(e){T=!0,E=e}finally{try{M||null==L.return||L.return()}finally{if(T)throw E}}}finally{d.unbindShader(),this._doStroke=a,this.drawMode=o,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":26,"../core/main":36,"./p5.RendererGL.Retained":89,"./p5.Shader":91}]},{},[21])(21)});