diff --git a/ISN/P5js/assets/p5js.svg b/ISN/P5js/assets/p5js.svg new file mode 100644 index 0000000..eaf5b87 --- /dev/null +++ b/ISN/P5js/assets/p5js.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ISN/P5js/decouverte_p5js.html b/ISN/P5js/decouverte_p5js.html new file mode 100644 index 0000000..4231fa4 --- /dev/null +++ b/ISN/P5js/decouverte_p5js.html @@ -0,0 +1,108 @@ + +
+ + + + + + ++ + + + + + +
+ ++ Le but de ce TD est découvrir un nouveau langage: Javascript et d'explorer diverses façons de faire déplacer des objets. +
+ +
Documentations en français sur Javascript
+ ++ De manière générale, quand vous faites une recherche sur javascript ajouter le mot clé ES6 (ou supérieur). Ce sont les spécifications pour écrire correctement du javascript. +
+ +C'est la librairie javascript qui va nous permettre de créer des animations dans une page html.
+ + + ++ Pour faire fonctionner p5.js il faut avoir au minimum les 3 fichiers suivant dans la même répertoire: +
+ +
+ Vous trouverez un exemple dans le dossier ./exemple . +
+ +Les mouvements suivants sont a réaliser dans l'ordre que vous voulez. Copier le dossier ./template en le renommant puis éditer le fichier sketch.js pour réaliser le mouvement voulu.
+ ++ Difficulté: * + La balle se déplace en ligne droite. +
+ + + ++ Difficulté: ** + La balle fait des petits mouvements comme si elle vibrait de façon aléatoire. + P5.js met à disposition une fonction random pour générer un nombre aléatoire entre 0 et 1. +
+ + ++ Difficulté: ** + La balle se déplace en ligne droite, quand elle atteint un bord elle réapparait sur le bord opposé. + L'opérateur javascript modulo ou reste par la division euclidienne (%) est pratique pour ce genre de situation. +
+ + ++ Difficulté: ** + La balle se déplace en ligne droite, quand elle atteint un bord elle rebondit. +
+ + ++ Difficulté: *** + La balle a un mouvement périodique de bas en haut (pensez aux fonctions périodiques que vous connaissez). +
+ + ++ Difficulté: *** + La balle décrit un cercle autour d'un point (pensez au cercle trigonométrique). +
+ + ++ Difficulté: **** + La balle est lancée dans une direction avec une vitesse initial et est soumis à la gravitation pour retomber (pensez à vos cours de physique). +
+ + + + diff --git a/ISN/P5js/exemple/index.html b/ISN/P5js/exemple/index.html new file mode 100644 index 0000000..ec42b9d --- /dev/null +++ b/ISN/P5js/exemple/index.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/ISN/P5js/exemple/p5.min.js b/ISN/P5js/exemple/p5.min.js new file mode 100644 index 0000000..3d8d702 --- /dev/null +++ b/ISN/P5js/exemple/p5.min.js @@ -0,0 +1,13 @@ +/*! p5.js v0.6.1 April 27, 2018 */ !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.p5=a()}}(function(){var a;return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g123 are reserved for internal usage");n|=1<0?af.make(G):void 0,J=nf.make(),K=Ye.make(a.glyphs,{version:a.getEnglishName("version"),fullName:C,familyName:A,weightName:B,postScriptName:D,unitsPerEm:a.unitsPerEm,fontBBox:[0,t.yMin,t.ascender,t.advanceWidthMax]}),L=a.metas&&Object.keys(a.metas).length>0?sf.make(a.metas):void 0,M=[u,v,w,x,H,z,J,K,y];I&&M.push(I),a.tables.gsub&&M.push(rf.make(a.tables.gsub)),L&&M.push(L);for(var N=wb(M),O=N.encode(),P=ub(O),Q=N.fields,R=!1,S=0;S >>1,f=a[e].tag;if(f===b)return e;f>>1,f=a[e];if(f===b)return e;f=176&&c<=183)e+=c-176+1;else if(c>=184&&c<=191)e+=2*(c-184+1);else if(b&&1===f&&27===c)break}while(f>0);a.ip=e}function Xb(b,c){a.DEBUG&&console.log(c.step,"SVTCA["+b.axis+"]"),c.fv=c.pv=c.dpv=b}function Yb(b,c){a.DEBUG&&console.log(c.step,"SPVTCA["+b.axis+"]"),c.pv=c.dpv=b}function Zb(b,c){a.DEBUG&&console.log(c.step,"SFVTCA["+b.axis+"]"),c.fv=b}function $b(b,c){var d=c.stack,e=d.pop(),f=d.pop(),g=c.z2[e],h=c.z1[f];a.DEBUG&&console.log("SPVTL["+b+"]",e,f);var i,j;b?(i=g.y-h.y,j=h.x-g.x):(i=h.x-g.x,j=h.y-g.y),c.pv=c.dpv=Sb(i,j)}function _b(b,c){var d=c.stack,e=d.pop(),f=d.pop(),g=c.z2[e],h=c.z1[f];a.DEBUG&&console.log("SFVTL["+b+"]",e,f);var i,j;b?(i=g.y-h.y,j=h.x-g.x):(i=h.x-g.x,j=h.y-g.y),c.fv=Sb(i,j)}function ac(b){var c=b.stack,d=c.pop(),e=c.pop();a.DEBUG&&console.log(b.step,"SPVFS[]",d,e),b.pv=b.dpv=Sb(e,d)}function bc(b){var c=b.stack,d=c.pop(),e=c.pop();a.DEBUG&&console.log(b.step,"SPVFS[]",d,e),b.fv=Sb(e,d)}function cc(b){var c=b.stack,d=b.pv;a.DEBUG&&console.log(b.step,"GPV[]"),c.push(16384*d.x),c.push(16384*d.y)}function dc(b){var c=b.stack,d=b.fv;a.DEBUG&&console.log(b.step,"GFV[]"),c.push(16384*d.x),c.push(16384*d.y)}function ec(b){b.fv=b.pv,a.DEBUG&&console.log(b.step,"SFVTPV[]")}function fc(b){var c=b.stack,d=c.pop(),e=c.pop(),f=c.pop(),g=c.pop(),h=c.pop(),i=b.z0,j=b.z1,k=i[d],l=i[e],m=j[f],n=j[g],o=b.z2[h];a.DEBUG&&console.log("ISECT[], ",d,e,f,g,h);var p=k.x,q=k.y,r=l.x,s=l.y,t=m.x,u=m.y,v=n.x,w=n.y,x=(p-r)*(u-w)-(q-s)*(t-v),y=p*s-q*r,z=t*w-u*v;o.x=(y*(t-v)-z*(p-r))/x,o.y=(y*(u-w)-z*(q-s))/x}function gc(b){b.rp0=b.stack.pop(),a.DEBUG&&console.log(b.step,"SRP0[]",b.rp0)}function hc(b){b.rp1=b.stack.pop(),a.DEBUG&&console.log(b.step,"SRP1[]",b.rp1)}function ic(b){b.rp2=b.stack.pop(),a.DEBUG&&console.log(b.step,"SRP2[]",b.rp2)}function jc(b){var c=b.stack.pop();switch(a.DEBUG&&console.log(b.step,"SZP0[]",c),b.zp0=c,c){case 0:b.tZone||Vb(b),b.z0=b.tZone;break;case 1:b.z0=b.gZone;break;default:throw new Error("Invalid zone pointer")}}function kc(b){var c=b.stack.pop();switch(a.DEBUG&&console.log(b.step,"SZP1[]",c),b.zp1=c,c){case 0:b.tZone||Vb(b),b.z1=b.tZone;break;case 1:b.z1=b.gZone;break;default:throw new Error("Invalid zone pointer")}}function lc(b){var c=b.stack.pop();switch(a.DEBUG&&console.log(b.step,"SZP2[]",c),b.zp2=c,c){case 0:b.tZone||Vb(b),b.z2=b.tZone;break;case 1:b.z2=b.gZone;break;default:throw new Error("Invalid zone pointer")}}function mc(b){var c=b.stack.pop();switch(a.DEBUG&&console.log(b.step,"SZPS[]",c),b.zp0=b.zp1=b.zp2=c,c){case 0:b.tZone||Vb(b),b.z0=b.z1=b.z2=b.tZone;break;case 1:b.z0=b.z1=b.z2=b.gZone;break;default:throw new Error("Invalid zone pointer")}}function nc(b){b.loop=b.stack.pop(),a.DEBUG&&console.log(b.step,"SLOOP[]",b.loop)}function oc(b){a.DEBUG&&console.log(b.step,"RTG[]"),b.round=Mb}function pc(b){a.DEBUG&&console.log(b.step,"RTHG[]"),b.round=Ob}function qc(b){var c=b.stack.pop();a.DEBUG&&console.log(b.step,"SMD[]",c),b.minDis=c/64}function rc(b){a.DEBUG&&console.log(b.step,"ELSE[]"),Wb(b,!1)}function sc(b){var c=b.stack.pop();a.DEBUG&&console.log(b.step,"JMPR[]",c),b.ip+=c-1}function tc(b){var c=b.stack.pop();a.DEBUG&&console.log(b.step,"SCVTCI[]",c),b.cvCutIn=c/64}function uc(b){var c=b.stack;a.DEBUG&&console.log(b.step,"DUP[]"),c.push(c[c.length-1])}function vc(b){a.DEBUG&&console.log(b.step,"POP[]"),b.stack.pop()}function wc(b){a.DEBUG&&console.log(b.step,"CLEAR[]"),b.stack.length=0}function xc(b){var c=b.stack,d=c.pop(),e=c.pop();a.DEBUG&&console.log(b.step,"SWAP[]"),c.push(d),c.push(e)}function yc(b){var c=b.stack;a.DEBUG&&console.log(b.step,"DEPTH[]"),c.push(c.length)}function zc(b){var c=b.stack,d=c.pop(),e=c.pop();a.DEBUG&&console.log(b.step,"LOOPCALL[]",d,e);var f=b.ip,g=b.prog;b.prog=b.funcs[d];for(var h=0;h 1?"loop "+(c.loop-i)+": ":"")+"SHP["+(b?"rp1":"rp2")+"]",k)}c.loop=1}function Hc(b,c){var d=c.stack,e=b?c.rp1:c.rp2,f=(b?c.z0:c.z1)[e],g=c.fv,h=c.pv,i=d.pop(),j=c.z2[c.contours[i]],k=j;a.DEBUG&&console.log(c.step,"SHC["+b+"]",i);var l=h.distance(f,f,!1,!0);do{k!==f&&g.setRelative(k,k,l,h),k=k.nextPointOnContour}while(k!==j)}function Ic(b,c){var d=c.stack,e=b?c.rp1:c.rp2,f=(b?c.z0:c.z1)[e],g=c.fv,h=c.pv,i=d.pop();a.DEBUG&&console.log(c.step,"SHZ["+b+"]",i);var j;switch(i){case 0:j=c.tZone;break;case 1:j=c.gZone;break;default:throw new Error("Invalid zone")}for(var k,l=h.distance(f,f,!1,!0),m=j.length-2,n=0;n 1?"loop "+(b.loop-d)+": ":"")+"SHPIX[]",h,f),e.setRelative(i,i,f),e.touch(i)}b.loop=1}function Kc(b){for(var c=b.stack,d=b.rp1,e=b.rp2,f=b.loop,g=b.z0[d],h=b.z1[e],i=b.fv,j=b.dpv,k=b.z2;f--;){var l=c.pop(),m=k[l];a.DEBUG&&console.log(b.step,(b.loop>1?"loop "+(b.loop-f)+": ":"")+"IP[]",l,d,"<->",e),i.interpolate(m,g,h,j),i.touch(m)}b.loop=1}function Lc(b,c){var d=c.stack,e=d.pop()/64,f=d.pop(),g=c.z1[f],h=c.z0[c.rp0],i=c.fv,j=c.pv;i.setRelative(g,h,e,j),i.touch(g),a.DEBUG&&console.log(c.step,"MSIRP["+b+"]",e,f),c.rp1=c.rp0,c.rp2=f,b&&(c.rp0=f)}function Mc(b){for(var c=b.stack,d=b.rp0,e=b.z0[d],f=b.loop,g=b.fv,h=b.pv,i=b.z1;f--;){var j=c.pop(),k=i[j];a.DEBUG&&console.log(b.step,(b.loop>1?"loop "+(b.loop-f)+": ":"")+"ALIGNRP[]",j),g.setRelative(k,e,0,h),g.touch(k)}b.loop=1}function Nc(b){a.DEBUG&&console.log(b.step,"RTDG[]"),b.round=Nb}function Oc(b,c){var d=c.stack,e=d.pop(),f=d.pop(),g=c.z0[f],h=c.fv,i=c.pv,j=c.cvt[e];b&&(j=c.round(j)),a.DEBUG&&console.log(c.step,"MIAP["+b+"]",e,"(",j,")",f),h.setRelative(g,Bf,j,i),0===c.zp0&&(g.xo=g.x,g.yo=g.y),h.touch(g),c.rp0=c.rp1=f}function Pc(b){var c=b.prog,d=b.ip,e=b.stack,f=c[++d];a.DEBUG&&console.log(b.step,"NPUSHB[]",f);for(var g=0;g ",i),c.stack.push(Math.round(64*i))}function Xc(b){a.DEBUG&&console.log(b.step,"MPPEM[]"),b.stack.push(b.ppem)}function Yc(b){a.DEBUG&&console.log(b.step,"FLIPON[]"),b.autoFlip=!0}function Zc(b){var c=b.stack,d=c.pop(),e=c.pop();a.DEBUG&&console.log(b.step,"LT[]",d,e),c.push(e d?1:0)}function ad(b){var c=b.stack,d=c.pop(),e=c.pop();a.DEBUG&&console.log(b.step,"GTEQ[]",d,e),c.push(e>=d?1:0)}function bd(b){var c=b.stack,d=c.pop(),e=c.pop();a.DEBUG&&console.log(b.step,"EQ[]",d,e),c.push(d===e?1:0)}function cd(b){var c=b.stack,d=c.pop(),e=c.pop();a.DEBUG&&console.log(b.step,"NEQ[]",d,e),c.push(d!==e?1:0)}function dd(b){var c=b.stack,d=c.pop();a.DEBUG&&console.log(b.step,"ODD[]",d),c.push(Math.trunc(d)%2?1:0)}function ed(b){var c=b.stack,d=c.pop();a.DEBUG&&console.log(b.step,"EVEN[]",d),c.push(Math.trunc(d)%2?0:1)}function fd(b){var c,d=b.stack.pop();a.DEBUG&&console.log(b.step,"IF[]",d),d||(Wb(b,!0),a.DEBUG&&console.log(b.step,27===c?"ELSE[]":"EIF[]"))}function gd(b){a.DEBUG&&console.log(b.step,"EIF[]")}function hd(b){var c=b.stack,d=c.pop(),e=c.pop();a.DEBUG&&console.log(b.step,"AND[]",d,e),c.push(d&&e?1:0)}function id(b){var c=b.stack,d=c.pop(),e=c.pop();a.DEBUG&&console.log(b.step,"OR[]",d,e),c.push(d||e?1:0)}function jd(b){var c=b.stack,d=c.pop();a.DEBUG&&console.log(b.step,"NOT[]",d),c.push(d?0:1)}function kd(b,c){var d=c.stack,e=d.pop(),f=c.fv,g=c.pv,h=c.ppem,i=c.deltaBase+16*(b-1),j=c.deltaShift,k=c.z0;a.DEBUG&&console.log(c.step,"DELTAP["+b+"]",e,d);for(var l=0;l >4)===h){var o=(15&n)-8;o>=0&&o++,a.DEBUG&&console.log(c.step,"DELTAPFIX",m,"by",o*j);var p=k[m];f.setRelative(p,p,o*j,g)}}}function ld(b){var c=b.stack,d=c.pop();a.DEBUG&&console.log(b.step,"SDB[]",d),b.deltaBase=d}function md(b){var c=b.stack,d=c.pop();a.DEBUG&&console.log(b.step,"SDS[]",d),b.deltaShift=Math.pow(.5,d)}function nd(b){var c=b.stack,d=c.pop(),e=c.pop();a.DEBUG&&console.log(b.step,"ADD[]",d,e),c.push(e+d)}function od(b){var c=b.stack,d=c.pop(),e=c.pop();a.DEBUG&&console.log(b.step,"SUB[]",d,e),c.push(e-d)}function pd(b){var c=b.stack,d=c.pop(),e=c.pop();a.DEBUG&&console.log(b.step,"DIV[]",d,e),c.push(64*e/d)}function qd(b){var c=b.stack,d=c.pop(),e=c.pop();a.DEBUG&&console.log(b.step,"MUL[]",d,e),c.push(e*d/64)}function rd(b){var c=b.stack,d=c.pop();a.DEBUG&&console.log(b.step,"ABS[]",d),c.push(Math.abs(d))}function sd(b){var c=b.stack,d=c.pop();a.DEBUG&&console.log(b.step,"NEG[]",d),c.push(-d)}function td(b){var c=b.stack,d=c.pop();a.DEBUG&&console.log(b.step,"FLOOR[]",d),c.push(64*Math.floor(d/64))}function ud(b){var c=b.stack,d=c.pop();a.DEBUG&&console.log(b.step,"CEILING[]",d),c.push(64*Math.ceil(d/64))}function vd(b,c){var d=c.stack,e=d.pop();a.DEBUG&&console.log(c.step,"ROUND[]"),d.push(64*c.round(e/64))}function wd(b){var c=b.stack,d=c.pop(),e=c.pop();a.DEBUG&&console.log(b.step,"WCVTF[]",d,e),b.cvt[e]=d*b.ppem/b.font.unitsPerEm}function xd(b,c){var d=c.stack,e=d.pop(),f=c.ppem,g=c.deltaBase+16*(b-1),h=c.deltaShift;a.DEBUG&&console.log(c.step,"DELTAC["+b+"]",e,d);for(var i=0;i >4)===f){var l=(15&k)-8;l>=0&&l++;var m=l*h;a.DEBUG&&console.log(c.step,"DELTACFIX",j,"by",m),c.cvt[j]+=m}}}function yd(b){var c=b.stack.pop();a.DEBUG&&console.log(b.step,"SROUND[]",c),b.round=yf;var d;switch(192&c){case 0:d=.5;break;case 64:d=1;break;case 128:d=2;break;default:throw new Error("invalid SROUND value")}switch(b.srPeriod=d,48&c){case 0:b.srPhase=0;break;case 16:b.srPhase=.25*d;break;case 32:b.srPhase=.5*d;break;case 48:b.srPhase=.75*d;break;default:throw new Error("invalid SROUND value")}c&=15,b.srThreshold=0===c?0:(c/8-.5)*d}function zd(b){var c=b.stack.pop();a.DEBUG&&console.log(b.step,"S45ROUND[]",c),b.round=yf;var d;switch(192&c){case 0:d=Math.sqrt(2)/2;break;case 64:d=Math.sqrt(2);break;case 128:d=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(b.srPeriod=d,48&c){case 0:b.srPhase=0;break;case 16:b.srPhase=.25*d;break;case 32:b.srPhase=.5*d;break;case 48:b.srPhase=.75*d;break;default:throw new Error("invalid S45ROUND value")}c&=15,b.srThreshold=0===c?0:(c/8-.5)*d}function Ad(b){a.DEBUG&&console.log(b.step,"ROFF[]"),b.round=Lb}function Bd(b){a.DEBUG&&console.log(b.step,"RUTG[]"),b.round=Pb}function Cd(b){a.DEBUG&&console.log(b.step,"RDTG[]"),b.round=Qb}function Dd(b){var c=b.stack.pop();a.DEBUG&&console.log(b.step,"SCANCTRL[]",c)}function Ed(b,c){var d=c.stack,e=d.pop(),f=d.pop(),g=c.z2[e],h=c.z1[f];a.DEBUG&&console.log("SDPVTL["+b+"]",e,f);var i,j;b?(i=g.y-h.y,j=h.x-g.x):(i=h.x-g.x,j=h.y-g.y),c.dpv=Sb(i,j)}function Fd(b){var c=b.stack,d=c.pop(),e=0;a.DEBUG&&console.log(b.step,"GETINFO[]",d),1&d&&(e=35),32&d&&(e|=4096),c.push(e)}function Gd(b){var c=b.stack,d=c.pop(),e=c.pop(),f=c.pop();a.DEBUG&&console.log(b.step,"ROLL[]"),c.push(e),c.push(d),c.push(f)}function Hd(b){var c=b.stack,d=c.pop(),e=c.pop();a.DEBUG&&console.log(b.step,"MAX[]",d,e),c.push(Math.max(e,d))}function Id(b){var c=b.stack,d=c.pop(),e=c.pop();a.DEBUG&&console.log(b.step,"MIN[]",d,e),c.push(Math.min(e,d))}function Jd(b){var c=b.stack.pop();a.DEBUG&&console.log(b.step,"SCANTYPE[]",c)}function Kd(b){var c=b.stack.pop(),d=b.stack.pop();switch(a.DEBUG&&console.log(b.step,"INSTCTRL[]",c,d),c){case 1:return void(b.inhibitGridFit=!!d);case 2:return void(b.ignoreCvt=!!d);default:throw new Error("invalid INSTCTRL[] selector")}}function Ld(b,c){var d=c.stack,e=c.prog,f=c.ip;a.DEBUG&&console.log(c.step,"PUSHB["+b+"]");for(var g=0;g=0?1:-1,i=Math.abs(i),b&&(k=g.cvt[m],e&&Math.abs(i-k) ":"_")+(e?"R":"_")+(0===f?"Gr":1===f?"Bl":2===f?"Wh":"")+"]",b?m+"("+g.cvt[m]+","+k+")":"",n,"(d =",h,"->",j*i,")"),g.rp1=g.rp0,g.rp2=n,c&&(g.rp0=n)}function Od(a){a=a||{},a.empty||(Jb(a.familyName,"When creating a new Font object, familyName is required."),Jb(a.styleName,"When creating a new Font object, styleName is required."),Jb(a.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),Jb(a.ascender,"When creating a new Font object, ascender is required."), +Jb(a.descender,"When creating a new Font object, descender is required."),Jb(a.descender<0,"Descender should be negative (e.g. -512)."),this.names={fontFamily:{en:a.familyName||" "},fontSubfamily:{en:a.styleName||" "},fullName:{en:a.fullName||a.familyName+" "+a.styleName},postScriptName:{en:a.postScriptName||a.familyName+a.styleName},designer:{en:a.designer||" "},designerURL:{en:a.designerURL||" "},manufacturer:{en:a.manufacturer||" "},manufacturerURL:{en:a.manufacturerURL||" "},license:{en:a.license||" "},licenseURL:{en:a.licenseURL||" "},version:{en:a.version||"Version 0.1"},description:{en:a.description||" "},copyright:{en:a.copyright||" "},trademark:{en:a.trademark||" "}},this.unitsPerEm=a.unitsPerEm||1e3,this.ascender=a.ascender,this.descender=a.descender,this.createdTimestamp=a.createdTimestamp,this.tables={os2:{usWeightClass:a.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:a.widthClass||this.usWidthClasses.MEDIUM,fsSelection:a.fsSelection||this.fsSelectionValues.REGULAR}}),this.supported=!0,this.glyphs=new Ve.GlyphSet(this,a.glyphs||[]),this.encoding=new X(this),this.substitution=new Db(this),this.tables=this.tables||{},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:"truetype"===this.outlinesFormat?this._hinting=new Kb(this):void 0}})}function Pd(a,b){var c=JSON.stringify(a),d=256;for(var e in b){var f=parseInt(e);if(f&&!(f<256)){if(JSON.stringify(b[e])===c)return f;d<=f&&(d=f+1)}}return b[d]=a,d}function Qd(a,b,c){var d=Pd(b.name,c);return[{name:"tag_"+a,type:"TAG",value:b.tag},{name:"minValue_"+a,type:"FIXED",value:b.minValue<<16},{name:"defaultValue_"+a,type:"FIXED",value:b.defaultValue<<16},{name:"maxValue_"+a,type:"FIXED",value:b.maxValue<<16},{name:"flags_"+a,type:"USHORT",value:0},{name:"nameID_"+a,type:"USHORT",value:d}]}function Rd(a,b,c){var d={},e=new Ne.Parser(a,b);return d.tag=e.parseTag(),d.minValue=e.parseFixed(),d.defaultValue=e.parseFixed(),d.maxValue=e.parseFixed(),e.skip("uShort",1),d.name=c[e.parseUShort()]||{},d}function Sd(a,b,c,d){for(var e=Pd(b.name,d),f=[{name:"nameID_"+a,type:"USHORT",value:e},{name:"flags_"+a,type:"USHORT",value:0}],g=0;g >1;a1&&console.warn("Only the first kern subtable is supported."),a.skip("uLong");var c=a.parseUShort(),d=255&c;if(a.skip("uShort"),0===d){var e=a.parseUShort();a.skip("uShort",3);for(var f=0;f this.x2&&(this.x2=a)),"number"==typeof b&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=b,this.y2=b),b this.y2&&(this.y2=b))},q.prototype.addX=function(a){this.addPoint(a,null)},q.prototype.addY=function(a){this.addPoint(null,a)},q.prototype.addBezier=function(a,b,c,d,e,f,g,h){var i=this,j=[a,b],k=[c,d],l=[e,f],m=[g,h];this.addPoint(a,b),this.addPoint(g,h);for(var n=0;n<=1;n++){var o=6*j[n]-12*k[n]+6*l[n],q=-3*j[n]+9*k[n]-9*l[n]+3*m[n],r=3*k[n]-3*j[n];if(0!==q){var s=Math.pow(o,2)-4*r*q;if(!(s<0)){var t=(-o+Math.sqrt(s))/(2*q);0 =0&&d>0&&(c+=" "),c+=b(e)}return c}var d=this;a=void 0!==a?a:2;for(var e="",f=0;f "},r.prototype.toDOMElement=function(a){var b=this.toPathData(a),c=document.createElementNS("http://www.w3.org/2000/svg","path");return c.setAttribute("d",b),c};var ze={fail:s,argument:t,assert:t},Ae=32768,Be=2147483648,Ce={},De={},Ee={};De.BYTE=function(a){return ze.argument(a>=0&&a<=255,"Byte value should be between 0 and 255."),[a]},Ee.BYTE=u(1),De.CHAR=function(a){return[a.charCodeAt(0)]},Ee.CHAR=u(1),De.CHARARRAY=function(a){for(var b=[],c=0;c >8&255,255&a]},Ee.USHORT=u(2),De.SHORT=function(a){return a>=Ae&&(a=-(2*Ae-a)),[a>>8&255,255&a]},Ee.SHORT=u(2),De.UINT24=function(a){return[a>>16&255,a>>8&255,255&a]},Ee.UINT24=u(3),De.ULONG=function(a){return[a>>24&255,a>>16&255,a>>8&255,255&a]},Ee.ULONG=u(4),De.LONG=function(a){return a>=Be&&(a=-(2*Be-a)),[a>>24&255,a>>16&255,a>>8&255,255&a]},Ee.LONG=u(4),De.FIXED=De.ULONG,Ee.FIXED=Ee.ULONG,De.FWORD=De.SHORT,Ee.FWORD=Ee.SHORT,De.UFWORD=De.USHORT,Ee.UFWORD=Ee.USHORT,De.LONGDATETIME=function(a){return[0,0,0,0,a>>24&255,a>>16&255,a>>8&255,255&a]},Ee.LONGDATETIME=u(8),De.TAG=function(a){return ze.argument(4===a.length,"Tag should be exactly 4 ASCII characters."),[a.charCodeAt(0),a.charCodeAt(1),a.charCodeAt(2),a.charCodeAt(3)]},Ee.TAG=u(4),De.Card8=De.BYTE,Ee.Card8=Ee.BYTE,De.Card16=De.USHORT,Ee.Card16=Ee.USHORT,De.OffSize=De.BYTE,Ee.OffSize=Ee.BYTE,De.SID=De.USHORT,Ee.SID=Ee.USHORT,De.NUMBER=function(a){return a>=-107&&a<=107?[a+139]:a>=108&&a<=1131?(a-=108,[247+(a>>8),255&a]):a>=-1131&&a<=-108?(a=-a-108,[251+(a>>8),255&a]):a>=-32768&&a<=32767?De.NUMBER16(a):De.NUMBER32(a)},Ee.NUMBER=function(a){return De.NUMBER(a).length},De.NUMBER16=function(a){return[28,a>>8&255,255&a]},Ee.NUMBER16=u(3),De.NUMBER32=function(a){return[29,a>>24&255,a>>16&255,a>>8&255,255&a]},Ee.NUMBER32=u(5),De.REAL=function(a){var b=a.toString(),c=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(b);if(c){var d=parseFloat("1e"+((c[2]?+c[2]:0)+c[1].length));b=(Math.round(a*d)/d).toString()}for(var e="",f=0,g=b.length;f >8&255,b[b.length]=255&d}return b},Ee.UTF16=function(a){return 2*a.length};var Fe={"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":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};Ce.MACSTRING=function(a,b,c,d){var e=Fe[d];if(void 0!==e){for(var f="",g=0;g =128&&void 0===(f=c[f]))return;d[e]=f}return d}},Ee.MACSTRING=function(a,b){var c=De.MACSTRING(a,b);return void 0!==c?c.length:0},De.VARDELTAS=function(a){for(var b=0,c=[];b =-128&&d<=127?x(a,b,c):y(a,b,c)}return c},De.INDEX=function(a){for(var b=1,c=[b],d=[],e=0;e >8,b[l+1]=255&m,b=b.concat(d[k])}return b},Ee.TABLE=function(a){for(var b=0,c=a.fields.length,d=0;d 0)return new Q(this.data,this.offset+b).parseStruct(a)},Q.prototype.parseListOfLists=function(a){for(var b=this,c=this.parseOffset16List(),d=c.length,e=this.relativeOffset,f=new Array(d),g=0;g =0)return d[e].script;if(b){var f={tag:a,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return d.splice(-1-e,0,f),f.script}}},getLangSysTable:function(a,b,c){var d=this.getScriptTable(a,c);if(d){if(!b||"dflt"===b||"DFLT"===b)return d.defaultLangSys;var e=Ab(d.langSysRecords,b);if(e>=0)return d.langSysRecords[e].langSys;if(c){var f={tag:b,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return d.langSysRecords.splice(-1-e,0,f),f.langSys}}},getFeatureTable:function(a,b,c,d){var e=this.getLangSysTable(a,b,d);if(e){for(var f,g=e.featureIndexes,h=this.font.tables[this.tableName].features,i=0;i =h[j-1].tag,"Features must be added in alphabetical order."),f={tag:c,feature:{params:0,lookupListIndexes:[]}},h.push(f),g.push(j),f.feature}}},getLookupTables:function(a,b,c,d,e){var f=this.getFeatureTable(a,b,c,e),g=[];if(f){for(var h,i=f.lookupListIndexes,j=this.font.tables[this.tableName].lookups,k=0;k =0){for(var k=f.ligatureSets[j],l=0;l 0&&a<0?c:e<0&&a>0?-c:a*e},zf={x:1,y:0,axis:"x",distance:function(a,b,c,d){return(c?a.xo:a.x)-(d?b.xo:b.x)},interpolate:function(a,b,c,d){var e,f,g,h,i,j,k;return d&&d!==this?(e=d.distance(a,b,!0,!0),f=d.distance(a,c,!0,!0),i=d.distance(b,b,!1,!0),j=d.distance(c,c,!1,!0),g=Math.abs(e),h=Math.abs(f),0===(k=g+h)?void zf.setRelative(a,a,(i+j)/2,d,!0):void zf.setRelative(a,a,(i*h+j*g)/k,d,!0)):(e=a.xo-b.xo,f=a.xo-c.xo,i=b.x-b.xo,j=c.x-c.xo,g=Math.abs(e),h=Math.abs(f),0===(k=g+h)?void(a.x=a.xo+(i+j)/2):void(a.x=a.xo+(i*h+j*g)/k))},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(a,b,c,d,e){if(!d||d===this)return void(a.x=(e?b.xo:b.x)+c);var f=e?b.xo:b.x,g=e?b.yo:b.y,h=f+c*d.x,i=g+c*d.y;a.x=h+(a.y-i)/d.normalSlope},slope:0,touch:function(a){a.xTouched=!0},touched:function(a){return a.xTouched},untouch:function(a){a.xTouched=!1}},Af={x:0,y:1,axis:"y",distance:function(a,b,c,d){return(c?a.yo:a.y)-(d?b.yo:b.y)},interpolate:function(a,b,c,d){var e,f,g,h,i,j,k;return d&&d!==this?(e=d.distance(a,b,!0,!0),f=d.distance(a,c,!0,!0),i=d.distance(b,b,!1,!0),j=d.distance(c,c,!1,!0),g=Math.abs(e),h=Math.abs(f),0===(k=g+h)?void Af.setRelative(a,a,(i+j)/2,d,!0):void Af.setRelative(a,a,(i*h+j*g)/k,d,!0)):(e=a.yo-b.yo,f=a.yo-c.yo,i=b.y-b.yo,j=c.y-c.yo,g=Math.abs(e),h=Math.abs(f),0===(k=g+h)?void(a.y=a.yo+(i+j)/2):void(a.y=a.yo+(i*h+j*g)/k))},normalSlope:0,setRelative:function(a,b,c,d,e){if(!d||d===this)return void(a.y=(e?b.yo:b.y)+c);var f=e?b.xo:b.x,g=e?b.yo:b.y,h=f+c*d.x,i=g+c*d.y;a.y=i+d.normalSlope*(a.x-h)},slope:Number.POSITIVE_INFINITY,touch:function(a){a.yTouched=!0},touched:function(a){return a.yTouched},untouch:function(a){a.yTouched=!1}};Object.freeze(zf),Object.freeze(Af),Rb.prototype.distance=function(a,b,c,d){return this.x*zf.distance(a,b,c,d)+this.y*Af.distance(a,b,c,d)},Rb.prototype.interpolate=function(a,b,c,d){var e,f,g,h,i,j,k;if(g=d.distance(a,b,!0,!0),h=d.distance(a,c,!0,!0),e=d.distance(b,b,!1,!0),f=d.distance(c,c,!1,!0),i=Math.abs(g),j=Math.abs(h),0===(k=i+j))return void this.setRelative(a,a,(e+f)/2,d,!0);this.setRelative(a,a,(e*j+f*i)/k,d,!0)},Rb.prototype.setRelative=function(a,b,c,d,e){d=d||this;var f=e?b.xo:b.x,g=e?b.yo:b.y,h=f+c*d.x,i=g+c*d.y,j=d.normalSlope,k=this.slope,l=a.x,m=a.y;a.x=(k*l-j*h+i-m)/(k-j),a.y=k*(a.x-l)+m},Rb.prototype.touch=function(a){a.xTouched=!0,a.yTouched=!0},Tb.prototype.nextTouched=function(a){for(var b=this.nextPointOnContour;!a.touched(b)&&b!==this;)b=b.nextPointOnContour;return b},Tb.prototype.prevTouched=function(a){for(var b=this.prevPointOnContour;!a.touched(b)&&b!==this;)b=b.prevPointOnContour;return b};var Bf=Object.freeze(new Tb(0,0)),Cf={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};Kb.prototype.exec=function(b,c){if("number"!=typeof c)throw new Error("Point size is not a number!");if(!(this._errorState>2)){var d=this.font,e=this._prepState;if(!e||e.ppem!==c){var f=this._fpgmState;if(!f){Ub.prototype=Cf,f=this._fpgmState=new Ub("fpgm",d.tables.fpgm),f.funcs=[],f.font=d,a.DEBUG&&(console.log("---EXEC FPGM---"),f.step=-1);try{vf(f)}catch(a){return console.log("Hinting error in FPGM:"+a),void(this._errorState=3)}}Ub.prototype=f,e=this._prepState=new Ub("prep",d.tables.prep),e.ppem=c;var g=d.tables.cvt;if(g)for(var h=e.cvt=new Array(g.length),i=c/d.unitsPerEm,j=0;j 1))try{return wf(b,e)}catch(a){return this._errorState<1&&(console.log("Hinting error:"+a),console.log("Note: further hinting errors are silenced")),void(this._errorState=1)}}},wf=function(b,c){var d,e,f,g=c.ppem/c.font.unitsPerEm,h=g,i=b.components;if(Ub.prototype=c,i){var j=c.font;e=[],d=[];for(var k=0;k 0,"No English "+b+" specified.")}var c=[],d=this;b("fontFamily"),b("weightName"),b("manufacturer"),b("copyright"),b("version"),a(this.unitsPerEm>0,"No unitsPerEm specified.")},Od.prototype.toTables=function(){return tf.fontToTable(this)},Od.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},Od.prototype.toArrayBuffer=function(){for(var a=this.toTables(),b=a.encode(),c=new ArrayBuffer(b.length),d=new Uint8Array(c),e=0;e 1)for(var c=1;c -1?b:a}function n(a,b){b=b||{};var c=b.body;if(a instanceof n){if(a.bodyUsed)throw new TypeError("Already read");this.url=a.url,this.credentials=a.credentials,b.headers||(this.headers=new e(a.headers)),this.method=a.method,this.mode=a.mode,c||null==a._bodyInit||(c=a._bodyInit,a.bodyUsed=!0)}else this.url=String(a);if(this.credentials=b.credentials||this.credentials||"omit",!b.headers&&this.headers||(this.headers=new e(b.headers)),this.method=m(b.method||this.method||"GET"),this.mode=b.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&c)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(c)}function o(a){var b=new FormData;return a.trim().split("&").forEach(function(a){if(a){var c=a.split("="),d=c.shift().replace(/\+/g," "),e=c.join("=").replace(/\+/g," ");b.append(decodeURIComponent(d),decodeURIComponent(e))}}),b}function p(a){var b=new e;return a.split(/\r?\n/).forEach(function(a){var c=a.split(":"),d=c.shift().trim();if(d){var e=c.join(":").trim();b.append(d,e)}}),b}function q(a,b){b||(b={}),this.type="default",this.status="status"in b?b.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in b?b.statusText:"OK",this.headers=new e(b.headers),this.url=b.url||"",this._initBody(a)}if(!a.fetch){var r={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch(a){return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};if(r.arrayBuffer)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],t=function(a){return a&&DataView.prototype.isPrototypeOf(a)},u=ArrayBuffer.isView||function(a){return a&&s.indexOf(Object.prototype.toString.call(a))>-1};e.prototype.append=function(a,d){a=b(a),d=c(d);var e=this.map[a];this.map[a]=e?e+","+d:d},e.prototype.delete=function(a){delete this.map[b(a)]},e.prototype.get=function(a){return a=b(a),this.has(a)?this.map[a]:null},e.prototype.has=function(a){return this.map.hasOwnProperty(b(a))},e.prototype.set=function(a,d){this.map[b(a)]=c(d)},e.prototype.forEach=function(a,b){for(var c in this.map)this.map.hasOwnProperty(c)&&a.call(b,this.map[c],c,this)},e.prototype.keys=function(){var a=[];return this.forEach(function(b,c){a.push(c)}),d(a)},e.prototype.values=function(){var a=[];return this.forEach(function(b){a.push(b)}),d(a)},e.prototype.entries=function(){var a=[];return this.forEach(function(b,c){a.push([c,b])}),d(a)},r.iterable&&(e.prototype[Symbol.iterator]=e.prototype.entries);var v=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];n.prototype.clone=function(){return new n(this,{body:this._bodyInit})},l.call(n.prototype),l.call(q.prototype),q.prototype.clone=function(){return new q(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new e(this.headers),url:this.url})},q.error=function(){var a=new q(null,{status:0,statusText:""});return a.type="error",a};var w=[301,302,303,307,308];q.redirect=function(a,b){if(-1===w.indexOf(b))throw new RangeError("Invalid status code");return new q(null,{status:b,headers:{location:a}})},a.Headers=e,a.Request=n,a.Response=q,a.fetch=function(a,b){return new Promise(function(c,d){var e=new n(a,b),f=new XMLHttpRequest;f.onload=function(){var a={status:f.status,statusText:f.statusText,headers:p(f.getAllResponseHeaders()||"")};a.url="responseURL"in f?f.responseURL:a.headers.get("X-Request-URL");var b="response"in f?f.response:f.responseText;c(new q(b,a))},f.onerror=function(){d(new TypeError("Network request failed"))},f.ontimeout=function(){d(new TypeError("Network request failed"))},f.open(e.method,e.url,!0),"include"===e.credentials&&(f.withCredentials=!0),"responseType"in f&&r.blob&&(f.responseType="blob"),e.headers.forEach(function(a,b){f.setRequestHeader(b,a)}),f.send(void 0===e._bodyInit?null:e._bodyInit)})},a.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},{}],12:[function(a,b,c){"use strict";var d=a("./core/core");a("./color/p5.Color"),a("./core/p5.Element"),a("./typography/p5.Font"),a("./core/p5.Graphics"),a("./core/p5.Renderer2D"),a("./image/p5.Image"),a("./math/p5.Vector"),a("./io/p5.TableRow"),a("./io/p5.Table"),a("./io/p5.XML"),a("./color/creating_reading"),a("./color/setting"),a("./core/constants"),a("./utilities/conversion"),a("./utilities/array_functions"),a("./utilities/string_functions"),a("./core/environment"),a("./image/image"),a("./image/loading_displaying"),a("./image/pixels"),a("./io/files"),a("./events/keyboard"),a("./events/acceleration"),a("./events/mouse"),a("./utilities/time_date"),a("./events/touch"),a("./math/math"),a("./math/calculation"),a("./math/random"),a("./math/noise"),a("./math/trigonometry"),a("./core/rendering"),a("./core/2d_primitives"),a("./core/attributes"),a("./core/curves"),a("./core/vertex"),a("./core/structure"),a("./core/transform"),a("./typography/attributes"),a("./typography/loading_displaying"),a("./data/p5.TypedDict"),a("./webgl/p5.RendererGL"),a("./webgl/p5.Geometry"),a("./webgl/p5.RendererGL.Retained"),a("./webgl/p5.RendererGL.Immediate"),a("./webgl/primitives"),a("./webgl/loading"),a("./webgl/p5.Matrix"),a("./webgl/material"),a("./webgl/light"),a("./webgl/p5.Shader"),a("./webgl/camera"),a("./webgl/interaction"),a("./core/init.js"),b.exports=d},{"./color/creating_reading":14,"./color/p5.Color":15,"./color/setting":16,"./core/2d_primitives":17,"./core/attributes":18,"./core/constants":20,"./core/core":21,"./core/curves":22,"./core/environment":23,"./core/init.js":25,"./core/p5.Element":26,"./core/p5.Graphics":27,"./core/p5.Renderer2D":29,"./core/rendering":30,"./core/structure":32,"./core/transform":33,"./core/vertex":34,"./data/p5.TypedDict":35,"./events/acceleration":36,"./events/keyboard":37,"./events/mouse":38,"./events/touch":39,"./image/image":41,"./image/loading_displaying":42,"./image/p5.Image":43,"./image/pixels":44,"./io/files":45,"./io/p5.Table":46,"./io/p5.TableRow":47,"./io/p5.XML":48,"./math/calculation":49,"./math/math":50,"./math/noise":51,"./math/p5.Vector":52,"./math/random":53,"./math/trigonometry":54,"./typography/attributes":55,"./typography/loading_displaying":56,"./typography/p5.Font":57,"./utilities/array_functions":58,"./utilities/conversion":59,"./utilities/string_functions":60,"./utilities/time_date":61,"./webgl/camera":62,"./webgl/interaction":63,"./webgl/light":64,"./webgl/loading":65,"./webgl/material":66,"./webgl/p5.Geometry":67,"./webgl/p5.Matrix":68,"./webgl/p5.RendererGL":71,"./webgl/p5.RendererGL.Immediate":69,"./webgl/p5.RendererGL.Retained":70,"./webgl/p5.Shader":72,"./webgl/primitives":74}],13:[function(a,b,c){"use strict";var d=a("../core/core");d.ColorConversion={},d.ColorConversion._hsbaToHSLA=function(a){var b=a[0],c=a[1],d=a[2],e=(2-c)*d/2;return 0!==e&&(1===e?c=0:e<.5?c/=2-c:c=c*d/(2-2*e)),[b,c,e,a[3]]},d.ColorConversion._hsbaToRGBA=function(a){var b=6*a[0],c=a[1],d=a[2],e=[];if(0===c)e=[d,d,d,a[3]];else{var f,g,h,i=Math.floor(b),j=d*(1-c),k=d*(1-c*(b-i)),l=d*(1-c*(1+i-b));1===i?(f=k,g=d,h=j):2===i?(f=j,g=d,h=l):3===i?(f=j,g=k,h=d):4===i?(f=l,g=j,h=d):5===i?(f=d,g=j,h=k):(f=d,g=l,h=j),e=[f,g,h,a[3]]}return e},d.ColorConversion._hslaToHSBA=function(a){var b,c=a[0],d=a[1],e=a[2];return b=e<.5?(1+d)*e:e+d-e*d,d=2*(b-e)/b,[c,d,b,a[3]]},d.ColorConversion._hslaToRGBA=function(a){var b=6*a[0],c=a[1],d=a[2],e=[];if(0===c)e=[d,d,d,a[3]];else{var f;f=d<.5?(1+c)*d:d+c-d*c;var g=2*d-f,h=function(a,b,c){return a<0?a+=6:a>=6&&(a-=6),a<1?b+(c-b)*a:a<3?c:a<4?b+(c-b)*(4-a):b};e=[h(b+2,g,f),h(b,g,f),h(b-2,g,f),a[3]]}return e},d.ColorConversion._rgbaToHSBA=function(a){var b,c,d=a[0],e=a[1],f=a[2],g=Math.max(d,e,f),h=g-Math.min(d,e,f);return 0===h?(b=0,c=0):(c=h/g,d===g?b=(e-f)/h:e===g?b=2+(f-d)/h:f===g&&(b=4+(d-e)/h),b<0?b+=6:b>=6&&(b-=6)),[b/6,c,g,a[3]]},d.ColorConversion._rgbaToHSLA=function(a){var b,c,d=a[0],e=a[1],f=a[2],g=Math.max(d,e,f),h=Math.min(d,e,f),i=g+h,j=g-h;return 0===j?(b=0,c=0):(c=i<1?j/i:j/(2-i),d===g?b=(e-f)/j:e===g?b=2+(f-d)/j:f===g&&(b=4+(d-e)/j),b<0?b+=6:b>=6&&(b-=6)),[b/6,c,i/2,a[3]]},b.exports=d.ColorConversion},{"../core/core":21}],14:[function(a,b,c){"use strict";var d=a("../core/core"),e=a("../core/constants");a("./p5.Color"),a("../core/error_helpers"),d.prototype.alpha=function(a){return d._validateParameters("alpha",arguments),this.color(a)._getAlpha()},d.prototype.blue=function(a){return d._validateParameters("blue",arguments),this.color(a)._getBlue()},d.prototype.brightness=function(a){return d._validateParameters("brightness",arguments),this.color(a)._getBrightness()},d.prototype.color=function(){if(d._validateParameters("color",arguments),arguments[0]instanceof d.Color)return arguments[0];var a=arguments[0]instanceof Array?arguments[0]:arguments;return new d.Color(this,a)},d.prototype.green=function(a){return d._validateParameters("green",arguments),this.color(a)._getGreen()},d.prototype.hue=function(a){return d._validateParameters("hue",arguments),this.color(a)._getHue()},d.prototype.lerpColor=function(a,b,c){d._validateParameters("lerpColor",arguments);var f,g,h,i,j,k,l=this._colorMode,m=this._colorMaxes;if(l===e.RGB)j=a.levels.map(function(a){return a/255}),k=b.levels.map(function(a){return a/255});else if(l===e.HSB)a._getBrightness(),b._getBrightness(),j=a.hsba,k=b.hsba;else{if(l!==e.HSL)throw new Error(l+"cannot be used for interpolation.");a._getLightness(),b._getLightness(),j=a.hsla,k=b.hsla}return c=Math.max(Math.min(c,1),0),void 0===this.lerp&&(this.lerp=function(a,b,c){return c*(b-a)+a}),f=this.lerp(j[0],k[0],c),g=this.lerp(j[1],k[1],c),h=this.lerp(j[2],k[2],c),i=this.lerp(j[3],k[3],c),f*=m[l][0],g*=m[l][1],h*=m[l][2],i*=m[l][3],this.color(f,g,h,i)},d.prototype.lightness=function(a){return d._validateParameters("lightness",arguments),this.color(a)._getLightness()},d.prototype.red=function(a){return d._validateParameters("red",arguments),this.color(a)._getRed()},d.prototype.saturation=function(a){return d._validateParameters("saturation",arguments),this.color(a)._getSaturation()},b.exports=d},{"../core/constants":20,"../core/core":21,"../core/error_helpers":24,"./p5.Color":15}],15:[function(a,b,c){"use strict";var d=a("../core/core"),e=a("../core/constants"),f=a("./color_conversion");d.Color=function(a,b){if(this._storeModeAndMaxes(a._colorMode,a._colorMaxes),this.mode!==e.RGB&&this.mode!==e.HSL&&this.mode!==e.HSB)throw new Error(this.mode+" is an invalid colorMode.");return this._array=d.Color._parseInputs.apply(this,b),this._calculateLevels(),this},d.Color.prototype.toString=function(a){ +this.hsba||(this.hsba=f._rgbaToHSBA(this._array)),this.hsla||(this.hsla=f._rgbaToHSLA(this._array));var b=this.levels,c=this._array,d=c[3];switch(a){case"#rrggbb":return"#".concat(b[0]<16?"0".concat(b[0].toString(16)):b[0].toString(16),b[1]<16?"0".concat(b[1].toString(16)):b[1].toString(16),b[2]<16?"0".concat(b[2].toString(16)):b[2].toString(16));case"#rrggbbaa":return"#".concat(b[0]<16?"0".concat(b[0].toString(16)):b[0].toString(16),b[1]<16?"0".concat(b[1].toString(16)):b[1].toString(16),b[2]<16?"0".concat(b[2].toString(16)):b[2].toString(16),b[3]<16?"0".concat(b[2].toString(16)):b[3].toString(16));case"#rgb":return"#".concat(Math.round(15*c[0]).toString(16),Math.round(15*c[1]).toString(16),Math.round(15*c[2]).toString(16));case"#rgba":return"#".concat(Math.round(15*c[0]).toString(16),Math.round(15*c[1]).toString(16),Math.round(15*c[2]).toString(16),Math.round(15*c[3]).toString(16));case"rgb":return"rgb(".concat(b[0],", ",b[1],", ",b[2],")");case"rgb%":return"rgb(".concat((100*c[0]).toPrecision(3),"%, ",(100*c[1]).toPrecision(3),"%, ",(100*c[2]).toPrecision(3),"%)");case"rgba%":return"rgba(".concat((100*c[0]).toPrecision(3),"%, ",(100*c[1]).toPrecision(3),"%, ",(100*c[2]).toPrecision(3),"%, ",(100*c[3]).toPrecision(3),"%)");case"hsb":case"hsv":return"hsb(".concat(this.hsba[0]*this.maxes[e.HSB][0],", ",this.hsba[1]*this.maxes[e.HSB][1],", ",this.hsba[2]*this.maxes[e.HSB][2],")");case"hsb%":case"hsv%":return"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"hsba(".concat(this.hsba[0]*this.maxes[e.HSB][0],", ",this.hsba[1]*this.maxes[e.HSB][1],", ",this.hsba[2]*this.maxes[e.HSB][2],", ",d,")");case"hsba%":case"hsva%":return"hsba(".concat((100*this.hsba[0]).toPrecision(3),"%, ",(100*this.hsba[1]).toPrecision(3),"%, ",(100*this.hsba[2]).toPrecision(3),"%, ",(100*d).toPrecision(3),"%)");case"hsl":return"hsl(".concat(this.hsla[0]*this.maxes[e.HSL][0],", ",this.hsla[1]*this.maxes[e.HSL][1],", ",this.hsla[2]*this.maxes[e.HSL][2],")");case"hsl%":return"hsl(".concat((100*this.hsla[0]).toPrecision(3),"%, ",(100*this.hsla[1]).toPrecision(3),"%, ",(100*this.hsla[2]).toPrecision(3),"%)");case"hsla":return"hsla(".concat(this.hsla[0]*this.maxes[e.HSL][0],", ",this.hsla[1]*this.maxes[e.HSL][1],", ",this.hsla[2]*this.maxes[e.HSL][2],", ",d,")");case"hsla%":return"hsl(".concat((100*this.hsla[0]).toPrecision(3),"%, ",(100*this.hsla[1]).toPrecision(3),"%, ",(100*this.hsla[2]).toPrecision(3),"%, ",(100*d).toPrecision(3),"%)");case"rgba":default:return"rgba("+b[0]+","+b[1]+","+b[2]+","+d+")"}},d.Color.prototype.setRed=function(a){this._array[0]=a/this.maxes[e.RGB][0],this._calculateLevels()},d.Color.prototype.setGreen=function(a){this._array[1]=a/this.maxes[e.RGB][1],this._calculateLevels()},d.Color.prototype.setBlue=function(a){this._array[2]=a/this.maxes[e.RGB][2],this._calculateLevels()},d.Color.prototype.setAlpha=function(a){this._array[3]=a/this.maxes[this.mode][3],this._calculateLevels()},d.Color.prototype._calculateLevels=function(){this.levels=this._array.map(function(a){return Math.round(255*a)})},d.Color.prototype._getAlpha=function(){return this._array[3]*this.maxes[this.mode][3]},d.Color.prototype._storeModeAndMaxes=function(a,b){this.mode=a,this.maxes=b},d.Color.prototype._getMode=function(){return this.mode},d.Color.prototype._getMaxes=function(){return this.maxes},d.Color.prototype._getBlue=function(){return this._array[2]*this.maxes[e.RGB][2]},d.Color.prototype._getBrightness=function(){return this.hsba||(this.hsba=f._rgbaToHSBA(this._array)),this.hsba[2]*this.maxes[e.HSB][2]},d.Color.prototype._getGreen=function(){return this._array[1]*this.maxes[e.RGB][1]},d.Color.prototype._getHue=function(){return this.mode===e.HSB?(this.hsba||(this.hsba=f._rgbaToHSBA(this._array)),this.hsba[0]*this.maxes[e.HSB][0]):(this.hsla||(this.hsla=f._rgbaToHSLA(this._array)),this.hsla[0]*this.maxes[e.HSL][0])},d.Color.prototype._getLightness=function(){return this.hsla||(this.hsla=f._rgbaToHSLA(this._array)),this.hsla[2]*this.maxes[e.HSL][2]},d.Color.prototype._getRed=function(){return this._array[0]*this.maxes[e.RGB][0]},d.Color.prototype._getSaturation=function(){return this.mode===e.HSB?(this.hsba||(this.hsba=f._rgbaToHSBA(this._array)),this.hsba[1]*this.maxes[e.HSB][1]):(this.hsla||(this.hsla=f._rgbaToHSLA(this._array)),this.hsla[1]*this.maxes[e.HSL][1])};var g={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",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"},h=/\s*/,i=/(\d{1,3})/,j=/((?:\d+(?:\.\d+)?)|(?:\.\d+))/,k=new RegExp(j.source+"%"),l={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\\(",i.source,",",i.source,",",i.source,"\\)$"].join(h.source),"i"),RGB_PERCENT:new RegExp(["^rgb\\(",k.source,",",k.source,",",k.source,"\\)$"].join(h.source),"i"),RGBA:new RegExp(["^rgba\\(",i.source,",",i.source,",",i.source,",",j.source,"\\)$"].join(h.source),"i"),RGBA_PERCENT:new RegExp(["^rgba\\(",k.source,",",k.source,",",k.source,",",j.source,"\\)$"].join(h.source),"i"),HSL:new RegExp(["^hsl\\(",i.source,",",k.source,",",k.source,"\\)$"].join(h.source),"i"),HSLA:new RegExp(["^hsla\\(",i.source,",",k.source,",",k.source,",",j.source,"\\)$"].join(h.source),"i"),HSB:new RegExp(["^hsb\\(",i.source,",",k.source,",",k.source,"\\)$"].join(h.source),"i"),HSBA:new RegExp(["^hsba\\(",i.source,",",k.source,",",k.source,",",j.source,"\\)$"].join(h.source),"i")};d.Color._parseInputs=function(a,b,c,h){var i=arguments.length,j=this.mode,k=this.maxes,m=[];if(i>=3)return m[0]=a/k[j][0],m[1]=b/k[j][1],m[2]=c/k[j][2],m[3]="number"==typeof h?h/k[j][3]:1,m=m.map(function(a){return Math.max(Math.min(a,1),0)}),j===e.HSL?f._hslaToRGBA(m):j===e.HSB?f._hsbaToRGBA(m):m;if(1===i&&"string"==typeof a){var n=a.trim().toLowerCase();if(g[n])return d.Color._parseInputs.call(this,g[n]);if(l.HEX3.test(n))return m=l.HEX3.exec(n).slice(1).map(function(a){return parseInt(a+a,16)/255}),m[3]=1,m;if(l.HEX6.test(n))return m=l.HEX6.exec(n).slice(1).map(function(a){return parseInt(a,16)/255}),m[3]=1,m;if(l.HEX4.test(n))return m=l.HEX4.exec(n).slice(1).map(function(a){return parseInt(a+a,16)/255});if(l.HEX8.test(n))return m=l.HEX8.exec(n).slice(1).map(function(a){return parseInt(a,16)/255});if(l.RGB.test(n))return m=l.RGB.exec(n).slice(1).map(function(a){return a/255}),m[3]=1,m;if(l.RGB_PERCENT.test(n))return m=l.RGB_PERCENT.exec(n).slice(1).map(function(a){return parseFloat(a)/100}),m[3]=1,m;if(l.RGBA.test(n))return m=l.RGBA.exec(n).slice(1).map(function(a,b){return 3===b?parseFloat(a):a/255});if(l.RGBA_PERCENT.test(n))return m=l.RGBA_PERCENT.exec(n).slice(1).map(function(a,b){return 3===b?parseFloat(a):parseFloat(a)/100});if(l.HSL.test(n)?(m=l.HSL.exec(n).slice(1).map(function(a,b){return 0===b?parseInt(a,10)/360:parseInt(a,10)/100}),m[3]=1):l.HSLA.test(n)&&(m=l.HSLA.exec(n).slice(1).map(function(a,b){return 0===b?parseInt(a,10)/360:3===b?parseFloat(a):parseInt(a,10)/100})),m=m.map(function(a){return Math.max(Math.min(a,1),0)}),m.length)return f._hslaToRGBA(m);if(l.HSB.test(n)?(m=l.HSB.exec(n).slice(1).map(function(a,b){return 0===b?parseInt(a,10)/360:parseInt(a,10)/100}),m[3]=1):l.HSBA.test(n)&&(m=l.HSBA.exec(n).slice(1).map(function(a,b){return 0===b?parseInt(a,10)/360:3===b?parseFloat(a):parseInt(a,10)/100})),m=m.map(function(a){return Math.max(Math.min(a,1),0)}),m.length)return f._hsbaToRGBA(m);m=[1,1,1,1]}else{if(1!==i&&2!==i||"number"!=typeof a)throw new Error(arguments+"is not a valid color representation.");m[0]=a/k[j][2],m[1]=a/k[j][2],m[2]=a/k[j][2],m[3]="number"==typeof b?b/k[j][3]:1,m=m.map(function(a){return Math.max(Math.min(a,1),0)})}return m},b.exports=d.Color},{"../core/constants":20,"../core/core":21,"./color_conversion":13}],16:[function(a,b,c){"use strict";var d=a("../core/core"),e=a("../core/constants");a("./p5.Color"),d.prototype.background=function(){return arguments[0]instanceof d.Image?this.image(arguments[0],0,0,this.width,this.height):this._renderer.background.apply(this._renderer,arguments),this},d.prototype.clear=function(){return this._renderer.clear(),this},d.prototype.colorMode=function(a,b,c,f,g){if(d._validateParameters("colorMode",arguments),a===e.RGB||a===e.HSB||a===e.HSL){this._colorMode=a;var h=this._colorMaxes[a];2===arguments.length?(h[0]=b,h[1]=b,h[2]=b,h[3]=b):4===arguments.length?(h[0]=b,h[1]=c,h[2]=f):5===arguments.length&&(h[0]=b,h[1]=c,h[2]=f,h[3]=g)}return this},d.prototype.fill=function(){return this._renderer._setProperty("_fillSet",!0),this._renderer._setProperty("_doFill",!0),this._renderer.fill.apply(this._renderer,arguments),this},d.prototype.noFill=function(){return this._renderer._setProperty("_doFill",!1),this},d.prototype.noStroke=function(){return this._renderer._setProperty("_doStroke",!1),this},d.prototype.stroke=function(){return this._renderer._setProperty("_strokeSet",!0),this._renderer._setProperty("_doStroke",!0),this._renderer.stroke.apply(this._renderer,arguments),this},b.exports=d},{"../core/constants":20,"../core/core":21,"./p5.Color":15}],17:[function(a,b,c){"use strict";var d=a("./core"),e=a("./constants"),f=a("./canvas");a("./error_helpers"),d.prototype.arc=function(a,b,c,f,g,h,i){if(d._validateParameters("arc",arguments),!this._renderer._doStroke&&!this._renderer._doFill)return this;for(g=this._toRadians(g),h=this._toRadians(h);g<0;)g+=e.TWO_PI;for(;h<0;)h+=e.TWO_PI;return g%=e.TWO_PI,h%=e.TWO_PI,h===g&&(h+=e.TWO_PI),g=g<=e.HALF_PI?Math.atan(c/f*Math.tan(g)):g>e.HALF_PI&&g<=3*e.HALF_PI?Math.atan(c/f*Math.tan(g))+e.PI:Math.atan(c/f*Math.tan(g))+e.TWO_PI,h=h<=e.HALF_PI?Math.atan(c/f*Math.tan(h)):h>e.HALF_PI&&h<=3*e.HALF_PI?Math.atan(c/f*Math.tan(h))+e.PI:Math.atan(c/f*Math.tan(h))+e.TWO_PI,g>h&&(h+=e.TWO_PI),c=Math.abs(c),f=Math.abs(f),this._renderer.arc(a,b,c,f,g,h,i),this},d.prototype.ellipse=function(a,b,c,e,g){if(d._validateParameters("ellipse",arguments),c<0&&(c=Math.abs(c)),void 0===e?e=c:e<0&&(e=Math.abs(e)),this._renderer._doStroke||this._renderer._doFill){var h=f.modeAdjust(a,b,c,e,this._renderer._ellipseMode);this._renderer.ellipse([h.x,h.y,h.w,h.h,g])}return this},d.prototype.line=function(){return d._validateParameters("line",arguments),this._renderer._doStroke&&this._renderer.line.apply(this._renderer,arguments),this},d.prototype.point=function(){return d._validateParameters("point",arguments),this._renderer._doStroke&&this._renderer.point.apply(this._renderer,arguments),this},d.prototype.quad=function(){return d._validateParameters("quad",arguments),(this._renderer._doStroke||this._renderer._doFill)&&this._renderer.quad.apply(this._renderer,arguments),this},d.prototype.rect=function(){if(d._validateParameters("rect",arguments),this._renderer._doStroke||this._renderer._doFill){for(var a=f.modeAdjust(arguments[0],arguments[1],arguments[2],arguments[3],this._renderer._rectMode),b=[a.x,a.y,a.w,a.h],c=4;c =c-5)&&(this.redraw(),this._frameRate=1e3/(a-this._lastFrameTime),this._lastFrameTime=a,void 0!==this._updateMouseCoords&&this._updateMouseCoords()),this._loop&&(this._requestAnimId=window.requestAnimationFrame(this._draw))}.bind(this),this._runFrames=function(){this._updateInterval&&clearInterval(this._updateInterval)}.bind(this),this._setProperty=function(a,b){this[a]=b,this._isGlobal&&(window[a]=b)}.bind(this),this.remove=function(){var a=document.getElementById(this._loadingScreenId);if(a&&(a.parentNode.removeChild(a),this._incrementPreload()),this._curElement){this._loop=!1,this._requestAnimId&&window.cancelAnimationFrame(this._requestAnimId);for(var b in this._events)window.removeEventListener(b,this._events[b]);for(var c=0;c -1)d=a;else if("string"==typeof a){var f="";b&&c&&"number"==typeof b&&"number"==typeof c&&(f=b+" "+c),d="http://"===a.substring(0,7)||"https://"===a.substring(0,8)?"url("+a+") "+f+", auto":/\.(cur|jpg|jpeg|gif|png|CUR|JPG|JPEG|GIF|PNG)$/.test(a)?"url("+a+") "+f+", auto":a}e.style.cursor=d},h.prototype.frameRate=function(a){return h._validateParameters("frameRate",arguments),"number"!=typeof a||a<0?this._frameRate:(this._setProperty("_targetFrameRate",a),this._runFrames(),this)},h.prototype.getFrameRate=function(){return this.frameRate()},h.prototype.setFrameRate=function(a){return this.frameRate(a)},h.prototype.noCursor=function(){this._curElement.elt.style.cursor="none"},h.prototype.displayWidth=screen.width,h.prototype.displayHeight=screen.height,h.prototype.windowWidth=d(),h.prototype.windowHeight=e(),h.prototype._onresize=function(a){this._setProperty("windowWidth",d()),this._setProperty("windowHeight",e());var b,c=this._isGlobal?window:this;"function"==typeof c.windowResized&&(void 0===(b=c.windowResized(a))||b||a.preventDefault())},h.prototype.width=0,h.prototype.height=0,h.prototype.fullscreen=function(a){if(h._validateParameters("fullscreen",arguments),void 0===a)return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;a?f(document.documentElement):g()},h.prototype.pixelDensity=function(a){if(h._validateParameters("pixelDensity",arguments),"number"!=typeof a)return this._pixelDensity;this._pixelDensity=a,this.resizeCanvas(this.width,this.height,!0)},h.prototype.displayDensity=function(){return window.devicePixelRatio},h.prototype.getURL=function(){return location.href},h.prototype.getURLPath=function(){return location.pathname.split("/").filter(function(a){return""!==a})},h.prototype.getURLParams=function(){for(var a,b=/[?&]([^&=]+)(?:[&=])([^&=]+)/gim,c={};null!=(a=b.exec(location.search));)a.index===b.lastIndex&&b.lastIndex++,c[a[1]]=a[2];return c},b.exports=h},{"./constants":20,"./core":21}],24:[function(a,b,c){"use strict";var d=a("./core");a("./constants");d._validateParameters=d._friendlyFileLoadError=function(){};var e=null,f="https://github.com/processing/p5.js/wiki/Frequently-Asked-Questions#why-cant-i-assign-variables-using-p5-functions-and-variables-before-setup",g=function(){var b={},c=function(a){return Object.getOwnPropertyNames(a).filter(function(a){return"_"!==a[0]&&(!(a in b)&&(b[a]=!0,!0))}).map(function(b){var c;return c="function"==typeof a[b]?"function":b===b.toUpperCase()?"constant":"variable",{name:b,type:c}})};e=[].concat(c(d.prototype),c(a("./constants"))),e.sort(function(a,b){return b.name.length-a.name.length})},h=function(a,b){b||(b=console.log.bind(console)),e||g(),e.some(function(c){if(a.message&&null!==a.message.match("\\W?"+c.name+"\\W"))return b("Did you just try to use p5.js's "+c.name+("function"===c.type?"() ":" ")+c.type+"? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: "+f),!0})};d.prototype._helpForMisusedAtTopLevelCode=h,"complete"!==document.readyState&&(window.addEventListener("error",h,!1),window.addEventListener("load",function(){window.removeEventListener("error",h,!1)})),b.exports=d},{"../../docs/reference/data.json":void 0,"./constants":20,"./core":21}],25:[function(a,b,c){"use strict";var d=a("../core/core"),e=function(){window.PHANTOMJS||window.mocha||(window.setup&&"function"==typeof window.setup||window.draw&&"function"==typeof window.draw)&&!d.instance&&new d};"complete"===document.readyState?e():window.addEventListener("load",e,!1)},{"../core/core":21}],26:[function(a,b,c){"use strict";function d(a,b,c){return!1===b?f(a,c):e(a,b,c),this}function e(a,b,c){c._events[a]&&f(a,c);var d=b.bind(c);c.elt.addEventListener(a,d,!1),c._events[a]=d}function f(a,b){var c=b._events[a];b.elt.removeEventListener(a,c,!1),b._events[a]=null}var g=a("./core");g.Element=function(a,b){this.elt=a,this._pInst=b,this._events={},this.width=this.elt.offsetWidth,this.height=this.elt.offsetHeight},g.Element.prototype.parent=function(a){return void 0===a?this.elt.parentNode:("string"==typeof a?("#"===a[0]&&(a=a.substring(1)),a=document.getElementById(a)):a instanceof g.Element&&(a=a.elt),a.appendChild(this.elt),this)},g.Element.prototype.id=function(a){return void 0===a?this.elt.id:(this.elt.id=a,this.width=this.elt.offsetWidth,this.height=this.elt.offsetHeight,this)},g.Element.prototype.class=function(a){return void 0===a?this.elt.className:(this.elt.className=a,this)},g.Element.prototype.mousePressed=function(a){ +return d("mousedown",a,this),d("touchstart",a,this),this},g.Element.prototype.doubleClicked=function(a){return d("dblclick",a,this),this},g.Element.prototype.mouseWheel=function(a){return d("wheel",a,this),this},g.Element.prototype.mouseReleased=function(a){return d("mouseup",a,this),d("touchend",a,this),this},g.Element.prototype.mouseClicked=function(a){return d("click",a,this),this},g.Element.prototype.mouseMoved=function(a){return d("mousemove",a,this),d("touchmove",a,this),this},g.Element.prototype.mouseOver=function(a){return d("mouseover",a,this),this},g.Element.prototype.changed=function(a){return d("change",a,this),this},g.Element.prototype.input=function(a){return d("input",a,this),this},g.Element.prototype.mouseOut=function(a){return d("mouseout",a,this),this},g.Element.prototype.touchStarted=function(a){return d("touchstart",a,this),d("mousedown",a,this),this},g.Element.prototype.touchMoved=function(a){return d("touchmove",a,this),d("mousemove",a,this),this},g.Element.prototype.touchEnded=function(a){return d("touchend",a,this),d("mouseup",a,this),this},g.Element.prototype.dragOver=function(a){return d("dragover",a,this),this},g.Element.prototype.dragLeave=function(a){return d("dragleave",a,this),this},g.Element.prototype.drop=function(a,b){function c(b){var c=new g.File(b);return function(b){c.data=b.target.result,a(c)}}return window.File&&window.FileReader&&window.FileList&&window.Blob?(e("dragover",function(a){a.stopPropagation(),a.preventDefault()},this),e("dragleave",function(a){a.stopPropagation(),a.preventDefault()},this),void 0!==b&&e("drop",b,this),e("drop",function(a){a.stopPropagation(),a.preventDefault();for(var b=a.dataTransfer.files,d=0;d -1?f.readAsText(e):f.readAsDataURL(e)}},this)):console.log("The File APIs are not fully supported in this browser."),this},g.Element.prototype._setProperty=function(a,b){this[a]=b},b.exports=g.Element},{"./core":21}],27:[function(a,b,c){"use strict";var d=a("./core"),e=a("./constants");d.Graphics=function(a,b,c,f){var g=c||e.P2D;this.canvas=document.createElement("canvas"),(f._userNode||document.body).appendChild(this.canvas),d.Element.call(this,this.canvas,f,!1);for(var h in d.prototype)this[h]||("function"==typeof d.prototype[h]?this[h]=d.prototype[h].bind(this):this[h]=d.prototype[h]);return d.prototype._initializeInstanceVariables.apply(this),this.width=a,this.height=b,this._pixelDensity=f._pixelDensity,g===e.WEBGL?this._renderer=new d.RendererGL(this.canvas,this,!1):this._renderer=new d.Renderer2D(this.canvas,this,!1),f._elements.push(this),this._renderer.resize(a,b),this._renderer._applyDefaults(),this},d.Graphics.prototype=Object.create(d.Element.prototype),d.Graphics.prototype.remove=function(){this.elt.parentNode&&this.elt.parentNode.removeChild(this.elt);var a=this._pInst._elements.indexOf(this);-1!==a&&this._pInst._elements.splice(a,1);for(var b in this._events)this.elt.removeEventListener(b,this._events[b])},b.exports=d.Graphics},{"./constants":20,"./core":21}],28:[function(a,b,c){"use strict";function d(a,b){for(var c=1;c this.width||b>this.height)return[0,0,0,255];var f=this._pInst||this;f.loadPixels();var g=f._pixelDensity;a=Math.floor(a),b=Math.floor(b),c=Math.floor(c),e=Math.floor(e);var h=a*g,i=b*g;if(1!==c||1!==e||this instanceof d.RendererGL){var j=Math.min(c,f.width),k=Math.min(e,f.height),l=j*g,m=k*g,n=new d.Image(j,k);return n.canvas.getContext("2d").drawImage(this.canvas,h,i,l,m,0,0,j,k),n}var o=this.drawingContext.getImageData(h,i,1,1).data;return[o[0],o[1],o[2],o[3]]},d.Renderer2D.prototype.loadPixels=function(){var a=this._pInst||this,b=a._pixelDensity,c=this.width*b,d=this.height*b,e=this.drawingContext.getImageData(0,0,c,d);a._setProperty("imageData",e),a._setProperty("pixels",e.data)},d.Renderer2D.prototype.set=function(a,b,c){a=Math.floor(a),b=Math.floor(b);var e=this._pInst||this;if(c instanceof d.Image)this.drawingContext.save(),this.drawingContext.setTransform(1,0,0,1,0,0),this.drawingContext.scale(e._pixelDensity,e._pixelDensity),this.drawingContext.drawImage(c.canvas,a,b),this.loadPixels.call(e),this.drawingContext.restore();else{var f=0,g=0,h=0,i=0,j=4*(b*e._pixelDensity*(this.width*e._pixelDensity)+a*e._pixelDensity);if(e.imageData||e.loadPixels.call(e),"number"==typeof c)j n;)o=Math.min(h-g,f.HALF_PI),p.push(this._acuteArcToBezier(g,o)),g+=o;return this._doFill&&(j.beginPath(),p.forEach(function(a,b){0===b&&j.moveTo(k.x+a.ax*l,k.y+a.ay*m),j.bezierCurveTo(k.x+a.bx*l,k.y+a.by*m,k.x+a.cx*l,k.y+a.cy*m,k.x+a.dx*l,k.y+a.dy*m)}),i!==f.PIE&&null!=i||j.lineTo(k.x,k.y),j.closePath(),j.fill()),this._doStroke&&(j.beginPath(),p.forEach(function(a,b){0===b&&j.moveTo(k.x+a.ax*l,k.y+a.ay*m),j.bezierCurveTo(k.x+a.bx*l,k.y+a.by*m,k.x+a.cx*l,k.y+a.cy*m,k.x+a.dx*l,k.y+a.dy*m)}),i===f.PIE?(j.lineTo(k.x,k.y),j.closePath()):i===f.CHORD&&j.closePath(),j.stroke()),this},d.Renderer2D.prototype.ellipse=function(a){var b=this.drawingContext,c=this._doFill,d=this._doStroke,e=a[0],f=a[1],g=a[2],i=a[3];if(c&&!d){if(this._getFill()===h)return this}else if(!c&&d&&this._getStroke()===h)return this;var j=.5522847498,k=g/2*j,l=i/2*j,m=e+g,n=f+i,o=e+g/2,p=f+i/2;b.beginPath(),b.moveTo(e,p),b.bezierCurveTo(e,p-l,o-k,f,o,f),b.bezierCurveTo(o+k,f,m,p-l,m,p),b.bezierCurveTo(m,p+l,o+k,n,o,n),b.bezierCurveTo(o-k,n,e,p+l,e,p),b.closePath(),c&&b.fill(),d&&b.stroke()},d.Renderer2D.prototype.line=function(a,b,c,d){var e=this.drawingContext;return this._doStroke?this._getStroke()===h?this:(e.lineWidth%2==1&&e.translate(.5,.5),e.beginPath(),e.moveTo(a,b),e.lineTo(c,d),e.stroke(),e.lineWidth%2==1&&e.translate(-.5,-.5),this):this},d.Renderer2D.prototype.point=function(a,b){var c=this.drawingContext;if(!this._doStroke)return this;if(this._getStroke()===h)return this;var d=this._getStroke(),e=this._getFill();a=Math.round(a),b=Math.round(b),this._setFill(d),c.lineWidth>1?(c.beginPath(),c.arc(a,b,c.lineWidth/2,0,f.TWO_PI,!1),c.fill()):c.fillRect(a,b,1,1),this._setFill(e)},d.Renderer2D.prototype.quad=function(a,b,c,d,e,f,g,i){var j=this.drawingContext,k=this._doFill,l=this._doStroke;if(k&&!l){if(this._getFill()===h)return this}else if(!k&&l&&this._getStroke()===h)return this;return j.beginPath(),j.moveTo(a,b),j.lineTo(c,d),j.lineTo(e,f),j.lineTo(g,i),j.closePath(),k&&j.fill(),l&&j.stroke(),this},d.Renderer2D.prototype.rect=function(a){var b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],i=a[6],j=a[7],k=this.drawingContext,l=this._doFill,m=this._doStroke;if(l&&!m){if(this._getFill()===h)return this}else if(!l&&m&&this._getStroke()===h)return this;if(this._doStroke&&k.lineWidth%2==1&&k.translate(.5,.5),k.beginPath(),void 0===f)k.rect(b,c,d,e);else{void 0===g&&(g=f),void 0===i&&(i=g),void 0===j&&(j=i);var n=d/2,o=e/2;d<2*f&&(f=n),e<2*f&&(f=o),d<2*g&&(g=n),e<2*g&&(g=o),d<2*i&&(i=n),e<2*i&&(i=o),d<2*j&&(j=n),e<2*j&&(j=o),k.beginPath(),k.moveTo(b+f,c),k.arcTo(b+d,c,b+d,c+e,g),k.arcTo(b+d,c+e,b,c+e,i),k.arcTo(b,c+e,b,c,j),k.arcTo(b,c,b+d,c,f),k.closePath()}return this._doFill&&k.fill(),this._doStroke&&k.stroke(),this._doStroke&&k.lineWidth%2==1&&k.translate(-.5,-.5),this},d.Renderer2D.prototype.triangle=function(a){var b=this.drawingContext,c=this._doFill,d=this._doStroke,e=a[0],f=a[1],g=a[2],i=a[3],j=a[4],k=a[5];if(c&&!d){if(this._getFill()===h)return this}else if(!c&&d&&this._getStroke()===h)return this;b.beginPath(),b.moveTo(e,f),b.lineTo(g,i),b.lineTo(j,k),b.closePath(),c&&b.fill(),d&&b.stroke()},d.Renderer2D.prototype.endShape=function(a,b,c,d,e,g,h){if(0===b.length)return this;if(!this._doStroke&&!this._doFill)return this;var i,j=a===f.CLOSE;j&&!g&&b.push(b[0]);var k,l,m=b.length;if(!c||h!==f.POLYGON&&null!==h)if(!d||h!==f.POLYGON&&null!==h)if(!e||h!==f.POLYGON&&null!==h)if(h===f.POINTS)for(k=0;k 2){for(this.drawingContext.beginPath(),k=2;k 3)for(k=0;k+1 3){var n=[],o=1-this._curveTightness;for(this.drawingContext.beginPath(),this.drawingContext.moveTo(b[1][0],b[1][1]),k=1;k+2 d?(k=n[h]+" ",o+=q.textLeading()):k=l;switch(this._rectMode===f.CENTER&&(b-=d/2,c-=e/2),this.drawingContext.textAlign){case f.CENTER:b+=d/2;break;case f.RIGHT:b+=d}if(void 0!==e){switch(this.drawingContext.textBaseline){case f.BOTTOM:c+=e-o;break;case f._CTX_MIDDLE:c+=(e-o)/2;break;case f.BASELINE:p=!0,this.drawingContext.textBaseline=f.TOP}r=c+e-q.textAscent()}for(i=0;i d&&k.length>0?(this._renderText(q,k,b,c,r),k=n[h]+" ",c+=q.textLeading()):k=l;this._renderText(q,k,b,c,r),c+=q.textLeading()}}else{var s=0,t=q.textAlign().vertical;for(t===f.CENTER?s=(g.length-1)*q.textLeading()/2:t===f.BOTTOM&&(s=(g.length-1)*q.textLeading()),j=0;j =e))return a.push(),this._isOpenType()?this._textFont._renderPath(b,c,d,{renderer:this}):(this._doStroke&&this._strokeSet&&this.drawingContext.strokeText(b,c,d),this._doFill&&(this._fillSet||this._setFill(f._DEFAULT_TEXT_FILL),this.drawingContext.fillText(b,c,d))),a.pop(),a},d.Renderer2D.prototype.textWidth=function(a){return this._isOpenType()?this._textFont._textWidth(a,this._textSize):this.drawingContext.measureText(a).width},d.Renderer2D.prototype.textAlign=function(a,b){if(void 0!==a)return a!==f.LEFT&&a!==f.RIGHT&&a!==f.CENTER||(this.drawingContext.textAlign=a),b!==f.TOP&&b!==f.BOTTOM&&b!==f.CENTER&&b!==f.BASELINE||(b===f.CENTER?this.drawingContext.textBaseline=f._CTX_MIDDLE:this.drawingContext.textBaseline=b),this._pInst;var c=this.drawingContext.textBaseline;return c===f._CTX_MIDDLE&&(c=f.CENTER),{horizontal:this.drawingContext.textAlign,vertical:c}},d.Renderer2D.prototype._applyTextProperties=function(){var a,b=this._pInst;return this._setProperty("_textAscent",null),this._setProperty("_textDescent",null),a=this._textFont,this._isOpenType()&&(a=this._textFont.font.familyName,this._setProperty("_textStyle",this._textFont.font.styleName)),this.drawingContext.font=(this._textStyle||"normal")+" "+(this._textSize||12)+"px "+(a||"sans-serif"),b},d.Renderer2D.prototype.push=function(){return this.drawingContext.save(),d.Renderer.prototype.push.apply(this)},d.Renderer2D.prototype.pop=function(a){this.drawingContext.restore(),this._cachedFillStyle=this.drawingContext.fillStyle,this._cachedStrokeStyle=this.drawingContext.strokeStyle,d.Renderer.prototype.pop.call(this,a)},b.exports=d.Renderer2D},{"../image/filters":40,"./canvas":19,"./constants":20,"./core":21,"./p5.Renderer":28}],30:[function(a,b,c){"use strict";var d=a("./core"),e=a("./constants");a("./p5.Graphics"),a("./p5.Renderer2D"),a("../webgl/p5.RendererGL");var f="defaultCanvas0",g="p5Canvas";d.prototype.createCanvas=function(a,b,c){d._validateParameters("createCanvas",arguments);var h,i=c||e.P2D;if(i===e.WEBGL){if(h=document.getElementById(f)){h.parentNode.removeChild(h);var j=this._renderer;this._elements=this._elements.filter(function(a){return a!==j})}h=document.createElement("canvas"),h.id=f,h.classList.add(g)}else if(this._defaultGraphicsCreated)h=this.canvas;else{h=document.createElement("canvas");for(var k=0;document.getElementById("defaultCanvas"+k);)k++;f="defaultCanvas"+k,h.id=f,h.classList.add(g)}return this._setupDone||(h.dataset.hidden=!0,h.style.visibility="hidden"),this._userNode?this._userNode.appendChild(h):document.body.appendChild(h),i===e.WEBGL?(this._setProperty("_renderer",new d.RendererGL(h,this,!0)),this._elements.push(this._renderer)):this._defaultGraphicsCreated||(this._setProperty("_renderer",new d.Renderer2D(h,this,!0)),this._defaultGraphicsCreated=!0,this._elements.push(this._renderer)),this._renderer.resize(a,b),this._renderer._applyDefaults(),this._renderer},d.prototype.resizeCanvas=function(a,b,c){if(d._validateParameters("resizeCanvas",arguments),this._renderer){var e={};for(var f in this.drawingContext){var g=this.drawingContext[f];"object"!=typeof g&&"function"!=typeof g&&(e[f]=g)}this._renderer.resize(a,b);for(var h in e)try{this.drawingContext[h]=e[h]}catch(a){}c||this.redraw()}},d.prototype.noCanvas=function(){this.canvas&&this.canvas.parentNode.removeChild(this.canvas)},d.prototype.createGraphics=function(a,b,c){return d._validateParameters("createGraphics",arguments),new d.Graphics(a,b,c,this)},d.prototype.blendMode=function(a){if(d._validateParameters("blendMode",arguments),a!==e.BLEND&&a!==e.DARKEST&&a!==e.LIGHTEST&&a!==e.DIFFERENCE&&a!==e.MULTIPLY&&a!==e.EXCLUSION&&a!==e.SCREEN&&a!==e.REPLACE&&a!==e.OVERLAY&&a!==e.HARD_LIGHT&&a!==e.SOFT_LIGHT&&a!==e.DODGE&&a!==e.BURN&&a!==e.ADD&&a!==e.NORMAL)throw new Error("Mode "+a+" not recognized.");this._renderer.blendMode(a)},b.exports=d},{"../webgl/p5.RendererGL":71,"./constants":20,"./core":21,"./p5.Graphics":27,"./p5.Renderer2D":29}],31:[function(a,b,c){"use strict";window.requestAnimationFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a,b){window.setTimeout(a,1e3/60)}}(),window.performance=window.performance||{},window.performance.now=function(){var a=Date.now();return window.performance.now||window.performance.mozNow||window.performance.msNow||window.performance.oNow||window.performance.webkitNow||function(){return Date.now()-a}}(),function(){"undefined"==typeof Uint8ClampedArray||Uint8ClampedArray.prototype.slice||Object.defineProperty(Uint8ClampedArray.prototype,"slice",{value:Array.prototype.slice,writable:!0,configurable:!0,enumerable:!1})}()},{}],32:[function(a,b,c){"use strict";function d(a,b){for(var c=1;c 0))throw"vertex() must be used once before calling quadraticVertex()";k=!0;for(var j=[],m=0;m n||Math.abs(this.accelerationY-this.pAccelerationY)>n||Math.abs(this.accelerationZ-this.pAccelerationZ)>n)&&a();var b=this.deviceTurned||window.deviceTurned;if("function"==typeof b){var c=this.rotationX+180,d=this.pRotationX+180,p=h+180;c-d>0&&c-d<270||c-d<-270?k="clockwise":(c-d<0||c-d>270)&&(k="counter-clockwise"),k!==e&&(p=c),Math.abs(c-p)>90&&Math.abs(c-p)<270&&(p=c,this._setProperty("turnAxis","X"),b()),e=k,h=p-180;var q=this.rotationY+180,r=this.pRotationY+180,s=i+180;q-r>0&&q-r<270||q-r<-270?l="clockwise":(q-r<0||q-this.pRotationY>270)&&(l="counter-clockwise"),l!==f&&(s=q),Math.abs(q-s)>90&&Math.abs(q-s)<270&&(s=q,this._setProperty("turnAxis","Y"),b()),f=l,i=s-180,this.rotationZ-this.pRotationZ>0&&this.rotationZ-this.pRotationZ<270||this.rotationZ-this.pRotationZ<-270?m="clockwise":(this.rotationZ-this.pRotationZ<0||this.rotationZ-this.pRotationZ>270)&&(m="counter-clockwise"),m!==g&&(j=this.rotationZ),Math.abs(this.rotationZ-j)>90&&Math.abs(this.rotationZ-j)<270&&(j=this.rotationZ,this._setProperty("turnAxis","Z"),b()),g=m,this._setProperty("turnAxis",void 0)}var t=this.deviceShaken||window.deviceShaken;if("function"==typeof t){var u,v;null!==this.pAccelerationX&&(u=Math.abs(this.accelerationX-this.pAccelerationX),v=Math.abs(this.accelerationY-this.pAccelerationY)),u+v>o&&t()}},b.exports=d},{"../core/core":21}],37:[function(a,b,c){"use strict";function d(){for(var a in f)if(f.hasOwnProperty(a)&&!0===f[a])return!0;return!1}var e=a("../core/core"),f={};e.prototype.isKeyPressed=!1,e.prototype.keyIsPressed=!1,e.prototype.key="",e.prototype.keyCode=0,e.prototype._onkeydown=function(a){if(!f[a.which]){this._setProperty("isKeyPressed",!0),this._setProperty("keyIsPressed",!0),this._setProperty("keyCode",a.which),f[a.which]=!0;var b=String.fromCharCode(a.which);b||(b=a.which),this._setProperty("key",b);var c=this.keyPressed||window.keyPressed;if("function"==typeof c&&!a.charCode){!1===c(a)&&a.preventDefault()}}},e.prototype._onkeyup=function(a){var b=this.keyReleased||window.keyReleased;f[a.which]=!1,d()||(this._setProperty("isKeyPressed",!1),this._setProperty("keyIsPressed",!1)),this._setProperty("_lastKeyCodeTyped",null);var c=String.fromCharCode(a.which);if(c||(c=a.which),this._setProperty("key",c),this._setProperty("keyCode",a.which),"function"==typeof b){!1===b(a)&&a.preventDefault()}},e.prototype._onkeypress=function(a){if(a.which!==this._lastKeyCodeTyped){this._setProperty("keyCode",a.which),this._setProperty("_lastKeyCodeTyped",a.which),this._setProperty("key",String.fromCharCode(a.which));var b=this.keyTyped||window.keyTyped;if("function"==typeof b){!1===b(a)&&a.preventDefault()}}},e.prototype._onblur=function(a){f={}},e.prototype.keyIsDown=function(a){return e._validateParameters("keyIsDown",arguments),f[a]},b.exports=e},{"../core/core":21}],38:[function(a,b,c){"use strict";function d(a,b,c,d){d&&!d.clientX&&(d.touches?d=d.touches[0]:d.changedTouches&&(d=d.changedTouches[0]));var e=a.getBoundingClientRect(),f=a.scrollWidth/b,g=a.scrollHeight/c;return{x:(d.clientX-e.left)/f,y:(d.clientY-e.top)/g,winX:d.clientX,winY:d.clientY,id:d.identifier}}var e=a("../core/core"),f=a("../core/constants");e.prototype._hasMouseInteracted=!1,e.prototype.mouseX=0,e.prototype.mouseY=0,e.prototype.pmouseX=0,e.prototype.pmouseY=0,e.prototype.winMouseX=0,e.prototype.winMouseY=0,e.prototype.pwinMouseX=0,e.prototype.pwinMouseY=0,e.prototype.mouseButton=0,e.prototype.mouseIsPressed=!1,e.prototype._updateNextMouseCoords=function(a){if(null!==this._curElement&&(!a.touches||a.touches.length>0)){var b=d(this._curElement.elt,this.width,this.height,a);this._setProperty("mouseX",b.x),this._setProperty("mouseY",b.y),this._setProperty("winMouseX",b.winX),this._setProperty("winMouseY",b.winY)}this._hasMouseInteracted||(this._updateMouseCoords(),this._setProperty("_hasMouseInteracted",!0))},e.prototype._updateMouseCoords=function(){this._setProperty("pmouseX",this.mouseX),this._setProperty("pmouseY",this.mouseY),this._setProperty("pwinMouseX",this.winMouseX),this._setProperty("pwinMouseY",this.winMouseY)},e.prototype._setMouseButton=function(a){1===a.button?this._setProperty("mouseButton",f.CENTER):2===a.button?this._setProperty("mouseButton",f.RIGHT):this._setProperty("mouseButton",f.LEFT)},e.prototype._onmousemove=function(a){var b=this._isGlobal?window:this;this._updateNextMouseCoords(a),this.mouseIsPressed?"function"==typeof b.mouseDragged?!1===b.mouseDragged(a)&&a.preventDefault():"function"==typeof b.touchMoved&&!1===b.touchMoved(a)&&a.preventDefault():"function"==typeof b.mouseMoved&&!1===b.mouseMoved(a)&&a.preventDefault()},e.prototype._onmousedown=function(a){var b=this._isGlobal?window:this;this._setProperty("mouseIsPressed",!0),this._setMouseButton(a),this._updateNextMouseCoords(a),"function"==typeof b.mousePressed?!1===b.mousePressed(a)&&a.preventDefault():"function"==typeof b.touchStarted&&!1===b.touchStarted(a)&&a.preventDefault()},e.prototype._onmouseup=function(a){var b=this._isGlobal?window:this;this._setProperty("mouseIsPressed",!1),"function"==typeof b.mouseReleased?!1===b.mouseReleased(a)&&a.preventDefault():"function"==typeof b.touchEnded&&!1===b.touchEnded(a)&&a.preventDefault()},e.prototype._ondragend=e.prototype._onmouseup,e.prototype._ondragover=e.prototype._onmousemove,e.prototype._onclick=function(a){var b=this._isGlobal?window:this;if("function"==typeof b.mouseClicked){!1===b.mouseClicked(a)&&a.preventDefault()}},e.prototype._ondblclick=function(a){var b=this._isGlobal?window:this;if("function"==typeof b.doubleClicked){!1===b.doubleClicked(a)&&a.preventDefault()}},e.prototype._onwheel=function(a){var b=this._isGlobal?window:this;if("function"==typeof b.mouseWheel){a.delta=a.deltaY;!1===b.mouseWheel(a)&&a.preventDefault()}},b.exports=e},{"../core/constants":20,"../core/core":21}],39:[function(a,b,c){"use strict";function d(a,b,c,d,e){e=e||0;var f=a.getBoundingClientRect(),g=a.scrollWidth/b,h=a.scrollHeight/c,i=d.touches[e]||d.changedTouches[e];return{x:(i.clientX-f.left)/g,y:(i.clientY-f.top)/h,winX:i.clientX,winY:i.clientY,id:i.identifier}}var e=a("../core/core");e.prototype.touches=[],e.prototype._updateTouchCoords=function(a){if(null!==this._curElement){for(var b=[],c=0;c =e)break;x=0}for(F=x;F =e);F++){var H=m[t+C];G=j[F],s+=G[(-16777216&H)>>>24],p+=G[(16711680&H)>>16],q+=G[(65280&H)>>8],r+=G[255&H],o+=i[F],t++}u=C+D,y[u]=s/o,z[u]=p/o,A[u]=q/o,B[u]=r/o}C+=e}for(C=0,v=-g,w=v*e,E=0;E =k)break;x=0,u=v,t=D+w}for(F=x;F =k);F++)G=j[F],s+=G[y[t]],p+=G[z[t]],q+=G[A[t]],r+=G[B[t]],o+=i[F],u++,t+=e;m[D+C]=s/o<<24|p/o<<16|q/o<<8|r/o}C+=e,w+=e,v++}f._setPixels(c,m)}var f={};f._toPixels=function(a){return a instanceof ImageData?a.data:a.getContext("2d").getImageData(0,0,a.width,a.height).data},f._getARGB=function(a,b){var c=4*b;return a[c+3]<<24&4278190080|a[c]<<16&16711680|a[c+1]<<8&65280|255&a[c+2]},f._setPixels=function(a,b){for(var c=0,d=0,e=a.length;d >>16,a[c+1]=(65280&b[d])>>>8,a[c+2]=255&b[d],a[c+3]=(4278190080&b[d])>>>24},f._toImageData=function(a){return a instanceof ImageData?a:a.getContext("2d").getImageData(0,0,a.width,a.height)},f._createImageData=function(a,b){return f._tmpCanvas=document.createElement("canvas"),f._tmpCtx=f._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(a,b)},f.apply=function(a,b,c){var d=a.getContext("2d"),e=d.getImageData(0,0,a.width,a.height),f=b(e,c);f instanceof ImageData?d.putImageData(f,0,0,0,0,a.width,a.height):d.putImageData(e,0,0,0,0,a.width,a.height)},f.threshold=function(a,b){var c=f._toPixels(a);void 0===b&&(b=.5);for(var d=Math.floor(255*b),e=0;e =d?255:0,c[e]=c[e+1]=c[e+2]=g}},f.gray=function(a){for(var b=f._toPixels(a),c=0;c 255)throw new Error("Level must be greater than 2 and less than 255 for posterize");for(var d=b-1,e=0;e >8)/d,c[e+1]=255*(h*b>>8)/d,c[e+2]=255*(i*b>>8)/d}},f.dilate=function(a){for(var b,c,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t=f._toPixels(a),u=0,v=t.length?t.length/4:0,w=new Int32Array(v);u =c&&(h=u),j<0&&(j=0),k>=v&&(k=u),n=f._getARGB(t,j),m=f._getARGB(t,i),o=f._getARGB(t,k),l=f._getARGB(t,h),g=77*(d>>16&255)+151*(d>>8&255)+28*(255&d),q=77*(m>>16&255)+151*(m>>8&255)+28*(255&m),p=77*(l>>16&255)+151*(l>>8&255)+28*(255&l),r=77*(n>>16&255)+151*(n>>8&255)+28*(255&n),s=77*(o>>16&255)+151*(o>>8&255)+28*(255&o),q>g&&(e=m,g=q),p>g&&(e=l,g=p),r>g&&(e=n,g=r),s>g&&(e=o,g=s),w[u++]=e;f._setPixels(t,w)},f.erode=function(a){for(var b,c,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t=f._toPixels(a),u=0,v=t.length?t.length/4:0,w=new Int32Array(v);u =c&&(h=u),j<0&&(j=0),k>=v&&(k=u),n=f._getARGB(t,j),m=f._getARGB(t,i),o=f._getARGB(t,k),l=f._getARGB(t,h),g=77*(d>>16&255)+151*(d>>8&255)+28*(255&d),q=77*(m>>16&255)+151*(m>>8&255)+28*(255&m),p=77*(l>>16&255)+151*(l>>8&255)+28*(255&l),r=77*(n>>16&255)+151*(n>>8&255)+28*(255&n),s=77*(o>>16&255)+151*(o>>8&255)+28*(255&o),q =1&&(b=e[0]),e.length>=2&&(c=e[1]),c=c||d.prototype._checkFileExtension(b,c)[1]||"png";var f;switch(c){default:f="image/png";break;case"jpeg":case"jpg":f="image/jpeg"}a.toBlob(function(a){d.prototype.downloadFile(a,b,c)},f)},d.prototype.saveFrames=function(a,b,c,f,g){d._validateParameters("saveFrames",arguments);var h=c||3;h=d.prototype.constrain(h,0,15),h*=1e3;var i=f||15;i=d.prototype.constrain(i,0,22);var j=0,k=d.prototype._makeFrame,l=this._curElement.elt,m=setInterval(function(){k(a+j,b,l),j++},1e3/i);setTimeout(function(){if(clearInterval(m),g)g(e);else for(var a=0;a 0&&a0&&this.loadPixels(),this.setModified(!0)},d.Image.prototype.copy=function(){var a,b,c,e,f,g,h,i,j;if(9===arguments.length)a=arguments[0],b=arguments[1],c=arguments[2],e=arguments[3],f=arguments[4],g=arguments[5],h=arguments[6],i=arguments[7],j=arguments[8];else{if(8!==arguments.length)throw new Error("Signature not supported");a=this,b=arguments[0],c=arguments[1],e=arguments[2],f=arguments[3],g=arguments[4],h=arguments[5],i=arguments[6],j=arguments[7]}d.Renderer2D._copyHelper(this,a,b,c,e,f,g,h,i,j)},d.Image.prototype.mask=function(a){void 0===a&&(a=this);var b=this.drawingContext.globalCompositeOperation,c=1;a instanceof d.Renderer&&(c=a._pInst._pixelDensity);var e=[a,0,0,c*a.width,c*a.height,0,0,this.width,this.height];this.drawingContext.globalCompositeOperation="destination-in",d.Image.prototype.copy.apply(this,e),this.drawingContext.globalCompositeOperation=b,this.setModified(!0)},d.Image.prototype.filter=function(a,b){e.apply(this.canvas,e[a.toLowerCase()],b),this.setModified(!0)},d.Image.prototype.blend=function(){d.prototype.blend.apply(this,arguments),this.setModified(!0)},d.Image.prototype.setModified=function(a){this._modified=a},d.Image.prototype.isModified=function(){return this._modified},d.Image.prototype.save=function(a,b){d.prototype.saveCanvas(this.canvas,a,b)},b.exports=d.Image},{"../core/core":21,"./filters":40}],44:[function(a,b,c){"use strict";var d=a("../core/core"),e=a("./filters");a("../color/p5.Color"),d.prototype.pixels=[],d.prototype.blend=function(){d._validateParameters("blend",arguments),this._renderer?this._renderer.blend.apply(this._renderer,arguments):d.Renderer2D.prototype.blend.apply(this,arguments)},d.prototype.copy=function(){d._validateParameters("copy",arguments),d.Renderer2D.prototype.copy.apply(this._renderer,arguments)},d.prototype.filter=function(a,b){d._validateParameters("filter",arguments),void 0!==this.canvas?e.apply(this.canvas,e[a.toLowerCase()],b):e.apply(this.elt,e[a.toLowerCase()],b)},d.prototype.get=function(a,b,c,d){return this._renderer.get(a,b,c,d)},d.prototype.loadPixels=function(){d._validateParameters("loadPixels",arguments),this._renderer.loadPixels()},d.prototype.set=function(a,b,c){this._renderer.set(a,b,c)},d.prototype.updatePixels=function(a,b,c,e){d._validateParameters("updatePixels",arguments),0!==this.pixels.length&&this._renderer.updatePixels(a,b,c,e)},b.exports=d},{"../color/p5.Color":15,"../core/core":21,"./filters":40}],45:[function(a,b,c){"use strict";function d(a,b){var c={};if(void 0===(b=b||[]))for(var d=0;d /g,">").replace(/"/g,""").replace(/'/g,"'")}function g(a,b){b&&!0!==b&&"true"!==b||(b=""),a||(a="untitled");var c="";return a&&a.indexOf(".")>-1&&(c=a.split(".").pop()),b&&c!==b&&(c=b,a=a+"."+c),[a,c]}function h(a){document.body.removeChild(a.target)}var i=a("../core/core");a("whatwg-fetch"),a("es6-promise").polyfill();var j=a("fetch-jsonp");a("../core/error_helpers"),i.prototype.loadJSON=function(){i._validateParameters("loadJSON",arguments);for(var a,b,c,d=arguments[0],e={},f="json",g=1;g 0&&"function"==typeof arguments[i];i--)g++;var k=arguments.length-g,l=arguments[0];if(2===k&&"string"==typeof l&&"object"==typeof arguments[1])d=new Request(l,arguments[1]),b=arguments[2],c=arguments[3];else{for(var m,n="GET",o=1;o "),e.print("");var m=' ',e.print(m),e.print(""),e.print(""),e.print(" "),"0"!==g[0]){e.print("
"),e.print(""),e.print("");for(var n=0;n ")}for(var p=0;p"+o),e.print(" ")}e.print(" ");for(var q=0;q "+s),e.print(" ")}e.print(" ")}e.print("