-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsmartdown_vendors~p5DOM~p5Sound~p5js.js
3 lines (3 loc) · 386 KB
/
smartdown_vendors~p5DOM~p5Sound~p5js.js
1
2
3
(window.webpackJsonpsmartdown=window.webpackJsonpsmartdown||[]).push([[0],{225:function(t,e){
/*! p5.js v0.6.1 April 27, 2018 */!function(r){if("object"==typeof e&&void 0!==t)t.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=r()}}(function(){return function t(e,r,i){function n(a,s){if(!r[a]){if(!e[a]){var h="function"==typeof require&&require;if(!s&&h)return h(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=r[a]={exports:{}};e[a][0].call(u.exports,function(t){return n(e[a][1][t]||t)},u,u.exports,t,e,r,i)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<i.length;a++)n(i[a]);return n}({1:[function(t,e,r){!function(t){"use strict";function e(t){var e=t.charCodeAt(0);return e===i||e===h?62:e===n||e===l?63:e<o?-1:e<o+10?e-o+26+26:e<s+26?e-s:e<a+26?e-a+26:void 0}var r="undefined"!=typeof Uint8Array?Uint8Array:Array,i="+".charCodeAt(0),n="/".charCodeAt(0),o="0".charCodeAt(0),a="a".charCodeAt(0),s="A".charCodeAt(0),h="-".charCodeAt(0),l="_".charCodeAt(0);t.toByteArray=function(t){function i(t){l[c++]=t}var n,o,a,s,h,l;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var u=t.length;h="="===t.charAt(u-2)?2:"="===t.charAt(u-1)?1:0,l=new r(3*t.length/4-h),a=h>0?t.length-4:t.length;var c=0;for(n=0,o=0;n<a;n+=4,o+=3)i((16711680&(s=e(t.charAt(n))<<18|e(t.charAt(n+1))<<12|e(t.charAt(n+2))<<6|e(t.charAt(n+3))))>>16),i((65280&s)>>8),i(255&s);return 2===h?i(255&(s=e(t.charAt(n))<<2|e(t.charAt(n+1))>>4)):1===h&&(i((s=e(t.charAt(n))<<10|e(t.charAt(n+1))<<4|e(t.charAt(n+2))>>2)>>8&255),i(255&s)),l},t.fromByteArray=function(t){function e(t){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)}function r(t){return e(t>>18&63)+e(t>>12&63)+e(t>>6&63)+e(63&t)}var i,n,o,a=t.length%3,s="";for(i=0,o=t.length-a;i<o;i+=3)s+=r(n=(t[i]<<16)+(t[i+1]<<8)+t[i+2]);switch(a){case 1:s+=e((n=t[t.length-1])>>2),s+=e(n<<4&63),s+="==";break;case 2:s+=e((n=(t[t.length-2]<<8)+t[t.length-1])>>10),s+=e(n>>4&63),s+=e(n<<2&63),s+="="}return s}}(void 0===r?this.base64js={}:r)},{}],2:[function(t,e,r){},{}],3:[function(t,e,r){(function(e){"use strict";function i(){return n.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function n(t){return this instanceof n?(n.TYPED_ARRAY_SUPPORT||(this.length=0,this.parent=void 0),"number"==typeof t?function(t,e){if(t=a(t,e<0?0:0|s(e)),!n.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;r++)t[r]=0;return t}(this,t):"string"==typeof t?function(t,e,r){return"string"==typeof r&&""!==r||(r="utf8"),(t=a(t,0|h(e,r))).write(e,r),t}(this,t,arguments.length>1?arguments[1]:"utf8"):function(t,e){if(n.isBuffer(e))return function(t,e){var r=0|s(e.length);return t=a(t,r),e.copy(t,0,0,r),t}(t,e);if(U(e))return function(t,e){var r=0|s(e.length);t=a(t,r);for(var i=0;i<r;i+=1)t[i]=255&e[i];return t}(t,e);if(null==e)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(e.buffer instanceof ArrayBuffer)return o(t,e);if(e instanceof ArrayBuffer)return function(t,e){return n.TYPED_ARRAY_SUPPORT?(e.byteLength,t=n._augment(new Uint8Array(e))):t=o(t,new Uint8Array(e)),t}(t,e)}return e.length?function(t,e){var r=0|s(e.length);t=a(t,r);for(var i=0;i<r;i+=1)t[i]=255&e[i];return t}(t,e):function(t,e){var r,i=0;"Buffer"===e.type&&U(e.data)&&(r=e.data,i=0|s(r.length)),t=a(t,i);for(var n=0;n<i;n+=1)t[n]=255&r[n];return t}(t,e)}(this,t)):arguments.length>1?new n(t,arguments[1]):new n(t)}function o(t,e){var r=0|s(e.length);t=a(t,r);for(var i=0;i<r;i+=1)t[i]=255&e[i];return t}function a(t,e){return n.TYPED_ARRAY_SUPPORT?(t=n._augment(new Uint8Array(e))).__proto__=n.prototype:(t.length=e,t._isBuffer=!0),0!==e&&e<=n.poolSize>>>1&&(t.parent=k),t}function s(t){if(t>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function h(t,e){"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"binary":case"raw":case"raws":return r;case"utf8":case"utf-8":return P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return L(t).length;default:if(i)return P(t).length;e=(""+e).toLowerCase(),i=!0}}function l(t,e,r,i){r=Number(r)||0;var n=t.length-r;i?(i=Number(i))>n&&(i=n):i=n;var o=e.length;if(o%2!=0)throw new Error("Invalid hex string");i>o/2&&(i=o/2);for(var a=0;a<i;a++){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))throw new Error("Invalid hex string");t[r+a]=s}return a}function u(t,e,r,i){return A(P(e,t.length-r),t,r,i)}function c(t,e,r,i){return A(function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e}(e),t,r,i)}function p(t,e,r,i){return c(t,e,r,i)}function d(t,e,r,i){return A(L(e),t,r,i)}function f(t,e,r,i){return A(function(t,e){for(var r,i,n,o=[],a=0;a<t.length&&!((e-=2)<0);a++)r=t.charCodeAt(a),i=r>>8,n=r%256,o.push(n),o.push(i);return o}(e,t.length-r),t,r,i)}function m(t,e,r){return 0===e&&r===t.length?D.fromByteArray(t):D.fromByteArray(t.slice(e,r))}function v(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n<r;){var o,a,s,h,l=t[n],u=null,c=l>239?4:l>223?3:l>191?2:1;if(n+c<=r)switch(c){case 1:l<128&&(u=l);break;case 2:128==(192&(o=t[n+1]))&&(h=(31&l)<<6|63&o)>127&&(u=h);break;case 3:o=t[n+1],a=t[n+2],128==(192&o)&&128==(192&a)&&(h=(15&l)<<12|(63&o)<<6|63&a)>2047&&(h<55296||h>57343)&&(u=h);break;case 4:o=t[n+1],a=t[n+2],s=t[n+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(h=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&h<1114112&&(u=h)}null===u?(u=65533,c=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|1023&u),i.push(u),n+=c}return function(t){var e=t.length;if(e<=O)return String.fromCharCode.apply(String,t);for(var r="",i=0;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=O));return r}(i)}function g(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;n++)i+=String.fromCharCode(127&t[n]);return i}function y(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;n++)i+=String.fromCharCode(t[n]);return i}function b(t,e,r){var i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);for(var n="",o=e;o<r;o++)n+=C(t[o]);return n}function _(t,e,r){for(var i=t.slice(e,r),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+256*i[o+1]);return n}function x(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function w(t,e,r,i,o,a){if(!n.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");if(e>o||e<a)throw new RangeError("value is out of bounds");if(r+i>t.length)throw new RangeError("index out of range")}function S(t,e,r,i){e<0&&(e=65535+e+1);for(var n=0,o=Math.min(t.length-r,2);n<o;n++)t[r+n]=(e&255<<8*(i?n:1-n))>>>8*(i?n:1-n)}function T(t,e,r,i){e<0&&(e=4294967295+e+1);for(var n=0,o=Math.min(t.length-r,4);n<o;n++)t[r+n]=e>>>8*(i?n:3-n)&255}function E(t,e,r,i,n,o){if(e>n||e<o)throw new RangeError("value is out of bounds");if(r+i>t.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function M(t,e,r,i,n){return n||E(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),I.write(t,e,r,i,23,4),r+4}function R(t,e,r,i,n){return n||E(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),I.write(t,e,r,i,52,8),r+8}function C(t){return t<16?"0"+t.toString(16):t.toString(16)}function P(t,e){e=e||1/0;for(var r,i=t.length,n=null,o=[],a=0;a<i;a++){if((r=t.charCodeAt(a))>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function L(t){return D.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(B,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function A(t,e,r,i){for(var n=0;n<i&&!(n+r>=e.length||n>=t.length);n++)e[n+r]=t[n];return n}var D=t("base64-js"),I=t("ieee754"),U=t("isarray");r.Buffer=n,r.SlowBuffer=function t(e,r){if(!(this instanceof t))return new t(e,r);var i=new n(e,r);return delete i.parent,i},r.INSPECT_MAX_BYTES=50,n.poolSize=8192;var k={};n.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){function t(){}try{var e=new Uint8Array(1);return e.foo=function(){return 42},e.constructor=t,42===e.foo()&&e.constructor===t&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}(),n.TYPED_ARRAY_SUPPORT?(n.prototype.__proto__=Uint8Array.prototype,n.__proto__=Uint8Array):(n.prototype.length=void 0,n.prototype.parent=void 0),n.isBuffer=function(t){return!(null==t||!t._isBuffer)},n.compare=function(t,e){if(!n.isBuffer(t)||!n.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,o=0,a=Math.min(r,i);o<a&&t[o]===e[o];)++o;return o!==a&&(r=t[o],i=e[o]),r<i?-1:i<r?1:0},n.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},n.concat=function(t,e){if(!U(t))throw new TypeError("list argument must be an Array of Buffers.");if(0===t.length)return new n(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;r++)e+=t[r].length;var i=new n(e),o=0;for(r=0;r<t.length;r++){var a=t[r];a.copy(i,o),o+=a.length}return i},n.byteLength=h,n.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?v(this,0,t):function(t,e,r){var i=!1;if(e|=0,r=void 0===r||r===1/0?this.length:0|r,t||(t="utf8"),e<0&&(e=0),r>this.length&&(r=this.length),r<=e)return"";for(;;)switch(t){case"hex":return b(this,e,r);case"utf8":case"utf-8":return v(this,e,r);case"ascii":return g(this,e,r);case"binary":return y(this,e,r);case"base64":return m(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}.apply(this,arguments)},n.prototype.equals=function(t){if(!n.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===n.compare(this,t)},n.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},n.prototype.compare=function(t){if(!n.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?0:n.compare(this,t)},n.prototype.indexOf=function(t,e){function r(t,e,r){for(var i=-1,n=0;r+n<t.length;n++)if(t[r+n]===e[-1===i?0:n-i]){if(-1===i&&(i=n),n-i+1===e.length)return r+i}else i=-1;return-1}if(e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e>>=0,0===this.length)return-1;if(e>=this.length)return-1;if(e<0&&(e=Math.max(this.length+e,0)),"string"==typeof t)return 0===t.length?-1:String.prototype.indexOf.call(this,t,e);if(n.isBuffer(t))return r(this,t,e);if("number"==typeof t)return n.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,t,e):r(this,[t],e);throw new TypeError("val must be string, number or Buffer")},n.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},n.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},n.prototype.write=function(t,e,r,i){if(void 0===e)i="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)i=e,r=this.length,e=0;else if(isFinite(e))e|=0,isFinite(r)?(r|=0,void 0===i&&(i="utf8")):(i=r,r=void 0);else{var n=i;i=e,e=0|r,r=n}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return l(this,t,e,r);case"utf8":case"utf-8":return u(this,t,e,r);case"ascii":return c(this,t,e,r);case"binary":return p(this,t,e,r);case"base64":return d(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;n.prototype.slice=function(t,e){var r,i=this.length;if(t=~~t,e=void 0===e?i:~~e,t<0?(t+=i)<0&&(t=0):t>i&&(t=i),e<0?(e+=i)<0&&(e=0):e>i&&(e=i),e<t&&(e=t),n.TYPED_ARRAY_SUPPORT)r=n._augment(this.subarray(t,e));else{var o=e-t;r=new n(o,void 0);for(var a=0;a<o;a++)r[a]=this[a+t]}return r.length&&(r.parent=this.parent||this),r},n.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var i=this[t],n=1,o=0;++o<e&&(n*=256);)i+=this[t+o]*n;return i},n.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var i=this[t+--e],n=1;e>0&&(n*=256);)i+=this[t+--e]*n;return i},n.prototype.readUInt8=function(t,e){return e||x(t,1,this.length),this[t]},n.prototype.readUInt16LE=function(t,e){return e||x(t,2,this.length),this[t]|this[t+1]<<8},n.prototype.readUInt16BE=function(t,e){return e||x(t,2,this.length),this[t]<<8|this[t+1]},n.prototype.readUInt32LE=function(t,e){return e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},n.prototype.readUInt32BE=function(t,e){return e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},n.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var i=this[t],n=1,o=0;++o<e&&(n*=256);)i+=this[t+o]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*e)),i},n.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var i=e,n=1,o=this[t+--i];i>0&&(n*=256);)o+=this[t+--i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},n.prototype.readInt8=function(t,e){return e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},n.prototype.readInt16LE=function(t,e){e||x(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},n.prototype.readInt16BE=function(t,e){e||x(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},n.prototype.readInt32LE=function(t,e){return e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},n.prototype.readInt32BE=function(t,e){return e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},n.prototype.readFloatLE=function(t,e){return e||x(t,4,this.length),I.read(this,t,!0,23,4)},n.prototype.readFloatBE=function(t,e){return e||x(t,4,this.length),I.read(this,t,!1,23,4)},n.prototype.readDoubleLE=function(t,e){return e||x(t,8,this.length),I.read(this,t,!0,52,8)},n.prototype.readDoubleBE=function(t,e){return e||x(t,8,this.length),I.read(this,t,!1,52,8)},n.prototype.writeUIntLE=function(t,e,r,i){t=+t,e|=0,r|=0,i||w(this,t,e,r,Math.pow(2,8*r),0);var n=1,o=0;for(this[e]=255&t;++o<r&&(n*=256);)this[e+o]=t/n&255;return e+r},n.prototype.writeUIntBE=function(t,e,r,i){t=+t,e|=0,r|=0,i||w(this,t,e,r,Math.pow(2,8*r),0);var n=r-1,o=1;for(this[e+n]=255&t;--n>=0&&(o*=256);)this[e+n]=t/o&255;return e+r},n.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||w(this,t,e,1,255,0),n.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},n.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||w(this,t,e,2,65535,0),n.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):S(this,t,e,!0),e+2},n.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||w(this,t,e,2,65535,0),n.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):S(this,t,e,!1),e+2},n.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||w(this,t,e,4,4294967295,0),n.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):T(this,t,e,!0),e+4},n.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||w(this,t,e,4,4294967295,0),n.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):T(this,t,e,!1),e+4},n.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);w(this,t,e,r,n-1,-n)}var o=0,a=1,s=t<0?1:0;for(this[e]=255&t;++o<r&&(a*=256);)this[e+o]=(t/a>>0)-s&255;return e+r},n.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);w(this,t,e,r,n-1,-n)}var o=r-1,a=1,s=t<0?1:0;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=(t/a>>0)-s&255;return e+r},n.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||w(this,t,e,1,127,-128),n.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},n.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||w(this,t,e,2,32767,-32768),n.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):S(this,t,e,!0),e+2},n.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||w(this,t,e,2,32767,-32768),n.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):S(this,t,e,!1),e+2},n.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||w(this,t,e,4,2147483647,-2147483648),n.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):T(this,t,e,!0),e+4},n.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||w(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),n.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):T(this,t,e,!1),e+4},n.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},n.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},n.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},n.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},n.prototype.copy=function(t,e,r,i){if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);var o,a=i-r;if(this===t&&r<e&&e<i)for(o=a-1;o>=0;o--)t[o+e]=this[o+r];else if(a<1e3||!n.TYPED_ARRAY_SUPPORT)for(o=0;o<a;o++)t[o+e]=this[o+r];else t._set(this.subarray(r,r+a),e);return a},n.prototype.fill=function(t,e,r){if(t||(t=0),e||(e=0),r||(r=this.length),r<e)throw new RangeError("end < start");if(r!==e&&0!==this.length){if(e<0||e>=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var i;if("number"==typeof t)for(i=e;i<r;i++)this[i]=t;else{var n=P(t.toString()),o=n.length;for(i=e;i<r;i++)this[i]=n[i%o]}return this}},n.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(n.TYPED_ARRAY_SUPPORT)return new n(this).buffer;for(var t=new Uint8Array(this.length),e=0,r=t.length;e<r;e+=1)t[e]=this[e];return t.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var F=n.prototype;n._augment=function(t){return t.constructor=n,t._isBuffer=!0,t._set=t.set,t.get=F.get,t.set=F.set,t.write=F.write,t.toString=F.toString,t.toLocaleString=F.toString,t.toJSON=F.toJSON,t.equals=F.equals,t.compare=F.compare,t.indexOf=F.indexOf,t.copy=F.copy,t.slice=F.slice,t.readUIntLE=F.readUIntLE,t.readUIntBE=F.readUIntBE,t.readUInt8=F.readUInt8,t.readUInt16LE=F.readUInt16LE,t.readUInt16BE=F.readUInt16BE,t.readUInt32LE=F.readUInt32LE,t.readUInt32BE=F.readUInt32BE,t.readIntLE=F.readIntLE,t.readIntBE=F.readIntBE,t.readInt8=F.readInt8,t.readInt16LE=F.readInt16LE,t.readInt16BE=F.readInt16BE,t.readInt32LE=F.readInt32LE,t.readInt32BE=F.readInt32BE,t.readFloatLE=F.readFloatLE,t.readFloatBE=F.readFloatBE,t.readDoubleLE=F.readDoubleLE,t.readDoubleBE=F.readDoubleBE,t.writeUInt8=F.writeUInt8,t.writeUIntLE=F.writeUIntLE,t.writeUIntBE=F.writeUIntBE,t.writeUInt16LE=F.writeUInt16LE,t.writeUInt16BE=F.writeUInt16BE,t.writeUInt32LE=F.writeUInt32LE,t.writeUInt32BE=F.writeUInt32BE,t.writeIntLE=F.writeIntLE,t.writeIntBE=F.writeIntBE,t.writeInt8=F.writeInt8,t.writeInt16LE=F.writeInt16LE,t.writeInt16BE=F.writeInt16BE,t.writeInt32LE=F.writeInt32LE,t.writeInt32BE=F.writeInt32BE,t.writeFloatLE=F.writeFloatLE,t.writeFloatBE=F.writeFloatBE,t.writeDoubleLE=F.writeDoubleLE,t.writeDoubleBE=F.writeDoubleBE,t.fill=F.fill,t.inspect=F.inspect,t.toArrayBuffer=F.toArrayBuffer,t};var B=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":1,ieee754:7,isarray:8}],4:[function(t,e,r){(function(i,n){!function(t,i){"object"==typeof r&&void 0!==e?e.exports=i():t.ES6Promise=i()}(this,function(){"use strict";function e(t){return"function"==typeof t}function r(){var t=setTimeout;return function(){return t(o,1)}}function o(){for(var t=0;t<S;t+=2)(0,D[t])(D[t+1]),D[t]=void 0,D[t+1]=void 0;S=0}function a(t,e){var r=arguments,i=this,n=new this.constructor(h);void 0===n[U]&&b(n);var o=i._state;return o?function(){var t=r[o-1];M(function(){return y(o,n,t,i._result)})}():m(i,n,t,e),n}function s(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(h);return c(e,t),e}function h(){}function l(t){try{return t.then}catch(t){return B.error=t,B}}function u(t,r,i){r.constructor===t.constructor&&i===a&&r.constructor.resolve===s?function(t,e){e._state===O?d(t,e._result):e._state===F?f(t,e._result):m(e,void 0,function(e){return c(t,e)},function(e){return f(t,e)})}(t,r):i===B?(f(t,B.error),B.error=null):void 0===i?d(t,r):e(i)?function(t,e,r){M(function(t){var i=!1,n=function(t,e,r,i){try{t.call(e,r,i)}catch(t){return t}}(r,e,function(r){i||(i=!0,e!==r?c(t,r):d(t,r))},function(e){i||(i=!0,f(t,e))},t._label);!i&&n&&(i=!0,f(t,n))},t)}(t,r,i):d(t,r)}function c(t,e){t===e?f(t,new TypeError("You cannot resolve a promise with itself")):function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}(e)?u(t,e,l(e)):d(t,e)}function p(t){t._onerror&&t._onerror(t._result),v(t)}function d(t,e){t._state===k&&(t._result=e,t._state=O,0!==t._subscribers.length&&M(v,t))}function f(t,e){t._state===k&&(t._state=F,t._result=e,M(p,t))}function m(t,e,r,i){var n=t._subscribers,o=n.length;t._onerror=null,n[o]=e,n[o+O]=r,n[o+F]=i,0===o&&t._state&&M(v,t)}function v(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var i=void 0,n=void 0,o=t._result,a=0;a<e.length;a+=3)i=e[a],n=e[a+r],i?y(r,i,n,o):n(o);t._subscribers.length=0}}function g(){this.error=null}function y(t,r,i,n){var o=e(i),a=void 0,s=void 0,h=void 0,l=void 0;if(o){if((a=function(t,e){try{return t(e)}catch(t){return N.error=t,N}}(i,n))===N?(l=!0,s=a.error,a.error=null):h=!0,r===a)return void f(r,new TypeError("A promises callback cannot return that same promise."))}else a=n,h=!0;r._state!==k||(o&&h?c(r,a):l?f(r,s):t===O?d(r,a):t===F&&f(r,a))}function b(t){t[U]=G++,t._state=void 0,t._result=void 0,t._subscribers=[]}function _(t,e){this._instanceConstructor=t,this.promise=new t(h),this.promise[U]||b(this.promise),w(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?d(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&d(this.promise,this._result))):f(this.promise,new Error("Array Methods must be provided an Array"))}function x(t){this[U]=G++,this._result=this._state=void 0,this._subscribers=[],h!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof x?function(t,e){try{e(function(e){c(t,e)},function(e){f(t,e)})}catch(e){f(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}var w=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},S=0,T=void 0,E=void 0,M=function(t,e){D[S]=t,D[S+1]=e,2===(S+=2)&&(E?E(o):I())},R="undefined"!=typeof window?window:void 0,C=R||{},P=C.MutationObserver||C.WebKitMutationObserver,L="undefined"==typeof self&&void 0!==i&&"[object process]"==={}.toString.call(i),A="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,D=new Array(1e3),I=void 0;I=L?function(){return i.nextTick(o)}:P?function(){var t=0,e=new P(o),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}():A?function(){var t=new MessageChannel;return t.port1.onmessage=o,function(){return t.port2.postMessage(0)}}():void 0===R&&"function"==typeof t?function(){try{var e=t("vertx");return void 0!==(T=e.runOnLoop||e.runOnContext)?function(){T(o)}:r()}catch(t){return r()}}():r();var U=Math.random().toString(36).substring(16),k=void 0,O=1,F=2,B=new g,N=new g,G=0;return _.prototype._enumerate=function(t){for(var e=0;this._state===k&&e<t.length;e++)this._eachEntry(t[e],e)},_.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,i=r.resolve;if(i===s){var n=l(t);if(n===a&&t._state!==k)this._settledAt(t._state,e,t._result);else if("function"!=typeof n)this._remaining--,this._result[e]=t;else if(r===x){var o=new r(h);u(o,t,n),this._willSettleAt(o,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(i(t),e)},_.prototype._settledAt=function(t,e,r){var i=this.promise;i._state===k&&(this._remaining--,t===F?f(i,r):this._result[e]=r),0===this._remaining&&d(i,this._result)},_.prototype._willSettleAt=function(t,e){var r=this;m(t,void 0,function(t){return r._settledAt(O,e,t)},function(t){return r._settledAt(F,e,t)})},x.all=function(t){return new _(this,t).promise},x.race=function(t){var e=this;return new e(w(t)?function(r,i){for(var n=t.length,o=0;o<n;o++)e.resolve(t[o]).then(r,i)}:function(t,e){return e(new TypeError("You must pass an array to race."))})},x.resolve=s,x.reject=function(t){var e=new this(h);return f(e,t),e},x._setScheduler=function(t){E=t},x._setAsap=function(t){M=t},x._asap=M,x.prototype={constructor:x,then:a,catch:function(t){return this.then(null,t)}},x.polyfill=function(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=x},x.Promise=x,x})}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:10}],5:[function(t,e,r){!function(t,i){if(void 0!==r&&void 0!==e)i(r,e);else{var n={exports:{}};i(n.exports,n),t.fetchJsonp=n.exports}}(this,function(t,e){"use strict";function r(t){try{delete window[t]}catch(e){window[t]=void 0}}function i(t){var e=document.getElementById(t);e&&document.getElementsByTagName("head")[0].removeChild(e)}var n={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};e.exports=function(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=t,a=e.timeout||n.timeout,s=e.jsonpCallback||n.jsonpCallback,h=void 0;return new Promise(function(n,l){var u=e.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),c=s+"_"+u;window[u]=function(t){n({ok:!0,json:function(){return Promise.resolve(t)}}),h&&clearTimeout(h),i(c),r(u)},o+=-1===o.indexOf("?")?"?":"&";var p=document.createElement("script");p.setAttribute("src",""+o+s+"="+u),e.charset&&p.setAttribute("charset",e.charset),p.id=c,document.getElementsByTagName("head")[0].appendChild(p),h=setTimeout(function(){l(new Error("JSONP request to "+t+" timed out")),r(u),i(c),window[u]=function(){r(u)}},a),p.onerror=function(){l(new Error("JSONP request to "+t+" failed")),r(u),i(c),h&&clearTimeout(h)}})}})},{}],6:[function(t,e,r){var i=i||function(t){"use strict";if(!(void 0===t||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var e=function(){return t.URL||t.webkitURL||t},r=t.document.createElementNS("http://www.w3.org/1999/xhtml","a"),i="download"in r,n=/constructor/i.test(t.HTMLElement)||t.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent),a=function(e){(t.setImmediate||t.setTimeout)(function(){throw e},0)},s=function(t){setTimeout(function(){"string"==typeof t?e().revokeObjectURL(t):t.remove()},4e4)},h=function(t,e,r){for(var i=(e=[].concat(e)).length;i--;){var n=t["on"+e[i]];if("function"==typeof n)try{n.call(t,r||t)}catch(t){a(t)}}},l=function(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob([String.fromCharCode(65279),t],{type:t.type}):t},u=function(a,u,c){c||(a=l(a));var p,d=this,f="application/octet-stream"===a.type,m=function(){h(d,"writestart progress write writeend".split(" "))};if(d.readyState=d.INIT,i)return p=e().createObjectURL(a),void setTimeout(function(){r.href=p,r.download=u,function(t){var e=new MouseEvent("click");t.dispatchEvent(e)}(r),m(),s(p),d.readyState=d.DONE});!function(){if((o||f&&n)&&t.FileReader){var r=new FileReader;return r.onloadend=function(){var e=o?r.result:r.result.replace(/^data:[^;]*;/,"data:attachment/file;");t.open(e,"_blank")||(t.location.href=e),e=void 0,d.readyState=d.DONE,m()},r.readAsDataURL(a),void(d.readyState=d.INIT)}p||(p=e().createObjectURL(a)),f?t.location.href=p:t.open(p,"_blank")||(t.location.href=p),d.readyState=d.DONE,m(),s(p)}()},c=u.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e,r){return e=e||t.name||"download",r||(t=l(t)),navigator.msSaveOrOpenBlob(t,e)}:(c.abort=function(){},c.readyState=c.INIT=0,c.WRITING=1,c.DONE=2,c.error=c.onwritestart=c.onprogress=c.onwrite=c.onabort=c.onerror=c.onwriteend=null,function(t,e,r){return new u(t,e||t.name||"download",r)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);void 0!==e&&e.exports&&(e.exports.saveAs=i)},{}],7:[function(t,e,r){r.read=function(t,e,r,i,n){var o,a,s=8*n-i-1,h=(1<<s)-1,l=h>>1,u=-7,c=r?n-1:0,p=r?-1:1,d=t[e+c];for(c+=p,o=d&(1<<-u)-1,d>>=-u,u+=s;u>0;o=256*o+t[e+c],c+=p,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=i;u>0;a=256*a+t[e+c],c+=p,u-=8);if(0===o)o=1-l;else{if(o===h)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,i),o-=l}return(d?-1:1)*a*Math.pow(2,o-i)},r.write=function(t,e,r,i,n,o){var a,s,h,l=8*o-n-1,u=(1<<l)-1,c=u>>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,f=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-a))<1&&(a--,h*=2),(e+=a+c>=1?p/h:p*Math.pow(2,1-c))*h>=2&&(a++,h/=2),a+c>=u?(s=0,a=u):a+c>=1?(s=(e*h-1)*Math.pow(2,n),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,n),a=0));n>=8;t[r+d]=255&s,d+=f,s/=256,n-=8);for(a=a<<n|s,l+=n;l>0;t[r+d]=255&a,d+=f,a/=256,l-=8);t[r+d-f]|=128*m}},{}],8:[function(t,e,r){var i={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==i.call(t)}},{}],9:[function(t,e,r){(function(i){!function(t,i){i("object"==typeof r&&void 0!==e?r:t.opentype=t.opentype||{})}(this,function(e){"use strict";function r(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function n(t,e){this.source=t,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=e,this.destLen=0,this.ltree=new r,this.dtree=new r}function o(t,e,r,i){var n,o;for(n=0;n<r;++n)t[n]=0;for(n=0;n<30-r;++n)t[n+r]=n/r|0;for(o=i,n=0;n<30;++n)e[n]=o,o+=1<<t[n]}function a(t,e,r,i){var n,o;for(n=0;n<16;++n)t.table[n]=0;for(n=0;n<i;++n)t.table[e[r+n]]++;for(t.table[0]=0,o=0,n=0;n<16;++n)ke[n]=o,o+=t.table[n];for(n=0;n<i;++n)e[r+n]&&(t.trans[ke[e[r+n]]++]=n)}function s(t){t.bitcount--||(t.tag=t.source[t.sourceIndex++],t.bitcount=7);var e=1&t.tag;return t.tag>>>=1,e}function h(t,e,r){if(!e)return r;for(;t.bitcount<24;)t.tag|=t.source[t.sourceIndex++]<<t.bitcount,t.bitcount+=8;var i=t.tag&65535>>>16-e;return t.tag>>>=e,t.bitcount-=e,i+r}function l(t,e){for(;t.bitcount<24;)t.tag|=t.source[t.sourceIndex++]<<t.bitcount,t.bitcount+=8;var r=0,i=0,n=0,o=t.tag;do{i=2*i+(1&o),o>>>=1,++n,r+=e.table[n],i-=e.table[n]}while(i>=0);return t.tag=o,t.bitcount-=n,e.trans[r+i]}function u(t,e,r){var i,n,o,s,u,c;for(i=h(t,5,257),n=h(t,5,1),o=h(t,4,4),s=0;s<19;++s)Ue[s]=0;for(s=0;s<o;++s){var p=h(t,3,0);Ue[De[s]]=p}for(a(Ie,Ue,0,19),u=0;u<i+n;){var d=l(t,Ie);switch(d){case 16:var f=Ue[u-1];for(c=h(t,2,3);c;--c)Ue[u++]=f;break;case 17:for(c=h(t,3,3);c;--c)Ue[u++]=0;break;case 18:for(c=h(t,7,11);c;--c)Ue[u++]=0;break;default:Ue[u++]=d}}a(e,Ue,0,i),a(r,Ue,i,n)}function c(t,e,r){for(;;){var i,n,o,a,s=l(t,e);if(256===s)return Te;if(s<256)t.dest[t.destLen++]=s;else for(i=h(t,Ce[s-=257],Pe[s]),n=l(t,r),a=o=t.destLen-h(t,Le[n],Ae[n]);a<o+i;++a)t.dest[t.destLen++]=t.dest[a]}}function p(t){for(var e,r;t.bitcount>8;)t.sourceIndex--,t.bitcount-=8;if((e=256*(e=t.source[t.sourceIndex+1])+t.source[t.sourceIndex])!==(65535&~(256*t.source[t.sourceIndex+3]+t.source[t.sourceIndex+2])))return Ee;for(t.sourceIndex+=4,r=e;r;--r)t.dest[t.destLen++]=t.source[t.sourceIndex++];return t.bitcount=0,Te}function d(t,e,r,i,n){return Math.pow(1-n,3)*t+3*Math.pow(1-n,2)*n*e+3*(1-n)*Math.pow(n,2)*r+Math.pow(n,3)*i}function f(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}function m(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}function v(t){throw new Error(t)}function g(t,e){t||v(e)}function y(t){return function(){return t}}function b(t){return t>=-128&&t<=127}function _(t,e,r){for(var i=0,n=t.length;e<n&&i<64&&0===t[e];)++e,++i;return r.push(128|i-1),e}function x(t,e,r){for(var i=0,n=t.length,o=e;o<n&&i<64;){var a=t[o];if(!b(a))break;if(0===a&&o+1<n&&0===t[o+1])break;++o,++i}r.push(i-1);for(var s=e;s<o;++s)r.push(t[s]+256&255);return o}function w(t,e,r){for(var i=0,n=t.length,o=e;o<n&&i<64;){var a=t[o];if(0===a)break;if(b(a)&&o+1<n&&b(t[o+1]))break;++o,++i}r.push(64|i-1);for(var s=e;s<o;++s){var h=t[s];r.push(h+65536>>8&255,h+256&255)}return o}function S(t,e,r){for(var i=this,n=0;n<e.length;n+=1){var o=e[n];i[o.name]=o.value}if(this.tableName=t,this.fields=e,r)for(var a=Object.keys(r),s=0;s<a.length;s+=1){var h=a[s],l=r[h];void 0!==i[h]&&(i[h]=l)}}function T(t,e,r){void 0===r&&(r=e.length);var i=new Array(e.length+1);i[0]={name:t+"Count",type:"USHORT",value:r};for(var n=0;n<e.length;n++)i[n+1]={name:t+n,type:"USHORT",value:e[n]};return i}function E(t,e,r){var i=e.length,n=new Array(i+1);n[0]={name:t+"Count",type:"USHORT",value:i};for(var o=0;o<i;o++)n[o+1]={name:t+o,type:"TABLE",value:r(e[o],o)};return n}function M(t,e,r){var i=e.length,n=[];n[0]={name:t+"Count",type:"USHORT",value:i};for(var o=0;o<i;o++)n=n.concat(r(e[o],o));return n}function R(t){1===t.format?S.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(T("glyph",t.glyphs))):Fe.assert(!1,"Can't create coverage table format 2 yet.")}function C(t){S.call(this,"scriptListTable",M("scriptRecord",t,function(t,e){var r=t.script,i=r.defaultLangSys;return Fe.assert(!!i,"Unable to write GSUB: script "+t.tag+" has no default language system."),[{name:"scriptTag"+e,type:"TAG",value:t.tag},{name:"script"+e,type:"TABLE",value:new S("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new S("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:i.reqFeatureIndex}].concat(T("featureIndex",i.featureIndexes)))}].concat(M("langSys",r.langSysRecords,function(t,e){var r=t.langSys;return[{name:"langSysTag"+e,type:"TAG",value:t.tag},{name:"langSys"+e,type:"TABLE",value:new S("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:r.reqFeatureIndex}].concat(T("featureIndex",r.featureIndexes)))}]})))}]}))}function P(t){S.call(this,"featureListTable",M("featureRecord",t,function(t,e){var r=t.feature;return[{name:"featureTag"+e,type:"TAG",value:t.tag},{name:"feature"+e,type:"TABLE",value:new S("featureTable",[{name:"featureParams",type:"USHORT",value:r.featureParams}].concat(T("lookupListIndex",r.lookupListIndexes)))}]}))}function L(t,e){S.call(this,"lookupListTable",E("lookup",t,function(t){var r=e[t.lookupType];return Fe.assert(!!r,"Unable to write GSUB lookup type "+t.lookupType+" tables."),new S("lookupTable",[{name:"lookupType",type:"USHORT",value:t.lookupType},{name:"lookupFlag",type:"USHORT",value:t.lookupFlag}].concat(E("subtable",t.subtables,r)))}))}function A(t,e){return t.getUint8(e)}function D(t,e){return t.getUint16(e,!1)}function I(t,e){return t.getUint32(e,!1)}function U(t,e){return t.getInt16(e,!1)+t.getUint16(e+2,!1)/65535}function k(t,e){this.data=t,this.offset=e,this.relativeOffset=0}function O(t,e,r){t.segments.push({end:e,start:e,delta:-(e-r),offset:0})}function F(t){this.font=t}function B(t){this.cmap=t}function N(t,e){this.encoding=t,this.charset=e}function G(t){var e=this;switch(t.version){case 1:this.names=tr.slice();break;case 2:this.names=new Array(t.numberOfGlyphs);for(var r=0;r<t.numberOfGlyphs;r++)t.glyphNameIndex[r]<tr.length?e.names[r]=tr[t.glyphNameIndex[r]]:e.names[r]=t.names[t.glyphNameIndex[r]-tr.length];break;case 2.5:this.names=new Array(t.numberOfGlyphs);for(var i=0;i<t.numberOfGlyphs;i++)e.names[i]=tr[i+t.glyphNameIndex[i]];break;case 3:default:this.names=[]}}function H(t,e,r,i,n){var o;return(e&i)>0?(o=t.parseByte(),0==(e&n)&&(o=-o),o=r+o):o=(e&n)>0?r:r+t.parseShort(),o}function V(t,e,r){var i,n,o=new Ze.Parser(e,r);if(t.numberOfContours=o.parseShort(),t._xMin=o.parseShort(),t._yMin=o.parseShort(),t._xMax=o.parseShort(),t._yMax=o.parseShort(),t.numberOfContours>0){for(var a=t.endPointIndices=[],s=0;s<t.numberOfContours;s+=1)a.push(o.parseUShort());t.instructionLength=o.parseUShort(),t.instructions=[];for(var h=0;h<t.instructionLength;h+=1)t.instructions.push(o.parseByte());var l=a[a.length-1]+1;i=[];for(var u=0;u<l;u+=1)if(n=o.parseByte(),i.push(n),(8&n)>0)for(var c=o.parseByte(),p=0;p<c;p+=1)i.push(n),u+=1;if(Fe.argument(i.length===l,"Bad flags."),a.length>0){var d,f=[];if(l>0){for(var m=0;m<l;m+=1)n=i[m],(d={}).onCurve=!!(1&n),d.lastPointOfContour=a.indexOf(m)>=0,f.push(d);for(var v=0,g=0;g<l;g+=1)n=i[g],(d=f[g]).x=H(o,n,v,2,16),v=d.x;for(var y=0,b=0;b<l;b+=1)n=i[b],(d=f[b]).y=H(o,n,y,4,32),y=d.y}t.points=f}else t.points=[]}else if(0===t.numberOfContours)t.points=[];else{t.isComposite=!0,t.points=[],t.components=[];for(var _=!0;_;){i=o.parseUShort();var x={glyphIndex:o.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(1&i)>0?(2&i)>0?(x.dx=o.parseShort(),x.dy=o.parseShort()):x.matchedPoints=[o.parseUShort(),o.parseUShort()]:(2&i)>0?(x.dx=o.parseChar(),x.dy=o.parseChar()):x.matchedPoints=[o.parseByte(),o.parseByte()],(8&i)>0?x.xScale=x.yScale=o.parseF2Dot14():(64&i)>0?(x.xScale=o.parseF2Dot14(),x.yScale=o.parseF2Dot14()):(128&i)>0&&(x.xScale=o.parseF2Dot14(),x.scale01=o.parseF2Dot14(),x.scale10=o.parseF2Dot14(),x.yScale=o.parseF2Dot14()),t.components.push(x),_=!!(32&i)}if(256&i){t.instructionLength=o.parseUShort(),t.instructions=[];for(var w=0;w<t.instructionLength;w+=1)t.instructions.push(o.parseByte())}}}function z(t,e){for(var r=[],i=0;i<t.length;i+=1){var n=t[i],o={x:e.xScale*n.x+e.scale01*n.y+e.dx,y:e.scale10*n.x+e.yScale*n.y+e.dy,onCurve:n.onCurve,lastPointOfContour:n.lastPointOfContour};r.push(o)}return r}function j(t){var e=new m;if(!t)return e;for(var r=function(t){for(var e=[],r=[],i=0;i<t.length;i+=1){var n=t[i];r.push(n),n.lastPointOfContour&&(e.push(r),r=[])}return Fe.argument(0===r.length,"There are still points left in the current contour."),e}(t),i=0;i<r.length;++i){var n=r[i],o=null,a=n[n.length-1],s=n[0];if(a.onCurve)e.moveTo(a.x,a.y);else if(s.onCurve)e.moveTo(s.x,s.y);else{var h={x:.5*(a.x+s.x),y:.5*(a.y+s.y)};e.moveTo(h.x,h.y)}for(var l=0;l<n.length;++l)if(o=a,a=s,s=n[(l+1)%n.length],a.onCurve)e.lineTo(a.x,a.y);else{var u=o,c=s;o.onCurve||(u={x:.5*(a.x+o.x),y:.5*(a.y+o.y)},e.lineTo(u.x,u.y)),s.onCurve||(c={x:.5*(a.x+s.x),y:.5*(a.y+s.y)}),e.lineTo(u.x,u.y),e.quadraticCurveTo(a.x,a.y,c.x,c.y)}e.closePath()}return e}function W(t,e){if(e.isComposite)for(var r=0;r<e.components.length;r+=1){var i=e.components[r],n=t.get(i.glyphIndex);if(n.getPath(),n.points){var o=void 0;if(void 0===i.matchedPoints)o=z(n.points,i);else{if(i.matchedPoints[0]>e.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+e.name);var a=e.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],h={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=z([s],h)[0],h.dx=a.x-s.x,h.dy=a.y-s.y,o=z(n.points,h)}e.points=e.points.concat(o)}}return j(e.points)}function X(t){this.bindConstructorValues(t)}function Y(t,e,r){Object.defineProperty(t,e,{get:function(){return t.path,t[r]},set:function(e){t[r]=e},enumerable:!0,configurable:!0})}function q(t,e){if(this.font=t,this.glyphs={},Array.isArray(e))for(var r=0;r<e.length;r++)this.glyphs[r]=e[r];this.length=e&&e.length||0}function Z(t,e){if(t===e)return!0;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r+=1)if(!Z(t[r],e[r]))return!1;return!0}return!1}function J(t){return t.length<1240?107:t.length<33900?1131:32768}function Q(t,e,r){var i,n,o=[],a=[],s=Ze.getCard16(t,e);if(0!==s){var h=Ze.getByte(t,e+2);i=e+(s+1)*h+2;for(var l=e+3,u=0;u<s+1;u+=1)o.push(Ze.getOffset(t,l,h)),l+=h;n=i+o[s]}else n=e+2;for(var c=0;c<o.length-1;c+=1){var p=Ze.getBytes(t,i+o[c],i+o[c+1]);r&&(p=r(p)),a.push(p)}return{objects:a,startOffset:e,endOffset:n}}function K(t,e){if(28===e)return t.parseByte()<<8|t.parseByte();if(29===e)return t.parseByte()<<24|t.parseByte()<<16|t.parseByte()<<8|t.parseByte();if(30===e)return function(t){for(var e="",r=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var i=t.parseByte(),n=i>>4,o=15&i;if(15===n)break;if(e+=r[n],15===o)break;e+=r[o]}return parseFloat(e)}(t);if(e>=32&&e<=246)return e-139;if(e>=247&&e<=250)return 256*(e-247)+t.parseByte()+108;if(e>=251&&e<=254)return 256*-(e-251)-t.parseByte()-108;throw new Error("Invalid b0 "+e)}function $(t,e,r){e=void 0!==e?e:0;var i=new Ze.Parser(t,e),n=[],o=[];for(r=void 0!==r?r:t.length;i.relativeOffset<r;){var a=i.parseByte();a<=21?(12===a&&(a=1200+i.parseByte()),n.push([a,o]),o=[]):o.push(K(i,a))}return function(t){for(var e={},r=0;r<t.length;r+=1){var i,n=t[r][0],o=t[r][1];if(i=1===o.length?o[0]:o,e.hasOwnProperty(n)&&!isNaN(e[n]))throw new Error("Object "+e+" already has key "+n);e[n]=i}return e}(n)}function tt(t,e){return e<=390?Qe[e]:t[e-391]}function et(t,e,r){for(var i,n={},o=0;o<e.length;o+=1){var a=e[o];if(Array.isArray(a.type)){var s=[];s.length=a.type.length;for(var h=0;h<a.type.length;h++)void 0===(i=void 0!==t[a.op]?t[a.op][h]:void 0)&&(i=void 0!==a.value&&void 0!==a.value[h]?a.value[h]:null),"SID"===a.type[h]&&(i=tt(r,i)),s[h]=i;n[a.name]=s}else void 0===(i=t[a.op])&&(i=void 0!==a.value?a.value:null),"SID"===a.type&&(i=tt(r,i)),n[a.name]=i}return n}function rt(t,e){return et($(t,0,t.byteLength),nr,e)}function it(t,e,r,i){return et($(t,e,r),or,i)}function nt(t,e,r,i){for(var n=[],o=0;o<r.length;o+=1){var a=rt(new DataView(new Uint8Array(r[o]).buffer),i);a._subrs=[],a._subrsBias=0;var s=a.private[0],h=a.private[1];if(0!==s&&0!==h){var l=it(t,h+e,s,i);if(a._defaultWidthX=l.defaultWidthX,a._nominalWidthX=l.nominalWidthX,0!==l.subrs){var u=Q(t,h+l.subrs+e);a._subrs=u.objects,a._subrsBias=J(a._subrs)}a._privateDict=l}n.push(a)}return n}function ot(t,e,r){function i(t,e){y&&d.closePath(),d.moveTo(t,e),y=!0}function n(){f.length%2!=0&&!g&&(S=f.shift()+p),v+=f.length>>1,f.length=0,g=!0}var o,a,s,h,l,u,c,p,d=new m,f=[],v=0,g=!1,y=!1,b=0,_=0;if(t.isCIDFont){var x=t.tables.cff.topDict._fdSelect[e.index],w=t.tables.cff.topDict._fdArray[x];l=w._subrs,u=w._subrsBias,c=w._defaultWidthX,p=w._nominalWidthX}else l=t.tables.cff.topDict._subrs,u=t.tables.cff.topDict._subrsBias,c=t.tables.cff.topDict._defaultWidthX,p=t.tables.cff.topDict._nominalWidthX;var S=c;return function r(c){for(var m,x,w,T,E,M,R,C,P,L,A,D,I=0;I<c.length;){var U=c[I];switch(I+=1,U){case 1:case 3:n();break;case 4:f.length>1&&!g&&(S=f.shift()+p,g=!0),_+=f.pop(),i(b,_);break;case 5:for(;f.length>0;)b+=f.shift(),_+=f.shift(),d.lineTo(b,_);break;case 6:for(;f.length>0&&(b+=f.shift(),d.lineTo(b,_),0!==f.length);)_+=f.shift(),d.lineTo(b,_);break;case 7:for(;f.length>0&&(_+=f.shift(),d.lineTo(b,_),0!==f.length);)b+=f.shift(),d.lineTo(b,_);break;case 8:for(;f.length>0;)o=b+f.shift(),a=_+f.shift(),s=o+f.shift(),h=a+f.shift(),b=s+f.shift(),_=h+f.shift(),d.curveTo(o,a,s,h,b,_);break;case 10:E=f.pop()+u,(M=l[E])&&r(M);break;case 11:return;case 12:switch(U=c[I],I+=1,U){case 35:o=b+f.shift(),a=_+f.shift(),s=o+f.shift(),h=a+f.shift(),R=s+f.shift(),C=h+f.shift(),P=R+f.shift(),L=C+f.shift(),A=P+f.shift(),D=L+f.shift(),b=A+f.shift(),_=D+f.shift(),f.shift(),d.curveTo(o,a,s,h,R,C),d.curveTo(P,L,A,D,b,_);break;case 34:o=b+f.shift(),a=_,s=o+f.shift(),h=a+f.shift(),R=s+f.shift(),C=h,P=R+f.shift(),L=h,A=P+f.shift(),D=_,b=A+f.shift(),d.curveTo(o,a,s,h,R,C),d.curveTo(P,L,A,D,b,_);break;case 36:o=b+f.shift(),a=_+f.shift(),s=o+f.shift(),h=a+f.shift(),R=s+f.shift(),C=h,P=R+f.shift(),L=h,A=P+f.shift(),D=L+f.shift(),b=A+f.shift(),d.curveTo(o,a,s,h,R,C),d.curveTo(P,L,A,D,b,_);break;case 37:o=b+f.shift(),a=_+f.shift(),s=o+f.shift(),h=a+f.shift(),R=s+f.shift(),C=h+f.shift(),P=R+f.shift(),L=C+f.shift(),A=P+f.shift(),D=L+f.shift(),Math.abs(A-b)>Math.abs(D-_)?b=A+f.shift():_=D+f.shift(),d.curveTo(o,a,s,h,R,C),d.curveTo(P,L,A,D,b,_);break;default:console.log("Glyph "+e.index+": unknown operator 1200"+U),f.length=0}break;case 14:f.length>0&&!g&&(S=f.shift()+p,g=!0),y&&(d.closePath(),y=!1);break;case 18:n();break;case 19:case 20:n(),I+=v+7>>3;break;case 21:f.length>2&&!g&&(S=f.shift()+p,g=!0),_+=f.pop(),i(b+=f.pop(),_);break;case 22:f.length>1&&!g&&(S=f.shift()+p,g=!0),i(b+=f.pop(),_);break;case 23:n();break;case 24:for(;f.length>2;)o=b+f.shift(),a=_+f.shift(),s=o+f.shift(),h=a+f.shift(),b=s+f.shift(),_=h+f.shift(),d.curveTo(o,a,s,h,b,_);b+=f.shift(),_+=f.shift(),d.lineTo(b,_);break;case 25:for(;f.length>6;)b+=f.shift(),_+=f.shift(),d.lineTo(b,_);o=b+f.shift(),a=_+f.shift(),s=o+f.shift(),h=a+f.shift(),b=s+f.shift(),_=h+f.shift(),d.curveTo(o,a,s,h,b,_);break;case 26:for(f.length%2&&(b+=f.shift());f.length>0;)o=b,a=_+f.shift(),s=o+f.shift(),h=a+f.shift(),b=s,_=h+f.shift(),d.curveTo(o,a,s,h,b,_);break;case 27:for(f.length%2&&(_+=f.shift());f.length>0;)o=b+f.shift(),a=_,s=o+f.shift(),h=a+f.shift(),b=s+f.shift(),_=h,d.curveTo(o,a,s,h,b,_);break;case 28:m=c[I],x=c[I+1],f.push((m<<24|x<<16)>>16),I+=2;break;case 29:E=f.pop()+t.gsubrsBias,(M=t.gsubrs[E])&&r(M);break;case 30:for(;f.length>0&&(o=b,a=_+f.shift(),s=o+f.shift(),h=a+f.shift(),b=s+f.shift(),_=h+(1===f.length?f.shift():0),d.curveTo(o,a,s,h,b,_),0!==f.length);)o=b+f.shift(),a=_,s=o+f.shift(),h=a+f.shift(),_=h+f.shift(),b=s+(1===f.length?f.shift():0),d.curveTo(o,a,s,h,b,_);break;case 31:for(;f.length>0&&(o=b+f.shift(),a=_,s=o+f.shift(),h=a+f.shift(),_=h+f.shift(),b=s+(1===f.length?f.shift():0),d.curveTo(o,a,s,h,b,_),0!==f.length);)o=b,a=_+f.shift(),s=o+f.shift(),h=a+f.shift(),b=s+f.shift(),_=h+(1===f.length?f.shift():0),d.curveTo(o,a,s,h,b,_);break;default:U<32?console.log("Glyph "+e.index+": unknown operator "+U):U<247?f.push(U-139):U<251?(m=c[I],I+=1,f.push(256*(U-247)+m+108)):U<255?(m=c[I],I+=1,f.push(256*-(U-251)-m-108)):(m=c[I],x=c[I+1],w=c[I+2],T=c[I+3],I+=4,f.push((m<<24|x<<16|w<<8|T)/65536))}}}(r),e.advanceWidth=S,d}function at(t,e){var r,i=Qe.indexOf(t);return i>=0&&(r=i),(i=e.indexOf(t))>=0?r=i+Qe.length:(r=Qe.length+e.length,e.push(t)),r}function st(t,e,r){for(var i={},n=0;n<t.length;n+=1){var o=t[n],a=e[o.name];void 0===a||Z(a,o.value)||("SID"===o.type&&(a=at(a,r)),i[o.op]={name:o.name,type:o.type,value:a})}return i}function ht(t,e){var r=new Xe.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return r.dict=st(nr,t,e),r}function lt(t){var e=new Xe.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return e.topDicts=[{name:"topDict_0",type:"TABLE",value:t}],e}function ut(t){var e=[],r=t.path;e.push({name:"width",type:"NUMBER",value:t.advanceWidth});for(var i=0,n=0,o=0;o<r.commands.length;o+=1){var a=void 0,s=void 0,h=r.commands[o];if("Q"===h.type){var l=1/3,u=2/3;h={type:"C",x:h.x,y:h.y,x1:l*i+u*h.x1,y1:l*n+u*h.y1,x2:l*h.x+u*h.x1,y2:l*h.y+u*h.y1}}if("M"===h.type)a=Math.round(h.x-i),s=Math.round(h.y-n),e.push({name:"dx",type:"NUMBER",value:a}),e.push({name:"dy",type:"NUMBER",value:s}),e.push({name:"rmoveto",type:"OP",value:21}),i=Math.round(h.x),n=Math.round(h.y);else if("L"===h.type)a=Math.round(h.x-i),s=Math.round(h.y-n),e.push({name:"dx",type:"NUMBER",value:a}),e.push({name:"dy",type:"NUMBER",value:s}),e.push({name:"rlineto",type:"OP",value:5}),i=Math.round(h.x),n=Math.round(h.y);else if("C"===h.type){var c=Math.round(h.x1-i),p=Math.round(h.y1-n),d=Math.round(h.x2-h.x1),f=Math.round(h.y2-h.y1);a=Math.round(h.x-h.x2),s=Math.round(h.y-h.y2),e.push({name:"dx1",type:"NUMBER",value:c}),e.push({name:"dy1",type:"NUMBER",value:p}),e.push({name:"dx2",type:"NUMBER",value:d}),e.push({name:"dy2",type:"NUMBER",value:f}),e.push({name:"dx",type:"NUMBER",value:a}),e.push({name:"dy",type:"NUMBER",value:s}),e.push({name:"rrcurveto",type:"OP",value:8}),i=Math.round(h.x),n=Math.round(h.y)}}return e.push({name:"endchar",type:"OP",value:14}),e}function ct(t,e,r){switch(t){case 0:if(65535===e)return"und";if(r)return r[e];break;case 1:return dr[e];case 3:return mr[e]}}function pt(t,e,r){switch(t){case 0:return vr;case 1:return yr[r]||gr[e];case 3:if(1===e||10===e)return vr}}function dt(t){var e={};for(var r in t)e[t[r]]=parseInt(r);return e}function ft(t,e,r,i,n,o){return new Xe.Record("NameRecord",[{name:"platformID",type:"USHORT",value:t},{name:"encodingID",type:"USHORT",value:e},{name:"languageID",type:"USHORT",value:r},{name:"nameID",type:"USHORT",value:i},{name:"length",type:"USHORT",value:n},{name:"offset",type:"USHORT",value:o}])}function mt(t,e){var r=function(t,e){var r=t.length,i=e.length-r+1;t:for(var n=0;n<i;n++)for(;n<i;n++){for(var o=0;o<r;o++)if(e[n+o]!==t[o])continue t;return n}return-1}(t,e);if(r<0){r=e.length;for(var i=0,n=t.length;i<n;++i)e.push(t[i])}return r}function vt(t){return Math.log(t)/Math.log(2)|0}function gt(t){for(;t.length%4!=0;)t.push(0);for(var e=0,r=0;r<t.length;r+=4)e+=(t[r]<<24)+(t[r+1]<<16)+(t[r+2]<<8)+t[r+3];return e%Math.pow(2,32)}function yt(t,e,r,i){return new Xe.Record("Table Record",[{name:"tag",type:"TAG",value:void 0!==t?t:""},{name:"checkSum",type:"ULONG",value:void 0!==e?e:0},{name:"offset",type:"ULONG",value:void 0!==r?r:0},{name:"length",type:"ULONG",value:void 0!==i?i:0}])}function bt(t){var e=new Xe.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);e.tables=t,e.numTables=t.length;var r=Math.pow(2,vt(e.numTables));e.searchRange=16*r,e.entrySelector=vt(r),e.rangeShift=16*e.numTables-e.searchRange;for(var i=[],n=[],o=e.sizeOf()+yt().sizeOf()*e.numTables;o%4!=0;)o+=1,n.push({name:"padding",type:"BYTE",value:0});for(var a=0;a<t.length;a+=1){var s=t[a];Fe.argument(4===s.tableName.length,"Table name"+s.tableName+" is invalid.");var h=s.sizeOf(),l=yt(s.tableName,gt(s.encode()),o,h);for(i.push({name:l.tag+" Table Record",type:"RECORD",value:l}),n.push({name:s.tableName+" table",type:"RECORD",value:s}),o+=h,Fe.argument(!isNaN(o),"Something went wrong calculating the offset.");o%4!=0;)o+=1,n.push({name:"padding",type:"BYTE",value:0})}return i.sort(function(t,e){return t.value.tag>e.value.tag?1:-1}),e.fields=e.fields.concat(i),e.fields=e.fields.concat(n),e}function _t(t,e,r){for(var i=0;i<e.length;i+=1){var n=t.charToGlyphIndex(e[i]);if(n>0)return t.glyphs.get(n).getMetrics()}return r}function xt(t,e){for(var r=0,i=t.length-1;r<=i;){var n=r+i>>>1,o=t[n].tag;if(o===e)return n;o<e?r=n+1:i=n-1}return-r-1}function wt(t,e){this.font=t,this.tableName=e}function St(t){wt.call(this,t,"gsub")}function Tt(t,e){var r=t.length;if(r!==e.length)return!1;for(var i=0;i<r;i++)if(t[i]!==e[i])return!1;return!0}function Et(t,e,r){for(var i=t.subtables,n=0;n<i.length;n++){var o=i[n];if(o.substFormat===e)return o}if(r)return i.push(r),r}function Mt(t){for(var e=new ArrayBuffer(t.length),r=new Uint8Array(e),i=0;i<t.length;++i)r[i]=t[i];return e}function Rt(t){for(var e=new i(t.byteLength),r=new Uint8Array(t),n=0;n<e.length;++n)e[n]=r[n];return e}function Ct(t,e){if(!t)throw e}function Pt(t){this.font=t,this._fpgmState=this._prepState=void 0,this._errorState=0}function Lt(t){return t}function At(t){return Math.sign(t)*Math.round(Math.abs(t))}function Dt(t){return Math.sign(t)*Math.round(Math.abs(2*t))/2}function It(t){return Math.sign(t)*(Math.round(Math.abs(t)+.5)-.5)}function Ut(t){return Math.sign(t)*Math.ceil(Math.abs(t))}function kt(t){return Math.sign(t)*Math.floor(Math.abs(t))}function Ot(t,e){this.x=t,this.y=e,this.axis=void 0,this.slope=e/t,this.normalSlope=-t/e,Object.freeze(this)}function Ft(t,e){var r=Math.sqrt(t*t+e*e);return e/=r,1===(t/=r)&&0===e?Ur:0===t&&1===e?kr:new Ot(t,e)}function Bt(t,e,r,i){this.x=this.xo=Math.round(64*t)/64,this.y=this.yo=Math.round(64*e)/64,this.lastPointOfContour=r,this.onCurve=i,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}function Nt(t,e){switch(this.env=t,this.stack=[],this.prog=e,t){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=Ur,this.round=At}}function Gt(t){for(var e=t.tZone=new Array(t.gZone.length),r=0;r<e.length;r++)e[r]=new Bt(0,0)}function Ht(t,e){var r,i=t.prog,n=t.ip,o=1;do{if(88===(r=i[++n]))o++;else if(89===r)o--;else if(64===r)n+=i[n+1]+1;else if(65===r)n+=2*i[n+1]+1;else if(r>=176&&r<=183)n+=r-176+1;else if(r>=184&&r<=191)n+=2*(r-184+1);else if(e&&1===o&&27===r)break}while(o>0);t.ip=n}function Vt(t,r){e.DEBUG&&console.log(r.step,"SVTCA["+t.axis+"]"),r.fv=r.pv=r.dpv=t}function zt(t,r){e.DEBUG&&console.log(r.step,"SPVTCA["+t.axis+"]"),r.pv=r.dpv=t}function jt(t,r){e.DEBUG&&console.log(r.step,"SFVTCA["+t.axis+"]"),r.fv=t}function Wt(t,r){var i,n,o=r.stack,a=o.pop(),s=o.pop(),h=r.z2[a],l=r.z1[s];e.DEBUG&&console.log("SPVTL["+t+"]",a,s),t?(i=h.y-l.y,n=l.x-h.x):(i=l.x-h.x,n=l.y-h.y),r.pv=r.dpv=Ft(i,n)}function Xt(t,r){var i,n,o=r.stack,a=o.pop(),s=o.pop(),h=r.z2[a],l=r.z1[s];e.DEBUG&&console.log("SFVTL["+t+"]",a,s),t?(i=h.y-l.y,n=l.x-h.x):(i=l.x-h.x,n=l.y-h.y),r.fv=Ft(i,n)}function Yt(t){e.DEBUG&&console.log(t.step,"POP[]"),t.stack.pop()}function qt(t,r){var i=r.stack.pop(),n=r.z0[i],o=r.fv,a=r.pv;e.DEBUG&&console.log(r.step,"MDAP["+t+"]",i);var s=a.distance(n,Or);t&&(s=r.round(s)),o.setRelative(n,Or,s,a),o.touch(n),r.rp0=r.rp1=i}function Zt(t,r){var i,n,o,a=r.z2,s=a.length-2;e.DEBUG&&console.log(r.step,"IUP["+t.axis+"]");for(var h=0;h<s;h++)i=a[h],t.touched(i)||(n=i.prevTouched(t))!==i&&(n===(o=i.nextTouched(t))&&t.setRelative(i,i,t.distance(n,n,!1,!0),t,!0),t.interpolate(i,n,o,t))}function Jt(t,r){for(var i=r.stack,n=t?r.rp1:r.rp2,o=(t?r.z0:r.z1)[n],a=r.fv,s=r.pv,h=r.loop,l=r.z2;h--;){var u=i.pop(),c=l[u],p=s.distance(o,o,!1,!0);a.setRelative(c,c,p,s),a.touch(c),e.DEBUG&&console.log(r.step,(r.loop>1?"loop "+(r.loop-h)+": ":"")+"SHP["+(t?"rp1":"rp2")+"]",u)}r.loop=1}function Qt(t,r){var i=r.stack,n=t?r.rp1:r.rp2,o=(t?r.z0:r.z1)[n],a=r.fv,s=r.pv,h=i.pop(),l=r.z2[r.contours[h]],u=l;e.DEBUG&&console.log(r.step,"SHC["+t+"]",h);var c=s.distance(o,o,!1,!0);do{u!==o&&a.setRelative(u,u,c,s),u=u.nextPointOnContour}while(u!==l)}function Kt(t,r){var i,n=r.stack,o=t?r.rp1:r.rp2,a=(t?r.z0:r.z1)[o],s=r.fv,h=r.pv,l=n.pop();switch(e.DEBUG&&console.log(r.step,"SHZ["+t+"]",l),l){case 0:i=r.tZone;break;case 1:i=r.gZone;break;default:throw new Error("Invalid zone")}for(var u,c=h.distance(a,a,!1,!0),p=i.length-2,d=0;d<p;d++)(u=i[d])!==a&&s.setRelative(u,u,c,h)}function $t(t,r){var i=r.stack,n=i.pop()/64,o=i.pop(),a=r.z1[o],s=r.z0[r.rp0],h=r.fv,l=r.pv;h.setRelative(a,s,n,l),h.touch(a),e.DEBUG&&console.log(r.step,"MSIRP["+t+"]",n,o),r.rp1=r.rp0,r.rp2=o,t&&(r.rp0=o)}function te(t,r){var i=r.stack,n=i.pop(),o=i.pop(),a=r.z0[o],s=r.fv,h=r.pv,l=r.cvt[n];t&&(l=r.round(l)),e.DEBUG&&console.log(r.step,"MIAP["+t+"]",n,"(",l,")",o),s.setRelative(a,Or,l,h),0===r.zp0&&(a.xo=a.x,a.yo=a.y),s.touch(a),r.rp0=r.rp1=o}function ee(t,r){var i=r.stack,n=i.pop(),o=r.z2[n];e.DEBUG&&console.log(r.step,"GC["+t+"]",n),i.push(64*r.dpv.distance(o,Or,t,!1))}function re(t,r){var i=r.stack,n=i.pop(),o=i.pop(),a=r.z1[n],s=r.z0[o],h=r.dpv.distance(s,a,t,t);e.DEBUG&&console.log(r.step,"MD["+t+"]",n,o,"->",h),r.stack.push(Math.round(64*h))}function ie(t,r){var i=r.stack,n=i.pop(),o=r.fv,a=r.pv,s=r.ppem,h=r.deltaBase+16*(t-1),l=r.deltaShift,u=r.z0;e.DEBUG&&console.log(r.step,"DELTAP["+t+"]",n,i);for(var c=0;c<n;c++){var p=i.pop(),d=i.pop();if(h+((240&d)>>4)===s){var f=(15&d)-8;f>=0&&f++,e.DEBUG&&console.log(r.step,"DELTAPFIX",p,"by",f*l);var m=u[p];o.setRelative(m,m,f*l,a)}}}function ne(t,r){var i=r.stack,n=i.pop();e.DEBUG&&console.log(r.step,"ROUND[]"),i.push(64*r.round(n/64))}function oe(t,r){var i=r.stack,n=i.pop(),o=r.ppem,a=r.deltaBase+16*(t-1),s=r.deltaShift;e.DEBUG&&console.log(r.step,"DELTAC["+t+"]",n,i);for(var h=0;h<n;h++){var l=i.pop(),u=i.pop();if(a+((240&u)>>4)===o){var c=(15&u)-8;c>=0&&c++;var p=c*s;e.DEBUG&&console.log(r.step,"DELTACFIX",l,"by",p),r.cvt[l]+=p}}}function ae(t,r){var i,n,o=r.stack,a=o.pop(),s=o.pop(),h=r.z2[a],l=r.z1[s];e.DEBUG&&console.log("SDPVTL["+t+"]",a,s),t?(i=h.y-l.y,n=l.x-h.x):(i=l.x-h.x,n=l.y-h.y),r.dpv=Ft(i,n)}function se(t,r){var i=r.stack,n=r.prog,o=r.ip;e.DEBUG&&console.log(r.step,"PUSHB["+t+"]");for(var a=0;a<t;a++)i.push(n[++o]);r.ip=o}function he(t,r){var i=r.ip,n=r.prog,o=r.stack;e.DEBUG&&console.log(r.ip,"PUSHW["+t+"]");for(var a=0;a<t;a++){var s=n[++i]<<8|n[++i];32768&s&&(s=-(1+(65535^s))),o.push(s)}r.ip=i}function le(t,r,i,n,o,a){var s,h,l,u,c=a.stack,p=t&&c.pop(),d=c.pop(),f=a.rp0,m=a.z0[f],v=a.z1[d],g=a.minDis,y=a.fv,b=a.dpv;l=(h=s=b.distance(v,m,!0,!0))>=0?1:-1,h=Math.abs(h),t&&(u=a.cvt[p],n&&Math.abs(h-u)<a.cvCutIn&&(h=u)),i&&h<g&&(h=g),n&&(h=a.round(h)),y.setRelative(v,m,l*h,b),y.touch(v),e.DEBUG&&console.log(a.step,(t?"MIRP[":"MDRP[")+(r?"M":"m")+(i?">":"_")+(n?"R":"_")+(0===o?"Gr":1===o?"Bl":2===o?"Wh":"")+"]",t?p+"("+a.cvt[p]+","+u+")":"",d,"(d =",s,"->",l*h,")"),a.rp1=a.rp0,a.rp2=d,r&&(a.rp0=d)}function ue(t){(t=t||{}).empty||(Ct(t.familyName,"When creating a new Font object, familyName is required."),Ct(t.styleName,"When creating a new Font object, styleName is required."),Ct(t.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),Ct(t.ascender,"When creating a new Font object, ascender is required."),Ct(t.descender,"When creating a new Font object, descender is required."),Ct(t.descender<0,"Descender should be negative (e.g. -512)."),this.names={fontFamily:{en:t.familyName||" "},fontSubfamily:{en:t.styleName||" "},fullName:{en:t.fullName||t.familyName+" "+t.styleName},postScriptName:{en:t.postScriptName||t.familyName+t.styleName},designer:{en:t.designer||" "},designerURL:{en:t.designerURL||" "},manufacturer:{en:t.manufacturer||" "},manufacturerURL:{en:t.manufacturerURL||" "},license:{en:t.license||" "},licenseURL:{en:t.licenseURL||" "},version:{en:t.version||"Version 0.1"},description:{en:t.description||" "},copyright:{en:t.copyright||" "},trademark:{en:t.trademark||" "}},this.unitsPerEm=t.unitsPerEm||1e3,this.ascender=t.ascender,this.descender=t.descender,this.createdTimestamp=t.createdTimestamp,this.tables={os2:{usWeightClass:t.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:t.widthClass||this.usWidthClasses.MEDIUM,fsSelection:t.fsSelection||this.fsSelectionValues.REGULAR}}),this.supported=!0,this.glyphs=new ir.GlyphSet(this,t.glyphs||[]),this.encoding=new F(this),this.substitution=new St(this),this.tables=this.tables||{},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:"truetype"===this.outlinesFormat?this._hinting=new Pt(this):void 0}})}function ce(t,e){var r=JSON.stringify(t),i=256;for(var n in e){var o=parseInt(n);if(o&&!(o<256)){if(JSON.stringify(e[n])===r)return o;i<=o&&(i=o+1)}}return e[i]=t,i}function pe(t,e,r){var i=ce(e.name,r);return[{name:"tag_"+t,type:"TAG",value:e.tag},{name:"minValue_"+t,type:"FIXED",value:e.minValue<<16},{name:"defaultValue_"+t,type:"FIXED",value:e.defaultValue<<16},{name:"maxValue_"+t,type:"FIXED",value:e.maxValue<<16},{name:"flags_"+t,type:"USHORT",value:0},{name:"nameID_"+t,type:"USHORT",value:i}]}function de(t,e,r){var i={},n=new Ze.Parser(t,e);return i.tag=n.parseTag(),i.minValue=n.parseFixed(),i.defaultValue=n.parseFixed(),i.maxValue=n.parseFixed(),n.skip("uShort",1),i.name=r[n.parseUShort()]||{},i}function fe(t,e,r,i){for(var n=[{name:"nameID_"+t,type:"USHORT",value:ce(e.name,i)},{name:"flags_"+t,type:"USHORT",value:0}],o=0;o<r.length;++o){var a=r[o].tag;n.push({name:"axis_"+t+" "+a,type:"FIXED",value:e.coordinates[a]<<16})}return n}function me(t,e,r,i){var n={},o=new Ze.Parser(t,e);n.name=i[o.parseUShort()]||{},o.skip("uShort",1),n.coordinates={};for(var a=0;a<r.length;++a)n.coordinates[r[a].tag]=o.parseFixed();return n}function ve(t,e){for(var r=new Ze.Parser(t,e),i=r.parseUShort(),n=[],o=0;o<i;o++)n[r.parseTag()]={offset:r.parseUShort()};return n}function ge(t,e){var r=new Ze.Parser(t,e),i=r.parseUShort();if(1===i){var n=r.parseUShort(),o=r.parseUShort(),a=r.parseUShortList(o);return function(t){return a[t-n]||0}}if(2===i){for(var s=r.parseUShort(),h=[],l=[],u=[],c=0;c<s;c++)h[c]=r.parseUShort(),l[c]=r.parseUShort(),u[c]=r.parseUShort();return function(t){for(var e=0,r=h.length-1;e<r;){var i=e+r+1>>1;t<h[i]?r=i-1:e=i}return h[e]<=t&&t<=l[e]&&u[e]||0}}}function ye(t,e){var r,i=new Ze.Parser(t,e),n=i.parseUShort(),o=function(t,e){var r=new Ze.Parser(t,e),i=r.parseUShort(),n=r.parseUShort();if(1===i)return r.parseUShortList(n);if(2===i){for(var o=[];n--;)for(var a=r.parseUShort(),s=r.parseUShort(),h=r.parseUShort(),l=a;l<=s;l++)o[h++]=l;return o}}(t,e+i.parseUShort()),a=i.parseUShort(),s=i.parseUShort();if(4===a&&0===s){var h={};if(1===n){for(var l=i.parseUShort(),u=[],c=i.parseOffset16List(l),p=0;p<l;p++){var d=c[p],f=h[d];if(!f){f={},i.relativeOffset=d;for(var m=i.parseUShort();m--;){var v=i.parseUShort();a&&(r=i.parseShort()),s&&i.parseShort(),f[v]=r}}u[o[p]]=f}return function(t,e){var r=u[t];if(r)return r[e]}}if(2===n){for(var g=i.parseUShort(),y=i.parseUShort(),b=i.parseUShort(),_=i.parseUShort(),x=ge(t,e+g),w=ge(t,e+y),S=[],T=0;T<b;T++)for(var E=S[T]=[],M=0;M<_;M++)a&&(r=i.parseShort()),s&&i.parseShort(),E[M]=r;for(var R={},C=0;C<o.length;C++)R[o[C]]=1;return function(t,e){if(R[t]){var r=x(t),i=w(e),n=S[r];return n?n[i]:void 0}}}}}function be(t,e){var r=new Ze.Parser(t,e),i=r.parseUShort(),n=r.parseUShort(),o=16&n,a=r.parseUShort(),s=r.parseOffset16List(a),h={lookupType:i,lookupFlag:n,markFilteringSet:o?r.parseUShort():-1};if(2===i){for(var l=[],u=0;u<a;u++){var c=ye(t,e+s[u]);c&&l.push(c)}h.getKerningValue=function(t,e){for(var r=l.length;r--;){var i=l[r](t,e);if(void 0!==i)return i}return 0}}return h}function _e(e,r){t("fs").readFile(e,function(t,e){if(t)return r(t.message);r(null,Mt(e))})}function xe(t,e){for(var r=[],i=12,n=0;n<e;n+=1){var o=Ze.getTag(t,i),a=Ze.getULong(t,i+4),s=Ze.getULong(t,i+8),h=Ze.getULong(t,i+12);r.push({tag:o,checksum:a,offset:s,length:h,compression:!1}),i+=16}return r}function we(t,e){if("WOFF"===e.compression){var r=new Uint8Array(t.buffer,e.offset+2,e.compressedLength-2),i=new Uint8Array(e.length);if(Oe(r,i),i.byteLength!==e.length)throw new Error("Decompression error: "+e.tag+" decompressed length doesn't match recorded length");return{data:new DataView(i.buffer,0),offset:0}}return{data:t,offset:e.offset}}function Se(t){var e,r,i,n=new ue({empty:!0}),o=new DataView(t,0),a=[],s=Ze.getTag(o,0);if(s===String.fromCharCode(0,1,0,0)||"true"===s||"typ1"===s)n.outlinesFormat="truetype",a=xe(o,i=Ze.getUShort(o,4));else if("OTTO"===s)n.outlinesFormat="cff",a=xe(o,i=Ze.getUShort(o,4));else{if("wOFF"!==s)throw new Error("Unsupported OpenType signature "+s);var h=Ze.getTag(o,4);if(h===String.fromCharCode(0,1,0,0))n.outlinesFormat="truetype";else{if("OTTO"!==h)throw new Error("Unsupported OpenType flavor "+s);n.outlinesFormat="cff"}a=function(t,e){for(var r=[],i=44,n=0;n<e;n+=1){var o,a=Ze.getTag(t,i),s=Ze.getULong(t,i+4),h=Ze.getULong(t,i+8),l=Ze.getULong(t,i+12);o=h<l&&"WOFF",r.push({tag:a,offset:s,compression:o,compressedLength:h,length:l}),i+=20}return r}(o,i=Ze.getUShort(o,12))}for(var l,u,c,p,d,f,m,v,g,y,b,_=0;_<i;_+=1){var x=a[_],w=void 0;switch(x.tag){case"cmap":w=we(o,x),n.tables.cmap=Je.parse(w.data,w.offset),n.encoding=new B(n.tables.cmap);break;case"cvt ":w=we(o,x),b=new Ze.Parser(w.data,w.offset),n.tables.cvt=b.parseShortList(x.length/2);break;case"fvar":u=x;break;case"fpgm":w=we(o,x),b=new Ze.Parser(w.data,w.offset),n.tables.fpgm=b.parseByteList(x.length);break;case"head":w=we(o,x),n.tables.head=sr.parse(w.data,w.offset),n.unitsPerEm=n.tables.head.unitsPerEm,e=n.tables.head.indexToLocFormat;break;case"hhea":w=we(o,x),n.tables.hhea=hr.parse(w.data,w.offset),n.ascender=n.tables.hhea.ascender,n.descender=n.tables.hhea.descender,n.numberOfHMetrics=n.tables.hhea.numberOfHMetrics;break;case"hmtx":f=x;break;case"ltag":w=we(o,x),r=ur.parse(w.data,w.offset);break;case"maxp":w=we(o,x),n.tables.maxp=cr.parse(w.data,w.offset),n.numGlyphs=n.tables.maxp.numGlyphs;break;case"name":g=x;break;case"OS/2":w=we(o,x),n.tables.os2=xr.parse(w.data,w.offset);break;case"post":w=we(o,x),n.tables.post=wr.parse(w.data,w.offset),n.glyphNames=new G(n.tables.post);break;case"prep":w=we(o,x),b=new Ze.Parser(w.data,w.offset),n.tables.prep=b.parseByteList(x.length);break;case"glyf":c=x;break;case"loca":v=x;break;case"CFF ":l=x;break;case"kern":m=x;break;case"GPOS":p=x;break;case"GSUB":d=x;break;case"meta":y=x}}var S=we(o,g);if(n.tables.name=br.parse(S.data,S.offset,r),n.names=n.tables.name,c&&v){var T=0===e,E=we(o,v),M=Hr.parse(E.data,E.offset,n.numGlyphs,T),R=we(o,c);n.glyphs=rr.parse(R.data,R.offset,M,n)}else{if(!l)throw new Error("Font doesn't contain TrueType or CFF outlines.");var C=we(o,l);ar.parse(C.data,C.offset,n)}var P=we(o,f);if(lr.parse(P.data,P.offset,n.numberOfHMetrics,n.numGlyphs,n.glyphs),function(t){for(var e,r=t.tables.cmap.glyphIndexMap,i=Object.keys(r),n=0;n<i.length;n+=1){var o=i[n],a=r[o];(e=t.glyphs.get(a)).addUnicode(parseInt(o))}for(var s=0;s<t.glyphs.length;s+=1)e=t.glyphs.get(s),t.cffEncoding?t.isCIDFont?e.name="gid"+s:e.name=t.cffEncoding.charset[s]:t.glyphNames.names&&(e.name=t.glyphNames.glyphIndexToName(s))}(n),m){var L=we(o,m);n.kerningPairs=Gr.parse(L.data,L.offset)}else n.kerningPairs={};if(p){var A=we(o,p);Nr.parse(A.data,A.offset,n)}if(d){var D=we(o,d);n.tables.gsub=Mr.parse(D.data,D.offset)}if(u){var I=we(o,u);n.tables.fvar=Br.parse(I.data,I.offset,n.names)}if(y){var U=we(o,y);n.tables.meta=Rr.parse(U.data,U.offset),n.metas=n.tables.meta}return n}var Te=0,Ee=-3,Me=new r,Re=new r,Ce=new Uint8Array(30),Pe=new Uint16Array(30),Le=new Uint8Array(30),Ae=new Uint16Array(30),De=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ie=new r,Ue=new Uint8Array(320),ke=new Uint16Array(16);(function(t,e){var r;for(r=0;r<7;++r)t.table[r]=0;for(t.table[7]=24,t.table[8]=152,t.table[9]=112,r=0;r<24;++r)t.trans[r]=256+r;for(r=0;r<144;++r)t.trans[24+r]=r;for(r=0;r<8;++r)t.trans[168+r]=280+r;for(r=0;r<112;++r)t.trans[176+r]=144+r;for(r=0;r<5;++r)e.table[r]=0;for(e.table[5]=32,r=0;r<32;++r)e.trans[r]=r})(Me,Re),o(Ce,Pe,4,3),o(Le,Ae,2,1),Ce[28]=0,Pe[28]=258;var Oe=function(t,e){var r,i,o=new n(t,e);do{switch(r=s(o),h(o,2,0)){case 0:i=p(o);break;case 1:i=c(o,Me,Re);break;case 2:u(o,o.ltree,o.dtree),i=c(o,o.ltree,o.dtree);break;default:i=Ee}if(i!==Te)throw new Error("Data error")}while(!r);return o.destLen<o.dest.length?"function"==typeof o.dest.slice?o.dest.slice(0,o.destLen):o.dest.subarray(0,o.destLen):o.dest};f.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},f.prototype.addPoint=function(t,e){"number"==typeof t&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),t<this.x1&&(this.x1=t),t>this.x2&&(this.x2=t)),"number"==typeof e&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.y2&&(this.y2=e))},f.prototype.addX=function(t){this.addPoint(t,null)},f.prototype.addY=function(t){this.addPoint(null,t)},f.prototype.addBezier=function(t,e,r,i,n,o,a,s){var h=this,l=[t,e],u=[r,i],c=[n,o],p=[a,s];this.addPoint(t,e),this.addPoint(a,s);for(var f=0;f<=1;f++){var m=6*l[f]-12*u[f]+6*c[f],v=-3*l[f]+9*u[f]-9*c[f]+3*p[f],g=3*u[f]-3*l[f];if(0!==v){var y=Math.pow(m,2)-4*g*v;if(!(y<0)){var b=(-m+Math.sqrt(y))/(2*v);0<b&&b<1&&(0===f&&h.addX(d(l[f],u[f],c[f],p[f],b)),1===f&&h.addY(d(l[f],u[f],c[f],p[f],b)));var _=(-m-Math.sqrt(y))/(2*v);0<_&&_<1&&(0===f&&h.addX(d(l[f],u[f],c[f],p[f],_)),1===f&&h.addY(d(l[f],u[f],c[f],p[f],_)))}}else{if(0===m)continue;var x=-g/m;0<x&&x<1&&(0===f&&h.addX(d(l[f],u[f],c[f],p[f],x)),1===f&&h.addY(d(l[f],u[f],c[f],p[f],x)))}}},f.prototype.addQuad=function(t,e,r,i,n,o){var a=t+2/3*(r-t),s=e+2/3*(i-e),h=a+1/3*(n-t),l=s+1/3*(o-e);this.addBezier(t,e,a,s,h,l,n,o)},m.prototype.moveTo=function(t,e){this.commands.push({type:"M",x:t,y:e})},m.prototype.lineTo=function(t,e){this.commands.push({type:"L",x:t,y:e})},m.prototype.curveTo=m.prototype.bezierCurveTo=function(t,e,r,i,n,o){this.commands.push({type:"C",x1:t,y1:e,x2:r,y2:i,x:n,y:o})},m.prototype.quadTo=m.prototype.quadraticCurveTo=function(t,e,r,i){this.commands.push({type:"Q",x1:t,y1:e,x:r,y:i})},m.prototype.close=m.prototype.closePath=function(){this.commands.push({type:"Z"})},m.prototype.extend=function(t){if(t.commands)t=t.commands;else if(t instanceof f){var e=t;return this.moveTo(e.x1,e.y1),this.lineTo(e.x2,e.y1),this.lineTo(e.x2,e.y2),this.lineTo(e.x1,e.y2),void this.close()}Array.prototype.push.apply(this.commands,t)},m.prototype.getBoundingBox=function(){for(var t=new f,e=0,r=0,i=0,n=0,o=0;o<this.commands.length;o++){var a=this.commands[o];switch(a.type){case"M":t.addPoint(a.x,a.y),e=i=a.x,r=n=a.y;break;case"L":t.addPoint(a.x,a.y),i=a.x,n=a.y;break;case"Q":t.addQuad(i,n,a.x1,a.y1,a.x,a.y),i=a.x,n=a.y;break;case"C":t.addBezier(i,n,a.x1,a.y1,a.x2,a.y2,a.x,a.y),i=a.x,n=a.y;break;case"Z":i=e,n=r;break;default:throw new Error("Unexpected path command "+a.type)}}return t.isEmpty()&&t.addPoint(0,0),t},m.prototype.draw=function(t){t.beginPath();for(var e=0;e<this.commands.length;e+=1){var r=this.commands[e];"M"===r.type?t.moveTo(r.x,r.y):"L"===r.type?t.lineTo(r.x,r.y):"C"===r.type?t.bezierCurveTo(r.x1,r.y1,r.x2,r.y2,r.x,r.y):"Q"===r.type?t.quadraticCurveTo(r.x1,r.y1,r.x,r.y):"Z"===r.type&&t.closePath()}this.fill&&(t.fillStyle=this.fill,t.fill()),this.stroke&&(t.strokeStyle=this.stroke,t.lineWidth=this.strokeWidth,t.stroke())},m.prototype.toPathData=function(t){function e(e){return Math.round(e)===e?""+Math.round(e):e.toFixed(t)}function r(){for(var t=arguments,r="",i=0;i<arguments.length;i+=1){var n=t[i];n>=0&&i>0&&(r+=" "),r+=e(n)}return r}t=void 0!==t?t:2;for(var i="",n=0;n<this.commands.length;n+=1){var o=this.commands[n];"M"===o.type?i+="M"+r(o.x,o.y):"L"===o.type?i+="L"+r(o.x,o.y):"C"===o.type?i+="C"+r(o.x1,o.y1,o.x2,o.y2,o.x,o.y):"Q"===o.type?i+="Q"+r(o.x1,o.y1,o.x,o.y):"Z"===o.type&&(i+="Z")}return i},m.prototype.toSVG=function(t){var e='<path d="';return e+=this.toPathData(t),e+='"',this.fill&&"black"!==this.fill&&(null===this.fill?e+=' fill="none"':e+=' fill="'+this.fill+'"'),this.stroke&&(e+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),e+"/>"},m.prototype.toDOMElement=function(t){var e=this.toPathData(t),r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",e),r};var Fe={fail:v,argument:g,assert:g},Be=2147483648,Ne={},Ge={},He={};Ge.BYTE=function(t){return Fe.argument(t>=0&&t<=255,"Byte value should be between 0 and 255."),[t]},He.BYTE=y(1),Ge.CHAR=function(t){return[t.charCodeAt(0)]},He.CHAR=y(1),Ge.CHARARRAY=function(t){for(var e=[],r=0;r<t.length;r+=1)e[r]=t.charCodeAt(r);return e},He.CHARARRAY=function(t){return t.length},Ge.USHORT=function(t){return[t>>8&255,255&t]},He.USHORT=y(2),Ge.SHORT=function(t){return t>=32768&&(t=-(65536-t)),[t>>8&255,255&t]},He.SHORT=y(2),Ge.UINT24=function(t){return[t>>16&255,t>>8&255,255&t]},He.UINT24=y(3),Ge.ULONG=function(t){return[t>>24&255,t>>16&255,t>>8&255,255&t]},He.ULONG=y(4),Ge.LONG=function(t){return t>=Be&&(t=-(2*Be-t)),[t>>24&255,t>>16&255,t>>8&255,255&t]},He.LONG=y(4),Ge.FIXED=Ge.ULONG,He.FIXED=He.ULONG,Ge.FWORD=Ge.SHORT,He.FWORD=He.SHORT,Ge.UFWORD=Ge.USHORT,He.UFWORD=He.USHORT,Ge.LONGDATETIME=function(t){return[0,0,0,0,t>>24&255,t>>16&255,t>>8&255,255&t]},He.LONGDATETIME=y(8),Ge.TAG=function(t){return Fe.argument(4===t.length,"Tag should be exactly 4 ASCII characters."),[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]},He.TAG=y(4),Ge.Card8=Ge.BYTE,He.Card8=He.BYTE,Ge.Card16=Ge.USHORT,He.Card16=He.USHORT,Ge.OffSize=Ge.BYTE,He.OffSize=He.BYTE,Ge.SID=Ge.USHORT,He.SID=He.USHORT,Ge.NUMBER=function(t){return t>=-107&&t<=107?[t+139]:t>=108&&t<=1131?[247+((t-=108)>>8),255&t]:t>=-1131&&t<=-108?[251+((t=-t-108)>>8),255&t]:t>=-32768&&t<=32767?Ge.NUMBER16(t):Ge.NUMBER32(t)},He.NUMBER=function(t){return Ge.NUMBER(t).length},Ge.NUMBER16=function(t){return[28,t>>8&255,255&t]},He.NUMBER16=y(3),Ge.NUMBER32=function(t){return[29,t>>24&255,t>>16&255,t>>8&255,255&t]},He.NUMBER32=y(5),Ge.REAL=function(t){var e=t.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(e);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));e=(Math.round(t*i)/i).toString()}for(var n="",o=0,a=e.length;o<a;o+=1){var s=e[o];n+="e"===s?"-"===e[++o]?"c":"b":"."===s?"a":"-"===s?"e":s}for(var h=[30],l=0,u=(n+=1&n.length?"f":"ff").length;l<u;l+=2)h.push(parseInt(n.substr(l,2),16));return h},He.REAL=function(t){return Ge.REAL(t).length},Ge.NAME=Ge.CHARARRAY,He.NAME=He.CHARARRAY,Ge.STRING=Ge.CHARARRAY,He.STRING=He.CHARARRAY,Ne.UTF8=function(t,e,r){for(var i=[],n=r,o=0;o<n;o++,e+=1)i[o]=t.getUint8(e);return String.fromCharCode.apply(null,i)},Ne.UTF16=function(t,e,r){for(var i=[],n=r/2,o=0;o<n;o++,e+=2)i[o]=t.getUint16(e);return String.fromCharCode.apply(null,i)},Ge.UTF16=function(t){for(var e=[],r=0;r<t.length;r+=1){var i=t.charCodeAt(r);e[e.length]=i>>8&255,e[e.length]=255&i}return e},He.UTF16=function(t){return 2*t.length};var Ve={"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":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};Ne.MACSTRING=function(t,e,r,i){var n=Ve[i];if(void 0!==n){for(var o="",a=0;a<r;a++){var s=t.getUint8(e+a);o+=s<=127?String.fromCharCode(s):n[127&s]}return o}};var ze,je="function"==typeof WeakMap&&new WeakMap;Ge.MACSTRING=function(t,e){var r=function(t){if(!ze)for(var e in ze={},Ve)ze[e]=new String(e);var r=ze[t];if(void 0!==r){if(je){var i=je.get(r);if(void 0!==i)return i}var n=Ve[t];if(void 0!==n){for(var o={},a=0;a<n.length;a++)o[n.charCodeAt(a)]=a+128;return je&&je.set(r,o),o}}}(e);if(void 0!==r){for(var i=[],n=0;n<t.length;n++){var o=t.charCodeAt(n);if(o>=128&&void 0===(o=r[o]))return;i[n]=o}return i}},He.MACSTRING=function(t,e){var r=Ge.MACSTRING(t,e);return void 0!==r?r.length:0},Ge.VARDELTAS=function(t){for(var e=0,r=[];e<t.length;){var i=t[e];e=0===i?_(t,e,r):i>=-128&&i<=127?x(t,e,r):w(t,e,r)}return r},Ge.INDEX=function(t){for(var e=1,r=[e],i=[],n=0;n<t.length;n+=1){var o=Ge.OBJECT(t[n]);Array.prototype.push.apply(i,o),e+=o.length,r.push(e)}if(0===i.length)return[0,0];for(var a=[],s=1+Math.floor(Math.log(e)/Math.log(2))/8|0,h=[void 0,Ge.BYTE,Ge.USHORT,Ge.UINT24,Ge.ULONG][s],l=0;l<r.length;l+=1){var u=h(r[l]);Array.prototype.push.apply(a,u)}return Array.prototype.concat(Ge.Card16(t.length),Ge.OffSize(s),a,i)},He.INDEX=function(t){return Ge.INDEX(t).length},Ge.DICT=function(t){for(var e=[],r=Object.keys(t),i=r.length,n=0;n<i;n+=1){var o=parseInt(r[n],0),a=t[o];e=(e=e.concat(Ge.OPERAND(a.value,a.type))).concat(Ge.OPERATOR(o))}return e},He.DICT=function(t){return Ge.DICT(t).length},Ge.OPERATOR=function(t){return t<1200?[t]:[12,t-1200]},Ge.OPERAND=function(t,e){var r=[];if(Array.isArray(e))for(var i=0;i<e.length;i+=1)Fe.argument(t.length===e.length,"Not enough arguments given for type"+e),r=r.concat(Ge.OPERAND(t[i],e[i]));else if("SID"===e)r=r.concat(Ge.NUMBER(t));else if("offset"===e)r=r.concat(Ge.NUMBER32(t));else if("number"===e)r=r.concat(Ge.NUMBER(t));else{if("real"!==e)throw new Error("Unknown operand type "+e);r=r.concat(Ge.REAL(t))}return r},Ge.OP=Ge.BYTE,He.OP=He.BYTE;var We="function"==typeof WeakMap&&new WeakMap;Ge.CHARSTRING=function(t){if(We){var e=We.get(t);if(void 0!==e)return e}for(var r=[],i=t.length,n=0;n<i;n+=1){var o=t[n];r=r.concat(Ge[o.type](o.value))}return We&&We.set(t,r),r},He.CHARSTRING=function(t){return Ge.CHARSTRING(t).length},Ge.OBJECT=function(t){var e=Ge[t.type];return Fe.argument(void 0!==e,"No encoding function for type "+t.type),e(t.value)},He.OBJECT=function(t){var e=He[t.type];return Fe.argument(void 0!==e,"No sizeOf function for type "+t.type),e(t.value)},Ge.TABLE=function(t){for(var e=[],r=t.fields.length,i=[],n=[],o=0;o<r;o+=1){var a=t.fields[o],s=Ge[a.type];Fe.argument(void 0!==s,"No encoding function for field type "+a.type+" ("+a.name+")");var h=t[a.name];void 0===h&&(h=a.value);var l=s(h);"TABLE"===a.type?(n.push(e.length),e=e.concat([0,0]),i.push(l)):e=e.concat(l)}for(var u=0;u<i.length;u+=1){var c=n[u],p=e.length;Fe.argument(p<65536,"Table "+t.tableName+" too big."),e[c]=p>>8,e[c+1]=255&p,e=e.concat(i[u])}return e},He.TABLE=function(t){for(var e=0,r=t.fields.length,i=0;i<r;i+=1){var n=t.fields[i],o=He[n.type];Fe.argument(void 0!==o,"No sizeOf function for field type "+n.type+" ("+n.name+")");var a=t[n.name];void 0===a&&(a=n.value),e+=o(a),"TABLE"===n.type&&(e+=2)}return e},Ge.RECORD=Ge.TABLE,He.RECORD=He.TABLE,Ge.LITERAL=function(t){return t},He.LITERAL=function(t){return t.length},S.prototype.encode=function(){return Ge.TABLE(this)},S.prototype.sizeOf=function(){return He.TABLE(this)},R.prototype=Object.create(S.prototype),R.prototype.constructor=R,C.prototype=Object.create(S.prototype),C.prototype.constructor=C,P.prototype=Object.create(S.prototype),P.prototype.constructor=P,L.prototype=Object.create(S.prototype),L.prototype.constructor=L;var Xe={Table:S,Record:S,Coverage:R,ScriptList:C,FeatureList:P,LookupList:L,ushortList:T,tableList:E,recordList:M},Ye={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};k.prototype.parseByte=function(){var t=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,t},k.prototype.parseChar=function(){var t=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,t},k.prototype.parseCard8=k.prototype.parseByte,k.prototype.parseUShort=function(){var t=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,t},k.prototype.parseCard16=k.prototype.parseUShort,k.prototype.parseSID=k.prototype.parseUShort,k.prototype.parseOffset16=k.prototype.parseUShort,k.prototype.parseShort=function(){var t=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,t},k.prototype.parseF2Dot14=function(){var t=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,t},k.prototype.parseULong=function(){var t=I(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,t},k.prototype.parseFixed=function(){var t=U(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,t},k.prototype.parseString=function(t){var e=this.data,r=this.offset+this.relativeOffset,i="";this.relativeOffset+=t;for(var n=0;n<t;n++)i+=String.fromCharCode(e.getUint8(r+n));return i},k.prototype.parseTag=function(){return this.parseString(4)},k.prototype.parseLongDateTime=function(){var t=I(this.data,this.offset+this.relativeOffset+4);return t-=2082844800,this.relativeOffset+=8,t},k.prototype.parseVersion=function(){var t=D(this.data,this.offset+this.relativeOffset),e=D(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,t+e/4096/10},k.prototype.skip=function(t,e){void 0===e&&(e=1),this.relativeOffset+=Ye[t]*e},k.prototype.parseOffset16List=k.prototype.parseUShortList=function(t){void 0===t&&(t=this.parseUShort());for(var e=new Array(t),r=this.data,i=this.offset+this.relativeOffset,n=0;n<t;n++)e[n]=r.getUint16(i),i+=2;return this.relativeOffset+=2*t,e},k.prototype.parseShortList=function(t){for(var e=new Array(t),r=this.data,i=this.offset+this.relativeOffset,n=0;n<t;n++)e[n]=r.getInt16(i),i+=2;return this.relativeOffset+=2*t,e},k.prototype.parseByteList=function(t){for(var e=new Array(t),r=this.data,i=this.offset+this.relativeOffset,n=0;n<t;n++)e[n]=r.getUint8(i++);return this.relativeOffset+=t,e},k.prototype.parseList=function(t,e){e||(e=t,t=this.parseUShort());for(var r=new Array(t),i=0;i<t;i++)r[i]=e.call(this);return r},k.prototype.parseRecordList=function(t,e){e||(e=t,t=this.parseUShort());for(var r=new Array(t),i=Object.keys(e),n=0;n<t;n++){for(var o={},a=0;a<i.length;a++){var s=i[a],h=e[s];o[s]=h.call(this)}r[n]=o}return r},k.prototype.parseStruct=function(t){if("function"==typeof t)return t.call(this);for(var e=Object.keys(t),r={},i=0;i<e.length;i++){var n=e[i],o=t[n];r[n]=o.call(this)}return r},k.prototype.parsePointer=function(t){var e=this.parseOffset16();if(e>0)return new k(this.data,this.offset+e).parseStruct(t)},k.prototype.parseListOfLists=function(t){for(var e=this,r=this.parseOffset16List(),i=r.length,n=this.relativeOffset,o=new Array(i),a=0;a<i;a++){var s=r[a];if(0!==s)if(e.relativeOffset=s,t){for(var h=e.parseOffset16List(),l=new Array(h.length),u=0;u<h.length;u++)e.relativeOffset=s+h[u],l[u]=t.call(e);o[a]=l}else o[a]=e.parseUShortList();else o[a]=void 0}return this.relativeOffset=n,o},k.prototype.parseCoverage=function(){var t=this,e=this.offset+this.relativeOffset,r=this.parseUShort(),i=this.parseUShort();if(1===r)return{format:1,glyphs:this.parseUShortList(i)};if(2===r){for(var n=new Array(i),o=0;o<i;o++)n[o]={start:t.parseUShort(),end:t.parseUShort(),index:t.parseUShort()};return{format:2,ranges:n}}throw new Error("0x"+e.toString(16)+": Coverage format must be 1 or 2.")},k.prototype.parseClassDef=function(){var t=this.offset+this.relativeOffset,e=this.parseUShort();if(1===e)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(2===e)return{format:2,ranges:this.parseRecordList({start:k.uShort,end:k.uShort,classId:k.uShort})};throw new Error("0x"+t.toString(16)+": ClassDef format must be 1 or 2.")},k.list=function(t,e){return function(){return this.parseList(t,e)}},k.recordList=function(t,e){return function(){return this.parseRecordList(t,e)}},k.pointer=function(t){return function(){return this.parsePointer(t)}},k.tag=k.prototype.parseTag,k.byte=k.prototype.parseByte,k.uShort=k.offset16=k.prototype.parseUShort,k.uShortList=k.prototype.parseUShortList,k.struct=k.prototype.parseStruct,k.coverage=k.prototype.parseCoverage,k.classDef=k.prototype.parseClassDef;var qe={reserved:k.uShort,reqFeatureIndex:k.uShort,featureIndexes:k.uShortList};k.prototype.parseScriptList=function(){return this.parsePointer(k.recordList({tag:k.tag,script:k.pointer({defaultLangSys:k.pointer(qe),langSysRecords:k.recordList({tag:k.tag,langSys:k.pointer(qe)})})}))},k.prototype.parseFeatureList=function(){return this.parsePointer(k.recordList({tag:k.tag,feature:k.pointer({featureParams:k.offset16,lookupListIndexes:k.uShortList})}))},k.prototype.parseLookupList=function(t){return this.parsePointer(k.list(k.pointer(function(){var e=this.parseUShort();Fe.argument(1<=e&&e<=8,"GSUB lookup type "+e+" unknown.");var r=this.parseUShort(),i=16&r;return{lookupType:e,lookupFlag:r,subtables:this.parseList(k.pointer(t[e])),markFilteringSet:i?this.parseUShort():void 0}})))};var Ze={getByte:A,getCard8:A,getUShort:D,getCard16:D,getShort:function(t,e){return t.getInt16(e,!1)},getULong:I,getFixed:U,getTag:function(t,e){for(var r="",i=e;i<e+4;i+=1)r+=String.fromCharCode(t.getInt8(i));return r},getOffset:function(t,e,r){for(var i=0,n=0;n<r;n+=1)i<<=8,i+=t.getUint8(e+n);return i},getBytes:function(t,e,r){for(var i=[],n=e;n<r;n+=1)i.push(t.getUint8(n));return i},bytesToString:function(t){for(var e="",r=0;r<t.length;r+=1)e+=String.fromCharCode(t[r]);return e},Parser:k},Je={parse:function(t,e){var r={};r.version=Ze.getUShort(t,e),Fe.argument(0===r.version,"cmap table version should be 0."),r.numTables=Ze.getUShort(t,e+2);for(var i=-1,n=r.numTables-1;n>=0;n-=1){var o=Ze.getUShort(t,e+4+8*n),a=Ze.getUShort(t,e+4+8*n+2);if(3===o&&(0===a||1===a||10===a)){i=Ze.getULong(t,e+4+8*n+4);break}}if(-1===i)throw new Error("No valid cmap sub-tables found.");var s=new Ze.Parser(t,e+i);if(r.format=s.parseUShort(),12===r.format)!function(t,e){var r;e.parseUShort(),t.length=e.parseULong(),t.language=e.parseULong(),t.groupCount=r=e.parseULong(),t.glyphIndexMap={};for(var i=0;i<r;i+=1)for(var n=e.parseULong(),o=e.parseULong(),a=e.parseULong(),s=n;s<=o;s+=1)t.glyphIndexMap[s]=a,a++}(r,s);else{if(4!==r.format)throw new Error("Only format 4 and 12 cmap tables are supported (found format "+r.format+").");!function(t,e,r,i,n){var o;t.length=e.parseUShort(),t.language=e.parseUShort(),t.segCount=o=e.parseUShort()>>1,e.skip("uShort",3),t.glyphIndexMap={};for(var a=new Ze.Parser(r,i+n+14),s=new Ze.Parser(r,i+n+16+2*o),h=new Ze.Parser(r,i+n+16+4*o),l=new Ze.Parser(r,i+n+16+6*o),u=i+n+16+8*o,c=0;c<o-1;c+=1)for(var p=void 0,d=a.parseUShort(),f=s.parseUShort(),m=h.parseShort(),v=l.parseUShort(),g=f;g<=d;g+=1)0!==v?(u=l.offset+l.relativeOffset-2,u+=v,u+=2*(g-f),0!==(p=Ze.getUShort(r,u))&&(p=p+m&65535)):p=g+m&65535,t.glyphIndexMap[g]=p}(r,s,t,e,i)}return r},make:function(t){var e,r=new Xe.Table("cmap",[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:1},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:12},{name:"format",type:"USHORT",value:4},{name:"length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);r.segments=[];for(var i=0;i<t.length;i+=1){for(var n=t.get(i),o=0;o<n.unicodes.length;o+=1)O(r,n.unicodes[o],i);r.segments=r.segments.sort(function(t,e){return t.start-e.start})}!function(t){t.segments.push({end:65535,start:65535,delta:1,offset:0})}(r),e=r.segments.length,r.segCountX2=2*e,r.searchRange=2*Math.pow(2,Math.floor(Math.log(e)/Math.log(2))),r.entrySelector=Math.log(r.searchRange/2)/Math.log(2),r.rangeShift=r.segCountX2-r.searchRange;for(var a=[],s=[],h=[],l=[],u=[],c=0;c<e;c+=1){var p=r.segments[c];a=a.concat({name:"end_"+c,type:"USHORT",value:p.end}),s=s.concat({name:"start_"+c,type:"USHORT",value:p.start}),h=h.concat({name:"idDelta_"+c,type:"SHORT",value:p.delta}),l=l.concat({name:"idRangeOffset_"+c,type:"USHORT",value:p.offset}),void 0!==p.glyphId&&(u=u.concat({name:"glyph_"+c,type:"USHORT",value:p.glyphId}))}return r.fields=r.fields.concat(a),r.fields.push({name:"reservedPad",type:"USHORT",value:0}),r.fields=r.fields.concat(s),r.fields=r.fields.concat(h),r.fields=r.fields.concat(l),r.fields=r.fields.concat(u),r.length=14+2*a.length+2+2*s.length+2*h.length+2*l.length+2*u.length,r}},Qe=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],Ke=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],$e=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],tr=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];F.prototype.charToGlyphIndex=function(t){var e=t.charCodeAt(0),r=this.font.glyphs;if(r)for(var i=0;i<r.length;i+=1)for(var n=r.get(i),o=0;o<n.unicodes.length;o+=1)if(n.unicodes[o]===e)return i;return null},B.prototype.charToGlyphIndex=function(t){return this.cmap.glyphIndexMap[t.charCodeAt(0)]||0},N.prototype.charToGlyphIndex=function(t){var e=t.charCodeAt(0),r=this.encoding[e];return this.charset.indexOf(r)},G.prototype.nameToGlyphIndex=function(t){return this.names.indexOf(t)},G.prototype.glyphIndexToName=function(t){return this.names[t]};var er={line:function(t,e,r,i,n){t.beginPath(),t.moveTo(e,r),t.lineTo(i,n),t.stroke()}},rr={getPath:j,parse:function(t,e,r,i){for(var n=new ir.GlyphSet(i),o=0;o<r.length-1;o+=1){var a=r[o];a!==r[o+1]?n.push(o,ir.ttfGlyphLoader(i,o,V,t,e+a,W)):n.push(o,ir.glyphLoader(i,o))}return n}};X.prototype.bindConstructorValues=function(t){this.index=t.index||0,this.name=t.name||null,this.unicode=t.unicode||void 0,this.unicodes=t.unicodes||void 0!==t.unicode?[t.unicode]:[],t.xMin&&(this.xMin=t.xMin),t.yMin&&(this.yMin=t.yMin),t.xMax&&(this.xMax=t.xMax),t.yMax&&(this.yMax=t.yMax),t.advanceWidth&&(this.advanceWidth=t.advanceWidth),Object.defineProperty(this,"path",function(t,e){var r=e||{commands:[]};return{configurable:!0,get:function(){return"function"==typeof r&&(r=r()),r},set:function(t){r=t}}}(0,t.path))},X.prototype.addUnicode=function(t){0===this.unicodes.length&&(this.unicode=t),this.unicodes.push(t)},X.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},X.prototype.getPath=function(t,e,r,i,n){var o,a;t=void 0!==t?t:0,e=void 0!==e?e:0,r=void 0!==r?r:72,i||(i={});var s=i.xScale,h=i.yScale;if(i.hinting&&n&&n.hinting&&(a=this.path&&n.hinting.exec(this,r)),a)o=rr.getPath(a).commands,t=Math.round(t),e=Math.round(e),s=h=1;else{o=this.path.commands;var l=1/this.path.unitsPerEm*r;void 0===s&&(s=l),void 0===h&&(h=l)}for(var u=new m,c=0;c<o.length;c+=1){var p=o[c];"M"===p.type?u.moveTo(t+p.x*s,e+-p.y*h):"L"===p.type?u.lineTo(t+p.x*s,e+-p.y*h):"Q"===p.type?u.quadraticCurveTo(t+p.x1*s,e+-p.y1*h,t+p.x*s,e+-p.y*h):"C"===p.type?u.curveTo(t+p.x1*s,e+-p.y1*h,t+p.x2*s,e+-p.y2*h,t+p.x*s,e+-p.y*h):"Z"===p.type&&u.closePath()}return u},X.prototype.getContours=function(){if(void 0===this.points)return[];for(var t=[],e=[],r=0;r<this.points.length;r+=1){var i=this.points[r];e.push(i),i.lastPointOfContour&&(t.push(e),e=[])}return Fe.argument(0===e.length,"There are still points left in the current contour."),t},X.prototype.getMetrics=function(){for(var t=this.path.commands,e=[],r=[],i=0;i<t.length;i+=1){var n=t[i];"Z"!==n.type&&(e.push(n.x),r.push(n.y)),"Q"!==n.type&&"C"!==n.type||(e.push(n.x1),r.push(n.y1)),"C"===n.type&&(e.push(n.x2),r.push(n.y2))}var o={xMin:Math.min.apply(null,e),yMin:Math.min.apply(null,r),xMax:Math.max.apply(null,e),yMax:Math.max.apply(null,r),leftSideBearing:this.leftSideBearing};return isFinite(o.xMin)||(o.xMin=0),isFinite(o.xMax)||(o.xMax=this.advanceWidth),isFinite(o.yMin)||(o.yMin=0),isFinite(o.yMax)||(o.yMax=0),o.rightSideBearing=this.advanceWidth-o.leftSideBearing-(o.xMax-o.xMin),o},X.prototype.draw=function(t,e,r,i,n){this.getPath(e,r,i,n).draw(t)},X.prototype.drawPoints=function(t,e,r,i){function n(e,r,i,n){var o=2*Math.PI;t.beginPath();for(var a=0;a<e.length;a+=1)t.moveTo(r+e[a].x*n,i+e[a].y*n),t.arc(r+e[a].x*n,i+e[a].y*n,2,0,o,!1);t.closePath(),t.fill()}e=void 0!==e?e:0,r=void 0!==r?r:0,i=void 0!==i?i:24;for(var o=1/this.path.unitsPerEm*i,a=[],s=[],h=this.path,l=0;l<h.commands.length;l+=1){var u=h.commands[l];void 0!==u.x&&a.push({x:u.x,y:-u.y}),void 0!==u.x1&&s.push({x:u.x1,y:-u.y1}),void 0!==u.x2&&s.push({x:u.x2,y:-u.y2})}t.fillStyle="blue",n(a,e,r,o),t.fillStyle="red",n(s,e,r,o)},X.prototype.drawMetrics=function(t,e,r,i){var n;e=void 0!==e?e:0,r=void 0!==r?r:0,i=void 0!==i?i:24,n=1/this.path.unitsPerEm*i,t.lineWidth=1,t.strokeStyle="black",er.line(t,e,-1e4,e,1e4),er.line(t,-1e4,r,1e4,r);var o=this.xMin||0,a=this.yMin||0,s=this.xMax||0,h=this.yMax||0,l=this.advanceWidth||0;t.strokeStyle="blue",er.line(t,e+o*n,-1e4,e+o*n,1e4),er.line(t,e+s*n,-1e4,e+s*n,1e4),er.line(t,-1e4,r+-a*n,1e4,r+-a*n),er.line(t,-1e4,r+-h*n,1e4,r+-h*n),t.strokeStyle="green",er.line(t,e+l*n,-1e4,e+l*n,1e4)},q.prototype.get=function(t){return"function"==typeof this.glyphs[t]&&(this.glyphs[t]=this.glyphs[t]()),this.glyphs[t]},q.prototype.push=function(t,e){this.glyphs[t]=e,this.length++};var ir={GlyphSet:q,glyphLoader:function(t,e){return new X({index:e,font:t})},ttfGlyphLoader:function(t,e,r,i,n,o){return function(){var a=new X({index:e,font:t});return a.path=function(){r(a,i,n);var e=o(t.glyphs,a);return e.unitsPerEm=t.unitsPerEm,e},Y(a,"xMin","_xMin"),Y(a,"xMax","_xMax"),Y(a,"yMin","_yMin"),Y(a,"yMax","_yMax"),a}},cffGlyphLoader:function(t,e,r,i){return function(){var n=new X({index:e,font:t});return n.path=function(){var e=r(t,n,i);return e.unitsPerEm=t.unitsPerEm,e},n}}},nr=[{name:"version",op:0,type:"SID"},{name:"notice",op:1,type:"SID"},{name:"copyright",op:1200,type:"SID"},{name:"fullName",op:2,type:"SID"},{name:"familyName",op:3,type:"SID"},{name:"weight",op:4,type:"SID"},{name:"isFixedPitch",op:1201,type:"number",value:0},{name:"italicAngle",op:1202,type:"number",value:0},{name:"underlinePosition",op:1203,type:"number",value:-100},{name:"underlineThickness",op:1204,type:"number",value:50},{name:"paintType",op:1205,type:"number",value:0},{name:"charstringType",op:1206,type:"number",value:2},{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"uniqueId",op:13,type:"number"},{name:"fontBBox",op:5,type:["number","number","number","number"],value:[0,0,0,0]},{name:"strokeWidth",op:1208,type:"number",value:0},{name:"xuid",op:14,type:[],value:null},{name:"charset",op:15,type:"offset",value:0},{name:"encoding",op:16,type:"offset",value:0},{name:"charStrings",op:17,type:"offset",value:0},{name:"private",op:18,type:["number","offset"],value:[0,0]},{name:"ros",op:1230,type:["SID","SID","number"]},{name:"cidFontVersion",op:1231,type:"number",value:0},{name:"cidFontRevision",op:1232,type:"number",value:0},{name:"cidFontType",op:1233,type:"number",value:0},{name:"cidCount",op:1234,type:"number",value:8720},{name:"uidBase",op:1235,type:"number"},{name:"fdArray",op:1236,type:"offset"},{name:"fdSelect",op:1237,type:"offset"},{name:"fontName",op:1238,type:"SID"}],or=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}],ar={parse:function(t,e,r){r.tables.cff={};var i=Q(t,Q(t,function(t,e){var r={};return r.formatMajor=Ze.getCard8(t,e),r.formatMinor=Ze.getCard8(t,e+1),r.size=Ze.getCard8(t,e+2),r.offsetSize=Ze.getCard8(t,e+3),r.startOffset=e,r.endOffset=e+4,r}(t,e).endOffset,Ze.bytesToString).endOffset),n=Q(t,i.endOffset,Ze.bytesToString),o=Q(t,n.endOffset);r.gsubrs=o.objects,r.gsubrsBias=J(r.gsubrs);var a=nt(t,e,i.objects,n.objects);if(1!==a.length)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+a.length);var s=a[0];if(r.tables.cff.topDict=s,s._privateDict&&(r.defaultWidthX=s._privateDict.defaultWidthX,r.nominalWidthX=s._privateDict.nominalWidthX),void 0!==s.ros[0]&&void 0!==s.ros[1]&&(r.isCIDFont=!0),r.isCIDFont){var h=s.fdArray,l=s.fdSelect;if(0===h||0===l)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");var u=nt(t,e,Q(t,h+=e).objects,n.objects);s._fdArray=u,l+=e,s._fdSelect=function(t,e,r,i){var n,o=[],a=new Ze.Parser(t,e),s=a.parseCard8();if(0===s)for(var h=0;h<r;h++){if((n=a.parseCard8())>=i)throw new Error("CFF table CID Font FDSelect has bad FD index value "+n+" (FD count "+i+")");o.push(n)}else{if(3!==s)throw new Error("CFF Table CID Font FDSelect table has unsupported format "+s);var l=a.parseCard16(),u=a.parseCard16();if(0!==u)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+u);for(var c,p=0;p<l;p++){if(n=a.parseCard8(),c=a.parseCard16(),n>=i)throw new Error("CFF table CID Font FDSelect has bad FD index value "+n+" (FD count "+i+")");if(c>r)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+c);for(;u<c;u++)o.push(n);u=c}if(c!==r)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+c)}return o}(t,l,r.numGlyphs,u.length)}var c=e+s.private[1],p=it(t,c,s.private[0],n.objects);if(r.defaultWidthX=p.defaultWidthX,r.nominalWidthX=p.nominalWidthX,0!==p.subrs){var d=Q(t,c+p.subrs);r.subrs=d.objects,r.subrsBias=J(r.subrs)}else r.subrs=[],r.subrsBias=0;var f=Q(t,e+s.charStrings);r.nGlyphs=f.objects.length;var m=function(t,e,r,i){var n,o,a=new Ze.Parser(t,e);r-=1;var s=[".notdef"],h=a.parseCard8();if(0===h)for(var l=0;l<r;l+=1)n=a.parseSID(),s.push(tt(i,n));else if(1===h)for(;s.length<=r;){n=a.parseSID(),o=a.parseCard8();for(var u=0;u<=o;u+=1)s.push(tt(i,n)),n+=1}else{if(2!==h)throw new Error("Unknown charset format "+h);for(;s.length<=r;){n=a.parseSID(),o=a.parseCard16();for(var c=0;c<=o;c+=1)s.push(tt(i,n)),n+=1}}return s}(t,e+s.charset,r.nGlyphs,n.objects);0===s.encoding?r.cffEncoding=new N(Ke,m):1===s.encoding?r.cffEncoding=new N($e,m):r.cffEncoding=function(t,e,r){var i,n={},o=new Ze.Parser(t,e),a=o.parseCard8();if(0===a)for(var s=o.parseCard8(),h=0;h<s;h+=1)n[i=o.parseCard8()]=h;else{if(1!==a)throw new Error("Unknown encoding format "+a);var l=o.parseCard8();i=1;for(var u=0;u<l;u+=1)for(var c=o.parseCard8(),p=o.parseCard8(),d=c;d<=c+p;d+=1)n[d]=i,i+=1}return new N(n,r)}(t,e+s.encoding,m),r.encoding=r.encoding||r.cffEncoding,r.glyphs=new ir.GlyphSet(r);for(var v=0;v<r.nGlyphs;v+=1){var g=f.objects[v];r.glyphs.push(v,ir.cffGlyphLoader(r,v,ot,g))}},make:function(t,e){for(var r,i=new Xe.Table("CFF ",[{name:"header",type:"RECORD"},{name:"nameIndex",type:"RECORD"},{name:"topDictIndex",type:"RECORD"},{name:"stringIndex",type:"RECORD"},{name:"globalSubrIndex",type:"RECORD"},{name:"charsets",type:"RECORD"},{name:"charStringsIndex",type:"RECORD"},{name:"privateDict",type:"RECORD"}]),n=1/e.unitsPerEm,o={version:e.version,fullName:e.fullName,familyName:e.familyName,weight:e.weightName,fontBBox:e.fontBBox||[0,0,0,0],fontMatrix:[n,0,0,n,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},a=[],s=1;s<t.length;s+=1)r=t.get(s),a.push(r.name);var h=[];i.header=new Xe.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}]),i.nameIndex=function(t){var e=new Xe.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);e.names=[];for(var r=0;r<t.length;r+=1)e.names.push({name:"name_"+r,type:"NAME",value:t[r]});return e}([e.postScriptName]);var l=ht(o,h);i.topDictIndex=lt(l),i.globalSubrIndex=new Xe.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}]),i.charsets=function(t,e){for(var r=new Xe.Record("Charsets",[{name:"format",type:"Card8",value:0}]),i=0;i<t.length;i+=1){var n=at(t[i],e);r.fields.push({name:"glyph_"+i,type:"SID",value:n})}return r}(a,h),i.charStringsIndex=function(t){for(var e=new Xe.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),r=0;r<t.length;r+=1){var i=t.get(r),n=ut(i);e.charStrings.push({name:i.name,type:"CHARSTRING",value:n})}return e}(t),i.privateDict=function(t,e){var r=new Xe.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return r.dict=st(or,t,e),r}({},h),i.stringIndex=function(t){var e=new Xe.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);e.strings=[];for(var r=0;r<t.length;r+=1)e.strings.push({name:"string_"+r,type:"STRING",value:t[r]});return e}(h);var u=i.header.sizeOf()+i.nameIndex.sizeOf()+i.topDictIndex.sizeOf()+i.stringIndex.sizeOf()+i.globalSubrIndex.sizeOf();return o.charset=u,o.encoding=0,o.charStrings=o.charset+i.charsets.sizeOf(),o.private[1]=o.charStrings+i.charStringsIndex.sizeOf(),l=ht(o,h),i.topDictIndex=lt(l),i}},sr={parse:function(t,e){var r={},i=new Ze.Parser(t,e);return r.version=i.parseVersion(),r.fontRevision=Math.round(1e3*i.parseFixed())/1e3,r.checkSumAdjustment=i.parseULong(),r.magicNumber=i.parseULong(),Fe.argument(1594834165===r.magicNumber,"Font header has wrong magic number."),r.flags=i.parseUShort(),r.unitsPerEm=i.parseUShort(),r.created=i.parseLongDateTime(),r.modified=i.parseLongDateTime(),r.xMin=i.parseShort(),r.yMin=i.parseShort(),r.xMax=i.parseShort(),r.yMax=i.parseShort(),r.macStyle=i.parseUShort(),r.lowestRecPPEM=i.parseUShort(),r.fontDirectionHint=i.parseShort(),r.indexToLocFormat=i.parseShort(),r.glyphDataFormat=i.parseShort(),r},make:function(t){var e=Math.round((new Date).getTime()/1e3)+2082844800,r=e;return t.createdTimestamp&&(r=t.createdTimestamp+2082844800),new Xe.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:r},{name:"modified",type:"LONGDATETIME",value:e},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],t)}},hr={parse:function(t,e){var r={},i=new Ze.Parser(t,e);return r.version=i.parseVersion(),r.ascender=i.parseShort(),r.descender=i.parseShort(),r.lineGap=i.parseShort(),r.advanceWidthMax=i.parseUShort(),r.minLeftSideBearing=i.parseShort(),r.minRightSideBearing=i.parseShort(),r.xMaxExtent=i.parseShort(),r.caretSlopeRise=i.parseShort(),r.caretSlopeRun=i.parseShort(),r.caretOffset=i.parseShort(),i.relativeOffset+=8,r.metricDataFormat=i.parseShort(),r.numberOfHMetrics=i.parseUShort(),r},make:function(t){return new Xe.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],t)}},lr={parse:function(t,e,r,i,n){for(var o,a,s=new Ze.Parser(t,e),h=0;h<i;h+=1){h<r&&(o=s.parseUShort(),a=s.parseShort());var l=n.get(h);l.advanceWidth=o,l.leftSideBearing=a}},make:function(t){for(var e=new Xe.Table("hmtx",[]),r=0;r<t.length;r+=1){var i=t.get(r),n=i.advanceWidth||0,o=i.leftSideBearing||0;e.fields.push({name:"advanceWidth_"+r,type:"USHORT",value:n}),e.fields.push({name:"leftSideBearing_"+r,type:"SHORT",value:o})}return e}},ur={make:function(t){for(var e=new Xe.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:t.length}]),r="",i=12+4*t.length,n=0;n<t.length;++n){var o=r.indexOf(t[n]);o<0&&(o=r.length,r+=t[n]),e.fields.push({name:"offset "+n,type:"USHORT",value:i+o}),e.fields.push({name:"length "+n,type:"USHORT",value:t[n].length})}return e.fields.push({name:"stringPool",type:"CHARARRAY",value:r}),e},parse:function(t,e){var r=new Ze.Parser(t,e),i=r.parseULong();Fe.argument(1===i,"Unsupported ltag table version."),r.skip("uLong",1);for(var n=r.parseULong(),o=[],a=0;a<n;a++){for(var s="",h=e+r.parseUShort(),l=r.parseUShort(),u=h;u<h+l;++u)s+=String.fromCharCode(t.getInt8(u));o.push(s)}return o}},cr={parse:function(t,e){var r={},i=new Ze.Parser(t,e);return r.version=i.parseVersion(),r.numGlyphs=i.parseUShort(),1===r.version&&(r.maxPoints=i.parseUShort(),r.maxContours=i.parseUShort(),r.maxCompositePoints=i.parseUShort(),r.maxCompositeContours=i.parseUShort(),r.maxZones=i.parseUShort(),r.maxTwilightPoints=i.parseUShort(),r.maxStorage=i.parseUShort(),r.maxFunctionDefs=i.parseUShort(),r.maxInstructionDefs=i.parseUShort(),r.maxStackElements=i.parseUShort(),r.maxSizeOfInstructions=i.parseUShort(),r.maxComponentElements=i.parseUShort(),r.maxComponentDepth=i.parseUShort()),r},make:function(t){return new Xe.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:t}])}},pr=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],dr={0:"en",1:"fr",2:"de",3:"it",4:"nl",5:"sv",6:"es",7:"da",8:"pt",9:"no",10:"he",11:"ja",12:"ar",13:"fi",14:"el",15:"is",16:"mt",17:"tr",18:"hr",19:"zh-Hant",20:"ur",21:"hi",22:"th",23:"ko",24:"lt",25:"pl",26:"hu",27:"es",28:"lv",29:"se",30:"fo",31:"fa",32:"ru",33:"zh",34:"nl-BE",35:"ga",36:"sq",37:"ro",38:"cz",39:"sk",40:"si",41:"yi",42:"sr",43:"mk",44:"bg",45:"uk",46:"be",47:"uz",48:"kk",49:"az-Cyrl",50:"az-Arab",51:"hy",52:"ka",53:"mo",54:"ky",55:"tg",56:"tk",57:"mn-CN",58:"mn",59:"ps",60:"ks",61:"ku",62:"sd",63:"bo",64:"ne",65:"sa",66:"mr",67:"bn",68:"as",69:"gu",70:"pa",71:"or",72:"ml",73:"kn",74:"ta",75:"te",76:"si",77:"my",78:"km",79:"lo",80:"vi",81:"id",82:"tl",83:"ms",84:"ms-Arab",85:"am",86:"ti",87:"om",88:"so",89:"sw",90:"rw",91:"rn",92:"ny",93:"mg",94:"eo",128:"cy",129:"eu",130:"ca",131:"la",132:"qu",133:"gn",134:"ay",135:"tt",136:"ug",137:"dz",138:"jv",139:"su",140:"gl",141:"af",142:"br",143:"iu",144:"gd",145:"gv",146:"ga",147:"to",148:"el-polyton",149:"kl",150:"az",151:"nn"},fr={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:5,11:1,12:4,13:0,14:6,15:0,16:0,17:0,18:0,19:2,20:4,21:9,22:21,23:3,24:29,25:29,26:29,27:29,28:29,29:0,30:0,31:4,32:7,33:25,34:0,35:0,36:0,37:0,38:29,39:29,40:0,41:5,42:7,43:7,44:7,45:7,46:7,47:7,48:7,49:7,50:4,51:24,52:23,53:7,54:7,55:7,56:7,57:27,58:7,59:4,60:4,61:4,62:4,63:26,64:9,65:9,66:9,67:13,68:13,69:11,70:10,71:12,72:17,73:16,74:14,75:15,76:18,77:19,78:20,79:22,80:30,81:0,82:0,83:0,84:4,85:28,86:28,87:28,88:0,89:0,90:0,91:0,92:0,93:0,94:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:7,136:4,137:26,138:0,139:0,140:0,141:0,142:0,143:28,144:0,145:0,146:0,147:0,148:6,149:0,150:0,151:0},mr={1078:"af",1052:"sq",1156:"gsw",1118:"am",5121:"ar-DZ",15361:"ar-BH",3073:"ar",2049:"ar-IQ",11265:"ar-JO",13313:"ar-KW",12289:"ar-LB",4097:"ar-LY",6145:"ary",8193:"ar-OM",16385:"ar-QA",1025:"ar-SA",10241:"ar-SY",7169:"aeb",14337:"ar-AE",9217:"ar-YE",1067:"hy",1101:"as",2092:"az-Cyrl",1068:"az",1133:"ba",1069:"eu",1059:"be",2117:"bn",1093:"bn-IN",8218:"bs-Cyrl",5146:"bs",1150:"br",1026:"bg",1027:"ca",3076:"zh-HK",5124:"zh-MO",2052:"zh",4100:"zh-SG",1028:"zh-TW",1155:"co",1050:"hr",4122:"hr-BA",1029:"cs",1030:"da",1164:"prs",1125:"dv",2067:"nl-BE",1043:"nl",3081:"en-AU",10249:"en-BZ",4105:"en-CA",9225:"en-029",16393:"en-IN",6153:"en-IE",8201:"en-JM",17417:"en-MY",5129:"en-NZ",13321:"en-PH",18441:"en-SG",7177:"en-ZA",11273:"en-TT",2057:"en-GB",1033:"en",12297:"en-ZW",1061:"et",1080:"fo",1124:"fil",1035:"fi",2060:"fr-BE",3084:"fr-CA",1036:"fr",5132:"fr-LU",6156:"fr-MC",4108:"fr-CH",1122:"fy",1110:"gl",1079:"ka",3079:"de-AT",1031:"de",5127:"de-LI",4103:"de-LU",2055:"de-CH",1032:"el",1135:"kl",1095:"gu",1128:"ha",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig",1057:"id",1117:"iu",2141:"iu-Latn",2108:"ga",1076:"xh",1077:"zu",1040:"it",2064:"it-CH",1041:"ja",1099:"kn",1087:"kk",1107:"km",1158:"quc",1159:"rw",1089:"sw",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1062:"lv",1063:"lt",2094:"dsb",1134:"lb",1071:"mk",2110:"ms-BN",1086:"ms",1100:"ml",1082:"mt",1153:"mi",1146:"arn",1102:"mr",1148:"moh",1104:"mn",2128:"mn-CN",1121:"ne",1044:"nb",2068:"nn",1154:"oc",1096:"or",1123:"ps",1045:"pl",1046:"pt",2070:"pt-PT",1094:"pa",1131:"qu-BO",2155:"qu-EC",3179:"qu",1048:"ro",1047:"rm",1049:"ru",9275:"smn",4155:"smj-NO",5179:"smj",3131:"se-FI",1083:"se",2107:"se-SE",8251:"sms",6203:"sma-NO",7227:"sms",1103:"sa",7194:"sr-Cyrl-BA",3098:"sr",6170:"sr-Latn-BA",2074:"sr-Latn",1132:"nso",1074:"tn",1115:"si",1051:"sk",1060:"sl",11274:"es-AR",16394:"es-BO",13322:"es-CL",9226:"es-CO",5130:"es-CR",7178:"es-DO",12298:"es-EC",17418:"es-SV",4106:"es-GT",18442:"es-HN",2058:"es-MX",19466:"es-NI",6154:"es-PA",15370:"es-PY",10250:"es-PE",20490:"es-PR",3082:"es",1034:"es",21514:"es-US",14346:"es-UY",8202:"es-VE",2077:"sv-FI",1053:"sv",1114:"syr",1064:"tg",2143:"tzm",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1055:"tr",1090:"tk",1152:"ug",1058:"uk",1070:"hsb",1056:"ur",2115:"uz-Cyrl",1091:"uz",1066:"vi",1106:"cy",1160:"wo",1157:"sah",1144:"ii",1130:"yo"},vr="utf-16",gr={0:"macintosh",1:"x-mac-japanese",2:"x-mac-chinesetrad",3:"x-mac-korean",6:"x-mac-greek",7:"x-mac-cyrillic",9:"x-mac-devanagai",10:"x-mac-gurmukhi",11:"x-mac-gujarati",12:"x-mac-oriya",13:"x-mac-bengali",14:"x-mac-tamil",15:"x-mac-telugu",16:"x-mac-kannada",17:"x-mac-malayalam",18:"x-mac-sinhalese",19:"x-mac-burmese",20:"x-mac-khmer",21:"x-mac-thai",22:"x-mac-lao",23:"x-mac-georgian",24:"x-mac-armenian",25:"x-mac-chinesesimp",26:"x-mac-tibetan",27:"x-mac-mongolian",28:"x-mac-ethiopic",29:"x-mac-ce",30:"x-mac-vietnamese",31:"x-mac-extarabic"},yr={15:"x-mac-icelandic",17:"x-mac-turkish",18:"x-mac-croatian",24:"x-mac-ce",25:"x-mac-ce",26:"x-mac-ce",27:"x-mac-ce",28:"x-mac-ce",30:"x-mac-icelandic",37:"x-mac-romanian",38:"x-mac-ce",39:"x-mac-ce",40:"x-mac-ce",143:"x-mac-inuit",146:"x-mac-gaelic"},br={parse:function(t,e,r){for(var i={},n=new Ze.Parser(t,e),o=n.parseUShort(),a=n.parseUShort(),s=n.offset+n.parseUShort(),h=0;h<a;h++){var l,u=n.parseUShort(),c=n.parseUShort(),p=n.parseUShort(),d=n.parseUShort(),f=pr[d]||d,m=n.parseUShort(),v=n.parseUShort(),g=ct(u,p,r),y=pt(u,c,p);if(void 0!==y&&void 0!==g)if(l=y===vr?Ne.UTF16(t,s+v,m):Ne.MACSTRING(t,s+v,m,y)){var b=i[f];void 0===b&&(b=i[f]={}),b[g]=l}}return 1===o&&n.parseUShort(),i},make:function(t,e){var r,i=[],n={},o=dt(pr);for(var a in t){var s=o[a];if(void 0===s&&(s=a),r=parseInt(s),isNaN(r))throw new Error('Name table entry "'+a+'" does not exist, see nameTableNames for complete list.');n[r]=t[a],i.push(r)}for(var h=dt(dr),l=dt(mr),u=[],c=[],p=0;p<i.length;p++){var d=n[r=i[p]];for(var f in d){var m=d[f],v=1,g=h[f],y=fr[g],b=pt(v,y,g),_=Ge.MACSTRING(m,b);void 0===_&&(v=0,(g=e.indexOf(f))<0&&(g=e.length,e.push(f)),y=4,_=Ge.UTF16(m));var x=mt(_,c);u.push(ft(v,y,g,r,_.length,x));var w=l[f];if(void 0!==w){var S=Ge.UTF16(m),T=mt(S,c);u.push(ft(3,1,w,r,S.length,T))}}}u.sort(function(t,e){return t.platformID-e.platformID||t.encodingID-e.encodingID||t.languageID-e.languageID||t.nameID-e.nameID});for(var E=new Xe.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:u.length},{name:"stringOffset",type:"USHORT",value:6+12*u.length}]),M=0;M<u.length;M++)E.fields.push({name:"record_"+M,type:"RECORD",value:u[M]});return E.fields.push({name:"strings",type:"LITERAL",value:c}),E}},_r=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}],xr={parse:function(t,e){var r={},i=new Ze.Parser(t,e);r.version=i.parseUShort(),r.xAvgCharWidth=i.parseShort(),r.usWeightClass=i.parseUShort(),r.usWidthClass=i.parseUShort(),r.fsType=i.parseUShort(),r.ySubscriptXSize=i.parseShort(),r.ySubscriptYSize=i.parseShort(),r.ySubscriptXOffset=i.parseShort(),r.ySubscriptYOffset=i.parseShort(),r.ySuperscriptXSize=i.parseShort(),r.ySuperscriptYSize=i.parseShort(),r.ySuperscriptXOffset=i.parseShort(),r.ySuperscriptYOffset=i.parseShort(),r.yStrikeoutSize=i.parseShort(),r.yStrikeoutPosition=i.parseShort(),r.sFamilyClass=i.parseShort(),r.panose=[];for(var n=0;n<10;n++)r.panose[n]=i.parseByte();return r.ulUnicodeRange1=i.parseULong(),r.ulUnicodeRange2=i.parseULong(),r.ulUnicodeRange3=i.parseULong(),r.ulUnicodeRange4=i.parseULong(),r.achVendID=String.fromCharCode(i.parseByte(),i.parseByte(),i.parseByte(),i.parseByte()),r.fsSelection=i.parseUShort(),r.usFirstCharIndex=i.parseUShort(),r.usLastCharIndex=i.parseUShort(),r.sTypoAscender=i.parseShort(),r.sTypoDescender=i.parseShort(),r.sTypoLineGap=i.parseShort(),r.usWinAscent=i.parseUShort(),r.usWinDescent=i.parseUShort(),r.version>=1&&(r.ulCodePageRange1=i.parseULong(),r.ulCodePageRange2=i.parseULong()),r.version>=2&&(r.sxHeight=i.parseShort(),r.sCapHeight=i.parseShort(),r.usDefaultChar=i.parseUShort(),r.usBreakChar=i.parseUShort(),r.usMaxContent=i.parseUShort()),r},make:function(t){return new Xe.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],t)},unicodeRanges:_r,getUnicodeRange:function(t){for(var e=0;e<_r.length;e+=1){var r=_r[e];if(t>=r.begin&&t<r.end)return e}return-1}},wr={parse:function(t,e){var r={},i=new Ze.Parser(t,e);switch(r.version=i.parseVersion(),r.italicAngle=i.parseFixed(),r.underlinePosition=i.parseShort(),r.underlineThickness=i.parseShort(),r.isFixedPitch=i.parseULong(),r.minMemType42=i.parseULong(),r.maxMemType42=i.parseULong(),r.minMemType1=i.parseULong(),r.maxMemType1=i.parseULong(),r.version){case 1:r.names=tr.slice();break;case 2:r.numberOfGlyphs=i.parseUShort(),r.glyphNameIndex=new Array(r.numberOfGlyphs);for(var n=0;n<r.numberOfGlyphs;n++)r.glyphNameIndex[n]=i.parseUShort();r.names=[];for(var o=0;o<r.numberOfGlyphs;o++)if(r.glyphNameIndex[o]>=tr.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;s<r.numberOfGlyphs;s++)r.offset[s]=i.parseChar()}return r},make:function(){return new Xe.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])}},Sr=new Array(9);Sr[1]=function(){var t=this.offset+this.relativeOffset,e=this.parseUShort();return 1===e?{substFormat:1,coverage:this.parsePointer(k.coverage),deltaGlyphId:this.parseUShort()}:2===e?{substFormat:2,coverage:this.parsePointer(k.coverage),substitute:this.parseOffset16List()}:void Fe.assert(!1,"0x"+t.toString(16)+": lookup type 1 format must be 1 or 2.")},Sr[2]=function(){var t=this.parseUShort();return Fe.argument(1===t,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(k.coverage),sequences:this.parseListOfLists()}},Sr[3]=function(){var t=this.parseUShort();return Fe.argument(1===t,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(k.coverage),alternateSets:this.parseListOfLists()}},Sr[4]=function(){var t=this.parseUShort();return Fe.argument(1===t,"GSUB ligature table identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(k.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};var Tr={sequenceIndex:k.uShort,lookupListIndex:k.uShort};Sr[5]=function(){var t=this.offset+this.relativeOffset,e=this.parseUShort();if(1===e)return{substFormat:e,coverage:this.parsePointer(k.coverage),ruleSets:this.parseListOfLists(function(){var t=this.parseUShort(),e=this.parseUShort();return{input:this.parseUShortList(t-1),lookupRecords:this.parseRecordList(e,Tr)}})};if(2===e)return{substFormat:e,coverage:this.parsePointer(k.coverage),classDef:this.parsePointer(k.classDef),classSets:this.parseListOfLists(function(){var t=this.parseUShort(),e=this.parseUShort();return{classes:this.parseUShortList(t-1),lookupRecords:this.parseRecordList(e,Tr)}})};if(3===e){var r=this.parseUShort(),i=this.parseUShort();return{substFormat:e,coverages:this.parseList(r,k.pointer(k.coverage)),lookupRecords:this.parseRecordList(i,Tr)}}Fe.assert(!1,"0x"+t.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},Sr[6]=function(){var t=this.offset+this.relativeOffset,e=this.parseUShort();return 1===e?{substFormat:1,coverage:this.parsePointer(k.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Tr)}})}:2===e?{substFormat:2,coverage:this.parsePointer(k.coverage),backtrackClassDef:this.parsePointer(k.classDef),inputClassDef:this.parsePointer(k.classDef),lookaheadClassDef:this.parsePointer(k.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Tr)}})}:3===e?{substFormat:3,backtrackCoverage:this.parseList(k.pointer(k.coverage)),inputCoverage:this.parseList(k.pointer(k.coverage)),lookaheadCoverage:this.parseList(k.pointer(k.coverage)),lookupRecords:this.parseRecordList(Tr)}:void Fe.assert(!1,"0x"+t.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},Sr[7]=function(){var t=this.parseUShort();Fe.argument(1===t,"GSUB Extension Substitution subtable identifier-format must be 1");var e=this.parseUShort(),r=new k(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:e,extension:Sr[e].call(r)}},Sr[8]=function(){var t=this.parseUShort();return Fe.argument(1===t,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(k.coverage),backtrackCoverage:this.parseList(k.pointer(k.coverage)),lookaheadCoverage:this.parseList(k.pointer(k.coverage)),substitutes:this.parseUShortList()}};var Er=new Array(9);Er[1]=function(t){return 1===t.substFormat?new Xe.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Xe.Coverage(t.coverage)},{name:"deltaGlyphID",type:"USHORT",value:t.deltaGlyphId}]):new Xe.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new Xe.Coverage(t.coverage)}].concat(Xe.ushortList("substitute",t.substitute)))},Er[3]=function(t){return Fe.assert(1===t.substFormat,"Lookup type 3 substFormat must be 1."),new Xe.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Xe.Coverage(t.coverage)}].concat(Xe.tableList("altSet",t.alternateSets,function(t){return new Xe.Table("alternateSetTable",Xe.ushortList("alternate",t))})))},Er[4]=function(t){return Fe.assert(1===t.substFormat,"Lookup type 4 substFormat must be 1."),new Xe.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Xe.Coverage(t.coverage)}].concat(Xe.tableList("ligSet",t.ligatureSets,function(t){return new Xe.Table("ligatureSetTable",Xe.tableList("ligature",t,function(t){return new Xe.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:t.ligGlyph}].concat(Xe.ushortList("component",t.components,t.components.length+1)))}))})))};var Mr={parse:function(t,e){var r=new k(t,e=e||0),i=r.parseVersion();return Fe.argument(1===i,"Unsupported GSUB table version."),{version:i,scripts:r.parseScriptList(),features:r.parseFeatureList(),lookups:r.parseLookupList(Sr)}},make:function(t){return new Xe.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new Xe.ScriptList(t.scripts)},{name:"features",type:"TABLE",value:new Xe.FeatureList(t.features)},{name:"lookups",type:"TABLE",value:new Xe.LookupList(t.lookups,Er)}])}},Rr={parse:function(t,e){var r=new Ze.Parser(t,e),i=r.parseULong();Fe.argument(1===i,"Unsupported META table version."),r.parseULong(),r.parseULong();for(var n=r.parseULong(),o={},a=0;a<n;a++){var s=r.parseTag(),h=r.parseULong(),l=r.parseULong(),u=Ne.UTF8(t,e+h,l);o[s]=u}return o},make:function(t){var e=Object.keys(t).length,r="",i=16+12*e,n=new Xe.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:i},{name:"numTags",type:"ULONG",value:e}]);for(var o in t){var a=r.length;r+=t[o],n.fields.push({name:"tag "+o,type:"TAG",value:o}),n.fields.push({name:"offset "+o,type:"ULONG",value:i+a}),n.fields.push({name:"length "+o,type:"ULONG",value:t[o].length})}return n.fields.push({name:"stringPool",type:"CHARARRAY",value:r}),n}},Cr={make:bt,fontToTable:function(t){for(var e,r=[],i=[],n=[],o=[],a=[],s=[],h=[],l=0,u=0,c=0,p=0,d=0,f=0;f<t.glyphs.length;f+=1){var m=t.glyphs.get(f),v=0|m.unicode;if(isNaN(m.advanceWidth))throw new Error("Glyph "+m.name+" ("+f+"): advanceWidth is not a number.");(e>v||void 0===e)&&v>0&&(e=v),l<v&&(l=v);var g=xr.getUnicodeRange(v);if(g<32)u|=1<<g;else if(g<64)c|=1<<g-32;else if(g<96)p|=1<<g-64;else{if(!(g<123))throw new Error("Unicode ranges bits > 123 are reserved for internal usage");d|=1<<g-96}if(".notdef"!==m.name){var y=m.getMetrics();r.push(y.xMin),i.push(y.yMin),n.push(y.xMax),o.push(y.yMax),s.push(y.leftSideBearing),h.push(y.rightSideBearing),a.push(m.advanceWidth)}}var b={xMin:Math.min.apply(null,r),yMin:Math.min.apply(null,i),xMax:Math.max.apply(null,n),yMax:Math.max.apply(null,o),advanceWidthMax:Math.max.apply(null,a),advanceWidthAvg:function(t){for(var e=0,r=0;r<t.length;r+=1)e+=t[r];return e/t.length}(a),minLeftSideBearing:Math.min.apply(null,s),maxLeftSideBearing:Math.max.apply(null,s),minRightSideBearing:Math.min.apply(null,h)};b.ascender=t.ascender,b.descender=t.descender;var _=sr.make({flags:3,unitsPerEm:t.unitsPerEm,xMin:b.xMin,yMin:b.yMin,xMax:b.xMax,yMax:b.yMax,lowestRecPPEM:3,createdTimestamp:t.createdTimestamp}),x=hr.make({ascender:b.ascender,descender:b.descender,advanceWidthMax:b.advanceWidthMax,minLeftSideBearing:b.minLeftSideBearing,minRightSideBearing:b.minRightSideBearing,xMaxExtent:b.maxLeftSideBearing+(b.xMax-b.xMin),numberOfHMetrics:t.glyphs.length}),w=cr.make(t.glyphs.length),S=xr.make({xAvgCharWidth:Math.round(b.advanceWidthAvg),usWeightClass:t.tables.os2.usWeightClass,usWidthClass:t.tables.os2.usWidthClass,usFirstCharIndex:e,usLastCharIndex:l,ulUnicodeRange1:u,ulUnicodeRange2:c,ulUnicodeRange3:p,ulUnicodeRange4:d,fsSelection:t.tables.os2.fsSelection,sTypoAscender:b.ascender,sTypoDescender:b.descender,sTypoLineGap:0,usWinAscent:b.yMax,usWinDescent:Math.abs(b.yMin),ulCodePageRange1:1,sxHeight:_t(t,"xyvw",{yMax:Math.round(b.ascender/2)}).yMax,sCapHeight:_t(t,"HIKLEFJMNTZBDPRAGOQSUVWXY",b).yMax,usDefaultChar:t.hasChar(" ")?32:0,usBreakChar:t.hasChar(" ")?32:0}),T=lr.make(t.glyphs),E=Je.make(t.glyphs),M=t.getEnglishName("fontFamily"),R=t.getEnglishName("fontSubfamily"),C=M+" "+R,P=t.getEnglishName("postScriptName");P||(P=M.replace(/\s/g,"")+"-"+R);var L={};for(var A in t.names)L[A]=t.names[A];L.uniqueID||(L.uniqueID={en:t.getEnglishName("manufacturer")+":"+C}),L.postScriptName||(L.postScriptName={en:P}),L.preferredFamily||(L.preferredFamily=t.names.fontFamily),L.preferredSubfamily||(L.preferredSubfamily=t.names.fontSubfamily);var D=[],I=br.make(L,D),U=D.length>0?ur.make(D):void 0,k=wr.make(),O=ar.make(t.glyphs,{version:t.getEnglishName("version"),fullName:C,familyName:M,weightName:R,postScriptName:P,unitsPerEm:t.unitsPerEm,fontBBox:[0,b.yMin,b.ascender,b.advanceWidthMax]}),F=t.metas&&Object.keys(t.metas).length>0?Rr.make(t.metas):void 0,B=[_,x,w,S,I,E,k,O,T];U&&B.push(U),t.tables.gsub&&B.push(Mr.make(t.tables.gsub)),F&&B.push(F);for(var N=bt(B),G=gt(N.encode()),H=N.fields,V=!1,z=0;z<H.length;z+=1)if("head table"===H[z].name){H[z].value.checkSumAdjustment=2981146554-G,V=!0;break}if(!V)throw new Error("Could not find head table with checkSum to adjust.");return N},computeCheckSum:gt};wt.prototype={searchTag:xt,binSearch:function(t,e){for(var r=0,i=t.length-1;r<=i;){var n=r+i>>>1,o=t[n];if(o===e)return n;o<e?r=n+1:i=n-1}return-r-1},getTable:function(t){var e=this.font.tables[this.tableName];return!e&&t&&(e=this.font.tables[this.tableName]=this.createDefaultTable()),e},getScriptNames:function(){var t=this.getTable();return t?t.scripts.map(function(t){return t.tag}):[]},getDefaultScriptName:function(){var t=this.getTable();if(t){for(var e=!1,r=0;r<t.scripts.length;r++){var i=t.scripts[r].tag;if("DFLT"===i)return i;"latn"===i&&(e=!0)}return e?"latn":void 0}},getScriptTable:function(t,e){var r=this.getTable(e);if(r){t=t||"DFLT";var i=r.scripts,n=xt(r.scripts,t);if(n>=0)return i[n].script;if(e){var o={tag:t,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return i.splice(-1-n,0,o),o.script}}},getLangSysTable:function(t,e,r){var i=this.getScriptTable(t,r);if(i){if(!e||"dflt"===e||"DFLT"===e)return i.defaultLangSys;var n=xt(i.langSysRecords,e);if(n>=0)return i.langSysRecords[n].langSys;if(r){var o={tag:e,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return i.langSysRecords.splice(-1-n,0,o),o.langSys}}},getFeatureTable:function(t,e,r,i){var n=this.getLangSysTable(t,e,i);if(n){for(var o,a=n.featureIndexes,s=this.font.tables[this.tableName].features,h=0;h<a.length;h++)if((o=s[a[h]]).tag===r)return o.feature;if(i){var l=s.length;return Fe.assert(0===l||r>=s[l-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(l),o.feature}}},getLookupTables:function(t,e,r,i,n){var o=this.getFeatureTable(t,e,r,n),a=[];if(o){for(var s,h=o.lookupListIndexes,l=this.font.tables[this.tableName].lookups,u=0;u<h.length;u++)(s=l[h[u]]).lookupType===i&&a.push(s);if(0===a.length&&n){s={lookupType:i,lookupFlag:0,subtables:[],markFilteringSet:void 0};var c=l.length;return l.push(s),h.push(c),[s]}}return a},expandCoverage:function(t){if(1===t.format)return t.glyphs;for(var e=[],r=t.ranges,i=0;i<r.length;i++)for(var n=r[i],o=n.start,a=n.end,s=o;s<=a;s++)e.push(s);return e}},St.prototype=wt.prototype,St.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},St.prototype.getSingle=function(t,e,r){for(var i=[],n=this.getLookupTables(e,r,t,1),o=0;o<n.length;o++)for(var a=n[o].subtables,s=0;s<a.length;s++){var h=a[s],l=this.expandCoverage(h.coverage),u=void 0;if(1===h.substFormat){var c=h.deltaGlyphId;for(u=0;u<l.length;u++){var p=l[u];i.push({sub:p,by:p+c})}}else{var d=h.substitute;for(u=0;u<l.length;u++)i.push({sub:l[u],by:d[u]})}}return i},St.prototype.getAlternates=function(t,e,r){for(var i=[],n=this.getLookupTables(e,r,t,3),o=0;o<n.length;o++)for(var a=n[o].subtables,s=0;s<a.length;s++)for(var h=a[s],l=this.expandCoverage(h.coverage),u=h.alternateSets,c=0;c<l.length;c++)i.push({sub:l[c],by:u[c]});return i},St.prototype.getLigatures=function(t,e,r){for(var i=[],n=this.getLookupTables(e,r,t,4),o=0;o<n.length;o++)for(var a=n[o].subtables,s=0;s<a.length;s++)for(var h=a[s],l=this.expandCoverage(h.coverage),u=h.ligatureSets,c=0;c<l.length;c++)for(var p=l[c],d=u[c],f=0;f<d.length;f++){var m=d[f];i.push({sub:[p].concat(m.components),by:m.ligGlyph})}return i},St.prototype.addSingle=function(t,e,r,i){var n=Et(this.getLookupTables(r,i,t,1,!0)[0],2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});Fe.assert(1===n.coverage.format,"Ligature: unable to modify coverage table format "+n.coverage.format);var o=e.sub,a=this.binSearch(n.coverage.glyphs,o);a<0&&(a=-1-a,n.coverage.glyphs.splice(a,0,o),n.substitute.splice(a,0,0)),n.substitute[a]=e.by},St.prototype.addAlternate=function(t,e,r,i){var n=Et(this.getLookupTables(r,i,t,3,!0)[0],1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});Fe.assert(1===n.coverage.format,"Ligature: unable to modify coverage table format "+n.coverage.format);var o=e.sub,a=this.binSearch(n.coverage.glyphs,o);a<0&&(a=-1-a,n.coverage.glyphs.splice(a,0,o),n.alternateSets.splice(a,0,0)),n.alternateSets[a]=e.by},St.prototype.addLigature=function(t,e,r,i){var n=this.getLookupTables(r,i,t,4,!0)[0],o=n.subtables[0];o||(o={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},n.subtables[0]=o),Fe.assert(1===o.coverage.format,"Ligature: unable to modify coverage table format "+o.coverage.format);var a=e.sub[0],s=e.sub.slice(1),h={ligGlyph:e.by,components:s},l=this.binSearch(o.coverage.glyphs,a);if(l>=0){for(var u=o.ligatureSets[l],c=0;c<u.length;c++)if(Tt(u[c].components,s))return;u.push(h)}else l=-1-l,o.coverage.glyphs.splice(l,0,a),o.ligatureSets.splice(l,0,[h])},St.prototype.getFeature=function(t,e,r){if(/ss\d\d/.test(t))return this.getSingle(t,e,r);switch(t){case"aalt":case"salt":return this.getSingle(t,e,r).concat(this.getAlternates(t,e,r));case"dlig":case"liga":case"rlig":return this.getLigatures(t,e,r)}},St.prototype.add=function(t,e,r,i){if(/ss\d\d/.test(t))return this.addSingle(t,e,r,i);switch(t){case"aalt":case"salt":return"number"==typeof e.by?this.addSingle(t,e,r,i):this.addAlternate(t,e,r,i);case"dlig":case"liga":case"rlig":return this.addLigature(t,e,r,i)}};var Pr,Lr,Ar,Dr,Ir=function(t){var e=this.srPeriod,r=this.srPhase,i=this.srThreshold,n=1;return t<0&&(t=-t,n=-1),t+=i-r,t=Math.trunc(t/e)*e,t+=r,n>0&&t<0?r:n<0&&t>0?-r:t*n},Ur={x:1,y:0,axis:"x",distance:function(t,e,r,i){return(r?t.xo:t.x)-(i?e.xo:e.x)},interpolate:function(t,e,r,i){var n,o,a,s,h,l,u;return i&&i!==this?(n=i.distance(t,e,!0,!0),o=i.distance(t,r,!0,!0),h=i.distance(e,e,!1,!0),l=i.distance(r,r,!1,!0),0===(u=(a=Math.abs(n))+(s=Math.abs(o)))?void Ur.setRelative(t,t,(h+l)/2,i,!0):void Ur.setRelative(t,t,(h*s+l*a)/u,i,!0)):(n=t.xo-e.xo,o=t.xo-r.xo,h=e.x-e.xo,l=r.x-r.xo,0===(u=(a=Math.abs(n))+(s=Math.abs(o)))?void(t.x=t.xo+(h+l)/2):void(t.x=t.xo+(h*s+l*a)/u))},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(t,e,r,i,n){if(i&&i!==this){var o=n?e.xo:e.x,a=n?e.yo:e.y,s=o+r*i.x,h=a+r*i.y;t.x=s+(t.y-h)/i.normalSlope}else t.x=(n?e.xo:e.x)+r},slope:0,touch:function(t){t.xTouched=!0},touched:function(t){return t.xTouched},untouch:function(t){t.xTouched=!1}},kr={x:0,y:1,axis:"y",distance:function(t,e,r,i){return(r?t.yo:t.y)-(i?e.yo:e.y)},interpolate:function(t,e,r,i){var n,o,a,s,h,l,u;return i&&i!==this?(n=i.distance(t,e,!0,!0),o=i.distance(t,r,!0,!0),h=i.distance(e,e,!1,!0),l=i.distance(r,r,!1,!0),0===(u=(a=Math.abs(n))+(s=Math.abs(o)))?void kr.setRelative(t,t,(h+l)/2,i,!0):void kr.setRelative(t,t,(h*s+l*a)/u,i,!0)):(n=t.yo-e.yo,o=t.yo-r.yo,h=e.y-e.yo,l=r.y-r.yo,0===(u=(a=Math.abs(n))+(s=Math.abs(o)))?void(t.y=t.yo+(h+l)/2):void(t.y=t.yo+(h*s+l*a)/u))},normalSlope:0,setRelative:function(t,e,r,i,n){if(i&&i!==this){var o=n?e.xo:e.x,a=n?e.yo:e.y,s=o+r*i.x,h=a+r*i.y;t.y=h+i.normalSlope*(t.x-s)}else t.y=(n?e.yo:e.y)+r},slope:Number.POSITIVE_INFINITY,touch:function(t){t.yTouched=!0},touched:function(t){return t.yTouched},untouch:function(t){t.yTouched=!1}};Object.freeze(Ur),Object.freeze(kr),Ot.prototype.distance=function(t,e,r,i){return this.x*Ur.distance(t,e,r,i)+this.y*kr.distance(t,e,r,i)},Ot.prototype.interpolate=function(t,e,r,i){var n,o,a,s,h,l,u;a=i.distance(t,e,!0,!0),s=i.distance(t,r,!0,!0),n=i.distance(e,e,!1,!0),o=i.distance(r,r,!1,!0),0!==(u=(h=Math.abs(a))+(l=Math.abs(s)))?this.setRelative(t,t,(n*l+o*h)/u,i,!0):this.setRelative(t,t,(n+o)/2,i,!0)},Ot.prototype.setRelative=function(t,e,r,i,n){i=i||this;var o=n?e.xo:e.x,a=n?e.yo:e.y,s=o+r*i.x,h=a+r*i.y,l=i.normalSlope,u=this.slope,c=t.x,p=t.y;t.x=(u*c-l*s+h-p)/(u-l),t.y=u*(t.x-c)+p},Ot.prototype.touch=function(t){t.xTouched=!0,t.yTouched=!0},Bt.prototype.nextTouched=function(t){for(var e=this.nextPointOnContour;!t.touched(e)&&e!==this;)e=e.nextPointOnContour;return e},Bt.prototype.prevTouched=function(t){for(var e=this.prevPointOnContour;!t.touched(e)&&e!==this;)e=e.prevPointOnContour;return e};var Or=Object.freeze(new Bt(0,0)),Fr={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};Pt.prototype.exec=function(t,r){if("number"!=typeof r)throw new Error("Point size is not a number!");if(!(this._errorState>2)){var i=this.font,n=this._prepState;if(!n||n.ppem!==r){var o=this._fpgmState;if(!o){Nt.prototype=Fr,(o=this._fpgmState=new Nt("fpgm",i.tables.fpgm)).funcs=[],o.font=i,e.DEBUG&&(console.log("---EXEC FPGM---"),o.step=-1);try{Lr(o)}catch(t){return console.log("Hinting error in FPGM:"+t),void(this._errorState=3)}}Nt.prototype=o,(n=this._prepState=new Nt("prep",i.tables.prep)).ppem=r;var a=i.tables.cvt;if(a)for(var s=n.cvt=new Array(a.length),h=r/i.unitsPerEm,l=0;l<a.length;l++)s[l]=a[l]*h;else n.cvt=[];e.DEBUG&&(console.log("---EXEC PREP---"),n.step=-1);try{Lr(n)}catch(t){this._errorState<2&&console.log("Hinting error in PREP:"+t),this._errorState=2}}if(!(this._errorState>1))try{return Ar(t,n)}catch(t){return this._errorState<1&&(console.log("Hinting error:"+t),console.log("Note: further hinting errors are silenced")),void(this._errorState=1)}}},Ar=function(t,r){var i,n,o,a=r.ppem/r.font.unitsPerEm,s=a,h=t.components;if(Nt.prototype=r,h){var l=r.font;n=[],i=[];for(var u=0;u<h.length;u++){var c=h[u],p=l.glyphs.get(c.glyphIndex);o=new Nt("glyf",p.instructions),e.DEBUG&&(console.log("---EXEC COMP "+u+"---"),o.step=-1),Dr(p,o,a,s);for(var d=Math.round(c.dx*a),f=Math.round(c.dy*s),m=o.gZone,v=o.contours,g=0;g<m.length;g++){var y=m[g];y.xTouched=y.yTouched=!1,y.xo=y.x=y.x+d,y.yo=y.y=y.y+f}var b=n.length;n.push.apply(n,m);for(var _=0;_<v.length;_++)i.push(v[_]+b)}t.instructions&&!o.inhibitGridFit&&((o=new Nt("glyf",t.instructions)).gZone=o.z0=o.z1=o.z2=n,o.contours=i,n.push(new Bt(0,0),new Bt(Math.round(t.advanceWidth*a),0)),e.DEBUG&&(console.log("---EXEC COMPOSITE---"),o.step=-1),Lr(o),n.length-=2)}else o=new Nt("glyf",t.instructions),e.DEBUG&&(console.log("---EXEC GLYPH---"),o.step=-1),Dr(t,o,a,s),n=o.gZone;return n},Dr=function(t,r,i,n){for(var o,a=t.points||[],s=a.length,h=r.gZone=r.z0=r.z1=r.z2=[],l=r.contours=[],u=0;u<s;u++)o=a[u],h[u]=new Bt(o.x*i,o.y*n,o.lastPointOfContour,o.onCurve);for(var c,p,d=0;d<s;d++)o=h[d],c||(c=o,l.push(d)),o.lastPointOfContour?(o.nextPointOnContour=c,c.prevPointOnContour=o,c=void 0):(p=h[d+1],o.nextPointOnContour=p,p.prevPointOnContour=o);if(!r.inhibitGridFit&&(h.push(new Bt(0,0),new Bt(Math.round(t.advanceWidth*i),0)),Lr(r),h.length-=2,e.DEBUG)){console.log("FINISHED GLYPH",r.stack);for(var f=0;f<s;f++)console.log(f,h[f].x,h[f].y)}},Lr=function(t){var r=t.prog;if(r){var i,n=r.length;for(t.ip=0;t.ip<n;t.ip++){if(e.DEBUG&&t.step++,!(i=Pr[r[t.ip]]))throw new Error("unknown instruction: 0x"+Number(r[t.ip]).toString(16));i(t)}}},Pr=[Vt.bind(void 0,kr),Vt.bind(void 0,Ur),zt.bind(void 0,kr),zt.bind(void 0,Ur),jt.bind(void 0,kr),jt.bind(void 0,Ur),Wt.bind(void 0,0),Wt.bind(void 0,1),Xt.bind(void 0,0),Xt.bind(void 0,1),function(t){var r=t.stack,i=r.pop(),n=r.pop();e.DEBUG&&console.log(t.step,"SPVFS[]",i,n),t.pv=t.dpv=Ft(n,i)},function(t){var r=t.stack,i=r.pop(),n=r.pop();e.DEBUG&&console.log(t.step,"SPVFS[]",i,n),t.fv=Ft(n,i)},function(t){var r=t.stack,i=t.pv;e.DEBUG&&console.log(t.step,"GPV[]"),r.push(16384*i.x),r.push(16384*i.y)},function(t){var r=t.stack,i=t.fv;e.DEBUG&&console.log(t.step,"GFV[]"),r.push(16384*i.x),r.push(16384*i.y)},function(t){t.fv=t.pv,e.DEBUG&&console.log(t.step,"SFVTPV[]")},function(t){var r=t.stack,i=r.pop(),n=r.pop(),o=r.pop(),a=r.pop(),s=r.pop(),h=t.z0,l=t.z1,u=h[i],c=h[n],p=l[o],d=l[a],f=t.z2[s];e.DEBUG&&console.log("ISECT[], ",i,n,o,a,s);var m=u.x,v=u.y,g=c.x,y=c.y,b=p.x,_=p.y,x=d.x,w=d.y,S=(m-g)*(_-w)-(v-y)*(b-x),T=m*y-v*g,E=b*w-_*x;f.x=(T*(b-x)-E*(m-g))/S,f.y=(T*(_-w)-E*(v-y))/S},function(t){t.rp0=t.stack.pop(),e.DEBUG&&console.log(t.step,"SRP0[]",t.rp0)},function(t){t.rp1=t.stack.pop(),e.DEBUG&&console.log(t.step,"SRP1[]",t.rp1)},function(t){t.rp2=t.stack.pop(),e.DEBUG&&console.log(t.step,"SRP2[]",t.rp2)},function(t){var r=t.stack.pop();switch(e.DEBUG&&console.log(t.step,"SZP0[]",r),t.zp0=r,r){case 0:t.tZone||Gt(t),t.z0=t.tZone;break;case 1:t.z0=t.gZone;break;default:throw new Error("Invalid zone pointer")}},function(t){var r=t.stack.pop();switch(e.DEBUG&&console.log(t.step,"SZP1[]",r),t.zp1=r,r){case 0:t.tZone||Gt(t),t.z1=t.tZone;break;case 1:t.z1=t.gZone;break;default:throw new Error("Invalid zone pointer")}},function(t){var r=t.stack.pop();switch(e.DEBUG&&console.log(t.step,"SZP2[]",r),t.zp2=r,r){case 0:t.tZone||Gt(t),t.z2=t.tZone;break;case 1:t.z2=t.gZone;break;default:throw new Error("Invalid zone pointer")}},function(t){var r=t.stack.pop();switch(e.DEBUG&&console.log(t.step,"SZPS[]",r),t.zp0=t.zp1=t.zp2=r,r){case 0:t.tZone||Gt(t),t.z0=t.z1=t.z2=t.tZone;break;case 1:t.z0=t.z1=t.z2=t.gZone;break;default:throw new Error("Invalid zone pointer")}},function(t){t.loop=t.stack.pop(),e.DEBUG&&console.log(t.step,"SLOOP[]",t.loop)},function(t){e.DEBUG&&console.log(t.step,"RTG[]"),t.round=At},function(t){e.DEBUG&&console.log(t.step,"RTHG[]"),t.round=It},function(t){var r=t.stack.pop();e.DEBUG&&console.log(t.step,"SMD[]",r),t.minDis=r/64},function(t){e.DEBUG&&console.log(t.step,"ELSE[]"),Ht(t,!1)},function(t){var r=t.stack.pop();e.DEBUG&&console.log(t.step,"JMPR[]",r),t.ip+=r-1},function(t){var r=t.stack.pop();e.DEBUG&&console.log(t.step,"SCVTCI[]",r),t.cvCutIn=r/64},void 0,void 0,function(t){var r=t.stack;e.DEBUG&&console.log(t.step,"DUP[]"),r.push(r[r.length-1])},Yt,function(t){e.DEBUG&&console.log(t.step,"CLEAR[]"),t.stack.length=0},function(t){var r=t.stack,i=r.pop(),n=r.pop();e.DEBUG&&console.log(t.step,"SWAP[]"),r.push(i),r.push(n)},function(t){var r=t.stack;e.DEBUG&&console.log(t.step,"DEPTH[]"),r.push(r.length)},function(t){var r=t.stack,i=r.pop();e.DEBUG&&console.log(t.step,"CINDEX[]",i),r.push(r[r.length-i])},function(t){var r=t.stack,i=r.pop();e.DEBUG&&console.log(t.step,"MINDEX[]",i),r.push(r.splice(r.length-i,1)[0])},void 0,void 0,void 0,function(t){var r=t.stack,i=r.pop(),n=r.pop();e.DEBUG&&console.log(t.step,"LOOPCALL[]",i,n);var o=t.ip,a=t.prog;t.prog=t.funcs[i];for(var s=0;s<n;s++)Lr(t),e.DEBUG&&console.log(++t.step,s+1<n?"next loopcall":"done loopcall",s);t.ip=o,t.prog=a},function(t){var r=t.stack.pop();e.DEBUG&&console.log(t.step,"CALL[]",r);var i=t.ip,n=t.prog;t.prog=t.funcs[r],Lr(t),t.ip=i,t.prog=n,e.DEBUG&&console.log(++t.step,"returning from",r)},function(t){if("fpgm"!==t.env)throw new Error("FDEF not allowed here");var r=t.stack,i=t.prog,n=t.ip,o=r.pop(),a=n;for(e.DEBUG&&console.log(t.step,"FDEF[]",o);45!==i[++n];);t.ip=n,t.funcs[o]=i.slice(a+1,n)},void 0,qt.bind(void 0,0),qt.bind(void 0,1),Zt.bind(void 0,kr),Zt.bind(void 0,Ur),Jt.bind(void 0,0),Jt.bind(void 0,1),Qt.bind(void 0,0),Qt.bind(void 0,1),Kt.bind(void 0,0),Kt.bind(void 0,1),function(t){for(var r=t.stack,i=t.loop,n=t.fv,o=r.pop()/64,a=t.z2;i--;){var s=r.pop(),h=a[s];e.DEBUG&&console.log(t.step,(t.loop>1?"loop "+(t.loop-i)+": ":"")+"SHPIX[]",s,o),n.setRelative(h,h,o),n.touch(h)}t.loop=1},function(t){for(var r=t.stack,i=t.rp1,n=t.rp2,o=t.loop,a=t.z0[i],s=t.z1[n],h=t.fv,l=t.dpv,u=t.z2;o--;){var c=r.pop(),p=u[c];e.DEBUG&&console.log(t.step,(t.loop>1?"loop "+(t.loop-o)+": ":"")+"IP[]",c,i,"<->",n),h.interpolate(p,a,s,l),h.touch(p)}t.loop=1},$t.bind(void 0,0),$t.bind(void 0,1),function(t){for(var r=t.stack,i=t.rp0,n=t.z0[i],o=t.loop,a=t.fv,s=t.pv,h=t.z1;o--;){var l=r.pop(),u=h[l];e.DEBUG&&console.log(t.step,(t.loop>1?"loop "+(t.loop-o)+": ":"")+"ALIGNRP[]",l),a.setRelative(u,n,0,s),a.touch(u)}t.loop=1},function(t){e.DEBUG&&console.log(t.step,"RTDG[]"),t.round=Dt},te.bind(void 0,0),te.bind(void 0,1),function(t){var r=t.prog,i=t.ip,n=t.stack,o=r[++i];e.DEBUG&&console.log(t.step,"NPUSHB[]",o);for(var a=0;a<o;a++)n.push(r[++i]);t.ip=i},function(t){var r=t.ip,i=t.prog,n=t.stack,o=i[++r];e.DEBUG&&console.log(t.step,"NPUSHW[]",o);for(var a=0;a<o;a++){var s=i[++r]<<8|i[++r];32768&s&&(s=-(1+(65535^s))),n.push(s)}t.ip=r},function(t){var r=t.stack,i=t.store;i||(i=t.store=[]);var n=r.pop(),o=r.pop();e.DEBUG&&console.log(t.step,"WS",n,o),i[o]=n},function(t){var r=t.stack,i=t.store,n=r.pop();e.DEBUG&&console.log(t.step,"RS",n);var o=i&&i[n]||0;r.push(o)},function(t){var r=t.stack,i=r.pop(),n=r.pop();e.DEBUG&&console.log(t.step,"WCVTP",i,n),t.cvt[n]=i/64},function(t){var r=t.stack,i=r.pop();e.DEBUG&&console.log(t.step,"RCVT",i),r.push(64*t.cvt[i])},ee.bind(void 0,0),ee.bind(void 0,1),void 0,re.bind(void 0,0),re.bind(void 0,1),function(t){e.DEBUG&&console.log(t.step,"MPPEM[]"),t.stack.push(t.ppem)},void 0,function(t){e.DEBUG&&console.log(t.step,"FLIPON[]"),t.autoFlip=!0},void 0,void 0,function(t){var r=t.stack,i=r.pop(),n=r.pop();e.DEBUG&&console.log(t.step,"LT[]",i,n),r.push(n<i?1:0)},function(t){var r=t.stack,i=r.pop(),n=r.pop();e.DEBUG&&console.log(t.step,"LTEQ[]",i,n),r.push(n<=i?1:0)},function(t){var r=t.stack,i=r.pop(),n=r.pop();e.DEBUG&&console.log(t.step,"GT[]",i,n),r.push(n>i?1:0)},function(t){var r=t.stack,i=r.pop(),n=r.pop();e.DEBUG&&console.log(t.step,"GTEQ[]",i,n),r.push(n>=i?1:0)},function(t){var r=t.stack,i=r.pop(),n=r.pop();e.DEBUG&&console.log(t.step,"EQ[]",i,n),r.push(i===n?1:0)},function(t){var r=t.stack,i=r.pop(),n=r.pop();e.DEBUG&&console.log(t.step,"NEQ[]",i,n),r.push(i!==n?1:0)},function(t){var r=t.stack,i=r.pop();e.DEBUG&&console.log(t.step,"ODD[]",i),r.push(Math.trunc(i)%2?1:0)},function(t){var r=t.stack,i=r.pop();e.DEBUG&&console.log(t.step,"EVEN[]",i),r.push(Math.trunc(i)%2?0:1)},function(t){var r=t.stack.pop();e.DEBUG&&console.log(t.step,"IF[]",r),r||(Ht(t,!0),e.DEBUG&&console.log(t.step,"EIF[]"))},function(t){e.DEBUG&&console.log(t.step,"EIF[]")},function(t){var r=t.stack,i=r.pop(),n=r.pop();e.DEBUG&&console.log(t.step,"AND[]",i,n),r.push(i&&n?1:0)},function(t){var r=t.stack,i=r.pop(),n=r.pop();e.DEBUG&&console.log(t.step,"OR[]",i,n),r.push(i||n?1:0)},function(t){var r=t.stack,i=r.pop();e.DEBUG&&console.log(t.step,"NOT[]",i),r.push(i?0:1)},ie.bind(void 0,1),function(t){var r=t.stack.pop();e.DEBUG&&console.log(t.step,"SDB[]",r),t.deltaBase=r},function(t){var r=t.stack.pop();e.DEBUG&&console.log(t.step,"SDS[]",r),t.deltaShift=Math.pow(.5,r)},function(t){var r=t.stack,i=r.pop(),n=r.pop();e.DEBUG&&console.log(t.step,"ADD[]",i,n),r.push(n+i)},function(t){var r=t.stack,i=r.pop(),n=r.pop();e.DEBUG&&console.log(t.step,"SUB[]",i,n),r.push(n-i)},function(t){var r=t.stack,i=r.pop(),n=r.pop();e.DEBUG&&console.log(t.step,"DIV[]",i,n),r.push(64*n/i)},function(t){var r=t.stack,i=r.pop(),n=r.pop();e.DEBUG&&console.log(t.step,"MUL[]",i,n),r.push(n*i/64)},function(t){var r=t.stack,i=r.pop();e.DEBUG&&console.log(t.step,"ABS[]",i),r.push(Math.abs(i))},function(t){var r=t.stack,i=r.pop();e.DEBUG&&console.log(t.step,"NEG[]",i),r.push(-i)},function(t){var r=t.stack,i=r.pop();e.DEBUG&&console.log(t.step,"FLOOR[]",i),r.push(64*Math.floor(i/64))},function(t){var r=t.stack,i=r.pop();e.DEBUG&&console.log(t.step,"CEILING[]",i),r.push(64*Math.ceil(i/64))},ne.bind(void 0,0),ne.bind(void 0,1),ne.bind(void 0,2),ne.bind(void 0,3),void 0,void 0,void 0,void 0,function(t){var r=t.stack,i=r.pop(),n=r.pop();e.DEBUG&&console.log(t.step,"WCVTF[]",i,n),t.cvt[n]=i*t.ppem/t.font.unitsPerEm},ie.bind(void 0,2),ie.bind(void 0,3),oe.bind(void 0,1),oe.bind(void 0,2),oe.bind(void 0,3),function(t){var r,i=t.stack.pop();switch(e.DEBUG&&console.log(t.step,"SROUND[]",i),t.round=Ir,192&i){case 0:r=.5;break;case 64:r=1;break;case 128:r=2;break;default:throw new Error("invalid SROUND value")}switch(t.srPeriod=r,48&i){case 0:t.srPhase=0;break;case 16:t.srPhase=.25*r;break;case 32:t.srPhase=.5*r;break;case 48:t.srPhase=.75*r;break;default:throw new Error("invalid SROUND value")}i&=15,t.srThreshold=0===i?0:(i/8-.5)*r},function(t){var r,i=t.stack.pop();switch(e.DEBUG&&console.log(t.step,"S45ROUND[]",i),t.round=Ir,192&i){case 0:r=Math.sqrt(2)/2;break;case 64:r=Math.sqrt(2);break;case 128:r=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(t.srPeriod=r,48&i){case 0:t.srPhase=0;break;case 16:t.srPhase=.25*r;break;case 32:t.srPhase=.5*r;break;case 48:t.srPhase=.75*r;break;default:throw new Error("invalid S45ROUND value")}i&=15,t.srThreshold=0===i?0:(i/8-.5)*r},void 0,void 0,function(t){e.DEBUG&&console.log(t.step,"ROFF[]"),t.round=Lt},void 0,function(t){e.DEBUG&&console.log(t.step,"RUTG[]"),t.round=Ut},function(t){e.DEBUG&&console.log(t.step,"RDTG[]"),t.round=kt},Yt,Yt,void 0,void 0,void 0,void 0,void 0,function(t){var r=t.stack.pop();e.DEBUG&&console.log(t.step,"SCANCTRL[]",r)},ae.bind(void 0,0),ae.bind(void 0,1),function(t){var r=t.stack,i=r.pop(),n=0;e.DEBUG&&console.log(t.step,"GETINFO[]",i),1&i&&(n=35),32&i&&(n|=4096),r.push(n)},void 0,function(t){var r=t.stack,i=r.pop(),n=r.pop(),o=r.pop();e.DEBUG&&console.log(t.step,"ROLL[]"),r.push(n),r.push(i),r.push(o)},function(t){var r=t.stack,i=r.pop(),n=r.pop();e.DEBUG&&console.log(t.step,"MAX[]",i,n),r.push(Math.max(n,i))},function(t){var r=t.stack,i=r.pop(),n=r.pop();e.DEBUG&&console.log(t.step,"MIN[]",i,n),r.push(Math.min(n,i))},function(t){var r=t.stack.pop();e.DEBUG&&console.log(t.step,"SCANTYPE[]",r)},function(t){var r=t.stack.pop(),i=t.stack.pop();switch(e.DEBUG&&console.log(t.step,"INSTCTRL[]",r,i),r){case 1:return void(t.inhibitGridFit=!!i);case 2:return void(t.ignoreCvt=!!i);default:throw new Error("invalid INSTCTRL[] selector")}},void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,se.bind(void 0,1),se.bind(void 0,2),se.bind(void 0,3),se.bind(void 0,4),se.bind(void 0,5),se.bind(void 0,6),se.bind(void 0,7),se.bind(void 0,8),he.bind(void 0,1),he.bind(void 0,2),he.bind(void 0,3),he.bind(void 0,4),he.bind(void 0,5),he.bind(void 0,6),he.bind(void 0,7),he.bind(void 0,8),le.bind(void 0,0,0,0,0,0),le.bind(void 0,0,0,0,0,1),le.bind(void 0,0,0,0,0,2),le.bind(void 0,0,0,0,0,3),le.bind(void 0,0,0,0,1,0),le.bind(void 0,0,0,0,1,1),le.bind(void 0,0,0,0,1,2),le.bind(void 0,0,0,0,1,3),le.bind(void 0,0,0,1,0,0),le.bind(void 0,0,0,1,0,1),le.bind(void 0,0,0,1,0,2),le.bind(void 0,0,0,1,0,3),le.bind(void 0,0,0,1,1,0),le.bind(void 0,0,0,1,1,1),le.bind(void 0,0,0,1,1,2),le.bind(void 0,0,0,1,1,3),le.bind(void 0,0,1,0,0,0),le.bind(void 0,0,1,0,0,1),le.bind(void 0,0,1,0,0,2),le.bind(void 0,0,1,0,0,3),le.bind(void 0,0,1,0,1,0),le.bind(void 0,0,1,0,1,1),le.bind(void 0,0,1,0,1,2),le.bind(void 0,0,1,0,1,3),le.bind(void 0,0,1,1,0,0),le.bind(void 0,0,1,1,0,1),le.bind(void 0,0,1,1,0,2),le.bind(void 0,0,1,1,0,3),le.bind(void 0,0,1,1,1,0),le.bind(void 0,0,1,1,1,1),le.bind(void 0,0,1,1,1,2),le.bind(void 0,0,1,1,1,3),le.bind(void 0,1,0,0,0,0),le.bind(void 0,1,0,0,0,1),le.bind(void 0,1,0,0,0,2),le.bind(void 0,1,0,0,0,3),le.bind(void 0,1,0,0,1,0),le.bind(void 0,1,0,0,1,1),le.bind(void 0,1,0,0,1,2),le.bind(void 0,1,0,0,1,3),le.bind(void 0,1,0,1,0,0),le.bind(void 0,1,0,1,0,1),le.bind(void 0,1,0,1,0,2),le.bind(void 0,1,0,1,0,3),le.bind(void 0,1,0,1,1,0),le.bind(void 0,1,0,1,1,1),le.bind(void 0,1,0,1,1,2),le.bind(void 0,1,0,1,1,3),le.bind(void 0,1,1,0,0,0),le.bind(void 0,1,1,0,0,1),le.bind(void 0,1,1,0,0,2),le.bind(void 0,1,1,0,0,3),le.bind(void 0,1,1,0,1,0),le.bind(void 0,1,1,0,1,1),le.bind(void 0,1,1,0,1,2),le.bind(void 0,1,1,0,1,3),le.bind(void 0,1,1,1,0,0),le.bind(void 0,1,1,1,0,1),le.bind(void 0,1,1,1,0,2),le.bind(void 0,1,1,1,0,3),le.bind(void 0,1,1,1,1,0),le.bind(void 0,1,1,1,1,1),le.bind(void 0,1,1,1,1,2),le.bind(void 0,1,1,1,1,3)],ue.prototype.hasChar=function(t){return null!==this.encoding.charToGlyphIndex(t)},ue.prototype.charToGlyphIndex=function(t){return this.encoding.charToGlyphIndex(t)},ue.prototype.charToGlyph=function(t){var e=this.charToGlyphIndex(t),r=this.glyphs.get(e);return r||(r=this.glyphs.get(0)),r},ue.prototype.stringToGlyphs=function(t,e){e=e||this.defaultRenderOptions;for(var r=[],i=0;i<t.length;i+=1){var n=t[i];r.push(this.charToGlyphIndex(n))}var o=r.length;if(e.features){var a=e.script||this.substitution.getDefaultScriptName(),s=[];e.features.liga&&(s=s.concat(this.substitution.getFeature("liga",a,e.language))),e.features.rlig&&(s=s.concat(this.substitution.getFeature("rlig",a,e.language)));for(var h=0;h<o;h+=1)for(var l=0;l<s.length;l++){for(var u=s[l],c=u.sub,p=c.length,d=0;d<p&&c[d]===r[h+d];)d++;d===p&&(r.splice(h,p,u.by),o=o-p+1)}}for(var f=new Array(o),m=this.glyphs.get(0),v=0;v<o;v+=1)f[v]=this.glyphs.get(r[v])||m;return f},ue.prototype.nameToGlyphIndex=function(t){return this.glyphNames.nameToGlyphIndex(t)},ue.prototype.nameToGlyph=function(t){var e=this.nameToGlyphIndex(t),r=this.glyphs.get(e);return r||(r=this.glyphs.get(0)),r},ue.prototype.glyphIndexToName=function(t){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(t):""},ue.prototype.getKerningValue=function(t,e){t=t.index||t,e=e.index||e;var r=this.getGposKerningValue;return r?r(t,e):this.kerningPairs[t+","+e]||0},ue.prototype.defaultRenderOptions={kerning:!0,features:{liga:!0,rlig:!0}},ue.prototype.forEachGlyph=function(t,e,r,i,n,o){e=void 0!==e?e:0,r=void 0!==r?r:0,i=void 0!==i?i:72,n=n||this.defaultRenderOptions;for(var a=1/this.unitsPerEm*i,s=this.stringToGlyphs(t,n),h=0;h<s.length;h+=1){var l=s[h];o.call(this,l,e,r,i,n),l.advanceWidth&&(e+=l.advanceWidth*a),n.kerning&&h<s.length-1&&(e+=this.getKerningValue(l,s[h+1])*a),n.letterSpacing?e+=n.letterSpacing*i:n.tracking&&(e+=n.tracking/1e3*i)}return e},ue.prototype.getPath=function(t,e,r,i,n){var o=new m;return this.forEachGlyph(t,e,r,i,n,function(t,e,r,i){var a=t.getPath(e,r,i,n,this);o.extend(a)}),o},ue.prototype.getPaths=function(t,e,r,i,n){var o=[];return this.forEachGlyph(t,e,r,i,n,function(t,e,r,i){var a=t.getPath(e,r,i,n,this);o.push(a)}),o},ue.prototype.getAdvanceWidth=function(t,e,r){return this.forEachGlyph(t,0,0,e,r,function(){})},ue.prototype.draw=function(t,e,r,i,n,o){this.getPath(e,r,i,n,o).draw(t)},ue.prototype.drawPoints=function(t,e,r,i,n,o){this.forEachGlyph(e,r,i,n,o,function(e,r,i,n){e.drawPoints(t,r,i,n)})},ue.prototype.drawMetrics=function(t,e,r,i,n,o){this.forEachGlyph(e,r,i,n,o,function(e,r,i,n){e.drawMetrics(t,r,i,n)})},ue.prototype.getEnglishName=function(t){var e=this.names[t];if(e)return e.en},ue.prototype.validate=function(){function t(t,e){t||r.push(e)}function e(e){var r=i.getEnglishName(e);t(r&&r.trim().length>0,"No English "+e+" specified.")}var r=[],i=this;e("fontFamily"),e("weightName"),e("manufacturer"),e("copyright"),e("version"),t(this.unitsPerEm>0,"No unitsPerEm specified.")},ue.prototype.toTables=function(){return Cr.fontToTable(this)},ue.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},ue.prototype.toArrayBuffer=function(){for(var t=this.toTables().encode(),e=new ArrayBuffer(t.length),r=new Uint8Array(e),i=0;i<t.length;i++)r[i]=t[i];return e},ue.prototype.download=function(e){var r=this.getEnglishName("fontFamily"),i=this.getEnglishName("fontSubfamily");e=e||r.replace(/\s/g,"")+"-"+i+".otf";var n=this.toArrayBuffer();if("undefined"!=typeof window)window.requestFileSystem=window.requestFileSystem||window.webkitRequestFileSystem,window.requestFileSystem(window.TEMPORARY,n.byteLength,function(t){t.root.getFile(e,{create:!0},function(t){t.createWriter(function(e){var r=new DataView(n),i=new Blob([r],{type:"font/opentype"});e.write(i),e.addEventListener("writeend",function(){location.href=t.toURL()},!1)})})},function(t){throw new Error(t.name+": "+t.message)});else{var o=t("fs"),a=Rt(n);o.writeFileSync(e,a)}},ue.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},ue.prototype.usWidthClasses={ULTRA_CONDENSED:1,EXTRA_CONDENSED:2,CONDENSED:3,SEMI_CONDENSED:4,MEDIUM:5,SEMI_EXPANDED:6,EXPANDED:7,EXTRA_EXPANDED:8,ULTRA_EXPANDED:9},ue.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};var Br={make:function(t,e){var r=new Xe.Table("fvar",[{name:"version",type:"ULONG",value:65536},{name:"offsetToData",type:"USHORT",value:0},{name:"countSizePairs",type:"USHORT",value:2},{name:"axisCount",type:"USHORT",value:t.axes.length},{name:"axisSize",type:"USHORT",value:20},{name:"instanceCount",type:"USHORT",value:t.instances.length},{name:"instanceSize",type:"USHORT",value:4+4*t.axes.length}]);r.offsetToData=r.sizeOf();for(var i=0;i<t.axes.length;i++)r.fields=r.fields.concat(pe(i,t.axes[i],e));for(var n=0;n<t.instances.length;n++)r.fields=r.fields.concat(fe(n,t.instances[n],t.axes,e));return r},parse:function(t,e,r){var i=new Ze.Parser(t,e),n=i.parseULong();Fe.argument(65536===n,"Unsupported fvar table version.");var o=i.parseOffset16();i.skip("uShort",1);for(var a=i.parseUShort(),s=i.parseUShort(),h=i.parseUShort(),l=i.parseUShort(),u=[],c=0;c<a;c++)u.push(de(t,e+o+c*s,r));for(var p=[],d=e+o+a*s,f=0;f<h;f++)p.push(me(t,d+f*l,u,r));return{axes:u,instances:p}}},Nr={parse:function(t,e,r){var i=new Ze.Parser(t,e),n=i.parseFixed();Fe.argument(1===n,"Unsupported GPOS table version."),ve(t,e+i.parseUShort()),ve(t,e+i.parseUShort());var o=i.parseUShort();i.relativeOffset=o;for(var a=i.parseUShort(),s=i.parseOffset16List(a),h=e+o,l=0;l<a;l++){var u=be(t,h+s[l]);2!==u.lookupType||r.getGposKerningValue||(r.getGposKerningValue=u.getKerningValue)}}},Gr={parse:function(t,e){var r=new Ze.Parser(t,e),i=r.parseUShort();if(0===i)return function(t){var e={};t.skip("uShort");var r=t.parseUShort();Fe.argument(0===r,"Unsupported kern sub-table version."),t.skip("uShort",2);var i=t.parseUShort();t.skip("uShort",3);for(var n=0;n<i;n+=1){var o=t.parseUShort(),a=t.parseUShort(),s=t.parseShort();e[o+","+a]=s}return e}(r);if(1===i)return function(t){var e={};t.skip("uShort"),t.parseULong()>1&&console.warn("Only the first kern subtable is supported."),t.skip("uLong");var r=255&t.parseUShort();if(t.skip("uShort"),0===r){var i=t.parseUShort();t.skip("uShort",3);for(var n=0;n<i;n+=1){var o=t.parseUShort(),a=t.parseUShort(),s=t.parseShort();e[o+","+a]=s}}return e}(r);throw new Error("Unsupported kern table version ("+i+").")}},Hr={parse:function(t,e,r,i){for(var n=new Ze.Parser(t,e),o=i?n.parseUShort:n.parseULong,a=[],s=0;s<r+1;s+=1){var h=o.call(n);i&&(h*=2),a.push(h)}return a}};e.Font=ue,e.Glyph=X,e.Path=m,e.BoundingBox=f,e._parse=Ze,e.parse=Se,e.load=function(t,e){("undefined"==typeof window?_e:function(t,e){var r=new XMLHttpRequest;r.open("get",t,!0),r.responseType="arraybuffer",r.onload=function(){return 200!==r.status?e("Font could not be loaded: "+r.statusText):e(null,r.response)},r.onerror=function(){e("Font could not be loaded")},r.send()})(t,function(t,r){if(t)return e(t);var i;try{i=Se(r)}catch(t){return e(t,null)}return e(null,i)})},e.loadSync=function(e){return Se(Mt(t("fs").readFileSync(e)))},Object.defineProperty(e,"__esModule",{value:!0})})}).call(this,t("buffer").Buffer)},{buffer:3,fs:2}],10:[function(t,e,r){function i(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function o(t){if(u===setTimeout)return setTimeout(t,0);if((u===i||!u)&&setTimeout)return u=setTimeout,setTimeout(t,0);try{return u(t,0)}catch(e){try{return u.call(null,t,0)}catch(e){return u.call(this,t,0)}}}function a(){m&&d&&(m=!1,d.length?f=d.concat(f):v=-1,f.length&&s())}function s(){if(!m){var t=o(a);m=!0;for(var e=f.length;e;){for(d=f,f=[];++v<e;)d&&d[v].run();v=-1,e=f.length}d=null,m=!1,function(t){if(c===clearTimeout)return clearTimeout(t);if((c===n||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(t);try{c(t)}catch(e){try{return c.call(null,t)}catch(e){return c.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function l(){}var u,c,p=e.exports={};!function(){try{u="function"==typeof setTimeout?setTimeout:i}catch(t){u=i}try{c="function"==typeof clearTimeout?clearTimeout:n}catch(t){c=n}}();var d,f=[],m=!1,v=-1;p.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];f.push(new h(t,e)),1!==f.length||m||o(s)},h.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=l,p.addListener=l,p.once=l,p.off=l,p.removeListener=l,p.removeAllListeners=l,p.emit=l,p.prependListener=l,p.prependOnceListener=l,p.listeners=function(t){return[]},p.binding=function(t){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(t){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},{}],11:[function(t,e,r){!function(t){"use strict";function e(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function r(t){return"string"!=typeof t&&(t=String(t)),t}function i(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return f.iterable&&(e[Symbol.iterator]=function(){return e}),e}function n(t){this.map={},t instanceof n?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function o(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function a(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function s(t){var e=new FileReader,r=a(e);return e.readAsArrayBuffer(t),r}function h(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function l(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,t)if("string"==typeof t)this._bodyText=t;else if(f.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(f.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(f.searchParams&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else if(f.arrayBuffer&&f.blob&&v(t))this._bodyArrayBuffer=h(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!f.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t)&&!g(t))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=h(t)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):f.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},f.blob&&(this.blob=function(){var t=o(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?o(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(s)}),this.text=function(){var t=o(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,r=a(e);return e.readAsText(t),r}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),i=0;i<e.length;i++)r[i]=String.fromCharCode(e[i]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},f.formData&&(this.formData=function(){return this.text().then(c)}),this.json=function(){return this.text().then(JSON.parse)},this}function u(t,e){var r=(e=e||{}).body;if(t instanceof u){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new n(t.headers)),this.method=t.method,this.mode=t.mode,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new n(e.headers)),this.method=function(t){var e=t.toUpperCase();return y.indexOf(e)>-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function c(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),i=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(n))}}),e}function p(t){var e=new n;return t.split(/\r?\n/).forEach(function(t){var r=t.split(":"),i=r.shift().trim();if(i){var n=r.join(":").trim();e.append(i,n)}}),e}function d(t,e){e||(e={}),this.type="default",this.status="status"in e?e.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new n(e.headers),this.url=e.url||"",this._initBody(t)}if(!t.fetch){var f={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(f.arrayBuffer)var m=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],v=function(t){return t&&DataView.prototype.isPrototypeOf(t)},g=ArrayBuffer.isView||function(t){return t&&m.indexOf(Object.prototype.toString.call(t))>-1};n.prototype.append=function(t,i){t=e(t),i=r(i);var n=this.map[t];this.map[t]=n?n+","+i:i},n.prototype.delete=function(t){delete this.map[e(t)]},n.prototype.get=function(t){return t=e(t),this.has(t)?this.map[t]:null},n.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},n.prototype.set=function(t,i){this.map[e(t)]=r(i)},n.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},n.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),i(t)},n.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),i(t)},n.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),i(t)},f.iterable&&(n.prototype[Symbol.iterator]=n.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];u.prototype.clone=function(){return new u(this,{body:this._bodyInit})},l.call(u.prototype),l.call(d.prototype),d.prototype.clone=function(){return new d(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new n(this.headers),url:this.url})},d.error=function(){var t=new d(null,{status:0,statusText:""});return t.type="error",t};var b=[301,302,303,307,308];d.redirect=function(t,e){if(-1===b.indexOf(e))throw new RangeError("Invalid status code");return new d(null,{status:e,headers:{location:t}})},t.Headers=n,t.Request=u,t.Response=d,t.fetch=function(t,e){return new Promise(function(r,i){var n=new u(t,e),o=new XMLHttpRequest;o.onload=function(){var t={status:o.status,statusText:o.statusText,headers:p(o.getAllResponseHeaders()||"")};t.url="responseURL"in o?o.responseURL:t.headers.get("X-Request-URL");var e="response"in o?o.response:o.responseText;r(new d(e,t))},o.onerror=function(){i(new TypeError("Network request failed"))},o.ontimeout=function(){i(new TypeError("Network request failed"))},o.open(n.method,n.url,!0),"include"===n.credentials&&(o.withCredentials=!0),"responseType"in o&&f.blob&&(o.responseType="blob"),n.headers.forEach(function(t,e){o.setRequestHeader(e,t)}),o.send(void 0===n._bodyInit?null:n._bodyInit)})},t.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},{}],12:[function(t,e,r){"use strict";var i=t("./core/core");t("./color/p5.Color"),t("./core/p5.Element"),t("./typography/p5.Font"),t("./core/p5.Graphics"),t("./core/p5.Renderer2D"),t("./image/p5.Image"),t("./math/p5.Vector"),t("./io/p5.TableRow"),t("./io/p5.Table"),t("./io/p5.XML"),t("./color/creating_reading"),t("./color/setting"),t("./core/constants"),t("./utilities/conversion"),t("./utilities/array_functions"),t("./utilities/string_functions"),t("./core/environment"),t("./image/image"),t("./image/loading_displaying"),t("./image/pixels"),t("./io/files"),t("./events/keyboard"),t("./events/acceleration"),t("./events/mouse"),t("./utilities/time_date"),t("./events/touch"),t("./math/math"),t("./math/calculation"),t("./math/random"),t("./math/noise"),t("./math/trigonometry"),t("./core/rendering"),t("./core/2d_primitives"),t("./core/attributes"),t("./core/curves"),t("./core/vertex"),t("./core/structure"),t("./core/transform"),t("./typography/attributes"),t("./typography/loading_displaying"),t("./data/p5.TypedDict"),t("./webgl/p5.RendererGL"),t("./webgl/p5.Geometry"),t("./webgl/p5.RendererGL.Retained"),t("./webgl/p5.RendererGL.Immediate"),t("./webgl/primitives"),t("./webgl/loading"),t("./webgl/p5.Matrix"),t("./webgl/material"),t("./webgl/light"),t("./webgl/p5.Shader"),t("./webgl/camera"),t("./webgl/interaction"),t("./core/init.js"),e.exports=i},{"./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(t,e,r){"use strict";var i=t("../core/core");i.ColorConversion={},i.ColorConversion._hsbaToHSLA=function(t){var e=t[0],r=t[1],i=t[2],n=(2-r)*i/2;return 0!==n&&(1===n?r=0:n<.5?r/=2-r:r=r*i/(2-2*n)),[e,r,n,t[3]]},i.ColorConversion._hsbaToRGBA=function(t){var e=6*t[0],r=t[1],i=t[2],n=[];if(0===r)n=[i,i,i,t[3]];else{var o,a,s,h=Math.floor(e),l=i*(1-r),u=i*(1-r*(e-h)),c=i*(1-r*(1+h-e));1===h?(o=u,a=i,s=l):2===h?(o=l,a=i,s=c):3===h?(o=l,a=u,s=i):4===h?(o=c,a=l,s=i):5===h?(o=i,a=l,s=u):(o=i,a=c,s=l),n=[o,a,s,t[3]]}return n},i.ColorConversion._hslaToHSBA=function(t){var e,r=t[0],i=t[1],n=t[2];return[r,i=2*((e=n<.5?(1+i)*n:n+i-n*i)-n)/e,e,t[3]]},i.ColorConversion._hslaToRGBA=function(t){var e=6*t[0],r=t[1],i=t[2],n=[];if(0===r)n=[i,i,i,t[3]];else{var o,a=2*i-(o=i<.5?(1+r)*i:i+r-i*r),s=function(t,e,r){return t<0?t+=6:t>=6&&(t-=6),t<1?e+(r-e)*t:t<3?r:t<4?e+(r-e)*(4-t):e};n=[s(e+2,a,o),s(e,a,o),s(e-2,a,o),t[3]]}return n},i.ColorConversion._rgbaToHSBA=function(t){var e,r,i=t[0],n=t[1],o=t[2],a=Math.max(i,n,o),s=a-Math.min(i,n,o);return 0===s?(e=0,r=0):(r=s/a,i===a?e=(n-o)/s:n===a?e=2+(o-i)/s:o===a&&(e=4+(i-n)/s),e<0?e+=6:e>=6&&(e-=6)),[e/6,r,a,t[3]]},i.ColorConversion._rgbaToHSLA=function(t){var e,r,i=t[0],n=t[1],o=t[2],a=Math.max(i,n,o),s=Math.min(i,n,o),h=a+s,l=a-s;return 0===l?(e=0,r=0):(r=h<1?l/h:l/(2-h),i===a?e=(n-o)/l:n===a?e=2+(o-i)/l:o===a&&(e=4+(i-n)/l),e<0?e+=6:e>=6&&(e-=6)),[e/6,r,h/2,t[3]]},e.exports=i.ColorConversion},{"../core/core":21}],14:[function(t,e,r){"use strict";var i=t("../core/core"),n=t("../core/constants");t("./p5.Color"),t("../core/error_helpers"),i.prototype.alpha=function(t){return i._validateParameters("alpha",arguments),this.color(t)._getAlpha()},i.prototype.blue=function(t){return i._validateParameters("blue",arguments),this.color(t)._getBlue()},i.prototype.brightness=function(t){return i._validateParameters("brightness",arguments),this.color(t)._getBrightness()},i.prototype.color=function(){if(i._validateParameters("color",arguments),arguments[0]instanceof i.Color)return arguments[0];var t=arguments[0]instanceof Array?arguments[0]:arguments;return new i.Color(this,t)},i.prototype.green=function(t){return i._validateParameters("green",arguments),this.color(t)._getGreen()},i.prototype.hue=function(t){return i._validateParameters("hue",arguments),this.color(t)._getHue()},i.prototype.lerpColor=function(t,e,r){i._validateParameters("lerpColor",arguments);var o,a,s,h,l,u,c=this._colorMode,p=this._colorMaxes;if(c===n.RGB)l=t.levels.map(function(t){return t/255}),u=e.levels.map(function(t){return t/255});else if(c===n.HSB)t._getBrightness(),e._getBrightness(),l=t.hsba,u=e.hsba;else{if(c!==n.HSL)throw new Error(c+"cannot be used for interpolation.");t._getLightness(),e._getLightness(),l=t.hsla,u=e.hsla}return r=Math.max(Math.min(r,1),0),void 0===this.lerp&&(this.lerp=function(t,e,r){return r*(e-t)+t}),o=this.lerp(l[0],u[0],r),a=this.lerp(l[1],u[1],r),s=this.lerp(l[2],u[2],r),h=this.lerp(l[3],u[3],r),o*=p[c][0],a*=p[c][1],s*=p[c][2],h*=p[c][3],this.color(o,a,s,h)},i.prototype.lightness=function(t){return i._validateParameters("lightness",arguments),this.color(t)._getLightness()},i.prototype.red=function(t){return i._validateParameters("red",arguments),this.color(t)._getRed()},i.prototype.saturation=function(t){return i._validateParameters("saturation",arguments),this.color(t)._getSaturation()},e.exports=i},{"../core/constants":20,"../core/core":21,"../core/error_helpers":24,"./p5.Color":15}],15:[function(t,e,r){"use strict";var i=t("../core/core"),n=t("../core/constants"),o=t("./color_conversion");i.Color=function(t,e){if(this._storeModeAndMaxes(t._colorMode,t._colorMaxes),this.mode!==n.RGB&&this.mode!==n.HSL&&this.mode!==n.HSB)throw new Error(this.mode+" is an invalid colorMode.");return this._array=i.Color._parseInputs.apply(this,e),this._calculateLevels(),this},i.Color.prototype.toString=function(t){this.hsba||(this.hsba=o._rgbaToHSBA(this._array)),this.hsla||(this.hsla=o._rgbaToHSLA(this._array));var e=this.levels,r=this._array,i=r[3];switch(t){case"#rrggbb":return"#".concat(e[0]<16?"0".concat(e[0].toString(16)):e[0].toString(16),e[1]<16?"0".concat(e[1].toString(16)):e[1].toString(16),e[2]<16?"0".concat(e[2].toString(16)):e[2].toString(16));case"#rrggbbaa":return"#".concat(e[0]<16?"0".concat(e[0].toString(16)):e[0].toString(16),e[1]<16?"0".concat(e[1].toString(16)):e[1].toString(16),e[2]<16?"0".concat(e[2].toString(16)):e[2].toString(16),e[3]<16?"0".concat(e[2].toString(16)):e[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(e[0],", ",e[1],", ",e[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"hsb(".concat(this.hsba[0]*this.maxes[n.HSB][0],", ",this.hsba[1]*this.maxes[n.HSB][1],", ",this.hsba[2]*this.maxes[n.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[n.HSB][0],", ",this.hsba[1]*this.maxes[n.HSB][1],", ",this.hsba[2]*this.maxes[n.HSB][2],", ",i,")");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*i).toPrecision(3),"%)");case"hsl":return"hsl(".concat(this.hsla[0]*this.maxes[n.HSL][0],", ",this.hsla[1]*this.maxes[n.HSL][1],", ",this.hsla[2]*this.maxes[n.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[n.HSL][0],", ",this.hsla[1]*this.maxes[n.HSL][1],", ",this.hsla[2]*this.maxes[n.HSL][2],", ",i,")");case"hsla%":return"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("+e[0]+","+e[1]+","+e[2]+","+i+")"}},i.Color.prototype.setRed=function(t){this._array[0]=t/this.maxes[n.RGB][0],this._calculateLevels()},i.Color.prototype.setGreen=function(t){this._array[1]=t/this.maxes[n.RGB][1],this._calculateLevels()},i.Color.prototype.setBlue=function(t){this._array[2]=t/this.maxes[n.RGB][2],this._calculateLevels()},i.Color.prototype.setAlpha=function(t){this._array[3]=t/this.maxes[this.mode][3],this._calculateLevels()},i.Color.prototype._calculateLevels=function(){this.levels=this._array.map(function(t){return Math.round(255*t)})},i.Color.prototype._getAlpha=function(){return this._array[3]*this.maxes[this.mode][3]},i.Color.prototype._storeModeAndMaxes=function(t,e){this.mode=t,this.maxes=e},i.Color.prototype._getMode=function(){return this.mode},i.Color.prototype._getMaxes=function(){return this.maxes},i.Color.prototype._getBlue=function(){return this._array[2]*this.maxes[n.RGB][2]},i.Color.prototype._getBrightness=function(){return this.hsba||(this.hsba=o._rgbaToHSBA(this._array)),this.hsba[2]*this.maxes[n.HSB][2]},i.Color.prototype._getGreen=function(){return this._array[1]*this.maxes[n.RGB][1]},i.Color.prototype._getHue=function(){return this.mode===n.HSB?(this.hsba||(this.hsba=o._rgbaToHSBA(this._array)),this.hsba[0]*this.maxes[n.HSB][0]):(this.hsla||(this.hsla=o._rgbaToHSLA(this._array)),this.hsla[0]*this.maxes[n.HSL][0])},i.Color.prototype._getLightness=function(){return this.hsla||(this.hsla=o._rgbaToHSLA(this._array)),this.hsla[2]*this.maxes[n.HSL][2]},i.Color.prototype._getRed=function(){return this._array[0]*this.maxes[n.RGB][0]},i.Color.prototype._getSaturation=function(){return this.mode===n.HSB?(this.hsba||(this.hsba=o._rgbaToHSBA(this._array)),this.hsba[1]*this.maxes[n.HSB][1]):(this.hsla||(this.hsla=o._rgbaToHSLA(this._array)),this.hsla[1]*this.maxes[n.HSL][1])};var a={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"},s=/\s*/,h=/(\d{1,3})/,l=/((?:\d+(?:\.\d+)?)|(?:\.\d+))/,u=new RegExp(l.source+"%"),c={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\\(",h.source,",",h.source,",",h.source,"\\)$"].join(s.source),"i"),RGB_PERCENT:new RegExp(["^rgb\\(",u.source,",",u.source,",",u.source,"\\)$"].join(s.source),"i"),RGBA:new RegExp(["^rgba\\(",h.source,",",h.source,",",h.source,",",l.source,"\\)$"].join(s.source),"i"),RGBA_PERCENT:new RegExp(["^rgba\\(",u.source,",",u.source,",",u.source,",",l.source,"\\)$"].join(s.source),"i"),HSL:new RegExp(["^hsl\\(",h.source,",",u.source,",",u.source,"\\)$"].join(s.source),"i"),HSLA:new RegExp(["^hsla\\(",h.source,",",u.source,",",u.source,",",l.source,"\\)$"].join(s.source),"i"),HSB:new RegExp(["^hsb\\(",h.source,",",u.source,",",u.source,"\\)$"].join(s.source),"i"),HSBA:new RegExp(["^hsba\\(",h.source,",",u.source,",",u.source,",",l.source,"\\)$"].join(s.source),"i")};i.Color._parseInputs=function(t,e,r,s){var h=arguments.length,l=this.mode,u=this.maxes,p=[];if(h>=3)return p[0]=t/u[l][0],p[1]=e/u[l][1],p[2]=r/u[l][2],p[3]="number"==typeof s?s/u[l][3]:1,p=p.map(function(t){return Math.max(Math.min(t,1),0)}),l===n.HSL?o._hslaToRGBA(p):l===n.HSB?o._hsbaToRGBA(p):p;if(1===h&&"string"==typeof t){var d=t.trim().toLowerCase();if(a[d])return i.Color._parseInputs.call(this,a[d]);if(c.HEX3.test(d))return(p=c.HEX3.exec(d).slice(1).map(function(t){return parseInt(t+t,16)/255}))[3]=1,p;if(c.HEX6.test(d))return(p=c.HEX6.exec(d).slice(1).map(function(t){return parseInt(t,16)/255}))[3]=1,p;if(c.HEX4.test(d))return c.HEX4.exec(d).slice(1).map(function(t){return parseInt(t+t,16)/255});if(c.HEX8.test(d))return c.HEX8.exec(d).slice(1).map(function(t){return parseInt(t,16)/255});if(c.RGB.test(d))return(p=c.RGB.exec(d).slice(1).map(function(t){return t/255}))[3]=1,p;if(c.RGB_PERCENT.test(d))return(p=c.RGB_PERCENT.exec(d).slice(1).map(function(t){return parseFloat(t)/100}))[3]=1,p;if(c.RGBA.test(d))return c.RGBA.exec(d).slice(1).map(function(t,e){return 3===e?parseFloat(t):t/255});if(c.RGBA_PERCENT.test(d))return c.RGBA_PERCENT.exec(d).slice(1).map(function(t,e){return 3===e?parseFloat(t):parseFloat(t)/100});if(c.HSL.test(d)?(p=c.HSL.exec(d).slice(1).map(function(t,e){return 0===e?parseInt(t,10)/360:parseInt(t,10)/100}))[3]=1:c.HSLA.test(d)&&(p=c.HSLA.exec(d).slice(1).map(function(t,e){return 0===e?parseInt(t,10)/360:3===e?parseFloat(t):parseInt(t,10)/100})),(p=p.map(function(t){return Math.max(Math.min(t,1),0)})).length)return o._hslaToRGBA(p);if(c.HSB.test(d)?(p=c.HSB.exec(d).slice(1).map(function(t,e){return 0===e?parseInt(t,10)/360:parseInt(t,10)/100}))[3]=1:c.HSBA.test(d)&&(p=c.HSBA.exec(d).slice(1).map(function(t,e){return 0===e?parseInt(t,10)/360:3===e?parseFloat(t):parseInt(t,10)/100})),(p=p.map(function(t){return Math.max(Math.min(t,1),0)})).length)return o._hsbaToRGBA(p);p=[1,1,1,1]}else{if(1!==h&&2!==h||"number"!=typeof t)throw new Error(arguments+"is not a valid color representation.");p[0]=t/u[l][2],p[1]=t/u[l][2],p[2]=t/u[l][2],p[3]="number"==typeof e?e/u[l][3]:1,p=p.map(function(t){return Math.max(Math.min(t,1),0)})}return p},e.exports=i.Color},{"../core/constants":20,"../core/core":21,"./color_conversion":13}],16:[function(t,e,r){"use strict";var i=t("../core/core"),n=t("../core/constants");t("./p5.Color"),i.prototype.background=function(){return arguments[0]instanceof i.Image?this.image(arguments[0],0,0,this.width,this.height):this._renderer.background.apply(this._renderer,arguments),this},i.prototype.clear=function(){return this._renderer.clear(),this},i.prototype.colorMode=function(t,e,r,o,a){if(i._validateParameters("colorMode",arguments),t===n.RGB||t===n.HSB||t===n.HSL){this._colorMode=t;var s=this._colorMaxes[t];2===arguments.length?(s[0]=e,s[1]=e,s[2]=e,s[3]=e):4===arguments.length?(s[0]=e,s[1]=r,s[2]=o):5===arguments.length&&(s[0]=e,s[1]=r,s[2]=o,s[3]=a)}return this},i.prototype.fill=function(){return this._renderer._setProperty("_fillSet",!0),this._renderer._setProperty("_doFill",!0),this._renderer.fill.apply(this._renderer,arguments),this},i.prototype.noFill=function(){return this._renderer._setProperty("_doFill",!1),this},i.prototype.noStroke=function(){return this._renderer._setProperty("_doStroke",!1),this},i.prototype.stroke=function(){return this._renderer._setProperty("_strokeSet",!0),this._renderer._setProperty("_doStroke",!0),this._renderer.stroke.apply(this._renderer,arguments),this},e.exports=i},{"../core/constants":20,"../core/core":21,"./p5.Color":15}],17:[function(t,e,r){"use strict";var i=t("./core"),n=t("./constants"),o=t("./canvas");t("./error_helpers"),i.prototype.arc=function(t,e,r,o,a,s,h){if(i._validateParameters("arc",arguments),!this._renderer._doStroke&&!this._renderer._doFill)return this;for(a=this._toRadians(a),s=this._toRadians(s);a<0;)a+=n.TWO_PI;for(;s<0;)s+=n.TWO_PI;return a%=n.TWO_PI,(s%=n.TWO_PI)===a&&(s+=n.TWO_PI),(a=a<=n.HALF_PI?Math.atan(r/o*Math.tan(a)):a>n.HALF_PI&&a<=3*n.HALF_PI?Math.atan(r/o*Math.tan(a))+n.PI:Math.atan(r/o*Math.tan(a))+n.TWO_PI)>(s=s<=n.HALF_PI?Math.atan(r/o*Math.tan(s)):s>n.HALF_PI&&s<=3*n.HALF_PI?Math.atan(r/o*Math.tan(s))+n.PI:Math.atan(r/o*Math.tan(s))+n.TWO_PI)&&(s+=n.TWO_PI),r=Math.abs(r),o=Math.abs(o),this._renderer.arc(t,e,r,o,a,s,h),this},i.prototype.ellipse=function(t,e,r,n,a){if(i._validateParameters("ellipse",arguments),r<0&&(r=Math.abs(r)),void 0===n?n=r:n<0&&(n=Math.abs(n)),this._renderer._doStroke||this._renderer._doFill){var s=o.modeAdjust(t,e,r,n,this._renderer._ellipseMode);this._renderer.ellipse([s.x,s.y,s.w,s.h,a])}return this},i.prototype.line=function(){return i._validateParameters("line",arguments),this._renderer._doStroke&&this._renderer.line.apply(this._renderer,arguments),this},i.prototype.point=function(){return i._validateParameters("point",arguments),this._renderer._doStroke&&this._renderer.point.apply(this._renderer,arguments),this},i.prototype.quad=function(){return i._validateParameters("quad",arguments),(this._renderer._doStroke||this._renderer._doFill)&&this._renderer.quad.apply(this._renderer,arguments),this},i.prototype.rect=function(){if(i._validateParameters("rect",arguments),this._renderer._doStroke||this._renderer._doFill){for(var t=o.modeAdjust(arguments[0],arguments[1],arguments[2],arguments[3],this._renderer._rectMode),e=[t.x,t.y,t.w,t.h],r=4;r<arguments.length;r++)e[r]=arguments[r];this._renderer.rect(e)}return this},i.prototype.triangle=function(){return i._validateParameters("triangle",arguments),(this._renderer._doStroke||this._renderer._doFill)&&this._renderer.triangle(arguments),this},e.exports=i},{"./canvas":19,"./constants":20,"./core":21,"./error_helpers":24}],18:[function(t,e,r){"use strict";var i=t("./core"),n=t("./constants");i.prototype.ellipseMode=function(t){return i._validateParameters("ellipseMode",arguments),t!==n.CORNER&&t!==n.CORNERS&&t!==n.RADIUS&&t!==n.CENTER||(this._renderer._ellipseMode=t),this},i.prototype.noSmooth=function(){return this._renderer.noSmooth(),this},i.prototype.rectMode=function(t){return i._validateParameters("rectMode",arguments),t!==n.CORNER&&t!==n.CORNERS&&t!==n.RADIUS&&t!==n.CENTER||(this._renderer._rectMode=t),this},i.prototype.smooth=function(){return this._renderer.smooth(),this},i.prototype.strokeCap=function(t){return i._validateParameters("strokeCap",arguments),t!==n.ROUND&&t!==n.SQUARE&&t!==n.PROJECT||this._renderer.strokeCap(t),this},i.prototype.strokeJoin=function(t){return i._validateParameters("strokeJoin",arguments),t!==n.ROUND&&t!==n.BEVEL&&t!==n.MITER||this._renderer.strokeJoin(t),this},i.prototype.strokeWeight=function(t){return i._validateParameters("strokeWeight",arguments),this._renderer.strokeWeight(t),this},e.exports=i},{"./constants":20,"./core":21}],19:[function(t,e,r){"use strict";var i=t("./constants");e.exports={modeAdjust:function(t,e,r,n,o){return o===i.CORNER?{x:t,y:e,w:r,h:n}:o===i.CORNERS?{x:t,y:e,w:r-t,h:n-e}:o===i.RADIUS?{x:t-r,y:e-n,w:2*r,h:2*n}:o===i.CENTER?{x:t-.5*r,y:e-.5*n,w:r,h:n}:void 0},arcModeAdjust:function(t,e,r,n,o){return o===i.CORNER?{x:t+.5*r,y:e+.5*n,w:r,h:n}:o===i.CORNERS?{x:t,y:e,w:r+t,h:n+e}:o===i.RADIUS?{x:t,y:e,w:2*r,h:2*n}:o===i.CENTER?{x:t,y:e,w:r,h:n}:void 0}}},{"./constants":20}],20:[function(t,e,r){"use strict";var i=Math.PI;e.exports={P2D:"p2d",WEBGL:"webgl",ARROW:"default",CROSS:"crosshair",HAND:"pointer",MOVE:"move",TEXT:"text",WAIT:"wait",HALF_PI:i/2,PI:i,QUARTER_PI:i/4,TAU:2*i,TWO_PI:2*i,DEGREES:"degrees",RADIANS:"radians",DEG_TO_RAD:i/180,RAD_TO_DEG:180/i,CORNER:"corner",CORNERS:"corners",RADIUS:"radius",RIGHT:"right",LEFT:"left",CENTER:"center",TOP:"top",BOTTOM:"bottom",BASELINE:"alphabetic",POINTS:0,LINES:1,LINE_STRIP:3,LINE_LOOP:2,TRIANGLES:4,TRIANGLE_FAN:6,TRIANGLE_STRIP:5,QUADS:"quads",QUAD_STRIP:"quad_strip",CLOSE:"close",OPEN:"open",CHORD:"chord",PIE:"pie",PROJECT:"square",SQUARE:"butt",ROUND:"round",BEVEL:"bevel",MITER:"miter",RGB:"rgb",HSB:"hsb",HSL:"hsl",AUTO:"auto",ALT:18,BACKSPACE:8,CONTROL:17,DELETE:46,DOWN_ARROW:40,ENTER:13,ESCAPE:27,LEFT_ARROW:37,OPTION:18,RETURN:13,RIGHT_ARROW:39,SHIFT:16,TAB:9,UP_ARROW:38,BLEND:"source-over",ADD:"lighter",DARKEST:"darken",LIGHTEST:"lighten",DIFFERENCE:"difference",EXCLUSION:"exclusion",MULTIPLY:"multiply",SCREEN:"screen",REPLACE:"copy",OVERLAY:"overlay",HARD_LIGHT:"hard-light",SOFT_LIGHT:"soft-light",DODGE:"color-dodge",BURN:"color-burn",THRESHOLD:"threshold",GRAY:"gray",OPAQUE:"opaque",INVERT:"invert",POSTERIZE:"posterize",DILATE:"dilate",ERODE:"erode",BLUR:"blur",NORMAL:"normal",ITALIC:"italic",BOLD:"bold",_DEFAULT_TEXT_FILL:"#000000",_DEFAULT_LEADMULT:1.25,_CTX_MIDDLE:"middle",LINEAR:"linear",QUADRATIC:"quadratic",BEZIER:"bezier",CURVE:"curve",STROKE:"stroke",FILL:"fill",TEXTURE:"texture",IMMEDIATE:"immediate",LANDSCAPE:"landscape",PORTRAIT:"portrait",_DEFAULT_STROKE:"#000000",_DEFAULT_FILL:"#FFFFFF"}},{}],21:[function(t,e,r){"use strict";t("./shim");var i=t("./constants"),n=function(t,e,r){"boolean"==typeof e&&void 0===r&&(r=e,e=void 0),this._setupDone=!1,this._pixelDensity=Math.ceil(window.devicePixelRatio)||1,this._userNode=e,this._curElement=null,this._elements=[],this._requestAnimId=0,this._preloadCount=0,this._isGlobal=!1,this._loop=!0,this._initializeInstanceVariables(),this._defaultCanvasSize={width:100,height:100},this._events={mousemove:null,mousedown:null,mouseup:null,dragend:null,dragover:null,click:null,dblclick:null,mouseover:null,mouseout:null,keydown:null,keyup:null,keypress:null,touchstart:null,touchmove:null,touchend:null,resize:null,blur:null},this._events.wheel=null,this._loadingScreenId="p5_loading",this._registeredMethods={};for(var i=Object.getOwnPropertyNames(n.prototype._registeredMethods),o=0;o<i.length;o++){var a=i[o];this._registeredMethods[a]=n.prototype._registeredMethods[a].slice()}window.DeviceOrientationEvent&&(this._events.deviceorientation=null),window.DeviceMotionEvent&&!window._isNodeWebkit&&(this._events.devicemotion=null),this._start=function(){this._userNode&&"string"==typeof this._userNode&&(this._userNode=document.getElementById(this._userNode));var t=this.preload||window.preload;if(t){var e=document.getElementById(this._loadingScreenId);for(var r in e||((e=document.createElement("div")).innerHTML="Loading...",e.style.position="absolute",e.id=this._loadingScreenId,(this._userNode||document.body).appendChild(e)),this._preloadMethods){this._preloadMethods[r]=this._preloadMethods[r]||n;var i=this._preloadMethods[r];i!==n.prototype&&i!==n||(this._isGlobal&&(window[r]=this._wrapPreload(this,r)),i=this),this._registeredPreloadMethods[r]=i[r],i[r]=this._wrapPreload(i,r)}t(),this._runIfPreloadsAreDone()}else this._setup(),this._runFrames(),this._draw()}.bind(this),this._runIfPreloadsAreDone=function(){var t=this._isGlobal?window:this;if(0===t._preloadCount){var e=document.getElementById(t._loadingScreenId);e&&e.parentNode.removeChild(e),t._setup(),t._runFrames(),t._draw()}},this._decrementPreload=function(){var t=this._isGlobal?window:this;"function"==typeof t.preload&&(t._setProperty("_preloadCount",t._preloadCount-1),t._runIfPreloadsAreDone())},this._wrapPreload=function(t,e){return function(){return this._incrementPreload(),this._registeredPreloadMethods[e].apply(t,arguments)}.bind(this)},this._incrementPreload=function(){var t=this._isGlobal?window:this;t._setProperty("_preloadCount",t._preloadCount+1)},this._setup=function(){this.createCanvas(this._defaultCanvasSize.width,this._defaultCanvasSize.height,"p2d");var t=this._isGlobal?window:this;if("function"==typeof t.preload)for(var e in this._preloadMethods)t[e]=this._preloadMethods[e][e],t[e]&&this&&(t[e]=t[e].bind(this));"function"==typeof t.setup&&t.setup();for(var r=document.getElementsByTagName("canvas"),i=0;i<r.length;i++){var n=r[i];"true"===n.dataset.hidden&&(n.style.visibility="",delete n.dataset.hidden)}this._setupDone=!0}.bind(this),this._draw=function(){var t=window.performance.now(),e=t-this._lastFrameTime,r=1e3/this._targetFrameRate;(!this._loop||e>=r-5)&&(this.redraw(),this._frameRate=1e3/(t-this._lastFrameTime),this._lastFrameTime=t,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(t,e){this[t]=e,this._isGlobal&&(window[t]=e)}.bind(this),this.remove=function(){var t=document.getElementById(this._loadingScreenId);if(t&&(t.parentNode.removeChild(t),this._incrementPreload()),this._curElement){for(var e in this._loop=!1,this._requestAnimId&&window.cancelAnimationFrame(this._requestAnimId),this._events)window.removeEventListener(e,this._events[e]);for(var r=0;r<this._elements.length;r++){var i=this._elements[r];for(var o in i.elt.parentNode&&i.elt.parentNode.removeChild(i.elt),i._events)i.elt.removeEventListener(o,i._events[o])}var a=this;this._registeredMethods.remove.forEach(function(t){void 0!==t&&t.call(a)})}if(this._isGlobal){for(var s in n.prototype)try{delete window[s]}catch(t){window[s]=void 0}for(var h in this)if(this.hasOwnProperty(h))try{delete window[h]}catch(t){window[h]=void 0}n.instance=null}}.bind(this),this._registeredMethods.init.forEach(function(t){void 0!==t&&t.call(this)},this);var s=this._createFriendlyGlobalFunctionBinder();if(t)t(this);else{for(var h in this._isGlobal=!0,n.instance=this,n.prototype)if("function"==typeof n.prototype[h]){var l=h.substring(2);this._events.hasOwnProperty(l)||(Math.hasOwnProperty(h)&&Math[h]===n.prototype[h]?s(h,n.prototype[h]):s(h,n.prototype[h].bind(this)))}else s(h,n.prototype[h]);for(var u in this)this.hasOwnProperty(u)&&s(u,this[u])}for(var c in this._events){var p=this["_on"+c];if(p){var d=p.bind(this);window.addEventListener(c,d,{passive:!1}),this._events[c]=d}}var f=function(){this._setProperty("focused",!0)}.bind(this),m=function(){this._setProperty("focused",!1)}.bind(this);window.addEventListener("focus",f),window.addEventListener("blur",m),this.registerMethod("remove",function(){window.removeEventListener("focus",f),window.removeEventListener("blur",m)}),r?this._start():"complete"===document.readyState?this._start():window.addEventListener("load",this._start.bind(this),!1)};for(var o in n.prototype._initializeInstanceVariables=function(){this._styles=[],this._bezierDetail=20,this._curveDetail=20,this._colorMode=i.RGB,this._colorMaxes={rgb:[255,255,255,255],hsb:[360,100,100,1],hsl:[360,100,100,1]}},n.instance=null,n.disableFriendlyErrors=!1,i)n.prototype[o]=i[o];n.prototype._preloadMethods={loadJSON:n.prototype,loadImage:n.prototype,loadStrings:n.prototype,loadXML:n.prototype,loadBytes:n.prototype,loadShape:n.prototype,loadTable:n.prototype,loadFont:n.prototype,loadModel:n.prototype,loadShader:n.prototype},n.prototype._registeredMethods={init:[],pre:[],post:[],remove:[]},n.prototype._registeredPreloadMethods={},n.prototype.registerPreloadMethod=function(t,e){n.prototype._preloadMethods.hasOwnProperty(t)||(n.prototype._preloadMethods[t]=e)},n.prototype.registerMethod=function(t,e){var r=this||n.prototype;r._registeredMethods.hasOwnProperty(t)||(r._registeredMethods[t]=[]),r._registeredMethods[t].push(e)},n.prototype._createFriendlyGlobalFunctionBinder=function(t){var e=(t=t||{}).globalObject||window;t.log||console.log.bind(console);return function(t,r){n.disableFriendlyErrors,e[t]=r}},e.exports=n},{"./constants":20,"./shim":31}],22:[function(t,e,r){"use strict";var i=t("./core");t("./error_helpers"),i.prototype.bezier=function(){return i._validateParameters("bezier",arguments),(this._renderer._doStroke||this._renderer._doFill)&&this._renderer.bezier.apply(this._renderer,arguments),this},i.prototype.bezierDetail=function(t){return i._validateParameters("bezierDetail",arguments),this._bezierDetail=t,this},i.prototype.bezierPoint=function(t,e,r,n,o){i._validateParameters("bezierPoint",arguments);var a=1-o;return Math.pow(a,3)*t+3*Math.pow(a,2)*o*e+3*a*Math.pow(o,2)*r+Math.pow(o,3)*n},i.prototype.bezierTangent=function(t,e,r,n,o){i._validateParameters("bezierTangent",arguments);var a=1-o;return 3*n*Math.pow(o,2)-3*r*Math.pow(o,2)+6*r*a*o-6*e*a*o+3*e*Math.pow(a,2)-3*t*Math.pow(a,2)},i.prototype.curve=function(){return i._validateParameters("curve",arguments),this._renderer._doStroke&&this._renderer.curve.apply(this._renderer,arguments),this},i.prototype.curveDetail=function(t){return i._validateParameters("curveDetail",arguments),this._curveDetail=t,this},i.prototype.curveTightness=function(t){i._validateParameters("curveTightness",arguments),this._renderer._curveTightness=t},i.prototype.curvePoint=function(t,e,r,n,o){i._validateParameters("curvePoint",arguments);var a=o*o*o,s=o*o;return t*(-.5*a+s-.5*o)+e*(1.5*a-2.5*s+1)+r*(-1.5*a+2*s+.5*o)+n*(.5*a-.5*s)},i.prototype.curveTangent=function(t,e,r,n,o){i._validateParameters("curveTangent",arguments);var a=o*o;return t*(-3*a/2+2*o-.5)+e*(9*a/2-5*o)+r*(-9*a/2+4*o+.5)+n*(3*a/2-o)},e.exports=i},{"./core":21,"./error_helpers":24}],23:[function(t,e,r){"use strict";function i(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth||0}function n(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0}var o=t("./core"),a=t("./constants"),s=[a.ARROW,a.CROSS,a.HAND,a.MOVE,a.TEXT,a.WAIT];o.prototype._frameRate=0,o.prototype._lastFrameTime=window.performance.now(),o.prototype._targetFrameRate=60;var h=window.print;o.prototype.print=function(){arguments.length?console.log.apply(console,arguments):h()},o.prototype.frameCount=0,o.prototype.focused=document.hasFocus(),o.prototype.cursor=function(t,e,r){var i="auto",n=this._curElement.elt;if(s.indexOf(t)>-1)i=t;else if("string"==typeof t){var o="";e&&r&&"number"==typeof e&&"number"==typeof r&&(o=e+" "+r),i="http://"===t.substring(0,7)||"https://"===t.substring(0,8)?"url("+t+") "+o+", auto":/\.(cur|jpg|jpeg|gif|png|CUR|JPG|JPEG|GIF|PNG)$/.test(t)?"url("+t+") "+o+", auto":t}n.style.cursor=i},o.prototype.frameRate=function(t){return o._validateParameters("frameRate",arguments),"number"!=typeof t||t<0?this._frameRate:(this._setProperty("_targetFrameRate",t),this._runFrames(),this)},o.prototype.getFrameRate=function(){return this.frameRate()},o.prototype.setFrameRate=function(t){return this.frameRate(t)},o.prototype.noCursor=function(){this._curElement.elt.style.cursor="none"},o.prototype.displayWidth=screen.width,o.prototype.displayHeight=screen.height,o.prototype.windowWidth=i(),o.prototype.windowHeight=n(),o.prototype._onresize=function(t){this._setProperty("windowWidth",i()),this._setProperty("windowHeight",n());var e,r=this._isGlobal?window:this;"function"==typeof r.windowResized&&(void 0===(e=r.windowResized(t))||e||t.preventDefault())},o.prototype.width=0,o.prototype.height=0,o.prototype.fullscreen=function(t){if(o._validateParameters("fullscreen",arguments),void 0===t)return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;t?function(t){if(!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled))throw new Error("Fullscreen not enabled in this browser.");t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen()}(document.documentElement):document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()},o.prototype.pixelDensity=function(t){if(o._validateParameters("pixelDensity",arguments),"number"!=typeof t)return this._pixelDensity;this._pixelDensity=t,this.resizeCanvas(this.width,this.height,!0)},o.prototype.displayDensity=function(){return window.devicePixelRatio},o.prototype.getURL=function(){return location.href},o.prototype.getURLPath=function(){return location.pathname.split("/").filter(function(t){return""!==t})},o.prototype.getURLParams=function(){for(var t,e=/[?&]([^&=]+)(?:[&=])([^&=]+)/gim,r={};null!=(t=e.exec(location.search));)t.index===e.lastIndex&&e.lastIndex++,r[t[1]]=t[2];return r},e.exports=o},{"./constants":20,"./core":21}],24:[function(t,e,r){"use strict";var i=t("./core");t("./constants"),i._validateParameters=i._friendlyFileLoadError=function(){};var n=null,o=function(){var e={},r=function(t){return Object.getOwnPropertyNames(t).filter(function(t){return!("_"===t[0]||t in e||(e[t]=!0,0))}).map(function(e){return{name:e,type:"function"==typeof t[e]?"function":e===e.toUpperCase()?"constant":"variable"}})};(n=[].concat(r(i.prototype),r(t("./constants")))).sort(function(t,e){return e.name.length-t.name.length})},a=function(t,e){e||(e=console.log.bind(console)),n||o(),n.some(function(r){if(t.message&&null!==t.message.match("\\W?"+r.name+"\\W"))return e("Did you just try to use p5.js's "+r.name+("function"===r.type?"() ":" ")+r.type+"? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: https://github.com/processing/p5.js/wiki/Frequently-Asked-Questions#why-cant-i-assign-variables-using-p5-functions-and-variables-before-setup"),!0})};i.prototype._helpForMisusedAtTopLevelCode=a,"complete"!==document.readyState&&(window.addEventListener("error",a,!1),window.addEventListener("load",function(){window.removeEventListener("error",a,!1)})),e.exports=i},{"../../docs/reference/data.json":void 0,"./constants":20,"./core":21}],25:[function(t,e,r){"use strict";var i=t("../core/core"),n=function(){window.PHANTOMJS||window.mocha||(window.setup&&"function"==typeof window.setup||window.draw&&"function"==typeof window.draw)&&!i.instance&&new i};"complete"===document.readyState?n():window.addEventListener("load",n,!1)},{"../core/core":21}],26:[function(t,e,r){"use strict";function i(t,e,r){return!1===e?o(t,r):n(t,e,r),this}function n(t,e,r){r._events[t]&&o(t,r);var i=e.bind(r);r.elt.addEventListener(t,i,!1),r._events[t]=i}function o(t,e){var r=e._events[t];e.elt.removeEventListener(t,r,!1),e._events[t]=null}var a=t("./core");a.Element=function(t,e){this.elt=t,this._pInst=e,this._events={},this.width=this.elt.offsetWidth,this.height=this.elt.offsetHeight},a.Element.prototype.parent=function(t){return void 0===t?this.elt.parentNode:("string"==typeof t?("#"===t[0]&&(t=t.substring(1)),t=document.getElementById(t)):t instanceof a.Element&&(t=t.elt),t.appendChild(this.elt),this)},a.Element.prototype.id=function(t){return void 0===t?this.elt.id:(this.elt.id=t,this.width=this.elt.offsetWidth,this.height=this.elt.offsetHeight,this)},a.Element.prototype.class=function(t){return void 0===t?this.elt.className:(this.elt.className=t,this)},a.Element.prototype.mousePressed=function(t){return i("mousedown",t,this),i("touchstart",t,this),this},a.Element.prototype.doubleClicked=function(t){return i("dblclick",t,this),this},a.Element.prototype.mouseWheel=function(t){return i("wheel",t,this),this},a.Element.prototype.mouseReleased=function(t){return i("mouseup",t,this),i("touchend",t,this),this},a.Element.prototype.mouseClicked=function(t){return i("click",t,this),this},a.Element.prototype.mouseMoved=function(t){return i("mousemove",t,this),i("touchmove",t,this),this},a.Element.prototype.mouseOver=function(t){return i("mouseover",t,this),this},a.Element.prototype.changed=function(t){return i("change",t,this),this},a.Element.prototype.input=function(t){return i("input",t,this),this},a.Element.prototype.mouseOut=function(t){return i("mouseout",t,this),this},a.Element.prototype.touchStarted=function(t){return i("touchstart",t,this),i("mousedown",t,this),this},a.Element.prototype.touchMoved=function(t){return i("touchmove",t,this),i("mousemove",t,this),this},a.Element.prototype.touchEnded=function(t){return i("touchend",t,this),i("mouseup",t,this),this},a.Element.prototype.dragOver=function(t){return i("dragover",t,this),this},a.Element.prototype.dragLeave=function(t){return i("dragleave",t,this),this},a.Element.prototype.drop=function(t,e){function r(e){var r=new a.File(e);return function(e){r.data=e.target.result,t(r)}}return window.File&&window.FileReader&&window.FileList&&window.Blob?(n("dragover",function(t){t.stopPropagation(),t.preventDefault()},this),n("dragleave",function(t){t.stopPropagation(),t.preventDefault()},this),void 0!==e&&n("drop",e,this),n("drop",function(t){t.stopPropagation(),t.preventDefault();for(var e=t.dataTransfer.files,i=0;i<e.length;i++){var n=e[i],o=new FileReader;o.onload=r(n),n.type.indexOf("text")>-1?o.readAsText(n):o.readAsDataURL(n)}},this)):console.log("The File APIs are not fully supported in this browser."),this},a.Element.prototype._setProperty=function(t,e){this[t]=e},e.exports=a.Element},{"./core":21}],27:[function(t,e,r){"use strict";var i=t("./core"),n=t("./constants");i.Graphics=function(t,e,r,o){var a=r||n.P2D;for(var s in this.canvas=document.createElement("canvas"),(o._userNode||document.body).appendChild(this.canvas),i.Element.call(this,this.canvas,o,!1),i.prototype)this[s]||("function"==typeof i.prototype[s]?this[s]=i.prototype[s].bind(this):this[s]=i.prototype[s]);return i.prototype._initializeInstanceVariables.apply(this),this.width=t,this.height=e,this._pixelDensity=o._pixelDensity,a===n.WEBGL?this._renderer=new i.RendererGL(this.canvas,this,!1):this._renderer=new i.Renderer2D(this.canvas,this,!1),o._elements.push(this),this._renderer.resize(t,e),this._renderer._applyDefaults(),this},i.Graphics.prototype=Object.create(i.Element.prototype),i.Graphics.prototype.remove=function(){this.elt.parentNode&&this.elt.parentNode.removeChild(this.elt);var t=this._pInst._elements.indexOf(this);for(var e in-1!==t&&this._pInst._elements.splice(t,1),this._events)this.elt.removeEventListener(e,this._events[e])},e.exports=i.Graphics},{"./constants":20,"./core":21}],28:[function(t,e,r){"use strict";function i(t){var e=0,r=0;if(t.offsetParent)do{e+=t.offsetLeft,r+=t.offsetTop}while(t=t.offsetParent);else e+=t.offsetLeft,r+=t.offsetTop;return[e,r]}var n=t("./core"),o=t("../core/constants");n.Renderer=function(t,e,r){n.Element.call(this,t,e),this.canvas=t,this._pInst=e,r?(this._isMainCanvas=!0,this._pInst._setProperty("_curElement",this),this._pInst._setProperty("canvas",this.canvas),this._pInst._setProperty("width",this.width),this._pInst._setProperty("height",this.height)):(this.canvas.style.display="none",this._styles=[]),this._textSize=12,this._textLeading=15,this._textFont="sans-serif",this._textStyle=o.NORMAL,this._textAscent=null,this._textDescent=null,this._rectMode=o.CORNER,this._ellipseMode=o.CENTER,this._curveTightness=0,this._imageMode=o.CORNER,this._tint=null,this._doStroke=!0,this._doFill=!0,this._strokeSet=!1,this._fillSet=!1},n.Renderer.prototype=Object.create(n.Element.prototype),n.Renderer.prototype.push=function(){return{properties:{_doStroke:this._doStroke,_strokeSet:this._strokeSet,_doFill:this._doFill,_fillSet:this._fillSet,_tint:this._tint,_imageMode:this._imageMode,_rectMode:this._rectMode,_ellipseMode:this._ellipseMode,_textFont:this._textFont,_textLeading:this._textLeading,_textSize:this._textSize,_textStyle:this._textStyle}}},n.Renderer.prototype.pop=function(t){t.properties&&function(t,e){for(var r=1;r<arguments.length;r++){var i=arguments[r];if(void 0!==i&&null!==i)for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])}}(this,t.properties)},n.Renderer.prototype.resize=function(t,e){this.width=t,this.height=e,this.elt.width=t*this._pInst._pixelDensity,this.elt.height=e*this._pInst._pixelDensity,this.elt.style.width=t+"px",this.elt.style.height=e+"px",this._isMainCanvas&&(this._pInst._setProperty("width",this.width),this._pInst._setProperty("height",this.height))},n.Renderer.prototype.textLeading=function(t){return"number"==typeof t?(this._setProperty("_textLeading",t),this):this._textLeading},n.Renderer.prototype.textSize=function(t){return"number"==typeof t?(this._setProperty("_textSize",t),this._setProperty("_textLeading",t*o._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},n.Renderer.prototype.textStyle=function(t){return t?(t!==o.NORMAL&&t!==o.ITALIC&&t!==o.BOLD||this._setProperty("_textStyle",t),this._applyTextProperties()):this._textStyle},n.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},n.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},n.Renderer.prototype._applyDefaults=function(){return this},n.Renderer.prototype._isOpenType=function(t){return"object"==typeof(t=t||this._textFont)&&t.font&&t.font.supported},n.Renderer.prototype._updateTextMetrics=function(){if(this._isOpenType())return this._setProperty("_textAscent",this._textFont._textAscent()),this._setProperty("_textDescent",this._textFont._textDescent()),this;var t=document.createElement("span");t.style.fontFamily=this._textFont,t.style.fontSize=this._textSize+"px",t.innerHTML="ABCjgq|";var e=document.createElement("div");e.style.display="inline-block",e.style.width="1px",e.style.height="0px";var r=document.createElement("div");r.appendChild(t),r.appendChild(e),r.style.height="0px",r.style.overflow="hidden",document.body.appendChild(r),e.style.verticalAlign="baseline";var n=i(e),o=i(t),a=n[1]-o[1];e.style.verticalAlign="bottom",n=i(e),o=i(t);var s=n[1]-o[1]-a;return document.body.removeChild(r),this._setProperty("_textAscent",a),this._setProperty("_textDescent",s),this},e.exports=n.Renderer},{"../core/constants":20,"./core":21}],29:[function(t,e,r){"use strict";var i=t("./core"),n=t("./canvas"),o=t("./constants"),a=t("../image/filters");t("./p5.Renderer");var s="rgba(0,0,0,0)";i.Renderer2D=function(t,e,r){return i.Renderer.call(this,t,e,r),this.drawingContext=this.canvas.getContext("2d"),this._pInst._setProperty("drawingContext",this.drawingContext),this},i.Renderer2D.prototype=Object.create(i.Renderer.prototype),i.Renderer2D.prototype._applyDefaults=function(){this._cachedFillStyle=this._cachedStrokeStyle=void 0,this._setFill(o._DEFAULT_FILL),this._setStroke(o._DEFAULT_STROKE),this.drawingContext.lineCap=o.ROUND,this.drawingContext.font="normal 12px sans-serif"},i.Renderer2D.prototype.resize=function(t,e){i.Renderer.prototype.resize.call(this,t,e),this.drawingContext.scale(this._pInst._pixelDensity,this._pInst._pixelDensity)},i.Renderer2D.prototype.background=function(){if(this.drawingContext.save(),this.drawingContext.setTransform(1,0,0,1,0,0),this.drawingContext.scale(this._pInst._pixelDensity,this._pInst._pixelDensity),arguments[0]instanceof i.Image)this._pInst.image(arguments[0],0,0,this.width,this.height);else{var t=this._getFill(),e=this._pInst.color.apply(this._pInst,arguments).toString();this._setFill(e),this.drawingContext.fillRect(0,0,this.width,this.height),this._setFill(t)}this.drawingContext.restore()},i.Renderer2D.prototype.clear=function(){this.drawingContext.save(),this.drawingContext.setTransform(1,0,0,1,0,0),this.drawingContext.clearRect(0,0,this.width,this.height),this.drawingContext.restore()},i.Renderer2D.prototype.fill=function(){var t=this._pInst.color.apply(this._pInst,arguments);this._setFill(t.toString())},i.Renderer2D.prototype.stroke=function(){var t=this._pInst.color.apply(this._pInst,arguments);this._setStroke(t.toString())},i.Renderer2D.prototype.image=function(t,e,r,n,o,a,s,h,l){var u;try{this._tint&&(i.MediaElement&&t instanceof i.MediaElement&&t.loadPixels(),t.canvas&&(u=this._getTintedImageCanvas(t))),u||(u=t.canvas||t.elt),this.drawingContext.drawImage(u,e,r,n,o,a,s,h,l)}catch(t){if("NS_ERROR_NOT_AVAILABLE"!==t.name)throw t}},i.Renderer2D.prototype._getTintedImageCanvas=function(t){if(!t.canvas)return t;var e=a._toPixels(t.canvas),r=document.createElement("canvas");r.width=t.canvas.width,r.height=t.canvas.height;for(var i=r.getContext("2d"),n=i.createImageData(t.canvas.width,t.canvas.height),o=n.data,s=0;s<e.length;s+=4){var h=e[s],l=e[s+1],u=e[s+2],c=e[s+3];o[s]=h*this._tint[0]/255,o[s+1]=l*this._tint[1]/255,o[s+2]=u*this._tint[2]/255,o[s+3]=c*this._tint[3]/255}return i.putImageData(n,0,0),r},i.Renderer2D.prototype.blendMode=function(t){this.drawingContext.globalCompositeOperation=t},i.Renderer2D.prototype.blend=function(){var t=this.drawingContext.globalCompositeOperation,e=arguments[arguments.length-1],r=Array.prototype.slice.call(arguments,0,arguments.length-1);this.drawingContext.globalCompositeOperation=e,this._pInst?this._pInst.copy.apply(this._pInst,r):this.copy.apply(this,r),this.drawingContext.globalCompositeOperation=t},i.Renderer2D.prototype.copy=function(){var t,e,r,n,o,a,s,h,l;if(9===arguments.length)t=arguments[0],e=arguments[1],r=arguments[2],n=arguments[3],o=arguments[4],a=arguments[5],s=arguments[6],h=arguments[7],l=arguments[8];else{if(8!==arguments.length)throw new Error("Signature not supported");t=this._pInst,e=arguments[0],r=arguments[1],n=arguments[2],o=arguments[3],a=arguments[4],s=arguments[5],h=arguments[6],l=arguments[7]}i.Renderer2D._copyHelper(this,t,e,r,n,o,a,s,h,l)},i.Renderer2D._copyHelper=function(t,e,r,i,n,o,a,s,h,l){e.loadPixels();var u=e.canvas.width/e.width;t.drawingContext.drawImage(e.canvas,u*r,u*i,u*n,u*o,a,s,h,l)},i.Renderer2D.prototype.get=function(t,e,r,n){if(void 0===t&&void 0===e&&void 0===r&&void 0===n?(t=0,e=0,r=this.width,n=this.height):void 0===r&&void 0===n&&(r=1,n=1),t+r<0||e+n<0||t>this.width||e>this.height)return[0,0,0,255];var o=this._pInst||this;o.loadPixels();var a=o._pixelDensity;t=Math.floor(t),e=Math.floor(e),r=Math.floor(r),n=Math.floor(n);var s=t*a,h=e*a;if(1!==r||1!==n||this instanceof i.RendererGL){var l=Math.min(r,o.width),u=Math.min(n,o.height),c=l*a,p=u*a,d=new i.Image(l,u);return d.canvas.getContext("2d").drawImage(this.canvas,s,h,c,p,0,0,l,u),d}var f=this.drawingContext.getImageData(s,h,1,1).data;return[f[0],f[1],f[2],f[3]]},i.Renderer2D.prototype.loadPixels=function(){var t=this._pInst||this,e=t._pixelDensity,r=this.width*e,i=this.height*e,n=this.drawingContext.getImageData(0,0,r,i);t._setProperty("imageData",n),t._setProperty("pixels",n.data)},i.Renderer2D.prototype.set=function(t,e,r){t=Math.floor(t),e=Math.floor(e);var n=this._pInst||this;if(r instanceof i.Image)this.drawingContext.save(),this.drawingContext.setTransform(1,0,0,1,0,0),this.drawingContext.scale(n._pixelDensity,n._pixelDensity),this.drawingContext.drawImage(r.canvas,t,e),this.loadPixels.call(n),this.drawingContext.restore();else{var o=0,a=0,s=0,h=0,l=4*(e*n._pixelDensity*(this.width*n._pixelDensity)+t*n._pixelDensity);if(n.imageData||n.loadPixels.call(n),"number"==typeof r)l<n.pixels.length&&(o=r,a=r,s=r,h=255);else if(r instanceof Array){if(r.length<4)throw new Error("pixel array must be of the form [R, G, B, A]");l<n.pixels.length&&(o=r[0],a=r[1],s=r[2],h=r[3])}else r instanceof i.Color&&l<n.pixels.length&&(o=r.levels[0],a=r.levels[1],s=r.levels[2],h=r.levels[3]);for(var u=0;u<n._pixelDensity;u++)for(var c=0;c<n._pixelDensity;c++)l=4*((e*n._pixelDensity+c)*this.width*n._pixelDensity+(t*n._pixelDensity+u)),n.pixels[l]=o,n.pixels[l+1]=a,n.pixels[l+2]=s,n.pixels[l+3]=h}},i.Renderer2D.prototype.updatePixels=function(t,e,r,i){var n=this._pInst||this,o=n._pixelDensity;void 0===t&&void 0===e&&void 0===r&&void 0===i&&(t=0,e=0,r=this.width,i=this.height),r*=o,i*=o,this.drawingContext.putImageData(n.imageData,t,e,0,0,r,i)},i.Renderer2D.prototype._acuteArcToBezier=function(t,e){var r=e/2,i=Math.cos(r),n=Math.sin(r),o=1/Math.tan(r),a=t+r,s=Math.cos(a),h=Math.sin(a),l=(4-i)/3,u=n+(i-l)*o;return{ax:Math.cos(t),ay:Math.sin(t),bx:l*s+u*h,by:l*h-u*s,cx:l*s-u*h,cy:l*h+u*s,dx:Math.cos(t+e),dy:Math.sin(t+e)}},i.Renderer2D.prototype.arc=function(t,e,r,i,a,s,h){for(var l=this.drawingContext,u=n.arcModeAdjust(t,e,r,i,this._ellipseMode),c=u.w/2,p=u.h/2,d=0,f=[];s-a>1e-5;)d=Math.min(s-a,o.HALF_PI),f.push(this._acuteArcToBezier(a,d)),a+=d;return this._doFill&&(l.beginPath(),f.forEach(function(t,e){0===e&&l.moveTo(u.x+t.ax*c,u.y+t.ay*p),l.bezierCurveTo(u.x+t.bx*c,u.y+t.by*p,u.x+t.cx*c,u.y+t.cy*p,u.x+t.dx*c,u.y+t.dy*p)}),h!==o.PIE&&null!=h||l.lineTo(u.x,u.y),l.closePath(),l.fill()),this._doStroke&&(l.beginPath(),f.forEach(function(t,e){0===e&&l.moveTo(u.x+t.ax*c,u.y+t.ay*p),l.bezierCurveTo(u.x+t.bx*c,u.y+t.by*p,u.x+t.cx*c,u.y+t.cy*p,u.x+t.dx*c,u.y+t.dy*p)}),h===o.PIE?(l.lineTo(u.x,u.y),l.closePath()):h===o.CHORD&&l.closePath(),l.stroke()),this},i.Renderer2D.prototype.ellipse=function(t){var e=this.drawingContext,r=this._doFill,i=this._doStroke,n=t[0],o=t[1],a=t[2],h=t[3];if(r&&!i){if(this._getFill()===s)return this}else if(!r&&i&&this._getStroke()===s)return this;var l=.5522847498,u=a/2*l,c=h/2*l,p=n+a,d=o+h,f=n+a/2,m=o+h/2;e.beginPath(),e.moveTo(n,m),e.bezierCurveTo(n,m-c,f-u,o,f,o),e.bezierCurveTo(f+u,o,p,m-c,p,m),e.bezierCurveTo(p,m+c,f+u,d,f,d),e.bezierCurveTo(f-u,d,n,m+c,n,m),e.closePath(),r&&e.fill(),i&&e.stroke()},i.Renderer2D.prototype.line=function(t,e,r,i){var n=this.drawingContext;return this._doStroke?this._getStroke()===s?this:(n.lineWidth%2==1&&n.translate(.5,.5),n.beginPath(),n.moveTo(t,e),n.lineTo(r,i),n.stroke(),n.lineWidth%2==1&&n.translate(-.5,-.5),this):this},i.Renderer2D.prototype.point=function(t,e){var r=this.drawingContext;if(!this._doStroke)return this;if(this._getStroke()===s)return this;var i=this._getStroke(),n=this._getFill();t=Math.round(t),e=Math.round(e),this._setFill(i),r.lineWidth>1?(r.beginPath(),r.arc(t,e,r.lineWidth/2,0,o.TWO_PI,!1),r.fill()):r.fillRect(t,e,1,1),this._setFill(n)},i.Renderer2D.prototype.quad=function(t,e,r,i,n,o,a,h){var l=this.drawingContext,u=this._doFill,c=this._doStroke;if(u&&!c){if(this._getFill()===s)return this}else if(!u&&c&&this._getStroke()===s)return this;return l.beginPath(),l.moveTo(t,e),l.lineTo(r,i),l.lineTo(n,o),l.lineTo(a,h),l.closePath(),u&&l.fill(),c&&l.stroke(),this},i.Renderer2D.prototype.rect=function(t){var e=t[0],r=t[1],i=t[2],n=t[3],o=t[4],a=t[5],h=t[6],l=t[7],u=this.drawingContext,c=this._doFill,p=this._doStroke;if(c&&!p){if(this._getFill()===s)return this}else if(!c&&p&&this._getStroke()===s)return this;if(this._doStroke&&u.lineWidth%2==1&&u.translate(.5,.5),u.beginPath(),void 0===o)u.rect(e,r,i,n);else{void 0===a&&(a=o),void 0===h&&(h=a),void 0===l&&(l=h);var d=i/2,f=n/2;i<2*o&&(o=d),n<2*o&&(o=f),i<2*a&&(a=d),n<2*a&&(a=f),i<2*h&&(h=d),n<2*h&&(h=f),i<2*l&&(l=d),n<2*l&&(l=f),u.beginPath(),u.moveTo(e+o,r),u.arcTo(e+i,r,e+i,r+n,a),u.arcTo(e+i,r+n,e,r+n,h),u.arcTo(e,r+n,e,r,l),u.arcTo(e,r,e+i,r,o),u.closePath()}return this._doFill&&u.fill(),this._doStroke&&u.stroke(),this._doStroke&&u.lineWidth%2==1&&u.translate(-.5,-.5),this},i.Renderer2D.prototype.triangle=function(t){var e=this.drawingContext,r=this._doFill,i=this._doStroke,n=t[0],o=t[1],a=t[2],h=t[3],l=t[4],u=t[5];if(r&&!i){if(this._getFill()===s)return this}else if(!r&&i&&this._getStroke()===s)return this;e.beginPath(),e.moveTo(n,o),e.lineTo(a,h),e.lineTo(l,u),e.closePath(),r&&e.fill(),i&&e.stroke()},i.Renderer2D.prototype.endShape=function(t,e,r,i,n,a,s){if(0===e.length)return this;if(!this._doStroke&&!this._doFill)return this;var h,l=t===o.CLOSE;l&&!a&&e.push(e[0]);var u,c,p=e.length;if(!r||s!==o.POLYGON&&null!==s)if(!i||s!==o.POLYGON&&null!==s)if(!n||s!==o.POLYGON&&null!==s)if(s===o.POINTS)for(u=0;u<p;u++)h=e[u],this._doStroke&&this._pInst.stroke(h[6]),this._pInst.point(h[0],h[1]);else if(s===o.LINES)for(u=0;u+1<p;u+=2)h=e[u],this._doStroke&&this._pInst.stroke(e[u+1][6]),this._pInst.line(h[0],h[1],e[u+1][0],e[u+1][1]);else if(s===o.TRIANGLES)for(u=0;u+2<p;u+=3)h=e[u],this.drawingContext.beginPath(),this.drawingContext.moveTo(h[0],h[1]),this.drawingContext.lineTo(e[u+1][0],e[u+1][1]),this.drawingContext.lineTo(e[u+2][0],e[u+2][1]),this.drawingContext.lineTo(h[0],h[1]),this._doFill&&(this._pInst.fill(e[u+2][5]),this.drawingContext.fill()),this._doStroke&&(this._pInst.stroke(e[u+2][6]),this.drawingContext.stroke()),this.drawingContext.closePath();else if(s===o.TRIANGLE_STRIP)for(u=0;u+1<p;u++)h=e[u],this.drawingContext.beginPath(),this.drawingContext.moveTo(e[u+1][0],e[u+1][1]),this.drawingContext.lineTo(h[0],h[1]),this._doStroke&&this._pInst.stroke(e[u+1][6]),this._doFill&&this._pInst.fill(e[u+1][5]),u+2<p&&(this.drawingContext.lineTo(e[u+2][0],e[u+2][1]),this._doStroke&&this._pInst.stroke(e[u+2][6]),this._doFill&&this._pInst.fill(e[u+2][5])),this._doFillStrokeClose();else if(s===o.TRIANGLE_FAN){if(p>2){for(this.drawingContext.beginPath(),u=2;u<p;u++)h=e[u],this.drawingContext.moveTo(e[0][0],e[0][1]),this.drawingContext.lineTo(e[u-1][0],e[u-1][1]),this.drawingContext.lineTo(h[0],h[1]),this.drawingContext.lineTo(e[0][0],e[0][1]),u<p-1&&(this._doFill&&h[5]!==e[u+1][5]||this._doStroke&&h[6]!==e[u+1][6])&&(this._doFill&&(this._pInst.fill(h[5]),this.drawingContext.fill(),this._pInst.fill(e[u+1][5])),this._doStroke&&(this._pInst.stroke(h[6]),this.drawingContext.stroke(),this._pInst.stroke(e[u+1][6])),this.drawingContext.closePath(),this.drawingContext.beginPath());this._doFillStrokeClose()}}else if(s===o.QUADS)for(u=0;u+3<p;u+=4){for(h=e[u],this.drawingContext.beginPath(),this.drawingContext.moveTo(h[0],h[1]),c=1;c<4;c++)this.drawingContext.lineTo(e[u+c][0],e[u+c][1]);this.drawingContext.lineTo(h[0],h[1]),this._doFill&&this._pInst.fill(e[u+3][5]),this._doStroke&&this._pInst.stroke(e[u+3][6]),this._doFillStrokeClose()}else if(s===o.QUAD_STRIP){if(p>3)for(u=0;u+1<p;u+=2)h=e[u],this.drawingContext.beginPath(),u+3<p?(this.drawingContext.moveTo(e[u+2][0],e[u+2][1]),this.drawingContext.lineTo(h[0],h[1]),this.drawingContext.lineTo(e[u+1][0],e[u+1][1]),this.drawingContext.lineTo(e[u+3][0],e[u+3][1]),this._doFill&&this._pInst.fill(e[u+3][5]),this._doStroke&&this._pInst.stroke(e[u+3][6])):(this.drawingContext.moveTo(h[0],h[1]),this.drawingContext.lineTo(e[u+1][0],e[u+1][1])),this._doFillStrokeClose()}else{for(this.drawingContext.beginPath(),this.drawingContext.moveTo(e[0][0],e[0][1]),u=1;u<p;u++)(h=e[u]).isVert&&(h.moveTo?this.drawingContext.moveTo(h[0],h[1]):this.drawingContext.lineTo(h[0],h[1]));this._doFillStrokeClose()}else{for(this.drawingContext.beginPath(),u=0;u<p;u++)e[u].isVert?e[u].moveTo?this.drawingContext.moveTo([0],e[u][1]):this.drawingContext.lineTo(e[u][0],e[u][1]):this.drawingContext.quadraticCurveTo(e[u][0],e[u][1],e[u][2],e[u][3]);this._doFillStrokeClose()}else{for(this.drawingContext.beginPath(),u=0;u<p;u++)e[u].isVert?e[u].moveTo?this.drawingContext.moveTo(e[u][0],e[u][1]):this.drawingContext.lineTo(e[u][0],e[u][1]):this.drawingContext.bezierCurveTo(e[u][0],e[u][1],e[u][2],e[u][3],e[u][4],e[u][5]);this._doFillStrokeClose()}else if(p>3){var d=[],f=1-this._curveTightness;for(this.drawingContext.beginPath(),this.drawingContext.moveTo(e[1][0],e[1][1]),u=1;u+2<p;u++)h=e[u],d[0]=[h[0],h[1]],d[1]=[h[0]+(f*e[u+1][0]-f*e[u-1][0])/6,h[1]+(f*e[u+1][1]-f*e[u-1][1])/6],d[2]=[e[u+1][0]+(f*e[u][0]-f*e[u+2][0])/6,e[u+1][1]+(f*e[u][1]-f*e[u+2][1])/6],d[3]=[e[u+1][0],e[u+1][1]],this.drawingContext.bezierCurveTo(d[1][0],d[1][1],d[2][0],d[2][1],d[3][0],d[3][1]);l&&this.drawingContext.lineTo(e[u+1][0],e[u+1][1]),this._doFillStrokeClose()}return r=!1,i=!1,n=!1,a=!1,l&&e.pop(),this},i.Renderer2D.prototype.noSmooth=function(){return"imageSmoothingEnabled"in this.drawingContext&&(this.drawingContext.imageSmoothingEnabled=!1),this},i.Renderer2D.prototype.smooth=function(){return"imageSmoothingEnabled"in this.drawingContext&&(this.drawingContext.imageSmoothingEnabled=!0),this},i.Renderer2D.prototype.strokeCap=function(t){return t!==o.ROUND&&t!==o.SQUARE&&t!==o.PROJECT||(this.drawingContext.lineCap=t),this},i.Renderer2D.prototype.strokeJoin=function(t){return t!==o.ROUND&&t!==o.BEVEL&&t!==o.MITER||(this.drawingContext.lineJoin=t),this},i.Renderer2D.prototype.strokeWeight=function(t){return this.drawingContext.lineWidth=void 0===t||0===t?1e-4:t,this},i.Renderer2D.prototype._getFill=function(){return this._cachedFillStyle||(this._cachedFillStyle=this.drawingContext.fillStyle),this._cachedFillStyle},i.Renderer2D.prototype._setFill=function(t){t!==this._cachedFillStyle&&(this.drawingContext.fillStyle=t,this._cachedFillStyle=t)},i.Renderer2D.prototype._getStroke=function(){return this._cachedStrokeStyle||(this._cachedStrokeStyle=this.drawingContext.strokeStyle),this._cachedStrokeStyle},i.Renderer2D.prototype._setStroke=function(t){t!==this._cachedStrokeStyle&&(this.drawingContext.strokeStyle=t,this._cachedStrokeStyle=t)},i.Renderer2D.prototype.bezier=function(t,e,r,i,n,o,a,s){return this._pInst.beginShape(),this._pInst.vertex(t,e),this._pInst.bezierVertex(r,i,n,o,a,s),this._pInst.endShape(),this},i.Renderer2D.prototype.curve=function(t,e,r,i,n,o,a,s){return this._pInst.beginShape(),this._pInst.curveVertex(t,e),this._pInst.curveVertex(r,i),this._pInst.curveVertex(n,o),this._pInst.curveVertex(a,s),this._pInst.endShape(),this},i.Renderer2D.prototype._doFillStrokeClose=function(){this._doFill&&this.drawingContext.fill(),this._doStroke&&this.drawingContext.stroke(),this.drawingContext.closePath()},i.Renderer2D.prototype.applyMatrix=function(t,e,r,i,n,o){this.drawingContext.transform(t,e,r,i,n,o)},i.Renderer2D.prototype.resetMatrix=function(){return this.drawingContext.setTransform(1,0,0,1,0,0),this.drawingContext.scale(this._pInst._pixelDensity,this._pInst._pixelDensity),this},i.Renderer2D.prototype.rotate=function(t){this.drawingContext.rotate(t)},i.Renderer2D.prototype.scale=function(t,e){return this.drawingContext.scale(t,e),this},i.Renderer2D.prototype.shearX=function(t){return this.drawingContext.transform(1,0,Math.tan(t),1,0,0),this},i.Renderer2D.prototype.shearY=function(t){return this.drawingContext.transform(1,Math.tan(t),0,1,0,0),this},i.Renderer2D.prototype.translate=function(t,e){return t instanceof i.Vector&&(e=t.y,t=t.x),this.drawingContext.translate(t,e),this},i.Renderer2D.prototype.text=function(t,e,r,i,n){var a,s,h,l,u,c,p,d,f,m=this._pInst,v=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==t){if("string"!=typeof t&&(t=t.toString()),a=(t=t.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(d=0,h=0;h<a.length;h++)for(u="",p=a[h].split(" "),s=0;s<p.length;s++)c=u+p[s]+" ",this.textWidth(c)>i?(u=p[s]+" ",d+=m.textLeading()):u=c;switch(this._rectMode===o.CENTER&&(e-=i/2,r-=n/2),this.drawingContext.textAlign){case o.CENTER:e+=i/2;break;case o.RIGHT:e+=i}if(void 0!==n){switch(this.drawingContext.textBaseline){case o.BOTTOM:r+=n-d;break;case o._CTX_MIDDLE:r+=(n-d)/2;break;case o.BASELINE:f=!0,this.drawingContext.textBaseline=o.TOP}v=r+n-m.textAscent()}for(h=0;h<a.length;h++){for(u="",p=a[h].split(" "),s=0;s<p.length;s++)c=u+p[s]+" ",this.textWidth(c)>i&&u.length>0?(this._renderText(m,u,e,r,v),u=p[s]+" ",r+=m.textLeading()):u=c;this._renderText(m,u,e,r,v),r+=m.textLeading()}}else{var g=0,y=m.textAlign().vertical;for(y===o.CENTER?g=(a.length-1)*m.textLeading()/2:y===o.BOTTOM&&(g=(a.length-1)*m.textLeading()),l=0;l<a.length;l++)this._renderText(m,a[l],e,r-g,v),r+=m.textLeading()}return f&&(this.drawingContext.textBaseline=o.BASELINE),m}},i.Renderer2D.prototype._renderText=function(t,e,r,i,n){if(!(i>=n))return t.push(),this._isOpenType()?this._textFont._renderPath(e,r,i,{renderer:this}):(this._doStroke&&this._strokeSet&&this.drawingContext.strokeText(e,r,i),this._doFill&&(this._fillSet||this._setFill(o._DEFAULT_TEXT_FILL),this.drawingContext.fillText(e,r,i))),t.pop(),t},i.Renderer2D.prototype.textWidth=function(t){return this._isOpenType()?this._textFont._textWidth(t,this._textSize):this.drawingContext.measureText(t).width},i.Renderer2D.prototype.textAlign=function(t,e){if(void 0!==t)return t!==o.LEFT&&t!==o.RIGHT&&t!==o.CENTER||(this.drawingContext.textAlign=t),e!==o.TOP&&e!==o.BOTTOM&&e!==o.CENTER&&e!==o.BASELINE||(e===o.CENTER?this.drawingContext.textBaseline=o._CTX_MIDDLE:this.drawingContext.textBaseline=e),this._pInst;var r=this.drawingContext.textBaseline;return r===o._CTX_MIDDLE&&(r=o.CENTER),{horizontal:this.drawingContext.textAlign,vertical:r}},i.Renderer2D.prototype._applyTextProperties=function(){var t,e=this._pInst;return this._setProperty("_textAscent",null),this._setProperty("_textDescent",null),t=this._textFont,this._isOpenType()&&(t=this._textFont.font.familyName,this._setProperty("_textStyle",this._textFont.font.styleName)),this.drawingContext.font=(this._textStyle||"normal")+" "+(this._textSize||12)+"px "+(t||"sans-serif"),e},i.Renderer2D.prototype.push=function(){return this.drawingContext.save(),i.Renderer.prototype.push.apply(this)},i.Renderer2D.prototype.pop=function(t){this.drawingContext.restore(),this._cachedFillStyle=this.drawingContext.fillStyle,this._cachedStrokeStyle=this.drawingContext.strokeStyle,i.Renderer.prototype.pop.call(this,t)},e.exports=i.Renderer2D},{"../image/filters":40,"./canvas":19,"./constants":20,"./core":21,"./p5.Renderer":28}],30:[function(t,e,r){"use strict";var i=t("./core"),n=t("./constants");t("./p5.Graphics"),t("./p5.Renderer2D"),t("../webgl/p5.RendererGL");var o="defaultCanvas0",a="p5Canvas";i.prototype.createCanvas=function(t,e,r){i._validateParameters("createCanvas",arguments);var s,h=r||n.P2D;if(h===n.WEBGL){if(s=document.getElementById(o)){s.parentNode.removeChild(s);var l=this._renderer;this._elements=this._elements.filter(function(t){return t!==l})}(s=document.createElement("canvas")).id=o,s.classList.add(a)}else if(this._defaultGraphicsCreated)s=this.canvas;else{s=document.createElement("canvas");for(var u=0;document.getElementById("defaultCanvas"+u);)u++;o="defaultCanvas"+u,s.id=o,s.classList.add(a)}return this._setupDone||(s.dataset.hidden=!0,s.style.visibility="hidden"),this._userNode?this._userNode.appendChild(s):document.body.appendChild(s),h===n.WEBGL?(this._setProperty("_renderer",new i.RendererGL(s,this,!0)),this._elements.push(this._renderer)):this._defaultGraphicsCreated||(this._setProperty("_renderer",new i.Renderer2D(s,this,!0)),this._defaultGraphicsCreated=!0,this._elements.push(this._renderer)),this._renderer.resize(t,e),this._renderer._applyDefaults(),this._renderer},i.prototype.resizeCanvas=function(t,e,r){if(i._validateParameters("resizeCanvas",arguments),this._renderer){var n={};for(var o in this.drawingContext){var a=this.drawingContext[o];"object"!=typeof a&&"function"!=typeof a&&(n[o]=a)}for(var s in this._renderer.resize(t,e),n)try{this.drawingContext[s]=n[s]}catch(t){}r||this.redraw()}},i.prototype.noCanvas=function(){this.canvas&&this.canvas.parentNode.removeChild(this.canvas)},i.prototype.createGraphics=function(t,e,r){return i._validateParameters("createGraphics",arguments),new i.Graphics(t,e,r,this)},i.prototype.blendMode=function(t){if(i._validateParameters("blendMode",arguments),t!==n.BLEND&&t!==n.DARKEST&&t!==n.LIGHTEST&&t!==n.DIFFERENCE&&t!==n.MULTIPLY&&t!==n.EXCLUSION&&t!==n.SCREEN&&t!==n.REPLACE&&t!==n.OVERLAY&&t!==n.HARD_LIGHT&&t!==n.SOFT_LIGHT&&t!==n.DODGE&&t!==n.BURN&&t!==n.ADD&&t!==n.NORMAL)throw new Error("Mode "+t+" not recognized.");this._renderer.blendMode(t)},e.exports=i},{"../webgl/p5.RendererGL":71,"./constants":20,"./core":21,"./p5.Graphics":27,"./p5.Renderer2D":29}],31:[function(t,e,r){"use strict";window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t,e){window.setTimeout(t,1e3/60)},window.performance=window.performance||{},window.performance.now=function(){var t=Date.now();return window.performance.now||window.performance.mozNow||window.performance.msNow||window.performance.oNow||window.performance.webkitNow||function(){return Date.now()-t}}(),"undefined"==typeof Uint8ClampedArray||Uint8ClampedArray.prototype.slice||Object.defineProperty(Uint8ClampedArray.prototype,"slice",{value:Array.prototype.slice,writable:!0,configurable:!0,enumerable:!1})},{}],32:[function(t,e,r){"use strict";var i=t("./core");i.prototype.exit=function(){throw"exit() not implemented, see remove()"},i.prototype.noLoop=function(){this._loop=!1},i.prototype.loop=function(){this._loop=!0,this._draw()},i.prototype.push=function(){this._styles.push({props:{_colorMode:this._colorMode},renderer:this._renderer.push()})},i.prototype.pop=function(){var t=this._styles.pop();t?(this._renderer.pop(t.renderer),function(t,e){for(var r=1;r<arguments.length;r++){var i=arguments[r];if(null!=i)for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])}}(this,t.props)):console.warn("pop() was called without matching push()")},i.prototype.pushStyle=function(){throw new Error("pushStyle() not used, see push()")},i.prototype.popStyle=function(){throw new Error("popStyle() not used, see pop()")},i.prototype.redraw=function(t){this.resetMatrix(),this._renderer.isP3D&&this._renderer._update();var e=parseInt(t);(isNaN(e)||e<1)&&(e=1);var r=this.setup||window.setup,i=this.draw||window.draw;if("function"==typeof i){void 0===r&&this.scale(this._pixelDensity,this._pixelDensity);for(var n=this,o=function(t){t.call(n)},a=0;a<e;a++)this._setProperty("frameCount",this.frameCount+1),this._registeredMethods.pre.forEach(o),i(),this._registeredMethods.post.forEach(o)}},i.prototype.size=function(){throw"size() is not a valid p5 function, to set the size of the "+"drawing canvas, please use createCanvas() instead"},e.exports=i},{"./core":21}],33:[function(t,e,r){"use strict";var i=t("./core");i.prototype.applyMatrix=function(t,e,r,i,n,o){return this._renderer.applyMatrix(t,e,r,i,n,o),this},i.prototype.popMatrix=function(){throw new Error("popMatrix() not used, see pop()")},i.prototype.printMatrix=function(){throw new Error("printMatrix() not implemented")},i.prototype.pushMatrix=function(){throw new Error("pushMatrix() not used, see push()")},i.prototype.resetMatrix=function(){return this._renderer.resetMatrix(),this},i.prototype.rotate=function(t,e){return i._validateParameters("rotate",arguments),this._renderer.rotate(this._toRadians(t),e),this},i.prototype.rotateX=function(t){return this._assert3d("rotateX"),i._validateParameters("rotateX",arguments),this._renderer.rotateX(this._toRadians(t)),this},i.prototype.rotateY=function(t){return this._assert3d("rotateY"),i._validateParameters("rotateY",arguments),this._renderer.rotateY(this._toRadians(t)),this},i.prototype.rotateZ=function(t){return this._assert3d("rotateZ"),i._validateParameters("rotateZ",arguments),this._renderer.rotateZ(this._toRadians(t)),this},i.prototype.scale=function(t,e,r){if(i._validateParameters("scale",arguments),t instanceof i.Vector){var n=t;t=n.x,e=n.y,r=n.z}else if(t instanceof Array){var o=t;t=o[0],e=o[1],r=o[2]||1}return isNaN(e)?e=r=t:isNaN(r)&&(r=1),this._renderer.scale.call(this._renderer,t,e,r),this},i.prototype.shearX=function(t){return i._validateParameters("shearX",arguments),this._renderer.shearX(this._toRadians(t)),this},i.prototype.shearY=function(t){return i._validateParameters("shearY",arguments),this._renderer.shearY(this._toRadians(t)),this},i.prototype.translate=function(t,e,r){return i._validateParameters("translate",arguments),this._renderer.isP3D?this._renderer.translate(t,e,r):this._renderer.translate(t,e),this},e.exports=i},{"./core":21}],34:[function(t,e,r){"use strict";var i=t("./core"),n=t("./constants"),o=null,a=[],s=[],h=!1,l=!1,u=!1,c=!1,p=!0;i.prototype.beginContour=function(){return s=[],c=!0,this},i.prototype.beginShape=function(t){return i._validateParameters("beginShape",arguments),this._renderer.isP3D?this._renderer.beginShape.apply(this._renderer,arguments):(o=t===n.POINTS||t===n.LINES||t===n.TRIANGLES||t===n.TRIANGLE_FAN||t===n.TRIANGLE_STRIP||t===n.QUADS||t===n.QUAD_STRIP?t:null,a=[],s=[]),this},i.prototype.bezierVertex=function(t,e,r,n,o,l){if(i._validateParameters("bezierVertex",arguments),0===a.length)throw"vertex() must be used once before calling bezierVertex()";h=!0;for(var u=[],p=0;p<arguments.length;p++)u[p]=arguments[p];return u.isVert=!1,c?s.push(u):a.push(u),this},i.prototype.curveVertex=function(t,e){return i._validateParameters("curveVertex",arguments),l=!0,this.vertex(t,e),this},i.prototype.endContour=function(){var t=s[0].slice();t.isVert=s[0].isVert,t.moveTo=!1,s.push(t),p&&(a.push(a[0]),p=!1);for(var e=0;e<s.length;e++)a.push(s[e]);return this},i.prototype.endShape=function(t){if(i._validateParameters("endShape",arguments),this._renderer.isP3D)this._renderer.endShape(t,l,h,u,c,o);else{if(0===a.length)return this;if(!this._renderer._doStroke&&!this._renderer._doFill)return this;var e=t===n.CLOSE;e&&!c&&a.push(a[0]),this._renderer.endShape(t,a,l,h,u,c,o),l=!1,h=!1,u=!1,c=!1,p=!0,e&&a.pop()}return this},i.prototype.quadraticVertex=function(t,e,r,o){if(i._validateParameters("quadraticVertex",arguments),this._contourInited){var h={};return h.x=t,h.y=e,h.x3=r,h.y3=o,h.type=n.QUADRATIC,this._contourVertices.push(h),this}if(!(a.length>0))throw"vertex() must be used once before calling quadraticVertex()";u=!0;for(var l=[],p=0;p<arguments.length;p++)l[p]=arguments[p];return l.isVert=!1,c?s.push(l):a.push(l),this},i.prototype.vertex=function(t,e,r,i,n){if(this._renderer.isP3D)this._renderer.vertex.apply(this._renderer,arguments);else{var o=[];o.isVert=!0,o[0]=t,o[1]=e,o[2]=0,o[3]=0,o[4]=0,o[5]=this._renderer._getFill(),o[6]=this._renderer._getStroke(),r&&(o.moveTo=r),c?(0===s.length&&(o.moveTo=!0),s.push(o)):a.push(o)}return this},e.exports=i},{"./constants":20,"./core":21}],35:[function(t,e,r){"use strict";var i=t("../core/core");i.prototype.createStringDict=function(t,e){return i._validateParameters("createStringDict",arguments),new i.StringDict(t,e)},i.prototype.createNumberDict=function(t,e){return i._validateParameters("createNumberDict",arguments),new i.NumberDict(t,e)},i.TypedDict=function(t,e){return t instanceof Object?this.data=t:(this.data={},this.data[t]=e),this},i.TypedDict.prototype.size=function(){return Object.keys(this.data).length},i.TypedDict.prototype.hasKey=function(t){return this.data.hasOwnProperty(t)},i.TypedDict.prototype.get=function(t){if(this.data.hasOwnProperty(t))return this.data[t];console.log(t+" does not exist in this Dictionary")},i.TypedDict.prototype.set=function(t,e){this._validate(e)?this.data[t]=e:console.log("Those values dont work for this dictionary type.")},i.TypedDict.prototype._addObj=function(t){for(var e in t)this.set(e,t[e])},i.TypedDict.prototype.create=function(t,e){t instanceof Object&&void 0===e?this._addObj(t):void 0!==t?this.set(t,e):console.log("In order to create a new Dictionary entry you must pass an object or a key, value pair")},i.TypedDict.prototype.clear=function(){this.data={}},i.TypedDict.prototype.remove=function(t){if(!this.data.hasOwnProperty(t))throw t+" does not exist in this Dictionary";delete this.data[t]},i.TypedDict.prototype.print=function(){for(var t in this.data)console.log("key:"+t+" value:"+this.data[t])},i.TypedDict.prototype.saveTable=function(t){var e="";for(var r in this.data)e+=r+","+this.data[r]+"\n";var n=new Blob([e],{type:"text/csv"});i.prototype.downloadFile(n,t||"mycsv","csv")},i.TypedDict.prototype.saveJSON=function(t,e){i.prototype.saveJSON(this.data,t,e)},i.TypedDict.prototype._validate=function(t){return!0},i.StringDict=function(){i.TypedDict.apply(this,arguments)},i.StringDict.prototype=Object.create(i.TypedDict.prototype),i.StringDict.prototype._validate=function(t){return"string"==typeof t},i.NumberDict=function(){i.TypedDict.apply(this,arguments)},i.NumberDict.prototype=Object.create(i.TypedDict.prototype),i.NumberDict.prototype._validate=function(t){return"number"==typeof t},i.NumberDict.prototype.add=function(t,e){this.data.hasOwnProperty(t)?this.data[t]+=e:console.log("The key - "+t+" does not exist in this dictionary.")},i.NumberDict.prototype.sub=function(t,e){this.add(t,-e)},i.NumberDict.prototype.mult=function(t,e){this.data.hasOwnProperty(t)?this.data[t]*=e:console.log("The key - "+t+" does not exist in this dictionary.")},i.NumberDict.prototype.div=function(t,e){this.data.hasOwnProperty(t)?this.data[t]/=e:console.log("The key - "+t+" does not exist in this dictionary.")},i.NumberDict.prototype._valueTest=function(t){if(0===Object.keys(this.data).length)throw"Unable to search for a minimum or maximum value on an empty NumberDict";if(1===Object.keys(this.data).length)return this.data[Object.keys(this.data)[0]];var e=this.data[Object.keys(this.data)[0]];for(var r in this.data)this.data[r]*t<e*t&&(e=this.data[r]);return e},i.NumberDict.prototype.minValue=function(){return this._valueTest(1)},i.NumberDict.prototype.maxValue=function(){return this._valueTest(-1)},i.NumberDict.prototype._keyTest=function(t){if(0===Object.keys(this.data).length)throw"Unable to use minValue on an empty NumberDict";if(1===Object.keys(this.data).length)return Object.keys(this.data)[0];for(var e=Object.keys(this.data)[0],r=1;r<Object.keys(this.data).length;r++)Object.keys(this.data)[r]*t<e*t&&(e=Object.keys(this.data)[r]);return e},i.NumberDict.prototype.minKey=function(){return this._keyTest(1)},i.NumberDict.prototype.maxKey=function(){return this._keyTest(-1)},e.exports=i.TypedDict},{"../core/core":21}],36:[function(t,e,r){"use strict";var i=t("../core/core");i.prototype.deviceOrientation=void 0,i.prototype.accelerationX=0,i.prototype.accelerationY=0,i.prototype.accelerationZ=0,i.prototype.pAccelerationX=0,i.prototype.pAccelerationY=0,i.prototype.pAccelerationZ=0,i.prototype._updatePAccelerations=function(){this._setProperty("pAccelerationX",this.accelerationX),this._setProperty("pAccelerationY",this.accelerationY),this._setProperty("pAccelerationZ",this.accelerationZ)},i.prototype.rotationX=0,i.prototype.rotationY=0,i.prototype.rotationZ=0,i.prototype.pRotationX=0,i.prototype.pRotationY=0,i.prototype.pRotationZ=0;var n,o,a,s=0,h=0,l=0,u="clockwise",c="clockwise",p="clockwise";i.prototype._updatePRotations=function(){this._setProperty("pRotationX",this.rotationX),this._setProperty("pRotationY",this.rotationY),this._setProperty("pRotationZ",this.rotationZ)},i.prototype.turnAxis=void 0;var d=.5,f=30;i.prototype.setMoveThreshold=function(t){i._validateParameters("setMoveThreshold",arguments),d=t},i.prototype.setShakeThreshold=function(t){i._validateParameters("setShakeThreshold",arguments),f=t},i.prototype._ondeviceorientation=function(t){this._updatePRotations(),this._setProperty("rotationX",t.beta),this._setProperty("rotationY",t.gamma),this._setProperty("rotationZ",t.alpha),this._handleMotion()},i.prototype._ondevicemotion=function(t){this._updatePAccelerations(),this._setProperty("accelerationX",2*t.acceleration.x),this._setProperty("accelerationY",2*t.acceleration.y),this._setProperty("accelerationZ",2*t.acceleration.z),this._handleMotion()},i.prototype._handleMotion=function(){90===window.orientation||-90===window.orientation?this._setProperty("deviceOrientation","landscape"):0===window.orientation?this._setProperty("deviceOrientation","portrait"):void 0===window.orientation&&this._setProperty("deviceOrientation","undefined");var t=this.deviceMoved||window.deviceMoved;"function"==typeof t&&(Math.abs(this.accelerationX-this.pAccelerationX)>d||Math.abs(this.accelerationY-this.pAccelerationY)>d||Math.abs(this.accelerationZ-this.pAccelerationZ)>d)&&t();var e=this.deviceTurned||window.deviceTurned;if("function"==typeof e){var r=this.rotationX+180,i=this.pRotationX+180,m=s+180;r-i>0&&r-i<270||r-i<-270?u="clockwise":(r-i<0||r-i>270)&&(u="counter-clockwise"),u!==n&&(m=r),Math.abs(r-m)>90&&Math.abs(r-m)<270&&(m=r,this._setProperty("turnAxis","X"),e()),n=u,s=m-180;var v=this.rotationY+180,g=this.pRotationY+180,y=h+180;v-g>0&&v-g<270||v-g<-270?c="clockwise":(v-g<0||v-this.pRotationY>270)&&(c="counter-clockwise"),c!==o&&(y=v),Math.abs(v-y)>90&&Math.abs(v-y)<270&&(y=v,this._setProperty("turnAxis","Y"),e()),o=c,h=y-180,this.rotationZ-this.pRotationZ>0&&this.rotationZ-this.pRotationZ<270||this.rotationZ-this.pRotationZ<-270?p="clockwise":(this.rotationZ-this.pRotationZ<0||this.rotationZ-this.pRotationZ>270)&&(p="counter-clockwise"),p!==a&&(l=this.rotationZ),Math.abs(this.rotationZ-l)>90&&Math.abs(this.rotationZ-l)<270&&(l=this.rotationZ,this._setProperty("turnAxis","Z"),e()),a=p,this._setProperty("turnAxis",void 0)}var b,_,x=this.deviceShaken||window.deviceShaken;"function"==typeof x&&(null!==this.pAccelerationX&&(b=Math.abs(this.accelerationX-this.pAccelerationX),_=Math.abs(this.accelerationY-this.pAccelerationY)),b+_>f&&x())},e.exports=i},{"../core/core":21}],37:[function(t,e,r){"use strict";var i=t("../core/core"),n={};i.prototype.isKeyPressed=!1,i.prototype.keyIsPressed=!1,i.prototype.key="",i.prototype.keyCode=0,i.prototype._onkeydown=function(t){if(!n[t.which]){this._setProperty("isKeyPressed",!0),this._setProperty("keyIsPressed",!0),this._setProperty("keyCode",t.which),n[t.which]=!0;var e=String.fromCharCode(t.which);e||(e=t.which),this._setProperty("key",e);var r=this.keyPressed||window.keyPressed;"function"!=typeof r||t.charCode||!1===r(t)&&t.preventDefault()}},i.prototype._onkeyup=function(t){var e=this.keyReleased||window.keyReleased;n[t.which]=!1,function(){for(var t in n)if(n.hasOwnProperty(t)&&!0===n[t])return!0;return!1}()||(this._setProperty("isKeyPressed",!1),this._setProperty("keyIsPressed",!1)),this._setProperty("_lastKeyCodeTyped",null);var r=String.fromCharCode(t.which);r||(r=t.which),this._setProperty("key",r),this._setProperty("keyCode",t.which),"function"==typeof e&&!1===e(t)&&t.preventDefault()},i.prototype._onkeypress=function(t){if(t.which!==this._lastKeyCodeTyped){this._setProperty("keyCode",t.which),this._setProperty("_lastKeyCodeTyped",t.which),this._setProperty("key",String.fromCharCode(t.which));var e=this.keyTyped||window.keyTyped;"function"==typeof e&&!1===e(t)&&t.preventDefault()}},i.prototype._onblur=function(t){n={}},i.prototype.keyIsDown=function(t){return i._validateParameters("keyIsDown",arguments),n[t]},e.exports=i},{"../core/core":21}],38:[function(t,e,r){"use strict";var i=t("../core/core"),n=t("../core/constants");i.prototype._hasMouseInteracted=!1,i.prototype.mouseX=0,i.prototype.mouseY=0,i.prototype.pmouseX=0,i.prototype.pmouseY=0,i.prototype.winMouseX=0,i.prototype.winMouseY=0,i.prototype.pwinMouseX=0,i.prototype.pwinMouseY=0,i.prototype.mouseButton=0,i.prototype.mouseIsPressed=!1,i.prototype._updateNextMouseCoords=function(t){if(null!==this._curElement&&(!t.touches||t.touches.length>0)){var e=function(t,e,r,i){i&&!i.clientX&&(i.touches?i=i.touches[0]:i.changedTouches&&(i=i.changedTouches[0]));var n=t.getBoundingClientRect(),o=t.scrollWidth/e,a=t.scrollHeight/r;return{x:(i.clientX-n.left)/o,y:(i.clientY-n.top)/a,winX:i.clientX,winY:i.clientY,id:i.identifier}}(this._curElement.elt,this.width,this.height,t);this._setProperty("mouseX",e.x),this._setProperty("mouseY",e.y),this._setProperty("winMouseX",e.winX),this._setProperty("winMouseY",e.winY)}this._hasMouseInteracted||(this._updateMouseCoords(),this._setProperty("_hasMouseInteracted",!0))},i.prototype._updateMouseCoords=function(){this._setProperty("pmouseX",this.mouseX),this._setProperty("pmouseY",this.mouseY),this._setProperty("pwinMouseX",this.winMouseX),this._setProperty("pwinMouseY",this.winMouseY)},i.prototype._setMouseButton=function(t){1===t.button?this._setProperty("mouseButton",n.CENTER):2===t.button?this._setProperty("mouseButton",n.RIGHT):this._setProperty("mouseButton",n.LEFT)},i.prototype._onmousemove=function(t){var e=this._isGlobal?window:this;this._updateNextMouseCoords(t),this.mouseIsPressed?"function"==typeof e.mouseDragged?!1===e.mouseDragged(t)&&t.preventDefault():"function"==typeof e.touchMoved&&!1===e.touchMoved(t)&&t.preventDefault():"function"==typeof e.mouseMoved&&!1===e.mouseMoved(t)&&t.preventDefault()},i.prototype._onmousedown=function(t){var e=this._isGlobal?window:this;this._setProperty("mouseIsPressed",!0),this._setMouseButton(t),this._updateNextMouseCoords(t),"function"==typeof e.mousePressed?!1===e.mousePressed(t)&&t.preventDefault():"function"==typeof e.touchStarted&&!1===e.touchStarted(t)&&t.preventDefault()},i.prototype._onmouseup=function(t){var e=this._isGlobal?window:this;this._setProperty("mouseIsPressed",!1),"function"==typeof e.mouseReleased?!1===e.mouseReleased(t)&&t.preventDefault():"function"==typeof e.touchEnded&&!1===e.touchEnded(t)&&t.preventDefault()},i.prototype._ondragend=i.prototype._onmouseup,i.prototype._ondragover=i.prototype._onmousemove,i.prototype._onclick=function(t){var e=this._isGlobal?window:this;"function"==typeof e.mouseClicked&&!1===e.mouseClicked(t)&&t.preventDefault()},i.prototype._ondblclick=function(t){var e=this._isGlobal?window:this;"function"==typeof e.doubleClicked&&!1===e.doubleClicked(t)&&t.preventDefault()},i.prototype._onwheel=function(t){var e=this._isGlobal?window:this;"function"==typeof e.mouseWheel&&(t.delta=t.deltaY,!1===e.mouseWheel(t)&&t.preventDefault())},e.exports=i},{"../core/constants":20,"../core/core":21}],39:[function(t,e,r){"use strict";function i(t,e,r,i,n){n=n||0;var o=t.getBoundingClientRect(),a=t.scrollWidth/e,s=t.scrollHeight/r,h=i.touches[n]||i.changedTouches[n];return{x:(h.clientX-o.left)/a,y:(h.clientY-o.top)/s,winX:h.clientX,winY:h.clientY,id:h.identifier}}var n=t("../core/core");n.prototype.touches=[],n.prototype._updateTouchCoords=function(t){if(null!==this._curElement){for(var e=[],r=0;r<t.touches.length;r++)e[r]=i(this._curElement.elt,this.width,this.height,t,r);this._setProperty("touches",e)}},n.prototype._ontouchstart=function(t){var e=this._isGlobal?window:this;this._setProperty("mouseIsPressed",!0),this._updateTouchCoords(t),this._updateNextMouseCoords(t),"function"==typeof e.touchStarted?!1===e.touchStarted(t)&&t.preventDefault():"function"==typeof e.mousePressed&&!1===e.mousePressed(t)&&t.preventDefault()},n.prototype._ontouchmove=function(t){var e=this._isGlobal?window:this;this._updateTouchCoords(t),this._updateNextMouseCoords(t),"function"==typeof e.touchMoved?!1===e.touchMoved(t)&&t.preventDefault():"function"==typeof e.mouseDragged&&!1===e.mouseDragged(t)&&t.preventDefault()},n.prototype._ontouchend=function(t){this._setProperty("mouseIsPressed",!1),this._updateTouchCoords(t),this._updateNextMouseCoords(t);var e=this._isGlobal?window:this;"function"==typeof e.touchEnded?!1===e.touchEnded(t)&&t.preventDefault():"function"==typeof e.mouseReleased&&!1===e.mouseReleased(t)&&t.preventDefault()},e.exports=n},{"../core/core":21}],40:[function(t,e,r){"use strict";function i(t,e){for(var r=h._toPixels(t),i=t.width,l=t.height,u=i*l,c=new Int32Array(u),p=0;p<u;p++)c[p]=h._getARGB(r,p);var d,f,m,v,g,y,b,_,x,w,S,T,E,M,R=new Int32Array(u),C=new Int32Array(u),P=new Int32Array(u),L=new Int32Array(u),A=0;for(function(t){var e=3.5*t|0;if(n!==(e=e<1?1:e<248?e:248)){o=1+(n=e)<<1,a=new Int32Array(o),s=new Array(o);for(var r=0;r<o;r++)s[r]=new Int32Array(256);for(var i,h,l,u,c=1,p=e-1;c<e;c++){a[e+c]=a[p]=h=p*p,l=s[e+c],u=s[p--];for(var d=0;d<256;d++)l[d]=u[d]=h*d}i=a[e]=e*e,l=s[e];for(var f=0;f<256;f++)l[f]=i*f}}(e),T=0;T<l;T++){for(S=0;S<i;S++){if(v=m=f=g=d=0,(y=S-n)<0)w=-y,y=0;else{if(y>=i)break;w=0}for(E=w;E<o&&!(y>=i);E++){var D=c[y+A];g+=(M=s[E])[(-16777216&D)>>>24],f+=M[(16711680&D)>>16],m+=M[(65280&D)>>8],v+=M[255&D],d+=a[E],y++}R[b=A+S]=g/d,C[b]=f/d,P[b]=m/d,L[b]=v/d}A+=i}for(A=0,x=(_=-n)*i,T=0;T<l;T++){for(S=0;S<i;S++){if(v=m=f=g=d=0,_<0)w=b=-_,y=S;else{if(_>=l)break;w=0,b=_,y=S+x}for(E=w;E<o&&!(b>=l);E++)g+=(M=s[E])[R[y]],f+=M[C[y]],m+=M[P[y]],v+=M[L[y]],d+=a[E],b++,y+=i;c[S+A]=g/d<<24|f/d<<16|m/d<<8|v/d}A+=i,x+=i,_++}h._setPixels(r,c)}var n,o,a,s,h={};h._toPixels=function(t){return t instanceof ImageData?t.data:t.getContext("2d").getImageData(0,0,t.width,t.height).data},h._getARGB=function(t,e){var r=4*e;return t[r+3]<<24&4278190080|t[r]<<16&16711680|t[r+1]<<8&65280|255&t[r+2]},h._setPixels=function(t,e){for(var r=0,i=0,n=t.length;i<n;i++)t[(r=4*i)+0]=(16711680&e[i])>>>16,t[r+1]=(65280&e[i])>>>8,t[r+2]=255&e[i],t[r+3]=(4278190080&e[i])>>>24},h._toImageData=function(t){return t instanceof ImageData?t:t.getContext("2d").getImageData(0,0,t.width,t.height)},h._createImageData=function(t,e){return h._tmpCanvas=document.createElement("canvas"),h._tmpCtx=h._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(t,e)},h.apply=function(t,e,r){var i=t.getContext("2d"),n=i.getImageData(0,0,t.width,t.height),o=e(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,t.width,t.height):i.putImageData(n,0,0,0,0,t.width,t.height)},h.threshold=function(t,e){var r=h._toPixels(t);void 0===e&&(e=.5);for(var i=Math.floor(255*e),n=0;n<r.length;n+=4){var o;o=.2126*r[n]+.7152*r[n+1]+.0722*r[n+2]>=i?255:0,r[n]=r[n+1]=r[n+2]=o}},h.gray=function(t){for(var e=h._toPixels(t),r=0;r<e.length;r+=4){var i=.2126*e[r]+.7152*e[r+1]+.0722*e[r+2];e[r]=e[r+1]=e[r+2]=i}},h.opaque=function(t){for(var e=h._toPixels(t),r=0;r<e.length;r+=4)e[r+3]=255;return e},h.invert=function(t){for(var e=h._toPixels(t),r=0;r<e.length;r+=4)e[r]=255-e[r],e[r+1]=255-e[r+1],e[r+2]=255-e[r+2]},h.posterize=function(t,e){var r=h._toPixels(t);if(e<2||e>255)throw new Error("Level must be greater than 2 and less than 255 for posterize");for(var i=e-1,n=0;n<r.length;n+=4){var o=r[n],a=r[n+1],s=r[n+2];r[n]=255*(o*e>>8)/i,r[n+1]=255*(a*e>>8)/i,r[n+2]=255*(s*e>>8)/i}},h.dilate=function(t){for(var e,r,i,n,o,a,s,l,u,c,p,d,f,m,v,g,y,b=h._toPixels(t),_=0,x=b.length?b.length/4:0,w=new Int32Array(x);_<x;)for(e=_,r=_+t.width;_<r;)i=n=h._getARGB(b,_),s=_-1,a=_+1,l=_-t.width,u=_+t.width,s<e&&(s=_),a>=r&&(a=_),l<0&&(l=0),u>=x&&(u=_),d=h._getARGB(b,l),p=h._getARGB(b,s),f=h._getARGB(b,u),m=77*((c=h._getARGB(b,a))>>16&255)+151*(c>>8&255)+28*(255&c),g=77*(d>>16&255)+151*(d>>8&255)+28*(255&d),y=77*(f>>16&255)+151*(f>>8&255)+28*(255&f),(v=77*(p>>16&255)+151*(p>>8&255)+28*(255&p))>(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=p,o=v),m>o&&(n=c,o=m),g>o&&(n=d,o=g),y>o&&(n=f,o=y),w[_++]=n;h._setPixels(b,w)},h.erode=function(t){for(var e,r,i,n,o,a,s,l,u,c,p,d,f,m,v,g,y,b=h._toPixels(t),_=0,x=b.length?b.length/4:0,w=new Int32Array(x);_<x;)for(e=_,r=_+t.width;_<r;)i=n=h._getARGB(b,_),s=_-1,a=_+1,l=_-t.width,u=_+t.width,s<e&&(s=_),a>=r&&(a=_),l<0&&(l=0),u>=x&&(u=_),d=h._getARGB(b,l),p=h._getARGB(b,s),f=h._getARGB(b,u),m=77*((c=h._getARGB(b,a))>>16&255)+151*(c>>8&255)+28*(255&c),g=77*(d>>16&255)+151*(d>>8&255)+28*(255&d),y=77*(f>>16&255)+151*(f>>8&255)+28*(255&f),(v=77*(p>>16&255)+151*(p>>8&255)+28*(255&p))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=p,o=v),m<o&&(n=c,o=m),g<o&&(n=d,o=g),y<o&&(n=f,o=y),w[_++]=n;h._setPixels(b,w)},h.blur=function(t,e){i(t,e)},e.exports=h},{}],41:[function(t,e,r){"use strict";var i=t("../core/core"),n=[];i.prototype.createImage=function(t,e){return i._validateParameters("createImage",arguments),new i.Image(t,e)},i.prototype.saveCanvas=function(){i._validateParameters("saveCanvas",arguments);var t,e,r,n,o=[].slice.call(arguments);switch(arguments[0]instanceof HTMLCanvasElement?(t=arguments[0],o.shift()):arguments[0]instanceof i.Element?(t=arguments[0].elt,o.shift()):t=this._curElement&&this._curElement.elt,o.length>=1&&(e=o[0]),o.length>=2&&(r=o[1]),r=r||i.prototype._checkFileExtension(e,r)[1]||"png"){default:n="image/png";break;case"jpeg":case"jpg":n="image/jpeg"}t.toBlob(function(t){i.prototype.downloadFile(t,e,r)},n)},i.prototype.saveFrames=function(t,e,r,o,a){i._validateParameters("saveFrames",arguments);var s=r||3;s=i.prototype.constrain(s,0,15),s*=1e3;var h=o||15;h=i.prototype.constrain(h,0,22);var l=0,u=i.prototype._makeFrame,c=this._curElement.elt,p=setInterval(function(){u(t+l,e,c),l++},1e3/h);setTimeout(function(){if(clearInterval(p),a)a(n);else for(var t=0;t<n.length;t++){var e=n[t];i.prototype.downloadFile(e.imageData,e.filename,e.ext)}n=[]},s+.01)},i.prototype._makeFrame=function(t,e,r){var i,o;if(i=this?this._curElement.elt:r,e)switch(e.toLowerCase()){case"png":o="image/png";break;case"jpeg":case"jpg":o="image/jpeg";break;default:o="image/png"}else e="png",o="image/png";var a=i.toDataURL(o);a=a.replace(o,"image/octet-stream");var s={};s.imageData=a,s.filename=t,s.ext=e,n.push(s)},e.exports=i},{"../core/core":21}],42:[function(t,e,r){"use strict";function i(t,e){return t>0&&t<e?t:e}var n=t("../core/core"),o=t("./filters"),a=t("../core/canvas"),s=t("../core/constants");t("../core/error_helpers"),n.prototype.loadImage=function(t,e,r){n._validateParameters("loadImage",arguments);var i=new Image,o=new n.Image(1,1,this),a=this;return i.onload=function(){o.width=o.canvas.width=i.width,o.height=o.canvas.height=i.height,o.drawingContext.drawImage(i,0,0),o.modified=!0,"function"==typeof e&&e(o),a._decrementPreload()},i.onerror=function(t){n._friendlyFileLoadError(0,i.src),"function"==typeof r&&r(t)},0!==t.indexOf("data:image/")&&(i.crossOrigin="Anonymous"),i.src=t,o},n.prototype.image=function(t,e,r,o,s,h,l,u,c){n._validateParameters("image",arguments);var p=t.width,d=t.height;t.elt&&t.elt.videoWidth&&!t.canvas&&(p=t.elt.videoWidth,d=t.elt.videoHeight);var f=e,m=r,v=o||p,g=s||d,y=h||0,b=l||0,_=u||p,x=c||d;_=i(_,p),x=i(x,d);var w=1;t.elt&&!t.canvas&&t.elt.style.width&&(w=t.elt.videoWidth&&!o?t.elt.videoWidth:t.elt.width,w/=parseInt(t.elt.style.width,10)),y*=w,b*=w,x*=w,_*=w;var S=a.modeAdjust(f,m,v,g,this._renderer._imageMode);this._renderer.image(t,y,b,_,x,S.x,S.y,S.w,S.h)},n.prototype.tint=function(){n._validateParameters("tint",arguments);var t=this.color.apply(this,arguments);this._renderer._tint=t.levels},n.prototype.noTint=function(){this._renderer._tint=null},n.prototype._getTintedImageCanvas=function(t){if(!t.canvas)return t;var e=o._toPixels(t.canvas),r=document.createElement("canvas");r.width=t.canvas.width,r.height=t.canvas.height;for(var i=r.getContext("2d"),n=i.createImageData(t.canvas.width,t.canvas.height),a=n.data,s=0;s<e.length;s+=4){var h=e[s],l=e[s+1],u=e[s+2],c=e[s+3];a[s]=h*this._renderer._tint[0]/255,a[s+1]=l*this._renderer._tint[1]/255,a[s+2]=u*this._renderer._tint[2]/255,a[s+3]=c*this._renderer._tint[3]/255}return i.putImageData(n,0,0),r},n.prototype.imageMode=function(t){n._validateParameters("imageMode",arguments),t!==s.CORNER&&t!==s.CORNERS&&t!==s.CENTER||(this._renderer._imageMode=t)},e.exports=n},{"../core/canvas":19,"../core/constants":20,"../core/core":21,"../core/error_helpers":24,"./filters":40}],43:[function(t,e,r){"use strict";var i=t("../core/core"),n=t("./filters");i.Image=function(t,e){this.width=t,this.height=e,this.canvas=document.createElement("canvas"),this.canvas.width=this.width,this.canvas.height=this.height,this.drawingContext=this.canvas.getContext("2d"),this._pixelDensity=1,this._modified=!1,this.pixels=[]},i.Image.prototype._setProperty=function(t,e){this[t]=e,this.setModified(!0)},i.Image.prototype.loadPixels=function(){i.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},i.Image.prototype.updatePixels=function(t,e,r,n){i.Renderer2D.prototype.updatePixels.call(this,t,e,r,n),this.setModified(!0)},i.Image.prototype.get=function(t,e,r,n){return i.Renderer2D.prototype.get.call(this,t,e,r,n)},i.Image.prototype.set=function(t,e,r){i.Renderer2D.prototype.set.call(this,t,e,r),this.setModified(!0)},i.Image.prototype.resize=function(t,e){0===t&&0===e?(t=this.canvas.width,e=this.canvas.height):0===t?t=this.canvas.width*e/this.canvas.height:0===e&&(e=this.canvas.height*t/this.canvas.width),t=Math.floor(t),e=Math.floor(e);var r=document.createElement("canvas");r.width=t,r.height=e,r.getContext("2d").drawImage(this.canvas,0,0,this.canvas.width,this.canvas.height,0,0,r.width,r.height),this.canvas.width=this.width=t,this.canvas.height=this.height=e,this.drawingContext.drawImage(r,0,0,t,e,0,0,t,e),this.pixels.length>0&&this.loadPixels(),this.setModified(!0)},i.Image.prototype.copy=function(){var t,e,r,n,o,a,s,h,l;if(9===arguments.length)t=arguments[0],e=arguments[1],r=arguments[2],n=arguments[3],o=arguments[4],a=arguments[5],s=arguments[6],h=arguments[7],l=arguments[8];else{if(8!==arguments.length)throw new Error("Signature not supported");t=this,e=arguments[0],r=arguments[1],n=arguments[2],o=arguments[3],a=arguments[4],s=arguments[5],h=arguments[6],l=arguments[7]}i.Renderer2D._copyHelper(this,t,e,r,n,o,a,s,h,l)},i.Image.prototype.mask=function(t){void 0===t&&(t=this);var e=this.drawingContext.globalCompositeOperation,r=1;t instanceof i.Renderer&&(r=t._pInst._pixelDensity);var n=[t,0,0,r*t.width,r*t.height,0,0,this.width,this.height];this.drawingContext.globalCompositeOperation="destination-in",i.Image.prototype.copy.apply(this,n),this.drawingContext.globalCompositeOperation=e,this.setModified(!0)},i.Image.prototype.filter=function(t,e){n.apply(this.canvas,n[t.toLowerCase()],e),this.setModified(!0)},i.Image.prototype.blend=function(){i.prototype.blend.apply(this,arguments),this.setModified(!0)},i.Image.prototype.setModified=function(t){this._modified=t},i.Image.prototype.isModified=function(){return this._modified},i.Image.prototype.save=function(t,e){i.prototype.saveCanvas(this.canvas,t,e)},e.exports=i.Image},{"../core/core":21,"./filters":40}],44:[function(t,e,r){"use strict";var i=t("../core/core"),n=t("./filters");t("../color/p5.Color"),i.prototype.pixels=[],i.prototype.blend=function(){i._validateParameters("blend",arguments),this._renderer?this._renderer.blend.apply(this._renderer,arguments):i.Renderer2D.prototype.blend.apply(this,arguments)},i.prototype.copy=function(){i._validateParameters("copy",arguments),i.Renderer2D.prototype.copy.apply(this._renderer,arguments)},i.prototype.filter=function(t,e){i._validateParameters("filter",arguments),void 0!==this.canvas?n.apply(this.canvas,n[t.toLowerCase()],e):n.apply(this.elt,n[t.toLowerCase()],e)},i.prototype.get=function(t,e,r,i){return this._renderer.get(t,e,r,i)},i.prototype.loadPixels=function(){i._validateParameters("loadPixels",arguments),this._renderer.loadPixels()},i.prototype.set=function(t,e,r){this._renderer.set(t,e,r)},i.prototype.updatePixels=function(t,e,r,n){i._validateParameters("updatePixels",arguments),0!==this.pixels.length&&this._renderer.updatePixels(t,e,r,n)},e.exports=i},{"../color/p5.Color":15,"../core/core":21,"./filters":40}],45:[function(t,e,r){"use strict";function i(t,e){var r={};if(void 0===(e=e||[]))for(var i=0;i<t.length;i++)e[i.toString()]=i;for(var n=0;n<e.length;n++){var o=e[n],a=t[n];r[o]=a}return r}function n(t){var e=new s.XML,r=t.childNodes;if(r&&r.length){for(var i=0;i<r.length;i++){var o=n(r[i]);e.addChild(o)}e.setName(t.nodeName),e._setCont(t.textContent),e._setAttributes(t);for(var a=0;a<e.children.length;a++)e.children[a].parent=e;return e}return e.setName(t.nodeName),e._setCont(t.textContent),e._setAttributes(t),e}function o(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function a(t,e){e&&!0!==e&&"true"!==e||(e=""),t||(t="untitled");var r="";return t&&t.indexOf(".")>-1&&(r=t.split(".").pop()),e&&r!==e&&(t=t+"."+(r=e)),[t,r]}var s=t("../core/core");t("whatwg-fetch"),t("es6-promise").polyfill();var h=t("fetch-jsonp");t("../core/error_helpers"),s.prototype.loadJSON=function(){s._validateParameters("loadJSON",arguments);for(var t,e,r,i=arguments[0],n={},o="json",a=1;a<arguments.length;a++){var h=arguments[a];"string"==typeof h?"jsonp"!==h&&"json"!==h||(o=h):"function"==typeof h?t?e=h:t=h:"object"==typeof h&&h.hasOwnProperty("jsonpCallback")&&(o="jsonp",r=h)}var l=this;return this.httpDo(i,"GET",r,o,function(e){for(var r in e)n[r]=e[r];void 0!==t&&t(e),l._decrementPreload()},e),n},s.prototype.loadStrings=function(){s._validateParameters("loadStrings",arguments);for(var t,e,r=[],i=1;i<arguments.length;i++){var n=arguments[i];"function"==typeof n&&(void 0===t?t=n:void 0===e&&(e=n))}var o=this;return s.prototype.httpDo.call(this,arguments[0],"GET","text",function(e){var i=e.match(/[^\r\n]+/g);for(var n in i)r[n]=i[n];void 0!==t&&t(r),o._decrementPreload()},e),r},s.prototype.loadTable=function(t){var e,r,n=[],o=!1,a=",",h=!1;"tsv"===t.substring(t.lastIndexOf(".")+1,t.length)&&(a="\t");for(var l=1;l<arguments.length;l++)if("function"==typeof arguments[l])void 0===e?e=arguments[l]:void 0===r&&(r=arguments[l]);else if("string"==typeof arguments[l])if(n.push(arguments[l]),"header"===arguments[l]&&(o=!0),"csv"===arguments[l]){if(h)throw new Error("Cannot set multiple separator types.");a=",",h=!0}else if("tsv"===arguments[l]){if(h)throw new Error("Cannot set multiple separator types.");a="\t",h=!0}var u=new s.Table,c=this;return this.httpDo(t,"GET","text",function(t){for(var r,n={},h='"',p=[],d=0,f=null,m=function(){n.currentState=0,n.token=""},v=function(){f.push(n.token),m()},g=function(){n.currentState=4,p.push(f),f=null};;){if(null==(r=t[d++])){if(n.escaped)throw new Error("Unclosed quote in file.");if(f){v(),g();break}}if(null===f&&(n.escaped=!1,f=[],m()),0===n.currentState){if(r===h){n.escaped=!0,n.currentState=1;continue}n.currentState=1}if(1===n.currentState&&n.escaped)if(r===h)t[d]===h?(n.token+=h,d++):(n.escaped=!1,n.currentState=2);else{if("\r"===r)continue;n.token+=r}else"\r"===r?("\n"===t[d]&&d++,v(),g()):"\n"===r?(v(),g()):r===a?v():1===n.currentState&&(n.token+=r)}if(o)u.columns=p.shift();else for(l=0;l<p[0].length;l++)u.columns[l]="null";var y;for(l=0;l<p.length;l++)(1!==p[l].length||"undefined"!==p[l][0]&&""!==p[l][0])&&((y=new s.TableRow).arr=p[l],y.obj=i(p[l],u.columns),u.addRow(y));"function"==typeof e&&e(u),c._decrementPreload()},function(e){if(s._friendlyFileLoadError(2,t),!r)throw e;r(e)}),u},s.prototype.loadXML=function(){for(var t,e,r={},i=1;i<arguments.length;i++){var n=arguments[i];"function"==typeof n&&(void 0===t?t=n:void 0===e&&(e=n))}var o=this;return this.httpDo(arguments[0],"GET","xml",function(e){for(var i in e)r[i]=e[i];void 0!==t&&t(r),o._decrementPreload()},e),r},s.prototype.loadBytes=function(t,e,r){var i={},n=this;return this.httpDo(t,"GET","arrayBuffer",function(t){i.bytes=new Uint8Array(t),"function"==typeof e&&e(i),n._decrementPreload()},r),i},s.prototype.httpGet=function(){s._validateParameters("httpGet",arguments);var t=Array.prototype.slice.call(arguments);t.splice(1,0,"GET"),s.prototype.httpDo.apply(this,t)},s.prototype.httpPost=function(){s._validateParameters("httpPost",arguments);var t=Array.prototype.slice.call(arguments);t.splice(1,0,"POST"),s.prototype.httpDo.apply(this,t)},s.prototype.httpDo=function(){for(var t,e,r,i,o={},a=0,s="text/plain",l=arguments.length-1;l>0&&"function"==typeof arguments[l];l--)a++;var u=arguments.length-a,c=arguments[0];if(2===u&&"string"==typeof c&&"object"==typeof arguments[1])i=new Request(c,arguments[1]),e=arguments[2],r=arguments[3];else{for(var p,d="GET",f=1;f<arguments.length;f++){var m=arguments[f];if("string"==typeof m)"GET"===m||"POST"===m||"PUT"===m||"DELETE"===m?d=m:"json"===m||"jsonp"===m||"binary"===m||"arrayBuffer"===m||"xml"===m||"text"===m?t=m:p=m;else if("number"==typeof m)p=m.toString();else if("object"==typeof m)if(m.hasOwnProperty("jsonpCallback"))for(var v in m)o[v]=m[v];else p=JSON.stringify(m),s="application/json";else"function"==typeof m&&(e?r=m:e=m)}i=new Request(c,{method:d,mode:"cors",body:p,headers:new Headers({"Content-Type":s})})}t||(t=-1!==c.indexOf("json")?"json":-1!==c.indexOf("xml")?"xml":"text"),("jsonp"===t?h(c,o):fetch(i)).then(function(e){if(!e.ok)throw e;switch(t){case"json":return e.json();case"binary":return e.blob();case"arrayBuffer":return e.arrayBuffer();case"xml":return e.text().then(function(t){return n((new DOMParser).parseFromString(t,"text/xml").documentElement)});default:return e.text()}}).then(e||function(){}).catch(r||console.error)},window.URL=window.URL||window.webkitURL,s.prototype._pWriters=[],s.prototype.createWriter=function(t,e){var r;for(var i in s.prototype._pWriters)if(s.prototype._pWriters[i].name===t)return r=new s.PrintWriter(t+this.millis(),e),s.prototype._pWriters.push(r),r;return r=new s.PrintWriter(t,e),s.prototype._pWriters.push(r),r},s.PrintWriter=function(t,e){var r=this;this.name=t,this.content="",this.write=function(t){this.content+=t},this.print=function(t){this.content+=t+"\n"},this.clear=function(){this.content=""},this.close=function(){var i=[];for(var n in i.push(this.content),s.prototype.writeFile(i,t,e),s.prototype._pWriters)s.prototype._pWriters[n].name===this.name&&s.prototype._pWriters.splice(n,1);r.clear(),r={}}},s.prototype.save=function(t,e,r){var i=arguments,n=this._curElement.elt;if(0!==i.length)if(i[0]instanceof s.Renderer||i[0]instanceof s.Graphics)s.prototype.saveCanvas(i[0].elt,i[1],i[2]);else if(1===i.length&&"string"==typeof i[0])s.prototype.saveCanvas(n,i[0]);else switch(a(i[1],i[2])[1]){case"json":return void s.prototype.saveJSON(i[0],i[1],i[2]);case"txt":return void s.prototype.saveStrings(i[0],i[1],i[2]);default:i[0]instanceof Array?s.prototype.saveStrings(i[0],i[1],i[2]):i[0]instanceof s.Table?s.prototype.saveTable(i[0],i[1],i[2]):i[0]instanceof s.Image?s.prototype.saveCanvas(i[0].canvas,i[1]):i[0]instanceof s.SoundFile&&s.prototype.saveSound(i[0],i[1],i[2],i[3])}else s.prototype.saveCanvas(n)},s.prototype.saveJSON=function(t,e,r){var i;s._validateParameters("saveJSON",arguments),i=r?JSON.stringify(t):JSON.stringify(t,void 0,2),this.saveStrings(i.split("\n"),e,"json")},s.prototype.saveJSONObject=s.prototype.saveJSON,s.prototype.saveJSONArray=s.prototype.saveJSON,s.prototype.saveStrings=function(t,e,r){s._validateParameters("saveStrings",arguments);for(var i=r||"txt",n=this.createWriter(e,i),o=0;o<t.length;o++)t.length,n.print(t[o]);n.close(),n.clear()},s.prototype.saveTable=function(t,e,r){var i;s._validateParameters("saveTable",arguments),i=void 0===r?e.substring(e.lastIndexOf(".")+1,e.length):r;var n=this.createWriter(e,i),a=t.columns,h=",";if("tsv"===i&&(h="\t"),"html"!==i){if("0"!==a[0]){for(var l=0;l<a.length;l++)l<a.length-1?n.write(a[l]+h):n.write(a[l]);n.write("\n")}for(var u=0;u<t.rows.length;u++){var c;for(c=0;c<t.rows[u].arr.length;c++)c<t.rows[u].arr.length-1?n.write(t.rows[u].arr[c]+h):(t.rows.length,n.write(t.rows[u].arr[c]));n.write("\n")}}else{n.print("<html>"),n.print("<head>");var p=' <meta http-equiv="content-type" content';if(p+='="text/html;charset=utf-8" />',n.print(p),n.print("</head>"),n.print("<body>"),n.print(" <table>"),"0"!==a[0]){n.print(" <tr>");for(var d=0;d<a.length;d++){var f=o(a[d]);n.print(" <td>"+f),n.print(" </td>")}n.print(" </tr>")}for(var m=0;m<t.rows.length;m++){n.print(" <tr>");for(var v=0;v<t.columns.length;v++){var g=o(t.rows[m].getString(v));n.print(" <td>"+g),n.print(" </td>")}n.print(" </tr>")}n.print(" </table>"),n.print("</body>"),n.print("</html>")}n.close(),n.clear()},s.prototype.writeFile=function(t,e,r){var i="application/octet-stream";s.prototype._isSafari()&&(i="text/plain");var n=new Blob(t,{type:i});s.prototype.downloadFile(n,e,r)},s.prototype.downloadFile=function(e,r,i){var n=a(r,i),o=n[0];if(e instanceof Blob)t("file-saver").saveAs(e,o);else{var h=document.createElement("a");if(h.href=e,h.download=o,h.onclick=function(t){(function(t){document.body.removeChild(t.target)})(t),t.stopPropagation()},h.style.display="none",document.body.appendChild(h),s.prototype._isSafari()){var l="Hello, Safari user! To download this file...\n";l+="1. Go to File --\x3e Save As.\n",l+='2. Choose "Page Source" as the Format.\n',l+='3. Name it with this extension: ."'+n[1]+'"',alert(l)}h.click()}},s.prototype._checkFileExtension=a,s.prototype._isSafari=function(){return Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0},e.exports=s},{"../core/core":21,"../core/error_helpers":24,"es6-promise":4,"fetch-jsonp":5,"file-saver":6,"whatwg-fetch":11}],46:[function(t,e,r){"use strict";var i=t("../core/core");i.Table=function(t){this.columns=[],this.rows=[]},i.Table.prototype.addRow=function(t){var e=t||new i.TableRow;if(void 0===e.arr||void 0===e.obj)throw"invalid TableRow: "+e;return e.table=this,this.rows.push(e),e},i.Table.prototype.removeRow=function(t){this.rows[t].table=null;var e=this.rows.splice(t+1,this.rows.length);this.rows.pop(),this.rows=this.rows.concat(e)},i.Table.prototype.getRow=function(t){return this.rows[t]},i.Table.prototype.getRows=function(){return this.rows},i.Table.prototype.findRow=function(t,e){if("string"==typeof e){for(var r=0;r<this.rows.length;r++)if(this.rows[r].obj[e]===t)return this.rows[r]}else for(var i=0;i<this.rows.length;i++)if(this.rows[i].arr[e]===t)return this.rows[i];return null},i.Table.prototype.findRows=function(t,e){var r=[];if("string"==typeof e)for(var i=0;i<this.rows.length;i++)this.rows[i].obj[e]===t&&r.push(this.rows[i]);else for(var n=0;n<this.rows.length;n++)this.rows[n].arr[e]===t&&r.push(this.rows[n]);return r},i.Table.prototype.matchRow=function(t,e){if("number"==typeof e){for(var r=0;r<this.rows.length;r++)if(this.rows[r].arr[e].match(t))return this.rows[r]}else for(var i=0;i<this.rows.length;i++)if(this.rows[i].obj[e].match(t))return this.rows[i];return null},i.Table.prototype.matchRows=function(t,e){var r=[];if("number"==typeof e)for(var i=0;i<this.rows.length;i++)this.rows[i].arr[e].match(t)&&r.push(this.rows[i]);else for(var n=0;n<this.rows.length;n++)this.rows[n].obj[e].match(t)&&r.push(this.rows[n]);return r},i.Table.prototype.getColumn=function(t){var e=[];if("string"==typeof t)for(var r=0;r<this.rows.length;r++)e.push(this.rows[r].obj[t]);else for(var i=0;i<this.rows.length;i++)e.push(this.rows[i].arr[t]);return e},i.Table.prototype.clearRows=function(){delete this.rows,this.rows=[]},i.Table.prototype.addColumn=function(t){var e=t||null;this.columns.push(e)},i.Table.prototype.getColumnCount=function(){return this.columns.length},i.Table.prototype.getRowCount=function(){return this.rows.length},i.Table.prototype.removeTokens=function(t,e){for(var r=function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},i=[],n=0;n<t.length;n++)i.push(r(t.charAt(n)));var o=new RegExp(i.join("|"),"g");if(void 0===e)for(var a=0;a<this.columns.length;a++)for(var s=0;s<this.rows.length;s++){var h=this.rows[s].arr[a];h=h.replace(o,""),this.rows[s].arr[a]=h,this.rows[s].obj[this.columns[a]]=h}else if("string"==typeof e)for(var l=0;l<this.rows.length;l++){var u=this.rows[l].obj[e];u=u.replace(o,""),this.rows[l].obj[e]=u;var c=this.columns.indexOf(e);this.rows[l].arr[c]=u}else for(var p=0;p<this.rows.length;p++){var d=this.rows[p].arr[e];d=d.replace(o,""),this.rows[p].arr[e]=d,this.rows[p].obj[this.columns[e]]=d}},i.Table.prototype.trim=function(t){var e=new RegExp(" ","g");if(void 0===t)for(var r=0;r<this.columns.length;r++)for(var i=0;i<this.rows.length;i++){var n=this.rows[i].arr[r];n=n.replace(e,""),this.rows[i].arr[r]=n,this.rows[i].obj[this.columns[r]]=n}else if("string"==typeof t)for(var o=0;o<this.rows.length;o++){var a=this.rows[o].obj[t];a=a.replace(e,""),this.rows[o].obj[t]=a;var s=this.columns.indexOf(t);this.rows[o].arr[s]=a}else for(var h=0;h<this.rows.length;h++){var l=this.rows[h].arr[t];l=l.replace(e,""),this.rows[h].arr[t]=l,this.rows[h].obj[this.columns[t]]=l}},i.Table.prototype.removeColumn=function(t){var e,r;"string"==typeof t?(e=t,r=this.columns.indexOf(t),console.log("string")):(r=t,e=this.columns[t]);var i=this.columns.splice(r+1,this.columns.length);this.columns.pop(),this.columns=this.columns.concat(i);for(var n=0;n<this.rows.length;n++){var o=this.rows[n].arr,a=o.splice(r+1,o.length);o.pop(),this.rows[n].arr=o.concat(a),delete this.rows[n].obj[e]}},i.Table.prototype.set=function(t,e,r){this.rows[t].set(e,r)},i.Table.prototype.setNum=function(t,e,r){this.rows[t].setNum(e,r)},i.Table.prototype.setString=function(t,e,r){this.rows[t].setString(e,r)},i.Table.prototype.get=function(t,e){return this.rows[t].get(e)},i.Table.prototype.getNum=function(t,e){return this.rows[t].getNum(e)},i.Table.prototype.getString=function(t,e){return this.rows[t].getString(e)},i.Table.prototype.getObject=function(t){for(var e,r={},i=0;i<this.rows.length;i++)if(e=this.rows[i].obj,"string"==typeof t){if(!(this.columns.indexOf(t)>=0))throw'This table has no column named "'+t+'"';r[e[t]]=e}else r[i]=this.rows[i].obj;return r},i.Table.prototype.getArray=function(){for(var t=[],e=0;e<this.rows.length;e++)t.push(this.rows[e].arr);return t},e.exports=i},{"../core/core":21}],47:[function(t,e,r){"use strict";var i=t("../core/core");i.TableRow=function(t,e){var r=[],i={};t&&(e=e||",",r=t.split(e));for(var n=0;n<r.length;n++){var o=n,a=r[n];i[o]=a}this.arr=r,this.obj=i,this.table=null},i.TableRow.prototype.set=function(t,e){if("string"==typeof t){var r=this.table.columns.indexOf(t);if(!(r>=0))throw'This table has no column named "'+t+'"';this.obj[t]=e,this.arr[r]=e}else{if(!(t<this.table.columns.length))throw"Column #"+t+" is out of the range of this table";this.arr[t]=e;var i=this.table.columns[t];this.obj[i]=e}},i.TableRow.prototype.setNum=function(t,e){var r=parseFloat(e);this.set(t,r)},i.TableRow.prototype.setString=function(t,e){var r=e.toString();this.set(t,r)},i.TableRow.prototype.get=function(t){return"string"==typeof t?this.obj[t]:this.arr[t]},i.TableRow.prototype.getNum=function(t){var e;if("NaN"===(e="string"==typeof t?parseFloat(this.obj[t]):parseFloat(this.arr[t])).toString())throw"Error: "+this.obj[t]+" is NaN (Not a Number)";return e},i.TableRow.prototype.getString=function(t){return"string"==typeof t?this.obj[t].toString():this.arr[t].toString()},e.exports=i},{"../core/core":21}],48:[function(t,e,r){"use strict";var i=t("../core/core");i.XML=function(){this.name=null,this.attributes={},this.children=[],this.parent=null,this.content=null},i.XML.prototype.getParent=function(){return this.parent},i.XML.prototype.getName=function(){return this.name},i.XML.prototype.setName=function(t){this.name=t},i.XML.prototype.hasChildren=function(){return this.children.length>0},i.XML.prototype.listChildren=function(){return this.children.map(function(t){return t.name})},i.XML.prototype.getChildren=function(t){return t?this.children.filter(function(e){return e.name===t}):this.children},i.XML.prototype.getChild=function(t){if("string"!=typeof t)return this.children[t];for(var e=0;e<this.children.length;e++){var r=this.children[e];if(r.name===t)return r}},i.XML.prototype.addChild=function(t){t instanceof i.XML&&this.children.push(t)},i.XML.prototype.removeChild=function(t){var e=-1;if("string"==typeof t){for(var r=0;r<this.children.length;r++)if(this.children[r].name===t){e=r;break}}else e=t;-1!==e&&this.children.splice(e,1)},i.XML.prototype.getAttributeCount=function(){return Object.keys(this.attributes).length},i.XML.prototype.listAttributes=function(){return Object.keys(this.attributes)},i.XML.prototype.hasAttribute=function(t){return!!this.attributes[t]},i.XML.prototype.getNum=function(t,e){return Number(this.attributes[t])||e||0},i.XML.prototype.getString=function(t,e){return String(this.attributes[t])||e||null},i.XML.prototype.setAttribute=function(t,e){this.attributes[t]&&(this.attributes[t]=e)},i.XML.prototype.getContent=function(t){return this.content||t||null},i.XML.prototype.setContent=function(t){this.children.length||(this.content=t)},i.XML.prototype._setCont=function(t){var e;e=(e=t).replace(/\s\s+/g,","),this.content=e},i.XML.prototype._setAttributes=function(t){var e={},r=t.attributes;if(r)for(var i=0;i<r.length;i++){var n=r[i];e[n.nodeName]=n.nodeValue}this.attributes=e},e.exports=i},{"../core/core":21}],49:[function(t,e,r){"use strict";function i(t,e,r){if("function"==typeof Math.hypot)return Math.hypot.apply(null,arguments);for(var i=arguments.length,n=[],o=0,a=0;a<i;a++){var s=arguments[a];if((s=+s)==1/0||s===-1/0)return 1/0;(s=Math.abs(s))>o&&(o=s),n[a]=s}0===o&&(o=1);for(var h=0,l=0,u=0;u<i;u++){var c=n[u]/o,p=c*c-l,d=h+p;l=d-h-p,h=d}return Math.sqrt(h)*o}var n=t("../core/core");n.prototype.abs=Math.abs,n.prototype.ceil=Math.ceil,n.prototype.constrain=function(t,e,r){return n._validateParameters("constrain",arguments),Math.max(Math.min(t,r),e)},n.prototype.dist=function(){return n._validateParameters("dist",arguments),4===arguments.length?i(arguments[2]-arguments[0],arguments[3]-arguments[1]):6===arguments.length?i(arguments[3]-arguments[0],arguments[4]-arguments[1],arguments[5]-arguments[2]):void 0},n.prototype.exp=Math.exp,n.prototype.floor=Math.floor,n.prototype.lerp=function(t,e,r){return n._validateParameters("lerp",arguments),r*(e-t)+t},n.prototype.log=Math.log,n.prototype.mag=function(t,e){return n._validateParameters("mag",arguments),i(t,e)},n.prototype.map=function(t,e,r,i,o,a){n._validateParameters("map",arguments);var s=(t-e)/(r-e)*(o-i)+i;return a?i<o?this.constrain(s,i,o):this.constrain(s,o,i):s},n.prototype.max=function(){return n._validateParameters("max",arguments),arguments[0]instanceof Array?Math.max.apply(null,arguments[0]):Math.max.apply(null,arguments)},n.prototype.min=function(){return n._validateParameters("min",arguments),arguments[0]instanceof Array?Math.min.apply(null,arguments[0]):Math.min.apply(null,arguments)},n.prototype.norm=function(t,e,r){return n._validateParameters("norm",arguments),this.map(t,e,r,0,1)},n.prototype.pow=Math.pow,n.prototype.round=Math.round,n.prototype.sq=function(t){return t*t},n.prototype.sqrt=Math.sqrt,e.exports=n},{"../core/core":21}],50:[function(t,e,r){"use strict";var i=t("../core/core");i.prototype.createVector=function(t,e,r){return this instanceof i?new i.Vector(this,arguments):new i.Vector(t,e,r)},e.exports=i},{"../core/core":21}],51:[function(t,e,r){"use strict";var i,n=t("../core/core"),o=4095,a=4,s=.5,h=function(t){return.5*(1-Math.cos(t*Math.PI))};n.prototype.noise=function(t,e,r){if(e=e||0,r=r||0,null==i){i=new Array(o+1);for(var n=0;n<o+1;n++)i[n]=Math.random()}t<0&&(t=-t),e<0&&(e=-e),r<0&&(r=-r);for(var l,u,c,p,d,f=Math.floor(t),m=Math.floor(e),v=Math.floor(r),g=t-f,y=e-m,b=r-v,_=0,x=.5,w=0;w<a;w++){var S=f+(m<<4)+(v<<8);l=h(g),u=h(y),c=i[S&o],c+=l*(i[S+1&o]-c),p=i[S+16&o],c+=u*((p+=l*(i[S+16+1&o]-p))-c),p=i[(S+=256)&o],p+=l*(i[S+1&o]-p),d=i[S+16&o],p+=u*((d+=l*(i[S+16+1&o]-d))-p),_+=(c+=h(b)*(p-c))*x,x*=s,f<<=1,m<<=1,y*=2,v<<=1,b*=2,(g*=2)>=1&&(f++,g--),y>=1&&(m++,y--),b>=1&&(v++,b--)}return _},n.prototype.noiseDetail=function(t,e){t>0&&(a=t),e>0&&(s=e)},n.prototype.noiseSeed=function(t){var e=function(){var t,e,r=4294967296;return{setSeed:function(i){e=t=(null==i?Math.random()*r:i)>>>0},getSeed:function(){return t},rand:function(){return(e=(1664525*e+1013904223)%r)/r}}}();e.setSeed(t),i=new Array(o+1);for(var r=0;r<o+1;r++)i[r]=e.rand()},e.exports=n},{"../core/core":21}],52:[function(t,e,r){"use strict";var i=t("../core/core"),n=t("../core/constants");i.Vector=function(){var t,e,r;arguments[0]instanceof i?(this.p5=arguments[0],t=arguments[1][0]||0,e=arguments[1][1]||0,r=arguments[1][2]||0):(t=arguments[0]||0,e=arguments[1]||0,r=arguments[2]||0),this.x=t,this.y=e,this.z=r},i.Vector.prototype.toString=function(){return"p5.Vector Object : ["+this.x+", "+this.y+", "+this.z+"]"},i.Vector.prototype.set=function(t,e,r){return t instanceof i.Vector?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this):t instanceof Array?(this.x=t[0]||0,this.y=t[1]||0,this.z=t[2]||0,this):(this.x=t||0,this.y=e||0,this.z=r||0,this)},i.Vector.prototype.copy=function(){return this.p5?new i.Vector(this.p5,[this.x,this.y,this.z]):new i.Vector(this.x,this.y,this.z)},i.Vector.prototype.add=function(t,e,r){return t instanceof i.Vector?(this.x+=t.x||0,this.y+=t.y||0,this.z+=t.z||0,this):t instanceof Array?(this.x+=t[0]||0,this.y+=t[1]||0,this.z+=t[2]||0,this):(this.x+=t||0,this.y+=e||0,this.z+=r||0,this)},i.Vector.prototype.sub=function(t,e,r){return t instanceof i.Vector?(this.x-=t.x||0,this.y-=t.y||0,this.z-=t.z||0,this):t instanceof Array?(this.x-=t[0]||0,this.y-=t[1]||0,this.z-=t[2]||0,this):(this.x-=t||0,this.y-=e||0,this.z-=r||0,this)},i.Vector.prototype.mult=function(t){return"number"==typeof t&&isFinite(t)?(this.x*=t,this.y*=t,this.z*=t,this):(console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this)},i.Vector.prototype.div=function(t){return"number"==typeof t&&isFinite(t)?0===t?(console.warn("p5.Vector.prototype.div:","divide by 0"),this):(this.x/=t,this.y/=t,this.z/=t,this):(console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this)},i.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},i.Vector.prototype.magSq=function(){var t=this.x,e=this.y,r=this.z;return t*t+e*e+r*r},i.Vector.prototype.dot=function(t,e,r){return t instanceof i.Vector?this.dot(t.x,t.y,t.z):this.x*(t||0)+this.y*(e||0)+this.z*(r||0)},i.Vector.prototype.cross=function(t){var e=this.y*t.z-this.z*t.y,r=this.z*t.x-this.x*t.z,n=this.x*t.y-this.y*t.x;return this.p5?new i.Vector(this.p5,[e,r,n]):new i.Vector(e,r,n)},i.Vector.prototype.dist=function(t){return t.copy().sub(this).mag()},i.Vector.prototype.normalize=function(){var t=this.mag();return 0!==t&&this.mult(1/t),this},i.Vector.prototype.limit=function(t){var e=this.magSq();return e>t*t&&this.div(Math.sqrt(e)).mult(t),this},i.Vector.prototype.setMag=function(t){return this.normalize().mult(t)},i.Vector.prototype.heading=function(){var t=Math.atan2(this.y,this.x);return this.p5?this.p5._fromRadians(t):t},i.Vector.prototype.rotate=function(t){var e=this.heading()+t;this.p5&&(e=this.p5._toRadians(e));var r=this.mag();return this.x=Math.cos(e)*r,this.y=Math.sin(e)*r,this},i.Vector.prototype.angleBetween=function(t){var e=this.dot(t)/(this.mag()*t.mag()),r=Math.acos(Math.min(1,Math.max(-1,e)));return this.p5?this.p5._fromRadians(r):r},i.Vector.prototype.lerp=function(t,e,r,n){return t instanceof i.Vector?this.lerp(t.x,t.y,t.z,e):(this.x+=(t-this.x)*n||0,this.y+=(e-this.y)*n||0,this.z+=(r-this.z)*n||0,this)},i.Vector.prototype.array=function(){return[this.x||0,this.y||0,this.z||0]},i.Vector.prototype.equals=function(t,e,r){var n,o,a;return t instanceof i.Vector?(n=t.x||0,o=t.y||0,a=t.z||0):t instanceof Array?(n=t[0]||0,o=t[1]||0,a=t[2]||0):(n=t||0,o=e||0,a=r||0),this.x===n&&this.y===o&&this.z===a},i.Vector.fromAngle=function(t,e){return void 0===e&&(e=1),new i.Vector(e*Math.cos(t),e*Math.sin(t),0)},i.Vector.fromAngles=function(t,e,r){void 0===r&&(r=1);var n=Math.cos(e),o=Math.sin(e),a=Math.cos(t),s=Math.sin(t);return new i.Vector(r*s*o,-r*a,r*s*n)},i.Vector.random2D=function(){return this.fromAngle(Math.random()*n.TWO_PI)},i.Vector.random3D=function(){var t=Math.random()*n.TWO_PI,e=2*Math.random()-1,r=Math.sqrt(1-e*e),o=r*Math.cos(t),a=r*Math.sin(t);return new i.Vector(o,a,e)},i.Vector.add=function(t,e,r){return r?r.set(t):r=t.copy(),r.add(e),r},i.Vector.sub=function(t,e,r){return r?r.set(t):r=t.copy(),r.sub(e),r},i.Vector.mult=function(t,e,r){return r?r.set(t):r=t.copy(),r.mult(e),r},i.Vector.div=function(t,e,r){return r?r.set(t):r=t.copy(),r.div(e),r},i.Vector.dot=function(t,e){return t.dot(e)},i.Vector.cross=function(t,e){return t.cross(e)},i.Vector.dist=function(t,e){return t.dist(e)},i.Vector.lerp=function(t,e,r,i){return i?i.set(t):i=t.copy(),i.lerp(e,r),i},i.Vector.mag=function(t){var e=t.x,r=t.y,i=t.z,n=e*e+r*r+i*i;return Math.sqrt(n)},e.exports=i.Vector},{"../core/constants":20,"../core/core":21}],53:[function(t,e,r){"use strict";var i=t("../core/core"),n=!1,o=!1,a=0,s=function(){var t,e,r=4294967296;return{setSeed:function(i){e=t=(null==i?Math.random()*r:i)>>>0},getSeed:function(){return t},rand:function(){return(e=(1664525*e+1013904223)%r)/r}}}();i.prototype.randomSeed=function(t){s.setSeed(t),n=!0,o=!1},i.prototype.random=function(t,e){var r;if(r=n?s.rand():Math.random(),void 0===t)return r;if(void 0===e)return t instanceof Array?t[Math.floor(r*t.length)]:r*t;if(t>e){var i=t;t=e,e=i}return r*(e-t)+t},i.prototype.randomGaussian=function(t,e){var r,i,n,s;if(o)r=a,o=!1;else{do{s=(i=this.random(2)-1)*i+(n=this.random(2)-1)*n}while(s>=1);r=i*(s=Math.sqrt(-2*Math.log(s)/s)),a=n*s,o=!0}return r*(e||1)+(t||0)},e.exports=i},{"../core/core":21}],54:[function(t,e,r){"use strict";var i=t("../core/core"),n=t("../core/constants");i.prototype._angleMode=n.RADIANS,i.prototype.acos=function(t){return this._fromRadians(Math.acos(t))},i.prototype.asin=function(t){return this._fromRadians(Math.asin(t))},i.prototype.atan=function(t){return this._fromRadians(Math.atan(t))},i.prototype.atan2=function(t,e){return this._fromRadians(Math.atan2(t,e))},i.prototype.cos=function(t){return Math.cos(this._toRadians(t))},i.prototype.sin=function(t){return Math.sin(this._toRadians(t))},i.prototype.tan=function(t){return Math.tan(this._toRadians(t))},i.prototype.degrees=function(t){return t*n.RAD_TO_DEG},i.prototype.radians=function(t){return t*n.DEG_TO_RAD},i.prototype.angleMode=function(t){t!==n.DEGREES&&t!==n.RADIANS||(this._angleMode=t)},i.prototype._toRadians=function(t){return this._angleMode===n.DEGREES?t*n.DEG_TO_RAD:t},i.prototype._toDegrees=function(t){return this._angleMode===n.RADIANS?t*n.RAD_TO_DEG:t},i.prototype._fromRadians=function(t){return this._angleMode===n.DEGREES?t*n.RAD_TO_DEG:t},e.exports=i},{"../core/constants":20,"../core/core":21}],55:[function(t,e,r){"use strict";var i=t("../core/core");i.prototype.textAlign=function(t,e){return i._validateParameters("textAlign",arguments),this._renderer.textAlign.apply(this._renderer,arguments)},i.prototype.textLeading=function(t){return i._validateParameters("textLeading",arguments),this._renderer.textLeading.apply(this._renderer,arguments)},i.prototype.textSize=function(t){return i._validateParameters("textSize",arguments),this._renderer.textSize.apply(this._renderer,arguments)},i.prototype.textStyle=function(t){return i._validateParameters("textStyle",arguments),this._renderer.textStyle.apply(this._renderer,arguments)},i.prototype.textWidth=function(t){return i._validateParameters("textWidth",arguments),0===t.length?0:this._renderer.textWidth.apply(this._renderer,arguments)},i.prototype.textAscent=function(){return i._validateParameters("textAscent",arguments),this._renderer.textAscent()},i.prototype.textDescent=function(){return i._validateParameters("textDescent",arguments),this._renderer.textDescent()},i.prototype._updateTextMetrics=function(){return this._renderer._updateTextMetrics()},e.exports=i},{"../core/core":21}],56:[function(t,e,r){"use strict";var i=t("../core/core"),n=t("../core/constants"),o=t("opentype.js");t("../core/error_helpers"),i.prototype.loadFont=function(t,e,r){i._validateParameters("loadFont",arguments);var n=new i.Font(this),a=this;return o.load(t,function(o,s){if(o)return void 0!==r?r(o):(i._friendlyFileLoadError(4,t),void console.error(o,t));n.font=s,void 0!==e&&e(n),a._decrementPreload();var h,l,u=t.split("\\").pop().split("/").pop(),c=u.lastIndexOf("."),p=c<1?null:u.substr(c+1);["ttf","otf","woff","woff2"].indexOf(p)>-1&&(h=u.substr(0,c),(l=document.createElement("style")).appendChild(document.createTextNode("\n@font-face {\nfont-family: "+h+";\nsrc: url("+t+");\n}\n")),document.head.appendChild(l))}),n},i.prototype.text=function(t,e,r,n,o){return i._validateParameters("text",arguments),this._renderer._doFill||this._renderer._doStroke?this._renderer.text.apply(this._renderer,arguments):this},i.prototype.textFont=function(t,e){if(i._validateParameters("textFont",arguments),arguments.length){if(!t)throw Error("null font passed to textFont");return this._renderer._setProperty("_textFont",t),e&&(this._renderer._setProperty("_textSize",e),this._renderer._setProperty("_textLeading",e*n._DEFAULT_LEADMULT)),this._renderer._applyTextProperties()}return this._renderer._textFont},e.exports=i},{"../core/constants":20,"../core/core":21,"../core/error_helpers":24,"opentype.js":9}],57:[function(t,e,r){"use strict";function i(t,e){for(var r=function(t,e){if("object"!=typeof t)t=e;else for(var r in e)void 0===t[r]&&(t[r]=e[r]);return t}(e,{sampleFactor:.1,simplifyThreshold:0}),i=c(t,0,1),o=i/(i*r.sampleFactor),a=[],s=0;s<i;s+=o)a.push(c(t,s));return r.simplifyThreshold&&n(a,r.simplifyThreshold),a}function n(t,e){e=void 0===e?0:e;for(var r=0,i=t.length-1;t.length>3&&i>=0;--i)h(s(t,i-1),s(t,i),s(t,i+1),e)&&(t.splice(i%t.length,1),r++);return r}function o(t){for(var e,r=[],i=0;i<t.length;i++)"M"===t[i].type&&(e&&r.push(e),e=[]),e.push(a(t[i]));return r.push(e),r}function a(t){var e=[t.type];return"M"===t.type||"L"===t.type?e.push(t.x,t.y):"C"===t.type?e.push(t.x1,t.y1,t.x2,t.y2,t.x,t.y):"Q"===t.type&&e.push(t.x1,t.y1,t.x,t.y),e}function s(t,e){var r=t.length;return t[e<0?e%r+r:e%r]}function h(t,e,r,i){if(!i)return 0===function(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(r[0]-t[0])*(e[1]-t[1])}(t,e,r);void 0===h.tmpPoint1&&(h.tmpPoint1=[],h.tmpPoint2=[]);var n=h.tmpPoint1,o=h.tmpPoint2;n.x=e.x-t.x,n.y=e.y-t.y,o.x=r.x-e.x,o.y=r.y-e.y;var a=n.x*o.x+n.y*o.y,s=Math.sqrt(n.x*n.x+n.y*n.y),l=Math.sqrt(o.x*o.x+o.y*o.y);return Math.acos(a/(s*l))<i}function l(t,e,r,i,n,o,a,s,h){var l=1-h,u=Math.pow(l,3),c=Math.pow(l,2),p=h*h,d=p*h,f=u*t+3*c*h*r+3*l*h*h*n+d*a,m=u*e+3*c*h*i+3*l*h*h*o+d*s,v=t+2*h*(r-t)+p*(n-2*r+t),g=e+2*h*(i-e)+p*(o-2*i+e),y=r+2*h*(n-r)+p*(a-2*n+r),b=i+2*h*(o-i)+p*(s-2*o+i),_=l*t+h*r,x=l*e+h*i,w=l*n+h*a,S=l*o+h*s,T=90-180*Math.atan2(v-y,g-b)/Math.PI;return(v>y||g<b)&&(T+=180),{x:f,y:m,m:{x:v,y:g},n:{x:y,y:b},start:{x:_,y:x},end:{x:w,y:S},alpha:T}}function u(t,e,r,i,n,o,a,s,h){return null==h?g(t,e,r,i,n,o,a,s):l(t,e,r,i,n,o,a,s,function(t,e,r,i,n,o,a,s,h){if(!(h<0||g(t,e,r,i,n,o,a,s)<h)){var l,u=.5,c=1-u;for(l=g(t,e,r,i,n,o,a,s,c);Math.abs(l-h)>.01;)u/=2,l=g(t,e,r,i,n,o,a,s,c+=(l<h?1:-1)*u);return c}}(t,e,r,i,n,o,a,s,h))}function c(t,e,r){for(var i,n,o,a,s,h=0,c=0,p=(t=d(t)).length;c<p;c++){if("M"===(o=t[c])[0])i=+o[1],n=+o[2];else{if(h+(a=u(i,n,o[1],o[2],o[3],o[4],o[5],o[6]))>e&&!r)return{x:(s=u(i,n,o[1],o[2],o[3],o[4],o[5],o[6],e-h)).x,y:s.y,alpha:s.alpha};h+=a,i=+o[5],n=+o[6]}o.shift()+o}return(s=r?h:l(i,n,o[0],o[1],o[2],o[3],o[4],o[5],1)).alpha&&(s={x:s.x,y:s.y,alpha:s.alpha}),s}function p(t){var e=[],r=0,i=0,n=0,o=0,a=0;if(!t)return e;"M"===t[0][0]&&(n=r=+t[0][1],o=i=+t[0][2],a++,e[0]=["M",r,i]);for(var s,h,l,u=3===t.length&&"M"===t[0][0]&&"R"===t[1][0].toUpperCase()&&"Z"===t[2][0].toUpperCase(),c=a,p=t.length;c<p;c++){if(e.push(h=[]),(l=t[c])[0]!==String.prototype.toUpperCase.call(l[0]))switch(h[0]=String.prototype.toUpperCase.call(l[0]),h[0]){case"A":h[1]=l[1],h[2]=l[2],h[3]=l[3],h[4]=l[4],h[5]=l[5],h[6]=+(l[6]+r),h[7]=+(l[7]+i);break;case"V":h[1]=+l[1]+i;break;case"H":h[1]=+l[1]+r;break;case"R":for(var d=2,m=(s=[r,i].concat(l.slice(1))).length;d<m;d++)s[d]=+s[d]+r,s[++d]=+s[d]+i;e.pop(),e=e.concat(f(s,u));break;case"M":n=+l[1]+r,o=+l[2]+i;break;default:for(d=1,m=l.length;d<m;d++)h[d]=+l[d]+(d%2?r:i)}else if("R"===l[0])s=[r,i].concat(l.slice(1)),e.pop(),e=e.concat(f(s,u)),h=["R"].concat(l.slice(-2));else for(var v=0,g=l.length;v<g;v++)h[v]=l[v];switch(h[0]){case"Z":r=n,i=o;break;case"H":r=h[1];break;case"V":i=h[1];break;case"M":n=h[h.length-2],o=h[h.length-1];break;default:r=h[h.length-2],i=h[h.length-1]}}return e}function d(t,e){var r,i=p(t),n=e&&p(e),o={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s=[],h=[],l=function(t,e,r){var i,n;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(t[0]in{T:1,Q:1}||(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"].concat(function t(e,r,i,n,o,a,s,h,l,u){var c,p,d,f,m,v=Math.PI,g=120*v/180,y=v/180*(+o||0),b=[],_=function(t,e,r){return{x:t*Math.cos(r)-e*Math.sin(r),y:t*Math.sin(r)+e*Math.cos(r)}};if(u)c=u[0],p=u[1],d=u[2],f=u[3];else{m=_(e,r,-y),e=m.x,r=m.y,m=_(h,l,-y),h=m.x,l=m.y;var x=(e-h)/2,w=(r-l)/2,S=x*x/(i*i)+w*w/(n*n);S>1&&(S=Math.sqrt(S),i*=S,n*=S);var T=i*i,E=n*n,M=(a===s?-1:1)*Math.sqrt(Math.abs((T*E-T*w*w-E*x*x)/(T*w*w+E*x*x)));d=M*i*w/n+(e+h)/2,f=M*-n*x/i+(r+l)/2,c=Math.asin(((r-f)/n).toFixed(9)),p=Math.asin(((l-f)/n).toFixed(9)),c=e<d?v-c:c,p=h<d?v-p:p,c<0&&(c=2*v+c),p<0&&(p=2*v+p),s&&c>p&&(c-=2*v),!s&&p>c&&(p-=2*v)}var R=p-c;if(Math.abs(R)>g){var C=p,P=h,L=l;p=c+g*(s&&p>c?1:-1),h=d+i*Math.cos(p),l=f+n*Math.sin(p),b=t(h,l,i,n,o,0,s,P,L,[p,C,d,f])}R=p-c;var A=Math.cos(c),D=Math.sin(c),I=Math.cos(p),U=Math.sin(p),k=Math.tan(R/4),O=4/3*i*k,F=4/3*n*k,B=[e,r],N=[e+O*D,r-F*A],G=[h+O*U,l-F*I],H=[h,l];if(N[0]=2*B[0]-N[0],N[1]=2*B[1]-N[1],u)return[N,G,H].concat(b);b=[N,G,H].concat(b).join().split(",");for(var V=[],z=0,j=b.length;z<j;z++)V[z]=z%2?_(b[z-1],b[z],y).y:_(b[z],b[z+1],y).x;return V}.apply(0,[e.x,e.y].concat(t.slice(1))));break;case"S":"C"===r||"S"===r?(i=2*e.x-e.bx,n=2*e.y-e.by):(i=e.x,n=e.y),t=["C",i,n].concat(t.slice(1));break;case"T":"Q"===r||"T"===r?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"].concat(v(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"].concat(v(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"].concat(m(e.x,e.y,t[1],t[2]));break;case"H":t=["C"].concat(m(e.x,e.y,t[1],e.y));break;case"V":t=["C"].concat(m(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"].concat(m(e.x,e.y,e.X,e.Y))}return t},u=function(t,e){if(t[e].length>7){t[e].shift();for(var o=t[e];o.length;)s[e]="A",n&&(h[e]="A"),t.splice(e++,0,["C"].concat(o.splice(0,6)));t.splice(e,1),r=Math.max(i.length,n&&n.length||0)}},c=function(t,e,o,a,s){t&&e&&"M"===t[s][0]&&"M"!==e[s][0]&&(e.splice(s,0,["M",a.x,a.y]),o.bx=0,o.by=0,o.x=t[s][1],o.y=t[s][2],r=Math.max(i.length,n&&n.length||0))},d="",f="";r=Math.max(i.length,n&&n.length||0);for(var g=0;g<r;g++){i[g]&&(d=i[g][0]),"C"!==d&&(s[g]=d,g&&(f=s[g-1])),i[g]=l(i[g],o,f),"A"!==s[g]&&"C"===d&&(s[g]="C"),u(i,g),n&&(n[g]&&(d=n[g][0]),"C"!==d&&(h[g]=d,g&&(f=h[g-1])),n[g]=l(n[g],a,f),"A"!==h[g]&&"C"===d&&(h[g]="C"),u(n,g)),c(i,n,o,a,g),c(n,i,a,o,g);var y=i[g],b=n&&n[g],_=y.length,x=n&&b.length;o.x=y[_-2],o.y=y[_-1],o.bx=parseFloat(y[_-4])||o.x,o.by=parseFloat(y[_-3])||o.y,a.bx=n&&(parseFloat(b[x-4])||a.x),a.by=n&&(parseFloat(b[x-3])||a.y),a.x=n&&b[x-2],a.y=n&&b[x-1]}return n?[i,n]:i}function f(t,e){for(var r=[],i=0,n=t.length;n-2*!e>i;i+=2){var o=[{x:+t[i-2],y:+t[i-1]},{x:+t[i],y:+t[i+1]},{x:+t[i+2],y:+t[i+3]},{x:+t[i+4],y:+t[i+5]}];e?i?n-4===i?o[3]={x:+t[0],y:+t[1]}:n-2===i&&(o[2]={x:+t[0],y:+t[1]},o[3]={x:+t[2],y:+t[3]}):o[0]={x:+t[n-2],y:+t[n-1]}:n-4===i?o[3]=o[2]:i||(o[0]={x:+t[i],y:+t[i+1]}),r.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return r}function m(t,e,r,i){return[t,e,r,i,r,i]}function v(t,e,r,i,n,o){var a=1/3,s=2/3;return[a*t+s*r,a*e+s*i,a*n+s*r,a*o+s*i,n,o]}function g(t,e,r,i,n,o,a,s,h){null==h&&(h=1);for(var l=(h=h>1?1:h<0?0:h)/2,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],c=0,p=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0;d<12;d++){var f=l*u[d]+l,m=y(f,t,r,n,a),v=y(f,e,i,o,s),g=m*m+v*v;c+=p[d]*Math.sqrt(g)}return l*c}function y(t,e,r,i,n){return t*(t*(-3*e+9*r-9*i+3*n)+6*e-12*r+6*i)-3*e+3*r}function b(){for(var t="",e=arguments.length-1;e>=0;--e){var r=arguments[e];t+=r===Object(r)?JSON.stringify(r):r}return t}var _=t("../core/core"),x=t("../core/constants");_.Font=function(t){this.parent=t,this.cache={},this.font=void 0},_.Font.prototype.list=function(){throw"not yet implemented"},_.Font.prototype.textBounds=function(t,e,r,i,n){e=void 0!==e?e:0,r=void 0!==r?r:0,i=i||this.parent._renderer._textSize;var o=n&&n.renderer&&n.renderer._pInst||this.parent,a=o._renderer.drawingContext,s=a.textAlign||x.LEFT,h=a.textBaseline||x.BASELINE,l=b("textBounds",t,e,r,i,s,h),u=this.cache[l];if(!u){var c,p,d,f,m=[],v=[],g=this._scale(i);this.font.forEachGlyph(t,e,r,i,n,function(t,e,r,i){var n=t.getMetrics();m.push(e+n.xMin*g),m.push(e+n.xMax*g),v.push(r+-n.yMin*g),v.push(r+-n.yMax*g)}),c=Math.min.apply(null,m),p=Math.min.apply(null,v),d=Math.max.apply(null,m),u={x:c,y:p,h:Math.max.apply(null,v)-p,w:d-c,advance:c-e},f=this._handleAlignment(o,a,t,u.x,u.y,u.w+u.advance),u.x=f.x,u.y=f.y,this.cache[b("textBounds",t,e,r,i,s,h)]=u}return u},_.Font.prototype.textToPoints=function(t,e,r,n,a){function s(e){return u[e].name&&"space"===u[e].name||t.length===u.length&&" "===t[e]||u[e].index&&3===u[e].index}var h=0,l=[],u=this._getGlyphs(t);n=n||this.parent._renderer._textSize;for(var c=0;c<u.length;c++){if(!s(c))for(var p=o(u[c].getPath(e,r,n).commands),d=0;d<p.length;d++)for(var f=i(p[d],a),m=0;m<f.length;m++)f[m].x+=h,l.push(f[m]);h+=u[c].advanceWidth*this._scale(n)}return l},_.Font.prototype._getGlyphs=function(t){return this.font.stringToGlyphs(t)},_.Font.prototype._getPath=function(t,e,r,i){var n=i&&i.renderer&&i.renderer._pInst||this.parent,o=n._renderer.drawingContext,a=this._handleAlignment(n,o,t,e,r);return this.font.getPath(t,a.x,a.y,n._renderer._textSize,i)},_.Font.prototype._getPathData=function(t,e,r,i){var n=3;return"string"==typeof t&&arguments.length>2?t=this._getPath(t,e,r,i):"object"==typeof e&&(i=e),i&&"number"==typeof i.decimals&&(n=i.decimals),t.toPathData(n)},_.Font.prototype._getSVG=function(t,e,r,i){var n=3;return"string"==typeof t&&arguments.length>2?t=this._getPath(t,e,r,i):"object"==typeof e&&(i=e),i&&("number"==typeof i.decimals&&(n=i.decimals),"number"==typeof i.strokeWidth&&(t.strokeWidth=i.strokeWidth),void 0!==i.fill&&(t.fill=i.fill),void 0!==i.stroke&&(t.stroke=i.stroke)),t.toSVG(n)},_.Font.prototype._renderPath=function(t,e,r,i){var n,o=i&&i.renderer||this.parent._renderer,a=o.drawingContext;n="object"==typeof t&&t.commands?t.commands:this._getPath(t,e,r,i).commands,a.beginPath();for(var s=0;s<n.length;s+=1){var h=n[s];"M"===h.type?a.moveTo(h.x,h.y):"L"===h.type?a.lineTo(h.x,h.y):"C"===h.type?a.bezierCurveTo(h.x1,h.y1,h.x2,h.y2,h.x,h.y):"Q"===h.type?a.quadraticCurveTo(h.x1,h.y1,h.x,h.y):"Z"===h.type&&a.closePath()}return o._doStroke&&o._strokeSet&&a.stroke(),o._doFill&&(o._fillSet||o._setFill(x._DEFAULT_TEXT_FILL),a.fill()),this},_.Font.prototype._textWidth=function(t,e){return this.font.getAdvanceWidth(t,e)},_.Font.prototype._textAscent=function(t){return this.font.ascender*this._scale(t)},_.Font.prototype._textDescent=function(t){return-this.font.descender*this._scale(t)},_.Font.prototype._scale=function(t){return 1/this.font.unitsPerEm*(t||this.parent._renderer._textSize)},_.Font.prototype._handleAlignment=function(t,e,r,i,n,o){var a=t._renderer._textSize,s=this._textAscent(a),h=this._textDescent(a);return o=void 0!==o?o:this._textWidth(r,a),e.textAlign===x.CENTER?i-=o/2:e.textAlign===x.RIGHT&&(i-=o),e.textBaseline===x.TOP?n+=s:e.textBaseline===x._CTX_MIDDLE?n+=s/2:e.textBaseline===x.BOTTOM&&(n-=h),{x:i,y:n}},e.exports=_},{"../core/constants":20,"../core/core":21}],58:[function(t,e,r){"use strict";var i=t("../core/core");i.prototype.append=function(t,e){return t.push(e),t},i.prototype.arrayCopy=function(t,e,r,i,n){var o,a;void 0!==n?(a=Math.min(n,t.length),o=i,t=t.slice(e,a+e)):(void 0!==r?(a=r,a=Math.min(a,t.length)):a=t.length,o=0,r=e,t=t.slice(0,a)),Array.prototype.splice.apply(r,[o,a].concat(t))},i.prototype.concat=function(t,e){return t.concat(e)},i.prototype.reverse=function(t){return t.reverse()},i.prototype.shorten=function(t){return t.pop(),t},i.prototype.shuffle=function(t,e){for(var r,i,n=ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t),o=(t=e||n?t:t.slice()).length;o>1;)r=Math.random()*o|0,i=t[--o],t[o]=t[r],t[r]=i;return t},i.prototype.sort=function(t,e){var r=e?t.slice(0,Math.min(e,t.length)):t,i=e?t.slice(Math.min(e,t.length)):[];return(r="string"==typeof r[0]?r.sort():r.sort(function(t,e){return t-e})).concat(i)},i.prototype.splice=function(t,e,r){return Array.prototype.splice.apply(t,[r,0].concat(e)),t},i.prototype.subset=function(t,e,r){return void 0!==r?t.slice(e,e+r):t.slice(e,t.length)},e.exports=i},{"../core/core":21}],59:[function(t,e,r){"use strict";var i=t("../core/core");i.prototype.float=function(t){return t instanceof Array?t.map(parseFloat):parseFloat(t)},i.prototype.int=function(t,e){return e=e||10,"string"==typeof t?parseInt(t,e):"number"==typeof t?0|t:"boolean"==typeof t?t?1:0:t instanceof Array?t.map(function(t){return i.prototype.int(t,e)}):void 0},i.prototype.str=function(t){return t instanceof Array?t.map(i.prototype.str):String(t)},i.prototype.boolean=function(t){return"number"==typeof t?0!==t:"string"==typeof t?"true"===t.toLowerCase():"boolean"==typeof t?t:t instanceof Array?t.map(i.prototype.boolean):void 0},i.prototype.byte=function(t){var e=i.prototype.int(t,10);return"number"==typeof e?(e+128)%256-128:e instanceof Array?e.map(i.prototype.byte):void 0},i.prototype.char=function(t){return"number"!=typeof t||isNaN(t)?t instanceof Array?t.map(i.prototype.char):"string"==typeof t?i.prototype.char(parseInt(t,10)):void 0:String.fromCharCode(t)},i.prototype.unchar=function(t){return"string"==typeof t&&1===t.length?t.charCodeAt(0):t instanceof Array?t.map(i.prototype.unchar):void 0},i.prototype.hex=function(t,e){if(e=void 0===e||null===e?e=8:e,t instanceof Array)return t.map(function(t){return i.prototype.hex(t,e)});if("number"==typeof t){t<0&&(t=4294967295+t+1);for(var r=Number(t).toString(16).toUpperCase();r.length<e;)r="0"+r;return r.length>=e&&(r=r.substring(r.length-e,r.length)),r}},i.prototype.unhex=function(t){return t instanceof Array?t.map(i.prototype.unhex):parseInt("0x"+t,16)},e.exports=i},{"../core/core":21}],60:[function(t,e,r){"use strict";function i(t,e,r){var i=t<0,n=i?t.toString().substring(1):t.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",h=i?"-":"";if(void 0!==r){var l="";(-1!==o||r-s.length>0)&&(l="."),s.length>r&&(s=s.substring(0,r));for(var u=0;u<e-a.length;u++)h+="0";h+=a,h+=l,h+=s;for(var c=0;c<r-s.length;c++)h+="0";return h}for(var p=0;p<Math.max(e-a.length,0);p++)h+="0";return h+n}function n(t,e){var r=(t=t.toString()).indexOf("."),i=-1!==r?t.substring(r):"",n=-1!==r?t.substring(0,r):t;if(n=n.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),0===e)i="";else if(void 0!==e)if(e>i.length)for(var o=e-(i+=-1===r?".":"").length+1,a=0;a<o;a++)i+="0";else i=i.substring(0,e+1);return n+i}function o(t){return parseFloat(t)>0?"+"+t.toString():t.toString()}function a(t){return parseFloat(t)>0?" "+t.toString():t.toString()}var s=t("../core/core");t("../core/error_helpers"),s.prototype.join=function(t,e){return s._validateParameters("join",arguments),t.join(e)},s.prototype.match=function(t,e){return s._validateParameters("match",arguments),t.match(e)},s.prototype.matchAll=function(t,e){s._validateParameters("matchAll",arguments);for(var r=new RegExp(e,"g"),i=r.exec(t),n=[];null!==i;)n.push(i),i=r.exec(t);return n},s.prototype.nf=function(t,e,r){return s._validateParameters("nf",arguments),t instanceof Array?t.map(function(t){return i(t,e,r)}):"[object Arguments]"===Object.prototype.toString.call(t)?3===t.length?this.nf(t[0],t[1],t[2]):2===t.length?this.nf(t[0],t[1]):this.nf(t[0]):i(t,e,r)},s.prototype.nfc=function(t,e){return s._validateParameters("nfc",arguments),t instanceof Array?t.map(function(t){return n(t,e)}):n(t,e)},s.prototype.nfp=function(){s._validateParameters("nfp",arguments);var t=s.prototype.nf.apply(this,arguments);return t instanceof Array?t.map(o):o(t)},s.prototype.nfs=function(){s._validateParameters("nfs",arguments);var t=s.prototype.nf.apply(this,arguments);return t instanceof Array?t.map(a):a(t)},s.prototype.split=function(t,e){return s._validateParameters("split",arguments),t.split(e)},s.prototype.splitTokens=function(t,e){var r;if(s._validateParameters("splitTokens",arguments),void 0!==e){var i=e,n=/\]/g.exec(i),o=/\[/g.exec(i);o&&n?(i=i.slice(0,n.index)+i.slice(n.index+1),o=/\[/g.exec(i),i=i.slice(0,o.index)+i.slice(o.index+1),r=new RegExp("[\\["+i+"\\]]","g")):n?(i=i.slice(0,n.index)+i.slice(n.index+1),r=new RegExp("["+i+"\\]]","g")):o?(i=i.slice(0,o.index)+i.slice(o.index+1),r=new RegExp("["+i+"\\[]","g")):r=new RegExp("["+i+"]","g")}else r=/\s/g;return t.split(r).filter(function(t){return t})},s.prototype.trim=function(t){return s._validateParameters("trim",arguments),t instanceof Array?t.map(this.trim):t.trim()},e.exports=s},{"../core/core":21,"../core/error_helpers":24}],61:[function(t,e,r){"use strict";var i=t("../core/core");i.prototype.day=function(){return(new Date).getDate()},i.prototype.hour=function(){return(new Date).getHours()},i.prototype.minute=function(){return(new Date).getMinutes()},i.prototype.millis=function(){return window.performance.now()},i.prototype.month=function(){return(new Date).getMonth()+1},i.prototype.second=function(){return(new Date).getSeconds()},i.prototype.year=function(){return(new Date).getFullYear()},e.exports=i},{"../core/core":21}],62:[function(t,e,r){"use strict";var i=t("../core/core");i.prototype.camera=function(){return this._assert3d("camera"),i._validateParameters("camera",arguments),this._renderer.camera.apply(this._renderer,arguments),this},i.RendererGL.prototype.camera=function(t,e,r,i,n,o,a,s,h){void 0===t&&(t=this.defaultCameraX,e=this.defaultCameraY,r=this.defaultCameraZ,i=t,n=e,o=0,a=0,s=1,h=0),this.cameraX=t,this.cameraY=e,this.cameraZ=r;var l=t-i,u=e-n,c=r-o;this.eyeDist=Math.sqrt(l*l+u*u+c*c),0!==this.eyeDist&&(l/=this.eyeDist,u/=this.eyeDist,c/=this.eyeDist);var p=a,d=s,f=h,m=d*c-f*u,v=-p*c+f*l,g=p*u-d*l;p=u*g-c*v,d=-l*g+c*m,f=l*v-u*m;var y=Math.sqrt(m*m+v*v+g*g);0!==y&&(m/=y,v/=y,g/=y);var b=Math.sqrt(p*p+d*d+f*f);0!==b&&(p/=b,d/=b,f/=b),this.cameraMatrix.set(m,p,l,0,v,d,u,0,g,f,c,0,0,0,0,1);var _=-t,x=-e,w=-r;return this.cameraMatrix.translate([_,x,w]),this.uMVMatrix.set(this.cameraMatrix.mat4[0],this.cameraMatrix.mat4[1],this.cameraMatrix.mat4[2],this.cameraMatrix.mat4[3],this.cameraMatrix.mat4[4],this.cameraMatrix.mat4[5],this.cameraMatrix.mat4[6],this.cameraMatrix.mat4[7],this.cameraMatrix.mat4[8],this.cameraMatrix.mat4[9],this.cameraMatrix.mat4[10],this.cameraMatrix.mat4[11],this.cameraMatrix.mat4[12],this.cameraMatrix.mat4[13],this.cameraMatrix.mat4[14],this.cameraMatrix.mat4[15]),this},i.prototype.perspective=function(){return this._assert3d("perspective"),i._validateParameters("perspective",arguments),this._renderer.perspective.apply(this._renderer,arguments),this},i.RendererGL.prototype.perspective=function(t,e,r,n){void 0===t&&(t=this.defaultCameraFOV),void 0===e&&(e=this.defaultCameraAspect),void 0===r&&(r=this.defaultCameraNear),void 0===n&&(n=this.defaultCameraFar),this.cameraFOV=this._pInst._toRadians(t),this.cameraAspect=e,this.cameraNear=r,this.cameraFar=n,this.uPMatrix=i.Matrix.identity();var o=1/Math.tan(this.cameraFOV/2),a=1/(this.cameraNear-this.cameraFar);this.uPMatrix.set(o/e,0,0,0,0,-o,0,0,0,0,(n+r)*a,-1,0,0,2*n*r*a,0),this._curCamera="custom"},i.prototype.ortho=function(){return this._assert3d("ortho"),i._validateParameters("ortho",arguments),this._renderer.ortho.apply(this._renderer,arguments),this},i.RendererGL.prototype.ortho=function(t,e,r,n,o,a){void 0===t&&(t=-this.width/2),void 0===e&&(e=+this.width/2),void 0===r&&(r=-this.height/2),void 0===n&&(n=+this.height/2),void 0===o&&(o=0),void 0===a&&(a=Math.max(this.width,this.height));var s=e-t,h=n-r,l=a-o,u=2/s,c=2/h,p=-2/l,d=-(e+t)/s,f=-(n+r)/h,m=-(a+o)/l;this.uPMatrix=i.Matrix.identity(),this.uPMatrix.set(u,0,0,0,0,-c,0,0,0,0,p,0,d,f,m,1),this._curCamera="custom"},e.exports=i},{"../core/core":21}],63:[function(t,e,r){"use strict";var i=t("../core/core");i.prototype.orbitControl=function(){return this._assert3d("orbitControl"),i._validateParameters("orbitControl",arguments),this.mouseIsPressed&&(this.rotateY((this.mouseX-this.width/2)/(this.width/2)),this.rotateX((this.mouseY-this.height/2)/(this.width/2))),this},e.exports=i},{"../core/core":21}],64:[function(t,e,r){"use strict";var i=t("../core/core");i.prototype.ambientLight=function(t,e,r,n){this._assert3d("ambientLight"),i._validateParameters("ambientLight",arguments);var o=this.color.apply(this,arguments),a=this._renderer._useLightShader();return a.setUniform("uUseLighting",!0),a.setUniform("uMaterialColor",this._renderer.curFillColor),this._renderer.ambientLightColors.push(o._array[0],o._array[1],o._array[2]),a.setUniform("uAmbientColor",this._renderer.ambientLightColors),a.setUniform("uAmbientLightCount",this._renderer.ambientLightColors.length/3),this},i.prototype.directionalLight=function(t,e,r,n,o,a){this._assert3d("directionalLight"),i._validateParameters("directionalLight",arguments);var s,h,l,u=this._renderer._useLightShader(),c=this.color.apply(this,[t,e,r]),p=arguments[arguments.length-1];"number"==typeof p?(s=arguments[arguments.length-3],h=arguments[arguments.length-2],l=arguments[arguments.length-1]):(s=p.x,h=p.y,l=p.z),u.setUniform("uUseLighting",!0),u.setUniform("uMaterialColor",this._renderer.curFillColor);var d=Math.sqrt(s*s+h*h+l*l);return this._renderer.directionalLightDirections.push(s/d,h/d,l/d),u.setUniform("uLightingDirection",this._renderer.directionalLightDirections),this._renderer.directionalLightColors.push(c._array[0],c._array[1],c._array[2]),u.setUniform("uDirectionalColor",this._renderer.directionalLightColors),u.setUniform("uDirectionalLightCount",this._renderer.directionalLightColors.length/3),this},i.prototype.pointLight=function(t,e,r,n,o,a){this._assert3d("pointLight"),i._validateParameters("pointLight",arguments);var s,h,l,u=this._renderer._pInst.color.apply(this,[t,e,r]),c=arguments[arguments.length-1];"number"==typeof c?(s=arguments[arguments.length-3],h=arguments[arguments.length-2],l=arguments[arguments.length-1]):(s=c.x,h=c.y,l=c.z);var p=this._renderer._useLightShader();return p.setUniform("uUseLighting",!0),p.setUniform("uMaterialColor",this._renderer.curFillColor),this._renderer.pointLightPositions.push(s,h,l),p.setUniform("uPointLightLocation",this._renderer.pointLightPositions),this._renderer.pointLightColors.push(u._array[0],u._array[1],u._array[2]),p.setUniform("uPointLightColor",this._renderer.pointLightColors),p.setUniform("uPointLightCount",this._renderer.pointLightColors.length/3),this},e.exports=i},{"../core/core":21}],65:[function(t,e,r){"use strict";var i=t("../core/core");t("./p5.Geometry"),i.prototype.loadModel=function(t){var e,r,n;i._validateParameters("loadModel",arguments),"boolean"==typeof arguments[1]?(e=arguments[1],r=arguments[2],n=arguments[3]):(e=!1,r=arguments[1],n=arguments[2]);var o=new i.Geometry;o.gid=t+"|"+e;var a=this;return this.loadStrings(t,function(t){(function(t,e){for(var r={v:[],vt:[],vn:[]},n={},o=0;o<e.length;++o){var a=e[o].trim().split(/\b\s+/);if(a.length>0)if("v"===a[0]||"vn"===a[0]){var s=new i.Vector(parseFloat(a[1]),parseFloat(a[2]),parseFloat(a[3]));r[a[0]].push(s)}else if("vt"===a[0]){var h=[parseFloat(a[1]),parseFloat(a[2])];r[a[0]].push(h)}else if("f"===a[0])for(var l=3;l<a.length;++l){for(var u=[],c=[1,l-1,l],p=0;p<c.length;++p){var d=a[c[p]],f=0;if(void 0!==n[d])f=n[d];else{for(var m=d.split("/"),v=0;v<m.length;v++)m[v]=parseInt(m[v])-1;f=n[d]=t.vertices.length,t.vertices.push(r.v[m[0]].copy()),r.vt[m[1]]?t.uvs.push(r.vt[m[1]].slice()):t.uvs.push([0,0]),r.vn[m[2]]&&t.vertexNormals.push(r.vn[m[2]].copy())}u.push(f)}u[0]!==u[1]&&u[0]!==u[2]&&u[1]!==u[2]&&t.faces.push(u)}}0===t.vertexNormals.length&&t.computeNormals()})(o,t),e&&o.normalize(),a._decrementPreload(),"function"==typeof r&&r(o)}.bind(this),n),o},i.prototype.model=function(t){this._assert3d("model"),i._validateParameters("model",arguments),t.vertices.length>0&&(this._renderer.geometryInHash(t.gid)||(t._makeTriangleEdges()._edgesToVertices(),this._renderer.createBuffers(t.gid,t)),this._renderer.drawBuffers(t.gid))},e.exports=i},{"../core/core":21,"./p5.Geometry":67}],66:[function(t,e,r){"use strict";var i=t("../core/core"),n=t("../core/constants");t("./p5.Texture"),i.prototype.loadShader=function(t,e){i._validateParameters("loadShader",arguments);var r=new i.Shader,n=this,o=!1,a=!1;return this.loadStrings(e,function(t){r._fragSrc=t.join("\n"),o=!0,a&&n._decrementPreload()}),this.loadStrings(t,function(t){r._vertSrc=t.join("\n"),a=!0,o&&n._decrementPreload()}),r},i.prototype.createShader=function(t,e){return this._assert3d("createShader"),i._validateParameters("createShader",arguments),new i.Shader(this._renderer,t,e)},i.prototype.shader=function(t){return this._assert3d("shader"),i._validateParameters("shader",arguments),void 0===t._renderer&&(t._renderer=this._renderer),t.isStrokeShader()?this._renderer.setStrokeShader(t):this._renderer.setFillShader(t),this},i.prototype.normalMaterial=function(){return this._assert3d("normalMaterial"),i._validateParameters("normalMaterial",arguments),this._renderer.drawMode=n.FILL,this._renderer.setFillShader(this._renderer._getNormalShader()),this._renderer.curFillColor=[1,1,1,1],this.noStroke(),this},i.prototype.texture=function(t){this._assert3d("texture"),i._validateParameters("texture",arguments),this._renderer.drawMode=n.TEXTURE;var e=this._renderer._useLightShader();return e.setUniform("uSpecular",!1),e.setUniform("isTexture",!0),e.setUniform("uSampler",t),this.noStroke(),this},i.prototype.ambientMaterial=function(t,e,r,n){this._assert3d("ambientMaterial"),i._validateParameters("ambientMaterial",arguments);var o=i.prototype.color.apply(this,arguments);this._renderer.curFillColor=o._array;var a=this._renderer._useLightShader();return a.setUniform("uMaterialColor",this._renderer.curFillColor),a.setUniform("uSpecular",!1),a.setUniform("isTexture",!1),this},i.prototype.specularMaterial=function(t,e,r,n){this._assert3d("specularMaterial"),i._validateParameters("specularMaterial",arguments);var o=i.prototype.color.apply(this,arguments);this._renderer.curFillColor=o._array;var a=this._renderer._useLightShader();return a.setUniform("uMaterialColor",this._renderer.curFillColor),a.setUniform("uSpecular",!0),a.setUniform("isTexture",!1),this},i.RendererGL.prototype._applyColorBlend=function(t){var e=this.GL,r=this.drawMode===n.TEXTURE;return r||t[t.length-1]<1?(e.depthMask(r),e.enable(e.BLEND),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA)):(e.depthMask(!0),e.disable(e.BLEND)),t},e.exports=i},{"../core/constants":20,"../core/core":21,"./p5.Texture":73}],67:[function(t,e,r){"use strict";var i=t("../core/core");i.Geometry=function(t,e,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.detailX=void 0!==t?t:1,this.detailY=void 0!==e?e:1,r instanceof Function&&r.call(this),this},i.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var t,e,r,i,n=this.detailX+1,o=0;o<this.detailY;o++)for(var a=0;a<this.detailX;a++)t=o*n+a,e=o*n+a+1,r=(o+1)*n+a+1,i=(o+1)*n+a,this.faces.push([t,e,i]),this.faces.push([i,e,r]);return this},i.Geometry.prototype._getFaceNormal=function(t){var e=this.faces[t],r=this.vertices[e[0]],n=this.vertices[e[1]],o=this.vertices[e[2]],a=i.Vector.sub(n,r),s=i.Vector.sub(o,r),h=i.Vector.cross(a,s),l=i.Vector.mag(h),u=l/(i.Vector.mag(a)*i.Vector.mag(s));return 0===u||isNaN(u)?(console.warn("p5.Geometry.prototype._getFaceNormal:","face has colinear sides or a repeated vertex"),h):(u>1&&(u=1),h.mult(Math.asin(u)/l))},i.Geometry.prototype.computeNormals=function(){var t,e=this.vertexNormals,r=this.vertices,n=this.faces;for(e.length=0,t=0;t<r.length;++t)e.push(new i.Vector);for(var o=0;o<n.length;++o)for(var a=n[o],s=this._getFaceNormal(o),h=0;h<3;++h){e[a[h]].add(s)}for(t=0;t<r.length;++t)e[t].normalize();return this},i.Geometry.prototype.averageNormals=function(){for(var t=0;t<=this.detailY;t++){var e=this.detailX+1,r=i.Vector.add(this.vertexNormals[t*e],this.vertexNormals[t*e+this.detailX]);r=i.Vector.div(r,2),this.vertexNormals[t*e]=r,this.vertexNormals[t*e+this.detailX]=r}return this},i.Geometry.prototype.averagePoleNormals=function(){for(var t=new i.Vector(0,0,0),e=0;e<this.detailX;e++)t.add(this.vertexNormals[e]);for(t=i.Vector.div(t,this.detailX),e=0;e<this.detailX;e++)this.vertexNormals[e]=t;for(t=new i.Vector(0,0,0),e=this.vertices.length-1;e>this.vertices.length-1-this.detailX;e--)t.add(this.vertexNormals[e]);for(t=i.Vector.div(t,this.detailX),e=this.vertices.length-1;e>this.vertices.length-1-this.detailX;e--)this.vertexNormals[e]=t;return this},i.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var t=0,e=this.strokeIndices.length;t<e;t++)this.edges.push(this.strokeIndices[t]);else for(var r=0;r<this.faces.length;r++)this.edges.push([this.faces[r][0],this.faces[r][1]]),this.edges.push([this.faces[r][1],this.faces[r][2]]),this.edges.push([this.faces[r][2],this.faces[r][0]]);return this},i.Geometry.prototype._edgesToVertices=function(){this.lineVertices.length=0,this.lineNormals.length=0;for(var t=0;t<this.edges.length;t++){var e=this.vertices[this.edges[t][0]],r=this.vertices[this.edges[t][1]],i=r.copy().sub(e).normalize(),n=e.array(),o=e.array(),a=r.array(),s=r.array(),h=i.array(),l=i.array();h.push(1),l.push(-1),this.lineNormals.push(h,l,h,h,l,l),this.lineVertices.push(n,o,a,a,o,s)}return this},i.Geometry.prototype.normalize=function(){if(this.vertices.length>0){for(var t=this.vertices[0].copy(),e=this.vertices[0].copy(),r=0;r<this.vertices.length;r++)t.x=Math.max(t.x,this.vertices[r].x),e.x=Math.min(e.x,this.vertices[r].x),t.y=Math.max(t.y,this.vertices[r].y),e.y=Math.min(e.y,this.vertices[r].y),t.z=Math.max(t.z,this.vertices[r].z),e.z=Math.min(e.z,this.vertices[r].z);var n=i.Vector.lerp(t,e,.5),o=i.Vector.sub(t,e),a=200/Math.max(Math.max(o.x,o.y),o.z);for(r=0;r<this.vertices.length;r++)this.vertices[r].sub(n),this.vertices[r].mult(a)}return this},e.exports=i.Geometry},{"../core/core":21}],68:[function(t,e,r){"use strict";var i=t("../core/core"),n=Array,o=function(t){return t instanceof Array};"undefined"!=typeof Float32Array&&(n=Float32Array,o=function(t){return t instanceof Array||t instanceof Float32Array}),i.Matrix=function(){for(var t=new Array(arguments.length),e=0;e<t.length;++e)t[e]=arguments[e];return t.length&&t[t.length-1]instanceof i&&(this.p5=t[t.length-1]),"mat3"===t[0]?this.mat3=Array.isArray(t[1])?t[1]:new n([1,0,0,0,1,0,0,0,1]):this.mat4=Array.isArray(t[0])?t[0]:new n([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this},i.Matrix.prototype.set=function(t){return t instanceof i.Matrix?(this.mat4=t.mat4,this):o(t)?(this.mat4=t,this):(16===arguments.length&&(this.mat4[0]=arguments[0],this.mat4[1]=arguments[1],this.mat4[2]=arguments[2],this.mat4[3]=arguments[3],this.mat4[4]=arguments[4],this.mat4[5]=arguments[5],this.mat4[6]=arguments[6],this.mat4[7]=arguments[7],this.mat4[8]=arguments[8],this.mat4[9]=arguments[9],this.mat4[10]=arguments[10],this.mat4[11]=arguments[11],this.mat4[12]=arguments[12],this.mat4[13]=arguments[13],this.mat4[14]=arguments[14],this.mat4[15]=arguments[15]),this)},i.Matrix.prototype.get=function(){return new i.Matrix(this.mat4,this.p5)},i.Matrix.prototype.copy=function(){var t=new i.Matrix(this.p5);return t.mat4[0]=this.mat4[0],t.mat4[1]=this.mat4[1],t.mat4[2]=this.mat4[2],t.mat4[3]=this.mat4[3],t.mat4[4]=this.mat4[4],t.mat4[5]=this.mat4[5],t.mat4[6]=this.mat4[6],t.mat4[7]=this.mat4[7],t.mat4[8]=this.mat4[8],t.mat4[9]=this.mat4[9],t.mat4[10]=this.mat4[10],t.mat4[11]=this.mat4[11],t.mat4[12]=this.mat4[12],t.mat4[13]=this.mat4[13],t.mat4[14]=this.mat4[14],t.mat4[15]=this.mat4[15],t},i.Matrix.identity=function(t){return new i.Matrix(t)},i.Matrix.prototype.transpose=function(t){var e,r,n,a,s,h;return t instanceof i.Matrix?(e=t.mat4[1],r=t.mat4[2],n=t.mat4[3],a=t.mat4[6],s=t.mat4[7],h=t.mat4[11],this.mat4[0]=t.mat4[0],this.mat4[1]=t.mat4[4],this.mat4[2]=t.mat4[8],this.mat4[3]=t.mat4[12],this.mat4[4]=e,this.mat4[5]=t.mat4[5],this.mat4[6]=t.mat4[9],this.mat4[7]=t.mat4[13],this.mat4[8]=r,this.mat4[9]=a,this.mat4[10]=t.mat4[10],this.mat4[11]=t.mat4[14],this.mat4[12]=n,this.mat4[13]=s,this.mat4[14]=h,this.mat4[15]=t.mat4[15]):o(t)&&(e=t[1],r=t[2],n=t[3],a=t[6],s=t[7],h=t[11],this.mat4[0]=t[0],this.mat4[1]=t[4],this.mat4[2]=t[8],this.mat4[3]=t[12],this.mat4[4]=e,this.mat4[5]=t[5],this.mat4[6]=t[9],this.mat4[7]=t[13],this.mat4[8]=r,this.mat4[9]=a,this.mat4[10]=t[10],this.mat4[11]=t[14],this.mat4[12]=n,this.mat4[13]=s,this.mat4[14]=h,this.mat4[15]=t[15]),this},i.Matrix.prototype.invert=function(t){var e,r,n,a,s,h,l,u,c,p,d,f,m,v,g,y;t instanceof i.Matrix?(e=t.mat4[0],r=t.mat4[1],n=t.mat4[2],a=t.mat4[3],s=t.mat4[4],h=t.mat4[5],l=t.mat4[6],u=t.mat4[7],c=t.mat4[8],p=t.mat4[9],d=t.mat4[10],f=t.mat4[11],m=t.mat4[12],v=t.mat4[13],g=t.mat4[14],y=t.mat4[15]):o(t)&&(e=t[0],r=t[1],n=t[2],a=t[3],s=t[4],h=t[5],l=t[6],u=t[7],c=t[8],p=t[9],d=t[10],f=t[11],m=t[12],v=t[13],g=t[14],y=t[15]);var b=e*h-r*s,_=e*l-n*s,x=e*u-a*s,w=r*l-n*h,S=r*u-a*h,T=n*u-a*l,E=c*v-p*m,M=c*g-d*m,R=c*y-f*m,C=p*g-d*v,P=p*y-f*v,L=d*y-f*g,A=b*L-_*P+x*C+w*R-S*M+T*E;return A?(A=1/A,this.mat4[0]=(h*L-l*P+u*C)*A,this.mat4[1]=(n*P-r*L-a*C)*A,this.mat4[2]=(v*T-g*S+y*w)*A,this.mat4[3]=(d*S-p*T-f*w)*A,this.mat4[4]=(l*R-s*L-u*M)*A,this.mat4[5]=(e*L-n*R+a*M)*A,this.mat4[6]=(g*x-m*T-y*_)*A,this.mat4[7]=(c*T-d*x+f*_)*A,this.mat4[8]=(s*P-h*R+u*E)*A,this.mat4[9]=(r*R-e*P-a*E)*A,this.mat4[10]=(m*S-v*x+y*b)*A,this.mat4[11]=(p*x-c*S-f*b)*A,this.mat4[12]=(h*M-s*C-l*E)*A,this.mat4[13]=(e*C-r*M+n*E)*A,this.mat4[14]=(v*_-m*w-g*b)*A,this.mat4[15]=(c*w-p*_+d*b)*A,this):null},i.Matrix.prototype.invert3x3=function(){var t=this.mat3[0],e=this.mat3[1],r=this.mat3[2],i=this.mat3[3],n=this.mat3[4],o=this.mat3[5],a=this.mat3[6],s=this.mat3[7],h=this.mat3[8],l=h*n-o*s,u=-h*i+o*a,c=s*i-n*a,p=t*l+e*u+r*c;return p?(p=1/p,this.mat3[0]=l*p,this.mat3[1]=(-h*e+r*s)*p,this.mat3[2]=(o*e-r*n)*p,this.mat3[3]=u*p,this.mat3[4]=(h*t-r*a)*p,this.mat3[5]=(-o*t+r*i)*p,this.mat3[6]=c*p,this.mat3[7]=(-s*t+e*a)*p,this.mat3[8]=(n*t-e*i)*p,this):null},i.Matrix.prototype.transpose3x3=function(t){var e=t[1],r=t[2],i=t[5];return this.mat3[1]=t[3],this.mat3[2]=t[6],this.mat3[3]=e,this.mat3[5]=t[7],this.mat3[6]=r,this.mat3[7]=i,this},i.Matrix.prototype.inverseTranspose=function(t){void 0===this.mat3?console.error("sorry, this function only works with mat3"):(this.mat3[0]=t.mat4[0],this.mat3[1]=t.mat4[1],this.mat3[2]=t.mat4[2],this.mat3[3]=t.mat4[4],this.mat3[4]=t.mat4[5],this.mat3[5]=t.mat4[6],this.mat3[6]=t.mat4[8],this.mat3[7]=t.mat4[9],this.mat3[8]=t.mat4[10]);var e=this.invert3x3();if(e)e.transpose3x3(this.mat3);else for(var r=0;r<9;r++)this.mat3[r]=0;return this},i.Matrix.prototype.determinant=function(){var t=this.mat4[0]*this.mat4[5]-this.mat4[1]*this.mat4[4],e=this.mat4[0]*this.mat4[6]-this.mat4[2]*this.mat4[4],r=this.mat4[0]*this.mat4[7]-this.mat4[3]*this.mat4[4],i=this.mat4[1]*this.mat4[6]-this.mat4[2]*this.mat4[5],n=this.mat4[1]*this.mat4[7]-this.mat4[3]*this.mat4[5],o=this.mat4[2]*this.mat4[7]-this.mat4[3]*this.mat4[6],a=this.mat4[8]*this.mat4[13]-this.mat4[9]*this.mat4[12],s=this.mat4[8]*this.mat4[14]-this.mat4[10]*this.mat4[12],h=this.mat4[8]*this.mat4[15]-this.mat4[11]*this.mat4[12],l=this.mat4[9]*this.mat4[14]-this.mat4[10]*this.mat4[13],u=this.mat4[9]*this.mat4[15]-this.mat4[11]*this.mat4[13];return t*(this.mat4[10]*this.mat4[15]-this.mat4[11]*this.mat4[14])-e*u+r*l+i*h-n*s+o*a},i.Matrix.prototype.mult=function(t){var e;if(t===this||t===this.mat4)e=this.copy().mat4;else if(t instanceof i.Matrix)e=t.mat4;else{if(!o(t))return;e=t}var r=this.mat4[0],n=this.mat4[1],a=this.mat4[2],s=this.mat4[3];return this.mat4[0]=r*e[0]+n*e[4]+a*e[8]+s*e[12],this.mat4[1]=r*e[1]+n*e[5]+a*e[9]+s*e[13],this.mat4[2]=r*e[2]+n*e[6]+a*e[10]+s*e[14],this.mat4[3]=r*e[3]+n*e[7]+a*e[11]+s*e[15],r=this.mat4[4],n=this.mat4[5],a=this.mat4[6],s=this.mat4[7],this.mat4[4]=r*e[0]+n*e[4]+a*e[8]+s*e[12],this.mat4[5]=r*e[1]+n*e[5]+a*e[9]+s*e[13],this.mat4[6]=r*e[2]+n*e[6]+a*e[10]+s*e[14],this.mat4[7]=r*e[3]+n*e[7]+a*e[11]+s*e[15],r=this.mat4[8],n=this.mat4[9],a=this.mat4[10],s=this.mat4[11],this.mat4[8]=r*e[0]+n*e[4]+a*e[8]+s*e[12],this.mat4[9]=r*e[1]+n*e[5]+a*e[9]+s*e[13],this.mat4[10]=r*e[2]+n*e[6]+a*e[10]+s*e[14],this.mat4[11]=r*e[3]+n*e[7]+a*e[11]+s*e[15],r=this.mat4[12],n=this.mat4[13],a=this.mat4[14],s=this.mat4[15],this.mat4[12]=r*e[0]+n*e[4]+a*e[8]+s*e[12],this.mat4[13]=r*e[1]+n*e[5]+a*e[9]+s*e[13],this.mat4[14]=r*e[2]+n*e[6]+a*e[10]+s*e[14],this.mat4[15]=r*e[3]+n*e[7]+a*e[11]+s*e[15],this},i.Matrix.prototype.scale=function(t,e,r){return t instanceof i.Vector?(e=t.y,r=t.z,t=t.x):t instanceof Array&&(e=t[1],r=t[2],t=t[0]),this.mat4[0]*=t,this.mat4[1]*=t,this.mat4[2]*=t,this.mat4[3]*=t,this.mat4[4]*=e,this.mat4[5]*=e,this.mat4[6]*=e,this.mat4[7]*=e,this.mat4[8]*=r,this.mat4[9]*=r,this.mat4[10]*=r,this.mat4[11]*=r,this},i.Matrix.prototype.rotate=function(t,e,r,n){var o=this.p5?this.p5._toRadians(t):t;e instanceof i.Vector?(r=e.y,n=e.z,e=e.x):e instanceof Array&&(r=e[1],n=e[2],e=e[0]);var a=Math.sqrt(e*e+r*r+n*n);e*=1/a,r*=1/a,n*=1/a;var s=this.mat4[0],h=this.mat4[1],l=this.mat4[2],u=this.mat4[3],c=this.mat4[4],p=this.mat4[5],d=this.mat4[6],f=this.mat4[7],m=this.mat4[8],v=this.mat4[9],g=this.mat4[10],y=this.mat4[11],b=Math.sin(o),_=Math.cos(o),x=1-_,w=e*e*x+_,S=r*e*x+n*b,T=n*e*x-r*b,E=e*r*x-n*b,M=r*r*x+_,R=n*r*x+e*b,C=e*n*x+r*b,P=r*n*x-e*b,L=n*n*x+_;return this.mat4[0]=s*w+c*S+m*T,this.mat4[1]=h*w+p*S+v*T,this.mat4[2]=l*w+d*S+g*T,this.mat4[3]=u*w+f*S+y*T,this.mat4[4]=s*E+c*M+m*R,this.mat4[5]=h*E+p*M+v*R,this.mat4[6]=l*E+d*M+g*R,this.mat4[7]=u*E+f*M+y*R,this.mat4[8]=s*C+c*P+m*L,this.mat4[9]=h*C+p*P+v*L,this.mat4[10]=l*C+d*P+g*L,this.mat4[11]=u*C+f*P+y*L,this},i.Matrix.prototype.translate=function(t){var e=t[0],r=t[1],i=t[2]||0;this.mat4[12]+=this.mat4[0]*e+this.mat4[4]*r+this.mat4[8]*i,this.mat4[13]+=this.mat4[1]*e+this.mat4[5]*r+this.mat4[9]*i,this.mat4[14]+=this.mat4[2]*e+this.mat4[6]*r+this.mat4[10]*i,this.mat4[15]+=this.mat4[3]*e+this.mat4[7]*r+this.mat4[11]*i},i.Matrix.prototype.rotateX=function(t){this.rotate(t,1,0,0)},i.Matrix.prototype.rotateY=function(t){this.rotate(t,0,1,0)},i.Matrix.prototype.rotateZ=function(t){this.rotate(t,0,0,1)},i.Matrix.prototype.perspective=function(t,e,r,i){var n=1/Math.tan(t/2),o=1/(r-i);return this.mat4[0]=n/e,this.mat4[1]=0,this.mat4[2]=0,this.mat4[3]=0,this.mat4[4]=0,this.mat4[5]=n,this.mat4[6]=0,this.mat4[7]=0,this.mat4[8]=0,this.mat4[9]=0,this.mat4[10]=(i+r)*o,this.mat4[11]=-1,this.mat4[12]=0,this.mat4[13]=0,this.mat4[14]=2*i*r*o,this.mat4[15]=0,this},i.Matrix.prototype.ortho=function(t,e,r,i,n,o){var a=1/(t-e),s=1/(r-i),h=1/(n-o);return this.mat4[0]=-2*a,this.mat4[1]=0,this.mat4[2]=0,this.mat4[3]=0,this.mat4[4]=0,this.mat4[5]=-2*s,this.mat4[6]=0,this.mat4[7]=0,this.mat4[8]=0,this.mat4[9]=0,this.mat4[10]=2*h,this.mat4[11]=0,this.mat4[12]=(t+e)*a,this.mat4[13]=(i+r)*s,this.mat4[14]=(o+n)*h,this.mat4[15]=1,this},e.exports=i.Matrix},{"../core/core":21}],69:[function(t,e,r){"use strict";var i=t("../core/core"),n=t("../core/constants");i.RendererGL.prototype.beginShape=function(t){return this.immediateMode.shapeMode=void 0!==t?t:n.LINE_STRIP,void 0===this.immediateMode.vertices?(this.immediateMode.vertices=[],this.immediateMode.edges=[],this.immediateMode.lineVertices=[],this.immediateMode.vertexColors=[],this.immediateMode.lineNormals=[],this.immediateMode.uvCoords=[],this.immediateMode.vertexBuffer=this.GL.createBuffer(),this.immediateMode.colorBuffer=this.GL.createBuffer(),this.immediateMode.uvBuffer=this.GL.createBuffer(),this.immediateMode.lineVertexBuffer=this.GL.createBuffer(),this.immediateMode.lineNormalBuffer=this.GL.createBuffer()):(this.immediateMode.vertices.length=0,this.immediateMode.edges.length=0,this.immediateMode.lineVertices.length=0,this.immediateMode.lineNormals.length=0,this.immediateMode.vertexColors.length=0,this.immediateMode.uvCoords.length=0),this.isImmediateDrawing=!0,this},i.RendererGL.prototype.vertex=function(t,e){var r,n,o;r=n=o=0,3===arguments.length?r=arguments[2]:4===arguments.length?(n=arguments[2],o=arguments[3]):5===arguments.length&&(r=arguments[2],n=arguments[3],o=arguments[4]);var a=new i.Vector(t,e,r);this.immediateMode.vertices.push(a);var s=this.curFillColor||[.5,.5,.5,1];return this.immediateMode.vertexColors.push(s[0],s[1],s[2],s[3]),this.immediateMode.uvCoords.push(n,o),this},i.RendererGL.prototype.endShape=function(t,e,r,o,a,s){if(this._useImmediateModeShader(),this._doStroke&&this.drawMode!==n.TEXTURE){for(var h=0;h<this.immediateMode.vertices.length-1;h++)this.immediateMode.edges.push([h,h+1]);t===n.CLOSE&&this.immediateMode.edges.push([this.immediateMode.vertices.length-1,0]),i.Geometry.prototype._edgesToVertices.call(this.immediateMode),this._drawStrokeImmediateMode()}return this._doFill&&this._drawFillImmediateMode(t,e,r,o,a,s),this.immediateMode.vertices.length=0,this.immediateMode.vertexColors.length=0,this.immediateMode.uvCoords.length=0,this.isImmediateDrawing=!1,this},i.RendererGL.prototype._drawFillImmediateMode=function(t,e,r,i,o,a){var s=this.GL;if(this.curFillShader.bindShader(),this.curFillShader.attributes.aPosition&&(this._bindBuffer(this.immediateMode.vertexBuffer,s.ARRAY_BUFFER,this._vToNArray(this.immediateMode.vertices),Float32Array,s.DYNAMIC_DRAW),this.curFillShader.enableAttrib(this.curFillShader.attributes.aPosition.location,3,s.FLOAT,!1,0,0)),this.drawMode===n.FILL&&this.curFillShader.attributes.aVertexColor&&(this._bindBuffer(this.immediateMode.colorBuffer,s.ARRAY_BUFFER,this.immediateMode.vertexColors,Float32Array,s.DYNAMIC_DRAW),this.curFillShader.enableAttrib(this.curFillShader.attributes.aVertexColor.location,4,s.FLOAT,!1,0,0)),this.drawMode===n.TEXTURE&&this.curFillShader.attributes.aTexCoord&&(this._bindBuffer(this.immediateMode.uvBuffer,s.ARRAY_BUFFER,this.immediateMode.uvCoords,Float32Array,s.DYNAMIC_DRAW),this.curFillShader.enableAttrib(this.curFillShader.attributes.aTexCoord.location,2,s.FLOAT,!1,0,0)),this.drawMode===n.FILL||this.drawMode===n.TEXTURE)switch(this.immediateMode.shapeMode){case n.LINE_STRIP:case n.LINES:case n.TRIANGLES:this.immediateMode.shapeMode=n.TRIANGLE_FAN}else switch(this.immediateMode.shapeMode){case n.LINE_STRIP:case n.LINES:this.immediateMode.shapeMode=n.LINE_LOOP}if(this.immediateMode.shapeMode===n.QUADS||this.immediateMode.shapeMode===n.QUAD_STRIP)throw new Error("sorry, "+this.immediateMode.shapeMode+" not yet implemented in webgl mode.");this._applyColorBlend(this.curFillColor),s.enable(s.BLEND),s.drawArrays(this.immediateMode.shapeMode,0,this.immediateMode.vertices.length),this.curFillShader.unbindShader()},i.RendererGL.prototype._drawStrokeImmediateMode=function(){var t=this.GL;this.curStrokeShader.bindShader(),this.curStrokeShader.attributes.aPosition&&(this._bindBuffer(this.immediateMode.lineVertexBuffer,t.ARRAY_BUFFER,this._flatten(this.immediateMode.lineVertices),Float32Array,t.STATIC_DRAW),this.curStrokeShader.enableAttrib(this.curStrokeShader.attributes.aPosition.location,3,t.FLOAT,!1,0,0)),this.curStrokeShader.attributes.aDirection&&(this._bindBuffer(this.immediateMode.lineNormalBuffer,t.ARRAY_BUFFER,this._flatten(this.immediateMode.lineNormals),Float32Array,t.STATIC_DRAW),this.curStrokeShader.enableAttrib(this.curStrokeShader.attributes.aDirection.location,4,t.FLOAT,!1,0,0)),this._applyColorBlend(this.curStrokeColor),t.drawArrays(t.TRIANGLES,0,this.immediateMode.lineVertices.length),this.curStrokeShader.unbindShader()},e.exports=i.RendererGL},{"../core/constants":20,"../core/core":21}],70:[function(t,e,r){"use strict";var i=t("../core/core"),n=0;i.RendererGL.prototype._initBufferDefaults=function(t){if(this._freeBuffers(t),++n>1e3){var e=Object.keys(this.gHash)[0];delete this.gHash[e],n--}this.gHash[t]={}},i.RendererGL.prototype._freeBuffers=function(t){var e=this.gHash[t];if(e){delete this.gHash[t],n--;var r=this.GL;e.vertexBuffer&&r.deleteBuffer(e.vertexBuffer),e.normalBuffer&&r.deleteBuffer(e.normalBuffer),e.lineNormalBuffer&&r.deleteBuffer(e.lineNormalBuffer),e.uvBuffer&&r.deleteBuffer(e.uvBuffer),e.indexBuffer&&r.deleteBuffer(e.indexBuffer),e.lineVertexBuffer&&r.deleteBuffer(e.lineVertexBuffer)}},i.RendererGL.prototype.createBuffers=function(t,e){var r=this.GL;this._setDefaultCamera(),this._initBufferDefaults(t);var i=this.gHash[t];i.numberOfItems=3*e.faces.length,i.lineVertexCount=e.lineVertices.length,this._useColorShader(),this.curStrokeShader.attributes.aPosition&&(i.lineVertexBuffer=r.createBuffer(),this._bindBuffer(i.lineVertexBuffer,r.ARRAY_BUFFER,this._flatten(e.lineVertices),Float32Array,r.STATIC_DRAW),this.curStrokeShader.enableAttrib(this.curStrokeShader.attributes.aPosition.location,3,r.FLOAT,!1,0,0)),this.curStrokeShader.attributes.aDirection&&(i.lineNormalBuffer=r.createBuffer(),this._bindBuffer(i.lineNormalBuffer,r.ARRAY_BUFFER,this._flatten(e.lineNormals),Float32Array,r.STATIC_DRAW),this.curStrokeShader.enableAttrib(this.curStrokeShader.attributes.aDirection.location,4,r.FLOAT,!1,0,0)),this.curFillShader.attributes.aPosition&&(i.vertexBuffer=r.createBuffer(),this._bindBuffer(i.vertexBuffer,r.ARRAY_BUFFER,this._vToNArray(e.vertices),Float32Array,r.STATIC_DRAW),this.curFillShader.enableAttrib(this.curFillShader.attributes.aPosition.location,3,r.FLOAT,!1,0,0)),i.indexBuffer=r.createBuffer(),this._bindBuffer(i.indexBuffer,r.ELEMENT_ARRAY_BUFFER,this._flatten(e.faces),Uint16Array,r.STATIC_DRAW),this.curFillShader.attributes.aNormal&&(i.normalBuffer=r.createBuffer(),this._bindBuffer(i.normalBuffer,r.ARRAY_BUFFER,this._vToNArray(e.vertexNormals),Float32Array,r.STATIC_DRAW),this.curFillShader.enableAttrib(this.curFillShader.attributes.aNormal.location,3,r.FLOAT,!1,0,0)),this.curFillShader.attributes.aTexCoord&&(i.uvBuffer=r.createBuffer(),this._bindBuffer(i.uvBuffer,r.ARRAY_BUFFER,this._flatten(e.uvs),Float32Array,r.STATIC_DRAW),this.curFillShader.enableAttrib(this.curFillShader.attributes.aTexCoord.location,2,r.FLOAT,!1,0,0))},i.RendererGL.prototype.drawBuffers=function(t){this._setDefaultCamera();var e=this.GL;this._useColorShader();var r=this.gHash[t];return this._doStroke&&r.lineVertexCount>0&&(this.curStrokeShader.bindShader(),r.lineVertexBuffer&&(this._bindBuffer(r.lineVertexBuffer,e.ARRAY_BUFFER),this.curStrokeShader.enableAttrib(this.curStrokeShader.attributes.aPosition.location,3,e.FLOAT,!1,0,0)),r.lineNormalBuffer&&(this._bindBuffer(r.lineNormalBuffer,e.ARRAY_BUFFER),this.curStrokeShader.enableAttrib(this.curStrokeShader.attributes.aDirection.location,4,e.FLOAT,!1,0,0)),this._applyColorBlend(this.curStrokeColor),this._drawArrays(e.TRIANGLES,t),this.curStrokeShader.unbindShader()),!1!==this._doFill&&(this.curFillShader.bindShader(),r.vertexBuffer&&(this._bindBuffer(r.vertexBuffer,e.ARRAY_BUFFER),this.curFillShader.enableAttrib(this.curFillShader.attributes.aPosition.location,3,e.FLOAT,!1,0,0)),r.indexBuffer&&this._bindBuffer(r.indexBuffer,e.ELEMENT_ARRAY_BUFFER),r.normalBuffer&&(this._bindBuffer(r.normalBuffer,e.ARRAY_BUFFER),this.curFillShader.enableAttrib(this.curFillShader.attributes.aNormal.location,3,e.FLOAT,!1,0,0)),r.uvBuffer&&(this._bindBuffer(r.uvBuffer,e.ARRAY_BUFFER),this.curFillShader.enableAttrib(this.curFillShader.attributes.aTexCoord.location,2,e.FLOAT,!1,0,0)),this._applyColorBlend(this.curFillColor),this._drawElements(e.TRIANGLES,t),this.curFillShader.unbindShader()),this},i.RendererGL.prototype.drawBuffersScaled=function(t,e,r,i){var n=this.uMVMatrix.copy();try{this.uMVMatrix.scale(e,r,i),this.drawBuffers(t)}finally{this.uMVMatrix=n}},i.RendererGL.prototype._drawArrays=function(t,e){return this.GL.drawArrays(t,0,this.gHash[e].lineVertexCount),this},i.RendererGL.prototype._drawElements=function(t,e){this.GL.drawElements(t,this.gHash[e].numberOfItems,this.GL.UNSIGNED_SHORT,0)},e.exports=i.RendererGL},{"../core/core":21}],71:[function(t,e,r){"use strict";var i=t("../core/core"),n=t("../core/constants");t("./p5.Shader"),t("../core/p5.Renderer"),t("./p5.Matrix");var o="attribute vec3 aPosition;\nattribute vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uResolution;\nuniform float uPointSize;\n\nvarying vec4 vColor;\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n gl_PointSize = uPointSize;\n}\n",a="precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}",s="attribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nvarying vec3 vVertexNormal;\nvarying highp vec2 vVertTexCoord;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vVertexNormal = normalize(vec3( uNormalMatrix * aNormal ));\n vVertTexCoord = aTexCoord;\n}\n",h="precision mediump float;\nvarying vec3 vVertexNormal;\nvoid main(void) {\n gl_FragColor = vec4(vVertexNormal, 1.0);\n}",l="precision mediump float;\nvarying vec3 vVertexNormal;\nuniform vec4 uMaterialColor;\nvoid main(void) {\n gl_FragColor = uMaterialColor;\n}",u="attribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\n\nuniform mat4 uViewMatrix;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\nuniform int uAmbientLightCount;\nuniform int uDirectionalLightCount;\nuniform int uPointLightCount;\n\nuniform vec3 uAmbientColor[8];\nuniform vec3 uLightingDirection[8];\nuniform vec3 uDirectionalColor[8];\nuniform vec3 uPointLightLocation[8];\nuniform vec3 uPointLightColor[8];\nuniform bool uSpecular;\n\nvarying vec3 vVertexNormal;\nvarying vec2 vVertTexCoord;\nvarying vec3 vLightWeighting;\n\nvoid main(void){\n\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\n vec3 vertexNormal = normalize(vec3( uNormalMatrix * aNormal ));\n vVertexNormal = vertexNormal;\n vVertTexCoord = aTexCoord;\n\n vec4 mvPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n vec3 eyeDirection = normalize(-mvPosition.xyz);\n\n float shininess = 32.0;\n float specularFactor = 2.0;\n float diffuseFactor = 0.3;\n\n vec3 ambientLightFactor = vec3(0.0);\n\n for (int i = 0; i < 8; i++) {\n if (uAmbientLightCount == i) break;\n ambientLightFactor += uAmbientColor[i];\n }\n\n\n vec3 directionalLightFactor = vec3(0.0);\n\n for (int j = 0; j < 8; j++) {\n if (uDirectionalLightCount == j) break;\n vec3 dir = uLightingDirection[j];\n float directionalLightWeighting = max(dot(vertexNormal, -dir), 0.0);\n directionalLightFactor += uDirectionalColor[j] * directionalLightWeighting;\n }\n\n\n vec3 pointLightFactor = vec3(0.0);\n\n for (int k = 0; k < 8; k++) {\n if (uPointLightCount == k) break;\n vec3 loc = (uViewMatrix * vec4(uPointLightLocation[k], 1.0)).xyz;\n vec3 lightDirection = normalize(loc - mvPosition.xyz);\n\n float directionalLightWeighting = max(dot(vertexNormal, lightDirection), 0.0);\n\n float specularLightWeighting = 0.0;\n if (uSpecular ){\n vec3 reflectionDirection = reflect(-lightDirection, vertexNormal);\n specularLightWeighting = pow(max(dot(reflectionDirection, eyeDirection), 0.0), shininess);\n }\n\n pointLightFactor += uPointLightColor[k] * (specularFactor * specularLightWeighting\n + directionalLightWeighting * diffuseFactor);\n }\n\n vLightWeighting = ambientLightFactor + directionalLightFactor + pointLightFactor;\n}\n",c="precision mediump float;\n\nuniform vec4 uMaterialColor;\nuniform sampler2D uSampler;\nuniform bool isTexture;\nuniform bool uUseLighting;\n\nvarying vec3 vLightWeighting;\nvarying highp vec2 vVertTexCoord;\n\nvoid main(void) {\n gl_FragColor = isTexture ? texture2D(uSampler, vVertTexCoord) : uMaterialColor;\n if (uUseLighting)\n gl_FragColor.rgb *= vLightWeighting;\n}",p="precision mediump float;\n\nattribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\n\nuniform vec3 uAmbientColor[8];\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\nuniform int uAmbientLightCount;\n\nvarying vec3 vNormal;\nvarying vec2 vTexCoord;\nvarying vec3 vViewPosition;\nvarying vec3 vAmbientColor;\n\nvoid main(void){\n\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n\n // Pass varyings to fragment shader\n vViewPosition = viewModelPosition.xyz;\n gl_Position = uProjectionMatrix * viewModelPosition; \n\n vNormal = normalize(uNormalMatrix * normalize(aNormal));\n vTexCoord = aTexCoord;\n\n vAmbientColor = vec3(0.0);\n for (int i = 0; i < 8; i++) {\n if (uAmbientLightCount == i) break;\n vAmbientColor += uAmbientColor[i];\n }\n}\n",d="precision mediump float;\n\n//uniform mat4 uModelViewMatrix;\nuniform mat4 uViewMatrix;\n\nuniform vec4 uMaterialColor;\nuniform sampler2D uSampler;\nuniform bool isTexture;\nuniform bool uUseLighting;\n\nuniform vec3 uLightingDirection[8];\nuniform vec3 uDirectionalColor[8];\nuniform vec3 uPointLightLocation[8];\nuniform vec3 uPointLightColor[8];\nuniform bool uSpecular;\n\nuniform int uDirectionalLightCount;\nuniform int uPointLightCount;\n\nvarying vec3 vNormal;\nvarying vec2 vTexCoord;\nvarying vec3 vViewPosition;\nvarying vec3 vAmbientColor;\n\nvec3 V;\nvec3 N;\n\nconst float shininess = 32.0;\nconst float specularFactor = 2.0;\nconst float diffuseFactor = 0.73;\n\nstruct LightResult {\n\tfloat specular;\n\tfloat diffuse;\n};\n\nfloat phongSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float shininess) {\n\n vec3 R = normalize(reflect(-lightDirection, surfaceNormal)); \n return pow(max(0.0, dot(R, viewDirection)), shininess);\n}\n\nfloat lambertDiffuse(\n vec3 lightDirection,\n vec3 surfaceNormal) {\n return max(0.0, dot(-lightDirection, surfaceNormal));\n}\n\nLightResult light(vec3 lightVector) {\n\n vec3 L = normalize(lightVector);\n\n //compute our diffuse & specular terms\n LightResult lr;\n if (uSpecular)\n lr.specular = phongSpecular(L, V, N, shininess);\n lr.diffuse = lambertDiffuse(L, N);\n return lr;\n}\n\nvoid main(void) {\n\n V = normalize(vViewPosition);\n N = vNormal;\n\n vec3 diffuse = vec3(0.0);\n float specular = 0.0;\n\n for (int j = 0; j < 8; j++) {\n if (uDirectionalLightCount == j) break;\n\n LightResult result = light(uLightingDirection[j]);\n diffuse += result.diffuse * uDirectionalColor[j];\n specular += result.specular;\n }\n\n for (int k = 0; k < 8; k++) {\n if (uPointLightCount == k) break;\n\n vec3 lightPosition = (uViewMatrix * vec4(uPointLightLocation[k], 1.0)).xyz;\n vec3 lightVector = vViewPosition - lightPosition;\n\t\n //calculate attenuation\n float lightDistance = length(lightVector);\n float falloff = 500.0 / (lightDistance + 500.0);\n\n LightResult result = light(lightVector);\n diffuse += result.diffuse * falloff * uPointLightColor[k];\n specular += result.specular * falloff;\n }\n\n gl_FragColor = isTexture ? texture2D(uSampler, vTexCoord) : uMaterialColor;\n gl_FragColor.rgb = gl_FragColor.rgb * (diffuse * diffuseFactor + vAmbientColor) + specular * specularFactor;\n}",f="/*\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;\nvec3 scale = vec3(1.0);\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\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 // 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 vec2 perspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n\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 vec2 noPerspScale = p.w / (0.5 * uViewport.zw);\n\n //gl_Position.xy = p.xy + offset.xy * mix(noPerspScale, perspScale, float(perspective > 0));\n gl_Position.xy = p.xy + offset.xy * perspScale;\n gl_Position.zw = p.zw;\n}\n",m="precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}";i.RendererGL=function(t,e,r,n){return i.Renderer.call(this,t,e,r),this.attributes={},n=n||{},this.attributes.alpha=void 0===n.alpha||n.alpha,this.attributes.depth=void 0===n.depth||n.depth,this.attributes.stencil=void 0===n.stencil||n.stencil,this.attributes.antialias=void 0!==n.antialias&&n.antialias,this.attributes.premultipliedAlpha=void 0!==n.premultipliedAlpha&&n.premultipliedAlpha,this.attributes.preserveDrawingBuffer=void 0===n.preserveDrawingBuffer||n.preserveDrawingBuffer,this.attributes.perPixelLighting=void 0!==n.perPixelLighting&&n.perPixelLighting,this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this.ambientLightColors=[],this.directionalLightDirections=[],this.directionalLightColors=[],this.pointLightPositions=[],this.pointLightColors=[],this.uMVMatrix=new i.Matrix,this.uPMatrix=new i.Matrix,this.uNMatrix=new i.Matrix("mat3"),this._curCamera=null,this._computeCameraDefaultSettings(),this.cameraFOV=this.defaultCameraFOV,this.cameraAspect=this.defaultAspect,this.cameraX=this.defaultCameraX,this.cameraY=this.defaultCameraY,this.cameraZ=this.defaultCameraZ,this.cameraNear=this.defaultCameraNear,this.cameraFar=this.defaultCameraFar,this.cameraMatrix=new i.Matrix,this.camera(),this.gHash={},this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this.curFillShader=void 0,this.curStrokeShader=void 0,this._useColorShader(),this.setStrokeShader(this._getLineShader()),this.isImmediateDrawing=!1,this.immediateMode={},this.fill(255,255,255,255),this.pointSize=5,this.strokeWeight(2),this.stroke(0,0,0),this.textures=[],this},i.RendererGL.prototype=Object.create(i.Renderer.prototype),i.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this.attributes)||this.canvas.getContext("experimental-webgl",this.attributes),null===this.drawingContext)throw new Error("Error creating webgl context");console.log("p5.RendererGL: enabled webgl context");var t=this.drawingContext;t.enable(t.DEPTH_TEST),t.depthFunc(t.LEQUAL),t.viewport(0,0,t.drawingBufferWidth,t.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(t){throw new Error(t)}},i.RendererGL.prototype._resetContext=function(t,e,r){var n=this.width,o=this.height,a=this.canvas.id,s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=a,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s;var h=new i.RendererGL(this._pInst.canvas,this._pInst,!0,t);this._pInst._setProperty("_renderer",h),h.resize(n,o),h._applyDefaults(),this._pInst._elements.push(h),"function"==typeof r&&setTimeout(function(){r.apply(window._renderer,e)},0)},i.prototype.setAttributes=function(t,e){var r;this._assert3d("setAttributes"),void 0!==e?(r={})[t]=e:t instanceof Object&&(r=t),this.push(),this._renderer._resetContext(r),this.pop()},i.RendererGL.prototype._computeCameraDefaultSettings=function(){this.defaultCameraFOV=60/180*Math.PI,this.defaultCameraAspect=this.width/this.height,this.defaultCameraX=0,this.defaultCameraY=0,this.defaultCameraZ=this.height/2/Math.tan(this.defaultCameraFOV/2),this.defaultCameraNear=.1*this.defaultCameraZ,this.defaultCameraFar=10*this.defaultCameraZ},i.RendererGL.prototype._setDefaultCamera=function(){null===this._curCamera&&(this._computeCameraDefaultSettings(),this.cameraFOV=this.defaultCameraFOV,this.cameraAspect=this.defaultAspect,this.cameraX=this.defaultCameraX,this.cameraY=this.defaultCameraY,this.cameraZ=this.defaultCameraZ,this.cameraNear=this.defaultCameraNear,this.cameraFar=this.defaultCameraFar,this.perspective(),this.camera(),this._curCamera="default")},i.RendererGL.prototype._update=function(){this.uMVMatrix.set(this.cameraMatrix.mat4[0],this.cameraMatrix.mat4[1],this.cameraMatrix.mat4[2],this.cameraMatrix.mat4[3],this.cameraMatrix.mat4[4],this.cameraMatrix.mat4[5],this.cameraMatrix.mat4[6],this.cameraMatrix.mat4[7],this.cameraMatrix.mat4[8],this.cameraMatrix.mat4[9],this.cameraMatrix.mat4[10],this.cameraMatrix.mat4[11],this.cameraMatrix.mat4[12],this.cameraMatrix.mat4[13],this.cameraMatrix.mat4[14],this.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.directionalLightDirections.length=0,this.directionalLightColors.length=0,this.pointLightPositions.length=0,this.pointLightColors.length=0},i.RendererGL.prototype.background=function(){var t=this._pInst.color.apply(this._pInst,arguments),e=t.levels[0]/255,r=t.levels[1]/255,i=t.levels[2]/255,n=t.levels[3]/255;this.GL.clearColor(e,r,i,n),this.GL.depthMask(!0),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},i.RendererGL.prototype.fill=function(t,e,r,o){var a=i.prototype.color.apply(this._pInst,arguments);this.curFillColor=a._array,this.isImmediateDrawing?this.setFillShader(this._getImmediateModeShader()):this.setFillShader(this._getColorShader()),this.drawMode=n.FILL,this.curFillShader.setUniform("uMaterialColor",this.curFillColor)},i.RendererGL.prototype.stroke=function(t,e,r,n){arguments[3]=255;var o=i.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=o._array,this.curStrokeShader.setUniform("uMaterialColor",this.curStrokeColor)},i.RendererGL.prototype.strokeWeight=function(t){this.curStrokeWeight!==t&&(this.pointSize=t,this.curStrokeWeight=t,this.curStrokeShader.setUniform("uStrokeWeight",t))},i.RendererGL.prototype.get=function(t,e,r,n){return i.Renderer2D.prototype.get.apply(this,[t,e,r,n])},i.RendererGL.prototype.loadPixels=function(){if(!0===this.attributes.preserveDrawingBuffer){var t=this._pInst._pixelDensity,e=this.width,r=this.height;e*=t,r*=t,void 0===this.pixels&&(this.pixels=new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4)),this.GL.readPixels(0,0,e,r,this.GL.RGBA,this.GL.UNSIGNED_BYTE,this.pixels),this._pInst._setProperty("pixels",this.pixels)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},i.RendererGL.prototype.geometryInHash=function(t){return void 0!==this.gHash[t]},i.RendererGL.prototype.resize=function(t,e){i.Renderer.prototype.resize.call(this,t,e),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),null!==this._curCamera&&"default"!==this._curCamera||(this._curCamera=null,this._setDefaultCamera()),void 0!==this.pixels&&(this.pixels=new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},i.RendererGL.prototype.clear=function(){var t=arguments[0]||0,e=arguments[1]||0,r=arguments[2]||0,i=arguments[3]||0;this.GL.clearColor(t,e,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},i.RendererGL.prototype.translate=function(t,e,r){return t instanceof i.Vector&&(r=t.z,e=t.y,t=t.x),this.uMVMatrix.translate([t,e,r]),this},i.RendererGL.prototype.scale=function(t,e,r){return this.uMVMatrix.scale(t,e,r),this},i.RendererGL.prototype.rotate=function(t,e){return void 0===e?this.rotateZ(t):(i.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},i.RendererGL.prototype.rotateX=function(t){return this.rotate(t,1,0,0),this},i.RendererGL.prototype.rotateY=function(t){return this.rotate(t,0,1,0),this},i.RendererGL.prototype.rotateZ=function(t){return this.rotate(t,0,0,1),this},i.RendererGL.prototype.push=function(){var t=i.Renderer.prototype.push.apply(this),e=t.properties;return e.uMVMatrix=this.uMVMatrix.copy(),e.cameraMatrix=this.cameraMatrix.copy(),t},i.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=i.Matrix.identity(this._pInst),this},i.RendererGL.prototype._applyTextProperties=function(){console.error("text commands not yet implemented in webgl")},i.RendererGL.prototype.setFillShader=function(t){return this.curFillShader!==t&&(this.curFillShader=t,this.curFillShader.init()),this.curFillShader},i.RendererGL.prototype.setStrokeShader=function(t){return this.curStrokeShader!==t&&(this.curStrokeShader=t,this.curStrokeShader.init()),this.curStrokeShader},i.RendererGL.prototype._useLightShader=function(){return this.curFillShader&&this.curFillShader.isLightShader()||this.setFillShader(this._getLightShader()),this.curFillShader},i.RendererGL.prototype._useColorShader=function(){return this.curFillShader&&this.curFillShader!==this._defaultImmediateModeShader||this.setFillShader(this._getColorShader()),this.curFillShader},i.RendererGL.prototype._useImmediateModeShader=function(){return this.curFillShader&&this.curFillShader!==this._defaultColorShader||this.setFillShader(this._getImmediateModeShader()),this.curFillShader},i.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this.attributes.perPixelLighting?this._defaultLightShader=new i.Shader(this,p,d):this._defaultLightShader=new i.Shader(this,u,c)),this._defaultLightShader},i.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new i.Shader(this,o,a)),this._defaultImmediateModeShader},i.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new i.Shader(this,s,h)),this._defaultNormalShader},i.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new i.Shader(this,s,l)),this._defaultColorShader},i.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new i.Shader(this,f,m)),this._defaultLineShader},i.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var t=new i.Image(1,1);t.set(0,0,255),this._emptyTexture=new i.Texture(this,t)}return this._emptyTexture},i.RendererGL.prototype.getTexture=function(t){var e=this.textures.find(function(e){return e.src===t});return e||(e=new i.Texture(this,t),this.textures.push(e)),e},i.RendererGL.prototype._bindBuffer=function(t,e,r,i,n){if(this.GL.bindBuffer(e,t),void 0!==r){var o=new i(r);this.GL.bufferData(e,o,n)}},i.RendererGL.prototype.smooth=function(){console.log("smoothing not yet implemented in webgl")},i.RendererGL.prototype.noSmooth=function(){console.log("smoothing not yet implemented in webgl")},i.RendererGL.prototype._flatten=function(t){if(0===t.length)return[];if(t.length>2e4){var e,r=Object.prototype.toString,i=[],n=t.slice();e=n.pop();do{"[object Array]"===r.call(e)?n.push.apply(n,e):i.push(e)}while(n.length&&void 0!==(e=n.pop()));return i.reverse(),i}return[].concat.apply([],t)},i.RendererGL.prototype._vToNArray=function(t){return this._flatten(t.map(function(t){return[t.x,t.y,t.z]}))},i.prototype._assert3d=function(t){if(!this._renderer.isP3D)throw new Error(t+"() is only supported in WEBGL mode. If you'd like to use 3D graphics and WebGL, see https://p5js.org/examples/form-3d-primitives.html for more information.")},e.exports=i.RendererGL},{"../core/constants":20,"../core/core":21,"../core/p5.Renderer":28,"./p5.Matrix":68,"./p5.Shader":72}],72:[function(t,e,r){"use strict";var i=t("../core/core");i.Shader=function(t,e,r){return this._renderer=t,this._vertSrc=e,this._fragSrc=r,this._vertShader=-1,this._fragShader=-1,this._glProgram=0,this._loadedAttributes=!1,this.attributes={},this._loadedUniforms=!1,this.uniforms={},this._bound=!1,this.samplers=[],this},i.Shader.prototype.init=function(){if(0===this._glProgram){var t=this._renderer.GL;if(this._vertShader=t.createShader(t.VERTEX_SHADER),t.shaderSource(this._vertShader,this._vertSrc),t.compileShader(this._vertShader),!t.getShaderParameter(this._vertShader,t.COMPILE_STATUS))return console.error("Yikes! An error occurred compiling the vertex shader:"+t.getShaderInfoLog(this._vertShader)),null;if(this._fragShader=t.createShader(t.FRAGMENT_SHADER),t.shaderSource(this._fragShader,this._fragSrc),t.compileShader(this._fragShader),!t.getShaderParameter(this._fragShader,t.COMPILE_STATUS))return console.error("Darn! An error occurred compiling the fragment shader:"+t.getShaderInfoLog(this._fragShader)),null;this._glProgram=t.createProgram(),t.attachShader(this._glProgram,this._vertShader),t.attachShader(this._glProgram,this._fragShader),t.linkProgram(this._glProgram),t.getProgramParameter(this._glProgram,t.LINK_STATUS)||console.error("Snap! Error linking shader program: "+t.getProgramInfoLog(this._glProgram)),this._loadAttributes(),this._loadUniforms()}return this},i.Shader.prototype._loadAttributes=function(){if(!this._loadedAttributes){this.attributes={};for(var t=this._renderer.GL,e=t.getProgramParameter(this._glProgram,t.ACTIVE_ATTRIBUTES),r=0;r<e;++r){var i=t.getActiveAttrib(this._glProgram,r),n=i.name,o=t.getAttribLocation(this._glProgram,n),a={};a.name=n,a.location=o,a.type=i.type,a.size=i.size,this.attributes[n]=a}this._loadedAttributes=!0}},i.Shader.prototype._loadUniforms=function(){if(!this._loadedUniforms){for(var t=this._renderer.GL,e=t.getProgramParameter(this._glProgram,t.ACTIVE_UNIFORMS),r=0,i=0;i<e;++i){var n=t.getActiveUniform(this._glProgram,i),o={};o.location=t.getUniformLocation(this._glProgram,n.name),o.size=n.size;var a=n.name;n.size>1&&(a=a.substring(0,a.indexOf("[0]"))),o.name=a,o.type=n.type,o.type===t.SAMPLER_2D&&(o.samplerIndex=r,r++,this.samplers.push(o)),this.uniforms[a]=o}this._loadedUniforms=!0}},i.Shader.prototype.compile=function(){},i.Shader.prototype.bindShader=function(){this.init(),this._bound||(this.useProgram(),this._bound=!0,this.bindTextures(),this._loadAttributes(),this._loadUniforms(),this._renderer._setDefaultCamera(),this._setMatrixUniforms(),this===this._renderer.curStrokeShader&&this._setViewportUniform())},i.Shader.prototype.unbindShader=function(){return this._bound&&(this.unbindTextures(),this._bound=!1),this},i.Shader.prototype.bindTextures=function(){for(var t=this._renderer.GL,e=0;e<this.samplers.length;e++){var r=this.samplers[e],i=r.texture;void 0===i&&(i=this._renderer._getEmptyTexture()),t.activeTexture(t.TEXTURE0+r.samplerIndex),i.bindTexture(),i.update(),t.uniform1i(r.location,r.samplerIndex)}},i.Shader.prototype.unbindTextures=function(){},i.Shader.prototype._setMatrixUniforms=function(){this.setUniform("uProjectionMatrix",this._renderer.uPMatrix.mat4),this.setUniform("uModelViewMatrix",this._renderer.uMVMatrix.mat4),this.setUniform("uViewMatrix",this._renderer.cameraMatrix.mat4),this===this._renderer.curFillShader&&(this._renderer.uNMatrix.inverseTranspose(this._renderer.uMVMatrix),this.setUniform("uNormalMatrix",this._renderer.uNMatrix.mat3))},i.Shader.prototype._setViewportUniform=function(){this.setUniform("uViewport",this._renderer._viewport)},i.Shader.prototype.useProgram=function(){return this._renderer.GL.useProgram(this._glProgram),this},i.Shader.prototype.setUniform=function(t,e){var r=this.uniforms[t];if(r){var i=r.location,n=this._renderer.GL;switch(this.useProgram(),r.type){case n.BOOL:!0===e?n.uniform1i(i,1):n.uniform1i(i,0);break;case n.INT:r.size>1?e.length&&n.uniform1iv(i,e):n.uniform1i(i,e);break;case n.FLOAT:r.size>1?e.length&&n.uniform1fv(i,e):n.uniform1f(i,e);break;case n.FLOAT_MAT3:n.uniformMatrix3fv(i,!1,e);break;case n.FLOAT_MAT4:n.uniformMatrix4fv(i,!1,e);break;case n.FLOAT_VEC2:r.size>1?e.length&&n.uniform2fv(i,e):n.uniform2f(i,e[0],e[1]);break;case n.FLOAT_VEC3:r.size>1?e.length&&n.uniform3fv(i,e):n.uniform3f(i,e[0],e[1],e[2]);break;case n.FLOAT_VEC4:r.size>1?e.length&&n.uniform4fv(i,e):n.uniform4f(i,e[0],e[1],e[2],e[3]);break;case n.SAMPLER_2D:n.activeTexture(n.TEXTURE0+r.samplerIndex),r.texture=this._renderer.getTexture(e),n.uniform1i(r.location,r.samplerIndex)}return this}},i.Shader.prototype.isLightShader=function(){return void 0!==this.uniforms.uUseLighting||void 0!==this.uniforms.uAmbientLightCount||void 0!==this.uniforms.uDirectionalLightCount||void 0!==this.uniforms.uPointLightCount||void 0!==this.uniforms.uAmbientColor||void 0!==this.uniforms.uDirectionalColor||void 0!==this.uniforms.uPointLightLocation||void 0!==this.uniforms.uPointLightColor||void 0!==this.uniforms.uLightingDirection||void 0!==this.uniforms.uSpecular},i.Shader.prototype.isTextureShader=function(){return this.samplerIndex>0},i.Shader.prototype.isColorShader=function(){return void 0!==this.attributes.aVertexColor||void 0!==this.uniforms.uMaterialColor},i.Shader.prototype.isTexLightShader=function(){return this.isLightShader()&&this.isTextureShader()},i.Shader.prototype.isStrokeShader=function(){return void 0!==this.uniforms.uStrokeWeight},i.Shader.prototype.enableAttrib=function(t,e,r,i,n,o){var a=this._renderer.GL;return-1!==t&&(a.enableVertexAttribArray(t),a.vertexAttribPointer(t,e,r,i,n,o)),this},e.exports=i.Shader},{"../core/core":21}],73:[function(t,e,r){"use strict";var i=t("../core/core");i.Texture=function(t,e){this._renderer=t;var r=this._renderer.GL;this.src=e,this.glTex=void 0,this.glTarget=r.TEXTURE_2D,this.glFormat=r.RGBA,this.mipmaps=!1,this.glMinFilter=r.LINEAR,this.glMagFilter=r.LINEAR,this.glWrapS=r.CLAMP_TO_EDGE,this.glWrapT=r.CLAMP_TO_EDGE,this.isSrcMediaElement=void 0!==i.MediaElement&&e instanceof i.MediaElement,this._videoPrevUpdateTime=0,this.isSrcHTMLElement=void 0!==i.Element&&e instanceof i.Element&&!(e instanceof i.Graphics),this.isSrcP5Image=e instanceof i.Image,this.isSrcP5Graphics=e instanceof i.Graphics;var n=this._getTextureDataFromSource();return this.width=n.width,this.height=n.height,this.init(n),this},i.Texture.prototype._getTextureDataFromSource=function(){var t;return this.isSrcP5Image?t=this.src.canvas:(this.isSrcMediaElement||this.isSrcP5Graphics||this.isSrcHTMLElement)&&(t=this.src.elt),t},i.Texture.prototype.init=function(t){var e=this._renderer.GL;if(this.glTex=e.createTexture(),this.bindTexture(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,this.glMagFilter),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,this.glMinFilter),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,this.glWrapS),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,this.glWrapT),0===this.width||0===this.height||this.isSrcMediaElement&&!this.src.loadedmetadata){var r=new Uint8Array([1,1,1,1]);e.texImage2D(this.glTarget,0,e.RGBA,1,1,0,this.glFormat,e.UNSIGNED_BYTE,r)}else e.texImage2D(this.glTarget,0,this.glFormat,this.glFormat,e.UNSIGNED_BYTE,t)},i.Texture.prototype.update=function(){var t=this.src;if(0!==t.width&&0!==t.height){var e=this._getTextureDataFromSource(),r=this._renderer.GL;if(e.width!==this.width||e.height!==this.height)this.width=e.width,this.height=e.height,this.bindTexture(),r.texImage2D(this.glTarget,0,this.glFormat,this.glFormat,r.UNSIGNED_BYTE,e),this.isSrcP5Image?t.setModified(!1):(this.isSrcMediaElement||this.isSrcHTMLElement)&&t.setModified(!0);else if(this.isSrcP5Image)t.isModified()&&(this.bindTexture(),r.texImage2D(this.glTarget,0,this.glFormat,this.glFormat,r.UNSIGNED_BYTE,e),t.setModified(!1));else if(this.isSrcMediaElement){var i=!1;t.isModified()?(i=!0,t.setModified(!1)):t.loadedmetadata&&this._videoPrevUpdateTime!==t.time()&&(this._videoPrevUpdateTime=t.time(),i=!0),i&&(this.bindTexture(),r.texImage2D(this.glTarget,0,this.glFormat,this.glFormat,r.UNSIGNED_BYTE,e))}else r.texImage2D(this.glTarget,0,this.glFormat,this.glFormat,r.UNSIGNED_BYTE,e)}},i.Texture.prototype.bindTexture=function(){return this._renderer.GL.bindTexture(this.glTarget,this.glTex),this},i.Texture.prototype.unbindTexture=function(){this._renderer.GL.bindTexture(this.glTarget,null)},e.exports=i.Texture},{"../core/core":21}],74:[function(t,e,r){"use strict";var i=t("../core/core");t("./p5.Geometry"),i.prototype.plane=function(t,e,r,n){this._assert3d("plane"),i._validateParameters("plane",arguments),void 0===t&&(t=50),void 0===e&&(e=t),void 0===r&&(r=1),void 0===n&&(n=1);var o="plane|"+r+"|"+n;if(!this._renderer.geometryInHash(o)){var a=new i.Geometry(r,n,function(){for(var t,e,r,n=0;n<=this.detailY;n++){e=n/this.detailY;for(var o=0;o<=this.detailX;o++)t=o/this.detailX,r=new i.Vector(t-.5,e-.5,0),this.vertices.push(r),this.uvs.push(t,e)}});a.computeFaces().computeNormals(),r<=1&&n<=1?a._makeTriangleEdges()._edgesToVertices():console.log("Cannot draw stroke on plane objects with more than 1 detailX or 1 detailY"),this._renderer.createBuffers(o,a)}this._renderer.drawBuffersScaled(o,t,e,0)},i.prototype.box=function(t,e,r,n,o){this._assert3d("box"),i._validateParameters("box",arguments),void 0===t&&(t=50),void 0===e&&(e=t),void 0===r&&(r=e);var a=this._renderer.attributes&&this._renderer.attributes.perPixelLighting;void 0===n&&(n=a?1:4),void 0===o&&(o=a?1:4);var s="box|"+n+"|"+o;if(!this._renderer.geometryInHash(s)){var h=new i.Geometry(n,o,function(){var t=[[0,4,2,6],[1,3,5,7],[0,1,4,5],[2,6,3,7],[0,2,1,3],[4,5,6,7]];this.strokeIndices=[[0,1],[1,3],[3,2],[6,7],[8,9],[9,11],[14,15],[16,17],[17,19],[18,19],[20,21],[22,23]];for(var e=0;e<t.length;e++){for(var r=t[e],n=4*e,o=0;o<4;o++){var a=r[o],s=new i.Vector((2*(1&a)-1)/2,((2&a)-1)/2,((4&a)/2-1)/2);this.vertices.push(s),this.uvs.push(1&o,(2&o)/2)}this.faces.push([n,n+1,n+2]),this.faces.push([n+2,n+1,n+3])}});h.computeNormals(),n<=4&&o<=4?h._makeTriangleEdges()._edgesToVertices():console.log("Cannot draw stroke on box objects with more than 4 detailX or 4 detailY"),this._renderer.createBuffers(s,h)}return this._renderer.drawBuffersScaled(s,t,e,r),this},i.prototype.sphere=function(t,e,r){return this._assert3d("sphere"),i._validateParameters("sphere",arguments),void 0===t&&(t=50),void 0===e&&(e=24),void 0===r&&(r=16),this.ellipsoid(t,t,t,e,r),this};var n=function(t,e,r,n,o,a,s){t=t<=0?1:t,e=e<0?0:e,r=r<=0?t:r,n=n<3?3:n,o=o<1?1:o,a=void 0===a||a,s=void 0===s?0!==e:s;var h,l,u,c,p,d=a?-2:0,f=o+(s?2:0),m={},v=Math.atan2(t-e,r);for(h=d;h<=f;++h){var g,y=h/o,b=r*y;for(h<0?(b=0,y=0,g=t):h>o?(b=r,y=1,g=e):g=t+(e-t)*y,-2!==h&&h!==o+2||(g=0),b-=r/2,m[h]=0===g?1:n,l=0;l<m[h];++l){var _=l/n;this.vertices.push(new i.Vector(Math.sin(2*_*Math.PI)*g,b,Math.cos(2*_*Math.PI)*g)),this.vertexNormals.push(new i.Vector(h<0||h>o?0:Math.sin(2*_*Math.PI)*Math.cos(v),h<0?-1:h>o?1:Math.sin(v),h<0||h>o?0:Math.cos(2*_*Math.PI)*Math.cos(v))),this.uvs.push(_,y)}}var x=0;if(a){for(u=0;u<m[-1];++u)p=(u+1)%m[-1],this.faces.push([x,x+1+p,x+1+u]);x+=m[-2]+m[-1]}for(h=0;h<o;++h){for(l=0;l<m[h];++l)1===m[h+1]?(c=(l+1)%m[h],this.faces.push([x+l,x+c,x+m[h]])):(c=(l+1)%m[h],this.faces.push([x+l,x+c,x+m[h]+c]),this.faces.push([x+l,x+m[h]+c,x+m[h]+l]));x+=m[h]}if(s)for(x+=m[o],l=0;l<m[o+1];++l)c=(l+1)%m[o+1],this.faces.push([x+l,x+c,x+m[o+1]])};i.prototype.cylinder=function(t,e,r,o,a,s){this._assert3d("cylinder"),i._validateParameters("cylinder",arguments),void 0===t&&(t=50),void 0===e&&(e=t),void 0===r&&(r=24),void 0===o&&(o=1),void 0===s&&(s=!0),void 0===a&&(a=!0);var h="cylinder|"+r+"|"+o+"|"+a+"|"+s;if(!this._renderer.geometryInHash(h)){var l=new i.Geometry(r,o);n.call(l,1,1,1,r,o,a,s),l.computeNormals(),r<=24&&o<=16?l._makeTriangleEdges()._edgesToVertices():console.log("Cannot draw stroke on cylinder objects with more than 24 detailX or 16 detailY"),this._renderer.createBuffers(h,l)}return this._renderer.drawBuffersScaled(h,t,e,t),this},i.prototype.cone=function(t,e,r,o,a){this._assert3d("cone"),i._validateParameters("cone",arguments),void 0===t&&(t=50),void 0===e&&(e=t),void 0===r&&(r=24),void 0===o&&(o=1),void 0===a&&(a=!0);var s="cone|"+r+"|"+o+"|"+a;if(!this._renderer.geometryInHash(s)){var h=new i.Geometry(r,o);n.call(h,1,0,1,r,o,a,!1),h.computeNormals(),r<=24&&o<=16?h._makeTriangleEdges()._edgesToVertices():console.log("Cannot draw stroke on cone objects with more than 24 detailX or 16 detailY"),this._renderer.createBuffers(s,h)}return this._renderer.drawBuffersScaled(s,t,e,t),this},i.prototype.ellipsoid=function(t,e,r,n,o){this._assert3d("ellipsoid"),i._validateParameters("ellipsoid",arguments),void 0===t&&(t=50),void 0===e&&(e=t),void 0===r&&(r=t),void 0===n&&(n=24),void 0===o&&(o=16);var a="ellipsoid|"+n+"|"+o;if(!this._renderer.geometryInHash(a)){var s=new i.Geometry(n,o,function(){for(var t=0;t<=this.detailY;t++)for(var e=t/this.detailY,r=Math.PI*e-Math.PI/2,n=Math.cos(r),o=Math.sin(r),a=0;a<=this.detailX;a++){var s=a/this.detailX,h=2*Math.PI*s,l=Math.cos(h),u=Math.sin(h),c=new i.Vector(n*u,o,n*l);this.vertices.push(c),this.vertexNormals.push(c),this.uvs.push(s,e)}});s.computeFaces(),n<=24&&o<=24?s._makeTriangleEdges()._edgesToVertices():console.log("Cannot draw stroke on ellipsoids with more than 24 detailX or 24 detailY"),this._renderer.createBuffers(a,s)}return this._renderer.drawBuffersScaled(a,t,e,r),this},i.prototype.torus=function(t,e,r,n){if(this._assert3d("torus"),i._validateParameters("torus",arguments),void 0===t)t=50;else if(!t)return;if(void 0===e)e=10;else if(!e)return;void 0===r&&(r=24),void 0===n&&(n=16);var o=(e/t).toPrecision(4),a="torus|"+o+"|"+r+"|"+n;if(!this._renderer.geometryInHash(a)){var s=new i.Geometry(r,n,function(){for(var t=0;t<=this.detailY;t++)for(var e=t/this.detailY,r=2*Math.PI*e,n=Math.cos(r),a=Math.sin(r),s=1+o*n,h=0;h<=this.detailX;h++){var l=h/this.detailX,u=2*Math.PI*l,c=Math.cos(u),p=Math.sin(u),d=new i.Vector(s*c,s*p,o*a),f=new i.Vector(n*c,n*p,a);this.vertices.push(d),this.vertexNormals.push(f),this.uvs.push(l,e)}});s.computeFaces(),r<=24&&n<=16?s._makeTriangleEdges()._edgesToVertices():console.log("Cannot draw strokes on torus object with more than 24 detailX or 16 detailY"),this._renderer.createBuffers(a,s)}return this._renderer.drawBuffersScaled(a,t,t,t),this},i.RendererGL.prototype.point=function(t,e,r){return console.log("point not yet implemented in webgl"),this},i.RendererGL.prototype.triangle=function(t){var e=t[0],r=t[1],n=t[2],o=t[3],a=t[4],s=t[5],h="tri";if(!this.geometryInHash(h)){var l=new i.Geometry(1,1,function(){var t=[];t.push(new i.Vector(0,0,0)),t.push(new i.Vector(0,1,0)),t.push(new i.Vector(1,0,0)),this.strokeIndices=[[0,1],[1,2],[2,0]],this.vertices=t,this.faces=[[0,1,2]],this.uvs=[0,0,0,1,1,1]});l._makeTriangleEdges()._edgesToVertices(),l.computeNormals(),this.createBuffers(h,l)}var u=this.uMVMatrix.copy();try{var c=new i.Matrix([n-e,o-r,0,0,a-e,s-r,0,0,0,0,1,0,e,r,0,1]).mult(this.uMVMatrix);this.uMVMatrix=c,this.drawBuffers(h)}finally{this.uMVMatrix=u}return this},i.RendererGL.prototype.ellipse=function(t){var e=t[0],r=t[1],n=t[2],o=t[3],a=t[4]||24,s="ellipse|"+a;if(!this.geometryInHash(s)){var h=new i.Geometry(a,1,function(){this.vertices.push(new i.Vector(.5,.5,0)),this.uvs.push([.5,.5]);for(var t=0;t<this.detailX;t++){var e=t/this.detailX,r=2*Math.PI*e,n=.5+Math.cos(r)/2,o=.5+Math.sin(r)/2;this.vertices.push(new i.Vector(n,o,0)),this.uvs.push(n,o),this.faces.push([0,(t+1)%this.detailX+1,t+1])}});h.computeNormals(),a<=50?h._makeTriangleEdges()._edgesToVertices():console.log("Cannot stroke ellipse with more than 50 detailX"),this.createBuffers(s,h)}var l=this.uMVMatrix.copy();try{this.uMVMatrix.translate([e,r,0]),this.uMVMatrix.scale(n,o,1),this.drawBuffers(s)}finally{this.uMVMatrix=l}return this},i.RendererGL.prototype.rect=function(t){var e=this.attributes.perPixelLighting,r=t[0],n=t[1],o=t[2],a=t[3],s=t[4]||(e?1:24),h=t[5]||(e?1:16),l="rect|"+s+"|"+h;if(!this.geometryInHash(l)){var u=new i.Geometry(s,h,function(){for(var t=0;t<=this.detailY;t++)for(var e=t/this.detailY,r=0;r<=this.detailX;r++){var n=r/this.detailX,o=new i.Vector(n,e,0);this.vertices.push(o),this.uvs.push(n,e)}});u.computeFaces().computeNormals()._makeTriangleEdges()._edgesToVertices(),this.createBuffers(l,u)}var c=this.uMVMatrix.copy();try{this.uMVMatrix.translate([r,n,0]),this.uMVMatrix.scale(o,a,1),this.drawBuffers(l)}finally{this.uMVMatrix=c}return this},i.RendererGL.prototype.quad=function(t,e,r,n,o,a,s,h){var l="quad|"+t+"|"+e+"|"+r+"|"+n+"|"+o+"|"+a+"|"+s+"|"+h;if(!this.geometryInHash(l)){var u=new i.Geometry(2,2,function(){this.vertices.push(new i.Vector(t,e,0)),this.vertices.push(new i.Vector(r,n,0)),this.vertices.push(new i.Vector(o,a,0)),this.vertices.push(new i.Vector(s,h,0)),this.uvs.push(0,0,1,0,1,1,0,1),this.strokeIndices=[[0,1],[1,2],[2,3],[3,0]]});u.computeNormals()._makeTriangleEdges()._edgesToVertices(),u.faces=[[0,1,2],[2,3,0]],this.createBuffers(l,u)}return this.drawBuffers(l),this},i.RendererGL.prototype.bezier=function(t,e,r,i,n,o,a,s,h,l,u,c){8===arguments.length&&(l=a,u=s,a=n,s=i,n=i=r,r=o=h=c=0);var p=this._pInst._bezierDetail||20;this.beginShape();for(var d=0;d<=p;d++){var f=Math.pow(1-d/p,3),m=d/p*3*Math.pow(1-d/p,2),v=3*Math.pow(d/p,2)*(1-d/p),g=Math.pow(d/p,3);this.vertex(t*f+i*m+a*v+l*g,e*f+n*m+s*v+u*g,r*f+o*m+h*v+c*g)}return this.endShape(),this},i.RendererGL.prototype.curve=function(t,e,r,i,n,o,a,s,h,l,u,c){8===arguments.length&&(l=a,u=s,a=n,s=i,n=i=r,r=o=h=c=0);var p=this._pInst._curveDetail;this.beginShape();for(var d=0;d<=p;d++){var f=.5*Math.pow(d/p,3),m=.5*Math.pow(d/p,2),v=d/p*.5,g=f*(3*i-t-3*a+l)+m*(2*t-5*i+4*a-l)+v*(-t+a)+2*i*.5,y=f*(3*n-e-3*s+u)+m*(2*e-5*n+4*s-u)+v*(-e+s)+2*n*.5,b=f*(3*o-r-3*h+c)+m*(2*r-5*o+4*h-c)+v*(-r+h)+2*o*.5;this.vertex(g,y,b)}return this.endShape(),this},i.RendererGL.prototype.line=function(){return 6===arguments.length?(this.beginShape(),this.vertex(arguments[0],arguments[1],arguments[2]),this.vertex(arguments[3],arguments[4],arguments[5]),this.endShape()):4===arguments.length&&(this.beginShape(),this.vertex(arguments[0],arguments[1],0),this.vertex(arguments[2],arguments[3],0),this.endShape()),this},e.exports=i},{"../core/core":21,"./p5.Geometry":67}]},{},[12])(12)})}}]);
//# sourceMappingURL=smartdown_vendors~p5DOM~p5Sound~p5js.js.map