UNPKG

jimp-compact

Version:
1 lines 545 kB
(()=>{var r={6016:r=>{function _arrayLikeToArray(r,i){if(i==null||i>r.length)i=r.length;for(var a=0,o=new Array(i);a<i;a++){o[a]=r[a]}return o}r.exports=_arrayLikeToArray;r.exports.default=r.exports,r.exports.__esModule=true},6063:r=>{function _arrayWithHoles(r){if(Array.isArray(r))return r}r.exports=_arrayWithHoles;r.exports.default=r.exports,r.exports.__esModule=true},4622:(r,i,a)=>{var o=a(6016);function _arrayWithoutHoles(r){if(Array.isArray(r))return o(r)}r.exports=_arrayWithoutHoles;r.exports.default=r.exports,r.exports.__esModule=true},3808:r=>{function _assertThisInitialized(r){if(r===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r}r.exports=_assertThisInitialized;r.exports.default=r.exports,r.exports.__esModule=true},9346:r=>{function _classCallCheck(r,i){if(!(r instanceof i)){throw new TypeError("Cannot call a class as a function")}}r.exports=_classCallCheck;r.exports.default=r.exports,r.exports.__esModule=true},3077:(r,i,a)=>{var o=a(20);var s=a(6497);function _construct(i,a,l){if(s()){r.exports=_construct=Reflect.construct;r.exports.default=r.exports,r.exports.__esModule=true}else{r.exports=_construct=function _construct(r,i,a){var s=[null];s.push.apply(s,i);var l=Function.bind.apply(r,s);var u=new l;if(a)o(u,a.prototype);return u};r.exports.default=r.exports,r.exports.__esModule=true}return _construct.apply(null,arguments)}r.exports=_construct;r.exports.default=r.exports,r.exports.__esModule=true},2158:r=>{function _defineProperties(r,i){for(var a=0;a<i.length;a++){var o=i[a];o.enumerable=o.enumerable||false;o.configurable=true;if("value"in o)o.writable=true;Object.defineProperty(r,o.key,o)}}function _createClass(r,i,a){if(i)_defineProperties(r.prototype,i);if(a)_defineProperties(r,a);return r}r.exports=_createClass;r.exports.default=r.exports,r.exports.__esModule=true},3561:r=>{function _defineProperty(r,i,a){if(i in r){Object.defineProperty(r,i,{value:a,enumerable:true,configurable:true,writable:true})}else{r[i]=a}return r}r.exports=_defineProperty;r.exports.default=r.exports,r.exports.__esModule=true},9042:r=>{function _extends(){r.exports=_extends=Object.assign||function(r){for(var i=1;i<arguments.length;i++){var a=arguments[i];for(var o in a){if(Object.prototype.hasOwnProperty.call(a,o)){r[o]=a[o]}}}return r};r.exports.default=r.exports,r.exports.__esModule=true;return _extends.apply(this,arguments)}r.exports=_extends;r.exports.default=r.exports,r.exports.__esModule=true},2030:r=>{function _getPrototypeOf(i){r.exports=_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(r){return r.__proto__||Object.getPrototypeOf(r)};r.exports.default=r.exports,r.exports.__esModule=true;return _getPrototypeOf(i)}r.exports=_getPrototypeOf;r.exports.default=r.exports,r.exports.__esModule=true},5937:(r,i,a)=>{var o=a(20);function _inherits(r,i){if(typeof i!=="function"&&i!==null){throw new TypeError("Super expression must either be null or a function")}r.prototype=Object.create(i&&i.prototype,{constructor:{value:r,writable:true,configurable:true}});if(i)o(r,i)}r.exports=_inherits;r.exports.default=r.exports,r.exports.__esModule=true},3298:r=>{function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}r.exports=_interopRequireDefault;r.exports.default=r.exports,r.exports.__esModule=true},8429:(r,i,a)=>{var o=a(1042).default;function _getRequireWildcardCache(r){if(typeof WeakMap!=="function")return null;var i=new WeakMap;var a=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(r){return r?a:i})(r)}function _interopRequireWildcard(r,i){if(!i&&r&&r.__esModule){return r}if(r===null||o(r)!=="object"&&typeof r!=="function"){return{default:r}}var a=_getRequireWildcardCache(i);if(a&&a.has(r)){return a.get(r)}var s={};var l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in r){if(u!=="default"&&Object.prototype.hasOwnProperty.call(r,u)){var v=l?Object.getOwnPropertyDescriptor(r,u):null;if(v&&(v.get||v.set)){Object.defineProperty(s,u,v)}else{s[u]=r[u]}}}s["default"]=r;if(a){a.set(r,s)}return s}r.exports=_interopRequireWildcard;r.exports.default=r.exports,r.exports.__esModule=true},6497:r=>{function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return true}catch(r){return false}}r.exports=_isNativeReflectConstruct;r.exports.default=r.exports,r.exports.__esModule=true},3152:r=>{function _iterableToArray(r){if(typeof Symbol!=="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}r.exports=_iterableToArray;r.exports.default=r.exports,r.exports.__esModule=true},9985:r=>{function _iterableToArrayLimit(r,i){var a=r==null?null:typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(a==null)return;var o=[];var s=true;var l=false;var u,v;try{for(a=a.call(r);!(s=(u=a.next()).done);s=true){o.push(u.value);if(i&&o.length===i)break}}catch(r){l=true;v=r}finally{try{if(!s&&a["return"]!=null)a["return"]()}finally{if(l)throw v}}return o}r.exports=_iterableToArrayLimit;r.exports.default=r.exports,r.exports.__esModule=true},4410:r=>{function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}r.exports=_nonIterableRest;r.exports.default=r.exports,r.exports.__esModule=true},7215:r=>{function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}r.exports=_nonIterableSpread;r.exports.default=r.exports,r.exports.__esModule=true},8104:(r,i,a)=>{var o=a(1042).default;var s=a(3808);function _possibleConstructorReturn(r,i){if(i&&(o(i)==="object"||typeof i==="function")){return i}else if(i!==void 0){throw new TypeError("Derived constructors may only return object or undefined")}return s(r)}r.exports=_possibleConstructorReturn;r.exports.default=r.exports,r.exports.__esModule=true},20:r=>{function _setPrototypeOf(i,a){r.exports=_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(r,i){r.__proto__=i;return r};r.exports.default=r.exports,r.exports.__esModule=true;return _setPrototypeOf(i,a)}r.exports=_setPrototypeOf;r.exports.default=r.exports,r.exports.__esModule=true},5612:(r,i,a)=>{var o=a(6063);var s=a(9985);var l=a(9230);var u=a(4410);function _slicedToArray(r,i){return o(r)||s(r,i)||l(r,i)||u()}r.exports=_slicedToArray;r.exports.default=r.exports,r.exports.__esModule=true},9491:(r,i,a)=>{var o=a(4622);var s=a(3152);var l=a(9230);var u=a(7215);function _toConsumableArray(r){return o(r)||s(r)||l(r)||u()}r.exports=_toConsumableArray;r.exports.default=r.exports,r.exports.__esModule=true},1042:r=>{function _typeof(i){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){r.exports=_typeof=function _typeof(r){return typeof r};r.exports.default=r.exports,r.exports.__esModule=true}else{r.exports=_typeof=function _typeof(r){return r&&typeof Symbol==="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r};r.exports.default=r.exports,r.exports.__esModule=true}return _typeof(i)}r.exports=_typeof;r.exports.default=r.exports,r.exports.__esModule=true},9230:(r,i,a)=>{var o=a(6016);function _unsupportedIterableToArray(r,i){if(!r)return;if(typeof r==="string")return o(r,i);var a=Object.prototype.toString.call(r).slice(8,-1);if(a==="Object"&&r.constructor)a=r.constructor.name;if(a==="Map"||a==="Set")return Array.from(r);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return o(r,i)}r.exports=_unsupportedIterableToArray;r.exports.default=r.exports,r.exports.__esModule=true},9032:(r,i,a)=>{r.exports=a(4307)},4858:(r,i,a)=>{"use strict";var o=a(3298);Object.defineProperty(i,"__esModule",{value:true});i.default=void 0;var s=o(a(3561));var l=o(a(9030));var u=a(7403);var v="image/bmp";var b="image/x-ms-bmp";function toAGBR(r){return(0,u.scan)(r,0,0,r.bitmap.width,r.bitmap.height,(function(r,i,a){var o=this.bitmap.data[a+0];var s=this.bitmap.data[a+1];var l=this.bitmap.data[a+2];var u=this.bitmap.data[a+3];this.bitmap.data[a+0]=u;this.bitmap.data[a+1]=l;this.bitmap.data[a+2]=s;this.bitmap.data[a+3]=o})).bitmap}function fromAGBR(r){return(0,u.scan)({bitmap:r},0,0,r.width,r.height,(function(i,a,o){var s=this.bitmap.data[o+0];var l=this.bitmap.data[o+1];var u=this.bitmap.data[o+2];var v=this.bitmap.data[o+3];this.bitmap.data[o+0]=v;this.bitmap.data[o+1]=u;this.bitmap.data[o+2]=l;this.bitmap.data[o+3]=r.is_with_alpha?s:255})).bitmap}var _=function decode(r){return fromAGBR(l["default"].decode(r))};var y=function encode(r){return l["default"].encode(toAGBR(r)).data};var x=function _default(){var r,i;return{mime:(0,s["default"])({},v,["bmp"]),constants:{MIME_BMP:v,MIME_X_MS_BMP:b},decoders:(r={},(0,s["default"])(r,v,_),(0,s["default"])(r,b,_),r),encoders:(i={},(0,s["default"])(i,v,y),(0,s["default"])(i,b,y),i)}};i.default=x;r.exports=i.default},8284:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.srcOver=srcOver;i.dstOver=dstOver;i.multiply=multiply;i.add=add;i.screen=screen;i.overlay=overlay;i.darken=darken;i.lighten=lighten;i.hardLight=hardLight;i.difference=difference;i.exclusion=exclusion;function srcOver(r,i){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;r.a*=a;var o=i.a+r.a-i.a*r.a;var s=(r.r*r.a+i.r*i.a*(1-r.a))/o;var l=(r.g*r.a+i.g*i.a*(1-r.a))/o;var u=(r.b*r.a+i.b*i.a*(1-r.a))/o;return{r:s,g:l,b:u,a:o}}function dstOver(r,i){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;r.a*=a;var o=i.a+r.a-i.a*r.a;var s=(i.r*i.a+r.r*r.a*(1-i.a))/o;var l=(i.g*i.a+r.g*r.a*(1-i.a))/o;var u=(i.b*i.a+r.b*r.a*(1-i.a))/o;return{r:s,g:l,b:u,a:o}}function multiply(r,i){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;r.a*=a;var o=i.a+r.a-i.a*r.a;var s=r.r*r.a;var l=r.g*r.a;var u=r.b*r.a;var v=i.r*i.a;var b=i.g*i.a;var _=i.b*i.a;var y=(s*v+s*(1-i.a)+v*(1-r.a))/o;var x=(l*b+l*(1-i.a)+b*(1-r.a))/o;var M=(u*_+u*(1-i.a)+_*(1-r.a))/o;return{r:y,g:x,b:M,a:o}}function add(r,i){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;r.a*=a;var o=i.a+r.a-i.a*r.a;var s=r.r*r.a;var l=r.g*r.a;var u=r.b*r.a;var v=i.r*i.a;var b=i.g*i.a;var _=i.b*i.a;var y=(s+v)/o;var x=(l+b)/o;var M=(u+_)/o;return{r:y,g:x,b:M,a:o}}function screen(r,i){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;r.a*=a;var o=i.a+r.a-i.a*r.a;var s=r.r*r.a;var l=r.g*r.a;var u=r.b*r.a;var v=i.r*i.a;var b=i.g*i.a;var _=i.b*i.a;var y=(s*i.a+v*r.a-s*v+s*(1-i.a)+v*(1-r.a))/o;var x=(l*i.a+b*r.a-l*b+l*(1-i.a)+b*(1-r.a))/o;var M=(u*i.a+_*r.a-u*_+u*(1-i.a)+_*(1-r.a))/o;return{r:y,g:x,b:M,a:o}}function overlay(r,i){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;r.a*=a;var o=i.a+r.a-i.a*r.a;var s=r.r*r.a;var l=r.g*r.a;var u=r.b*r.a;var v=i.r*i.a;var b=i.g*i.a;var _=i.b*i.a;var y=(2*v<=i.a?2*s*v+s*(1-i.a)+v*(1-r.a):s*(1+i.a)+v*(1+r.a)-2*v*s-i.a*r.a)/o;var x=(2*b<=i.a?2*l*b+l*(1-i.a)+b*(1-r.a):l*(1+i.a)+b*(1+r.a)-2*b*l-i.a*r.a)/o;var M=(2*_<=i.a?2*u*_+u*(1-i.a)+_*(1-r.a):u*(1+i.a)+_*(1+r.a)-2*_*u-i.a*r.a)/o;return{r:y,g:x,b:M,a:o}}function darken(r,i){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;r.a*=a;var o=i.a+r.a-i.a*r.a;var s=r.r*r.a;var l=r.g*r.a;var u=r.b*r.a;var v=i.r*i.a;var b=i.g*i.a;var _=i.b*i.a;var y=(Math.min(s*i.a,v*r.a)+s*(1-i.a)+v*(1-r.a))/o;var x=(Math.min(l*i.a,b*r.a)+l*(1-i.a)+b*(1-r.a))/o;var M=(Math.min(u*i.a,_*r.a)+u*(1-i.a)+_*(1-r.a))/o;return{r:y,g:x,b:M,a:o}}function lighten(r,i){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;r.a*=a;var o=i.a+r.a-i.a*r.a;var s=r.r*r.a;var l=r.g*r.a;var u=r.b*r.a;var v=i.r*i.a;var b=i.g*i.a;var _=i.b*i.a;var y=(Math.max(s*i.a,v*r.a)+s*(1-i.a)+v*(1-r.a))/o;var x=(Math.max(l*i.a,b*r.a)+l*(1-i.a)+b*(1-r.a))/o;var M=(Math.max(u*i.a,_*r.a)+u*(1-i.a)+_*(1-r.a))/o;return{r:y,g:x,b:M,a:o}}function hardLight(r,i){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;r.a*=a;var o=i.a+r.a-i.a*r.a;var s=r.r*r.a;var l=r.g*r.a;var u=r.b*r.a;var v=i.r*i.a;var b=i.g*i.a;var _=i.b*i.a;var y=(2*s<=r.a?2*s*v+s*(1-i.a)+v*(1-r.a):s*(1+i.a)+v*(1+r.a)-2*v*s-i.a*r.a)/o;var x=(2*l<=r.a?2*l*b+l*(1-i.a)+b*(1-r.a):l*(1+i.a)+b*(1+r.a)-2*b*l-i.a*r.a)/o;var M=(2*u<=r.a?2*u*_+u*(1-i.a)+_*(1-r.a):u*(1+i.a)+_*(1+r.a)-2*_*u-i.a*r.a)/o;return{r:y,g:x,b:M,a:o}}function difference(r,i){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;r.a*=a;var o=i.a+r.a-i.a*r.a;var s=r.r*r.a;var l=r.g*r.a;var u=r.b*r.a;var v=i.r*i.a;var b=i.g*i.a;var _=i.b*i.a;var y=(s+v-2*Math.min(s*i.a,v*r.a))/o;var x=(l+b-2*Math.min(l*i.a,b*r.a))/o;var M=(u+_-2*Math.min(u*i.a,_*r.a))/o;return{r:y,g:x,b:M,a:o}}function exclusion(r,i){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;r.a*=a;var o=i.a+r.a-i.a*r.a;var s=r.r*r.a;var l=r.g*r.a;var u=r.b*r.a;var v=i.r*i.a;var b=i.g*i.a;var _=i.b*i.a;var y=(s*i.a+v*r.a-2*s*v+s*(1-i.a)+v*(1-r.a))/o;var x=(l*i.a+b*r.a-2*l*b+l*(1-i.a)+b*(1-r.a))/o;var M=(u*i.a+_*r.a-2*u*_+u*(1-i.a)+_*(1-r.a))/o;return{r:y,g:x,b:M,a:o}}},5141:(r,i,a)=>{"use strict";var o=a(8429);Object.defineProperty(i,"__esModule",{value:true});i.default=composite;var s=a(7403);var l=o(a(4619));var u=o(a(8284));function composite(r,i,a){var o=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var v=arguments.length>4?arguments[4]:undefined;if(typeof o==="function"){v=o;o={}}if(!(r instanceof this.constructor)){return s.throwError.call(this,"The source must be a Jimp image",v)}if(typeof i!=="number"||typeof a!=="number"){return s.throwError.call(this,"x and y must be numbers",v)}var b=o,_=b.mode,y=b.opacitySource,x=b.opacityDest;if(!_){_=l.BLEND_SOURCE_OVER}if(typeof y!=="number"||y<0||y>1){y=1}if(typeof x!=="number"||x<0||x>1){x=1}var M=u[_];i=Math.round(i);a=Math.round(a);var E=this;if(x!==1){E.opacity(x)}r.scanQuiet(0,0,r.bitmap.width,r.bitmap.height,(function(r,o,s){var u=E.getPixelIndex(i+r,a+o,l.EDGE_CROP);var v=M({r:this.bitmap.data[s+0]/255,g:this.bitmap.data[s+1]/255,b:this.bitmap.data[s+2]/255,a:this.bitmap.data[s+3]/255},{r:E.bitmap.data[u+0]/255,g:E.bitmap.data[u+1]/255,b:E.bitmap.data[u+2]/255,a:E.bitmap.data[u+3]/255},y);E.bitmap.data[u+0]=this.constructor.limit255(v.r*255);E.bitmap.data[u+1]=this.constructor.limit255(v.g*255);E.bitmap.data[u+2]=this.constructor.limit255(v.b*255);E.bitmap.data[u+3]=this.constructor.limit255(v.a*255)}));if((0,s.isNodePattern)(v)){v.call(this,null,this)}return this}r.exports=i.default},4619:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.EDGE_CROP=i.EDGE_WRAP=i.EDGE_EXTEND=i.BLEND_EXCLUSION=i.BLEND_DIFFERENCE=i.BLEND_HARDLIGHT=i.BLEND_LIGHTEN=i.BLEND_DARKEN=i.BLEND_OVERLAY=i.BLEND_SCREEN=i.BLEND_ADD=i.BLEND_MULTIPLY=i.BLEND_DESTINATION_OVER=i.BLEND_SOURCE_OVER=i.VERTICAL_ALIGN_BOTTOM=i.VERTICAL_ALIGN_MIDDLE=i.VERTICAL_ALIGN_TOP=i.HORIZONTAL_ALIGN_RIGHT=i.HORIZONTAL_ALIGN_CENTER=i.HORIZONTAL_ALIGN_LEFT=i.AUTO=void 0;var a=-1;i.AUTO=a;var o=1;i.HORIZONTAL_ALIGN_LEFT=o;var s=2;i.HORIZONTAL_ALIGN_CENTER=s;var l=4;i.HORIZONTAL_ALIGN_RIGHT=l;var u=8;i.VERTICAL_ALIGN_TOP=u;var v=16;i.VERTICAL_ALIGN_MIDDLE=v;var b=32;i.VERTICAL_ALIGN_BOTTOM=b;var _="srcOver";i.BLEND_SOURCE_OVER=_;var y="dstOver";i.BLEND_DESTINATION_OVER=y;var x="multiply";i.BLEND_MULTIPLY=x;var M="add";i.BLEND_ADD=M;var E="screen";i.BLEND_SCREEN=E;var I="overlay";i.BLEND_OVERLAY=I;var D="darken";i.BLEND_DARKEN=D;var T="lighten";i.BLEND_LIGHTEN=T;var k="hardLight";i.BLEND_HARDLIGHT=k;var P="difference";i.BLEND_DIFFERENCE=P;var S="exclusion";i.BLEND_EXCLUSION=S;var A=1;i.EDGE_EXTEND=A;var L=2;i.EDGE_WRAP=L;var B=3;i.EDGE_CROP=B},678:(r,i,a)=>{"use strict";var o=a(8429);var s=a(3298);Object.defineProperty(i,"__esModule",{value:true});i.addConstants=addConstants;i.addJimpMethods=addJimpMethods;i.jimpEvMethod=jimpEvMethod;i.jimpEvChange=jimpEvChange;Object.defineProperty(i,"addType",{enumerable:true,get:function get(){return G.addType}});i.default=void 0;var l=s(a(3077));var u=s(a(5612));var v=s(a(9346));var b=s(a(2158));var _=s(a(8104));var y=s(a(2030));var x=s(a(3808));var M=s(a(5937));var E=s(a(3561));var I=s(a(1042));var D=s(a(5747));var T=s(a(5622));var k=s(a(8614));var P=a(7403);var S=s(a(8720));var A=s(a(6186));var L=s(a(6097));var B=s(a(5479));var O=s(a(7025));var R=s(a(4310));var z=s(a(5141));var U=s(a(6826));var G=o(a(3153));var j=a(3946);var H=o(a(4619));var Q="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_";var V=[NaN,NaN];for(var Z=2;Z<65;Z++){var K=(0,S["default"])(S["default"].BIN,Q.slice(0,Z))(new Array(64+1).join("1"));V.push(K.length)}function noop(){}function isArrayBuffer(r){return Object.prototype.toString.call(r).toLowerCase().indexOf("arraybuffer")>-1}function bufferFromArrayBuffer(r){var i=Buffer.alloc(r.byteLength);var a=new Uint8Array(r);for(var o=0;o<i.length;++o){i[o]=a[o]}return i}function loadFromURL(r,i){(0,R["default"])(r,(function(a,o,s){if(a){return i(a)}if("headers"in o&&"location"in o.headers){r.url=o.headers.location;return loadFromURL(r,i)}if((0,I["default"])(s)==="object"&&Buffer.isBuffer(s)){return i(null,s)}var l="Could not load Buffer from <"+r.url+"> "+"(HTTP: "+o.statusCode+")";return new Error(l)}))}function loadBufferFromPath(r,i){if(D["default"]&&typeof D["default"].readFile==="function"&&!r.match(/^(http|ftp)s?:\/\/./)){D["default"].readFile(r,i)}else{loadFromURL({url:r},i)}}function isRawRGBAData(r){return r&&(0,I["default"])(r)==="object"&&typeof r.width==="number"&&typeof r.height==="number"&&(Buffer.isBuffer(r.data)||r.data instanceof Uint8Array||typeof Uint8ClampedArray==="function"&&r.data instanceof Uint8ClampedArray)&&(r.data.length===r.width*r.height*4||r.data.length===r.width*r.height*3)}function makeRGBABufferFromRGB(r){if(r.length%3!==0){throw new Error("Buffer length is incorrect")}var i=Buffer.allocUnsafe(r.length/3*4);var a=0;for(var o=0;o<r.length;o++){i[a]=r[o];if((o+1)%3===0){i[++a]=255}a++}return i}var J={data:null,width:null,height:null};var $=function(r){(0,M["default"])(Jimp,r);function Jimp(){var r;for(var i=arguments.length,a=new Array(i),o=0;o<i;o++){a[o]=arguments[o]}(0,v["default"])(this,Jimp);r=(0,_["default"])(this,(0,y["default"])(Jimp).call(this));(0,E["default"])((0,x["default"])(r),"bitmap",J);(0,E["default"])((0,x["default"])(r),"_background",0);(0,E["default"])((0,x["default"])(r),"_originalMime",Jimp.MIME_PNG);(0,E["default"])((0,x["default"])(r),"_exif",null);(0,E["default"])((0,x["default"])(r),"_rgba",true);(0,E["default"])((0,x["default"])(r),"writeAsync",(function(i){return(0,U["default"])(r.write,(0,x["default"])(r),i)}));(0,E["default"])((0,x["default"])(r),"getBase64Async",(function(i){return(0,U["default"])(r.getBase64,(0,x["default"])(r),i)}));(0,E["default"])((0,x["default"])(r),"getBuffer",j.getBuffer);(0,E["default"])((0,x["default"])(r),"getBufferAsync",j.getBufferAsync);(0,E["default"])((0,x["default"])(r),"getPixelColour",r.getPixelColor);(0,E["default"])((0,x["default"])(r),"setPixelColour",r.setPixelColor);var s=(0,x["default"])(r);var l=noop;if(isArrayBuffer(a[0])){a[0]=bufferFromArrayBuffer(a[0])}function finish(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++){i[a]=arguments[a]}var o=i[0];var u=o||{};u.methodName="constructor";setTimeout((function(){var r;if(o&&l===noop){s.emitError("constructor",o)}else if(!o){s.emitMulti("constructor","initialized")}(r=l).call.apply(r,[s].concat(i))}),1)}if(typeof a[0]==="number"&&typeof a[1]==="number"||parseInt(a[0],10)&&parseInt(a[1],10)){var u=parseInt(a[0],10);var b=parseInt(a[1],10);l=a[2];if(typeof a[2]==="number"){r._background=a[2];l=a[3]}if(typeof a[2]==="string"){r._background=Jimp.cssColorToHex(a[2]);l=a[3]}if(typeof l==="undefined"){l=noop}if(typeof l!=="function"){return(0,_["default"])(r,P.throwError.call((0,x["default"])(r),"cb must be a function",finish))}r.bitmap={data:Buffer.alloc(u*b*4),width:u,height:b};for(var M=0;M<r.bitmap.data.length;M+=4){r.bitmap.data.writeUInt32BE(r._background,M)}finish(null,(0,x["default"])(r))}else if((0,I["default"])(a[0])==="object"&&a[0].url){l=a[1]||noop;if(typeof l!=="function"){return(0,_["default"])(r,P.throwError.call((0,x["default"])(r),"cb must be a function",finish))}loadFromURL(a[0],(function(i,o){if(i){return P.throwError.call((0,x["default"])(r),i,finish)}r.parseBitmap(o,a[0].url,finish)}))}else if(a[0]instanceof Jimp){var D=a[0];l=a[1];if(typeof l==="undefined"){l=noop}if(typeof l!=="function"){return(0,_["default"])(r,P.throwError.call((0,x["default"])(r),"cb must be a function",finish))}r.bitmap={data:Buffer.from(D.bitmap.data),width:D.bitmap.width,height:D.bitmap.height};r._quality=D._quality;r._deflateLevel=D._deflateLevel;r._deflateStrategy=D._deflateStrategy;r._filterType=D._filterType;r._rgba=D._rgba;r._background=D._background;r._originalMime=D._originalMime;finish(null,(0,x["default"])(r))}else if(isRawRGBAData(a[0])){var T=a[0];l=a[1]||noop;var k=T.width*T.height*4===T.data.length;var S=k?Buffer.from(T.data):makeRGBABufferFromRGB(T.data);r.bitmap={data:S,width:T.width,height:T.height};finish(null,(0,x["default"])(r))}else if(typeof a[0]==="string"){var A=a[0];l=a[1];if(typeof l==="undefined"){l=noop}if(typeof l!=="function"){return(0,_["default"])(r,P.throwError.call((0,x["default"])(r),"cb must be a function",finish))}loadBufferFromPath(A,(function(i,a){if(i){return P.throwError.call((0,x["default"])(r),i,finish)}r.parseBitmap(a,A,finish)}))}else if((0,I["default"])(a[0])==="object"&&Buffer.isBuffer(a[0])){var L=a[0];l=a[1];if(typeof l!=="function"){return(0,_["default"])(r,P.throwError.call((0,x["default"])(r),"cb must be a function",finish))}r.parseBitmap(L,null,finish)}else{l=a[a.length-1];if(typeof l!=="function"){l=a[a.length-2];if(typeof l!=="function"){l=noop}}var B=Jimp.__extraConstructors.find((function(r){return r.test.apply(r,a)}));if(B){new Promise((function(i,o){var s;return(s=B.run).call.apply(s,[(0,x["default"])(r),i,o].concat(a))})).then((function(){return finish(null,(0,x["default"])(r))}))["catch"](finish)}else{return(0,_["default"])(r,P.throwError.call((0,x["default"])(r),"No matching constructor overloading was found. "+"Please see the docs for how to call the Jimp constructor.",finish))}}return r}(0,b["default"])(Jimp,[{key:"parseBitmap",value:function parseBitmap(r,i,a){j.parseBitmap.call(this,r,null,a)}},{key:"rgba",value:function rgba(r,i){if(typeof r!=="boolean"){return P.throwError.call(this,"bool must be a boolean, true for RGBA or false for RGB",i)}this._rgba=r;if((0,P.isNodePattern)(i)){i.call(this,null,this)}return this}},{key:"emitMulti",value:function emitMulti(r,i){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};a=Object.assign(a,{methodName:r,eventName:i});this.emit("any",a);if(r){this.emit(r,a)}this.emit(i,a)}},{key:"emitError",value:function emitError(r,i){this.emitMulti(r,"error",i)}},{key:"getHeight",value:function getHeight(){return this.bitmap.height}},{key:"getWidth",value:function getWidth(){return this.bitmap.width}},{key:"inspect",value:function inspect(){return"<Jimp "+(this.bitmap===J?"pending...":this.bitmap.width+"x"+this.bitmap.height)+">"}},{key:"toString",value:function toString(){return"[object Jimp]"}},{key:"getMIME",value:function getMIME(){var r=this._originalMime||Jimp.MIME_PNG;return r}},{key:"getExtension",value:function getExtension(){var r=this.getMIME();return G.getExtension(r)}},{key:"write",value:function write(r,i){var a=this;if(!D["default"]||!D["default"].createWriteStream){throw new Error("Cant access the filesystem. You can use the getBase64 method.")}if(typeof r!=="string"){return P.throwError.call(this,"path must be a string",i)}if(typeof i==="undefined"){i=noop}if(typeof i!=="function"){return P.throwError.call(this,"cb must be a function",i)}var o=G.getType(r)||this.getMIME();var s=T["default"].parse(r);if(s.dir){A["default"].sync(s.dir)}this.getBuffer(o,(function(o,s){if(o){return P.throwError.call(a,o,i)}var l=D["default"].createWriteStream(r);l.on("open",(function(){l.write(s);l.end()})).on("error",(function(r){return P.throwError.call(a,r,i)}));l.on("finish",(function(){i.call(a,null,a)}))}));return this}},{key:"getBase64",value:function getBase64(r,i){if(r===Jimp.AUTO){r=this.getMIME()}if(typeof r!=="string"){return P.throwError.call(this,"mime must be a string",i)}if(typeof i!=="function"){return P.throwError.call(this,"cb must be a function",i)}this.getBuffer(r,(function(a,o){if(a){return P.throwError.call(this,a,i)}var s="data:"+r+";base64,"+o.toString("base64");i.call(this,null,s)}));return this}},{key:"hash",value:function hash(r,i){r=r||64;if(typeof r==="function"){i=r;r=64}if(typeof r!=="number"){return P.throwError.call(this,"base must be a number",i)}if(r<2||r>64){return P.throwError.call(this,"base must be a number between 2 and 64",i)}var hash=this.pHash();hash=(0,S["default"])(S["default"].BIN,Q.slice(0,r))(hash);while(hash.length<V[r]){hash="0"+hash}if((0,P.isNodePattern)(i)){i.call(this,null,hash)}return hash}},{key:"pHash",value:function pHash(){var pHash=new O["default"];return pHash.getHash(this)}},{key:"distanceFromHash",value:function distanceFromHash(r){var i=new O["default"];var a=i.getHash(this);return i.distance(a,r)}},{key:"getPixelIndex",value:function getPixelIndex(r,i,a,o){var s;var l;if(typeof a==="function"&&typeof o==="undefined"){o=a;a=null}if(!a){a=Jimp.EDGE_EXTEND}if(typeof r!=="number"||typeof i!=="number"){return P.throwError.call(this,"x and y must be numbers",o)}r=Math.round(r);i=Math.round(i);s=r;l=i;if(a===Jimp.EDGE_EXTEND){if(r<0)s=0;if(r>=this.bitmap.width)s=this.bitmap.width-1;if(i<0)l=0;if(i>=this.bitmap.height)l=this.bitmap.height-1}if(a===Jimp.EDGE_WRAP){if(r<0){s=this.bitmap.width+r}if(r>=this.bitmap.width){s=r%this.bitmap.width}if(i<0){s=this.bitmap.height+i}if(i>=this.bitmap.height){l=i%this.bitmap.height}}var u=this.bitmap.width*l+s<<2;if(s<0||s>=this.bitmap.width){u=-1}if(l<0||l>=this.bitmap.height){u=-1}if((0,P.isNodePattern)(o)){o.call(this,null,u)}return u}},{key:"getPixelColor",value:function getPixelColor(r,i,a){if(typeof r!=="number"||typeof i!=="number")return P.throwError.call(this,"x and y must be numbers",a);r=Math.round(r);i=Math.round(i);var o=this.getPixelIndex(r,i);var s=this.bitmap.data.readUInt32BE(o);if((0,P.isNodePattern)(a)){a.call(this,null,s)}return s}},{key:"setPixelColor",value:function setPixelColor(r,i,a,o){if(typeof r!=="number"||typeof i!=="number"||typeof a!=="number")return P.throwError.call(this,"hex, x and y must be numbers",o);i=Math.round(i);a=Math.round(a);var s=this.getPixelIndex(i,a);this.bitmap.data.writeUInt32BE(r,s);if((0,P.isNodePattern)(o)){o.call(this,null,this)}return this}},{key:"hasAlpha",value:function hasAlpha(){for(var r=0;r<this.bitmap.height;r++){for(var i=0;i<this.bitmap.width;i++){var a=this.bitmap.width*r+i<<2;var o=this.bitmap.data[a+3];if(o!==255){return true}}}return false}},{key:"scanIterator",value:function scanIterator(r,i,a,o){if(typeof r!=="number"||typeof i!=="number"){return P.throwError.call(this,"x and y must be numbers")}if(typeof a!=="number"||typeof o!=="number"){return P.throwError.call(this,"w and h must be numbers")}return(0,P.scanIterator)(this,r,i,a,o)}}]);return Jimp}(k["default"]);function addConstants(r){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:$;Object.entries(r).forEach((function(r){var a=(0,u["default"])(r,2),o=a[0],s=a[1];i[o]=s}))}function addJimpMethods(r){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:$;Object.entries(r).forEach((function(r){var a=(0,u["default"])(r,2),o=a[0],s=a[1];i.prototype[o]=s}))}addConstants(H);addJimpMethods({composite:z["default"]});$.__extraConstructors=[];$.appendConstructorOption=function(r,i,a){$.__extraConstructors.push({name:r,test:i,run:a})};$.read=function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++){i[a]=arguments[a]}return new Promise((function(r,a){(0,l["default"])($,i.concat([function(i,o){if(i)a(i);else r(o)}]))}))};$.create=$.read;$.rgbaToInt=function(r,i,a,o,s){if(typeof r!=="number"||typeof i!=="number"||typeof a!=="number"||typeof o!=="number"){return P.throwError.call(this,"r, g, b and a must be numbers",s)}if(r<0||r>255){return P.throwError.call(this,"r must be between 0 and 255",s)}if(i<0||i>255){P.throwError.call(this,"g must be between 0 and 255",s)}if(a<0||a>255){return P.throwError.call(this,"b must be between 0 and 255",s)}if(o<0||o>255){return P.throwError.call(this,"a must be between 0 and 255",s)}r=Math.round(r);a=Math.round(a);i=Math.round(i);o=Math.round(o);var l=r*Math.pow(256,3)+i*Math.pow(256,2)+a*Math.pow(256,1)+o*Math.pow(256,0);if((0,P.isNodePattern)(s)){s.call(this,null,l)}return l};$.intToRGBA=function(r,i){if(typeof r!=="number"){return P.throwError.call(this,"i must be a number",i)}var a={};a.r=Math.floor(r/Math.pow(256,3));a.g=Math.floor((r-a.r*Math.pow(256,3))/Math.pow(256,2));a.b=Math.floor((r-a.r*Math.pow(256,3)-a.g*Math.pow(256,2))/Math.pow(256,1));a.a=Math.floor((r-a.r*Math.pow(256,3)-a.g*Math.pow(256,2)-a.b*Math.pow(256,1))/Math.pow(256,0));if((0,P.isNodePattern)(i)){i.call(this,null,a)}return a};$.cssColorToHex=function(r){r=r||0;if(typeof r==="number")return Number(r);return parseInt((0,B["default"])(r).toHex8(),16)};$.limit255=function(r){r=Math.max(r,0);r=Math.min(r,255);return r};$.diff=function(r,i){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:.1;if(!(r instanceof $)||!(i instanceof $))return P.throwError.call(this,"img1 and img2 must be an Jimp images");var o=r.bitmap;var s=i.bitmap;if(o.width!==s.width||o.height!==s.height){if(o.width*o.height>s.width*s.height){r=r.cloneQuiet().resize(s.width,s.height)}else{i=i.cloneQuiet().resize(o.width,o.height)}}if(typeof a!=="number"||a<0||a>1){return P.throwError.call(this,"threshold must be a number between 0 and 1")}var l=new $(o.width,o.height,4294967295);var u=(0,L["default"])(o.data,s.data,l.bitmap.data,l.bitmap.width,l.bitmap.height,{threshold:a});return{percent:u/(l.bitmap.width*l.bitmap.height),image:l}};$.distance=function(r,i){var a=new O["default"];var o=a.getHash(r);var s=a.getHash(i);return a.distance(o,s)};$.compareHashes=function(r,i){var a=new O["default"];return a.distance(r,i)};$.colorDiff=function(r,i){var a=function pow(r){return Math.pow(r,2)};var o=Math.max;var s=255*255*3;if(r.a!==0&&!r.a){r.a=255}if(i.a!==0&&!i.a){i.a=255}return(o(a(r.r-i.r),a(r.r-i.r-r.a+i.a))+o(a(r.g-i.g),a(r.g-i.g-r.a+i.a))+o(a(r.b-i.b),a(r.b-i.b-r.a+i.a)))/s};function jimpEvMethod(r,i,a){var o="before-"+i;var s=i.replace(/e$/,"")+"ed";$.prototype[r]=function(){var i;for(var l=arguments.length,u=new Array(l),v=0;v<l;v++){u[v]=arguments[v]}var b=u[a.length-1];var _=this;if(typeof b==="function"){i=function wrappedCb(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++){a[o]=arguments[o]}var l=a[0],u=a[1];if(l){_.emitError(r,l)}else{_.emitMulti(r,s,(0,E["default"])({},r,u))}b.apply(this,a)};u[u.length-1]=i}else{i=false}this.emitMulti(r,o);var y;try{y=a.apply(this,u);if(!i){this.emitMulti(r,s,(0,E["default"])({},r,y))}}catch(i){i.methodName=r;this.emitError(r,i)}return y};$.prototype[r+"Quiet"]=a}jimpEvMethod("clone","clone",(function(r){var i=new $(this);if((0,P.isNodePattern)(r)){r.call(i,null,i)}return i}));function jimpEvChange(r,i){jimpEvMethod(r,"change",i)}jimpEvChange("background",(function(r,i){if(typeof r!=="number"){return P.throwError.call(this,"hex must be a hexadecimal rgba value",i)}this._background=r;if((0,P.isNodePattern)(i)){i.call(this,null,this)}return this}));jimpEvChange("scan",(function(r,i,a,o,s,l){if(typeof r!=="number"||typeof i!=="number"){return P.throwError.call(this,"x and y must be numbers",l)}if(typeof a!=="number"||typeof o!=="number"){return P.throwError.call(this,"w and h must be numbers",l)}if(typeof s!=="function"){return P.throwError.call(this,"f must be a function",l)}var u=(0,P.scan)(this,r,i,a,o,s);if((0,P.isNodePattern)(l)){l.call(this,null,u)}return u}));if(process.env.ENVIRONMENT==="BROWSER"){var tt;if(typeof window!=="undefined"&&(typeof window==="undefined"?"undefined":(0,I["default"])(window))==="object"){tt=window}if(typeof self!=="undefined"&&(typeof self==="undefined"?"undefined":(0,I["default"])(self))==="object"){tt=self}tt.Jimp=$;tt.Buffer=Buffer}var et=$;i.default=et},7025:r=>{"use strict";function ImagePHash(r,i){this.size=this.size||r;this.smallerSize=this.smallerSize||i;initCoefficients(this.size)}ImagePHash.prototype.size=32;ImagePHash.prototype.smallerSize=8;ImagePHash.prototype.distance=function(r,i){var a=0;for(var o=0;o<r.length;o++){if(r[o]!==i[o]){a++}}return a/r.length};ImagePHash.prototype.getHash=function(r){r=r.clone().resize(this.size,this.size);r.grayscale();var i=[];for(var a=0;a<r.bitmap.width;a++){i[a]=[];for(var o=0;o<r.bitmap.height;o++){i[a][o]=intToRGBA(r.getPixelColor(a,o)).b}}var s=applyDCT(i,this.size);var l=0;for(var u=0;u<this.smallerSize;u++){for(var v=0;v<this.smallerSize;v++){l+=s[u][v]}}var b=l/(this.smallerSize*this.smallerSize);var _="";for(var y=0;y<this.smallerSize;y++){for(var x=0;x<this.smallerSize;x++){_+=s[y][x]>b?"1":"0"}}return _};function intToRGBA(r){var i={};i.r=Math.floor(r/Math.pow(256,3));i.g=Math.floor((r-i.r*Math.pow(256,3))/Math.pow(256,2));i.b=Math.floor((r-i.r*Math.pow(256,3)-i.g*Math.pow(256,2))/Math.pow(256,1));i.a=Math.floor((r-i.r*Math.pow(256,3)-i.g*Math.pow(256,2)-i.b*Math.pow(256,1))/Math.pow(256,0));return i}var i=[];function initCoefficients(r){for(var a=1;a<r;a++){i[a]=1}i[0]=1/Math.sqrt(2)}function applyDCT(r,a){var o=a;var s=[];for(var l=0;l<o;l++){s[l]=[];for(var u=0;u<o;u++){var v=0;for(var b=0;b<o;b++){for(var _=0;_<o;_++){v+=Math.cos((2*b+1)/(2*o)*l*Math.PI)*Math.cos((2*_+1)/(2*o)*u*Math.PI)*r[b][_]}}v*=i[l]*i[u]/4;s[l][u]=v}}return s}r.exports=ImagePHash},4310:(r,i,a)=>{"use strict";var o=a(3298);var s=o(a(3561));var l=o(a(9042));function ownKeys(r,i){var a=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);if(i)o=o.filter((function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}));a.push.apply(a,o)}return a}function _objectSpread(r){for(var i=1;i<arguments.length;i++){var a=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(a,true).forEach((function(i){(0,s["default"])(r,i,a[i])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(r,Object.getOwnPropertyDescriptors(a))}else{ownKeys(a).forEach((function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(a,i))}))}}return r}if(process.browser||process.env.ENVIRONMENT==="BROWSER"||typeof process.versions.electron!=="undefined"&&process.type==="renderer"&&typeof XMLHttpRequest==="function"){r.exports=function(r,i){var a=new XMLHttpRequest;a.open("GET",r.url,true);a.responseType="arraybuffer";a.addEventListener("load",(function(){if(a.status<400){try{var o=Buffer.from(this.response);i(null,a,o)}catch(a){return i(new Error("Response is not a buffer for url "+r.url+". Error: "+a.message))}}else{i(new Error("HTTP Status "+a.status+" for url "+r.url))}}));a.addEventListener("error",(function(r){i(r)}));a.send()}}else{r.exports=function(r,i){var o=(0,l["default"])({},r);var s=a(6130);s(_objectSpread({compression:true},o),(function(r,a){if(r===null){i(null,a,a.body)}else{i(r)}}))}}},3946:(r,i,a)=>{"use strict";var o=a(8429);var s=a(3298);Object.defineProperty(i,"__esModule",{value:true});i.parseBitmap=parseBitmap;i.getBuffer=getBuffer;i.getBufferAsync=getBufferAsync;var l=s(a(5612));var u=s(a(4930));var v=s(a(6621));var b=a(7403);var _=o(a(4619));var y=o(a(3153));var x=s(a(6826));function getMIMEFromBuffer(r,i){var a=(0,u["default"])(r);if(a){return a.mime}if(i){return y.getType(i)}return null}function getExifOrientation(r){return r._exif&&r._exif.tags&&r._exif.tags.Orientation||1}function getExifOrientationTransformation(r){var i=r.getWidth();var a=r.getHeight();switch(getExifOrientation(r)){case 1:return null;case 2:return function(r,a){return[i-r-1,a]};case 3:return function(r,o){return[i-r-1,a-o-1]};case 4:return function(r,i){return[r,a-i-1]};case 5:return function(r,i){return[i,r]};case 6:return function(r,i){return[i,a-r-1]};case 7:return function(r,o){return[i-o-1,a-r-1]};case 8:return function(r,a){return[i-a-1,r]};default:return null}}function transformBitmap(r,i,a,o){var s=r.bitmap.data;var u=r.bitmap.width;var v=Buffer.alloc(s.length);for(var b=0;b<i;b++){for(var _=0;_<a;_++){var y=o(b,_),x=(0,l["default"])(y,2),M=x[0],E=x[1];var I=i*_+b<<2;var D=u*E+M<<2;var T=s.readUInt32BE(D);v.writeUInt32BE(T,I)}}r.bitmap.data=v;r.bitmap.width=i;r.bitmap.height=a}function exifRotate(r){if(getExifOrientation(r)<2)return;var i=getExifOrientationTransformation(r);var a=getExifOrientation(r)>4;var o=a?r.bitmap.height:r.bitmap.width;var s=a?r.bitmap.width:r.bitmap.height;transformBitmap(r,o,s,i)}function parseBitmap(r,i,a){var o=getMIMEFromBuffer(r,i);if(typeof o!=="string"){return a(new Error("Could not find MIME for Buffer <"+i+">"))}this._originalMime=o.toLowerCase();try{var s=this.getMIME();if(this.constructor.decoders[s]){this.bitmap=this.constructor.decoders[s](r)}else{return b.throwError.call(this,"Unsupported MIME type: "+s,a)}}catch(r){return a.call(this,r,this)}try{this._exif=v["default"].create(r).parse();exifRotate(this)}catch(r){}a.call(this,null,this);return this}function compositeBitmapOverBackground(r,i){return new r(i.bitmap.width,i.bitmap.height,i._background).composite(i,0,0).bitmap}function getBuffer(r,i){if(r===_.AUTO){r=this.getMIME()}if(typeof r!=="string"){return b.throwError.call(this,"mime must be a string",i)}if(typeof i!=="function"){return b.throwError.call(this,"cb must be a function",i)}r=r.toLowerCase();if(this._rgba&&this.constructor.hasAlpha[r]){this.bitmap.data=Buffer.from(this.bitmap.data)}else{this.bitmap.data=compositeBitmapOverBackground(this.constructor,this).data}if(this.constructor.encoders[r]){var a=this.constructor.encoders[r](this);i.call(this,null,a)}else{i.call(this,"Unsupported MIME type: "+r)}return this}function getBufferAsync(r){return(0,x["default"])(getBuffer,this,r)}},3153:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.getExtension=i.getType=i.addType=void 0;var a={};var o=function findType(r){return Object.entries(a).find((function(i){return i[1].includes(r)}))||[]};var s=function addType(r,i){a[r]=i};i.addType=s;var l=function getType(r){var i=r.split("/").slice(-1);var a=i[i.length-1].split(".").pop();var s=o(a);return s[0]};i.getType=l;var u=function getExtension(r){return(a[r.toLowerCase()]||[])[0]};i.getExtension=u},6826:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.default=void 0;var a=function promisify(r,i){for(var a=arguments.length,o=new Array(a>2?a-2:0),s=2;s<a;s++){o[s-2]=arguments[s]}return new Promise((function(a,s){o.push((function(r,i){if(r){s(r)}a(i)}));r.bind(i).apply(void 0,o)}))};var o=a;i.default=o;r.exports=i.default},9472:(r,i,a)=>{"use strict";var o=a(8429);var s=a(3298);Object.defineProperty(i,"__esModule",{value:true});i.default=configure;var l=s(a(9491));var u=s(a(3561));var v=s(a(5612));var b=o(a(678));function ownKeys(r,i){var a=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);if(i)o=o.filter((function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}));a.push.apply(a,o)}return a}function _objectSpread(r){for(var i=1;i<arguments.length;i++){var a=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(a,true).forEach((function(i){(0,u["default"])(r,i,a[i])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(r,Object.getOwnPropertyDescriptors(a))}else{ownKeys(a).forEach((function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(a,i))}))}}return r}function configure(r){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:b["default"];var a={hasAlpha:{},encoders:{},decoders:{},class:{},constants:{}};function addToConfig(r){Object.entries(r).forEach((function(r){var i=(0,v["default"])(r,2),o=i[0],s=i[1];a[o]=_objectSpread({},a[o],{},s)}))}function addImageType(r){var i=r();if(Array.isArray(i.mime)){b.addType.apply(void 0,(0,l["default"])(i.mime))}else{Object.entries(i.mime).forEach((function(r){return b.addType.apply(void 0,(0,l["default"])(r))}))}delete i.mime;addToConfig(i)}function addPlugin(r){var i=r(b.jimpEvChange)||{};if(!i["class"]&&!i.constants){addToConfig({class:i})}else{addToConfig(i)}}if(r.types){r.types.forEach(addImageType);i.decoders=_objectSpread({},i.decoders,{},a.decoders);i.encoders=_objectSpread({},i.encoders,{},a.encoders);i.hasAlpha=_objectSpread({},i.hasAlpha,{},a.hasAlpha)}if(r.plugins){r.plugins.forEach(addPlugin)}(0,b.addJimpMethods)(a["class"],i);(0,b.addConstants)(a.constants,i);return b["default"]}r.exports=i.default},8257:(r,i,a)=>{"use strict";var o=a(3298);Object.defineProperty(i,"__esModule",{value:true});i.default=void 0;var s=o(a(3561));var l=o(a(9717));var u=a(7304);var v="image/gif";var b=function _default(){return{mime:(0,s["default"])({},v,["gif"]),constants:{MIME_GIF:v},decoders:(0,s["default"])({},v,(function(r){var i=new l["default"].GifReader(r);var a=Buffer.alloc(i.width*i.height*4);i.decodeAndBlitFrameRGBA(0,a);return{data:a,width:i.width,height:i.height}})),encoders:(0,s["default"])({},v,(function(r){var i=new u.BitmapImage(r.bitmap);u.GifUtil.quantizeDekker(i,256);var a=new u.GifFrame(i);var o=new u.GifCodec;return o.encodeGif([a],{}).then((function(r){return r.buffer}))}))}};i.default=b;r.exports=i.default},5177:(r,i,a)=>{"use strict";var o=a(3298);Object.defineProperty(i,"__esModule",{value:true});i.default=void 0;var s=o(a(3561));var l=o(a(8541));var u=a(7403);var v="image/jpeg";var b=function _default(){return{mime:(0,s["default"])({},v,["jpeg","jpg","jpe"]),constants:{MIME_JPEG:v},decoders:(0,s["default"])({},v,l["default"].decode),encoders:(0,s["default"])({},v,(function(r){return l["default"].encode(r.bitmap,r._quality).data})),class:{_quality:100,quality:function quality(r,i){if(typeof r!=="number"){return u.throwError.call(this,"n must be a number",i)}if(r<0||r>100){return u.throwError.call(this,"n must be a number 0 - 100",i)}this._quality=Math.round(r);if((0,u.isNodePattern)(i)){i.call(this,null,this)}return this}}}};i.default=b;r.exports=i.default},1485:(r,i,a)=>{"use strict";var o=a(3298);Object.defineProperty(i,"__esModule",{value:true});i.default=void 0;var s=o(a(1042));var l=a(7403);var u=function _default(){return{blit:function blit(r,i,a,o,u,v,b,_){if(!(r instanceof this.constructor)){return l.throwError.call(this,"The source must be a Jimp image",_)}if(typeof i!=="number"||typeof a!=="number"){return l.throwError.call(this,"x and y must be numbers",_)}if(typeof o==="function"){_=o;o=0;u=0;v=r.bitmap.width;b=r.bitmap.height}else if((0,s["default"])(o)===(0,s["default"])(u)&&(0,s["default"])(u)===(0,s["default"])(v)&&(0,s["default"])(v)===(0,s["default"])(b)){o=o||0;u=u||0;v=v||r.bitmap.width;b=b||r.bitmap.height}else{return l.throwError.call(this,"srcx, srcy, srcw, srch must be numbers",_)}i=Math.round(i);a=Math.round(a);o=Math.round(o);u=Math.round(u);v=Math.round(v);b=Math.round(b);var y=this.bitmap.width;var x=this.bitmap.height;var M=this;r.scanQuiet(o,u,v,b,(function(r,s,l){var v=i+r-o;var b=a+s-u;if(v>=0&&b>=0&&y-v>0&&x-b>0){var _=M.getPixelIndex(v,b);var E={r:this.bitmap.data[l],g:this.bitmap.data[l+1],b:this.bitmap.data[l+2],a:this.bitmap.data[l+3]};var I={r:M.bitmap.data[_],g:M.bitmap.data[_+1],b:M.bitmap.data[_+2],a:M.bitmap.data[_+3]};M.bitmap.data[_]=(E.a*(E.r-I.r)-I.r+255>>8)+I.r;M.bitmap.data[_+1]=(E.a*(E.g-I.g)-I.g+255>>8)+I.g;M.bitmap.data[_+2]=(E.a*(E.b-I.b)-I.b+255>>8)+I.b;M.bitmap.data[_+3]=this.constructor.limit255(I.a+E.a)}}));if((0,l.isNodePattern)(_)){_.call(this,null,this)}return this}}};i.default=u;r.exports=i.default},5803:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.shgTable=i.mulTable=void 0;var a=[1,57,41,21,203,34,97,73,227,91,149,62,105,45,39,137,241,107,3,173,39,71,65,238,219,101,187,87,81,151,141,133,249,117,221,209,197,187,177,169,5,153,73,139,133,127,243,233,223,107,103,99,191,23,177,171,165,159,77,149,9,139,135,131,253,245,119,231,224,109,211,103,25,195,189,23,45,175,171,83,81,79,155,151,147,9,141,137,67,131,129,251,123,30,235,115,113,221,217,53,13,51,50,49,193,189,185,91,179,175,43,169,83,163,5,79,155,19,75,147,145,143,35,69,17,67,33,65,255,251,247,243,239,59,29,229,113,111,219,27,213,105,207,51,201,199,49,193,191,47,93,183,181,179,11,87,43,85,167,165,163,161,159,157,155,77,19,75,37,73,145,143,141,35,138,137,135,67,33,131,129,255,63,250,247,61,121,239,237,117,29,229,227,225,111,55,109,216,213,211,209,207,205,203,201,199,197,195,193,48,190,47,93,185,183,181,179,178,176,175,173,171,85,21,167,165,41,163,161,5,79,157,78,154,153,19,75,149,74,147,73,144,143,71,141,140,139,137,17,135,134,133,66,131,65,129,1];i.mulTable=a;var o=[0,9,10,10,14,12,14,14,16,15,16,15,16,15,15,17,18,17,12,18,16,17,17,19,19,18,19,18,18,19,19,19,20,19,20,20,20,20,20,20,15,20,19,20,20,20,21,21,21,20,20,20,21,18,21,21,21,21,20,21,17,21,21,21,22,22,21,22,22,21,22,21,19,22,22,19,20,22,22,21,21,21,22,22,22,18,22,22,21,22,22,23,22,20,23,22,22,23,23,21,19,21,21,21,23,23,23,22,23,23,21,23,22,23,18,22,23,20,22,23,23,23,21,22,20,22,21,22,24,24,24,24,24,22,21,24,23,23,24,21,24,23,24,22,24,24,22,24,24,22,23,24,24,24,20,23,22,23,24,24,24,24,24,24,24,23,21,23,22,23,24,24,24,22,24,24,24,23,22,24,24,25,23,25,25,23,24,25,25,24,22,25,25,25,24,23,24,25,25,25,25,25,25,25,25,25,25,25,25,23,25,23,24,25,25,25,25,25,25,25,25,25,24,22,25,25,23,25,25,20,24,25,24,25,25,22,24,25,24,25,24,25,25,24,25,25,25,25,22,25,25,25,24,25,24,25,18];i.shgTable=o},6223:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.default=void 0;var o=a(7403);var s=a(5803);var l=function _default(){return{blur:function blur(r,i){if(typeof r!=="number")return o.throwError.call(this,"r must be a number",i);if(r<1)return o.throwError.call(this,"r must be greater than 0",i);var a;var l;var u;var v;var b;var _;var y;var x;var M;var E;var I;var D;var T;var k;var P=this.bitmap.width-1;var S=this.bitmap.height-1;var A=r+1;var L=s.mulTable[r];var B=s.shgTable[r];var O=[];var R=[];var z=[];var U=[];var G=[];var j=[];var H=2;while(H-- >0){D=0;T=0;for(_=0;_<this.bitmap.height;_++){a=this.bitmap.data[T]*A;l=this.bitmap.data[T+1]*A;u=this.bitmap.data[T+2]*A;v=this.bitmap.data[T+3]*A;for(y=1;y<=r;y++){x=T+((y>P?P:y)<<2);a+=this.bitmap.data[x++];l+=this.bitmap.data[x++];u+=this.bitmap.data[x++];v+=this.bitmap.data[x]}for(b=0;b<this.bitmap.width;b++){O[D]=a;R[D]=l;z[D]=u;U[D]=v;if(_===0){G[b]=((x=b+A)<P?x:P)<<2;j[b]=(x=b-r)>0?x<<2:0}M=T+G[b];E=T+j[b];a+=this.bitmap.data[M++]-this.bitmap.data[E++];l+=this.bitmap.data[M++]-this.bitmap.data[E++];u+=this.bitmap.data[M++]-this.bitmap.data[E++];v+=this.bitmap.data[M]-this.bitmap.data[E];D++}T+=this.bitmap.width<<2}for(b=0;b<this.bitmap.width;b++){I=b;a=O[I]*A;l=R[I]*A;u=z[I]*A;v=U[I]*A;for(y=1;y<=r;y++){I+=y>S?0:this.bitmap.width;a+=O[I];l+=R[I];u+=z[I];v+=U[I]}D=b<<2;for(_=0;_<this.bitmap.height;_++){k=v*L>>>B;this.bitmap.data[D+3]=k;if(k>255){this.bitmap.data[D+3]=255}if(k>0){k=255/k;this.bitmap.data[D]=(a*L>>>B)*k;this.bitmap.data[D+1]=(l*L>>>B)*k;this.bitmap.data[D+2]=(u*L>>>B)*k}else{this.bitmap.data[D+2]=0;this.bitmap.data[D+1]=0;this.bitmap.data[D]=0}if(b===0){G[_]=((x=_+A)<S?x:S)*this.bitmap.width;j[_]=(x=_-r)>0?x*this.bitmap.width:0}M=b+G[_];E=b+j[_];a+=O[M]-O[E];l+=R[M]-R[E];u+=z[M]-z[E];v+=U[M]-U[E];D+=this.bitmap.width<<2}}}if((0,o.isNodePattern)(i)){i.call(this,null,this)}return this}}};i.default=l;r.exports=i.default},2005:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.default=void 0;var o=a(7403);var s=function _default(){return{circle:function circle(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var i=arguments.length>1?arguments[1]:undefined;if(typeof r==="function"){i=r;r={}}var a=r.radius||(this.bitmap.width>this.bitmap.height?this.bitmap.height:this.bitmap.width)/2;var s={x:typeof r.x==="number"?r.x:this.bitmap.width/2,y:typeof r.y==="number"?r.y:this.bitmap.height/2};this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(r,i,o){var l=Math.sqrt(Math.pow(r-s.x,2)+Math.pow(i-s.y,2));if(a-l<=0){this.bitmap.data[o+3]=0}else if(a-l<1){this.bitmap.data[o+3]=255*(a-l)}}));if((0,o.isNodePattern)(i)){i.call(this,null,this)}return this}}};i.default=s;r.exports=i.default},5432:(r,i,a)=>{"use strict";var o=a(3298);Object.defineProperty(i,"__esModule",{value:true});i.default=void 0;var s=o(a(9491));var l=o(a(5479));var u=a(7403);function applyKernel(r,i,a,o){var s=[0,0,0];var l=(i.length-1)/2;for(var u=0;u<i.length;u+=1){for(var v=0;v<i[u].length;v+=1){var b=r.getPixelIndex(a+u-l,o+v-l);s[0]+=r.bitmap.data[b]*i[u][v];s[1]+=r.bitmap.data[b+1]*i[u][v];s[2]+=r.bitmap.data[b+2]*i[u][v]}}return s}var v=function isDef(r){return typeof r!=="undefined"&&r!==null};function greyscale(r){this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(r,i,a){var o=parseInt(.2126*this.bitmap.data[a]+.7152*this.bitmap.data[a+1]+.0722*this.bitmap.data[a+2],10);this.bitmap.data[a]=o;this.bitmap.data[a+1]=o;this.bitmap.data[a+2]=o}));if((0,u.isNodePattern)(r)){r.call(this,null,this)}return this}function mix(r,i){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:50;return{r:(i.r-r.r)*(a/100)+r.r,g:(i.g-r.g)*(a/100)+r.g,b:(i.b-r.b)*(a/100)+r.b}}function colorFn(r,i){var a=this;if(!r||!Array.isArray(r)){return u.throwError.call(this,"actions must be an array",i)}r=r.map((function(r){if(r.apply==="xor"||r.apply==="mix"){r.params[0]=(0,l["default"])(r.params[0]).toRgb()}return r}));this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(o,v,b){var _={r:a.bitmap.data[b],g:a.bitmap.data[b+1],b:a.bitmap.data[b+2]};var y=function colorModifier(r,i){return a.constructor.limit255(_[r]+i)};r.forEach((function(r){if(r.apply==="mix"){_=mix(_,r.params[0],r.params[1])}else i