From 577743ce18a0f56494e4ba383290b8f1fc0630e9 Mon Sep 17 00:00:00 2001 From: hlomzik Date: Wed, 18 Aug 2021 11:19:47 +0300 Subject: [PATCH] Update LSF: fixes for relations on image (#1316) --- label_studio/frontend/dist/lsf/js/main.js | 2 +- label_studio/frontend/dist/lsf/js/main.js.map | 2 +- label_studio/frontend/dist/lsf/version.json | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/label_studio/frontend/dist/lsf/js/main.js b/label_studio/frontend/dist/lsf/js/main.js index a8043fea4858..0e5910a1117a 100644 --- a/label_studio/frontend/dist/lsf/js/main.js +++ b/label_studio/frontend/dist/lsf/js/main.js @@ -1,3 +1,3 @@ /*! For license information please see main.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.LabelStudio=t():e.LabelStudio=t()}("undefined"!=typeof self?self:this,(function(){return function(){var e={7757:function(e,t,n){e.exports=n(5666)},6259:function(e){function t(e){return!0}e.exports=function(e,n){var r=[];n=n||t;do{r.push(e),e=e.parentNode}while(e&&e.tagName&&n(e));return r.slice(1)}},454:function(e){"use strict";function t(e,t,n){e.splice(n<0?e.length+n:n,0,e.splice(t,1)[0])}e.exports=function(e,n,r){return t(e=e.slice(),n,r),e},e.exports.mut=t},2903:function(e,t){"use strict";t.Z={onDeleteAnnotation:function(){},onEntityCreate:function(){},onEntityDelete:function(){},onGroundTruth:function(){},onLabelStudioLoad:function(){},onSkipTask:function(){},onSubmitAnnotation:function(){},onSubmitDraft:function(e){},onTaskLoad:function(){},onUpdateAnnotation:function(){},onSelectAnnotation:function(e,t){},onAcceptAnnotation:function(e,t){},onRejectAnnotation:function(e,t){},onStorageInitialized:function(e){}}},1808:function(e,t,n){"use strict";n.r(t);var r=n(2903),o=n(4588);t.default={getData:function(e){return e&&e.data?{...e,data:JSON.stringify(e.data)}:e},getState:function(e){return{annotations:null==e?void 0:e.annotations,completions:null==e?void 0:e.completions,predictions:null==e?void 0:e.predictions}},rootElement:function(e){let t;return t="string"==typeof e?document.getElementById(e):e,t.innerHTML="",t},configureApplication:function(e){const t=e.submitAnnotation||e.onSubmitAnnotation,n=e.updateAnnotation||e.onUpdateAnnotation,i=e.deleteAnnotation||e.onDeleteAnnotation;return{alert:e=>console.log(e),messages:{...o.Z,...e.messages},onSubmitAnnotation:e.onSubmitAnnotation?t:r.Z.onSubmitAnnotation,onUpdateAnnotation:e.onUpdateAnnotation?n:r.Z.onUpdateAnnotation,onDeleteAnnotation:e.onDeleteAnnotation?i:r.Z.onDeleteAnnotation,onSkipTask:e.onSkipTask?e.onSkipTask:r.Z.onSkipTask,onSubmitDraft:e.onSubmitDraft,onTaskLoad:e.onTaskLoad||r.Z.onTaskLoad,onLabelStudioLoad:e.onLabelStudioLoad||r.Z.onLabelStudioLoad,onEntityCreate:e.onEntityCreate||r.Z.onEntityCreate,onEntityDelete:e.onEntityDelete||r.Z.onEntityDelete,onGroundTruth:e.onGroundTruth||r.Z.onGroundTruth,onSelectAnnotation:e.onSelectAnnotation||r.Z.onSelectAnnotation,onAcceptAnnotation:e.onAcceptAnnotation||r.Z.onAcceptAnnotation,onRejectAnnotation:e.onRejectAnnotation||r.Z.onRejectAnnotation,onStorageInitialized:e.onStorageInitialized||r.Z.onStorageInitialized}}}},4588:function(e,t,n){"use strict";n(7294);var r=n(5893);const o="https://app.heartex.ai/docs/guide/FAQ.html#Image-audio-resource-loading-error-while-labeling";t.Z={DONE:"Done!",NO_COMP_LEFT:"No more annotations",NO_NEXT_TASK:"No more data available for labeling",NO_ACCESS:"You don't have access to this task",CONFIRM_TO_DELETE_ALL_REGIONS:"Please confirm you want to delete all labeled regions",ERR_REQUIRED:({modelName:e,field:t})=>`Attribute ${t} is required for ${e}`,ERR_UNKNOWN_TAG:({modelName:e,field:t,value:n})=>`Tag with name ${n} is not registered. Referenced by ${e}#${t}.`,ERR_TAG_NOT_FOUND:({modelName:e,field:t,value:n})=>`Tag with name ${n} does not exist in the config. Referenced by ${e}#${t}.`,ERR_TAG_UNSUPPORTED:({modelName:e,field:t,value:n,validType:r})=>`Invalid attribute ${t} for ${e}: referenced tag is ${n}, but ${e} can only control ${[].concat(r).join(", ")}`,ERR_PARENT_TAG_UNEXPECTED:({validType:e,value:t})=>`Tag ${t} must be a child of one of the tags ${[].concat(e).join(", ")}.`,ERR_BAD_TYPE:({modelName:e,field:t,validType:n})=>`Attribute ${t} of tag ${e} has invalid type. Valid types are: ${n}.`,ERR_INTERNAL:({value:e})=>`Internal error. See browser console for more info. Try again or contact developers.
${e}`,ERR_GENERAL:({value:e})=>e,URL_CORS_DOCS:o,ERR_LOADING_AUDIO:({attr:e,url:t,error:n})=>(0,r.jsxs)("p",{children:["Error while loading audio. Check ",(0,r.jsx)("code",{children:e})," field in task.",(0,r.jsx)("br",{}),"Technical description: ",n,(0,r.jsx)("br",{}),"URL: ",t]}),ERR_LOADING_S3:({attr:e,url:t})=>`\n
\n

\n There was an issue loading URL from ${e} value.\n The request parameters are invalid.\n If you are using S3, make sure you’ve specified the right bucket region name.\n

\n

URL: ${t}

\n
\n `,ERR_LOADING_CORS:({attr:e,url:t})=>`\n
\n

\n There was an issue loading URL from ${e} value.\n Most likely that's because static server has wide-open CORS.\n Read more on that here.\n

\n

\n Also check that:\n

\n

\n

URL: ${t}

\n
\n `,ERR_LOADING_HTTP:({attr:e,url:t,error:n})=>`\n
\n

\n There was an issue loading URL from ${e} value\n

\n

\n Things to look out for:\n

\n

\n

\n Technical description: ${n}\n
\n URL: ${t}\n

\n
\n `}},9742:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,i=l(e),a=i[0],s=i[1],c=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),u=0,d=s>0?a-4:a;for(n=0;n>16&255,c[u++]=t>>8&255,c[u++]=255&t;2===s&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t);1===s&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t);return c},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=16383,s=0,l=r-o;sl?l:s+a));1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,r){for(var o,i,a=[],s=t;s>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},8764:function(e,t,n){"use strict";var r=n(9742),o=n(645),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=function(e){+e!=e&&(e=0);return l.alloc(+e)},t.INSPECT_MAX_BYTES=50;var a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return c(e,t,n)}function c(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|g(e,t),r=s(n),o=r.write(e,t);o!==n&&(r=r.slice(0,o));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(B(e,Uint8Array)){var t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(B(e,ArrayBuffer)||e&&B(e.buffer,ArrayBuffer))return p(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(B(e,SharedArrayBuffer)||e&&B(e.buffer,SharedArrayBuffer)))return p(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return l.from(r,t,n);var o=function(e){if(l.isBuffer(e)){var t=0|h(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||U(e.length)?s(0):f(e);if("Buffer"===e.type&&Array.isArray(e.data))return f(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return u(e),s(e<0?0:0|h(e))}function f(e){for(var t=e.length<0?0:0|h(e.length),n=s(t),r=0;r=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function g(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||B(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(o)return r?-1:F(e).length;t=(""+t).toLowerCase(),o=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return N(this,t,n);case"utf8":case"utf-8":return _(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return P(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),U(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,o){var i,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var u=-1;for(i=n;is&&(n=s-l),i=n;i>=0;i--){for(var d=!0,f=0;fo&&(r=o):r=o;var i=t.length;r>i/2&&(r=i/2);for(var a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function S(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function _(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:c>223?3:c>191?2:1;if(o+d<=n)switch(d){case 1:c<128&&(u=c);break;case 2:128==(192&(i=e[o+1]))&&(l=(31&c)<<6|63&i)>127&&(u=l);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(l=(15&c)<<12|(63&i)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(l=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,d=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),o+=d}return function(e){var t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rr.length?l.from(i).copy(r,o):Uint8Array.prototype.set.call(r,i,o);else{if(!l.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,o)}o+=i.length}return r},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tn&&(e+=" ... "),""},i&&(l.prototype[i]=l.prototype.inspect),l.prototype.compare=function(e,t,n,r,o){if(B(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),c=this.slice(r,o),u=e.slice(t,n),d=0;d>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":case"latin1":case"binary":return E(this,e,t,n);case"base64":return C(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function T(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function A(e,t,n,r,o,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function j(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,r,i){return t=+t,n>>>=0,i||j(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,i){return t=+t,n>>>=0,i||j(e,0,n,8),o.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||M(e,t,this.length);for(var r=this[e],o=1,i=0;++i>>=0,t>>>=0,n||M(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||M(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||M(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||M(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||M(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||M(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||M(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||M(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||M(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||A(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i>>=0,n>>>=0,r)||A(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=Math.pow(2,8*n-1);A(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=Math.pow(2,8*n-1);A(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function z(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(I,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function B(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function U(e){return e!=e}var H=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,o=0;o<16;++o)t[r+o]=e[n]+e[o];return t}()},5792:function(e){e.exports=function(){"use strict";for(var e=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),en?n:e},t=function(t){t._clipped=!1,t._unclipped=t.slice(0);for(var n=0;n<=3;n++)n<3?((t[n]<0||t[n]>255)&&(t._clipped=!0),t[n]=e(t[n],0,255)):3===n&&(t[n]=e(t[n],0,1));return t},n={},r=0,o=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];r=3?Array.prototype.slice.call(e):"object"==a(e[0])&&t?t.split("").filter((function(t){return void 0!==e[0][t]})).map((function(t){return e[0][t]})):e[0]},l=function(e){if(e.length<2)return null;var t=e.length-1;return"string"==a(e[t])?e[t].toLowerCase():null},c=Math.PI,u={clip_rgb:t,limit:e,type:a,unpack:s,last:l,PI:c,TWOPI:2*c,PITHIRD:c/3,DEG2RAD:c/180,RAD2DEG:180/c},d={format:{},autodetect:[]},f=u.last,p=u.clip_rgb,h=u.type,g=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=this;if("object"===h(e[0])&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];var r=f(e),o=!1;if(!r){o=!0,d.sorted||(d.autodetect=d.autodetect.sort((function(e,t){return t.p-e.p})),d.sorted=!0);for(var i=0,a=d.autodetect;i4?e[4]:1;return 1===i?[0,0,0,a]:[n>=1?0:255*(1-n)*(1-i),r>=1?0:255*(1-r)*(1-i),o>=1?0:255*(1-o)*(1-i),a]},k=u.unpack,S=u.type;m.prototype.cmyk=function(){return x(this._rgb)},y.cmyk=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(m,[null].concat(e,["cmyk"])))},d.format.cmyk=C,d.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=k(e,"cmyk"),"array"===S(e)&&4===e.length)return"cmyk"}});var _=u.unpack,O=u.last,T=function(e){return Math.round(100*e)/100},P=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=_(e,"hsla"),r=O(e)||"lsa";return n[0]=T(n[0]||0),n[1]=T(100*n[1])+"%",n[2]=T(100*n[2])+"%","hsla"===r||n.length>3&&n[3]<1?(n[3]=n.length>3?n[3]:1,r="hsla"):n.length=3,r+"("+n.join(",")+")"},N=u.unpack,R=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=(e=N(e,"rgba"))[0],r=e[1],o=e[2];n/=255,r/=255,o/=255;var i,a,s=Math.min(n,r,o),l=Math.max(n,r,o),c=(l+s)/2;return l===s?(i=0,a=Number.NaN):i=c<.5?(l-s)/(l+s):(l-s)/(2-l-s),n==l?a=(r-o)/(l-s):r==l?a=2+(o-n)/(l-s):o==l&&(a=4+(n-r)/(l-s)),(a*=60)<0&&(a+=360),e.length>3&&void 0!==e[3]?[a,i,c,e[3]]:[a,i,c]},M=u.unpack,A=u.last,j=Math.round,D=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=M(e,"rgba"),r=A(e)||"rgb";return"hsl"==r.substr(0,3)?P(R(n),r):(n[0]=j(n[0]),n[1]=j(n[1]),n[2]=j(n[2]),("rgba"===r||n.length>3&&n[3]<1)&&(n[3]=n.length>3?n[3]:1,r="rgba"),r+"("+n.slice(0,"rgb"===r?3:4).join(",")+")")},L=u.unpack,I=Math.round,F=function(){for(var e,t=[],n=arguments.length;n--;)t[n]=arguments[n];var r,o,i,a=(t=L(t,"hsl"))[0],s=t[1],l=t[2];if(0===s)r=o=i=255*l;else{var c=[0,0,0],u=[0,0,0],d=l<.5?l*(1+s):l+s-l*s,f=2*l-d,p=a/360;c[0]=p+1/3,c[1]=p,c[2]=p-1/3;for(var h=0;h<3;h++)c[h]<0&&(c[h]+=1),c[h]>1&&(c[h]-=1),6*c[h]<1?u[h]=f+6*(d-f)*c[h]:2*c[h]<1?u[h]=d:3*c[h]<2?u[h]=f+(d-f)*(2/3-c[h])*6:u[h]=f;r=(e=[I(255*u[0]),I(255*u[1]),I(255*u[2])])[0],o=e[1],i=e[2]}return t.length>3?[r,o,i,t[3]]:[r,o,i,1]},z=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,V=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,B=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,U=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,H=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,W=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,K=Math.round,q=function(e){var t;if(e=e.toLowerCase().trim(),d.format.named)try{return d.format.named(e)}catch(e){}if(t=e.match(z)){for(var n=t.slice(1,4),r=0;r<3;r++)n[r]=+n[r];return n[3]=1,n}if(t=e.match(V)){for(var o=t.slice(1,5),i=0;i<4;i++)o[i]=+o[i];return o}if(t=e.match(B)){for(var a=t.slice(1,4),s=0;s<3;s++)a[s]=K(2.55*a[s]);return a[3]=1,a}if(t=e.match(U)){for(var l=t.slice(1,5),c=0;c<3;c++)l[c]=K(2.55*l[c]);return l[3]=+l[3],l}if(t=e.match(H)){var u=t.slice(1,4);u[1]*=.01,u[2]*=.01;var f=F(u);return f[3]=1,f}if(t=e.match(W)){var p=t.slice(1,4);p[1]*=.01,p[2]*=.01;var h=F(p);return h[3]=+t[4],h}};q.test=function(e){return z.test(e)||V.test(e)||B.test(e)||U.test(e)||H.test(e)||W.test(e)};var G=q,Y=u.type;m.prototype.css=function(e){return D(this._rgb,e)},y.css=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(m,[null].concat(e,["css"])))},d.format.css=G,d.autodetect.push({p:5,test:function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];if(!t.length&&"string"===Y(e)&&G.test(e))return"css"}});var $=u.unpack;d.format.gl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=$(e,"rgba");return n[0]*=255,n[1]*=255,n[2]*=255,n},y.gl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(m,[null].concat(e,["gl"])))},m.prototype.gl=function(){var e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]};var X=u.unpack,Q=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r=X(e,"rgb"),o=r[0],i=r[1],a=r[2],s=Math.min(o,i,a),l=Math.max(o,i,a),c=l-s,u=100*c/255,d=s/(255-c)*100;return 0===c?n=Number.NaN:(o===l&&(n=(i-a)/c),i===l&&(n=2+(a-o)/c),a===l&&(n=4+(o-i)/c),(n*=60)<0&&(n+=360)),[n,u,d]},J=u.unpack,Z=Math.floor,ee=function(){for(var e,t,n,r,o,i,a=[],s=arguments.length;s--;)a[s]=arguments[s];var l,c,u,d=(a=J(a,"hcg"))[0],f=a[1],p=a[2];p*=255;var h=255*f;if(0===f)l=c=u=p;else{360===d&&(d=0),d>360&&(d-=360),d<0&&(d+=360);var g=Z(d/=60),m=d-g,v=p*(1-f),y=v+h*(1-m),b=v+h*m,w=v+h;switch(g){case 0:l=(e=[w,b,v])[0],c=e[1],u=e[2];break;case 1:l=(t=[y,w,v])[0],c=t[1],u=t[2];break;case 2:l=(n=[v,w,b])[0],c=n[1],u=n[2];break;case 3:l=(r=[v,y,w])[0],c=r[1],u=r[2];break;case 4:l=(o=[b,v,w])[0],c=o[1],u=o[2];break;case 5:l=(i=[w,v,y])[0],c=i[1],u=i[2]}}return[l,c,u,a.length>3?a[3]:1]},te=u.unpack,ne=u.type;m.prototype.hcg=function(){return Q(this._rgb)},y.hcg=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(m,[null].concat(e,["hcg"])))},d.format.hcg=ee,d.autodetect.push({p:1,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=te(e,"hcg"),"array"===ne(e)&&3===e.length)return"hcg"}});var re=u.unpack,oe=u.last,ie=Math.round,ae=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=re(e,"rgba"),r=n[0],o=n[1],i=n[2],a=n[3],s=oe(e)||"auto";void 0===a&&(a=1),"auto"===s&&(s=a<1?"rgba":"rgb");var l="000000"+((r=ie(r))<<16|(o=ie(o))<<8|(i=ie(i))).toString(16);l=l.substr(l.length-6);var c="0"+ie(255*a).toString(16);switch(c=c.substr(c.length-2),s.toLowerCase()){case"rgba":return"#"+l+c;case"argb":return"#"+c+l;default:return"#"+l}},se=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,le=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,ce=function(e){if(e.match(se)){4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]);var t=parseInt(e,16);return[t>>16,t>>8&255,255&t,1]}if(e.match(le)){5!==e.length&&9!==e.length||(e=e.substr(1)),4===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);var n=parseInt(e,16);return[n>>24&255,n>>16&255,n>>8&255,Math.round((255&n)/255*100)/100]}throw new Error("unknown hex color: "+e)},ue=u.type;m.prototype.hex=function(e){return ae(this._rgb,e)},y.hex=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(m,[null].concat(e,["hex"])))},d.format.hex=ce,d.autodetect.push({p:4,test:function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];if(!t.length&&"string"===ue(e)&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});var de=u.unpack,fe=u.TWOPI,pe=Math.min,he=Math.sqrt,ge=Math.acos,me=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r=de(e,"rgb"),o=r[0],i=r[1],a=r[2],s=pe(o/=255,i/=255,a/=255),l=(o+i+a)/3,c=l>0?1-s/l:0;return 0===c?n=NaN:(n=(o-i+(o-a))/2,n/=he((o-i)*(o-i)+(o-a)*(i-a)),n=ge(n),a>i&&(n=fe-n),n/=fe),[360*n,c,l]},ve=u.unpack,ye=u.limit,be=u.TWOPI,we=u.PITHIRD,xe=Math.cos,Ee=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r,o,i=(e=ve(e,"hsi"))[0],a=e[1],s=e[2];return isNaN(i)&&(i=0),isNaN(a)&&(a=0),i>360&&(i-=360),i<0&&(i+=360),(i/=360)<1/3?r=1-((o=(1-a)/3)+(n=(1+a*xe(be*i)/xe(we-be*i))/3)):i<2/3?o=1-((n=(1-a)/3)+(r=(1+a*xe(be*(i-=1/3))/xe(we-be*i))/3)):n=1-((r=(1-a)/3)+(o=(1+a*xe(be*(i-=2/3))/xe(we-be*i))/3)),[255*(n=ye(s*n*3)),255*(r=ye(s*r*3)),255*(o=ye(s*o*3)),e.length>3?e[3]:1]},Ce=u.unpack,ke=u.type;m.prototype.hsi=function(){return me(this._rgb)},y.hsi=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(m,[null].concat(e,["hsi"])))},d.format.hsi=Ee,d.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Ce(e,"hsi"),"array"===ke(e)&&3===e.length)return"hsi"}});var Se=u.unpack,_e=u.type;m.prototype.hsl=function(){return R(this._rgb)},y.hsl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(m,[null].concat(e,["hsl"])))},d.format.hsl=F,d.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Se(e,"hsl"),"array"===_e(e)&&3===e.length)return"hsl"}});var Oe=u.unpack,Te=Math.min,Pe=Math.max,Ne=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r,o,i=(e=Oe(e,"rgb"))[0],a=e[1],s=e[2],l=Te(i,a,s),c=Pe(i,a,s),u=c-l;return o=c/255,0===c?(n=Number.NaN,r=0):(r=u/c,i===c&&(n=(a-s)/u),a===c&&(n=2+(s-i)/u),s===c&&(n=4+(i-a)/u),(n*=60)<0&&(n+=360)),[n,r,o]},Re=u.unpack,Me=Math.floor,Ae=function(){for(var e,t,n,r,o,i,a=[],s=arguments.length;s--;)a[s]=arguments[s];var l,c,u,d=(a=Re(a,"hsv"))[0],f=a[1],p=a[2];if(p*=255,0===f)l=c=u=p;else{360===d&&(d=0),d>360&&(d-=360),d<0&&(d+=360);var h=Me(d/=60),g=d-h,m=p*(1-f),v=p*(1-f*g),y=p*(1-f*(1-g));switch(h){case 0:l=(e=[p,y,m])[0],c=e[1],u=e[2];break;case 1:l=(t=[v,p,m])[0],c=t[1],u=t[2];break;case 2:l=(n=[m,p,y])[0],c=n[1],u=n[2];break;case 3:l=(r=[m,v,p])[0],c=r[1],u=r[2];break;case 4:l=(o=[y,m,p])[0],c=o[1],u=o[2];break;case 5:l=(i=[p,m,v])[0],c=i[1],u=i[2]}}return[l,c,u,a.length>3?a[3]:1]},je=u.unpack,De=u.type;m.prototype.hsv=function(){return Ne(this._rgb)},y.hsv=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(m,[null].concat(e,["hsv"])))},d.format.hsv=Ae,d.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=je(e,"hsv"),"array"===De(e)&&3===e.length)return"hsv"}});var Le={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},Ie=u.unpack,Fe=Math.pow,ze=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=Ie(e,"rgb"),r=n[0],o=n[1],i=n[2],a=Ue(r,o,i),s=a[0],l=a[1],c=116*l-16;return[c<0?0:c,500*(s-l),200*(l-a[2])]},Ve=function(e){return(e/=255)<=.04045?e/12.92:Fe((e+.055)/1.055,2.4)},Be=function(e){return e>Le.t3?Fe(e,1/3):e/Le.t2+Le.t0},Ue=function(e,t,n){return e=Ve(e),t=Ve(t),n=Ve(n),[Be((.4124564*e+.3575761*t+.1804375*n)/Le.Xn),Be((.2126729*e+.7151522*t+.072175*n)/Le.Yn),Be((.0193339*e+.119192*t+.9503041*n)/Le.Zn)]},He=ze,We=u.unpack,Ke=Math.pow,qe=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r,o,i=(e=We(e,"lab"))[0],a=e[1],s=e[2];return r=(i+16)/116,n=isNaN(a)?r:r+a/500,o=isNaN(s)?r:r-s/200,r=Le.Yn*Ye(r),n=Le.Xn*Ye(n),o=Le.Zn*Ye(o),[Ge(3.2404542*n-1.5371385*r-.4985314*o),Ge(-.969266*n+1.8760108*r+.041556*o),Ge(.0556434*n-.2040259*r+1.0572252*o),e.length>3?e[3]:1]},Ge=function(e){return 255*(e<=.00304?12.92*e:1.055*Ke(e,1/2.4)-.055)},Ye=function(e){return e>Le.t1?e*e*e:Le.t2*(e-Le.t0)},$e=qe,Xe=u.unpack,Qe=u.type;m.prototype.lab=function(){return He(this._rgb)},y.lab=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(m,[null].concat(e,["lab"])))},d.format.lab=$e,d.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Xe(e,"lab"),"array"===Qe(e)&&3===e.length)return"lab"}});var Je=u.unpack,Ze=u.RAD2DEG,et=Math.sqrt,tt=Math.atan2,nt=Math.round,rt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=Je(e,"lab"),r=n[0],o=n[1],i=n[2],a=et(o*o+i*i),s=(tt(i,o)*Ze+360)%360;return 0===nt(1e4*a)&&(s=Number.NaN),[r,a,s]},ot=u.unpack,it=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=ot(e,"rgb"),r=n[0],o=n[1],i=n[2],a=He(r,o,i),s=a[0],l=a[1],c=a[2];return rt(s,l,c)},at=u.unpack,st=u.DEG2RAD,lt=Math.sin,ct=Math.cos,ut=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=at(e,"lch"),r=n[0],o=n[1],i=n[2];return isNaN(i)&&(i=0),[r,ct(i*=st)*o,lt(i)*o]},dt=u.unpack,ft=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=(e=dt(e,"lch"))[0],r=e[1],o=e[2],i=ut(n,r,o),a=i[0],s=i[1],l=i[2],c=$e(a,s,l);return[c[0],c[1],c[2],e.length>3?e[3]:1]},pt=u.unpack,ht=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=pt(e,"hcl").reverse();return ft.apply(void 0,n)},gt=u.unpack,mt=u.type;m.prototype.lch=function(){return it(this._rgb)},m.prototype.hcl=function(){return it(this._rgb).reverse()},y.lch=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(m,[null].concat(e,["lch"])))},y.hcl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(m,[null].concat(e,["hcl"])))},d.format.lch=ft,d.format.hcl=ht,["lch","hcl"].forEach((function(e){return d.autodetect.push({p:2,test:function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];if(t=gt(t,e),"array"===mt(t)&&3===t.length)return e}})}));var vt={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",cornflower:"#6495ed",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",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",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",maroon2:"#7f0000",maroon3:"#b03060",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",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},yt=u.type;m.prototype.name=function(){for(var e=ae(this._rgb,"rgb"),t=0,n=Object.keys(vt);t0;)t[n]=arguments[n+1];if(!t.length&&"string"===yt(e)&&vt[e.toLowerCase()])return"named"}});var bt=u.unpack,wt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=bt(e,"rgb");return(n[0]<<16)+(n[1]<<8)+n[2]},xt=u.type,Et=function(e){if("number"==xt(e)&&e>=0&&e<=16777215)return[e>>16,e>>8&255,255&e,1];throw new Error("unknown num color: "+e)},Ct=u.type;m.prototype.num=function(){return wt(this._rgb)},y.num=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(m,[null].concat(e,["num"])))},d.format.num=Et,d.autodetect.push({p:5,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(1===e.length&&"number"===Ct(e[0])&&e[0]>=0&&e[0]<=16777215)return"num"}});var kt=u.unpack,St=u.type,_t=Math.round;m.prototype.rgb=function(e){return void 0===e&&(e=!0),!1===e?this._rgb.slice(0,3):this._rgb.slice(0,3).map(_t)},m.prototype.rgba=function(e){return void 0===e&&(e=!0),this._rgb.slice(0,4).map((function(t,n){return n<3?!1===e?t:_t(t):t}))},y.rgb=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(m,[null].concat(e,["rgb"])))},d.format.rgb=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=kt(e,"rgba");return void 0===n[3]&&(n[3]=1),n},d.autodetect.push({p:3,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=kt(e,"rgba"),"array"===St(e)&&(3===e.length||4===e.length&&"number"==St(e[3])&&e[3]>=0&&e[3]<=1))return"rgb"}});var Ot=Math.log,Tt=function(e){var t,n,r,o=e/100;return o<66?(t=255,n=-155.25485562709179-.44596950469579133*(n=o-2)+104.49216199393888*Ot(n),r=o<20?0:.8274096064007395*(r=o-10)-254.76935184120902+115.67994401066147*Ot(r)):(t=351.97690566805693+.114206453784165*(t=o-55)-40.25366309332127*Ot(t),n=325.4494125711974+.07943456536662342*(n=o-50)-28.0852963507957*Ot(n),r=255),[t,n,r,1]},Pt=u.unpack,Nt=Math.round,Rt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n,r=Pt(e,"rgb"),o=r[0],i=r[2],a=1e3,s=4e4,l=.4;s-a>l;){var c=Tt(n=.5*(s+a));c[2]/c[0]>=i/o?s=n:a=n}return Nt(n)};m.prototype.temp=m.prototype.kelvin=m.prototype.temperature=function(){return Rt(this._rgb)},y.temp=y.kelvin=y.temperature=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(m,[null].concat(e,["temp"])))},d.format.temp=d.format.kelvin=d.format.temperature=Tt;var Mt=u.type;m.prototype.alpha=function(e,t){return void 0===t&&(t=!1),void 0!==e&&"number"===Mt(e)?t?(this._rgb[3]=e,this):new m([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]},m.prototype.clipped=function(){return this._rgb._clipped||!1},m.prototype.darken=function(e){void 0===e&&(e=1);var t=this,n=t.lab();return n[0]-=Le.Kn*e,new m(n,"lab").alpha(t.alpha(),!0)},m.prototype.brighten=function(e){return void 0===e&&(e=1),this.darken(-e)},m.prototype.darker=m.prototype.darken,m.prototype.brighter=m.prototype.brighten,m.prototype.get=function(e){var t=e.split("."),n=t[0],r=t[1],o=this[n]();if(r){var i=n.indexOf(r);if(i>-1)return o[i];throw new Error("unknown channel "+r+" in mode "+n)}return o};var At=u.type,jt=Math.pow,Dt=1e-7,Lt=20;m.prototype.luminance=function(e){if(void 0!==e&&"number"===At(e)){if(0===e)return new m([0,0,0,this._rgb[3]],"rgb");if(1===e)return new m([255,255,255,this._rgb[3]],"rgb");var t=this.luminance(),n="rgb",r=Lt,o=function(t,i){var a=t.interpolate(i,.5,n),s=a.luminance();return Math.abs(e-s)e?o(t,a):o(a,i)},i=(t>e?o(new m([0,0,0]),this):o(this,new m([255,255,255]))).rgb();return new m(i.concat([this._rgb[3]]))}return It.apply(void 0,this._rgb.slice(0,3))};var It=function(e,t,n){return.2126*(e=Ft(e))+.7152*(t=Ft(t))+.0722*(n=Ft(n))},Ft=function(e){return(e/=255)<=.03928?e/12.92:jt((e+.055)/1.055,2.4)},zt={},Vt=u.type,Bt=function(e,t,n){void 0===n&&(n=.5);for(var r=[],o=arguments.length-3;o-- >0;)r[o]=arguments[o+3];var i=r[0]||"lrgb";if(zt[i]||r.length||(i=Object.keys(zt)[0]),!zt[i])throw new Error("interpolation mode "+i+" is not defined");return"object"!==Vt(e)&&(e=new m(e)),"object"!==Vt(t)&&(t=new m(t)),zt[i](e,t,n).alpha(e.alpha()+n*(t.alpha()-e.alpha()))};m.prototype.mix=m.prototype.interpolate=function(e,t){void 0===t&&(t=.5);for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return Bt.apply(void 0,[this,e,t].concat(n))},m.prototype.premultiply=function(e){void 0===e&&(e=!1);var t=this._rgb,n=t[3];return e?(this._rgb=[t[0]*n,t[1]*n,t[2]*n,n],this):new m([t[0]*n,t[1]*n,t[2]*n,n],"rgb")},m.prototype.saturate=function(e){void 0===e&&(e=1);var t=this,n=t.lch();return n[1]+=Le.Kn*e,n[1]<0&&(n[1]=0),new m(n,"lch").alpha(t.alpha(),!0)},m.prototype.desaturate=function(e){return void 0===e&&(e=1),this.saturate(-e)};var Ut=u.type;m.prototype.set=function(e,t,n){void 0===n&&(n=!1);var r=e.split("."),o=r[0],i=r[1],a=this[o]();if(i){var s=o.indexOf(i);if(s>-1){if("string"==Ut(t))switch(t.charAt(0)){case"+":case"-":a[s]+=+t;break;case"*":a[s]*=+t.substr(1);break;case"/":a[s]/=+t.substr(1);break;default:a[s]=+t}else{if("number"!==Ut(t))throw new Error("unsupported value for Color.set");a[s]=t}var l=new m(a,o);return n?(this._rgb=l._rgb,this):l}throw new Error("unknown channel "+i+" in mode "+o)}return a};var Ht=function(e,t,n){var r=e._rgb,o=t._rgb;return new m(r[0]+n*(o[0]-r[0]),r[1]+n*(o[1]-r[1]),r[2]+n*(o[2]-r[2]),"rgb")};zt.rgb=Ht;var Wt=Math.sqrt,Kt=Math.pow,qt=function(e,t,n){var r=e._rgb,o=r[0],i=r[1],a=r[2],s=t._rgb,l=s[0],c=s[1],u=s[2];return new m(Wt(Kt(o,2)*(1-n)+Kt(l,2)*n),Wt(Kt(i,2)*(1-n)+Kt(c,2)*n),Wt(Kt(a,2)*(1-n)+Kt(u,2)*n),"rgb")};zt.lrgb=qt;var Gt=function(e,t,n){var r=e.lab(),o=t.lab();return new m(r[0]+n*(o[0]-r[0]),r[1]+n*(o[1]-r[1]),r[2]+n*(o[2]-r[2]),"lab")};zt.lab=Gt;var Yt=function(e,t,n,r){var o,i,a,s,l,c,u,d,f,p,h,g;return"hsl"===r?(a=e.hsl(),s=t.hsl()):"hsv"===r?(a=e.hsv(),s=t.hsv()):"hcg"===r?(a=e.hcg(),s=t.hcg()):"hsi"===r?(a=e.hsi(),s=t.hsi()):"lch"!==r&&"hcl"!==r||(r="hcl",a=e.hcl(),s=t.hcl()),"h"===r.substr(0,1)&&(l=(o=a)[0],u=o[1],f=o[2],c=(i=s)[0],d=i[1],p=i[2]),isNaN(l)||isNaN(c)?isNaN(l)?isNaN(c)?g=Number.NaN:(g=c,1!=f&&0!=f||"hsv"==r||(h=d)):(g=l,1!=p&&0!=p||"hsv"==r||(h=u)):g=l+n*(c>l&&c-l>180?c-(l+360):c180?c+360-l:c-l),void 0===h&&(h=u+n*(d-u)),new m([g,h,f+n*(p-f)],r)},$t=function(e,t,n){return Yt(e,t,n,"lch")};zt.lch=$t,zt.hcl=$t;var Xt=function(e,t,n){var r=e.num(),o=t.num();return new m(r+n*(o-r),"num")};zt.num=Xt;var Qt=function(e,t,n){return Yt(e,t,n,"hcg")};zt.hcg=Qt;var Jt=function(e,t,n){return Yt(e,t,n,"hsi")};zt.hsi=Jt;var Zt=function(e,t,n){return Yt(e,t,n,"hsl")};zt.hsl=Zt;var en=function(e,t,n){return Yt(e,t,n,"hsv")};zt.hsv=en;var tn=u.clip_rgb,nn=Math.pow,rn=Math.sqrt,on=Math.PI,an=Math.cos,sn=Math.sin,ln=Math.atan2,cn=function(e,t,n){void 0===t&&(t="lrgb"),void 0===n&&(n=null);var r=e.length;n||(n=Array.from(new Array(r)).map((function(){return 1})));var o=r/n.reduce((function(e,t){return e+t}));if(n.forEach((function(e,t){n[t]*=o})),e=e.map((function(e){return new m(e)})),"lrgb"===t)return un(e,n);for(var i=e.shift(),a=i.get(t),s=[],l=0,c=0,u=0;u=360;)h-=360;a[p]=h}else a[p]=a[p]/s[p];return f/=r,new m(a,t).alpha(f>.99999?1:f,!0)},un=function(e,t){for(var n=e.length,r=[0,0,0,0],o=0;o.9999999&&(r[3]=1),new m(tn(r))},dn=u.type,fn=Math.pow,pn=function(e){var t="rgb",n=y("#ccc"),r=0,o=[0,1],i=[],a=[0,0],s=!1,l=[],c=!1,u=0,d=1,f=!1,p={},h=!0,g=1,m=function(e){if((e=e||["#fff","#000"])&&"string"===dn(e)&&y.brewer&&y.brewer[e.toLowerCase()]&&(e=y.brewer[e.toLowerCase()]),"array"===dn(e)){1===e.length&&(e=[e[0],e[0]]),e=e.slice(0);for(var t=0;t=s[n];)n++;return n-1}return 0},b=function(e){return e},w=function(e){return e},x=function(e,r){var o,c;if(null==r&&(r=!1),isNaN(e)||null===e)return n;c=r?e:s&&s.length>2?v(e)/(s.length-2):d!==u?(e-u)/(d-u):1,c=w(c),r||(c=b(c)),1!==g&&(c=fn(c,g)),c=a[0]+c*(1-a[0]-a[1]),c=Math.min(1,Math.max(0,c));var f=Math.floor(1e4*c);if(h&&p[f])o=p[f];else{if("array"===dn(l))for(var m=0;m=x&&m===i.length-1){o=l[m];break}if(c>x&&c2){var c=e.map((function(t,n){return n/(e.length-1)})),f=e.map((function(e){return(e-u)/(d-u)}));f.every((function(e,t){return c[t]===e}))||(w=function(e){if(e<=0||e>=1)return e;for(var t=0;e>=f[t+1];)t++;var n=(e-f[t])/(f[t+1]-f[t]);return c[t]+n*(c[t+1]-c[t])})}}return o=[u,d],C},C.mode=function(e){return arguments.length?(t=e,E(),C):t},C.range=function(e,t){return m(e,t),C},C.out=function(e){return c=e,C},C.spread=function(e){return arguments.length?(r=e,C):r},C.correctLightness=function(e){return null==e&&(e=!0),f=e,E(),b=f?function(e){for(var t=x(0,!0).lab()[0],n=x(1,!0).lab()[0],r=t>n,o=x(e,!0).lab()[0],i=t+(n-t)*e,a=o-i,s=0,l=1,c=20;Math.abs(a)>.01&&c-- >0;)r&&(a*=-1),a<0?(s=e,e+=.5*(l-e)):(l=e,e+=.5*(s-e)),o=x(e,!0).lab()[0],a=o-i;return e}:function(e){return e},C},C.padding=function(e){return null!=e?("number"===dn(e)&&(e=[e,e]),a=e,C):a},C.colors=function(t,n){arguments.length<2&&(n="hex");var r=[];if(0===arguments.length)r=l.slice(0);else if(1===t)r=[C(.5)];else if(t>1){var i=o[0],a=o[1]-i;r=hn(0,t,!1).map((function(e){return C(i+e/(t-1)*a)}))}else{e=[];var c=[];if(s&&s.length>2)for(var u=1,d=s.length,f=1<=d;f?ud;f?u++:u--)c.push(.5*(s[u-1]+s[u]));else c=o;r=c.map((function(e){return C(e)}))}return y[n]&&(r=r.map((function(e){return e[n]()}))),r},C.cache=function(e){return null!=e?(h=e,C):h},C.gamma=function(e){return null!=e?(g=e,C):g},C.nodata=function(e){return null!=e?(n=y(e),C):n},C};function hn(e,t,n){for(var r=[],o=ei;o?a++:a--)r.push(a);return r}var gn=function(e){var t,n,r,o,i,a,s;if(2===(e=e.map((function(e){return new m(e)}))).length)t=e.map((function(e){return e.lab()})),i=t[0],a=t[1],o=function(e){var t=[0,1,2].map((function(t){return i[t]+e*(a[t]-i[t])}));return new m(t,"lab")};else if(3===e.length)n=e.map((function(e){return e.lab()})),i=n[0],a=n[1],s=n[2],o=function(e){var t=[0,1,2].map((function(t){return(1-e)*(1-e)*i[t]+2*(1-e)*e*a[t]+e*e*s[t]}));return new m(t,"lab")};else if(4===e.length){var l;r=e.map((function(e){return e.lab()})),i=r[0],a=r[1],s=r[2],l=r[3],o=function(e){var t=[0,1,2].map((function(t){return(1-e)*(1-e)*(1-e)*i[t]+3*(1-e)*(1-e)*e*a[t]+3*(1-e)*e*e*s[t]+e*e*e*l[t]}));return new m(t,"lab")}}else if(5===e.length){var c=gn(e.slice(0,3)),u=gn(e.slice(2,5));o=function(e){return e<.5?c(2*e):u(2*(e-.5))}}return o},mn=function(e){var t=gn(e);return t.scale=function(){return pn(t)},t},vn=function(e,t,n){if(!vn[n])throw new Error("unknown blend mode "+n);return vn[n](e,t)},yn=function(e){return function(t,n){var r=y(n).rgb(),o=y(t).rgb();return y.rgb(e(r,o))}},bn=function(e){return function(t,n){var r=[];return r[0]=e(t[0],n[0]),r[1]=e(t[1],n[1]),r[2]=e(t[2],n[2]),r}},wn=function(e){return e},xn=function(e,t){return e*t/255},En=function(e,t){return e>t?t:e},Cn=function(e,t){return e>t?e:t},kn=function(e,t){return 255*(1-(1-e/255)*(1-t/255))},Sn=function(e,t){return t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255))},_n=function(e,t){return 255*(1-(1-t/255)/(e/255))},On=function(e,t){return 255===e||(e=t/255*255/(1-e/255))>255?255:e};vn.normal=yn(bn(wn)),vn.multiply=yn(bn(xn)),vn.screen=yn(bn(kn)),vn.overlay=yn(bn(Sn)),vn.darken=yn(bn(En)),vn.lighten=yn(bn(Cn)),vn.dodge=yn(bn(On)),vn.burn=yn(bn(_n));for(var Tn=vn,Pn=u.type,Nn=u.clip_rgb,Rn=u.TWOPI,Mn=Math.pow,An=Math.sin,jn=Math.cos,Dn=function(e,t,n,r,o){void 0===e&&(e=300),void 0===t&&(t=-1.5),void 0===n&&(n=1),void 0===r&&(r=1),void 0===o&&(o=[0,1]);var i,a=0;"array"===Pn(o)?i=o[1]-o[0]:(i=0,o=[o,o]);var s=function(s){var l=Rn*((e+120)/360+t*s),c=Mn(o[0]+i*s,r),u=(0!==a?n[0]+s*a:n)*c*(1-c)/2,d=jn(l),f=An(l);return y(Nn([255*(c+u*(-.14861*d+1.78277*f)),255*(c+u*(-.29227*d-.90649*f)),255*(c+u*(1.97294*d)),1]))};return s.start=function(t){return null==t?e:(e=t,s)},s.rotations=function(e){return null==e?t:(t=e,s)},s.gamma=function(e){return null==e?r:(r=e,s)},s.hue=function(e){return null==e?n:("array"===Pn(n=e)?0==(a=n[1]-n[0])&&(n=n[1]):a=0,s)},s.lightness=function(e){return null==e?o:("array"===Pn(e)?(o=e,i=e[1]-e[0]):(o=[e,e],i=0),s)},s.scale=function(){return y.scale(s)},s.hue(n),s},Ln="0123456789abcdef",In=Math.floor,Fn=Math.random,zn=function(){for(var e="#",t=0;t<6;t++)e+=Ln.charAt(In(16*Fn()));return new m(e,"hex")},Vn=Math.log,Bn=Math.pow,Un=Math.floor,Hn=Math.abs,Wn=function(e,t){void 0===t&&(t=null);var n={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return"object"===a(e)&&(e=Object.values(e)),e.forEach((function(e){t&&"object"===a(e)&&(e=e[t]),null==e||isNaN(e)||(n.values.push(e),n.sum+=e,en.max&&(n.max=e),n.count+=1)})),n.domain=[n.min,n.max],n.limits=function(e,t){return Kn(n,e,t)},n},Kn=function(e,t,n){void 0===t&&(t="equal"),void 0===n&&(n=7),"array"==a(e)&&(e=Wn(e));var r=e.min,o=e.max,i=e.values.sort((function(e,t){return e-t}));if(1===n)return[r,o];var s=[];if("c"===t.substr(0,1)&&(s.push(r),s.push(o)),"e"===t.substr(0,1)){s.push(r);for(var l=1;l 0");var c=Math.LOG10E*Vn(r),u=Math.LOG10E*Vn(o);s.push(r);for(var d=1;d200&&(w=!1)}for(var L={},I=0;Ir?(n+.05)/(r+.05):(r+.05)/(n+.05)},Yn=Math.sqrt,$n=Math.atan2,Xn=Math.abs,Qn=Math.cos,Jn=Math.PI,Zn=function(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=1),e=new m(e),t=new m(t);for(var o=Array.from(e.lab()),i=o[0],a=o[1],s=o[2],l=Array.from(t.lab()),c=l[0],u=l[1],d=l[2],f=Yn(a*a+s*s),p=Yn(u*u+d*d),h=i<16?.511:.040975*i/(1+.01765*i),g=.0638*f/(1+.0131*f)+.638,v=f<1e-6?0:180*$n(s,a)/Jn;v<0;)v+=360;for(;v>=360;)v-=360;var y=v>=164&&v<=345?.56+Xn(.2*Qn(Jn*(v+168)/180)):.36+Xn(.4*Qn(Jn*(v+35)/180)),b=f*f*f*f,w=Yn(b/(b+1900)),x=g*(w*y+1-w),E=f-p,C=a-u,k=s-d,S=(i-c)/(n*h),_=E/(r*g);return Yn(S*S+_*_+(C*C+k*k-E*E)/(x*x))},er=function(e,t,n){void 0===n&&(n="lab"),e=new m(e),t=new m(t);var r=e.get(n),o=t.get(n),i=0;for(var a in r){var s=(r[a]||0)-(o[a]||0);i+=s*s}return Math.sqrt(i)},tr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];try{return new(Function.prototype.bind.apply(m,[null].concat(e))),!0}catch(e){return!1}},nr={cool:function(){return pn([y.hsl(180,1,.9),y.hsl(250,.7,.4)])},hot:function(){return pn(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")}},rr={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},or=0,ir=Object.keys(rr);ort}};else{if(!function(e){return 3===e.nodeType}(t))throw new Error("Argument 2 of seek must be a number or a Text Node.");var s=function(e,t){if(e===t)return!1;var n=null,i=[e].concat((0,r.default)(e)).reverse(),a=[t].concat((0,r.default)(t)).reverse();for(;i[0]===a[0];)n=i.shift(),a.shift();i=i[0],a=a[0];var s=(0,o.default)(n.childNodes,i),l=(0,o.default)(n.childNodes,a);return s>l}(i,t)?function(){return!1}:function(){return i!==t};a={forward:s,backward:function(){return i!=t||!e.pointerBeforeReferenceNode}}}var l;for(;a.forward()&&null!==(i=e.nextNode());)n+=i.nodeValue.length;for(;a.backward()&&null!==(i=e.previousNode());)n-=i.nodeValue.length;return n};var r=i(n(6259)),o=i(n(1684));function i(e){return e&&e.__esModule?e:{default:e}}},7187:function(e){"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}g(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&g(e,"error",t,n)}(e,o,{once:!0})}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var o,i,a;if(s(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=l(e))>0&&a.length>o&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,function(e){console&&console.warn&&console.warn(e)}(c)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=u.bind(r);return o.listener=n,r.wrapFn=o,o}function f(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=i[e];if(void 0===l)return!1;if("function"==typeof l)r(l,this,t);else{var c=l.length,u=h(l,c);for(n=0;n=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return f(this,e,!0)},i.prototype.rawListeners=function(e){return f(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},i.prototype.listenerCount=p,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},4906:function(e){e.exports=function e(n){if(t(n))return n;if(t(n.ownerDocument))return n.ownerDocument;if(t(n.document))return n.document;if(n.parentNode)return e(n.parentNode);if(n.commonAncestorContainer)return e(n.commonAncestorContainer);if(n.startContainer)return e(n.startContainer);if(n.anchorNode)return e(n.anchorNode)};function t(e){return e&&9===e.nodeType}},645:function(e,t){t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,l=(1<>1,u=-7,d=n?o-1:0,f=n?-1:1,p=e[t+d];for(d+=f,i=p&(1<<-u)-1,p>>=-u,u+=s;u>0;i=256*i+e[t+d],d+=f,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+e[t+d],d+=f,u-=8);if(0===i)i=1-c;else{if(i===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),i-=c}return(p?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,l,c=8*i-o-1,u=(1<>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,h=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+d>=1?f/l:f*Math.pow(2,1-d))*l>=2&&(a++,l/=2),a+d>=u?(s=0,a=u):a+d>=1?(s=(t*l-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+p]=255&s,p+=h,s/=256,o-=8);for(a=a<0;e[n+p]=255&a,p+=h,a/=256,c-=8);e[n+p-h]|=128*g}},1684:function(e){"use strict";e.exports=function(e,t,n){n=n||0;if(null==e)return-1;var r=e.length,o=n<0?r+n:n;if(o>=e.length)return-1;for(;o1&&(i=v(e),e=[e[e.length-1]]),e=e[0],(e=l(e))in r||(r[e]=[]),r[e].push({shortcut:o[a],scope:t,method:n,key:o[a],mods:i})}for(n in a)h[n]=!1;function g(){return i||"all"}function m(e){var t;return""==(t=(e=e.replace(/\s/g,"")).split(","))[t.length-1]&&(t[t.length-2]+=","),t}function v(e){for(var t=e.slice(0,e.length-1),n=0;n0,o)(!o[i]&&u(n.mods,+i)>-1||o[i]&&-1==u(n.mods,+i))&&(l=!1);(0!=n.mods.length||o[16]||o[18]||o[17]||o[91])&&!l||!1===n.method(e,n)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}(e)})),y(document,"keyup",(function(e){var t,n=e.keyCode,r=u(c,n);if(r>=0&&c.splice(r,1),93!=n&&224!=n||(n=91),n in o)for(t in o[n]=!1,a)a[t]==n&&(h[t]=!1)})),y(window,"focus",(function(){for(n in o)o[n]=!1;for(n in a)h[n]=!1}));var b=t.key;t.key=h,t.key.setScope=function(e){i=e||"all"},t.key.getScope=g,t.key.deleteScope=function(e){var t,n,o;for(t in r)for(n=r[t],o=0;o1&&(c=v(o),e=o[o.length-1]),e=l(e),void 0===t&&(t=g()),!r[e])return;for(i=0;i0?e:[e]:[],this.layers=t,this},e.prototype.getLayers=function(){return this.layers},e.prototype.addLayer=function(e){var t,n=this.layers,r=n.length;for(t=0;t0},t.prototype.removeChildren=function(){for(var e,t=0;t1){for(var n=0;n0?t[0]:void 0},t.prototype._generalFind=function(e,t){var n=[];return this._descendants((function(r){var o=r._isMatch(e);return o&&n.push(r),!(!o||!t)})),i.Collection.toCollection(n)},t.prototype._descendants=function(e){for(var t=0;t=100&&t.shift()},e.prototype.reset=function(){var e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)},e.prototype.getCanvas=function(){return this.canvas},e.prototype.clear=function(e){var t=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,t.getWidth()/t.pixelRatio,t.getHeight()/t.pixelRatio)},e.prototype._applyLineCap=function(e){var t=e.getLineCap();t&&this.setAttr("lineCap",t)},e.prototype._applyOpacity=function(e){var t=e.getAbsoluteOpacity();1!==t&&this.setAttr("globalAlpha",t)},e.prototype._applyLineJoin=function(e){var t=e.getLineJoin();t&&this.setAttr("lineJoin",t)},e.prototype.setAttr=function(e,t){this._context[e]=t},e.prototype.arc=function(e,t,n,r,o,i){this._context.arc(e,t,n,r,o,i)},e.prototype.arcTo=function(e,t,n,r,o){this._context.arcTo(e,t,n,r,o)},e.prototype.beginPath=function(){this._context.beginPath()},e.prototype.bezierCurveTo=function(e,t,n,r,o,i){this._context.bezierCurveTo(e,t,n,r,o,i)},e.prototype.clearRect=function(e,t,n,r){this._context.clearRect(e,t,n,r)},e.prototype.clip=function(){this._context.clip()},e.prototype.closePath=function(){this._context.closePath()},e.prototype.createImageData=function(e,t){var n=arguments;return 2===n.length?this._context.createImageData(e,t):1===n.length?this._context.createImageData(e):void 0},e.prototype.createLinearGradient=function(e,t,n,r){return this._context.createLinearGradient(e,t,n,r)},e.prototype.createPattern=function(e,t){return this._context.createPattern(e,t)},e.prototype.createRadialGradient=function(e,t,n,r,o,i){return this._context.createRadialGradient(e,t,n,r,o,i)},e.prototype.drawImage=function(e,t,n,r,o,i,a,s,l){var c=arguments,u=this._context;3===c.length?u.drawImage(e,t,n):5===c.length?u.drawImage(e,t,n,r,o):9===c.length&&u.drawImage(e,t,n,r,o,i,a,s,l)},e.prototype.ellipse=function(e,t,n,r,o,i,a,s){this._context.ellipse(e,t,n,r,o,i,a,s)},e.prototype.isPointInPath=function(e,t){return this._context.isPointInPath(e,t)},e.prototype.fill=function(){this._context.fill()},e.prototype.fillRect=function(e,t,n,r){this._context.fillRect(e,t,n,r)},e.prototype.strokeRect=function(e,t,n,r){this._context.strokeRect(e,t,n,r)},e.prototype.fillText=function(e,t,n){this._context.fillText(e,t,n)},e.prototype.measureText=function(e){return this._context.measureText(e)},e.prototype.getImageData=function(e,t,n,r){return this._context.getImageData(e,t,n,r)},e.prototype.lineTo=function(e,t){this._context.lineTo(e,t)},e.prototype.moveTo=function(e,t){this._context.moveTo(e,t)},e.prototype.rect=function(e,t,n,r){this._context.rect(e,t,n,r)},e.prototype.putImageData=function(e,t,n){this._context.putImageData(e,t,n)},e.prototype.quadraticCurveTo=function(e,t,n,r){this._context.quadraticCurveTo(e,t,n,r)},e.prototype.restore=function(){this._context.restore()},e.prototype.rotate=function(e){this._context.rotate(e)},e.prototype.save=function(){this._context.save()},e.prototype.scale=function(e,t){this._context.scale(e,t)},e.prototype.setLineDash=function(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)},e.prototype.getLineDash=function(){return this._context.getLineDash()},e.prototype.setTransform=function(e,t,n,r,o,i){this._context.setTransform(e,t,n,r,o,i)},e.prototype.stroke=function(){this._context.stroke()},e.prototype.strokeText=function(e,t,n,r){this._context.strokeText(e,t,n,r)},e.prototype.transform=function(e,t,n,r,o,i){this._context.transform(e,t,n,r,o,i)},e.prototype.translate=function(e,t){this._context.translate(e,t)},e.prototype._enableTrace=function(){var e,t,n=this,r=s.length,o=i.Util._simplifyArray,a=this.setAttr,l=function(e){var r,i=n[e];n[e]=function(){return t=o(Array.prototype.slice.call(arguments,0)),r=i.apply(n,arguments),n._trace({method:e,args:t}),r}};for(e=0;e0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("trident/")>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var r=e.indexOf("edge/");return r>0&&parseInt(e.substring(r+5,e.indexOf(".",r)),10)};t._parseUA=function(e){var t=e.toLowerCase(),n=/(chrome)[ /]([\w.]+)/.exec(t)||/(webkit)[ /]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ /]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[],r=!!e.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i),i=!!e.match(/IEMobile/i);return{browser:n[1]||"",version:n[2]||"0",isIE:o(t),mobile:r,ieMobile:i}},t.glob=void 0!==n.g?n.g:"undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:{},t.Konva={_global:t.glob,version:"4.2.2",isBrowser:"undefined"!=typeof window&&("[object Window]"==={}.toString.call(window)||"[object global]"==={}.toString.call(window)),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle:function(e){return t.Konva.angleDeg?e*r:e},enableTrace:!1,_pointerEventsEnabled:!1,hitOnDragEnabled:!1,captureTouchEventsEnabled:!1,listenClickTap:!1,inDblClickWindow:!1,pixelRatio:void 0,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging:function(){return t.Konva.DD.isDragging},isDragReady:function(){return!!t.Konva.DD.node},UA:t._parseUA(t.glob.navigator&&t.glob.navigator.userAgent||""),document:t.glob.document,_injectGlobal:function(e){t.glob.Konva=e},_parseUA:t._parseUA},t._NODES_REGISTRY={},t._registerNode=function(e){t._NODES_REGISTRY[e.prototype.getClassName()]=e,t.Konva[e.prototype.getClassName()]=e}},8985:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(8588),a=n(8783),s=n(4417),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype._validateAdd=function(e){var t=e.getType();"Group"!==t&&"Shape"!==t&&i.Util.throw("You may only add groups and shapes to groups.")},t}(a.Container);t.Group=l,l.prototype.nodeType="Group",s._registerNode(l),i.Collection.mapMethods(l)},4415:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(8588),a=n(8783),s=n(1455),l=n(5331),c=n(4842),u=n(7955),d=n(3774),f=n(4417),p=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],h=p.length,g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.hitCanvas=new c.HitCanvas({pixelRatio:1}),t}return o(t,e),t.prototype._setCanvasSize=function(e,t){this.canvas.setSize(e,t),this.hitCanvas.setSize(e,t),this._checkSmooth()},t.prototype._validateAdd=function(e){var t=e.getType();"Group"!==t&&"Shape"!==t&&i.Util.throw("You may only add groups and shapes to a layer.")},t.prototype.getIntersection=function(e,t){var n,r,o,i;if(!this.hitGraphEnabled()||!this.isVisible())return null;for(var a=1,s=!1;;){for(r=0;r0?{antialiased:!0}:{}},t.prototype.drawScene=function(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas();return this._fire("beforeDraw",{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),a.Container.prototype.drawScene.call(this,r,t),this._fire("draw",{node:this}),this},t.prototype.drawHit=function(e,t){var n=this.getLayer(),r=e||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),a.Container.prototype.drawHit.call(this,r,t),this},t.prototype.clear=function(e){return l.BaseLayer.prototype.clear.call(this,e),this.getHitCanvas().getContext().clear(e),this},t.prototype.enableHitGraph=function(){return this.hitGraphEnabled(!0),this},t.prototype.disableHitGraph=function(){return this.hitGraphEnabled(!1),this},t.prototype.toggleHitCanvas=function(){if(this.parent){var e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}},t.prototype.setSize=function(t){var n=t.width,r=t.height;return e.prototype.setSize.call(this,{width:n,height:r}),this.hitCanvas.setSize(n,r),this},t}(l.BaseLayer);t.Layer=g,g.prototype.nodeType="Layer",f._registerNode(g),s.Factory.addGetterSetter(g,"hitGraphEnabled",!0,d.getBooleanValidator()),i.Collection.mapMethods(g)},7939:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8588),o=n(1455),i=n(4842),a=n(4417),s=n(210),l=n(3774);t.ids={},t.names={};t._removeId=function(e,n){e&&t.ids[e]===n&&delete t.ids[e]},t._addName=function(e,n){n&&(t.names[n]||(t.names[n]=[]),t.names[n].push(e))},t._removeName=function(e,n){if(e){var r=t.names[e];if(r){for(var o=0;o0&&e[0].getDepth()<=o&&s(e)}(i.getStage().getChildren()),a},e.prototype.getDepth=function(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e},e.prototype.setPosition=function(e){return this.x(e.x),this.y(e.y),this},e.prototype.getPosition=function(){return{x:this.x(),y:this.y()}},e.prototype.getAbsolutePosition=function(e){for(var t=!1,n=this.parent;n;){if(n.isCached()){t=!0;break}n=n.parent}t&&!e&&(e=!0);var o=this.getAbsoluteTransform(e).getMatrix(),i=new r.Transform,a=this.offset();return i.m=o.slice(),i.translate(a.x,a.y),i.getTranslation()},e.prototype.setAbsolutePosition=function(e){var t,n=this._clearTransform();return this.attrs.x=n.x,this.attrs.y=n.y,delete n.x,delete n.y,(t=this.getAbsoluteTransform()).invert(),t.translate(e.x,e.y),e={x:this.attrs.x+t.getTranslation().x,y:this.attrs.y+t.getTranslation().y},this.setPosition({x:e.x,y:e.y}),this._setTransform(n),this},e.prototype._setTransform=function(e){var t;for(t in e)this.attrs[t]=e[t];this._clearCache(b),this._clearSelfAndDescendantCache(u)},e.prototype._clearTransform=function(){var e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,this._clearCache(b),this._clearSelfAndDescendantCache(u),e},e.prototype.move=function(e){var t=e.x,n=e.y,r=this.x(),o=this.y();return void 0!==t&&(r+=t),void 0!==n&&(o+=n),this.setPosition({x:r,y:o}),this},e.prototype._eachAncestorReverse=function(e,t){var n,r,o=[],i=this.getParent();if(t&&t._id===this._id)e(this);else{for(o.unshift(this);i&&(!t||i._id!==t._id);)o.unshift(i),i=i.parent;for(n=o.length,r=0;r0&&(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0)},e.prototype.moveToBottom=function(){if(!this.parent)return r.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;var e=this.index;return e>0&&(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0)},e.prototype.setZIndex=function(e){if(!this.parent)return r.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&r.Util.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var t=this.index;return this.parent.children.splice(t,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this},e.prototype.getAbsoluteOpacity=function(){return this._getCache(c,this._getAbsoluteOpacity)},e.prototype._getAbsoluteOpacity=function(){var e=this.opacity(),t=this.getParent();return t&&!t._isUnderCache&&(e*=t.getAbsoluteOpacity()),e},e.prototype.moveTo=function(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this},e.prototype.toObject=function(){var e,t,n,o,i={},a=this.getAttrs();for(e in i.attrs={},a)t=a[e],r.Util.isObject(t)&&!r.Util._isPlainObject(t)&&!r.Util._isArray(t)||(n="function"==typeof this[e]&&this[e],delete a[e],o=n?n.call(this):null,a[e]=t,o!==t&&(i.attrs[e]=t));return i.className=this.getClassName(),r.Util._prepareToStringify(i)},e.prototype.toJSON=function(){return JSON.stringify(this.toObject())},e.prototype.getParent=function(){return this.parent},e.prototype.findAncestors=function(e,t,n){var r=[];t&&this._isMatch(e)&&r.push(this);for(var o=this.parent;o;){if(o===n)return r;o._isMatch(e)&&r.push(o),o=o.parent}return r},e.prototype.isAncestorOf=function(e){return!1},e.prototype.findAncestor=function(e,t,n){return this.findAncestors(e,t,n)[0]},e.prototype._isMatch=function(e){if(!e)return!1;if("function"==typeof e)return e(this);var t,n,o=e.replace(/ /g,"").split(","),i=o.length;for(t=0;t=0)&&!this.isDragging()){var n=!1;s.DD._dragElements.forEach((function(e){t.isAncestorOf(e.node)&&(n=!0)})),n||this._createDragElement(e)}}))},e.prototype._dragChange=function(){this.attrs.draggable?this._listenDrag():(this._dragCleanup(),this.getStage()&&s.DD._dragElements.has(this._id)&&this.stopDrag())},e.prototype._dragCleanup=function(){this.off("mousedown.konva"),this.off("touchstart.konva")},e.create=function(e,t){return r.Util._isString(e)&&(e=JSON.parse(e)),this._createNode(e,t)},e._createNode=function(t,n){var o,i,s,l=e.prototype.getClassName.call(t),c=t.children;if(n&&(t.attrs.container=n),a._NODES_REGISTRY[l]||(r.Util.warn('Can not find a node with class name "'+l+'". Fallback to "Shape".'),l="Shape"),o=new(0,a._NODES_REGISTRY[l])(t.attrs),c)for(i=c.length,s=0;s0},n.prototype.destroy=function(){return l.Node.prototype.destroy.call(this),delete t.shapes[this.colorKey],delete this.colorKey,this},n.prototype._useBufferCanvas=function(e){return!(e&&!this.hasShadow()||!this.perfectDrawEnabled()||1===this.getAbsoluteOpacity()||!this.hasFill()||!this.hasStroke()||!this.getStage())},n.prototype.setStrokeHitEnabled=function(e){a.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)},n.prototype.getStrokeHitEnabled=function(){return 0!==this.hitStrokeWidth()},n.prototype.getSelfRect=function(){var e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}},n.prototype.getClientRect=function(e){var t=(e=e||{}).skipTransform,n=e.relativeTo,r=this.getSelfRect(),o=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,i=r.width+o,a=r.height+o,s=!e.skipShadow&&this.hasShadow(),l=s?this.shadowOffsetX():0,c=s?this.shadowOffsetY():0,u=i+Math.abs(l),d=a+Math.abs(c),f=s&&this.shadowBlur()||0,p=u+2*f,h=d+2*f,g=0;Math.round(o/2)!==o/2&&(g=1);var m={width:p+g,height:h+g,x:-Math.round(o/2+f)+Math.min(l,0)+r.x,y:-Math.round(o/2+f)+Math.min(c,0)+r.y};return t?m:this._transformedRect(m,n)},n.prototype.drawScene=function(e,t,n,r){var o,i,a=this.getLayer(),s=e||a.getCanvas(),l=s.getContext(),c=this._getCanvasCache(),u=this.sceneFunc(),d=this.hasShadow(),f=this.hasStroke();if(!this.isVisible()&&!n)return this;if(c)return l.save(),a._applyTransform(this,l,t),this._drawCachedSceneCanvas(l),l.restore(),this;if(!u)return this;if(l.save(),this._useBufferCanvas(n)&&!r){if((i=(o=this.getStage().bufferCanvas).getContext()).clear(),i.save(),i._applyLineJoin(this),!n)if(a)a._applyTransform(this,i,t);else{var p=this.getAbsoluteTransform(t).getMatrix();l.transform(p[0],p[1],p[2],p[3],p[4],p[5])}u.call(this,i,this),i.restore();var h=o.pixelRatio;d&&!s.hitCanvas?(l.save(),l._applyShadow(this),l._applyOpacity(this),l._applyGlobalCompositeOperation(this),l.drawImage(o._canvas,0,0,o.width/h,o.height/h),l.restore()):(l._applyOpacity(this),l._applyGlobalCompositeOperation(this),l.drawImage(o._canvas,0,0,o.width/h,o.height/h))}else{if(l._applyLineJoin(this),!n)if(a)a._applyTransform(this,l,t);else{var g=this.getAbsoluteTransform(t).getMatrix();l.transform(g[0],g[1],g[2],g[3],g[4],g[5])}d&&f&&!s.hitCanvas?(l.save(),n||(l._applyOpacity(this),l._applyGlobalCompositeOperation(this)),l._applyShadow(this),u.call(this,l,this),l.restore(),this.hasFill()&&this.shadowForStrokeEnabled()&&u.call(this,l,this)):d&&!s.hitCanvas?(l.save(),n||(l._applyOpacity(this),l._applyGlobalCompositeOperation(this)),l._applyShadow(this),u.call(this,l,this),l.restore()):(n||(l._applyOpacity(this),l._applyGlobalCompositeOperation(this)),u.call(this,l,this))}return l.restore(),this},n.prototype.drawHit=function(e,t,n){var r=this.getLayer(),o=e||r.hitCanvas,i=o&&o.getContext(),s=this.hitFunc()||this.sceneFunc(),l=this._getCanvasCache(),c=l&&l.hit;if(this.colorKey||(console.log(this),a.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. See the shape in logs above. If you want to reuse shape you should call remove() instead of destroy()")),!this.shouldDrawHit()&&!n)return this;if(c)return i.save(),r._applyTransform(this,i,t),this._drawCachedHitCanvas(i),i.restore(),this;if(!s)return this;if(i.save(),i._applyLineJoin(this),!n)if(r)r._applyTransform(this,i,t);else{var u=this.getAbsoluteTransform(t).getMatrix();i.transform(u[0],u[1],u[2],u[3],u[4],u[5])}return s.call(this,i,this),i.restore(),this},n.prototype.drawHitFromCache=function(e){void 0===e&&(e=0);var t,n,r,o,i,s=this._getCanvasCache(),l=this._getCachedSceneCanvas(),c=s.hit,u=c.getContext(),d=c.getWidth(),f=c.getHeight();u.clear(),u.drawImage(l._canvas,0,0,d,f);try{for(r=(n=(t=u.getImageData(0,0,d,f)).data).length,o=a.Util._hexToRgb(this.colorKey),i=0;ie?(n[i]=o.r,n[i+1]=o.g,n[i+2]=o.b,n[i+3]=255):n[i+3]=0;u.putImageData(t,0,0)}catch(e){a.Util.error("Unable to draw hit graph from cached scene canvas. "+e.message)}return this},n.prototype.hasPointerCapture=function(e){return d.hasPointerCapture(e,this)},n.prototype.setPointerCapture=function(e){d.setPointerCapture(e,this)},n.prototype.releaseCapture=function(e){d.releaseCapture(e,this)},n}(l.Node);t.Shape=C,C.prototype._fillFunc=function(e){e.fill()},C.prototype._strokeFunc=function(e){e.stroke()},C.prototype._fillFuncHit=function(e){e.fill()},C.prototype._strokeFuncHit=function(e){e.stroke()},C.prototype._centroid=!1,C.prototype.nodeType="Shape",u._registerNode(C),s.Factory.addGetterSetter(C,"stroke",void 0,c.getStringValidator()),s.Factory.addGetterSetter(C,"strokeWidth",2,c.getNumberValidator()),s.Factory.addGetterSetter(C,"hitStrokeWidth","auto",c.getNumberOrAutoValidator()),s.Factory.addGetterSetter(C,"strokeHitEnabled",!0,c.getBooleanValidator()),s.Factory.addGetterSetter(C,"perfectDrawEnabled",!0,c.getBooleanValidator()),s.Factory.addGetterSetter(C,"shadowForStrokeEnabled",!0,c.getBooleanValidator()),s.Factory.addGetterSetter(C,"lineJoin"),s.Factory.addGetterSetter(C,"lineCap"),s.Factory.addGetterSetter(C,"sceneFunc"),s.Factory.addGetterSetter(C,"hitFunc"),s.Factory.addGetterSetter(C,"dash"),s.Factory.addGetterSetter(C,"dashOffset",0,c.getNumberValidator()),s.Factory.addGetterSetter(C,"shadowColor",void 0,c.getStringValidator()),s.Factory.addGetterSetter(C,"shadowBlur",0,c.getNumberValidator()),s.Factory.addGetterSetter(C,"shadowOpacity",1,c.getNumberValidator()),s.Factory.addComponentsGetterSetter(C,"shadowOffset",["x","y"]),s.Factory.addGetterSetter(C,"shadowOffsetX",0,c.getNumberValidator()),s.Factory.addGetterSetter(C,"shadowOffsetY",0,c.getNumberValidator()),s.Factory.addGetterSetter(C,"fillPatternImage"),s.Factory.addGetterSetter(C,"fill",void 0,c.getStringValidator()),s.Factory.addGetterSetter(C,"fillPatternX",0,c.getNumberValidator()),s.Factory.addGetterSetter(C,"fillPatternY",0,c.getNumberValidator()),s.Factory.addGetterSetter(C,"fillLinearGradientColorStops"),s.Factory.addGetterSetter(C,"strokeLinearGradientColorStops"),s.Factory.addGetterSetter(C,"fillRadialGradientStartRadius",0),s.Factory.addGetterSetter(C,"fillRadialGradientEndRadius",0),s.Factory.addGetterSetter(C,"fillRadialGradientColorStops"),s.Factory.addGetterSetter(C,"fillPatternRepeat","repeat"),s.Factory.addGetterSetter(C,"fillEnabled",!0),s.Factory.addGetterSetter(C,"strokeEnabled",!0),s.Factory.addGetterSetter(C,"shadowEnabled",!0),s.Factory.addGetterSetter(C,"dashEnabled",!0),s.Factory.addGetterSetter(C,"strokeScaleEnabled",!0),s.Factory.addGetterSetter(C,"fillPriority","color"),s.Factory.addComponentsGetterSetter(C,"fillPatternOffset",["x","y"]),s.Factory.addGetterSetter(C,"fillPatternOffsetX",0,c.getNumberValidator()),s.Factory.addGetterSetter(C,"fillPatternOffsetY",0,c.getNumberValidator()),s.Factory.addComponentsGetterSetter(C,"fillPatternScale",["x","y"]),s.Factory.addGetterSetter(C,"fillPatternScaleX",1,c.getNumberValidator()),s.Factory.addGetterSetter(C,"fillPatternScaleY",1,c.getNumberValidator()),s.Factory.addComponentsGetterSetter(C,"fillLinearGradientStartPoint",["x","y"]),s.Factory.addComponentsGetterSetter(C,"strokeLinearGradientStartPoint",["x","y"]),s.Factory.addGetterSetter(C,"fillLinearGradientStartPointX",0),s.Factory.addGetterSetter(C,"strokeLinearGradientStartPointX",0),s.Factory.addGetterSetter(C,"fillLinearGradientStartPointY",0),s.Factory.addGetterSetter(C,"strokeLinearGradientStartPointY",0),s.Factory.addComponentsGetterSetter(C,"fillLinearGradientEndPoint",["x","y"]),s.Factory.addComponentsGetterSetter(C,"strokeLinearGradientEndPoint",["x","y"]),s.Factory.addGetterSetter(C,"fillLinearGradientEndPointX",0),s.Factory.addGetterSetter(C,"strokeLinearGradientEndPointX",0),s.Factory.addGetterSetter(C,"fillLinearGradientEndPointY",0),s.Factory.addGetterSetter(C,"strokeLinearGradientEndPointY",0),s.Factory.addComponentsGetterSetter(C,"fillRadialGradientStartPoint",["x","y"]),s.Factory.addGetterSetter(C,"fillRadialGradientStartPointX",0),s.Factory.addGetterSetter(C,"fillRadialGradientStartPointY",0),s.Factory.addComponentsGetterSetter(C,"fillRadialGradientEndPoint",["x","y"]),s.Factory.addGetterSetter(C,"fillRadialGradientEndPointX",0),s.Factory.addGetterSetter(C,"fillRadialGradientEndPointY",0),s.Factory.addGetterSetter(C,"fillPatternRotation",0),s.Factory.backCompat(C,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"}),a.Collection.mapMethods(C)},8342:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(8588),a=n(1455),s=n(8783),l=n(4417),c=n(4842),u=n(210),d=n(4417),f=n(8479),p="mouseout",h="mouseleave",g="mouseover",m="mouseenter",v="mousemove",y="mousedown",b="mouseup",w="pointermove",x="pointerdown",E="pointerup",C="contextmenu",k="click",S="dblclick",_="touchstart",O="touchend",T="dbltap",P="touchmove",N="wheel",R=[m,y,v,b,p,_,P,O,g,N,C,x,w,E,"pointercancel","lostpointercapture"],M=R.length;function A(e,t){e.content.addEventListener(t,(function(n){e["_"+t](n)}),!1)}function j(e){return void 0===e&&(e={}),(e.clipFunc||e.clipWidth||e.clipHeight)&&i.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}t.stages=[];var D=function(e){function n(n){var r=e.call(this,j(n))||this;return r._pointerPositions=[],r._changedPointerPositions=[],r._buildDOM(),r._bindContentEvents(),t.stages.push(r),r.on("widthChange.konva heightChange.konva",r._resizeDOM),r.on("visibleChange.konva",r._checkVisibility),r.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",(function(){j(r.attrs)})),r._checkVisibility(),r}return o(n,e),n.prototype._validateAdd=function(e){var t="Layer"===e.getType(),n="FastLayer"===e.getType();t||n||i.Util.throw("You may only add layers to the stage.")},n.prototype._checkVisibility=function(){if(this.content){var e=this.visible()?"":"none";this.content.style.display=e}},n.prototype.setContainer=function(e){if("string"==typeof e){if("."===e.charAt(0)){var t=e.slice(1);e=document.getElementsByClassName(t)[0]}else{var n;n="#"!==e.charAt(0)?e:e.slice(1),e=document.getElementById(n)}if(!e)throw"Can not find container in document with id "+n}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this},n.prototype.shouldDrawHit=function(){return!0},n.prototype.clear=function(){var e,t=this.children,n=t.length;for(e=0;e-1&&t.stages.splice(r,1),this},n.prototype.getPointerPosition=function(){var e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(i.Util.warn("Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);"),null)},n.prototype._getPointerById=function(e){return this._pointerPositions.find((function(t){return t.id===e}))},n.prototype.getPointersPositions=function(){return this._pointerPositions},n.prototype.getStage=function(){return this},n.prototype.getContent=function(){return this.content},n.prototype._toKonvaCanvas=function(e){var t=(e=e||{}).x||0,n=e.y||0,r=new c.SceneCanvas({width:e.width||this.width(),height:e.height||this.height(),pixelRatio:e.pixelRatio||1}),o=r.getContext()._context,i=this.children;return(t||n)&&o.translate(-1*t,-1*n),i.each((function(r){if(r.isVisible()){var i=r._toKonvaCanvas(e);o.drawImage(i._canvas,t,n,i.getWidth()/i.getPixelRatio(),i.getHeight()/i.getPixelRatio())}})),r},n.prototype.getIntersection=function(e,t){if(!e)return null;var n,r,o=this.children;for(n=o.length-1;n>=0;n--)if(r=o[n].getIntersection(e,t))return r;return null},n.prototype._resizeDOM=function(){var e=this.width(),t=this.height();this.content&&(this.content.style.width=e+"px",this.content.style.height=t+"px"),this.bufferCanvas.setSize(e,t),this.bufferHitCanvas.setSize(e,t),this.children.each((function(n){n.setSize({width:e,height:t}),n.draw()}))},n.prototype.add=function(t){if(arguments.length>1){for(var n=0;n5&&i.Util.warn("The stage has "+r+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),t._setCanvasSize(this.width(),this.height()),t.draw(),l.Konva.isBrowser&&this.content.appendChild(t.canvas._canvas),this},n.prototype.getParent=function(){return null},n.prototype.getLayer=function(){return null},n.prototype.hasPointerCapture=function(e){return f.hasPointerCapture(e,this)},n.prototype.setPointerCapture=function(e){f.setPointerCapture(e,this)},n.prototype.releaseCapture=function(e){f.releaseCapture(e,this)},n.prototype.getLayers=function(){return this.getChildren()},n.prototype._bindContentEvents=function(){if(l.Konva.isBrowser)for(var e=0;ethis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())},e.prototype.getTime=function(){return this._time},e.prototype.setPosition=function(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e},e.prototype.getPosition=function(e){return void 0===e&&(e=this._time),this.func(e,this.begin,this._change,this.duration)},e.prototype.play=function(){this.state=2,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")},e.prototype.reverse=function(){this.state=3,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")},e.prototype.seek=function(e){this.pause(),this._time=e,this.update(),this.fire("onSeek")},e.prototype.reset=function(){this.pause(),this._time=0,this.update(),this.fire("onReset")},e.prototype.finish=function(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")},e.prototype.update=function(){this.setPosition(this.getPosition(this._time))},e.prototype.onEnterFrame=function(){var e=this.getTimer()-this._startTime;2===this.state?this.setTime(e):3===this.state&&this.setTime(this.duration-e)},e.prototype.pause=function(){this.state=1,this.fire("onPause")},e.prototype.getTimer=function(){return(new Date).getTime()},e}(),d=function(){function e(n){var i,c,d=this,f=n.node,p=f._id,h=n.easing||t.Easings.Linear,g=!!n.yoyo;i=void 0===n.duration?.3:0===n.duration?.001:n.duration,this.node=f,this._id=l++;var m=f.getLayer()||(f instanceof a.Konva.Stage?f.getLayers():null);for(c in m||r.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new o.Animation((function(){d.tween.onEnterFrame()}),m),this.tween=new u(c,(function(e){d._tweenFunc(e)}),h,0,1,1e3*i,g),this._addListeners(),e.attrs[p]||(e.attrs[p]={}),e.attrs[p][this._id]||(e.attrs[p][this._id]={}),e.tweens[p]||(e.tweens[p]={}),n)void 0===s[c]&&this._addAttr(c,n[c]);this.reset(),this.onFinish=n.onFinish,this.onReset=n.onReset}return e.prototype._addAttr=function(t,n){var o,i,a,s,l,u,d,f,p=this.node,h=p._id;if((a=e.tweens[h][t])&&delete e.attrs[h][a][t],o=p.getAttr(t),r.Util._isArray(n))if(i=[],l=Math.max(n.length,o.length),"points"===t&&n.length!==o.length&&(n.length>o.length?(d=o,o=r.Util._prepareArrayForTween(o,n,p.closed())):(u=n,n=r.Util._prepareArrayForTween(n,o,p.closed()))),0===t.indexOf("fill"))for(s=0;s0?1:-1},requestAnimFrame:function(e){d.push(e),1===d.length&&requestAnimationFrame((function(){var e=d;d=[],e.forEach((function(e){e()}))}))},createCanvasElement:function(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch(e){}return e},createImageElement:function(){return document.createElement("img")},_isInDocument:function(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_simplifyArray:function(e){var n,r,o=[],i=e.length,a=t.Util;for(n=0;n>16&255,g:t>>8&255,b:255&t}},getRandomColor:function(){for(var e=(16777215*Math.random()<<0).toString(16);e.length<6;)e="0"+e;return"#"+e},get:function(e,t){return void 0===e?t:e},getRGB:function(e){var t;return e in c?{r:(t=c[e])[0],g:t[1],b:t[2]}:"#"===e[0]?this._hexToRgb(e.substring(1)):"rgb("===e.substr(0,4)?(t=u.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA:function(e){return e=e||"black",t.Util._namedColorToRBA(e)||t.Util._hex3ColorToRGBA(e)||t.Util._hex6ColorToRGBA(e)||t.Util._rgbColorToRGBA(e)||t.Util._rgbaColorToRGBA(e)||t.Util._hslColorToRGBA(e)},_namedColorToRBA:function(e){var t=c[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA:function(e){if(0===e.indexOf("rgb(")){var t=(e=e.match(/rgb\(([^)]+)\)/)[1]).split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA:function(e){if(0===e.indexOf("rgba(")){var t=(e=e.match(/rgba\(([^)]+)\)/)[1]).split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex6ColorToRGBA:function(e){if("#"===e[0]&&7===e.length)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex3ColorToRGBA:function(e){if("#"===e[0]&&4===e.length)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA:function(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){var t=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),n=(t[0],t.slice(1)),r=Number(n[0])/360,o=Number(n[1])/100,i=Number(n[2])/100,a=void 0,s=void 0,l=void 0;if(0===o)return l=255*i,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};for(var c=2*i-(a=i<.5?i*(1+o):i+o-i*o),u=[0,0,0],d=0;d<3;d++)(s=r+1/3*-(d-1))<0&&s++,s>1&&s--,l=6*s<1?c+6*(a-c)*s:2*s<1?a:3*s<2?c+(a-c)*(2/3-s)*6:c,u[d]=255*l;return{r:Math.round(u[0]),g:Math.round(u[1]),b:Math.round(u[2]),a:1}}},haveIntersection:function(e,t){return!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.height1?(a=n,s=r,l=(n-o)*(n-o)+(r-i)*(r-i)):l=((a=e+u*(n-e))-o)*(a-o)+((s=t+u*(r-t))-i)*(s-i)}return[a,s,l]},_getProjectionToLine:function(e,n,r){var o=t.Util.cloneObject(e),i=Number.MAX_VALUE;return n.forEach((function(a,s){if(r||s!==n.length-1){var l=n[(s+1)%n.length],c=t.Util._getProjectionToSegment(a.x,a.y,l.x,l.y,e.x,e.y),u=c[0],d=c[1],f=c[2];fn.length){var s=n;n=e,e=s}for(o=0;o255?255:e<0?0:Math.round(e)},t.alphaComponent=function(e){return e>1?1:e<1e-4?1e-4:e},t.getNumberValidator=function(){if(r.Konva.isUnminified)return function(e,t){return o.Util._isNumber(e)||o.Util.warn(i(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}},t.getNumberOrAutoValidator=function(){if(r.Konva.isUnminified)return function(e,t){return o.Util._isNumber(e)||"auto"===e||o.Util.warn(i(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}},t.getStringValidator=function(){if(r.Konva.isUnminified)return function(e,t){return o.Util._isString(e)||o.Util.warn(i(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}},t.getFunctionValidator=function(){if(r.Konva.isUnminified)return function(e,t){return o.Util._isFunction(e)||o.Util.warn(i(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}},t.getNumberArrayValidator=function(){if(r.Konva.isUnminified)return function(e,t){return o.Util._isArray(e)?e.forEach((function(e){o.Util._isNumber(e)||o.Util.warn('"'+t+'" attribute has non numeric element '+e+". Make sure that all elements are numbers.")})):o.Util.warn(i(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.'),e}},t.getBooleanValidator=function(){if(r.Konva.isUnminified)return function(e,t){return!0===e||!1===e||o.Util.warn(i(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}},t.getComponentValidator=function(e){if(r.Konva.isUnminified)return function(t,n){return o.Util.isObject(t)||o.Util.warn(i(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}},3986:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4417),o=n(8588),i=n(7939),a=n(8783),s=n(8342),l=n(4415),c=n(3980),u=n(8985),d=n(210),f=n(7955),p=n(6745),h=n(8017),g=n(3442),m=n(4842);t.Konva=o.Util._assign(r.Konva,{Collection:o.Collection,Util:o.Util,Transform:o.Transform,Node:i.Node,ids:i.ids,names:i.names,Container:a.Container,Stage:s.Stage,stages:s.stages,Layer:l.Layer,FastLayer:c.FastLayer,Group:u.Group,DD:d.DD,Shape:f.Shape,shapes:f.shapes,Animation:p.Animation,Tween:h.Tween,Easings:h.Easings,Context:g.Context,Canvas:m.Canvas})},2076:function(e,t,n){"use strict";var r=n(3986),o=n(119),i=n(2064),a=n(7643),s=n(535),l=n(1298),c=n(6067),u=n(7149),d=n(7339),f=n(5244),p=n(1785),h=n(657),g=n(8986),m=n(1964),v=n(3787),y=n(2831),b=n(9516),w=n(9846),x=n(2527),E=n(6672),C=n(5309),k=n(1695),S=n(9621),_=n(2927),O=n(7194),T=n(3925),P=n(5751),N=n(6588),R=n(3565),M=n(5929),A=n(7233),j=n(8590),D=n(8280),L=n(3438),I=n(6703),F=n(1665),z=n(1863);t.S=r.Konva.Util._assign(r.Konva,{Arc:o.Arc,Arrow:i.Arrow,Circle:a.Circle,Ellipse:s.Ellipse,Image:l.Image,Label:c.Label,Tag:c.Tag,Line:u.Line,Path:d.Path,Rect:f.Rect,RegularPolygon:p.RegularPolygon,Ring:h.Ring,Sprite:g.Sprite,Star:m.Star,Text:v.Text,TextPath:y.TextPath,Transformer:b.Transformer,Wedge:w.Wedge,Filters:{Blur:x.Blur,Brighten:E.Brighten,Contrast:C.Contrast,Emboss:k.Emboss,Enhance:S.Enhance,Grayscale:_.Grayscale,HSL:O.HSL,HSV:T.HSV,Invert:P.Invert,Kaleidoscope:N.Kaleidoscope,Mask:R.Mask,Noise:M.Noise,Pixelate:A.Pixelate,Posterize:j.Posterize,RGB:D.RGB,RGBA:L.RGBA,Sepia:I.Sepia,Solarize:F.Solarize,Threshold:z.Threshold}})},2527:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1455),o=n(7939),i=n(3774);function a(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var s=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],l=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];t.Blur=function(e){var t=Math.round(this.blurRadius());t>0&&function(e,t){var n,r,o,i,c,u,d,f,p,h,g,m,v,y,b,w,x,E,C,k,S,_,O,T,P=e.data,N=e.width,R=e.height,M=t+t+1,A=N-1,j=R-1,D=t+1,L=D*(D+1)/2,I=new a,F=null,z=I,V=null,B=null,U=s[t],H=l[t];for(o=1;o>H,0!==O?(O=255/O,P[u]=(f*U>>H)*O,P[u+1]=(p*U>>H)*O,P[u+2]=(h*U>>H)*O):P[u]=P[u+1]=P[u+2]=0,f-=m,p-=v,h-=y,g-=b,m-=V.r,v-=V.g,y-=V.b,b-=V.a,i=d+((i=n+t+1)>H,O>0?(O=255/O,P[i]=(f*U>>H)*O,P[i+1]=(p*U>>H)*O,P[i+2]=(h*U>>H)*O):P[i]=P[i+1]=P[i+2]=0,f-=m,p-=v,h-=y,g-=b,m-=V.r,v-=V.g,y-=V.b,b-=V.a,i=n+((i=r+D)255?255:i,a=(a*=255)<0?0:a>255?255:a,s=(s*=255)<0?0:s>255?255:s,r[t]=i,r[t+1]=a,r[t+2]=s},r.Factory.addGetterSetter(o.Node,"contrast",0,i.getNumberValidator(),r.Factory.afterSetFilter)},1695:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1455),o=n(7939),i=n(8588),a=n(3774);t.Emboss=function(e){var t=10*this.embossStrength(),n=255*this.embossWhiteLevel(),r=this.embossDirection(),o=this.embossBlend(),a=0,s=0,l=e.data,c=e.width,u=e.height,d=4*c,f=u;switch(r){case"top-left":a=-1,s=-1;break;case"top":a=-1,s=0;break;case"top-right":a=-1,s=1;break;case"right":a=0,s=1;break;case"bottom-right":a=1,s=1;break;case"bottom":a=1,s=0;break;case"bottom-left":a=1,s=-1;break;case"left":a=0,s=-1;break;default:i.Util.error("Unknown emboss direction: "+r)}do{var p=(f-1)*d,h=a;f+h<1&&(h=0),f+h>u&&(h=0);var g=(f-1+h)*c*4,m=c;do{var v=p+4*(m-1),y=s;m+y<1&&(y=0),m+y>c&&(y=0);var b=g+4*(m-1+y),w=l[v]-l[b],x=l[v+1]-l[b+1],E=l[v+2]-l[b+2],C=w,k=C>0?C:-C;if((x>0?x:-x)>k&&(C=x),(E>0?E:-E)>k&&(C=E),C*=t,o){var S=l[v]+C,_=l[v+1]+C,O=l[v+2]+C;l[v]=S>255?255:S<0?0:S,l[v+1]=_>255?255:_<0?0:_,l[v+2]=O>255?255:O<0?0:O}else{var T=n-C;T<0?T=0:T>255&&(T=255),l[v]=l[v+1]=l[v+2]=T}}while(--m)}while(--f)},r.Factory.addGetterSetter(o.Node,"embossStrength",.5,a.getNumberValidator(),r.Factory.afterSetFilter),r.Factory.addGetterSetter(o.Node,"embossWhiteLevel",.5,a.getNumberValidator(),r.Factory.afterSetFilter),r.Factory.addGetterSetter(o.Node,"embossDirection","top-left",null,r.Factory.afterSetFilter),r.Factory.addGetterSetter(o.Node,"embossBlend",!1,null,r.Factory.afterSetFilter)},9621:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1455),o=n(7939),i=n(3774);function a(e,t,n,r,o){var i=n-t,a=o-r;return 0===i?r+a/2:0===a?r:a*((e-t)/i)+r}t.Enhance=function(e){var t,n,r,o,i=e.data,s=i.length,l=i[0],c=l,u=i[1],d=u,f=i[2],p=f,h=this.enhance();if(0!==h){for(o=0;oc&&(c=t),(n=i[o+1])d&&(d=n),(r=i[o+2])p&&(p=r);var g,m,v,y,b,w,x,E,C;for(c===l&&(c=255,l=0),d===u&&(d=255,u=0),p===f&&(p=255,f=0),h>0?(m=c+h*(255-c),v=l-h*(l-0),b=d+h*(255-d),w=u-h*(u-0),E=p+h*(255-p),C=f-h*(f-0)):(m=c+h*(c-(g=.5*(c+l))),v=l+h*(l-g),b=d+h*(d-(y=.5*(d+u))),w=u+h*(u-y),E=p+h*(p-(x=.5*(p+f))),C=f+h*(f-x)),o=0;ov?a:v;var y,b,w,x,E=u,C=c,k=360/C*Math.PI/180;for(b=0;bd&&(w=b,x=0,E=-1),n=0;nb?l:b;var w,x,E,C=f,k=d,S=n.polarRotation||0;for(o=0;o=0&&p=0&&h=0&&p=0&&h=1020?255:0}return a}(t=function(e,t,n){for(var r=[1,1,1,1,0,1,1,1,1],o=Math.round(Math.sqrt(r.length)),i=Math.floor(o/2),a=[],s=0;s=0&&p=0&&h=v))for(n=d;n=y||(i+=x[(r=4*(v*n+t))+0],a+=x[r+1],s+=x[r+2],l+=x[r+3],g+=1);for(i/=g,a/=g,s/=g,l/=g,t=c;t=v))for(n=d;n=y||(x[(r=4*(v*n+t))+0]=i,x[r+1]=a,x[r+2]=s,x[r+3]=l)}},r.Factory.addGetterSetter(i.Node,"pixelSize",8,a.getNumberValidator(),r.Factory.afterSetFilter)},8590:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1455),o=n(7939),i=n(3774);t.Posterize=function(e){var t,n=Math.round(254*this.levels())+1,r=e.data,o=r.length,i=255/n;for(t=0;t255?255:e<0?0:Math.round(e)})),r.Factory.addGetterSetter(o.Node,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),r.Factory.addGetterSetter(o.Node,"blue",0,i.RGBComponent,r.Factory.afterSetFilter)},3438:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1455),o=n(7939),i=n(3774);t.RGBA=function(e){var t,n,r=e.data,o=r.length,i=this.red(),a=this.green(),s=this.blue(),l=this.alpha();for(t=0;t255?255:e<0?0:Math.round(e)})),r.Factory.addGetterSetter(o.Node,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),r.Factory.addGetterSetter(o.Node,"blue",0,i.RGBComponent,r.Factory.afterSetFilter),r.Factory.addGetterSetter(o.Node,"alpha",1,(function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e}))},6703:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sepia=function(e){var t,n,r,o,i=e.data,a=i.length;for(t=0;t127&&(l=255-l),c>127&&(c=255-c),u>127&&(u=255-u),t[s]=l,t[s+1]=c,t[s+2]=u}while(--a)}while(--o)}},1863:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1455),o=n(7939),i=n(3774);t.Threshold=function(e){var t,n=255*this.threshold(),r=e.data,o=r.length;for(t=0;t4;i&&(o=this.getTensionPoints());var a,s,l=r.length;i?(a=r[l-2]-(o[o.length-2]+o[o.length-4])/2,s=r[l-1]-(o[o.length-1]+o[o.length-3])/2):(a=r[l-2]-r[l-4],s=r[l-1]-r[l-3]);var c=(Math.atan2(s,a)+n)%n,u=this.pointerLength(),d=this.pointerWidth();t.save(),t.beginPath(),t.translate(r[l-2],r[l-1]),t.rotate(c),t.moveTo(0,0),t.lineTo(-u,d/2),t.lineTo(-u,-d/2),t.closePath(),t.restore(),this.pointerAtBeginning()&&(t.save(),t.translate(r[0],r[1]),i?(a=(o[0]+o[2])/2-r[0],s=(o[1]+o[3])/2-r[1]):(a=r[2]-r[0],s=r[3]-r[1]),t.rotate((Math.atan2(-s,-a)+n)%n),t.moveTo(0,0),t.lineTo(-u,d/2),t.lineTo(-u,-d/2),t.closePath(),t.restore());var f=this.dashEnabled();f&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),f&&(this.attrs.dashEnabled=!0)},t.prototype.getSelfRect=function(){var t=e.prototype.getSelfRect.call(this),n=this.pointerWidth()/2;return{x:t.x-n,y:t.y-n,width:t.width+2*n,height:t.height+2*n}},t}(s.Line);t.Arrow=u,u.prototype.className="Arrow",c._registerNode(u),a.Factory.addGetterSetter(u,"pointerLength",10,l.getNumberValidator()),a.Factory.addGetterSetter(u,"pointerWidth",10,l.getNumberValidator()),a.Factory.addGetterSetter(u,"pointerAtBeginning",!1),i.Collection.mapMethods(u)},7643:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(8588),a=n(1455),s=n(7955),l=n(3774),c=n(4417),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype._sceneFunc=function(e){e.beginPath(),e.arc(0,0,this.radius(),0,2*Math.PI,!1),e.closePath(),e.fillStrokeShape(this)},t.prototype.getWidth=function(){return 2*this.radius()},t.prototype.getHeight=function(){return 2*this.radius()},t.prototype.setWidth=function(e){this.radius()!==e/2&&this.radius(e/2)},t.prototype.setHeight=function(e){this.radius()!==e/2&&this.radius(e/2)},t}(s.Shape);t.Circle=u,u.prototype._centroid=!0,u.prototype.className="Circle",u.prototype._attrsAffectingSize=["radius"],c._registerNode(u),a.Factory.addGetterSetter(u,"radius",0,l.getNumberValidator()),i.Collection.mapMethods(u)},535:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(8588),a=n(1455),s=n(7955),l=n(3774),c=n(4417),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype._sceneFunc=function(e){var t=this.radiusX(),n=this.radiusY();e.beginPath(),e.save(),t!==n&&e.scale(1,n/t),e.arc(0,0,t,0,2*Math.PI,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)},t.prototype.getWidth=function(){return 2*this.radiusX()},t.prototype.getHeight=function(){return 2*this.radiusY()},t.prototype.setWidth=function(e){this.radiusX(e/2)},t.prototype.setHeight=function(e){this.radiusY(e/2)},t}(s.Shape);t.Ellipse=u,u.prototype.className="Ellipse",u.prototype._centroid=!0,u.prototype._attrsAffectingSize=["radiusX","radiusY"],c._registerNode(u),a.Factory.addComponentsGetterSetter(u,"radius",["x","y"]),a.Factory.addGetterSetter(u,"radiusX",0,l.getNumberValidator()),a.Factory.addGetterSetter(u,"radiusY",0,l.getNumberValidator()),i.Collection.mapMethods(u)},1298:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(8588),a=n(1455),s=n(7955),l=n(3774),c=n(4417),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype._useBufferCanvas=function(){return!(!this.hasShadow()&&1===this.getAbsoluteOpacity()||!this.hasStroke()||!this.getStage())},t.prototype._sceneFunc=function(e){var t,n,r,o=this.width(),i=this.height(),a=this.image();a&&(t=this.cropWidth(),n=this.cropHeight(),r=t&&n?[a,this.cropX(),this.cropY(),t,n,0,0,o,i]:[a,0,0,o,i]),(this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,o,i),e.closePath(),e.fillStrokeShape(this)),a&&e.drawImage.apply(e,r)},t.prototype._hitFunc=function(e){var t=this.width(),n=this.height();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)},t.prototype.getWidth=function(){var e,t=this.image();return null!=(e=this.attrs.width)?e:t?t.width:0},t.prototype.getHeight=function(){var e,t=this.image();return null!=(e=this.attrs.height)?e:t?t.height:0},t.fromURL=function(e,n){var r=i.Util.createImageElement();r.onload=function(){var e=new t({image:r});n(e)},r.crossOrigin="Anonymous",r.src=e},t}(s.Shape);t.Image=u,u.prototype.className="Image",c._registerNode(u),a.Factory.addGetterSetter(u,"image"),a.Factory.addComponentsGetterSetter(u,"crop",["x","y","width","height"]),a.Factory.addGetterSetter(u,"cropX",0,l.getNumberValidator()),a.Factory.addGetterSetter(u,"cropY",0,l.getNumberValidator()),a.Factory.addGetterSetter(u,"cropWidth",0,l.getNumberValidator()),a.Factory.addGetterSetter(u,"cropHeight",0,l.getNumberValidator()),i.Collection.mapMethods(u)},6067:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(8588),a=n(1455),s=n(7955),l=n(8985),c=n(3774),u=n(4417),d=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width"],f="up",p="right",h="down",g="left",m=d.length,v=function(e){function t(t){var n=e.call(this,t)||this;return n.on("add.konva",(function(e){this._addListeners(e.child),this._sync()})),n}return o(t,e),t.prototype.getText=function(){return this.find("Text")[0]},t.prototype.getTag=function(){return this.find("Tag")[0]},t.prototype._addListeners=function(e){var t,n=this,r=function(){n._sync()};for(t=0;t4){for(n=(t=this.getTensionPoints()).length,r=s?0:4,s||e.quadraticCurveTo(t[0],t[1],t[2],t[3]);rc?l:c,g=l>c?1:l/c,m=l>c?c/l:1;e.translate(a,s),e.rotate(f),e.scale(g,m),e.arc(0,0,h,u,u+d,1-p),e.scale(1/g,1/m),e.rotate(-f),e.translate(-a,-s);break;case"z":n=!0,e.closePath()}}n||this.hasFill()?e.fillStrokeShape(this):e.strokeShape(this)},t.prototype.getSelfRect=function(){var e=[];this.dataArray.forEach((function(n){if("A"===n.command){var r=n.points[4],o=n.points[5],i=n.points[4]+o,a=Math.PI/180;if(Math.abs(r-i)i;s-=a){var l=t.getPointOnEllipticalArc(n.points[0],n.points[1],n.points[2],n.points[3],s,0);e.push(l.x,l.y)}else for(s=r+a;sthis.dataArray[r].pathLength;)e-=this.dataArray[r].pathLength,++r;if(r===o)return{x:(n=this.dataArray[r-1].points.slice(-2))[0],y:n[1]};if(e<.01)return{x:(n=this.dataArray[r].points.slice(0,2))[0],y:n[1]};var i=this.dataArray[r],a=i.points;switch(i.command){case"L":return t.getPointOnLine(e,i.start.x,i.start.y,a[0],a[1]);case"C":return t.getPointOnCubicBezier(e/i.pathLength,i.start.x,i.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return t.getPointOnQuadraticBezier(e/i.pathLength,i.start.x,i.start.y,a[0],a[1],a[2],a[3]);case"A":var s=a[0],l=a[1],c=a[2],u=a[3],d=a[4],f=a[5],p=a[6];return d+=f*e/i.pathLength,t.getPointOnEllipticalArc(s,l,c,u,d,p)}return null},t.getLineLength=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},t.getPointOnLine=function(e,t,n,r,o,i,a){void 0===i&&(i=t),void 0===a&&(a=n);var s=(o-n)/(r-t+1e-8),l=Math.sqrt(e*e/(1+s*s));r0&&!isNaN(p[0]);){var v,y,b,w,x,E,C,k,S,_,O=null,T=[],P=l,N=c;switch(f){case"l":l+=p.shift(),c+=p.shift(),O="L",T.push(l,c);break;case"L":l=p.shift(),c=p.shift(),T.push(l,c);break;case"m":var R=p.shift(),M=p.shift();if(l+=R,c+=M,O="M",a.length>2&&"z"===a[a.length-1].command)for(var A=a.length-2;A>=0;A--)if("M"===a[A].command){l=a[A].points[0]+R,c=a[A].points[1]+M;break}T.push(l,c),f="l";break;case"M":l=p.shift(),c=p.shift(),O="M",T.push(l,c),f="L";break;case"h":l+=p.shift(),O="L",T.push(l,c);break;case"H":l=p.shift(),O="L",T.push(l,c);break;case"v":c+=p.shift(),O="L",T.push(l,c);break;case"V":c=p.shift(),O="L",T.push(l,c);break;case"C":T.push(p.shift(),p.shift(),p.shift(),p.shift()),l=p.shift(),c=p.shift(),T.push(l,c);break;case"c":T.push(l+p.shift(),c+p.shift(),l+p.shift(),c+p.shift()),l+=p.shift(),c+=p.shift(),O="C",T.push(l,c);break;case"S":y=l,b=c,"C"===(v=a[a.length-1]).command&&(y=l+(l-v.points[2]),b=c+(c-v.points[3])),T.push(y,b,p.shift(),p.shift()),l=p.shift(),c=p.shift(),O="C",T.push(l,c);break;case"s":y=l,b=c,"C"===(v=a[a.length-1]).command&&(y=l+(l-v.points[2]),b=c+(c-v.points[3])),T.push(y,b,l+p.shift(),c+p.shift()),l+=p.shift(),c+=p.shift(),O="C",T.push(l,c);break;case"Q":T.push(p.shift(),p.shift()),l=p.shift(),c=p.shift(),T.push(l,c);break;case"q":T.push(l+p.shift(),c+p.shift()),l+=p.shift(),c+=p.shift(),O="Q",T.push(l,c);break;case"T":y=l,b=c,"Q"===(v=a[a.length-1]).command&&(y=l+(l-v.points[0]),b=c+(c-v.points[1])),l=p.shift(),c=p.shift(),O="Q",T.push(y,b,l,c);break;case"t":y=l,b=c,"Q"===(v=a[a.length-1]).command&&(y=l+(l-v.points[0]),b=c+(c-v.points[1])),l+=p.shift(),c+=p.shift(),O="Q",T.push(y,b,l,c);break;case"A":w=p.shift(),x=p.shift(),E=p.shift(),C=p.shift(),k=p.shift(),S=l,_=c,l=p.shift(),c=p.shift(),O="A",T=this.convertEndpointToCenterParameterization(S,_,l,c,C,k,w,x,E);break;case"a":w=p.shift(),x=p.shift(),E=p.shift(),C=p.shift(),k=p.shift(),S=l,_=c,l+=p.shift(),c+=p.shift(),O="A",T=this.convertEndpointToCenterParameterization(S,_,l,c,C,k,w,x,E)}a.push({command:O||f,points:T,start:{x:P,y:N},pathLength:this.calcLength(P,N,O||f,T)})}"z"!==f&&"Z"!==f||a.push({command:"z",points:[],start:void 0,pathLength:0})}return a},t.calcLength=function(e,n,r,o){var i,a,s,l,c=t;switch(r){case"L":return c.getLineLength(e,n,o[0],o[1]);case"C":for(i=0,a=c.getPointOnCubicBezier(0,e,n,o[0],o[1],o[2],o[3],o[4],o[5]),l=.01;l<=1;l+=.01)s=c.getPointOnCubicBezier(l,e,n,o[0],o[1],o[2],o[3],o[4],o[5]),i+=c.getLineLength(a.x,a.y,s.x,s.y),a=s;return i;case"Q":for(i=0,a=c.getPointOnQuadraticBezier(0,e,n,o[0],o[1],o[2],o[3]),l=.01;l<=1;l+=.01)s=c.getPointOnQuadraticBezier(l,e,n,o[0],o[1],o[2],o[3]),i+=c.getLineLength(a.x,a.y,s.x,s.y),a=s;return i;case"A":i=0;var u=o[4],d=o[5],f=o[4]+d,p=Math.PI/180;if(Math.abs(u-f)f;l-=p)s=c.getPointOnEllipticalArc(o[0],o[1],o[2],o[3],l,0),i+=c.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(l=u+p;l1&&(a*=Math.sqrt(f),s*=Math.sqrt(f));var p=Math.sqrt((a*a*(s*s)-a*a*(d*d)-s*s*(u*u))/(a*a*(d*d)+s*s*(u*u)));o===i&&(p*=-1),isNaN(p)&&(p=0);var h=p*a*d/s,g=p*-s*u/a,m=(e+n)/2+Math.cos(c)*h-Math.sin(c)*g,v=(t+r)/2+Math.sin(c)*h+Math.cos(c)*g,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(k=0),0===i&&k>0&&(k-=2*Math.PI),1===i&&k<0&&(k+=2*Math.PI),[m,v,a,s,x,k,c,i]},t}(s.Shape);t.Path=c,c.prototype.className="Path",c.prototype._attrsAffectingSize=["data"],l._registerNode(c),a.Factory.addGetterSetter(c,"data"),i.Collection.mapMethods(c)},5244:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(8588),a=n(1455),s=n(7955),l=n(4417),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype._sceneFunc=function(e){var t=this.cornerRadius(),n=this.width(),r=this.height();if(e.beginPath(),t){var o=0,i=0,a=0,s=0;"number"==typeof t?o=i=a=s=Math.min(t,n/2,r/2):(o=Math.min(t[0],n/2,r/2),i=Math.min(t[1],n/2,r/2),s=Math.min(t[2],n/2,r/2),a=Math.min(t[3],n/2,r/2)),e.moveTo(o,0),e.lineTo(n-i,0),e.arc(n-i,i,i,3*Math.PI/2,0,!1),e.lineTo(n,r-s),e.arc(n-s,r-s,s,0,Math.PI/2,!1),e.lineTo(a,r),e.arc(a,r-a,a,Math.PI/2,Math.PI,!1),e.lineTo(0,o),e.arc(o,o,o,Math.PI,3*Math.PI/2,!1)}else e.rect(0,0,n,r);e.closePath(),e.fillStrokeShape(this)},t}(s.Shape);t.Rect=c,c.prototype.className="Rect",l._registerNode(c),a.Factory.addGetterSetter(c,"cornerRadius",0),i.Collection.mapMethods(c)},1785:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(8588),a=n(1455),s=n(7955),l=n(3774),c=n(4417),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype._sceneFunc=function(e){var t,n,r,o=this.sides(),i=this.radius();for(e.beginPath(),e.moveTo(0,0-i),t=1;t1&&(b+=o)}},t.prototype._hitFunc=function(e){var t=this.getWidth(),n=this.getHeight();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)},t.prototype.setText=function(e){var t=a.Util._isString(e)?e:null==e?"":e+"";return this._setAttr("text",t),this},t.prototype.getWidth=function(){return this.attrs.width===f||void 0===this.attrs.width?this.getTextWidth()+2*this.padding():this.attrs.width},t.prototype.getHeight=function(){return this.attrs.height===f||void 0===this.attrs.height?this.fontSize()*this.textArr.length*this.lineHeight()+2*this.padding():this.attrs.height},t.prototype.getTextWidth=function(){return this.textWidth},t.prototype.getTextHeight=function(){return a.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight},t.prototype.measureSize=function(e){var t,n=w(),r=this.fontSize();return n.save(),n.font=this._getContextFont(),t=n.measureText(e),n.restore(),{width:t.width,height:r}},t.prototype._getContextFont=function(){return c.Konva.UA.isIE?this.fontStyle()+v+this.fontSize()+"px "+this.fontFamily():this.fontStyle()+v+this.fontVariant()+v+this.fontSize()+"px "+this.fontFamily()},t.prototype._addTextLine=function(e){this.align()===p&&(e=e.trim());var t=this._getTextWidth(e);return this.textArr.push({text:e,width:t})},t.prototype._getTextWidth=function(e){var t=this.letterSpacing(),n=e.length;return w().measureText(e).width+(n?t*(n-1):0)},t.prototype._setTextData=function(){var e=this.text().split("\n"),t=+this.fontSize(),n=0,r=this.lineHeight()*t,o=this.attrs.width,i=this.attrs.height,a=o!==f&&void 0!==o,s=i!==f&&void 0!==i,l=this.padding(),c=o-2*l,u=i-2*l,d=0,p=this.wrap(),h="none"!==p,g="char"!==p&&h,m=this.ellipsis()&&!h;this.textArr=[],w().font=this._getContextFont();for(var y=m?this._getTextWidth("…"):0,b=0,x=e.length;bc)for(;E.length>0;){for(var k=0,S=E.length,_="",O=0;k>>1,P=E.slice(0,T+1),N=this._getTextWidth(P)+y;N<=c?(k=T+1,_=P+(m?"…":""),O=N):S=T}if(!_)break;if(g){var R,M=E[_.length];(R=(M===v||"-"===M)&&O<=c?_.length:Math.max(_.lastIndexOf(v),_.lastIndexOf("-"))+1)>0&&(k=R,_=_.slice(0,k),O=this._getTextWidth(_))}if(_=_.trimRight(),this._addTextLine(_),n=Math.max(n,O),d+=r,!h||s&&d+r>u)break;if((E=(E=E.slice(k)).trimLeft()).length>0&&(C=this._getTextWidth(E))<=c){this._addTextLine(E),d+=r,n=Math.max(n,C);break}}else this._addTextLine(E),d+=r,n=Math.max(n,C);if(s&&d+r>u)break}this.textHeight=t,this.textWidth=n},t.prototype.getStrokeScaleEnabled=function(){return!0},t}(l.Shape);t.Text=x,x.prototype._fillFunc=function(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)},x.prototype._strokeFunc=function(e){e.strokeText(this._partialText,this._partialTextX,this._partialTextY)},x.prototype.className="Text",x.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight"],d._registerNode(x),s.Factory.overWriteSetter(x,"width",u.getNumberOrAutoValidator()),s.Factory.overWriteSetter(x,"height",u.getNumberOrAutoValidator()),s.Factory.addGetterSetter(x,"fontFamily","Arial"),s.Factory.addGetterSetter(x,"fontSize",12,u.getNumberValidator()),s.Factory.addGetterSetter(x,"fontStyle",m),s.Factory.addGetterSetter(x,"fontVariant",m),s.Factory.addGetterSetter(x,"padding",0,u.getNumberValidator()),s.Factory.addGetterSetter(x,"align",h),s.Factory.addGetterSetter(x,"verticalAlign","top"),s.Factory.addGetterSetter(x,"lineHeight",1,u.getNumberValidator()),s.Factory.addGetterSetter(x,"wrap","word"),s.Factory.addGetterSetter(x,"ellipsis",!1),s.Factory.addGetterSetter(x,"letterSpacing",0,u.getNumberValidator()),s.Factory.addGetterSetter(x,"text","",u.getStringValidator()),s.Factory.addGetterSetter(x,"textDecoration",""),a.Collection.mapMethods(x)},2831:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(8588),a=n(1455),s=n(7955),l=n(7339),c=n(3787),u=n(3774),d=n(4417),f="normal";function p(e){e.fillText(this.partialText,0,0)}function h(e){e.strokeText(this.partialText,0,0)}var g=function(e){function t(t){var n=e.call(this,t)||this;return n.dummyCanvas=i.Util.createCanvasElement(),n.dataArray=[],n.dataArray=l.Path.parsePathData(n.attrs.data),n.on("dataChange.konva",(function(){this.dataArray=l.Path.parsePathData(this.attrs.data),this._setTextData()})),n.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva",n._setTextData),t&&t.getKerning&&(i.Util.warn('getKerning TextPath API is deprecated. Please use "kerningFunc" instead.'),n.kerningFunc(t.getKerning)),n._setTextData(),n}return o(t,e),t.prototype._sceneFunc=function(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();var t=this.textDecoration(),n=this.fill(),r=this.fontSize(),o=this.glyphInfo;"underline"===t&&e.beginPath();for(var i=0;i=1){var n=t[0].p0;e.moveTo(n.x,n.y)}for(var r=0;r0&&(a+=e.dataArray[s].pathLength);var c=0;"center"===r&&(c=Math.max(0,a/2-i/2)),"right"===r&&(c=Math.max(0,a-i));for(var u,d,f,p=this.text().split(""),h=this.text().split(" ").length-1,g=-1,m=0,v=function(){m=0;for(var t=e.dataArray,n=g+1;n0)return g=n,t[n];"M"===t[n].command&&(u={x:t[n].points[0],y:t[n].points[1]})}return{}},y=function(t){var o=e._getTextSize(t).width+n;" "===t&&"justify"===r&&(o+=(a-i)/h);var s=0,c=0;for(d=void 0;Math.abs(o-s)/o>.01&&c<25;){c++;for(var p=s;void 0===f;)(f=v())&&p+f.pathLengtho?d=l.Path.getPointOnLine(o,u.x,u.y,f.points[0],f.points[1],u.x,u.y):f=void 0;break;case"A":var y=f.points[4],b=f.points[5],w=f.points[4]+b;0===m?m=y+1e-8:o>s?m+=Math.PI/180*b/Math.abs(b):m-=Math.PI/360*b/Math.abs(b),(b<0&&m=0&&m>w)&&(m=w,g=!0),d=l.Path.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],m,f.points[6]);break;case"C":0===m?m=o>f.pathLength?1e-8:o/f.pathLength:o>s?m+=(o-s)/f.pathLength:m-=(s-o)/f.pathLength,m>1&&(m=1,g=!0),d=l.Path.getPointOnCubicBezier(m,f.start.x,f.start.y,f.points[0],f.points[1],f.points[2],f.points[3],f.points[4],f.points[5]);break;case"Q":0===m?m=o/f.pathLength:o>s?m+=(o-s)/f.pathLength:m-=(s-o)/f.pathLength,m>1&&(m=1,g=!0),d=l.Path.getPointOnQuadraticBezier(m,f.start.x,f.start.y,f.points[0],f.points[1],f.points[2],f.points[3])}void 0!==d&&(s=l.Path.getLineLength(u.x,u.y,d.x,d.y)),g&&(g=!1,f=void 0)}},b=c/(e._getTextSize("C").width+n)-1,w=0;wthis.findOne(".bottom-right").x()?-1:1,u=this.findOne(".top-left").y()>this.findOne(".bottom-right").y()?-1:1;t=r*this.cos*c,n=r*this.sin*u,this.findOne(".top-left").x(this.findOne(".bottom-right").x()-t-2*l),this.findOne(".top-left").y(this.findOne(".bottom-right").y()-n-2*l)}}else if("top-center"===this._movingAnchorName)this.findOne(".top-left").y(o.y());else if("top-right"===this._movingAnchorName){if(s){r=Math.sqrt(Math.pow(o.x()-this.findOne(".bottom-left").x()-2*l,2)+Math.pow(this.findOne(".bottom-left").y()-o.y()-2*l,2));c=this.findOne(".top-right").x()this.findOne(".bottom-left").y()?-1:1;t=r*this.cos*c,n=r*this.sin*u,this.findOne(".top-right").x(t+l),this.findOne(".top-right").y(this.findOne(".bottom-left").y()-n-2*l)}var f=o.position();this.findOne(".top-left").y(f.y),this.findOne(".bottom-right").x(f.x)}else if("middle-left"===this._movingAnchorName)this.findOne(".top-left").x(o.x());else if("middle-right"===this._movingAnchorName)this.findOne(".bottom-right").x(o.x());else if("bottom-left"===this._movingAnchorName){if(s){r=Math.sqrt(Math.pow(this.findOne(".top-right").x()-o.x()-2*l,2)+Math.pow(o.y()-this.findOne(".top-right").y()-2*l,2));c=this.findOne(".top-right").x()this.findOne(".bottom-right").x()?-1:1,u=this.findOne(".top-left").y()>this.findOne(".bottom-right").y()?-1:1;t=r*this.cos*c,n=r*this.sin*u,this.findOne(".bottom-right").x(t+l),this.findOne(".bottom-right").y(n+l)}}else if("rotater"===this._movingAnchorName){var p=this._getNodeRect();t=o.x()-p.width/2,n=-o.y()+p.height/2;var h=Math.atan2(-n,t)+Math.PI/2;p.height<0&&(h-=Math.PI);for(var g=d.Konva.getAngle(this.rotation()),m=i.Util._radToDeg(g)+i.Util._radToDeg(h),v=d.Konva.getAngle(this.getNode().rotation()),y=i.Util._degToRad(m),b=this.rotationSnaps(),w=d.Konva.getAngle(this.rotationSnapTolerance()),x=0;x=0}),this.findOne(".top-center").setAttrs({x:a/2,y:-u,scale:o,visible:c&&l.indexOf("top-center")>=0}),this.findOne(".top-right").setAttrs({x:a+u,y:-u,scale:o,visible:c&&l.indexOf("top-right")>=0}),this.findOne(".middle-left").setAttrs({x:-u,y:s/2,scale:o,visible:c&&l.indexOf("middle-left")>=0}),this.findOne(".middle-right").setAttrs({x:a+u,y:s/2,scale:o,visible:c&&l.indexOf("middle-right")>=0}),this.findOne(".bottom-left").setAttrs({x:-u,y:s+u,scale:o,visible:c&&l.indexOf("bottom-left")>=0}),this.findOne(".bottom-center").setAttrs({x:a/2,y:s+u,scale:o,visible:c&&l.indexOf("bottom-center")>=0}),this.findOne(".bottom-right").setAttrs({x:a+u,y:s+u,scale:o,visible:c&&l.indexOf("bottom-right")>=0});var f=-this.rotateAnchorOffset()*Math.abs(o.y);this.findOne(".rotater").setAttrs({x:a/2,y:f*i.Util._sign(s)-u,scale:o,visible:this.rotateEnabled()}),this.findOne(".back").setAttrs({width:a*r.x,height:s*r.y,scale:o,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash()})},t.prototype.isTransforming=function(){return this._transforming},t.prototype.stopTransform=function(){if(this._transforming){this._removeEvents();var e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}},t.prototype.destroy=function(){return this.getStage()&&this._cursorChange&&(this.getStage().content.style.cursor=""),u.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this},t.prototype.toObject=function(){return s.Node.prototype.toObject.call(this)},t}(u.Group);t.Transformer=x,x.prototype.className="Transformer",p._registerNode(x),a.Factory.addGetterSetter(x,"enabledAnchors",w,(function(e){return e instanceof Array||i.Util.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach((function(e){-1===w.indexOf(e)&&i.Util.warn("Unknown anchor name: "+e+". Available names are: "+w.join(", "))})),e||[]})),a.Factory.addGetterSetter(x,"resizeEnabled",!0),a.Factory.addGetterSetter(x,"anchorSize",10,f.getNumberValidator()),a.Factory.addGetterSetter(x,"rotateEnabled",!0),a.Factory.addGetterSetter(x,"rotationSnaps",[]),a.Factory.addGetterSetter(x,"rotateAnchorOffset",50,f.getNumberValidator()),a.Factory.addGetterSetter(x,"rotationSnapTolerance",5,f.getNumberValidator()),a.Factory.addGetterSetter(x,"borderEnabled",!0),a.Factory.addGetterSetter(x,"anchorStroke","rgb(0, 161, 255)"),a.Factory.addGetterSetter(x,"anchorStrokeWidth",1,f.getNumberValidator()),a.Factory.addGetterSetter(x,"anchorFill","white"),a.Factory.addGetterSetter(x,"anchorCornerRadius",0,f.getNumberValidator()),a.Factory.addGetterSetter(x,"borderStroke","rgb(0, 161, 255)"),a.Factory.addGetterSetter(x,"borderStrokeWidth",1,f.getNumberValidator()),a.Factory.addGetterSetter(x,"borderDash"),a.Factory.addGetterSetter(x,"keepRatio",!0),a.Factory.addGetterSetter(x,"centeredScaling",!1),a.Factory.addGetterSetter(x,"ignoreStroke",!1),a.Factory.addGetterSetter(x,"padding",0,f.getNumberValidator()),a.Factory.addGetterSetter(x,"node"),a.Factory.addGetterSetter(x,"boundBoxFunc"),a.Factory.backCompat(x,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"}),i.Collection.mapMethods(x)},9846:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(8588),a=n(1455),s=n(7955),l=n(4417),c=n(3774),u=n(4417),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype._sceneFunc=function(e){e.beginPath(),e.arc(0,0,this.radius(),0,l.Konva.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)},t.prototype.getWidth=function(){return 2*this.radius()},t.prototype.getHeight=function(){return 2*this.radius()},t.prototype.setWidth=function(e){this.radius(e/2)},t.prototype.setHeight=function(e){this.radius(e/2)},t}(s.Shape);t.Wedge=d,d.prototype.className="Wedge",d.prototype._centroid=!0,d.prototype._attrsAffectingSize=["radius"],u._registerNode(d),a.Factory.addGetterSetter(d,"radius",0,c.getNumberValidator()),a.Factory.addGetterSetter(d,"angle",0,c.getNumberValidator()),a.Factory.addGetterSetter(d,"clockwise",!1),a.Factory.backCompat(d,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"}),i.Collection.mapMethods(d)},9208:function(e,t,n){var r="__lodash_hash_undefined__",o="[object Function]",i="[object GeneratorFunction]",a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/,l=/^\./,c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,u=/\\(\\)?/g,d=/^\[object .+?Constructor\]$/,f="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,p="object"==typeof self&&self&&self.Object===Object&&self,h=f||p||Function("return this")();var g,m=Array.prototype,v=Function.prototype,y=Object.prototype,b=h["__core-js_shared__"],w=(g=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||""))?"Symbol(src)_1."+g:"",x=v.toString,E=y.hasOwnProperty,C=y.toString,k=RegExp("^"+x.call(E).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),S=h.Symbol,_=m.splice,O=F(h,"Map"),T=F(Object,"create"),P=S?S.prototype:void 0,N=P?P.toString:void 0;function R(e){var t=-1,n=e?e.length:0;for(this.clear();++t-1},M.prototype.set=function(e,t){var n=this.__data__,r=j(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},A.prototype.clear=function(){this.__data__={hash:new R,map:new(O||M),string:new R}},A.prototype.delete=function(e){return I(this,e).delete(e)},A.prototype.get=function(e){return I(this,e).get(e)},A.prototype.has=function(e){return I(this,e).has(e)},A.prototype.set=function(e,t){return I(this,e).set(e,t),this};var z=B((function(e){e=function(e){return null==e?"":function(e){if("string"==typeof e)return e;if(K(e))return N?N.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(e);var t=[];return l.test(e)&&t.push(""),e.replace(c,(function(e,n,r,o){t.push(r?o.replace(u,"$1"):n||e)})),t}));function V(e){if("string"==typeof e||K(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function B(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(B.Cache||A),n}function U(e,t){return e===t||e!=e&&t!=t}B.Cache=A;var H=Array.isArray;function W(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function K(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==C.call(e)}e.exports=function(e,t,n){var r=null==e?void 0:D(e,t);return void 0===r?n:r}},2336:function(e,t,n){e=n.nmd(e);var r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",a="[object Array]",s="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",d="[object Map]",f="[object Number]",p="[object Object]",h="[object Promise]",g="[object RegExp]",m="[object Set]",v="[object String]",y="[object Symbol]",b="[object WeakMap]",w="[object ArrayBuffer]",x="[object DataView]",E=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,k={};k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k[i]=k[a]=k[w]=k[s]=k[x]=k[l]=k[c]=k[u]=k[d]=k[f]=k[p]=k[g]=k[m]=k[v]=k[b]=!1;var S="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,_="object"==typeof self&&self&&self.Object===Object&&self,O=S||_||Function("return this")(),T=t&&!t.nodeType&&t,P=T&&e&&!e.nodeType&&e,N=P&&P.exports===T&&S.process,R=function(){try{return N&&N.binding("util")}catch(e){}}(),M=R&&R.isTypedArray;function A(e,t){for(var n=-1,r=e?e.length:0;++ns))return!1;var c=i.get(e);if(c&&i.get(t))return c==t;var u=-1,d=!0,f=1&o?new me:void 0;for(i.set(e,t),i.set(t,e);++u-1},he.prototype.set=function(e,t){var n=this.__data__,r=be(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},ge.prototype.clear=function(){this.__data__={hash:new pe,map:new(te||he),string:new pe}},ge.prototype.delete=function(e){return ke(this,e).delete(e)},ge.prototype.get=function(e){return ke(this,e).get(e)},ge.prototype.has=function(e){return ke(this,e).has(e)},ge.prototype.set=function(e,t){return ke(this,e).set(e,t),this},me.prototype.add=me.prototype.push=function(e){return this.__data__.set(e,r),this},me.prototype.has=function(e){return this.__data__.has(e)},ve.prototype.clear=function(){this.__data__=new he},ve.prototype.delete=function(e){return this.__data__.delete(e)},ve.prototype.get=function(e){return this.__data__.get(e)},ve.prototype.has=function(e){return this.__data__.has(e)},ve.prototype.set=function(e,t){var n=this.__data__;if(n instanceof he){var r=n.__data__;if(!te||r.length<199)return r.push([e,t]),this;n=this.__data__=new ge(r)}return n.set(e,t),this};var _e=function(e){return G.call(e)};function Oe(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||C.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=o}function De(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Le(e){return!!e&&"object"==typeof e}var Ie=M?function(e){return function(t){return e(t)}}(M):function(e){return Le(e)&&je(e.length)&&!!k[G.call(e)]};function Fe(e){return Me(e)?ye(e):Ee(e)}e.exports=function(e,t){return e===t||function(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=Object(e);o--;){var s=n[o];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o=t||n<0||f&&e-u>=a}function E(){var e=g();if(x(e))return C(e);l=setTimeout(E,function(e){var n=t-(e-c);return f?h(n,a-(e-u)):n}(e))}function C(e){return l=void 0,m&&o?b(e):(o=i=void 0,s)}function k(){var e=g(),n=x(e);if(o=arguments,i=this,c=e,n){if(void 0===l)return w(c);if(f)return l=setTimeout(E,t),b(c)}return void 0===l&&(l=setTimeout(E,t)),s}return t=y(t)||0,v(n)&&(d=!!n.leading,a=(f="maxWait"in n)?p(y(n.maxWait)||0,t):a,m="trailing"in n?!!n.trailing:m),k.cancel=function(){void 0!==l&&clearTimeout(l),u=0,o=c=i=l=void 0},k.flush=function(){return void 0===l?s:C(g())},k}function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==f.call(e)}(e))return NaN;if(v(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=v(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=a.test(e);return n||s.test(e)?l(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new TypeError(r);return v(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),m(e,t,{leading:o,maxWait:t,trailing:i})}},8552:function(e,t,n){var r=n(852)(n(5639),"DataView");e.exports=r},1989:function(e,t,n){var r=n(1789),o=n(401),i=n(7667),a=n(1327),s=n(1866);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++tu))return!1;var f=l.get(e),p=l.get(t);if(f&&p)return f==t&&p==e;var h=-1,g=!0,m=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++h-1&&e%1==0&&e-1}},4705:function(e,t,n){var r=n(8470);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},4785:function(e,t,n){var r=n(1989),o=n(8407),i=n(7071);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},1285:function(e,t,n){var r=n(5050);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},6e3:function(e,t,n){var r=n(5050);e.exports=function(e){return r(this,e).get(e)}},9916:function(e,t,n){var r=n(5050);e.exports=function(e){return r(this,e).has(e)}},5265:function(e,t,n){var r=n(5050);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},8776:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},4536:function(e,t,n){var r=n(852)(Object,"create");e.exports=r},6916:function(e,t,n){var r=n(5569)(Object.keys,Object);e.exports=r},1167:function(e,t,n){e=n.nmd(e);var r=n(1957),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,s=function(){try{var e=i&&i.require&&i.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},5639:function(e,t,n){var r=n(1957),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},619:function(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},2385:function(e){e.exports=function(e){return this.__data__.has(e)}},1814:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},7465:function(e,t,n){var r=n(8407);e.exports=function(){this.__data__=new r,this.size=0}},3779:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},7599:function(e){e.exports=function(e){return this.__data__.get(e)}},4758:function(e){e.exports=function(e){return this.__data__.has(e)}},4309:function(e,t,n){var r=n(8407),o=n(7071),i=n(3369);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},346:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},7990:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},3279:function(e,t,n){var r=n(3218),o=n(7771),i=n(4841),a=Math.max,s=Math.min;e.exports=function(e,t,n){var l,c,u,d,f,p,h=0,g=!1,m=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=l,r=c;return l=c=void 0,h=t,d=e.apply(r,n)}function b(e){return h=e,f=setTimeout(x,t),g?y(e):d}function w(e){var n=e-p;return void 0===p||n>=t||n<0||m&&e-h>=u}function x(){var e=o();if(w(e))return E(e);f=setTimeout(x,function(e){var n=t-(e-p);return m?s(n,u-(e-h)):n}(e))}function E(e){return f=void 0,v&&l?y(e):(l=c=void 0,d)}function C(){var e=o(),n=w(e);if(l=arguments,c=this,p=e,n){if(void 0===f)return b(p);if(m)return clearTimeout(f),f=setTimeout(x,t),y(p)}return void 0===f&&(f=setTimeout(x,t)),d}return t=i(t)||0,r(n)&&(g=!!n.leading,u=(m="maxWait"in n)?a(i(n.maxWait)||0,t):u,v="trailing"in n?!!n.trailing:v),C.cancel=function(){void 0!==f&&clearTimeout(f),h=0,l=p=c=f=void 0},C.flush=function(){return void 0===f?d:E(o())},C}},7813:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},5694:function(e,t,n){var r=n(9454),o=n(7005),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},1469:function(e){var t=Array.isArray;e.exports=t},8612:function(e,t,n){var r=n(3560),o=n(1780);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},4144:function(e,t,n){e=n.nmd(e);var r=n(5639),o=n(5062),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,s=a&&a.exports===i?r.Buffer:void 0,l=(s?s.isBuffer:void 0)||o;e.exports=l},8446:function(e,t,n){var r=n(939);e.exports=function(e,t){return r(e,t)}},3560:function(e,t,n){var r=n(4239),o=n(3218);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},3448:function(e,t,n){var r=n(4239),o=n(7005);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},6719:function(e,t,n){var r=n(8749),o=n(1717),i=n(1167),a=i&&i.isTypedArray,s=a?o(a):r;e.exports=s},3674:function(e,t,n){var r=n(4636),o=n(280),i=n(8612);e.exports=function(e){return i(e)?r(e):o(e)}},7771:function(e,t,n){var r=n(5639);e.exports=function(){return r.Date.now()}},479:function(e){e.exports=function(){return[]}},5062:function(e){e.exports=function(){return!1}},4841:function(e,t,n){var r=n(7561),o=n(3218),i=n(3448),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||l.test(e)?c(e.slice(2),n?2:8):a.test(e)?NaN:+e}},6551:function(e){e.exports={"ant-divider-horizontal":"ant-divider-horizontal--3_QVz","ant-divider-with-text-center":"ant-divider-with-text-center--2ghLj","ant-divider-with-text-left":"ant-divider-with-text-left--1es8c","ant-divider-with-text-right":"ant-divider-with-text-right--34JtC","ls-renderall":"ls-renderall--2p_YK","ls-fade":"ls-fade--120yD",fadeInOpacity:"fadeInOpacity--1SyqN","htx-highlight":"htx-highlight--2sEcE","htx-no-label":"htx-no-label--1PHG7","htx-highlight-last":"htx-highlight-last--2Y8G7","htx-yoyo":"htx-yoyo--8gZvk","ant-modal-confirm-error":"ant-modal-confirm-error--uV-7e","react-dropdown-tree-select":"react-dropdown-tree-select--_jp-a",node:"node--1EDf9",toggle:"toggle--2jObT",disabled:"disabled--2379R","ant-list-item-action":"ant-list-item-action--1XVgM",segment:"segment--2c03A","main-content-wrapper":"main-content-wrapper--1qjJ0",editor:"editor--38IjC",editorfs:"editorfs--35DEA",menu:"menu--389bf",menubsp:"menubsp--1dgDv",content:"content--3AwAm",common:"common--1n20d","view-all":"view-all--kQzfL",commonbsp:"commonbsp--34Ryp",pins:"pins--rc2IU",pinsright:"pinsright--3SMzu",grid:"grid--11Oww",container:"container--2d8bU",left:"left--eVd72",right:"right--3WGsC"}},6653:function(e){e.exports={block:"block--aErAg",block_selected:"block_selected--3fQdI",name:"name--2Y__f",tag:"tag--wibDx",date:"date--3X3XS"}},3537:function(e){e.exports={section:"section--3stUo",header:"header--2gZVc",title:"title--6Chjw",treelabels:"treelabels--Gyqxz",treelabel:"treelabel--1x6NT",treetag:"treetag--dUykE",item:"item--DBLXE",lstitem:"lstitem--2MvV3",hidden:"hidden--OeH1g",visible:"visible--2xjRS",selected:"selected--26EPW",lstitem_label:"lstitem_label--1L6UI",lstitem__actions:"lstitem__actions--3NJ0J",lstitem__actionIcon:"lstitem__actionIcon--1tWdg",list:"list--28nXE",uihidden:"uihidden--3w0An",uivisible:"uivisible--3gELS","ant-tree-switcher":"ant-tree-switcher--2IZ4x"}},165:function(e){e.exports={block:"block--1mrhB",button:"button--23Zqq",labels:"labels--36qif",tag:"tag--24Ubt",statesblk:"statesblk--2SB5r",row:"row--1uJfQ",long:"long--pgH_K"}},9447:function(e){e.exports={error:"error--O7ftV"}},2807:function(e){e.exports={main:"main--3sNRF"}},9314:function(e){e.exports={input:"input--VOXHQ",editing:"editing--2GJSX",enter:"enter--12U-1",delete:"delete--3L0o-"}},5179:function(e){e.exports={block:"block--2awKU",divider:"divider--1wUlv",button:"button--cWhwC",wrapper:"wrapper--i-it1",loading:"loading--34nhb",container:"container--Xb7Oz",rotated:"rotated--Mvlud",filler:"filler--37S2l",withGallery:"withGallery--3b8tR",gallery:"gallery--jBUKK",active:"active--1beCx"}},3500:function(e){e.exports={node:"node--LDDGK",minimal:"minimal--2DIXG",alias:"alias--2GhPL"}},7434:function(e){e.exports={list:"list--2wbr2",item:"item--3FTWu",selected:"selected--qE5Wn",block:"block--8wq2d",relationbtn:"relationbtn--1w1OU",header:"header--1wd7P",section:"section--i0mAU",section__blocks:"section__blocks--gGygY",uihidden:"uihidden--5e397",uivisible:"uivisible--3ndzq"}},6841:function(e){e.exports={"ant-divider-horizontal":"ant-divider-horizontal--2_B7I","ant-divider-with-text-center":"ant-divider-with-text-center--3pS_p","ant-divider-with-text-left":"ant-divider-with-text-left--2vK-T","ant-divider-with-text-right":"ant-divider-with-text-right--D36tc","ls-renderall":"ls-renderall--GuD2c","ls-fade":"ls-fade--1YyFQ",fadeInOpacity:"fadeInOpacity--1cQK8","htx-highlight":"htx-highlight--1EiC9","htx-no-label":"htx-no-label--3euX2","htx-highlight-last":"htx-highlight-last--3K9fK","htx-yoyo":"htx-yoyo--9Yx6s","ant-modal-confirm-error":"ant-modal-confirm-error--2S-Db","react-dropdown-tree-select":"react-dropdown-tree-select--3jjv9",node:"node--14Etw",toggle:"toggle--1AsYT",disabled:"disabled--2tN8i",block:"block--1JMwd"}},1068:function(e){e.exports={block:"block--1kvYS",divider:"divider--ZWwTQ",button:"button--1sh6I"}},2860:function(e){e.exports={progress:"progress--3U-pB",wave:"wave--3UTNo",menu:"menu--3O5Z6"}},6873:function(e){e.exports={mark:"mark--2sZtr",selected:"selected--23NH3",highlighted:"highlighted--34qAb",relation:"relation--E4JQn",delete:"delete--LC6Rz",row:"row--zlvG1"}},2500:function(e){e.exports={link:"link--1GXtV"}},1259:function(e){e.exports={phrase:"phrase--3va5P",numbered:"numbered--FuR10",name:"name--ikW4Q",text:"text--3Ztgr",dialoguename:"dialoguename--3GGrq",dialoguetext:"dialoguetext--358fr",container:"container--2Qetk",withAudio:"withAudio--UfYZG",audio:"audio--1PTBT",play:"play--LRPte"}},4419:function(e){e.exports={tooltitle:"tooltitle--168oG"}},7090:function(e,t,n){"use strict";n.r(t),n.d(t,{addDisposer:function(){return G},addMiddleware:function(){return Pe},applyAction:function(){return be},applyPatch:function(){return x},applySnapshot:function(){return _},cast:function(){return J},castFlowReturn:function(){return Mt},castToReferenceSnapshot:function(){return ee},castToSnapshot:function(){return Z},clone:function(){return H},createActionTrackingMiddleware:function(){return ge},createActionTrackingMiddleware2:function(){return ve},decorate:function(){return Ne},destroy:function(){return K},detach:function(){return W},escapeJsonPath:function(){return It},flow:function(){return Rt},getChildType:function(){return y},getEnv:function(){return Y},getIdentifier:function(){return F},getLivelinessChecking:function(){return s},getMembers:function(){return Q},getNodeId:function(){return te},getParent:function(){return P},getParentOfType:function(){return R},getPath:function(){return A},getPathParts:function(){return j},getPropertyMembers:function(){return X},getRelativePath:function(){return U},getRoot:function(){return M},getRunningActionContext:function(){return Me},getSnapshot:function(){return O},getType:function(){return v},hasParent:function(){return T},hasParentOfType:function(){return N},isActionContextChildOf:function(){return je},isActionContextThisOrChildOf:function(){return De},isAlive:function(){return q},isArrayType:function(){return Jt},isFrozenType:function(){return Ln},isIdentifierType:function(){return $n},isLateType:function(){return An},isLiteralType:function(){return bn},isMapType:function(){return Gt},isModelType:function(){return an},isOptionalType:function(){return Tn},isPrimitiveType:function(){return mn},isProtected:function(){return S},isReferenceType:function(){return Hn},isRefinementType:function(){return xn},isRoot:function(){return D},isStateTreeNode:function(){return Xe},isType:function(){return fe},isUnionType:function(){return kn},isValidReference:function(){return V},joinJsonPath:function(){return zt},onAction:function(){return xe},onPatch:function(){return b},onSnapshot:function(){return w},process:function(){return at},protect:function(){return C},recordActions:function(){return we},recordPatches:function(){return E},resolveIdentifier:function(){return I},resolvePath:function(){return L},setLivelinessChecking:function(){return a},setLivelynessChecking:function(){return l},splitJsonPath:function(){return Vt},toGenerator:function(){return jt},toGeneratorFunction:function(){return At},tryReference:function(){return z},tryResolve:function(){return B},typecheck:function(){return He},types:function(){return Zn},unescapeJsonPath:function(){return Ft},unprotect:function(){return k},walk:function(){return $}});var r,o=n(2188),i="warn";function a(e){i=e}function s(){return i}function l(e){a(e)}!function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"}(r||(r={}));var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function u(e,t){function n(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var d=function(){return(d=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function p(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function m(){for(var e=[],t=0;t";return this.type.name+"@"+e+(this.isAlive?"":" [dead]")},t.prototype.die=function(){this.isAlive&&this.state!==We.DETACHING&&(this.aboutToDie(),this.finalizeDeath())},t.prototype.finalizeCreation=function(){this.baseFinalizeCreation()},t.prototype.aboutToDie=function(){this.baseAboutToDie()},t.prototype.finalizeDeath=function(){this.baseFinalizeDeath()},t.prototype.fireHook=function(e){this.fireInternalHook(e)},f([o.aD],t.prototype,"die",null),t}(re),ie=1,ae={onError:function(e){throw e}},se=function(e){function t(t,n,r,o,i){var a=e.call(this,t,n,r,o)||this;if(a.nodeId=++ie,a.isProtectionEnabled=!0,a._autoUnbox=!0,a._isRunningAction=!1,a._hasSnapshotReaction=!1,a._observableInstanceState=0,a._cachedInitialSnapshotCreated=!1,a.unbox=a.unbox.bind(a),a._initialSnapshot=yt(i),a.identifierAttribute=t.identifierAttribute,n||(a.identifierCache=new qe),a._childNodes=t.initializeChildNodes(a,a._initialSnapshot),a.identifier=null,a.unnormalizedIdentifier=null,a.identifierAttribute&&a._initialSnapshot){var s=a._initialSnapshot[a.identifierAttribute];if(void 0===s){var l=a._childNodes[a.identifierAttribute];l&&(s=l.value)}if("string"!=typeof s&&"number"!=typeof s)throw ut("Instance identifier '"+a.identifierAttribute+"' for type '"+a.type.name+"' must be a string or a number");a.identifier=Xn(s),a.unnormalizedIdentifier=s}return n?n.root.identifierCache.addNodeToCache(a):a.identifierCache.addNodeToCache(a),a}return u(t,e),t.prototype.applyPatches=function(e){this.createObservableInstanceIfNeeded(),this._applyPatches(e)},t.prototype.applySnapshot=function(e){this.createObservableInstanceIfNeeded(),this._applySnapshot(e)},t.prototype.createObservableInstanceIfNeeded=function(){0===this._observableInstanceState&&this.createObservableInstance()},t.prototype.createObservableInstance=function(){var e,t;this._observableInstanceState=1;for(var n=[],i=this.parent;i&&0===i._observableInstanceState;)n.unshift(i),i=i.parent;try{for(var a=h(n),s=a.next();!s.done;s=a.next()){s.value.createObservableInstanceIfNeeded()}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}var l,c,u=this.type;try{this.storedValue=u.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,u.finalizeNewInstance(this,this.storedValue)}catch(e){throw this.state=We.DEAD,e}finally{this._isRunningAction=!1}this._observableInstanceState=2,l=this,c="snapshot",(0,o.qp)(l,c).trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=lt,this.state=We.CREATED,this.fireHook(r.afterCreate),this.finalizeCreation()},Object.defineProperty(t.prototype,"root",{get:function(){var e=this.parent;return e?e.root:this},enumerable:!1,configurable:!0}),t.prototype.clearParent=function(){if(this.parent){this.fireHook(r.beforeDetach);var e=this.state;this.state=We.DETACHING;var t=this.root,n=t.environment,o=t.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=n,this.identifierCache=o}finally{this.state=e}}},t.prototype.setParent=function(e,t){var n=e!==this.parent,o=t!==this.subpath;(n||o)&&(n?(this.environment=void 0,e.root.identifierCache.mergeCache(this),this.baseSetParent(e,t),this.fireHook(r.afterAttach)):o&&this.baseSetParent(this.parent,t))},t.prototype.fireHook=function(e){var t=this;this.fireInternalHook(e);var n=this.storedValue&&"object"==typeof this.storedValue&&this.storedValue[e];"function"==typeof n&&(o.vB?(0,o.vB)((function(){n.apply(t.storedValue)})):n.apply(this.storedValue))},Object.defineProperty(t.prototype,"snapshot",{get:function(){return yt(this.getSnapshot())},enumerable:!1,configurable:!0}),t.prototype.getSnapshot=function(){return this.isAlive?2===this._observableInstanceState?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath},t.prototype._getActualSnapshot=function(){return this.type.getSnapshot(this)},t.prototype._getCachedInitialSnapshot=function(){if(!this._cachedInitialSnapshotCreated){var e=this.type,t=this._childNodes,n=this._initialSnapshot;this._cachedInitialSnapshot=e.processInitialSnapshot(t,n),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot},t.prototype.isRunningAction=function(){return!!this._isRunningAction||!this.isRoot&&this.parent.isRunningAction()},t.prototype.assertAlive=function(e){var t=s();if(!this.isAlive&&"ignore"!==t){var n=this._getAssertAliveError(e);switch(t){case"error":throw ut(n);case"warn":St(n)}}},t.prototype._getAssertAliveError=function(e){var t=this.getEscapedPath(!1)||this.pathUponDeath||"",n=e.subpath&&It(e.subpath)||"",r=e.actionContext||ke();r&&"action"!==r.type&&r.parentActionEvent&&(r=r.parentActionEvent);var o="";r&&null!=r.name&&(o=(r&&r.context&&A(r.context)||t)+"."+r.name+"()");return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '"+this.type.name+"', Path upon death: '"+t+"', Subpath: '"+n+"', Action: '"+o+"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree."},t.prototype.getChildNode=function(e){this.assertAlive({subpath:e}),this._autoUnbox=!1;try{return 2===this._observableInstanceState?this.type.getChildNode(this,e):this._childNodes[e]}finally{this._autoUnbox=!0}},t.prototype.getChildren=function(){this.assertAlive(lt),this._autoUnbox=!1;try{return 2===this._observableInstanceState?this.type.getChildren(this):it(this._childNodes)}finally{this._autoUnbox=!0}},t.prototype.getChildType=function(e){return this.type.getChildType(e)},Object.defineProperty(t.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),t.prototype.assertWritable=function(e){if(this.assertAlive(e),!this.isRunningAction()&&this.isProtected)throw ut("Cannot modify '"+this+"', the object is protected and can only be modified by using an action.")},t.prototype.removeChild=function(e){this.type.removeChild(this,e)},t.prototype.unbox=function(e){return e?(this.assertAlive({subpath:e.subpath||e.subpathUponDeath}),this._autoUnbox?e.value:e):e},t.prototype.toString=function(){var e=(this.isAlive?this.path:this.pathUponDeath)||"",t=this.identifier?"(id: "+this.identifier+")":"";return this.type.name+"@"+e+t+(this.isAlive?"":" [dead]")},t.prototype.finalizeCreation=function(){var e=this;this.baseFinalizeCreation((function(){var t,n;try{for(var o=h(e.getChildren()),i=o.next();!i.done;i=o.next()){i.value.finalizeCreation()}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}e.fireInternalHook(r.afterCreationFinalization)}))},t.prototype.detach=function(){if(!this.isAlive)throw ut("Error while detaching, node is not alive.");this.clearParent()},t.prototype.preboot=function(){var e=this;this._applyPatches=Te(this.storedValue,"@APPLY_PATCHES",(function(t){t.forEach((function(t){var n=Vt(t.path);ot(e,n.slice(0,-1)).applyPatchLocally(n[n.length-1],t)}))})),this._applySnapshot=Te(this.storedValue,"@APPLY_SNAPSHOT",(function(t){if(t!==e.snapshot)return e.type.applySnapshot(e,t)})),bt(this.storedValue,"$treenode",this),bt(this.storedValue,"toJSON",et)},t.prototype.die=function(){this.isAlive&&this.state!==We.DETACHING&&(this.aboutToDie(),this.finalizeDeath())},t.prototype.aboutToDie=function(){0!==this._observableInstanceState&&(this.getChildren().forEach((function(e){e.aboutToDie()})),this.baseAboutToDie(),this._internalEventsEmit("dispose"),this._internalEventsClear("dispose"))},t.prototype.finalizeDeath=function(){this.getChildren().forEach((function(e){e.finalizeDeath()})),this.root.identifierCache.notifyDied(this);var e=this.snapshot;this._snapshotUponDeath=e,this._internalEventsClearAll(),this.baseFinalizeDeath()},t.prototype.onSnapshot=function(e){return this._addSnapshotReaction(),this._internalEventsRegister("snapshot",e)},t.prototype.emitSnapshot=function(e){this._internalEventsEmit("snapshot",e)},t.prototype.onPatch=function(e){return this._internalEventsRegister("patch",e)},t.prototype.emitPatch=function(e,t){if(this._internalEventsHasSubscribers("patch")){var n=g(function(e){if(!("oldValue"in e))throw ut("Patches without `oldValue` field cannot be inversed");return[Dt(e),Lt(e)]}(function(e){for(var t=[],n=1;n=0&&this.middlewares.splice(t,1)}},t.prototype.addMiddleWare=function(e,t){var n=this;void 0===t&&(t=!0);var r={handler:e,includeHooks:t};return this.middlewares?this.middlewares.push(r):this.middlewares=[r],function(){n.removeMiddleware(r)}},t.prototype.applyPatchLocally=function(e,t){this.assertWritable({subpath:e}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,e,t)},t.prototype._addSnapshotReaction=function(){var e=this;if(!this._hasSnapshotReaction){var t=(0,o.U5)((function(){return e.snapshot}),(function(t){return e.emitSnapshot(t)}),ae);this.addDisposer(t),this._hasSnapshotReaction=!0}},t.prototype._internalEventsHasSubscribers=function(e){return!!this._internalEvents&&this._internalEvents.hasSubscribers(e)},t.prototype._internalEventsRegister=function(e,t,n){return void 0===n&&(n=!1),this._internalEvents||(this._internalEvents=new xt),this._internalEvents.register(e,t,n)},t.prototype._internalEventsHas=function(e,t){return!!this._internalEvents&&this._internalEvents.has(e,t)},t.prototype._internalEventsUnregister=function(e,t){this._internalEvents&&this._internalEvents.unregister(e,t)},t.prototype._internalEventsEmit=function(e){for(var t,n=[],r=1;r0},enumerable:!1,configurable:!0}),e}();function ve(e){var t=new WeakMap;return function(n,r){var o=n.parentActionEvent?t.get(n.parentActionEvent):void 0;if("action"===n.type){var i=d(d({},n),{env:o&&o.call.env,parentCall:o&&o.call}),a=!e.filter||e.filter(i),s=new me(a?e:void 0,i);t.set(n,s);var l=void 0;try{l=r(n)}catch(e){throw s.finish(e),e}return s.hasFlowsPending||s.finish(),l}if(!o)return r(n);switch(n.type){case"flow_spawn":return o.incFlowsPending(),r(n);case"flow_resume":case"flow_resume_error":return r(n);case"flow_throw":var c=n.args[0];try{return r(n)}finally{o.decFlowsPending(),o.hasFlowsPending||o.finish(c)}case"flow_return":try{return r(n)}finally{o.decFlowsPending(),o.hasFlowsPending||o.finish()}}}}function ye(e){return{$MST_UNSERIALIZABLE:!0,type:e}}function be(e,t){Qe(e,1),_t(t,(function(e){return"object"==typeof e}),"object or array",2),(0,o.z)((function(){ht(t).forEach((function(t){return function(e,t){var n=B(e,t.path||"");if(!n)throw ut("Invalid action path: "+(t.path||""));var r=Je(n);if("@APPLY_PATCHES"===t.name)return x.call(null,n,t.args[0]);if("@APPLY_SNAPSHOT"===t.name)return _.call(null,n,t.args[0]);if("function"!=typeof n[t.name])throw ut("Action '"+t.name+"' does not exist in '"+r.path+"'");return n[t.name].apply(n,t.args?t.args.map((function(e){return function(e,t){return t&&"object"==typeof t&&"$MST_DATE"in t?new Date(t.$MST_DATE):t}(0,e)})):[])}(e,t)}))}))}function we(e,t){Qe(e,1);var n,r=[],o=function(e){(!t||t(e,Me()))&&r.push(e)},i={actions:r,get recording(){return!!n},stop:function(){n&&(n(),n=void 0)},resume:function(){n||(n=xe(e,o))},replay:function(e){be(e,r)}};return i.resume(),i}function xe(e,t,n){return void 0===n&&(n=!1),Qe(e,1),Pe(e,(function(r,o){if("action"===r.type&&r.id===r.rootId){var i=Je(r.context),a={name:r.name,path:nt(Je(e),i),args:r.args.map((function(e,t){return function(e,t,n,r){if(r instanceof Date)return{$MST_DATE:r.getTime()};if(vt(r))return r;if(Xe(r))return ye("[MSTNode: "+v(r).name+"]");if("function"==typeof r)return ye("[function]");if("object"==typeof r&&!gt(r)&&!pt(r))return ye("[object "+(r&&r.constructor&&r.constructor.name||"Complex Object")+"]");try{return JSON.stringify(r),r}catch(e){return ye(""+e)}}(0,r.name,0,e)}))};if(n){var s=o(r);return t(a),s}return t(a),o(r)}return o(r)}))}var Ee,Ce=1;function ke(){return Ee}function Se(){return Ce++}function _e(e,t){var n=Je(e.context);"action"===e.type&&n.assertAlive({actionContext:e});var i=n._isRunningAction;n._isRunningAction=!0;var a=Ee;Ee=e;try{return function(e,t,n){var i=new Re(e,n);if(i.isEmpty)return(0,o.aD)(n).apply(null,t.args);var a=null;function s(e){var t=i.getNextMiddleware(),l=t&&t.handler;if(!l)return(0,o.aD)(n).apply(null,e.args);if(!t.includeHooks&&r[e.name])return s(e);function c(e,t){!0,a=s(e),t&&(a=t(a))}function u(e){!0,a=e}return l(e,c,u),a}return s(t)}(n,e,t)}finally{Ee=a,n._isRunningAction=i}}function Oe(e){if(e)return"action"===e.type?e:e.parentActionEvent}function Te(e,t,n){var r=function(){var r=Se(),o=Ee,i=Oe(o);return _e({type:"action",name:t,id:r,args:Et(arguments),context:e,tree:M(e),rootId:o?o.rootId:r,parentId:o?o.id:0,allParentIds:o?m(o.allParentIds,[o.id]):[],parentEvent:o,parentActionEvent:i},n)};return r._isMSTAction=!0,r}function Pe(e,t,n){void 0===n&&(n=!0);var r=Je(e);return r.addMiddleWare(t,n)}function Ne(e,t,n){void 0===n&&(n=!0);var r={handler:e,includeHooks:n};return t.$mst_middleware=t.$mst_middleware||[],t.$mst_middleware.push(r),t}var Re=function(){function e(e,t){this.arrayIndex=0,this.inArrayIndex=0,this.middlewares=[],t.$mst_middleware&&this.middlewares.push(t.$mst_middleware);for(var n=e;n;)n.middlewares&&this.middlewares.push(n.middlewares),n=n.parent}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),e.prototype.getNextMiddleware=function(){var e=this.middlewares[this.arrayIndex];if(e){var t=e[this.inArrayIndex++];return t||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}},e}();function Me(){for(var e=ke();e&&"action"!==e.type;)e=e.parentActionEvent;return e}function Ae(e,t,n){for(var r="number"==typeof t?t:t.id,o=n?e:e.parentActionEvent;o;){if(o.id===r)return!0;o=o.parentActionEvent}return!1}function je(e,t){return Ae(e,t,!1)}function De(e,t){return Ae(e,t,!0)}function Le(e){return"function"==typeof e?"":Xe(e)?"<"+e+">":"`"+function(e){try{return JSON.stringify(e)}catch(e){return""}}(e)+"`"}function Ie(e){var t=e.value,n=e.context[e.context.length-1].type,r=e.context.map((function(e){return e.path})).filter((function(e){return e.length>0})).join("/"),o=r.length>0?'at path "/'+r+'" ':"",i=Xe(t)?"value of type "+Je(t).type.name+":":vt(t)?"value":"snapshot",a=n&&Xe(t)&&n.is(Je(t).snapshot);return""+o+i+" "+Le(t)+" is not assignable "+(n?"to type: `"+n.name+"`":"")+(e.message?" ("+e.message+")":"")+(n?mn(n)||vt(t)?".":", expected an instance of `"+n.name+"` or a snapshot like `"+n.describe()+"` instead."+(a?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function Fe(e,t,n){return e.concat([{path:t,type:n}])}function ze(){return st}function Ve(e,t,n){return[{context:e,value:t,message:n}]}function Be(e){return e.reduce((function(e,t){return e.concat(t)}),[])}function Ue(e,t){"undefined"!=typeof process&&"true"==="MISSING_ENV_VAR".ENABLE_TYPE_CHECK&&He(e,t)}function He(e,t){var n=e.validate(t,[{path:"",type:e}]);if(n.length>0)throw ut(function(e,t,n){if(0===n.length)return;return"Error while converting "+(r=Le(t),(r.length<280?r:r.substring(0,272)+"......"+r.substring(r.length-8))+" to `")+e.name+"`:\n\n "+n.map(Ie).join("\n ");var r}(e,t,n))}var We,Ke=0,qe=function(){function e(){this.cacheId=Ke++,this.cache=o.LO.map(),this.lastCacheModificationPerId=o.LO.map()}return e.prototype.updateLastCacheModificationPerId=function(e){var t=this.lastCacheModificationPerId.get(e);this.lastCacheModificationPerId.set(e,void 0===t?1:t+1)},e.prototype.getLastCacheModificationPerId=function(e){var t=this.lastCacheModificationPerId.get(e)||0;return this.cacheId+"-"+t},e.prototype.addNodeToCache=function(e,t){if(void 0===t&&(t=!0),e.identifierAttribute){var n=e.identifier;this.cache.has(n)||this.cache.set(n,o.LO.array([],ct));var r=this.cache.get(n);if(-1!==r.indexOf(e))throw ut("Already registered");r.push(e),t&&this.updateLastCacheModificationPerId(n)}},e.prototype.mergeCache=function(e){var t=this;(0,o.VO)(e.identifierCache.cache).forEach((function(e){return e.forEach((function(e){t.addNodeToCache(e)}))}))},e.prototype.notifyDied=function(e){if(e.identifierAttribute){var t=e.identifier,n=this.cache.get(t);n&&(n.remove(e),n.length||this.cache.delete(t),this.updateLastCacheModificationPerId(e.identifier))}},e.prototype.splitCache=function(t){var n=this,r=new e,i=t.path;return(0,o.qh)(this.cache).forEach((function(e){for(var t=g(e,2),o=t[0],a=t[1],s=!1,l=a.length-1;l>=0;l--)0===a[l].path.indexOf(i)&&(r.addNodeToCache(a[l],!1),a.splice(l,1),s=!0);s&&n.updateLastCacheModificationPerId(o)})),r},e.prototype.has=function(e,t){var n=this.cache.get(t);return!!n&&n.some((function(t){return e.isAssignableFrom(t.type)}))},e.prototype.resolve=function(e,t){var n=this.cache.get(t);if(!n)return null;var r=n.filter((function(t){return e.isAssignableFrom(t.type)}));switch(r.length){case 0:return null;case 1:return r[0];default:throw ut("Cannot resolve a reference to type '"+e.name+"' with id: '"+t+"' unambigously, there are multiple candidates: "+r.map((function(e){return e.path})).join(", "))}},e}();function Ge(e,t,n,r,o){var i=Ze(o);if(i){if(i.parent)throw ut("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '"+(t?t.path:"")+"/"+n+"', but it lives already at '"+i.path+"'");return t&&i.setParent(t,n),i}return new se(e,t,n,r,o)}function Ye(e,t,n,r,o){return new oe(e,t,n,r,o)}function $e(e){return e instanceof oe||e instanceof se}function Xe(e){return!(!e||!e.$treenode)}function Qe(e,t){_t(e,Xe,"mobx-state-tree node",t)}function Je(e){if(!Xe(e))throw ut("Value "+e+" is no MST Node");return e.$treenode}function Ze(e){return e&&e.$treenode||null}function et(){return Je(this).snapshot}!function(e){e[e.INITIALIZING=0]="INITIALIZING",e[e.CREATED=1]="CREATED",e[e.FINALIZED=2]="FINALIZED",e[e.DETACHING=3]="DETACHING",e[e.DEAD=4]="DEAD"}(We||(We={}));var tt=function(e){return".."};function nt(e,t){if(e.root!==t.root)throw ut("Cannot calculate relative path: objects '"+e+"' and '"+t+"' are not part of the same object tree");for(var n=Vt(e.path),r=Vt(t.path),o=0;o0},enumerable:!1,configurable:!0}),e.prototype.register=function(e,t){var n=this;return void 0===t&&(t=!1),t?this.handlers.unshift(e):this.handlers.push(e),function(){n.unregister(e)}},e.prototype.has=function(e){return this.handlers.indexOf(e)>=0},e.prototype.unregister=function(e){var t=this.handlers.indexOf(e);t>=0&&this.handlers.splice(t,1)},e.prototype.clear=function(){this.handlers.length=0},e.prototype.emit=function(){for(var e=[],t=0;t0?this.hookInitializers.concat(e):[e];return new t(this.name,this._subType,n)},t.prototype.instantiate=function(e,t,n,r){return this._determineIdentifierMode(),Ge(this,e,t,n,r)},t.prototype._determineIdentifierMode=function(){if(this.identifierMode===Ut.UNKNOWN){var e=[];if(Wt(this._subType,e)){var t=void 0;e.forEach((function(e){if(e.identifierAttribute){if(t&&t!==e.identifierAttribute)throw ut("The objects in a map should all have the same identifier attribute, expected '"+t+"', but child of type '"+e.name+"' declared attribute '"+e.identifierAttribute+"' as identifier");t=e.identifierAttribute}})),t?(this.identifierMode=Ut.YES,this.mapIdentifierAttribute=t):this.identifierMode=Ut.NO}}},t.prototype.initializeChildNodes=function(e,t){void 0===t&&(t={});var n=e.type._subType,r={};return Object.keys(t).forEach((function(o){r[o]=n.instantiate(e,o,void 0,t[o])})),r},t.prototype.createNewInstance=function(e){return new Kt(e)},t.prototype.finalizeNewInstance=function(e,t){(0,o.Nv)(t,e.unbox),e.type.hookInitializers.forEach((function(e){var n=e(t);Object.keys(n).forEach((function(e){var r=n[e],o=Te(t,e,r);bt(t,e,o)}))})),(0,o.Su)(t,this.willChange),(0,o.N7)(t,this.didChange)},t.prototype.describe=function(){return"Map"},t.prototype.getChildren=function(e){return(0,o.VO)(e.storedValue)},t.prototype.getChildNode=function(e,t){var n=e.storedValue.get(""+t);if(!n)throw ut("Not a child "+t);return n},t.prototype.willChange=function(e){var t=Je(e.object),n=e.name;t.assertWritable({subpath:n});var r=t.type,o=r._subType;switch(e.type){case"update":var i=e.newValue;if(i===e.object.get(n))return null;Ue(o,i),e.newValue=o.reconcile(t.getChildNode(n),e.newValue,t,n),r.processIdentifier(n,e.newValue);break;case"add":Ue(o,e.newValue),e.newValue=o.instantiate(t,n,void 0,e.newValue),r.processIdentifier(n,e.newValue)}return e},t.prototype.processIdentifier=function(e,t){if(this.identifierMode===Ut.YES&&t instanceof se){var n=t.identifier;if(n!==e)throw ut("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '"+n+"', but expected: '"+e+"'")}},t.prototype.getSnapshot=function(e){var t={};return e.getChildren().forEach((function(e){t[e.subpath]=e.snapshot})),t},t.prototype.processInitialSnapshot=function(e){var t={};return Object.keys(e).forEach((function(n){t[n]=e[n].getSnapshot()})),t},t.prototype.didChange=function(e){var t=Je(e.object);switch(e.type){case"update":return void t.emitPatch({op:"replace",path:It(e.name),value:e.newValue.snapshot,oldValue:e.oldValue?e.oldValue.snapshot:void 0},t);case"add":return void t.emitPatch({op:"add",path:It(e.name),value:e.newValue.snapshot,oldValue:void 0},t);case"delete":var n=e.oldValue.snapshot;return e.oldValue.die(),void t.emitPatch({op:"remove",path:It(e.name),oldValue:n},t)}},t.prototype.applyPatchLocally=function(e,t,n){var r=e.storedValue;switch(n.op){case"add":case"replace":r.set(t,n.value);break;case"remove":r.delete(t)}},t.prototype.applySnapshot=function(e,t){Ue(this,t);var n=e.storedValue,r={};if(Array.from(n.keys()).forEach((function(e){r[e]=!1})),t)for(var o in t)n.set(o,t[o]),r[""+o]=!0;Object.keys(r).forEach((function(e){!1===r[e]&&n.delete(e)}))},t.prototype.getChildType=function(){return this._subType},t.prototype.isValidSnapshot=function(e,t){var n=this;return gt(e)?Be(Object.keys(e).map((function(r){return n._subType.validate(e[r],Fe(t,r,n._subType))}))):Ve(t,e,"Value is not a plain object")},t.prototype.getDefaultSnapshot=function(){return lt},t.prototype.removeChild=function(e,t){e.storedValue.delete(t)},f([o.aD],t.prototype,"applySnapshot",null),t}(ue);function Gt(e){return fe(e)&&(e.flags&ne.Map)>0}var Yt=function(e){function t(t,n,r){void 0===r&&(r=[]);var o=e.call(this,t)||this;return o._subType=n,o.flags=ne.Array,o.hookInitializers=[],o.hookInitializers=r,o}return u(t,e),t.prototype.hooks=function(e){var n=this.hookInitializers.length>0?this.hookInitializers.concat(e):[e];return new t(this.name,this._subType,n)},t.prototype.instantiate=function(e,t,n,r){return Ge(this,e,t,n,r)},t.prototype.initializeChildNodes=function(e,t){void 0===t&&(t=[]);var n=e.type._subType,r={};return t.forEach((function(t,o){var i=""+o;r[i]=n.instantiate(e,i,void 0,t)})),r},t.prototype.createNewInstance=function(e){return o.LO.array(it(e),ct)},t.prototype.finalizeNewInstance=function(e,t){(0,o.kS)(t).dehancer=e.unbox,e.type.hookInitializers.forEach((function(e){var n=e(t);Object.keys(n).forEach((function(e){var r=n[e],o=Te(t,e,r);bt(t,e,o)}))})),(0,o.Su)(t,this.willChange),(0,o.N7)(t,this.didChange)},t.prototype.describe=function(){return this._subType.describe()+"[]"},t.prototype.getChildren=function(e){return e.storedValue.slice()},t.prototype.getChildNode=function(e,t){var n=Number(t);if(n=0;n--)t.emitPatch({op:"remove",path:""+(e.index+n),oldValue:e.removed[n].snapshot},t);for(n=0;n0}var Zt="preProcessSnapshot",en="postProcessSnapshot";function tn(){return Je(this).toString()}var nn={name:"AnonymousModel",properties:{},initializers:st};function rn(e){return Object.keys(e).reduce((function(e,t){var n,o,i;if(t in r)throw ut("Hook '"+t+"' was defined as property. Hooks should be defined as part of the actions");var a=Object.getOwnPropertyDescriptor(e,t);if("get"in a)throw ut("Getters are not supported as properties. Please use views instead");var s=a.value;if(null==s)throw ut("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(vt(s))return Object.assign({},e,((n={})[t]=_n(function(e){switch(typeof e){case"string":return ln;case"number":return cn;case"boolean":return dn;case"object":if(e instanceof Date)return gn}throw ut("Cannot determine primitive type from value "+e)}(s),s),n));if(s instanceof qt)return Object.assign({},e,((o={})[t]=_n(s,{}),o));if(s instanceof Yt)return Object.assign({},e,((i={})[t]=_n(s,[]),i));if(fe(s))return e;throw ut("Invalid type definition for property '"+t+"', cannot infer a type from a value like '"+s+"' ("+typeof s+")")}),e)}var on=function(e){function t(t){var n=e.call(this,t.name||nn.name)||this;return n.flags=ne.Object,n.named=function(e){return n.cloneAndEnhance({name:e})},n.props=function(e){return n.cloneAndEnhance({properties:e})},n.preProcessSnapshot=function(e){var t=n.preProcessor;return t?n.cloneAndEnhance({preProcessor:function(n){return t(e(n))}}):n.cloneAndEnhance({preProcessor:e})},n.postProcessSnapshot=function(e){var t=n.postProcessor;return t?n.cloneAndEnhance({postProcessor:function(n){return e(t(n))}}):n.cloneAndEnhance({postProcessor:e})},Object.assign(n,nn,t),n.properties=rn(n.properties),n.properties,n.propertyNames=Object.keys(n.properties),n.identifierAttribute=n._getIdentifierAttribute(),n}return u(t,e),t.prototype._getIdentifierAttribute=function(){var e=void 0;return this.forAllProps((function(t,n){if(n.flags&ne.Identifier){if(e)throw ut("Cannot define property '"+t+"' as object identifier, property '"+e+"' is already defined as identifier property");e=t}})),e},t.prototype.cloneAndEnhance=function(e){return new t({name:e.name||this.name,properties:Object.assign({},this.properties,e.properties),initializers:this.initializers.concat(e.initializers||[]),preProcessor:e.preProcessor||this.preProcessor,postProcessor:e.postProcessor||this.postProcessor})},t.prototype.actions=function(e){var t=this;return this.cloneAndEnhance({initializers:[function(n){return t.instantiateActions(n,e(n)),n}]})},t.prototype.instantiateActions=function(e,t){if(!gt(t))throw ut("actions initializer should return a plain object containing actions");Object.keys(t).forEach((function(n){if(n===Zt)throw ut("Cannot define action 'preProcessSnapshot', it should be defined using 'type.preProcessSnapshot(fn)' instead");if(n===en)throw ut("Cannot define action 'postProcessSnapshot', it should be defined using 'type.postProcessSnapshot(fn)' instead");var o=t[n],i=e[n];if(n in r&&i){var a=o;o=function(){i.apply(null,arguments),a.apply(null,arguments)}}var s=o.$mst_middleware,l=o.bind(t);l.$mst_middleware=s;var c=Te(e,n,l);t[n]=c,bt(e,n,c)}))},t.prototype.volatile=function(e){var t=this;if("function"!=typeof e)throw ut("You passed an "+typeof e+" to volatile state as an argument, when function is expected");return this.cloneAndEnhance({initializers:[function(n){return t.instantiateVolatileState(n,e(n)),n}]})},t.prototype.instantiateVolatileState=function(e,t){if(!gt(t))throw ut("volatile state initializer should return a plain object containing state");(0,o.t8)(e,t)},t.prototype.extend=function(e){var t=this;return this.cloneAndEnhance({initializers:[function(n){var r=e(n),o=r.actions,i=r.views,a=r.state,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0}var sn=function(e){function t(t,n,r,o){void 0===o&&(o=dt);var i=e.call(this,t)||this;return i.flags=n,i.checker=r,i.initializer=o,i.flags=n,i}return u(t,e),t.prototype.describe=function(){return this.name},t.prototype.instantiate=function(e,t,n,r){return Ye(this,e,t,n,r)},t.prototype.createNewInstance=function(e){return this.initializer(e)},t.prototype.isValidSnapshot=function(e,t){return vt(e)&&this.checker(e)?ze():Ve(t,e,"Value is not a "+("Date"===this.name?"Date or a unix milliseconds timestamp":this.name))},t}(de),ln=new sn("string",ne.String,(function(e){return"string"==typeof e})),cn=new sn("number",ne.Number,(function(e){return"number"==typeof e})),un=new sn("integer",ne.Integer,(function(e){return ft(e)})),dn=new sn("boolean",ne.Boolean,(function(e){return"boolean"==typeof e})),fn=new sn("null",ne.Null,(function(e){return null===e})),pn=new sn("undefined",ne.Undefined,(function(e){return void 0===e})),hn=new sn("Date",ne.Date,(function(e){return"number"==typeof e||e instanceof Date}),(function(e){return e instanceof Date?e:new Date(e)}));hn.getSnapshot=function(e){return e.storedValue.getTime()};var gn=hn;function mn(e){return fe(e)&&(e.flags&(ne.String|ne.Number|ne.Integer|ne.Boolean|ne.Date))>0}var vn=function(e){function t(t){var n=e.call(this,JSON.stringify(t))||this;return n.flags=ne.Literal,n.value=t,n}return u(t,e),t.prototype.instantiate=function(e,t,n,r){return Ye(this,e,t,n,r)},t.prototype.describe=function(){return JSON.stringify(this.value)},t.prototype.isValidSnapshot=function(e,t){return vt(e)&&e===this.value?ze():Ve(t,e,"Value is not a literal "+JSON.stringify(this.value))},t}(de);function yn(e){return _t(),new vn(e)}function bn(e){return fe(e)&&(e.flags&ne.Literal)>0}var wn=function(e){function t(t,n,r,o){var i=e.call(this,t)||this;return i._subtype=n,i._predicate=r,i._message=o,i}return u(t,e),Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|ne.Refinement},enumerable:!1,configurable:!0}),t.prototype.describe=function(){return this.name},t.prototype.instantiate=function(e,t,n,r){return this._subtype.instantiate(e,t,n,r)},t.prototype.isAssignableFrom=function(e){return this._subtype.isAssignableFrom(e)},t.prototype.isValidSnapshot=function(e,t){var n=this._subtype.validate(e,t);if(n.length>0)return n;var r=Xe(e)?Je(e).snapshot:e;return this._predicate(r)?ze():Ve(t,e,this._message(e))},t.prototype.reconcile=function(e,t,n,r){return this._subtype.reconcile(e,t,n,r)},t.prototype.getSubTypes=function(){return this._subtype},t}(ce);function xn(e){return(e.flags&ne.Refinement)>0}var En=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o._types=n,o._eager=!0,r=d({eager:!0,dispatcher:void 0},r),o._dispatcher=r.dispatcher,r.eager||(o._eager=!1),o}return u(t,e),Object.defineProperty(t.prototype,"flags",{get:function(){var e=ne.Union;return this._types.forEach((function(t){e|=t.flags})),e},enumerable:!1,configurable:!0}),t.prototype.isAssignableFrom=function(e){return this._types.some((function(t){return t.isAssignableFrom(e)}))},t.prototype.describe=function(){return"("+this._types.map((function(e){return e.describe()})).join(" | ")+")"},t.prototype.instantiate=function(e,t,n,r){var o=this.determineType(r,void 0);if(!o)throw ut("No matching type for union "+this.describe());return o.instantiate(e,t,n,r)},t.prototype.reconcile=function(e,t,n,r){var o=this.determineType(t,e.type);if(!o)throw ut("No matching type for union "+this.describe());return o.reconcile(e,t,n,r)},t.prototype.determineType=function(e,t){return this._dispatcher?this._dispatcher(e):t?t.is(e)?t:this._types.filter((function(e){return e!==t})).find((function(t){return t.is(e)})):this._types.find((function(t){return t.is(e)}))},t.prototype.isValidSnapshot=function(e,t){if(this._dispatcher)return this._dispatcher(e).validate(e,t);for(var n=[],r=0,o=0;o0}var Sn=function(e){function t(t,n,r){var o=e.call(this,t.name)||this;return o._subtype=t,o._defaultValue=n,o.optionalValues=r,o}return u(t,e),Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|ne.Optional},enumerable:!1,configurable:!0}),t.prototype.describe=function(){return this._subtype.describe()+"?"},t.prototype.instantiate=function(e,t,n,r){if(this.optionalValues.indexOf(r)>=0){var o=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(e,t,n,o)}return this._subtype.instantiate(e,t,n,r)},t.prototype.reconcile=function(e,t,n,r){return this._subtype.reconcile(e,this.optionalValues.indexOf(t)<0&&this._subtype.is(t)?t:this.getDefaultInstanceOrSnapshot(),n,r)},t.prototype.getDefaultInstanceOrSnapshot=function(){var e="function"==typeof this._defaultValue?this._defaultValue():this._defaultValue;return"function"==typeof this._defaultValue&&Ue(this,e),e},t.prototype.isValidSnapshot=function(e,t){return this.optionalValues.indexOf(e)>=0?ze():this._subtype.validate(e,t)},t.prototype.isAssignableFrom=function(e){return this._subtype.isAssignableFrom(e)},t.prototype.getSubTypes=function(){return this._subtype},t}(ce);function _n(e,t,n){return function(e,t){if("function"!=typeof t&&Xe(t))throw ut("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead");pe(e,1)}(e,t),new Sn(e,t,n||On)}var On=[void 0];function Tn(e){return fe(e)&&(e.flags&ne.Optional)>0}var Pn=_n(pn,void 0),Nn=_n(fn,null);function Rn(e){return pe(e,1),Cn(e,Pn)}var Mn=function(e){function t(t,n){var r=e.call(this,t)||this;return r._definition=n,r}return u(t,e),Object.defineProperty(t.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|ne.Late},enumerable:!1,configurable:!0}),t.prototype.getSubType=function(e){if(!this._subType){var t=void 0;try{t=this._definition()}catch(e){if(!(e instanceof ReferenceError))throw e;t=void 0}if(e&&void 0===t)throw ut("Late type seems to be used too early, the definition (still) returns undefined");t&&(this._subType=t)}return this._subType},t.prototype.instantiate=function(e,t,n,r){return this.getSubType(!0).instantiate(e,t,n,r)},t.prototype.reconcile=function(e,t,n,r){return this.getSubType(!0).reconcile(e,t,n,r)},t.prototype.describe=function(){var e=this.getSubType(!1);return e?e.name:""},t.prototype.isValidSnapshot=function(e,t){var n=this.getSubType(!1);return n?n.validate(e,t):ze()},t.prototype.isAssignableFrom=function(e){var t=this.getSubType(!1);return!!t&&t.isAssignableFrom(e)},t.prototype.getSubTypes=function(){var e=this.getSubType(!1);return e||le},t}(ce);function An(e){return fe(e)&&(e.flags&ne.Late)>0}var jn=function(e){function t(t){var n=e.call(this,t?"frozen("+t.name+")":"frozen")||this;return n.subType=t,n.flags=ne.Frozen,n}return u(t,e),t.prototype.describe=function(){return""},t.prototype.instantiate=function(e,t,n,r){return Ye(this,e,t,n,r)},t.prototype.isValidSnapshot=function(e,t){return function(e){return"function"!=typeof e}(e)?this.subType?this.subType.validate(e,t):ze():Ve(t,e,"Value is not serializable and cannot be frozen")},t}(de),Dn=new jn;function Ln(e){return fe(e)&&(e.flags&ne.Frozen)>0}var In=function(){function e(e,t){if(this.targetType=t,Qn(e))this.identifier=e;else{if(!Xe(e))throw ut("Can only store references to tree nodes or identifiers, got: '"+e+"'");var n=Je(e);if(!n.identifierAttribute)throw ut("Can only store references with a defined identifier attribute.");var r=n.unnormalizedIdentifier;if(null==r)throw ut("Can only store references to tree nodes with a defined identifier.");this.identifier=r}}return e.prototype.updateResolvedReference=function(e){var t=Xn(this.identifier),n=e.root,r=n.identifierCache.getLastCacheModificationPerId(t);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==r){var o=this.targetType,i=n.identifierCache.resolve(o,t);if(!i)throw new Fn("[mobx-state-tree] Failed to resolve reference '"+this.identifier+"' to type '"+this.targetType.name+"' (from node: "+e.path+")");this.resolvedReference={node:i,lastCacheModification:r}}},Object.defineProperty(e.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),e}(),Fn=function(e){function t(n){var r=e.call(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return u(t,e),t}(Error),zn=function(e){function t(t,n){var r=e.call(this,"reference("+t.name+")")||this;return r.targetType=t,r.onInvalidated=n,r.flags=ne.Reference,r}return u(t,e),t.prototype.describe=function(){return this.name},t.prototype.isAssignableFrom=function(e){return this.targetType.isAssignableFrom(e)},t.prototype.isValidSnapshot=function(e,t){return Qn(e)?ze():Ve(t,e,"Value is not a valid identifier, which is a string or a number")},t.prototype.fireInvalidated=function(e,t,n,r){var o=t.parent;if(o&&o.isAlive){var i=o.storedValue;i&&this.onInvalidated({cause:e,parent:i,invalidTarget:r?r.storedValue:void 0,invalidId:n,replaceRef:function(e){x(t.root.storedValue,{op:"replace",value:e,path:t.path})},removeRef:function(){an(o.type)?this.replaceRef(void 0):x(t.root.storedValue,{op:"remove",path:t.path})}})}},t.prototype.addTargetNodeWatcher=function(e,t){var n=this,o=this.getValue(e);if(o){var i=Je(o),a=function(o,a){var s=function(e){switch(e){case r.beforeDestroy:return"destroy";case r.beforeDetach:return"detach";default:return}}(a);s&&n.fireInvalidated(s,e,t,i)},s=i.registerHook(r.beforeDetach,a),l=i.registerHook(r.beforeDestroy,a);return function(){s(),l()}}},t.prototype.watchTargetNodeForInvalidations=function(e,t,n){var o=this;if(this.onInvalidated){var i;e.registerHook(r.beforeDestroy,(function(){i&&i()}));var a=function(r){i&&i();var a=e.parent,s=a&&a.storedValue;if(a&&a.isAlive&&s){(n?!!n.get(t,s):e.root.identifierCache.has(o.targetType,Xn(t)))?i=o.addTargetNodeWatcher(e,t):r||o.fireInvalidated("invalidSnapshotReference",e,t,null)}};e.state===We.FINALIZED?a(!0):(e.isRoot||e.root.registerHook(r.afterCreationFinalization,(function(){e.parent&&e.parent.createObservableInstanceIfNeeded()})),e.registerHook(r.afterAttach,(function(){a(!1)})))}},t}(de),Vn=function(e){function t(t,n){return e.call(this,t,n)||this}return u(t,e),t.prototype.getValue=function(e){if(e.isAlive)return e.storedValue.resolvedValue},t.prototype.getSnapshot=function(e){return e.storedValue.identifier},t.prototype.instantiate=function(e,t,n,r){var o=Xe(r)?F(r):r,i=new In(r,this.targetType),a=Ye(this,e,t,n,i);return i.node=a,this.watchTargetNodeForInvalidations(a,o,void 0),a},t.prototype.reconcile=function(e,t,n,r){if(!e.isDetaching&&e.type===this){var o=Xe(t),i=e.storedValue;if(!o&&i.identifier===t||o&&i.resolvedValue===t)return e.setParent(n,r),e}var a=this.instantiate(n,r,void 0,t);return e.die(),a},t}(zn),Bn=function(e){function t(t,n,r){var o=e.call(this,t,r)||this;return o.options=n,o}return u(t,e),t.prototype.getValue=function(e){if(e.isAlive)return this.options.get(e.storedValue,e.parent?e.parent.storedValue:null)},t.prototype.getSnapshot=function(e){return e.storedValue},t.prototype.instantiate=function(e,t,n,r){var o=Xe(r)?this.options.set(r,e?e.storedValue:null):r,i=Ye(this,e,t,n,o);return this.watchTargetNodeForInvalidations(i,o,this.options),i},t.prototype.reconcile=function(e,t,n,r){var o=Xe(t)?this.options.set(t,e?e.storedValue:null):t;if(!e.isDetaching&&e.type===this&&e.storedValue===o)return e.setParent(n,r),e;var i=this.instantiate(n,r,void 0,o);return e.die(),i},t}(zn);function Un(e,t){pe(e,1);var n=t||void 0,r=t?t.onInvalidated:void 0;return n&&(n.get||n.set)?new Bn(e,{get:n.get,set:n.set},r):new Vn(e,r)}function Hn(e){return(e.flags&ne.Reference)>0}var Wn=function(e){function t(t,n){var r=e.call(this,t)||this;return r.validType=n,r.flags=ne.Identifier,r}return u(t,e),t.prototype.instantiate=function(e,t,n,r){if(!(e&&e.type instanceof on))throw ut("Identifier types can only be instantiated as direct child of a model type");return Ye(this,e,t,n,r)},t.prototype.reconcile=function(e,t,n,r){if(e.storedValue!==t)throw ut("Tried to change identifier from '"+e.storedValue+"' to '"+t+"'. Changing identifiers is not allowed.");return e.setParent(n,r),e},t.prototype.isValidSnapshot=function(e,t){return typeof e!==this.validType?Ve(t,e,"Value is not a valid "+this.describe()+", expected a "+this.validType):ze()},t}(de),Kn=function(e){function t(){var t=e.call(this,"identifier","string")||this;return t.flags=ne.Identifier,t}return u(t,e),t.prototype.describe=function(){return"identifier"},t}(Wn),qn=function(e){function t(){return e.call(this,"identifierNumber","number")||this}return u(t,e),t.prototype.getSnapshot=function(e){return e.storedValue},t.prototype.describe=function(){return"identifierNumber"},t}(Wn),Gn=new Kn,Yn=new qn;function $n(e){return fe(e)&&(e.flags&ne.Identifier)>0}function Xn(e){return""+e}function Qn(e){return"string"==typeof e||"number"==typeof e}var Jn=function(e){function t(t){var n=e.call(this,t.name)||this;return n.options=t,n.flags=ne.Custom,n}return u(t,e),t.prototype.describe=function(){return this.name},t.prototype.isValidSnapshot=function(e,t){if(this.options.isTargetType(e))return ze();var n=this.options.getValidationMessage(e);return n?Ve(t,e,"Invalid value for type '"+this.name+"': "+n):ze()},t.prototype.getSnapshot=function(e){return this.options.toSnapshot(e.storedValue)},t.prototype.instantiate=function(e,t,n,r){return Ye(this,e,t,n,this.options.isTargetType(r)?r:this.options.fromSnapshot(r,e&&e.root.environment))},t.prototype.reconcile=function(e,t,n,r){var o=!this.options.isTargetType(t);if(!e.isDetaching&&(e.type===this&&(o?t===e.snapshot:t===e.storedValue)))return e.setParent(n,r),e;var i=o?this.options.fromSnapshot(t,n.root.environment):t,a=this.instantiate(n,r,void 0,i);return e.die(),a},t}(de),Zn={enumeration:function(e,t){var n="string"==typeof e?t:e,r=Cn.apply(void 0,m(n.map((function(e){return yn(""+e)}))));return"string"==typeof e&&(r.name=e),r},model:function(){for(var e=[],t=0;t",e)},array:function(e){return pe(e,1),new Yt(e.name+"[]",e)},frozen:function(e){return 0===arguments.length?Dn:fe(e)?new jn(e):_n(Dn,e)},identifier:Gn,identifierNumber:Yn,late:function(e,t){var n="string"==typeof e?e:"late("+e.toString()+")",r="string"==typeof e?t:e;return new Mn(n,r)},undefined:pn,null:fn,snapshotProcessor:function(e,t,n){return pe(e,1),new Bt(e,t,n)}}},2188:function(e,t,n){"use strict";n.d(t,{so:function(){return w},vP:function(){return Gt},le:function(){return Ue},$$:function(){return be},vB:function(){return Ee},mJ:function(){return fe},wM:function(){return de},kS:function(){return sn},Nv:function(){return ht},aD:function(){return Je},Fl:function(){return te},jQ:function(){return st},cp:function(){return C},qh:function(){return Ct},qp:function(){return an},Gf:function(){return dt},Su:function(){return gt},eJ:function(){return vt},Ei:function(){return Wt},LJ:function(){return Yt},Pb:function(){return on},wn:function(){return wt},LO:function(){return $},N7:function(){return St},U5:function(){return ot},z:function(){return Ze},t8:function(){return kt},rV:function(){return Ye},rg:function(){return le},VO:function(){return Et}});var r=[];Object.freeze(r);var o={};function i(){return++Ae.mobxGuid}function a(e){throw s(!1,e),"X"}function s(e,t){if(!e)throw new Error("[mobx] "+(t||"An invariant failed, however the error is obfuscated because this is a production build."))}Object.freeze(o);function l(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var c=function(){};function u(e){return null!==e&&"object"==typeof e}function d(e){if(null===e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function f(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function p(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(e){return u(e)&&!0===e[n]}}function h(e){return e instanceof Map}function g(e){return e instanceof Set}function m(e){var t=new Set;for(var n in e)t.add(n);return Object.getOwnPropertySymbols(e).forEach((function(n){Object.getOwnPropertyDescriptor(e,n).enumerable&&t.add(n)})),Array.from(t)}function v(e){return e&&e.toString?e.toString():new String(e).toString()}function y(e){return null===e?null:"object"==typeof e?""+e:e}var b="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,w=Symbol("mobx administration"),x=function(){function e(e){void 0===e&&(e="Atom@"+i()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=Q.NOT_TRACKING}return e.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(e){return e()}))},e.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(e){return e()}))},e.prototype.reportObserved=function(){return ze(this)},e.prototype.reportChanged=function(){Ie(),function(e){if(e.lowestObserverState===Q.STALE)return;e.lowestObserverState=Q.STALE,e.observers.forEach((function(t){t.dependenciesState===Q.UP_TO_DATE&&(t.isTracing!==J.NONE&&Ve(t,e),t.onBecomeStale()),t.dependenciesState=Q.STALE}))}(this),Fe()},e.prototype.toString=function(){return this.name},e}(),E=p("Atom",x);function C(e,t,n){void 0===t&&(t=c),void 0===n&&(n=c);var r,o=new x(e);return t!==c&&at("onBecomeObserved",o,t,r),n!==c&&it(o,n),o}var k={identity:function(e,t){return e===t},structural:function(e,t){return cn(e,t)},default:function(e,t){return Object.is(e,t)},shallow:function(e,t){return cn(e,t,1)}},S=function(e,t){return(S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var _=function(){return(_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function T(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function P(){for(var e=[],t=0;t2&&X("box");var n=U(t);return new Ce(e,G(n),n.name,!0,n.equals)},array:function(e,t){arguments.length>2&&X("array");var n=U(t);return zt(e,G(n),n.name)},map:function(e,t){arguments.length>2&&X("map");var n=U(t);return new Gt(e,G(n),n.name)},set:function(e,t){arguments.length>2&&X("set");var n=U(t);return new Xt(e,G(n),n.name)},object:function(e,t,n){"string"==typeof arguments[1]&&X("object");var r=U(n);if(!1===r.proxy)return lt({},e,t,r);var o=ct(r),i=lt({},void 0,void 0,r),a=Rt(i);return ut(a,e,t,o),a},ref:K,shallow:W,deep:H,struct:q},$=function(e,t,n){if("string"==typeof arguments[1]||"symbol"==typeof arguments[1])return H.apply(null,arguments);if(bt(e))return e;var r=d(e)?$.object(e,t,n):Array.isArray(e)?$.array(e,t):h(e)?$.map(e,t):g(e)?$.set(e,t):e;if(r!==e)return r;a(!1)};function X(e){a("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(Y).forEach((function(e){return $[e]=Y[e]}));var Q,J,Z=L(!1,(function(e,t,n,r,o){var i=n.get,a=n.set,s=o[0]||{};Zt(e).addComputedProp(e,t,_({get:i,set:a,context:e},s))})),ee=Z({equals:k.structural}),te=function(e,t,n){if("string"==typeof t)return Z.apply(null,arguments);if(null!==e&&"object"==typeof e&&1===arguments.length)return Z.apply(null,arguments);var r="object"==typeof t?t:{};return r.get=e,r.set="function"==typeof t?t:r.set,r.name=r.name||e.name||"",new Se(r)};te.struct=ee,function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"}(Q||(Q={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(J||(J={}));var ne=function(e){this.cause=e};function re(e){return e instanceof ne}function oe(e){switch(e.dependenciesState){case Q.UP_TO_DATE:return!1;case Q.NOT_TRACKING:case Q.STALE:return!0;case Q.POSSIBLY_STALE:for(var t=de(!0),n=ce(),r=e.observing,o=r.length,i=0;i0;Ae.computationDepth>0&&t&&a(!1),Ae.allowStateChanges||!t&&"strict"!==Ae.enforceActions||a(!1)}function ae(e,t,n){var r=de(!0);pe(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++Ae.runId;var o,i=Ae.trackingDerivation;if(Ae.trackingDerivation=e,!0===Ae.disableErrorBoundaries)o=t.call(n);else try{o=t.call(n)}catch(e){o=new ne(e)}return Ae.trackingDerivation=i,function(e){for(var t=e.observing,n=e.observing=e.newObserving,r=Q.UP_TO_DATE,o=0,i=e.unboundDepsCount,a=0;ar&&(r=s.dependenciesState)}n.length=o,e.newObserving=null,i=t.length;for(;i--;){0===(s=t[i]).diffValue&&De(s,e),s.diffValue=0}for(;o--;){var s;1===(s=n[o]).diffValue&&(s.diffValue=0,je(s,e))}r!==Q.UP_TO_DATE&&(e.dependenciesState=r,e.onBecomeStale())}(e),fe(r),o}function se(e){var t=e.observing;e.observing=[];for(var n=t.length;n--;)De(t[n],e);e.dependenciesState=Q.NOT_TRACKING}function le(e){var t=ce();try{return e()}finally{ue(t)}}function ce(){var e=Ae.trackingDerivation;return Ae.trackingDerivation=null,e}function ue(e){Ae.trackingDerivation=e}function de(e){var t=Ae.allowStateReads;return Ae.allowStateReads=e,t}function fe(e){Ae.allowStateReads=e}function pe(e){if(e.dependenciesState!==Q.UP_TO_DATE){e.dependenciesState=Q.UP_TO_DATE;for(var t=e.observing,n=t.length;n--;)t[n].lowestObserverState=Q.UP_TO_DATE}}var he=0,ge=1,me=Object.getOwnPropertyDescriptor((function(){}),"name");me&&me.configurable;function ve(e,t,n){var r=function(){return ye(e,t,n||this,arguments)};return r.isMobxAction=!0,r}function ye(e,t,n,r){var o=function(e,t,n){var r=!1,o=0;var i=ce();Ie();var a=we(!0),s=de(!0),l={prevDerivation:i,prevAllowStateChanges:a,prevAllowStateReads:s,notifySpy:r,startTime:o,actionId:ge++,parentActionId:he};return he=l.actionId,l}();try{return t.apply(n,r)}catch(e){throw o.error=e,e}finally{!function(e){he!==e.actionId&&a("invalid action stack. did you forget to finish an action?");he=e.parentActionId,void 0!==e.error&&(Ae.suppressReactionErrors=!0);xe(e.prevAllowStateChanges),fe(e.prevAllowStateReads),Fe(),ue(e.prevDerivation),e.notifySpy&&!1;Ae.suppressReactionErrors=!1}(o)}}function be(e,t){var n,r=we(e);try{n=t()}finally{xe(r)}return n}function we(e){var t=Ae.allowStateChanges;return Ae.allowStateChanges=e,t}function xe(e){Ae.allowStateChanges=e}function Ee(e){var t,n=Ae.computationDepth;Ae.computationDepth=0;try{t=e()}finally{Ae.computationDepth=n}return t}var Ce=function(e){function t(t,n,r,o,a){void 0===r&&(r="ObservableValue@"+i()),void 0===o&&(o=!0),void 0===a&&(a=k.default);var s=e.call(this,r)||this;return s.enhancer=n,s.name=r,s.equals=a,s.hasUnreportedChange=!1,s.value=n(t,void 0,r),s}return function(e,t){function n(){this.constructor=e}S(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.prototype.set=function(e){this.value;if((e=this.prepareNewValue(e))!==Ae.UNCHANGED){false,this.setNewValue(e)}},t.prototype.prepareNewValue=function(e){if(ie(this),Mt(this)){var t=jt(this,{object:this,type:"update",newValue:e});if(!t)return Ae.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value,this.name),this.equals(this.value,e)?Ae.UNCHANGED:e},t.prototype.setNewValue=function(e){var t=this.value;this.value=e,this.reportChanged(),Dt(this)&&It(this,{type:"update",object:this,newValue:e,oldValue:t})},t.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},t.prototype.intercept=function(e){return At(this,e)},t.prototype.observe=function(e,t){return t&&e({object:this,type:"update",newValue:this.value,oldValue:void 0}),Lt(this,e)},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.value+"]"},t.prototype.valueOf=function(){return y(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t}(x),ke=p("ObservableValue",Ce),Se=function(){function e(e){this.dependenciesState=Q.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=Q.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+i(),this.value=new ne(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=J.NONE,s(e.get,"missing option for computed: get"),this.derivation=e.get,this.name=e.name||"ComputedValue@"+i(),e.set&&(this.setter=ve(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?k.structural:k.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return e.prototype.onBecomeStale=function(){!function(e){if(e.lowestObserverState!==Q.UP_TO_DATE)return;e.lowestObserverState=Q.POSSIBLY_STALE,e.observers.forEach((function(t){t.dependenciesState===Q.UP_TO_DATE&&(t.dependenciesState=Q.POSSIBLY_STALE,t.isTracing!==J.NONE&&Ve(t,e),t.onBecomeStale())}))}(this)},e.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(e){return e()}))},e.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(e){return e()}))},e.prototype.get=function(){this.isComputing&&a("Cycle detected in computation "+this.name+": "+this.derivation),0!==Ae.inBatch||0!==this.observers.size||this.keepAlive?(ze(this),oe(this)&&this.trackAndCompute()&&function(e){if(e.lowestObserverState===Q.STALE)return;e.lowestObserverState=Q.STALE,e.observers.forEach((function(t){t.dependenciesState===Q.POSSIBLY_STALE?t.dependenciesState=Q.STALE:t.dependenciesState===Q.UP_TO_DATE&&(e.lowestObserverState=Q.UP_TO_DATE)}))}(this)):oe(this)&&(this.warnAboutUntrackedRead(),Ie(),this.value=this.computeValue(!1),Fe());var e=this.value;if(re(e))throw e.cause;return e},e.prototype.peek=function(){var e=this.computeValue(!1);if(re(e))throw e.cause;return e},e.prototype.set=function(e){if(this.setter){s(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else s(!1,!1)},e.prototype.trackAndCompute=function(){var e=this.value,t=this.dependenciesState===Q.NOT_TRACKING,n=this.computeValue(!0),r=t||re(e)||re(n)||!this.equals(e,n);return r&&(this.value=n),r},e.prototype.computeValue=function(e){var t;if(this.isComputing=!0,Ae.computationDepth++,e)t=ae(this,this.derivation,this.scope);else if(!0===Ae.disableErrorBoundaries)t=this.derivation.call(this.scope);else try{t=this.derivation.call(this.scope)}catch(e){t=new ne(e)}return Ae.computationDepth--,this.isComputing=!1,t},e.prototype.suspend=function(){this.keepAlive||(se(this),this.value=void 0)},e.prototype.observe=function(e,t){var n=this,r=!0,o=void 0;return tt((function(){var i=n.get();if(!r||t){var a=ce();e({type:"update",object:n,newValue:i,oldValue:o}),ue(a)}r=!1,o=i}))},e.prototype.warnAboutUntrackedRead=function(){},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},e.prototype.valueOf=function(){return y(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e}(),_e=p("ComputedValue",Se),Oe=function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1},Te={};function Pe(){return"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:Te}var Ne,Re=!0,Me=!1,Ae=((Ne=Pe()).__mobxInstanceCount>0&&!Ne.__mobxGlobals&&(Re=!1),Ne.__mobxGlobals&&Ne.__mobxGlobals.version!==(new Oe).version&&(Re=!1),Re?Ne.__mobxGlobals?(Ne.__mobxInstanceCount+=1,Ne.__mobxGlobals.UNCHANGED||(Ne.__mobxGlobals.UNCHANGED={}),Ne.__mobxGlobals):(Ne.__mobxInstanceCount=1,Ne.__mobxGlobals=new Oe):(setTimeout((function(){Me||a("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new Oe));function je(e,t){e.observers.add(t),e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function De(e,t){e.observers.delete(t),0===e.observers.size&&Le(e)}function Le(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,Ae.pendingUnobservations.push(e))}function Ie(){Ae.inBatch++}function Fe(){if(0==--Ae.inBatch){We();for(var e=Ae.pendingUnobservations,t=0;t0&&Le(e),!1)}function Ve(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===J.BREAK){var n=[];Be(dt(e),n,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof Se?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}function Be(e,t,n){t.length>=1e3?t.push("(and many more)"):(t.push(""+new Array(n).join("\t")+e.name),e.dependencies&&e.dependencies.forEach((function(e){return Be(e,t,n+1)})))}var Ue=function(){function e(e,t,n,r){void 0===e&&(e="Reaction@"+i()),void 0===r&&(r=!1),this.name=e,this.onInvalidate=t,this.errorHandler=n,this.requiresObservable=r,this.observing=[],this.newObserving=[],this.dependenciesState=Q.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+i(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=J.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Ae.pendingReactions.push(this),We())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){if(!this.isDisposed){if(Ie(),this._isScheduled=!1,oe(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending}catch(e){this.reportExceptionInDerivation(e)}}Fe()}},e.prototype.track=function(e){if(!this.isDisposed){Ie();false,this._isRunning=!0;var t=ae(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&se(this),re(t)&&this.reportExceptionInDerivation(t.cause),Fe()}},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(Ae.disableErrorBoundaries)throw e;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";Ae.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,e),Ae.globalReactionErrorHandlers.forEach((function(n){return n(e,t)}))}},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Ie(),se(this),Fe()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e[w]=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.trace=function(e){void 0===e&&(e=!1),function(){for(var e=[],t=0;t0||Ae.isRunningReactions||He(Ke)}function Ke(){Ae.isRunningReactions=!0;for(var e=Ae.pendingReactions,t=0;e.length>0;){100==++t&&(console.error("Reaction doesn't converge to a stable state after 100 iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,o=n.length;r",e):2===arguments.length&&"function"==typeof t?ve(e,t):1===arguments.length&&"string"==typeof e?Xe(e):!0!==r?Xe(t).apply(null,arguments):void f(e,t,ve(e.name||t,n.value,this))};function Ze(e,t){"string"==typeof e||e.name;return ye(0,"function"==typeof e?e:t,this,void 0)}function et(e,t,n){f(e,t,ve(t,n.bind(e)))}function tt(e,t){void 0===t&&(t=o);var n,r=t&&t.name||e.name||"Autorun@"+i();if(!t.scheduler&&!t.delay)n=new Ue(r,(function(){this.track(l)}),t.onError,t.requiresObservable);else{var a=rt(t),s=!1;n=new Ue(r,(function(){s||(s=!0,a((function(){s=!1,n.isDisposed||n.track(l)})))}),t.onError,t.requiresObservable)}function l(){e(n)}return n.schedule(),n.getDisposer()}Je.bound=function(e,t,n,r){return!0===r?(et(e,t,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return et(this,t,n.value||n.initializer.call(this)),this[t]},set:$e}:{enumerable:!1,configurable:!0,set:function(e){et(this,t,e)},get:function(){}}};var nt=function(e){return e()};function rt(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:nt}function ot(e,t,n){void 0===n&&(n=o);var r,a,s,l=n.name||"Reaction@"+i(),c=Je(l,n.onError?(r=n.onError,a=t,function(){try{return a.apply(this,arguments)}catch(e){r.call(this,e)}}):t),u=!n.scheduler&&!n.delay,d=rt(n),f=!0,p=!1,h=n.compareStructural?k.structural:n.equals||k.default,g=new Ue(l,(function(){f||u?m():p||(p=!0,d(m))}),n.onError,n.requiresObservable);function m(){if(p=!1,!g.isDisposed){var t=!1;g.track((function(){var n=e(g);t=f||!h(s,n),s=n})),f&&n.fireImmediately&&c(s,g),f||!0!==t||c(s,g),f&&(f=!1)}}return g.schedule(),g.getDisposer()}function it(e,t,n){return at("onBecomeUnobserved",e,t,n)}function at(e,t,n,r){var o="function"==typeof r?an(t,n):an(t),i="function"==typeof r?r:n,s=e+"Listeners";return o[s]?o[s].add(i):o[s]=new Set([i]),"function"!=typeof o[e]?a(!1):function(){var e=o[s];e&&(e.delete(i),0===e.size&&delete o[s])}}function st(e){var t=e.enforceActions,n=e.computedRequiresReaction,r=e.computedConfigurable,o=e.disableErrorBoundaries,i=e.reactionScheduler,s=e.reactionRequiresObservable,l=e.observableRequiresReaction;if(!0===e.isolateGlobalState&&((Ae.pendingReactions.length||Ae.inBatch||Ae.isRunningReactions)&&a("isolateGlobalState should be called before MobX is running any reactions"),Me=!0,Re&&(0==--Pe().__mobxInstanceCount&&(Pe().__mobxGlobals=void 0),Ae=new Oe)),void 0!==t){var c=void 0;switch(t){case!0:case"observed":c=!0;break;case!1:case"never":c=!1;break;case"strict":case"always":c="strict";break;default:a("Invalid value for 'enforceActions': '"+t+"', expected 'never', 'always' or 'observed'")}Ae.enforceActions=c,Ae.allowStateChanges=!0!==c&&"strict"!==c}void 0!==n&&(Ae.computedRequiresReaction=!!n),void 0!==s&&(Ae.reactionRequiresObservable=!!s),void 0!==l&&(Ae.observableRequiresReaction=!!l,Ae.allowStateReads=!Ae.observableRequiresReaction),void 0!==r&&(Ae.computedConfigurable=!!r),void 0!==o&&(!0===o&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),Ae.disableErrorBoundaries=!!o),i&&Ge(i)}function lt(e,t,n,r){var o=ct(r=U(r));return D(e),Zt(e,r.name,o.enhancer),t&&ut(e,t,n,o),e}function ct(e){return e.defaultDecorator||(!1===e.deep?K:H)}function ut(e,t,n,r){var o,i;Ie();try{var a=b(t);try{for(var s=O(a),l=s.next();!l.done;l=s.next()){var c=l.value,u=Object.getOwnPropertyDescriptor(t,c);0;var d=(n&&c in n?n[c]:u.get?Z:r)(e,c,u,!0);d&&Object.defineProperty(e,c,d)}}catch(e){o={error:e}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}}finally{Fe()}}function dt(e,t){return ft(an(e,t))}function ft(e){var t,n,r={name:e.name};return e.observing&&e.observing.length>0&&(r.dependencies=(t=e.observing,n=[],t.forEach((function(e){-1===n.indexOf(e)&&n.push(e)})),n).map(ft)),r}function pt(){this.message="FLOW_CANCELLED"}function ht(e,t,n){var r;if(Yt(e)||Wt(e)||ke(e))r=sn(e);else{if(!on(e))return a(!1);if("string"!=typeof t)return a(!1);r=sn(e,t)}return void 0!==r.dehancer?a(!1):(r.dehancer="function"==typeof t?t:n,function(){r.dehancer=void 0})}function gt(e,t,n){return"function"==typeof n?function(e,t,n){return sn(e,t).intercept(n)}(e,t,n):function(e,t){return sn(e).intercept(t)}(e,t)}function mt(e,t){if(null==e)return!1;if(void 0!==t){if(!1===on(e))return!1;if(!e[w].values.has(t))return!1;var n=an(e,t);return _e(n)}return _e(e)}function vt(e,t){return"string"!=typeof t?a(!1):mt(e,t)}function yt(e,t){return null!=e&&(void 0!==t?!!on(e)&&e[w].values.has(t):on(e)||!!e[w]||E(e)||qe(e)||_e(e))}function bt(e){return 1!==arguments.length&&a(!1),yt(e)}function wt(e,t){return"string"!=typeof t?a(!1):yt(e,t)}function xt(e){return on(e)?e[w].getKeys():Yt(e)||Qt(e)?Array.from(e.keys()):Wt(e)?e.map((function(e,t){return t})):a(!1)}function Et(e){return on(e)?xt(e).map((function(t){return e[t]})):Yt(e)?xt(e).map((function(t){return e.get(t)})):Qt(e)?Array.from(e.values()):Wt(e)?e.slice():a(!1)}function Ct(e){return on(e)?xt(e).map((function(t){return[t,e[t]]})):Yt(e)?xt(e).map((function(t){return[t,e.get(t)]})):Qt(e)?Array.from(e.entries()):Wt(e)?e.map((function(e,t){return[t,e]})):a(!1)}function kt(e,t,n){if(2!==arguments.length||Qt(e))if(on(e)){var r=e[w],o=r.values.get(t);o?r.write(t,n):r.addObservableProp(t,n,r.defaultEnhancer)}else if(Yt(e))e.set(t,n);else if(Qt(e))e.add(t);else{if(!Wt(e))return a(!1);"number"!=typeof t&&(t=parseInt(t,10)),s(t>=0,"Not a valid index: '"+t+"'"),Ie(),t>=e.length&&(e.length=t+1),e[t]=n,Fe()}else{Ie();var i=t;try{for(var l in i)kt(e,l,i[l])}finally{Fe()}}}function St(e,t,n,r){return"function"==typeof n?function(e,t,n,r){return sn(e,t).observe(n,r)}(e,t,n,r):function(e,t,n){return sn(e).observe(t,n)}(e,t,n)}pt.prototype=Object.create(Error.prototype);function _t(e){switch(e.length){case 0:return Ae.trackingDerivation;case 1:return an(e[0]);case 2:return an(e[0],e[1])}}function Ot(e,t){void 0===t&&(t=void 0),Ie();try{return e.apply(t)}finally{Fe()}}function Tt(e){return e[w]}function Pt(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e}var Nt={has:function(e,t){if(t===w||"constructor"===t||t===N)return!0;var n=Tt(e);return Pt(t)?n.has(t):t in e},get:function(e,t){if(t===w||"constructor"===t||t===N)return e[t];var n=Tt(e),r=n.values.get(t);if(r instanceof x){var o=r.get();return void 0===o&&n.has(t),o}return Pt(t)&&n.has(t),e[t]},set:function(e,t,n){return!!Pt(t)&&(kt(e,t,n),!0)},deleteProperty:function(e,t){return!!Pt(t)&&(Tt(e).remove(t),!0)},ownKeys:function(e){return Tt(e).keysAtom.reportObserved(),Reflect.ownKeys(e)},preventExtensions:function(e){return a("Dynamic observable objects cannot be frozen"),!1}};function Rt(e){var t=new Proxy(e,Nt);return e[w].proxy=t,t}function Mt(e){return void 0!==e.interceptors&&e.interceptors.length>0}function At(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),l((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function jt(e,t){var n=ce();try{for(var r=P(e.interceptors||[]),o=0,i=r.length;o0}function Lt(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),l((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function It(e,t){var n=ce(),r=e.changeListeners;if(r){for(var o=0,i=(r=r.slice()).length;o0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return At(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Lt(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var n=new Array(e-t),r=0;ri?e=i:e<0&&(e=Math.max(0,i+e)),t=1===arguments.length?i-e:null==t?0:Math.max(0,Math.min(t,i-e)),void 0===n&&(n=r),Mt(this)){var a=jt(this,{object:this.proxy,type:"splice",index:e,removedCount:t,added:n});if(!a)return r;t=a.removedCount,n=a.added}n=0===n.length?n:n.map((function(e){return o.enhancer(e,void 0)}));var s=this.spliceItemsIntoValues(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice(e,n,s),this.dehanceValues(s)},e.prototype.spliceItemsIntoValues=function(e,t,n){var r;if(n.length<1e4)return(r=this.values).splice.apply(r,P([e,t],n));var o=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(n,this.values.slice(e+t)),o},e.prototype.notifyArrayChildUpdate=function(e,t,n){var r=!this.owned&&!1,o=Dt(this),i=o||r?{object:this.proxy,type:"update",index:e,newValue:t,oldValue:n}:null;this.atom.reportChanged(),o&&It(this,i)},e.prototype.notifyArraySplice=function(e,t,n){var r=!this.owned&&!1,o=Dt(this),i=o||r?{object:this.proxy,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;this.atom.reportChanged(),o&&It(this,i)},e}(),Bt={intercept:function(e){return this[w].intercept(e)},observe:function(e,t){return void 0===t&&(t=!1),this[w].observe(e,t)},clear:function(){return this.splice(0)},replace:function(e){var t=this[w];return t.spliceWithArray(0,t.values.length,e)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(e,t){for(var n=[],r=2;r-1&&(this.splice(n,1),!0)},get:function(e){var t=this[w];if(t){if(e=0&&n++}e=dn(e),t=dn(t);var s="[object Array]"===a;if(!s){if("object"!=typeof e||"object"!=typeof t)return!1;var l=e.constructor,c=t.constructor;if(l!==c&&!("function"==typeof l&&l instanceof l&&"function"==typeof c&&c instanceof c)&&"constructor"in e&&"constructor"in t)return!1}if(0===n)return!1;n<0&&(n=-1),o=o||[];for(var u=(r=r||[]).length;u--;)if(r[u]===e)return o[u]===t;if(r.push(e),o.push(t),s){if((u=e.length)!==t.length)return!1;for(;u--;)if(!un(e[u],t[u],n-1,r,o))return!1}else{var d=Object.keys(e),f=void 0;if(u=d.length,Object.keys(t).length!==u)return!1;for(;u--;)if(!fn(t,f=d[u])||!un(e[f],t[f],n-1,r,o))return!1}return r.pop(),o.pop(),!0}function dn(e){return Wt(e)?e.slice():h(e)||Yt(e)||g(e)||Qt(e)?Array.from(e.entries()):e}function fn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function pn(e){return e[Symbol.iterator]=hn,e}function hn(){return this}if("undefined"==typeof Proxy||"undefined"==typeof Symbol)throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Ye,extras:{getDebugName:function(e,t){return(void 0!==t?an(e,t):on(e)||Yt(e)||Qt(e)?sn(e):an(e)).name}},$mobx:w})},1496:function(e){for(var t=self.crypto||self.msCrypto,n="-_",r=36;r--;)n+=r.toString(36);for(r=36;r---10;)n+=r.toString(36).toUpperCase();e.exports=function(e){var o="",i=t.getRandomValues(new Uint8Array(e||21));for(r=e||21;r--;)o+=n[63&i[r]];return o}},7418:function(e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,s,l=o(e),c=1;c=128?"dark":"light"}function i(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function a(e){function t(){o=(o+n[r=(r+1)%256])%256;var e=n[r];return n[r]=n[o],n[o]=e,n[(n[r]+n[o])%256]}for(var n=[],r=0,o=0,i=0;256>i;i++)n[i]=i;for(var a=0,s=0;256>a;a++){s=(s+n[a]+e.charCodeAt(a%e.length))%256;var l=n[a];n[a]=n[s],n[s]=l}this.random=function(){for(var e=0,n=0,r=1;8>e;e++)n+=t()*r,r*=256;return n/0x10000000000000000}}var s={},l={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",darkgrey:"A9A9A9",darkgreen:"006400",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",grey:"808080",green:"008000",greenyellow:"ADFF2F",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",lightgrey:"D3D3D3",lightgreen:"90EE90",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:"9370D8",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:"D87093",papayawhip:"FFEFD5",peachpuff:"FFDAB9",peru:"CD853F",pink:"FFC0CB",plum:"DDA0DD",powderblue:"B0E0E6",purple:"800080",rebeccapurple:"663399",red:"FF0000",rosybrown:"BC8F8F",royalblue:"4169E1",saddlebrown:"8B4513",salmon:"FA8072",sandybrown:"F4A460",seagreen:"2E8B57",seashell:"FFF5EE",sienna:"A0522D",silver:"C0C0C0",skyblue:"87CEEB",slateblue:"6A5ACD",slategray:"708090",slategrey:"708090",snow:"FFFAFA",springgreen:"00FF7F",steelblue:"4682B4",tan:"D2B48C",teal:"008080",thistle:"D8BFD8",tomato:"FF6347",turquoise:"40E0D0",violet:"EE82EE",wheat:"F5DEB3",white:"FFFFFF",whitesmoke:"F5F5F5",yellow:"FFFF00",yellowgreen:"9ACD32"},c=.618033988749895,u={hue:null,saturation:null,value:null,base_color:"",greyscale:!1,grayscale:!1,golden:!0,full_random:!1,colors_returned:1,format:"hex",seed:null},d={scheme_type:"analogous",format:"hex"},f={golden:!1,format:"hex"};return s.NAME_to_HEX=function(e){return(e=e.toLowerCase())in l?l[e]:void console.error("Color name not recognized.")},s.NAME_to_RGB=function(e){return s.HEX_to_RGB(s.NAME_to_HEX(e))},s.NAME_to_HSV=function(e){return s.HEX_to_HSV(s.NAME_to_HEX(e))},s.HEX_to_RGB=function(e){var t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(t,(function(e,t,n,r){return t+t+n+n+r+r}));var n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null},s.RGB_to_HEX=function(e){return"#"+((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)},s.HSV_to_RGB=function(e){var t,n,r,o,i,a,s,l,c=e.h,u=e.s,d=e.v;if(0===u)return{r:d,g:d,b:d};switch(a=d*(1-u),s=d*(1-u*(i=(c/=60)-(o=Math.floor(c)))),l=d*(1-u*(1-i)),o){case 0:t=d,n=l,r=a;break;case 1:t=s,n=d,r=a;break;case 2:t=a,n=d,r=l;break;case 3:t=a,n=s,r=d;break;case 4:t=l,n=a,r=d;break;case 5:t=d,n=a,r=s}return{r:Math.floor(255*t),g:Math.floor(255*n),b:Math.floor(255*r)}},s.RGB_to_HSV=function(e){var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,Math.min(n,r)),i=Math.max(t,Math.max(n,r));return o===i?{h:0,s:0,v:o}:{h:60*((t===o?3:r===o?1:5)-(t===o?n-r:r===o?t-n:r-t)/(i-o)),s:(i-o)/i,v:i}},s.HSV_to_HEX=function(e){return s.RGB_to_HEX(s.HSV_to_RGB(e))},s.HEX_to_HSV=function(e){return s.RGB_to_HSV(s.HEX_to_RGB(e))},s.make_scheme=function(e,t){function o(e){return{h:e.h,s:e.s,v:e.v}}var a,s,l,c,u,f=i(d);if(null!==t)for(var p in t)t.hasOwnProperty(p)&&(f[p]=t[p]);var h=[e];switch(f.scheme_type.toLowerCase()){case"monochromatic":case"mono":for(u=1;2>=u;u++)l=n(l=(a=o(e)).s+.1*u,0,1),c=n(c=a.v+.1*u,0,1),a.s=l,a.v=c,h.push(a);for(u=1;2>=u;u++)l=n(l=(a=o(e)).s-.1*u,0,1),c=n(c=a.v-.1*u,0,1),a.s=l,a.v=c,h.push(a);break;case"complementary":case"complement":case"comp":(a=o(e)).h=(a.h+180)%360,h.push(a);break;case"split-complementary":case"split-complement":case"split":(a=o(e)).h=(a.h+165)%360,h.push(a),(a=o(e)).h=Math.abs((a.h-165)%360),h.push(a);break;case"double-complementary":case"double-complement":case"double":(a=o(e)).h=(a.h+180)%360,h.push(a),a.h=(a.h+30)%360,s=o(a),h.push(a),a.h=(a.h+180)%360,h.push(s);break;case"analogous":case"ana":for(u=1;5>=u;u++)(a=o(e)).h=(a.h+20*u)%360,h.push(a);break;case"triadic":case"triad":case"tri":for(u=1;3>u;u++)(a=o(e)).h=(a.h+120*u)%360,h.push(a);break;default:console.error("Color scheme not recognized.")}return r(f.format.toLowerCase(),h),h},s.make_color=function(o){var l=[],d=i(u),f=null;if(null!==o)for(var p in o)o.hasOwnProperty(p)&&(d[p]=o[p]);var h=null;"string"==typeof d.seed&&(h=new a(d.seed)),d.base_color.length>0&&(f=d.base_color.match(/^#?([0-9a-f]{3})([0-9a-f]{3})?$/i)?s.HEX_to_HSV(d.base_color):s.NAME_to_HSV(d.base_color));for(var g=0;g