plot-plan-designer
Version:
Design Editor Tools with React.js + ant.design + fabric.js
2 lines • 6.7 MB
JavaScript
/*! For license information please see plot-plan-designer.min.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("plot-plan-designer.js",[],t):"object"==typeof exports?exports["plot-plan-designer.js"]=t():e["plot-plan-designer.js"]=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="./",n(n.s=713)}([function(e,t,n){"use strict";e.exports=n(894)},function(e,t,n){e.exports=n(899)()},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){var n={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},r={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},i=Object.prototype.toString,o=Array.prototype,a=o.forEach,s=o.filter,c=o.slice,l=o.map,u=o.reduce,h={};function d(e){if(null==e||"object"!=typeof e)return e;var t=e,o=i.call(e);if("[object Array]"===o){if(!M(e)){t=[];for(var a=0,s=e.length;a<s;a++)t[a]=d(e[a])}}else if(r[o]){if(!M(e)){var c=e.constructor;if(e.constructor.from)t=c.from(e);else{t=new c(e.length);for(a=0,s=e.length;a<s;a++)t[a]=d(e[a])}}}else if(!n[o]&&!M(e)&&!x(e))for(var l in t={},e)e.hasOwnProperty(l)&&(t[l]=d(e[l]));return t}function f(e,t,n){if(!b(t)||!b(e))return n?d(t):e;for(var r in t)if(t.hasOwnProperty(r)){var i=e[r],o=t[r];!b(o)||!b(i)||w(o)||w(i)||x(o)||x(i)||_(o)||_(i)||M(o)||M(i)?!n&&r in e||(e[r]=d(t[r])):f(i,o,n)}return e}function p(e,t,n){for(var r in t)t.hasOwnProperty(r)&&(n?null!=t[r]:null==e[r])&&(e[r]=t[r]);return e}var v,g=function(){return h.createCanvas()};function m(e,t,n){if(e&&t)if(e.forEach&&e.forEach===a)e.forEach(t,n);else if(e.length===+e.length)for(var r=0,i=e.length;r<i;r++)t.call(n,e[r],r,e);else for(var o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o,e)}function y(e,t){var n=c.call(arguments,2);return function(){return e.apply(t,n.concat(c.call(arguments)))}}function w(e){return"[object Array]"===i.call(e)}function b(e){var t=typeof e;return"function"===t||!!e&&"object"===t}function _(e){return!!n[i.call(e)]}function x(e){return"object"==typeof e&&"number"==typeof e.nodeType&&"object"==typeof e.ownerDocument}h.createCanvas=function(){return document.createElement("canvas")};function M(e){return e.__ec_primitive__}function z(e){var t=w(e);this.data={};var n=this;function r(e,r){t?n.set(e,r):n.set(r,e)}e instanceof z?e.each(r):e&&m(e,r)}z.prototype={constructor:z,get:function(e){return this.data.hasOwnProperty(e)?this.data[e]:null},set:function(e,t){return this.data[e]=t},each:function(e,t){for(var n in void 0!==t&&(e=y(e,t)),this.data)this.data.hasOwnProperty(n)&&e(this.data[n],n)},removeKey:function(e){delete this.data[e]}},t.$override=function(e,t){"createCanvas"===e&&(v=null),h[e]=t},t.clone=d,t.merge=f,t.mergeAll=function(e,t){for(var n=e[0],r=1,i=e.length;r<i;r++)n=f(n,e[r],t);return n},t.extend=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},t.defaults=p,t.createCanvas=g,t.getContext=function(){return v||(v=g().getContext("2d")),v},t.indexOf=function(e,t){if(e){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n}return-1},t.inherits=function(e,t){var n=e.prototype;function r(){}for(var i in r.prototype=t.prototype,e.prototype=new r,n)n.hasOwnProperty(i)&&(e.prototype[i]=n[i]);e.prototype.constructor=e,e.superClass=t},t.mixin=function(e,t,n){p(e="prototype"in e?e.prototype:e,t="prototype"in t?t.prototype:t,n)},t.isArrayLike=function(e){if(e)return"string"!=typeof e&&"number"==typeof e.length},t.each=m,t.map=function(e,t,n){if(e&&t){if(e.map&&e.map===l)return e.map(t,n);for(var r=[],i=0,o=e.length;i<o;i++)r.push(t.call(n,e[i],i,e));return r}},t.reduce=function(e,t,n,r){if(e&&t){if(e.reduce&&e.reduce===u)return e.reduce(t,n,r);for(var i=0,o=e.length;i<o;i++)n=t.call(r,n,e[i],i,e);return n}},t.filter=function(e,t,n){if(e&&t){if(e.filter&&e.filter===s)return e.filter(t,n);for(var r=[],i=0,o=e.length;i<o;i++)t.call(n,e[i],i,e)&&r.push(e[i]);return r}},t.find=function(e,t,n){if(e&&t)for(var r=0,i=e.length;r<i;r++)if(t.call(n,e[r],r,e))return e[r]},t.bind=y,t.curry=function(e){var t=c.call(arguments,1);return function(){return e.apply(this,t.concat(c.call(arguments)))}},t.isArray=w,t.isFunction=function(e){return"function"==typeof e},t.isString=function(e){return"[object String]"===i.call(e)},t.isObject=b,t.isBuiltInObject=_,t.isTypedArray=function(e){return!!r[i.call(e)]},t.isDom=x,t.eqNaN=function(e){return e!=e},t.retrieve=function(e){for(var t=0,n=arguments.length;t<n;t++)if(null!=arguments[t])return arguments[t]},t.retrieve2=function(e,t){return null!=e?e:t},t.retrieve3=function(e,t,n){return null!=e?e:null!=t?t:n},t.slice=function(){return Function.call.apply(c,arguments)},t.normalizeCssArray=function(e){if("number"==typeof e)return[e,e,e,e];var t=e.length;return 2===t?[e[0],e[1],e[0],e[1]]:3===t?[e[0],e[1],e[2],e[1]]:e},t.assert=function(e,t){if(!e)throw new Error(t)},t.trim=function(e){return null==e?null:"function"==typeof e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},t.setAsPrimitive=function(e){e.__ec_primitive__=!0},t.isPrimitive=M,t.createHashMap=function(e){return new z(e)},t.concatArray=function(e,t){for(var n=new e.constructor(e.length+t.length),r=0;r<e.length;r++)n[r]=e[r];var i=e.length;for(r=0;r<t.length;r++)n[r+i]=t[r];return n},t.noop=function(){}},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r)&&r.length){var a=i.apply(null,r);a&&e.push(a)}else if("object"===o)for(var s in r)n.call(r,s)&&r[s]&&e.push(s)}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(r=function(){return i}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){"use strict";t.__esModule=!0;var r,i=n(901),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}},function(e,t,n){(function(e){var r,i,o,a,s,c,l,u,h,d,f,p,v,g,m,y,w,b,_,x,M,z,C=C||{version:"4.3.0"};if(t.fabric=C,"undefined"!=typeof document&&"undefined"!=typeof window)document instanceof("undefined"!=typeof HTMLDocument?HTMLDocument:Document)?C.document=document:C.document=document.implementation.createHTMLDocument(""),C.window=window;else{var S=new(n(1110).JSDOM)(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;C.document=S.document,C.jsdomImplForWrapper=n(1111).implForWrapper,C.nodeCanvas=n(1112).Canvas,C.window=S,DOMParser=C.window.DOMParser}function k(e,t){var n=e.canvas,r=t.targetCanvas,i=r.getContext("2d");i.translate(0,r.height),i.scale(1,-1);var o=n.height-r.height;i.drawImage(n,0,o,r.width,r.height,0,0,r.width,r.height)}function L(e,t){var n=t.targetCanvas.getContext("2d"),r=t.destinationWidth,i=t.destinationHeight,o=r*i*4,a=new Uint8Array(this.imageBuffer,0,o),s=new Uint8ClampedArray(this.imageBuffer,0,o);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,a);var c=new ImageData(s,r,i);n.putImageData(c,0,0)}C.isTouchSupported="ontouchstart"in C.window||"ontouchstart"in C.document||C.window&&C.window.navigator&&C.window.navigator.maxTouchPoints>0,C.isLikelyNode=void 0!==e&&"undefined"==typeof window,C.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],C.DPI=96,C.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",C.commaWsp="(?:\\s+,?\\s*|,\\s*)",C.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,C.reNonWord=/[ \n\.,;!\?\-]/,C.fontPaths={},C.iMatrix=[1,0,0,1,0,0],C.svgNS="http://www.w3.org/2000/svg",C.perfLimitSizeTotal=2097152,C.maxCacheSideLimit=4096,C.minCacheSideLimit=256,C.charWidthsCache={},C.textureSize=2048,C.disableStyleCopyPaste=!1,C.enableGLFiltering=!0,C.devicePixelRatio=C.window.devicePixelRatio||C.window.webkitDevicePixelRatio||C.window.mozDevicePixelRatio||1,C.browserShadowBlurConstant=1,C.arcToSegmentsCache={},C.boundsOfCurveCache={},C.cachesBoundsOfCurve=!0,C.forceGLPutImageData=!1,C.initFilterBackend=function(){return C.enableGLFiltering&&C.isWebglSupported&&C.isWebglSupported(C.textureSize)?(console.log("max texture size: "+C.maxTextureSize),new C.WebglFilterBackend({tileSize:C.textureSize})):C.Canvas2dFilterBackend?new C.Canvas2dFilterBackend:void 0},"undefined"!=typeof document&&"undefined"!=typeof window&&(window.fabric=C),function(){function e(e,t){if(this.__eventListeners[e]){var n=this.__eventListeners[e];t?n[n.indexOf(t)]=!1:C.util.array.fill(n,!1)}}C.Observable={fire:function(e,t){if(!this.__eventListeners)return this;var n=this.__eventListeners[e];if(!n)return this;for(var r=0,i=n.length;r<i;r++)n[r]&&n[r].call(this,t||{});return this.__eventListeners[e]=n.filter((function(e){return!1!==e})),this},on:function(e,t){if(this.__eventListeners||(this.__eventListeners={}),1===arguments.length)for(var n in e)this.on(n,e[n]);else this.__eventListeners[e]||(this.__eventListeners[e]=[]),this.__eventListeners[e].push(t);return this},off:function(t,n){if(!this.__eventListeners)return this;if(0===arguments.length)for(t in this.__eventListeners)e.call(this,t);else if(1===arguments.length&&"object"==typeof arguments[0])for(var r in t)e.call(this,r,t[r]);else e.call(this,t,n);return this}}}(),C.Collection={_objects:[],add:function(){if(this._objects.push.apply(this._objects,arguments),this._onObjectAdded)for(var e=0,t=arguments.length;e<t;e++)this._onObjectAdded(arguments[e]);return this.renderOnAddRemove&&this.requestRenderAll(),this},insertAt:function(e,t,n){var r=this._objects;return n?r[t]=e:r.splice(t,0,e),this._onObjectAdded&&this._onObjectAdded(e),this.renderOnAddRemove&&this.requestRenderAll(),this},remove:function(){for(var e,t=this._objects,n=!1,r=0,i=arguments.length;r<i;r++)-1!==(e=t.indexOf(arguments[r]))&&(n=!0,t.splice(e,1),this._onObjectRemoved&&this._onObjectRemoved(arguments[r]));return this.renderOnAddRemove&&n&&this.requestRenderAll(),this},forEachObject:function(e,t){for(var n=this.getObjects(),r=0,i=n.length;r<i;r++)e.call(t,n[r],r,n);return this},getObjects:function(e){return void 0===e?this._objects.concat():this._objects.filter((function(t){return t.type===e}))},item:function(e){return this._objects[e]},isEmpty:function(){return 0===this._objects.length},size:function(){return this._objects.length},contains:function(e){return this._objects.indexOf(e)>-1},complexity:function(){return this._objects.reduce((function(e,t){return e+=t.complexity?t.complexity():0}),0)}},C.CommonMethods={_setOptions:function(e){for(var t in e)this.set(t,e[t])},_initGradient:function(e,t){!e||!e.colorStops||e instanceof C.Gradient||this.set(t,new C.Gradient(e))},_initPattern:function(e,t,n){!e||!e.source||e instanceof C.Pattern?n&&n():this.set(t,new C.Pattern(e,n))},_setObject:function(e){for(var t in e)this._set(t,e[t])},set:function(e,t){return"object"==typeof e?this._setObject(e):this._set(e,t),this},_set:function(e,t){this[e]=t},toggle:function(e){var t=this.get(e);return"boolean"==typeof t&&this.set(e,!t),this},get:function(e){return this[e]}},r=t,i=Math.sqrt,o=Math.atan2,a=Math.pow,s=Math.PI/180,c=Math.PI/2,C.util={cos:function(e){if(0===e)return 1;switch(e<0&&(e=-e),e/c){case 1:case 3:return 0;case 2:return-1}return Math.cos(e)},sin:function(e){if(0===e)return 0;var t=1;switch(e<0&&(t=-1),e/c){case 1:return t;case 2:return 0;case 3:return-t}return Math.sin(e)},removeFromArray:function(e,t){var n=e.indexOf(t);return-1!==n&&e.splice(n,1),e},getRandomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e},degreesToRadians:function(e){return e*s},radiansToDegrees:function(e){return e/s},rotatePoint:function(e,t,n){e.subtractEquals(t);var r=C.util.rotateVector(e,n);return new C.Point(r.x,r.y).addEquals(t)},rotateVector:function(e,t){var n=C.util.sin(t),r=C.util.cos(t);return{x:e.x*r-e.y*n,y:e.x*n+e.y*r}},transformPoint:function(e,t,n){return n?new C.Point(t[0]*e.x+t[2]*e.y,t[1]*e.x+t[3]*e.y):new C.Point(t[0]*e.x+t[2]*e.y+t[4],t[1]*e.x+t[3]*e.y+t[5])},makeBoundingBoxFromPoints:function(e,t){if(t)for(var n=0;n<e.length;n++)e[n]=C.util.transformPoint(e[n],t);var r=[e[0].x,e[1].x,e[2].x,e[3].x],i=C.util.array.min(r),o=C.util.array.max(r)-i,a=[e[0].y,e[1].y,e[2].y,e[3].y],s=C.util.array.min(a);return{left:i,top:s,width:o,height:C.util.array.max(a)-s}},invertTransform:function(e){var t=1/(e[0]*e[3]-e[1]*e[2]),n=[t*e[3],-t*e[1],-t*e[2],t*e[0]],r=C.util.transformPoint({x:e[4],y:e[5]},n,!0);return n[4]=-r.x,n[5]=-r.y,n},toFixed:function(e,t){return parseFloat(Number(e).toFixed(t))},parseUnit:function(e,t){var n=/\D{0,2}$/.exec(e),r=parseFloat(e);switch(t||(t=C.Text.DEFAULT_SVG_FONT_SIZE),n[0]){case"mm":return r*C.DPI/25.4;case"cm":return r*C.DPI/2.54;case"in":return r*C.DPI;case"pt":return r*C.DPI/72;case"pc":return r*C.DPI/72*12;case"em":return r*t;default:return r}},falseFunction:function(){return!1},getKlass:function(e,t){return e=C.util.string.camelize(e.charAt(0).toUpperCase()+e.slice(1)),C.util.resolveNamespace(t)[e]},getSvgAttributes:function(e){var t=["instantiated_by_use","style","id","class"];switch(e){case"linearGradient":t=t.concat(["x1","y1","x2","y2","gradientUnits","gradientTransform"]);break;case"radialGradient":t=t.concat(["gradientUnits","gradientTransform","cx","cy","r","fx","fy","fr"]);break;case"stop":t=t.concat(["offset","stop-color","stop-opacity"])}return t},resolveNamespace:function(e){if(!e)return C;var t,n=e.split("."),i=n.length,o=r||C.window;for(t=0;t<i;++t)o=o[n[t]];return o},loadImage:function(e,t,n,r){if(e){var i=C.util.createImage(),o=function(){t&&t.call(n,i,!1),i=i.onload=i.onerror=null};i.onload=o,i.onerror=function(){C.log("Error loading "+i.src),t&&t.call(n,null,!0),i=i.onload=i.onerror=null},0!==e.indexOf("data")&&null!=r&&(i.crossOrigin=r),"data:image/svg"===e.substring(0,14)&&(i.onload=null,C.util.loadImageInDom(i,o)),i.src=e}else t&&t.call(n,e)},loadImageInDom:function(e,t){var n=C.document.createElement("div");n.style.width=n.style.height="1px",n.style.left=n.style.top="-100%",n.style.position="absolute",n.appendChild(e),C.document.querySelector("body").appendChild(n),e.onload=function(){t(),n.parentNode.removeChild(n),n=null}},enlivenObjects:function(e,t,n,r){var i=[],o=0,a=(e=e||[]).length;function s(){++o===a&&t&&t(i.filter((function(e){return e})))}a?e.forEach((function(e,t){e&&e.type?C.util.getKlass(e.type,n).fromObject(e,(function(n,o){o||(i[t]=n),r&&r(e,n,o),s()})):s()})):t&&t(i)},enlivenPatterns:function(e,t){function n(){++i===o&&t&&t(r)}var r=[],i=0,o=(e=e||[]).length;o?e.forEach((function(e,t){e&&e.source?new C.Pattern(e,(function(e){r[t]=e,n()})):(r[t]=e,n())})):t&&t(r)},groupSVGElements:function(e,t,n){var r;return e&&1===e.length?e[0]:(t&&(t.width&&t.height?t.centerPoint={x:t.width/2,y:t.height/2}:(delete t.width,delete t.height)),r=new C.Group(e,t),void 0!==n&&(r.sourcePath=n),r)},populateWithProperties:function(e,t,n){if(n&&"[object Array]"===Object.prototype.toString.call(n))for(var r=0,i=n.length;r<i;r++)n[r]in e&&(t[n[r]]=e[n[r]])},drawDashedLine:function(e,t,n,r,a,s){var c=r-t,l=a-n,u=i(c*c+l*l),h=o(l,c),d=s.length,f=0,p=!0;for(e.save(),e.translate(t,n),e.moveTo(0,0),e.rotate(h),t=0;u>t;)(t+=s[f++%d])>u&&(t=u),e[p?"lineTo":"moveTo"](t,0),p=!p;e.restore()},createCanvasElement:function(){return C.document.createElement("canvas")},copyCanvasElement:function(e){var t=C.util.createCanvasElement();return t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t},toDataURL:function(e,t,n){return e.toDataURL("image/"+t,n)},createImage:function(){return C.document.createElement("img")},multiplyTransformMatrices:function(e,t,n){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],n?0:e[0]*t[4]+e[2]*t[5]+e[4],n?0:e[1]*t[4]+e[3]*t[5]+e[5]]},qrDecompose:function(e){var t=o(e[1],e[0]),n=a(e[0],2)+a(e[1],2),r=i(n),c=(e[0]*e[3]-e[2]*e[1])/r,l=o(e[0]*e[2]+e[1]*e[3],n);return{angle:t/s,scaleX:r,scaleY:c,skewX:l/s,skewY:0,translateX:e[4],translateY:e[5]}},calcRotateMatrix:function(e){if(!e.angle)return C.iMatrix.concat();var t=C.util.degreesToRadians(e.angle),n=C.util.cos(t),r=C.util.sin(t);return[n,r,-r,n,0,0]},calcDimensionsMatrix:function(e){var t=void 0===e.scaleX?1:e.scaleX,n=void 0===e.scaleY?1:e.scaleY,r=[e.flipX?-t:t,0,0,e.flipY?-n:n,0,0],i=C.util.multiplyTransformMatrices,o=C.util.degreesToRadians;return e.skewX&&(r=i(r,[1,0,Math.tan(o(e.skewX)),1],!0)),e.skewY&&(r=i(r,[1,Math.tan(o(e.skewY)),0,1],!0)),r},composeMatrix:function(e){var t=[1,0,0,1,e.translateX||0,e.translateY||0],n=C.util.multiplyTransformMatrices;return e.angle&&(t=n(t,C.util.calcRotateMatrix(e))),(1!==e.scaleX||1!==e.scaleY||e.skewX||e.skewY||e.flipX||e.flipY)&&(t=n(t,C.util.calcDimensionsMatrix(e))),t},resetObjectTransform:function(e){e.scaleX=1,e.scaleY=1,e.skewX=0,e.skewY=0,e.flipX=!1,e.flipY=!1,e.rotate(0)},saveObjectTransform:function(e){return{scaleX:e.scaleX,scaleY:e.scaleY,skewX:e.skewX,skewY:e.skewY,angle:e.angle,left:e.left,flipX:e.flipX,flipY:e.flipY,top:e.top}},isTransparent:function(e,t,n,r){r>0&&(t>r?t-=r:t=0,n>r?n-=r:n=0);var i,o=!0,a=e.getImageData(t,n,2*r||1,2*r||1),s=a.data.length;for(i=3;i<s&&!1!=(o=a.data[i]<=0);i+=4);return a=null,o},parsePreserveAspectRatioAttribute:function(e){var t,n="meet",r=e.split(" ");return r&&r.length&&("meet"!==(n=r.pop())&&"slice"!==n?(t=n,n="meet"):r.length&&(t=r.pop())),{meetOrSlice:n,alignX:"none"!==t?t.slice(1,4):"none",alignY:"none"!==t?t.slice(5,8):"none"}},clearFabricFontCache:function(e){(e=(e||"").toLowerCase())?C.charWidthsCache[e]&&delete C.charWidthsCache[e]:C.charWidthsCache={}},limitDimsByArea:function(e,t){var n=Math.sqrt(t*e),r=Math.floor(t/n);return{x:Math.floor(n),y:r}},capValue:function(e,t,n){return Math.max(e,Math.min(t,n))},findScaleToFit:function(e,t){return Math.min(t.width/e.width,t.height/e.height)},findScaleToCover:function(e,t){return Math.max(t.width/e.width,t.height/e.height)},matrixToSVG:function(e){return"matrix("+e.map((function(e){return C.util.toFixed(e,C.Object.NUM_FRACTION_DIGITS)})).join(" ")+")"},sizeAfterTransform:function(e,t,n){var r=e/2,i=t/2,o=[{x:-r,y:-i},{x:r,y:-i},{x:-r,y:i},{x:r,y:i}],a=C.util.calcDimensionsMatrix(n),s=C.util.makeBoundingBoxFromPoints(o,a);return{x:s.width,y:s.height}}},function(){var e=Array.prototype.join,t={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},n={m:"l",M:"L"};function r(e,t,n,r,i,o,a,s,c,l,u){var h=C.util.cos(e),d=C.util.sin(e),f=C.util.cos(t),p=C.util.sin(t),v=n*i*f-r*o*p+a,g=r*i*f+n*o*p+s;return["C",l+c*(-n*i*d-r*o*h),u+c*(-r*i*d+n*o*h),v+c*(n*i*p+r*o*f),g+c*(r*i*p-n*o*f),v,g]}function i(e,t,n,i,a,s,c){var l=Math.PI,u=c*l/180,h=C.util.sin(u),d=C.util.cos(u),f=0,p=0,v=-d*e*.5-h*t*.5,g=-d*t*.5+h*e*.5,m=(n=Math.abs(n))*n,y=(i=Math.abs(i))*i,w=g*g,b=v*v,_=m*y-m*w-y*b,x=0;if(_<0){var M=Math.sqrt(1-_/(m*y));n*=M,i*=M}else x=(a===s?-1:1)*Math.sqrt(_/(m*w+y*b));var z=x*n*g/i,S=-x*i*v/n,k=d*z-h*S+.5*e,L=h*z+d*S+.5*t,T=o(1,0,(v-z)/n,(g-S)/i),O=o((v-z)/n,(g-S)/i,(-v-z)/n,(-g-S)/i);0===s&&O>0?O-=2*l:1===s&&O<0&&(O+=2*l);for(var A=Math.ceil(Math.abs(O/l*2)),H=[],E=O/A,P=8/3*Math.sin(E/4)*Math.sin(E/4)/Math.sin(E/2),V=T+E,D=0;D<A;D++)H[D]=r(T,V,d,h,n,i,k,L,P,f,p),f=H[D][5],p=H[D][6],T=V,V+=E;return H}function o(e,t,n,r){var i=Math.atan2(t,e),o=Math.atan2(r,n);return o>=i?o-i:2*Math.PI-(i-o)}function a(t,n,r,i,o,a,s,c){var l;if(C.cachesBoundsOfCurve&&(l=e.call(arguments),C.boundsOfCurveCache[l]))return C.boundsOfCurveCache[l];var u,h,d,f,p,v,g,m,y=Math.sqrt,w=Math.min,b=Math.max,_=Math.abs,x=[],M=[[],[]];h=6*t-12*r+6*o,u=-3*t+9*r-9*o+3*s,d=3*r-3*t;for(var z=0;z<2;++z)if(z>0&&(h=6*n-12*i+6*a,u=-3*n+9*i-9*a+3*c,d=3*i-3*n),_(u)<1e-12){if(_(h)<1e-12)continue;0<(f=-d/h)&&f<1&&x.push(f)}else(g=h*h-4*d*u)<0||(0<(p=(-h+(m=y(g)))/(2*u))&&p<1&&x.push(p),0<(v=(-h-m)/(2*u))&&v<1&&x.push(v));for(var S,k,L,T=x.length,O=T;T--;)S=(L=1-(f=x[T]))*L*L*t+3*L*L*f*r+3*L*f*f*o+f*f*f*s,M[0][T]=S,k=L*L*L*n+3*L*L*f*i+3*L*f*f*a+f*f*f*c,M[1][T]=k;M[0][O]=t,M[1][O]=n,M[0][O+1]=s,M[1][O+1]=c;var A=[{x:w.apply(null,M[0]),y:w.apply(null,M[1])},{x:b.apply(null,M[0]),y:b.apply(null,M[1])}];return C.cachesBoundsOfCurve&&(C.boundsOfCurveCache[l]=A),A}function s(e,t,n){for(var r=n[1],o=n[2],a=n[3],s=n[4],c=n[5],l=i(n[6]-e,n[7]-t,r,o,s,c,a),u=0,h=l.length;u<h;u++)l[u][1]+=e,l[u][2]+=t,l[u][3]+=e,l[u][4]+=t,l[u][5]+=e,l[u][6]+=t;return l}function c(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))}function l(e,t,n,r,i,o,a,s){return function(c){var l,u=(l=c)*l*l,h=function(e){return 3*e*e*(1-e)}(c),d=function(e){return 3*e*(1-e)*(1-e)}(c),f=function(e){return(1-e)*(1-e)*(1-e)}(c);return{x:a*u+i*h+n*d+e*f,y:s*u+o*h+r*d+t*f}}}function u(e,t,n,r,i,o){return function(a){var s,c=(s=a)*s,l=function(e){return 2*e*(1-e)}(a),u=function(e){return(1-e)*(1-e)}(a);return{x:i*c+n*l+e*u,y:o*c+r*l+t*u}}}function h(e,t,n){var r,i,o={x:t,y:n},a=0;for(i=.01;i<=1;i+=.01)r=e(i),a+=c(o.x,o.y,r.x,r.y),o=r;return a}function d(e,t){for(var n,r,i=0,o=0,a=e.iterator,s={x:e.x,y:e.y},l=.01;o<t&&i<=1&&l>1e-4;)n=a(i),(r=c(s.x,s.y,n.x,n.y))+o>t?i-=l/=2:(s=n,i+=l,o+=r);return n}function f(e){for(var t,n,r,i=0,o=e.length,a=0,s=0,d=0,f=0,p=[],v=0;v<o;v++){switch(r={x:a,y:s,command:(t=e[v])[0]},t[0]){case"M":r.length=0,d=a=t[1],f=s=t[2];break;case"L":r.length=c(a,s,t[1],t[2]),a=t[1],s=t[2];break;case"C":n=l(a,s,t[1],t[2],t[3],t[4],t[5],t[6]),r.iterator=n,r.length=h(n,a,s),a=t[5],s=t[6];break;case"Q":n=u(a,s,t[1],t[2],t[3],t[4]),r.iterator=n,r.length=h(n,a,s),a=t[3],s=t[4];break;case"Z":case"z":r.destX=d,r.destY=f,r.length=c(a,s,d,f),a=d,s=f}i+=r.length,p.push(r)}return p.push({length:i,x:a,y:s}),p}C.util.parsePath=function(e){var r,i,o,a,s,c=[],l=[],u=C.rePathCommand,h="[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?\\s*",d="("+h+")"+C.commaWsp,f="([01])"+C.commaWsp+"?",p=new RegExp(d+"?"+d+"?"+d+f+f+d+"?("+h+")","g");if(!e||!e.match)return c;for(var v,g=0,m=(s=e.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi)).length;g<m;g++){a=(r=s[g]).slice(1).trim(),l.length=0;var y=r.charAt(0);if(v=[y],"a"===y.toLowerCase())for(var w;w=p.exec(a);)for(var b=1;b<w.length;b++)l.push(w[b]);else for(;o=u.exec(a);)l.push(o[0]);b=0;for(var _=l.length;b<_;b++)i=parseFloat(l[b]),isNaN(i)||v.push(i);var x=t[y.toLowerCase()],M=n[y]||y;if(v.length-1>x)for(var z=1,S=v.length;z<S;z+=x)c.push([y].concat(v.slice(z,z+x))),y=M;else c.push(v)}return c},C.util.makePathSimpler=function(e){var t,n,r,i,o,a,c=0,l=0,u=e.length,h=0,d=0,f=[];for(n=0;n<u;++n){switch(r=!1,(t=e[n].slice(0))[0]){case"l":t[0]="L",t[1]+=c,t[2]+=l;case"L":c=t[1],l=t[2];break;case"h":t[1]+=c;case"H":t[0]="L",t[2]=l,c=t[1];break;case"v":t[1]+=l;case"V":t[0]="L",l=t[1],t[1]=c,t[2]=l;break;case"m":t[0]="M",t[1]+=c,t[2]+=l;case"M":c=t[1],l=t[2],h=t[1],d=t[2];break;case"c":t[0]="C",t[1]+=c,t[2]+=l,t[3]+=c,t[4]+=l,t[5]+=c,t[6]+=l;case"C":o=t[3],a=t[4],c=t[5],l=t[6];break;case"s":t[0]="S",t[1]+=c,t[2]+=l,t[3]+=c,t[4]+=l;case"S":"C"===i?(o=2*c-o,a=2*l-a):(o=c,a=l),c=t[3],l=t[4],t[0]="C",t[5]=t[3],t[6]=t[4],t[3]=t[1],t[4]=t[2],t[1]=o,t[2]=a,o=t[3],a=t[4];break;case"q":t[0]="Q",t[1]+=c,t[2]+=l,t[3]+=c,t[4]+=l;case"Q":o=t[1],a=t[2],c=t[3],l=t[4];break;case"t":t[0]="T",t[1]+=c,t[2]+=l;case"T":"Q"===i?(o=2*c-o,a=2*l-a):(o=c,a=l),t[0]="Q",c=t[1],l=t[2],t[1]=o,t[2]=a,t[3]=c,t[4]=l;break;case"a":t[0]="A",t[6]+=c,t[7]+=l;case"A":r=!0,f=f.concat(s(c,l,t)),c=t[6],l=t[7];break;case"z":case"Z":c=h,l=d}r||f.push(t),i=t[0]}return f},C.util.getPathSegmentsInfo=f,C.util.fromArcToBeziers=s,C.util.fromArcToBeizers=s,C.util.getBoundsOfCurve=a,C.util.getPointOnPath=function(e,t,n){n||(n=f(e));for(var r=0;t-n[r].length>0&&r<n.length-2;)t-=n[r].length,r++;var i=n[r],o=t/i.length,a=i.command,s=e[r];switch(a){case"M":return{x:i.x,y:i.y};case"Z":case"z":return new C.Point(i.x,i.y).lerp(new C.Point(i.destX,i.destY),o);case"L":return new C.Point(i.x,i.y).lerp(new C.Point(s[1],s[2]),o);case"C":case"Q":return d(i,t)}},C.util.getBoundsOfArc=function(e,t,n,r,o,s,c,l,u){for(var h,d=0,f=0,p=[],v=i(l-e,u-t,n,r,s,c,o),g=0,m=v.length;g<m;g++)h=a(d,f,v[g][1],v[g][2],v[g][3],v[g][4],v[g][5],v[g][6]),p.push({x:h[0].x+e,y:h[0].y+t}),p.push({x:h[1].x+e,y:h[1].y+t}),d=v[g][5],f=v[g][6];return p},C.util.drawArc=function(e,t,n,r){s(t,n,r=r.slice(0).unshift("X")).forEach((function(t){e.bezierCurveTo.apply(e,t.slice(1))}))}}(),function(){var e=Array.prototype.slice;function t(e,t,n){if(e&&0!==e.length){var r=e.length-1,i=t?e[r][t]:e[r];if(t)for(;r--;)n(e[r][t],i)&&(i=e[r][t]);else for(;r--;)n(e[r],i)&&(i=e[r]);return i}}C.util.array={fill:function(e,t){for(var n=e.length;n--;)e[n]=t;return e},invoke:function(t,n){for(var r=e.call(arguments,2),i=[],o=0,a=t.length;o<a;o++)i[o]=r.length?t[o][n].apply(t[o],r):t[o][n].call(t[o]);return i},min:function(e,n){return t(e,n,(function(e,t){return e<t}))},max:function(e,n){return t(e,n,(function(e,t){return e>=t}))}}}(),function(){function e(t,n,r){if(r)if(!C.isLikelyNode&&n instanceof Element)t=n;else if(n instanceof Array){t=[];for(var i=0,o=n.length;i<o;i++)t[i]=e({},n[i],r)}else if(n&&"object"==typeof n)for(var a in n)"canvas"===a||"group"===a?t[a]=null:n.hasOwnProperty(a)&&(t[a]=e({},n[a],r));else t=n;else for(var a in n)t[a]=n[a];return t}C.util.object={extend:e,clone:function(t,n){return e({},t,n)}},C.util.object.extend(C.util,C.Observable)}(),function(){function e(e,t){var n=e.charCodeAt(t);if(isNaN(n))return"";if(n<55296||n>57343)return e.charAt(t);if(55296<=n&&n<=56319){if(e.length<=t+1)throw"High surrogate without following low surrogate";var r=e.charCodeAt(t+1);if(56320>r||r>57343)throw"High surrogate without following low surrogate";return e.charAt(t)+e.charAt(t+1)}if(0===t)throw"Low surrogate without preceding high surrogate";var i=e.charCodeAt(t-1);if(55296>i||i>56319)throw"Low surrogate without preceding high surrogate";return!1}C.util.string={camelize:function(e){return e.replace(/-+(.)?/g,(function(e,t){return t?t.toUpperCase():""}))},capitalize:function(e,t){return e.charAt(0).toUpperCase()+(t?e.slice(1):e.slice(1).toLowerCase())},escapeXml:function(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")},graphemeSplit:function(t){var n,r=0,i=[];for(r=0;r<t.length;r++)!1!==(n=e(t,r))&&i.push(n);return i}}}(),function(){var e=Array.prototype.slice,t=function(){},n=function(){for(var e in{toString:1})if("toString"===e)return!1;return!0}(),r=function(e,t,r){for(var i in t)i in e.prototype&&"function"==typeof e.prototype[i]&&(t[i]+"").indexOf("callSuper")>-1?e.prototype[i]=function(e){return function(){var n=this.constructor.superclass;this.constructor.superclass=r;var i=t[e].apply(this,arguments);if(this.constructor.superclass=n,"initialize"!==e)return i}}(i):e.prototype[i]=t[i],n&&(t.toString!==Object.prototype.toString&&(e.prototype.toString=t.toString),t.valueOf!==Object.prototype.valueOf&&(e.prototype.valueOf=t.valueOf))};function i(){}function o(t){for(var n=null,r=this;r.constructor.superclass;){var i=r.constructor.superclass.prototype[t];if(r[t]!==i){n=i;break}r=r.constructor.superclass.prototype}return n?arguments.length>1?n.apply(this,e.call(arguments,1)):n.call(this):console.log("tried to callSuper "+t+", method not found in prototype chain",this)}C.util.createClass=function(){var n=null,a=e.call(arguments,0);function s(){this.initialize.apply(this,arguments)}"function"==typeof a[0]&&(n=a.shift()),s.superclass=n,s.subclasses=[],n&&(i.prototype=n.prototype,s.prototype=new i,n.subclasses.push(s));for(var c=0,l=a.length;c<l;c++)r(s,a[c],n);return s.prototype.initialize||(s.prototype.initialize=t),s.prototype.constructor=s,s.prototype.callSuper=o,s}}(),l=!!C.document.createElement("div").attachEvent,u=["touchstart","touchmove","touchend"],C.util.addListener=function(e,t,n,r){e&&e.addEventListener(t,n,!l&&r)},C.util.removeListener=function(e,t,n,r){e&&e.removeEventListener(t,n,!l&&r)},C.util.getPointer=function(e){var t=e.target,n=C.util.getScrollLeftTop(t),r=function(e){var t=e.changedTouches;return t&&t[0]?t[0]:e}(e);return{x:r.clientX+n.left,y:r.clientY+n.top}},C.util.isTouchEvent=function(e){return u.indexOf(e.type)>-1||"touch"===e.pointerType},h=C.document.createElement("div"),d="string"==typeof h.style.opacity,f="string"==typeof h.style.filter,p=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,v=function(e){return e},d?v=function(e,t){return e.style.opacity=t,e}:f&&(v=function(e,t){var n=e.style;return e.currentStyle&&!e.currentStyle.hasLayout&&(n.zoom=1),p.test(n.filter)?(t=t>=.9999?"":"alpha(opacity="+100*t+")",n.filter=n.filter.replace(p,t)):n.filter+=" alpha(opacity="+100*t+")",e}),C.util.setStyle=function(e,t){var n=e.style;if(!n)return e;if("string"==typeof t)return e.style.cssText+=";"+t,t.indexOf("opacity")>-1?v(e,t.match(/opacity:\s*(\d?\.?\d*)/)[1]):e;for(var r in t)"opacity"===r?v(e,t[r]):n["float"===r||"cssFloat"===r?void 0===n.styleFloat?"cssFloat":"styleFloat":r]=t[r];return e},function(){var e=Array.prototype.slice;var t,n,r,i,o=function(t){return e.call(t,0)};try{t=o(C.document.childNodes)instanceof Array}catch(e){}function a(e,t){var n=C.document.createElement(e);for(var r in t)"class"===r?n.className=t[r]:"for"===r?n.htmlFor=t[r]:n.setAttribute(r,t[r]);return n}function s(e){for(var t=0,n=0,r=C.document.documentElement,i=C.document.body||{scrollLeft:0,scrollTop:0};e&&(e.parentNode||e.host)&&((e=e.parentNode||e.host)===C.document?(t=i.scrollLeft||r.scrollLeft||0,n=i.scrollTop||r.scrollTop||0):(t+=e.scrollLeft||0,n+=e.scrollTop||0),1!==e.nodeType||"fixed"!==e.style.position););return{left:t,top:n}}t||(o=function(e){for(var t=new Array(e.length),n=e.length;n--;)t[n]=e[n];return t}),n=C.document.defaultView&&C.document.defaultView.getComputedStyle?function(e,t){var n=C.document.defaultView.getComputedStyle(e,null);return n?n[t]:void 0}:function(e,t){var n=e.style[t];return!n&&e.currentStyle&&(n=e.currentStyle[t]),n},r=C.document.documentElement.style,i="userSelect"in r?"userSelect":"MozUserSelect"in r?"MozUserSelect":"WebkitUserSelect"in r?"WebkitUserSelect":"KhtmlUserSelect"in r?"KhtmlUserSelect":"",C.util.makeElementUnselectable=function(e){return void 0!==e.onselectstart&&(e.onselectstart=C.util.falseFunction),i?e.style[i]="none":"string"==typeof e.unselectable&&(e.unselectable="on"),e},C.util.makeElementSelectable=function(e){return void 0!==e.onselectstart&&(e.onselectstart=null),i?e.style[i]="":"string"==typeof e.unselectable&&(e.unselectable=""),e},C.util.setImageSmoothing=function(e,t){e.imageSmoothingEnabled=e.imageSmoothingEnabled||e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled||e.oImageSmoothingEnabled,e.imageSmoothingEnabled=t},C.util.getById=function(e){return"string"==typeof e?C.document.getElementById(e):e},C.util.toArray=o,C.util.addClass=function(e,t){e&&-1===(" "+e.className+" ").indexOf(" "+t+" ")&&(e.className+=(e.className?" ":"")+t)},C.util.makeElement=a,C.util.wrapElement=function(e,t,n){return"string"==typeof t&&(t=a(t,n)),e.parentNode&&e.parentNode.replaceChild(t,e),t.appendChild(e),t},C.util.getScrollLeftTop=s,C.util.getElementOffset=function(e){var t,r,i=e&&e.ownerDocument,o={left:0,top:0},a={left:0,top:0},c={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!i)return a;for(var l in c)a[c[l]]+=parseInt(n(e,l),10)||0;return t=i.documentElement,void 0!==e.getBoundingClientRect&&(o=e.getBoundingClientRect()),r=s(e),{left:o.left+r.left-(t.clientLeft||0)+a.left,top:o.top+r.top-(t.clientTop||0)+a.top}},C.util.getNodeCanvas=function(e){var t=C.jsdomImplForWrapper(e);return t._canvas||t._image},C.util.cleanUpJsdomNode=function(e){if(C.isLikelyNode){var t=C.jsdomImplForWrapper(e);t&&(t._image=null,t._canvas=null,t._currentSrc=null,t._attributes=null,t._classList=null)}}}(),function(){function e(){}C.util.request=function(t,n){n||(n={});var r=n.method?n.method.toUpperCase():"GET",i=n.onComplete||function(){},o=new C.window.XMLHttpRequest,a=n.body||n.parameters;return o.onreadystatechange=function(){4===o.readyState&&(i(o),o.onreadystatechange=e)},"GET"===r&&(a=null,"string"==typeof n.parameters&&(t=function(e,t){return e+(/\?/.test(e)?"&":"?")+t}(t,n.parameters))),o.open(r,t,!0),"POST"!==r&&"PUT"!==r||o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.send(a),o}}(),C.log=console.log,C.warn=console.warn,function(){function e(){return!1}function t(e,t,n,r){return-n*Math.cos(e/r*(Math.PI/2))+n+t}var n=C.window.requestAnimationFrame||C.window.webkitRequestAnimationFrame||C.window.mozRequestAnimationFrame||C.window.oRequestAnimationFrame||C.window.msRequestAnimationFrame||function(e){return C.window.setTimeout(e,1e3/60)},r=C.window.cancelAnimationFrame||C.window.clearTimeout;function i(){return n.apply(C.window,arguments)}C.util.animate=function(n){i((function(r){n||(n={});var o,a=r||+new Date,s=n.duration||500,c=a+s,l=n.onChange||e,u=n.abort||e,h=n.onComplete||e,d=n.easing||t,f="startValue"in n?n.startValue:0,p="endValue"in n?n.endValue:100,v=n.byValue||p-f;n.onStart&&n.onStart(),function e(t){var n=(o=t||+new Date)>c?s:o-a,r=n/s,g=d(n,f,v,s),m=Math.abs((g-f)/v);if(!u())return o>c?(l(p,1,1),void h(p,1,1)):(l(g,m,r),void i(e));h(p,1,1)}(a)}))},C.util.requestAnimFrame=i,C.util.cancelAnimFrame=function(){return r.apply(C.window,arguments)}}(),function(){function e(e,t,n){var r="rgba("+parseInt(e[0]+n*(t[0]-e[0]),10)+","+parseInt(e[1]+n*(t[1]-e[1]),10)+","+parseInt(e[2]+n*(t[2]-e[2]),10);return r+=","+(e&&t?parseFloat(e[3]+n*(t[3]-e[3])):1),r+=")"}C.util.animateColor=function(t,n,r,i){var o=new C.Color(t).getSource(),a=new C.Color(n).getSource(),s=i.onComplete,c=i.onChange;i=i||{},C.util.animate(C.util.object.extend(i,{duration:r||500,startValue:o,endValue:a,byValue:a,easing:function(t,n,r,o){return e(n,r,i.colorEasing?i.colorEasing(t,o):1-Math.cos(t/o*(Math.PI/2)))},onComplete:function(t,n,r){if(s)return s(e(a,a,0),n,r)},onChange:function(t,n,r){if(c){if(Array.isArray(t))return c(e(t,t,0),n,r);c(t,n,r)}}}))}}(),function(){function e(e,t,n,r){return e<Math.abs(t)?(e=t,r=n/4):r=0===t&&0===e?n/(2*Math.PI)*Math.asin(1):n/(2*Math.PI)*Math.asin(t/e),{a:e,c:t,p:n,s:r}}function t(e,t,n){return e.a*Math.pow(2,10*(t-=1))*Math.sin((t*n-e.s)*(2*Math.PI)/e.p)}function n(e,t,n,i){return n-r(i-e,0,n,i)+t}function r(e,t,n,r){return(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t}C.util.ease={easeInQuad:function(e,t,n,r){return n*(e/=r)*e+t},easeOutQuad:function(e,t,n,r){return-n*(e/=r)*(e-2)+t},easeInOutQuad:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t},easeInCubic:function(e,t,n,r){return n*(e/=r)*e*e+t},easeOutCubic:function(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t},easeInOutCubic:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e+t:n/2*((e-=2)*e*e+2)+t},easeInQuart:function(e,t,n,r){return n*(e/=r)*e*e*e+t},easeOutQuart:function(e,t,n,r){return-n*((e=e/r-1)*e*e*e-1)+t},easeInOutQuart:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e+t:-n/2*((e-=2)*e*e*e-2)+t},easeInQuint:function(e,t,n,r){return n*(e/=r)*e*e*e*e+t},easeOutQuint:function(e,t,n,r){return n*((e=e/r-1)*e*e*e*e+1)+t},easeInOutQuint:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t},easeInSine:function(e,t,n,r){return-n*Math.cos(e/r*(Math.PI/2))+n+t},easeOutSine:function(e,t,n,r){return n*Math.sin(e/r*(Math.PI/2))+t},easeInOutSine:function(e,t,n,r){return-n/2*(Math.cos(Math.PI*e/r)-1)+t},easeInExpo:function(e,t,n,r){return 0===e?t:n*Math.pow(2,10*(e/r-1))+t},easeOutExpo:function(e,t,n,r){return e===r?t+n:n*(1-Math.pow(2,-10*e/r))+t},easeInOutExpo:function(e,t,n,r){return 0===e?t:e===r?t+n:(e/=r/2)<1?n/2*Math.pow(2,10*(e-1))+t:n/2*(2-Math.pow(2,-10*--e))+t},easeInCirc:function(e,t,n,r){return-n*(Math.sqrt(1-(e/=r)*e)-1)+t},easeOutCirc:function(e,t,n,r){return n*Math.sqrt(1-(e=e/r-1)*e)+t},easeInOutCirc:function(e,t,n,r){return(e/=r/2)<1?-n/2*(Math.sqrt(1-e*e)-1)+t:n/2*(Math.sqrt(1-(e-=2)*e)+1)+t},easeInElastic:function(n,r,i,o){var a=0;return 0===n?r:1===(n/=o)?r+i:(a||(a=.3*o),-t(e(i,i,a,1.70158),n,o)+r)},easeOutElastic:function(t,n,r,i){var o=0;if(0===t)return n;if(1===(t/=i))return n+r;o||(o=.3*i);var a=e(r,r,o,1.70158);return a.a*Math.pow(2,-10*t)*Math.sin((t*i-a.s)*(2*Math.PI)/a.p)+a.c+n},easeInOutElastic:function(n,r,i,o){var a=0;if(0===n)return r;if(2===(n/=o/2))return r+i;a||(a=o*(.3*1.5));var s=e(i,i,a,1.70158);return n<1?-.5*t(s,n,o)+r:s.a*Math.pow(2,-10*(n-=1))*Math.sin((n*o-s.s)*(2*Math.PI)/s.p)*.5+s.c+r},easeInBack:function(e,t,n,r,i){return void 0===i&&(i=1.70158),n*(e/=r)*e*((i+1)*e-i)+t},easeOutBack:function(e,t,n,r,i){return void 0===i&&(i=1.70158),n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},easeInOutBack:function(e,t,n,r,i){return void 0===i&&(i=1.70158),(e/=r/2)<1?n/2*(e*e*((1+(i*=1.525))*e-i))+t:n/2*((e-=2)*e*((1+(i*=1.525))*e+i)+2)+t},easeInBounce:n,easeOutBounce:r,easeInOutBounce:function(e,t,i,o){return e<o/2?.5*n(2*e,0,i,o)+t:.5*r(2*e-o,0,i,o)+.5*i+t}}}(),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r=t.util.object.clone,i=t.util.toFixed,o=t.util.parseUnit,a=t.util.multiplyTransformMatrices,s={cx:"left",x:"left",r:"radius",cy:"top",y:"top",display:"visible",visibility:"visible",transform:"transformMatrix","fill-opacity":"fillOpacity","fill-rule":"fillRule","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","letter-spacing":"charSpacing","paint-order":"paintFirst","stroke-dasharray":"strokeDashArray","stroke-dashoffset":"strokeDashOffset","stroke-linecap":"strokeLineCap","stroke-linejoin":"strokeLineJoin","stroke-miterlimit":"strokeMiterLimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-decoration":"textDecoration","text-anchor":"textAnchor",opacity:"opacity","clip-path":"clipPath","clip-rule":"clipRule","vector-effect":"strokeUniform","image-rendering":"imageSmoothing"},c={stroke:"strokeOpacity",fill:"fillOpacity"};function l(e){return e in s?s[e]:e}function u(e,n,r,i){var s,c="[object Array]"===Object.prototype.toString.call(n);if("fill"!==e&&"stroke"!==e||"none"!==n){if("strokeUniform"===e)return"non-scaling-stroke"===n;if("strokeDashArray"===e)n="none"===n?null:n.replace(/,/g," ").split(/\s+/).map(parseFloat);else if("transformMatrix"===e)n=r&&r.transformMatrix?a(r.transformMatrix,t.parseTransformAttribute(n)):t.parseTransformAttribute(n);else if("visible"===e)n="none"!==n&&"hidden"!==n,r&&!1===r.visible&&(n=!1);else if("opacity"===e)n=parseFloat(n),r&&void 0!==r.opacity&&(n*=r.opacity);else if("textAnchor"===e)n="start"===n?"left":"end"===n?"right":"center";else if("charSpacing"===e)s=o(n,i)/i*1e3;else if("paintFirst"===e){var l=n.indexOf("fill"),u=n.indexOf("stroke");n="fill";(l>-1&&u>-1&&u<l||-1===l&&u>-1)&&(n="stroke")}else{if("href"===e||"xlink:href"===e||"font"===e)return n;if("imageSmoothing"===e)return"optimizeQuality"===n;s=c?n.map(o):o(n,i)}}else n="";return!c&&isNaN(s)?n:s}function h(e){return new RegExp("^("+e.join("|")+")\\b","i")}function d(e,t){var n,r,i,o,a=[];for(i=0,o=t.length;i<o;i++)n=t[i],r=e.getElementsByTagName(n),a=a.concat(Array.prototype.slice.call(r));return a}function f(e,t){var n,r=!0;return(n=p(e,t.pop()))&&t.length&&(r=function(e,t){var n,r=!0;for(;e.parentNode&&1===e.parentNode.nodeType&&t.length;)r&&(n=t.pop()),e=e.parentNode,r=p(e,n);return 0===t.length}(e,t)),n&&r&&0===t.length}function p(e,t){var n,r,i=e.nodeName,o=e.getAttribute("class"),a=e.getAttribute("id");if(n=new RegExp("^"+i,"i"),t=t.replace(n,""),a&&t.length&&(n=new RegExp("#"+a+"(?![a-zA-Z\\-]+)","i"),t=t.replace(n,"")),o&&t.length)for(r=(o=o.split(" ")).length;r--;)n=new RegExp("\\."+o[r]+"(?![a-zA-Z\\-]+)","i"),t=t.replace(n,"");return 0===t.length}function v(e,t){var n;if(e.getElementById&&(n=e.getElementById(t)),n)return n;var r,i,o,a=e.getElementsByTagName("*");for(i=0,o=a.length;i<o;i++)if(t===(r=a[i]).getAttribute("id"))return r}t.svgValidTagNamesRegEx=h(["path","circle","polygon","polyline","ellipse","rect","line","image","text"]),t.svgViewBoxElementsRegEx=h(["symbol","image","marker","pattern","view","svg"]),t.svgInvalidAncestorsRegEx=h(["pattern","defs","symbol","metadata","clipPath","mask","desc"]),t.svgValidParentsRegEx=h(["symbol","g","a","svg","clipPath","defs"]),t.cssRules={},t.gradientDefs={},t.clipPaths={},t.parseTransformAttribute=function(){function e(e,n,r){e[r]=Math.tan(t.util.degreesToRadians(n[0]))}var n=t.iMatrix,r=t.reNum,i=t.commaWsp,o="(?:"+("(?:(matrix)\\s*\\(\\s*("+r+")"+i+"("+r+")"+i+"("+r+")"+i+"("+r+")"+i+"("+r+")"+i+"("+r+")\\s*\\))")+"|"+("(?:(translate)\\s*\\(\\s*("+r+")(?:"+i+"("+r+"))?\\s*\\))")+"|"+("(?:(scale)\\s*\\(\\s*("+r+")(?:"+i+"("+r+"))?\\s*\\))")+"|"+("(?:(rotate)\\s*\\(\\s*("+r+")(?:"+i+"("+r+")"+i+"("+r+"))?\\s*\\))")+"|"+("(?:(skewX)\\s*\\(\\s*("+r+")\\s*\\))")+"|"+("(?:(skewY)\\s*\\(\\s*("+r+")\\s*\\))")+")",a=new RegExp("^\\s*(?:"+("(?:"+o+"(?:"+i+"*"+o+")*)")+"?)\\s*$"),s=new RegExp(o,"g");return function(r){var i=n.concat(),c=[];if(!r||r&&!a.test(r))return i;r.replace(s,(function(r){var a=new RegExp(o).exec(r).filter((function(e){return!!e})),s=a[1],l=a.slice(2).map(parseFloat);switch(s){case"translate":!function(e,t){e[4]=t[0],2===t.length&&(e[5]=t[1])}(i,l);break;case"rotate":l[0]=t.util.degreesToRadians(l[0]),function(e,n){var r=t.util.cos(n[0]),i=t.util.sin(n[0]),o=0,a=0;3===n.length&&(o=n[1],a=n[2]),e[0]=r,e[1]=i,e[2]=-i,e[3]=r,e[4]=o-(r*o-i*a),e[5]=a-(i*o+r*a)}(i,l);break;case"scale":!function(e,t){var n=t[0],r=2===t.length?t[1]:t[0];e[0]=n,e[3]=r}(i,l);break;case"skewX":e(i,l,2);break;case"skewY":e(i,l,1);break;case"matrix":i=l}c.push(i.concat()),i=n.concat()}));for(var l=c[0];c.length>1;)c.shift(),l=t.util.multiplyTransformMatrices(l,c[0]);return l}}();var g=new RegExp("^\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*$");function m(e){if(t.svgViewBoxElementsRegEx.test(e.nodeName)){var n,r,i,a,s,c,l=e.getAttribute("viewBox"),u=1,h=1,d=e.getAttribute("width"),f=e.getAttribute("height"),p=e.getAttribute("x")||0,v=e.getAttribute("y")||0,m=e.getAttribute("preserveAspectRatio")||"",y=!l||!(l=l.match(g)),w=!d||!f||"100%"===d||"100%"===f,b=y&&w,_={},x="",M=0,z=0;if(_.width=0,_.height=0,_.toBeParsed=b,y&&(p||v)&&"#document"!==e.parentNode.nodeName&&(x=" translate("+o(p)+" "+o(v)+") ",s=(e.getAttribute("transform")||"")+x,e.setAttribute("transform",s),e.removeAttribute("x"),e.removeAttribute("y")),b)return _;if(y)return _.width=o(d),_.height=o(f),_;if(n=-parseFloat(l[1]),r=-parseFloat(l[2]),i=parseFloat(l[3]),a=parseFloat(l[4]),_.minX=n,_.minY=r,_.viewBoxWidth=i,_.viewBoxHeight=a,w?(_.width=i,_.height=a):(_.width=o(d),_.height=o(f),u=_.width/i,h=_.height/a),"none"!==(m=t.util.parsePreserveAspectRatioAttribute(m)).alignX&&("meet"===m.meetOrSlice&&(h=u=u>h?h:u),"slice"===m.meetOrSlice&&(h=u=u>h?u:h),M=_.width-i*u,z=_.height-a*u,"Mid"===m.alignX&&(M/=2),"Mid"===m.alignY&&(z/=2),"Min"===m.alignX&&(M=0),"Min"===m.alignY&&(z=0)),1===u&&1===h&&0===n&&0===r&&0===p&&0===v)return _;if((p||v)&&"#document"!==e.parentNode.nodeName&&(x=" translate("+o(p)+" "+o(v)+") "),s=x+" matrix("+u+" 0 0 "+h+" "+(n*u+M)+" "+(r*h+z)+") ","svg"===e.nodeName){for(c=e.ownerDocument.createElementNS(t.svgNS,"g");e.firstChild;)c.appendChild(e.firstChild);e.appendChild(c)}else(c=e).removeAttribute("x"),c.removeAttribute("y"),s=c.getAttribute("transform")+s;return c.setAttribute("transform",s),_}}function y(e,t){var n=v(e,t.getAttribute("xlink:href").substr(1));if(n&&n.getAttribute("xlink:href")&&y(e,n),["gradientTransform","x1","x2","y1","y2","gradientUnits","cx","cy","r","fx","fy"].forEach((function(e){n&&!t.hasAttribute(e)&&n.hasAttribute(e)&&t.setAttribute(e,n.getAttribute(e))})),!t.children.length)for(var r=n.cloneNode(!0);r.firstChild;)t.appendChild(r.firstChild);t.removeAttribute("xlink:href")}t.parseSVGDocument=function(e,n,i,o){if(e){!function(e){for(var n=d(e,["use","svg:use"]),r=0;n.length&&r<n.length;){var i,o,a,s,c=n[r],l=(c.getAttribute("xlink:href")||c.getAttribute("href")).substr(1),u=c.getAttribute("x")||0,h=c.getAttribute("y")||0,f=v(e,l).cloneNode(!0),p=(f.getAttribute("transform")||"")+" translate("+u+", "+h+")",g=n.length,y=t.svgNS;if(m(f),/^svg$/i.test(f.nodeName)){var w=f.ownerDocument.createElementNS(y,"g");for(o=0,s=(a=f.attributes).length;o<s;o++)i=a.item(o),w.setAttributeNS(y,i.nodeName,i.nodeValue);for(;f.firstChild;)w.appendChild(f.firstChild);f=w}for(o=0,s=(a=c.attributes).length;o<s;o++)"x"!==(i=a.item(o)).nodeName&&"y"!==i.nodeName&&"xlink:href"!==i.nodeName&&"href"!==i.nodeName&&("transform"===i.nodeName?p=i.nodeValue+" "+p:f.setAttribute(i.nodeName,i.nodeValue));f.setAttribute("transform",p),f.setAttribute("instantiated_by_use","1"),f.removeAttribute("id"),c.parentNode.replaceChild(f,c),n.length===g&&r++}}(e);var a,s,c=t.Object.__uid++,l=m(e),u=t.util.toArray(e.getElementsByTagName("*"));if(l.crossOrigin=o&&o.crossOrigin,l.svgUid=c,0===u.length&&t.isLikelyNode){var h=[];for(a=0,s=(u=e.selectNodes('//*[name(.)!="svg"]')).length;a<s;a++)h[a]=u[a];u=h}var f=u.filter((function(e){return m(e),t.svgValidTagNamesRegEx.test(e.nodeName.replace("svg:",""))&&!function(e,t){for(;e&&(e=e.parentNode);)if(e.nodeName&&t.test(e.nodeName.replace("svg:",""))&&!e.getAttribute("instantiated_by_use"))return!0;return!1}(e,t.svgInvalidAncestorsRegEx)}));if(!f||f&&!f.length)n&&n([],{});else{var p={};u.filter((function(e){return"clipPath"===e.nodeName.replace("svg:","")})).forEach((function(e){var n=e.getAttribute("id");p[n]=t.util.toArray(e.getElementsByTagName("*")).filter((function(e){return t.svgValidTagNamesRegEx.test(e.nodeName.replace("svg:",""))}))})),t.gradientDefs[c]=t.getGradientDefs(e),t.cssRules[c]=t.getCSSRules(e),t.clipPaths[c]=p,t.parseElements(f,(function(e,r){n&&(n(e,l,r,u),delete t.gradientDefs[c],delete t.cssRules[c],delete t.clipPaths[c])}),r(l),i,o)}}};var w=new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*("+t.reNum+"(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|"+t.reNum+"))?\\s+(.*)");n(t,{parseFontDeclaration:function(e,t){var n=e.match(w);if(n){var r=n[1],i=n[3],a=n[4],s=n[5],c=n[6];r&&(t.fontStyle=r),i&&(t.fontWeight=isNaN(parseFloat(i))?i:parseFloat(i)),a&&(t.fontSize=o(a)),c&&(t.fontFamily=c),s&&(t.lineHeight="normal"===s?1:s)}},getGradientDefs:function(e){var t,n=d(e,["linearGradient","radialGradient","svg:linearGradient","svg:radialGradient"]),r=0,i={};for(r=n.length;r--;)(t=n[r]).getAttribute("xlink:href")&&y(e,t),i[t.getAttribute("id")]=t;return i},parseAttributes:function(e,r,a){if(e){var s,h,d,p={};void 0===a&&(a=e.getAttribute("svgUid")),e.parentNode&&t.svgValidParentsRegEx.test(e.parentNode.nodeName)&&(p=t.parseAttributes(e.parentNode,r,a));var v=r.reduce((function(t,n){return(s=e.getAttribute(n))&&(t[n]=s),t}),{}),g=n(function(e,n){var r={};for(var i in t.cssRules[n])if(f(e,i.split(" ")))for(var o in t.cssRules[n][i])r[o]=t.cssRules[n][i][o];return r}(e,a),t.parseStyleAttribute(e));v=n(v,g),g["clip-path"]&&e.setAttribute("clip-path",g["clip-path"]),h=d=p.fontSize||t.Text.DEFAULT_SVG_FONT_SIZE,v["font-size"]&&(v["font-size"]=h=o(v["font-size"],d));var m,y,w={};for(var b in v)y=u(m=l(b),v[b],p,h),w[m]=y;w&&w.font&&t.parseFontDeclaration(w.font,w);var _=n(p,w);return t.svgValidParentsRegEx.test(e.nodeName)?_:function(e){for(var n in c)if(void 0!==e[c[n]]&&""!==e[n]){if(void 0===e[n]){if(!t.Object.prototype[n])continue;e[n]=t.Object.prototype[n]}if(0!==e[n].indexOf("url(")){var r=new t.Color(e[n]);e[n]=r.setAlpha(i(r.getAlpha()*e[c[n]],2)).toRgba()}}return e}(_)}},parseElements:function(e,n,r,i,o){new t.ElementsParser(e,n,r,i,o).parse()},parseStyleAttribute:function(e){var t={},n=e.getAttribute("style");return n?("string"==typeof n?function(e,t){var n,r;e.replace(/;\s*$/,"").split(";").forEach((function(e){var i=e.split(":");n=i[0].trim().toLowerCase(),r=i[1].trim(),t[n]=r}))}(n,t):function(e,t){var n,r;for(var i in e)void 0!==e[i]&&(n=i.toLowerCase(),r=e[i],t[n]=r)}(n,t),t):t},parsePointsAttribute:function(e){if(!e)return null;var t,n,r=[];for(t=0,n=(e=(e=e.replace(/,/g," ").trim()).split(/\s+/)).length;t<n;t+=2)r.push({x:parseFloat(e[t]),y:parseFloat(e[t+1])});return r},getCSSRules:function(e){var n,r,i=e.getElementsByTagName("style"),o={};for(n=0,r=i.length;n<r;n++){var a=i[n].textContent;""!==(a=a.replace(/\/\*[\s\S]*?\*\//g,"")).trim()&&a.match(/[^{]*\{[\s\S]*?\}/g).map((function(e){return e.trim()})).forEach((function(e){var i=e.match(/([\s\S]*?)\s*\{([^}]*)\}/),a={},s=i[2].trim().replace(/;$/,"").split(/\s*;\s*/);for(n=0,r=s.length;n<r;n++){var c=s[n].split(/\s*:\s*/),l=c[0],u=c[1];a