gridjs-spreadsheet 23.2.0 → 23.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/xspreadsheet.js CHANGED
@@ -1,12 +1,12 @@
1
- !function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=38)}([function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function i(e){return t.exports=i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.default=t.exports,t.exports.__esModule=!0,i(e)}t.exports=i,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function i(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,i){var n=i(24);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,i){var n=i(13).default,r=i(8);t.exports=function(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return r(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,i){var n=i(16),r=i(21),o=i(15),a=i(18);t.exports=function(t,e){return n(t)||r(t,e)||o(t,e)||a()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,i){var n=i(22),r=i(19),o=i(15),a=i(23);t.exports=function(t){return n(t)||r(t)||o(t)||a()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,i){var n=i(26);function r(){return"undefined"!=typeof Reflect&&Reflect.get?(t.exports=r=Reflect.get,t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=r=function(t,e,i){var r=n(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:i):o.value}},t.exports.default=t.exports,t.exports.__esModule=!0),r.apply(this,arguments)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,i){(function(t){
1
+ !function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=38)}([function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function i(t){return e.exports=i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,i(t)}e.exports=i,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function i(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=i(24);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=i(13).default,r=i(8);e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=i(16),r=i(21),a=i(15),o=i(18);e.exports=function(e,t){return n(e)||r(e,t)||a(e,t)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=i(22),r=i(19),a=i(15),o=i(23);e.exports=function(e){return n(e)||r(e)||a(e)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=i(26);function r(){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=r=Reflect.get,e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e,t,i){var r=n(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(arguments.length<3?e:i):a.value}},e.exports.default=e.exports,e.exports.__esModule=!0),r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){(function(e){
2
2
  /*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */
3
- var n,r,o,a,s,l,c,h,u,f,d,v,g,p,m,y,b,w,x,C,k,_,S=S||{version:"4.6.0"};if(e.fabric=S,"undefined"!=typeof document&&"undefined"!=typeof window)document instanceof("undefined"!=typeof HTMLDocument?HTMLDocument:Document)?S.document=document:S.document=document.implementation.createHTMLDocument(""),S.window=window;else{var T=new(i(32).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;S.document=T.document,S.jsdomImplForWrapper=i(33).implForWrapper,S.nodeCanvas=i(34).Canvas,S.window=T,DOMParser=S.window.DOMParser}function O(t,e){var i=t.canvas,n=e.targetCanvas,r=n.getContext("2d");r.translate(0,n.height),r.scale(1,-1);var o=i.height-n.height;r.drawImage(i,0,o,n.width,n.height,0,0,n.width,n.height)}function E(t,e){var i=e.targetCanvas.getContext("2d"),n=e.destinationWidth,r=e.destinationHeight,o=n*r*4,a=new Uint8Array(this.imageBuffer,0,o),s=new Uint8ClampedArray(this.imageBuffer,0,o);t.readPixels(0,0,n,r,t.RGBA,t.UNSIGNED_BYTE,a);var l=new ImageData(s,n,r);i.putImageData(l,0,0)}S.isTouchSupported="ontouchstart"in S.window||"ontouchstart"in S.document||S.window&&S.window.navigator&&S.window.navigator.maxTouchPoints>0,S.isLikelyNode=void 0!==t&&"undefined"==typeof window,S.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"],S.DPI=96,S.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",S.commaWsp="(?:\\s+,?\\s*|,\\s*)",S.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,S.reNonWord=/[ \n\.,;!\?\-]/,S.fontPaths={},S.iMatrix=[1,0,0,1,0,0],S.svgNS="http://www.w3.org/2000/svg",S.perfLimitSizeTotal=2097152,S.maxCacheSideLimit=4096,S.minCacheSideLimit=256,S.charWidthsCache={},S.textureSize=2048,S.disableStyleCopyPaste=!1,S.enableGLFiltering=!0,S.devicePixelRatio=S.window.devicePixelRatio||S.window.webkitDevicePixelRatio||S.window.mozDevicePixelRatio||1,S.browserShadowBlurConstant=1,S.arcToSegmentsCache={},S.boundsOfCurveCache={},S.cachesBoundsOfCurve=!0,S.forceGLPutImageData=!1,S.initFilterBackend=function(){return S.enableGLFiltering&&S.isWebglSupported&&S.isWebglSupported(S.textureSize)?(console.log("max texture size: "+S.maxTextureSize),new S.WebglFilterBackend({tileSize:S.textureSize})):S.Canvas2dFilterBackend?new S.Canvas2dFilterBackend:void 0},"undefined"!=typeof document&&"undefined"!=typeof window&&(window.fabric=S),function(){function t(t,e){if(this.__eventListeners[t]){var i=this.__eventListeners[t];e?i[i.indexOf(e)]=!1:S.util.array.fill(i,!1)}}function e(t,e){var i=function(){e.apply(this,arguments),this.off(t,i)}.bind(this);this.on(t,i)}S.Observable={fire:function(t,e){if(!this.__eventListeners)return this;var i=this.__eventListeners[t];if(!i)return this;for(var n=0,r=i.length;n<r;n++)i[n]&&i[n].call(this,e||{});return this.__eventListeners[t]=i.filter((function(t){return!1!==t})),this},on:function(t,e){if(this.__eventListeners||(this.__eventListeners={}),1===arguments.length)for(var i in t)this.on(i,t[i]);else this.__eventListeners[t]||(this.__eventListeners[t]=[]),this.__eventListeners[t].push(e);return this},once:function(t,i){if(1===arguments.length)for(var n in t)e.call(this,n,t[n]);else e.call(this,t,i);return this},off:function(e,i){if(!this.__eventListeners)return this;if(0===arguments.length)for(e in this.__eventListeners)t.call(this,e);else if(1===arguments.length&&"object"==typeof arguments[0])for(var n in e)t.call(this,n,e[n]);else t.call(this,e,i);return this}}}(),S.Collection={_objects:[],add:function(){if(this._objects.push.apply(this._objects,arguments),this._onObjectAdded)for(var t=0,e=arguments.length;t<e;t++)this._onObjectAdded(arguments[t]);return this.renderOnAddRemove&&this.requestRenderAll(),this},insertAt:function(t,e,i){var n=this._objects;return i?n[e]=t:n.splice(e,0,t),this._onObjectAdded&&this._onObjectAdded(t),this.renderOnAddRemove&&this.requestRenderAll(),this},remove:function(){for(var t,e=this._objects,i=!1,n=0,r=arguments.length;n<r;n++)-1!==(t=e.indexOf(arguments[n]))&&(i=!0,e.splice(t,1),this._onObjectRemoved&&this._onObjectRemoved(arguments[n]));return this.renderOnAddRemove&&i&&this.requestRenderAll(),this},forEachObject:function(t,e){for(var i=this.getObjects(),n=0,r=i.length;n<r;n++)t.call(e,i[n],n,i);return this},getObjects:function(t){return void 0===t?this._objects.concat():this._objects.filter((function(e){return e.type===t}))},item:function(t){return this._objects[t]},isEmpty:function(){return 0===this._objects.length},size:function(){return this._objects.length},contains:function(t,e){return this._objects.indexOf(t)>-1||!!e&&this._objects.some((function(e){return"function"==typeof e.contains&&e.contains(t,!0)}))},complexity:function(){return this._objects.reduce((function(t,e){return t+=e.complexity?e.complexity():0}),0)}},S.CommonMethods={_setOptions:function(t){for(var e in t)this.set(e,t[e])},_initGradient:function(t,e){!t||!t.colorStops||t instanceof S.Gradient||this.set(e,new S.Gradient(t))},_initPattern:function(t,e,i){!t||!t.source||t instanceof S.Pattern?i&&i():this.set(e,new S.Pattern(t,i))},_setObject:function(t){for(var e in t)this._set(e,t[e])},set:function(t,e){return"object"==typeof t?this._setObject(t):this._set(t,e),this},_set:function(t,e){this[t]=e},toggle:function(t){var e=this.get(t);return"boolean"==typeof e&&this.set(t,!e),this},get:function(t){return this[t]}},n=e,r=Math.sqrt,o=Math.atan2,a=Math.pow,s=Math.PI/180,l=Math.PI/2,S.util={cos:function(t){if(0===t)return 1;switch(t<0&&(t=-t),t/l){case 1:case 3:return 0;case 2:return-1}return Math.cos(t)},sin:function(t){if(0===t)return 0;var e=1;switch(t<0&&(e=-1),t/l){case 1:return e;case 2:return 0;case 3:return-e}return Math.sin(t)},removeFromArray:function(t,e){var i=t.indexOf(e);return-1!==i&&t.splice(i,1),t},getRandomInt:function(t,e){return Math.floor(Math.random()*(e-t+1))+t},degreesToRadians:function(t){return t*s},radiansToDegrees:function(t){return t/s},rotatePoint:function(t,e,i){var n=new S.Point(t.x-e.x,t.y-e.y),r=S.util.rotateVector(n,i);return new S.Point(r.x,r.y).addEquals(e)},rotateVector:function(t,e){var i=S.util.sin(e),n=S.util.cos(e);return{x:t.x*n-t.y*i,y:t.x*i+t.y*n}},transformPoint:function(t,e,i){return i?new S.Point(e[0]*t.x+e[2]*t.y,e[1]*t.x+e[3]*t.y):new S.Point(e[0]*t.x+e[2]*t.y+e[4],e[1]*t.x+e[3]*t.y+e[5])},makeBoundingBoxFromPoints:function(t,e){if(e)for(var i=0;i<t.length;i++)t[i]=S.util.transformPoint(t[i],e);var n=[t[0].x,t[1].x,t[2].x,t[3].x],r=S.util.array.min(n),o=S.util.array.max(n)-r,a=[t[0].y,t[1].y,t[2].y,t[3].y],s=S.util.array.min(a);return{left:r,top:s,width:o,height:S.util.array.max(a)-s}},invertTransform:function(t){var e=1/(t[0]*t[3]-t[1]*t[2]),i=[e*t[3],-e*t[1],-e*t[2],e*t[0]],n=S.util.transformPoint({x:t[4],y:t[5]},i,!0);return i[4]=-n.x,i[5]=-n.y,i},toFixed:function(t,e){return parseFloat(Number(t).toFixed(e))},parseUnit:function(t,e){var i=/\D{0,2}$/.exec(t),n=parseFloat(t);switch(e||(e=S.Text.DEFAULT_SVG_FONT_SIZE),i[0]){case"mm":return n*S.DPI/25.4;case"cm":return n*S.DPI/2.54;case"in":return n*S.DPI;case"pt":return n*S.DPI/72;case"pc":return n*S.DPI/72*12;case"em":return n*e;default:return n}},falseFunction:function(){return!1},getKlass:function(t,e){return t=S.util.string.camelize(t.charAt(0).toUpperCase()+t.slice(1)),S.util.resolveNamespace(e)[t]},getSvgAttributes:function(t){var e=["instantiated_by_use","style","id","class"];switch(t){case"linearGradient":e=e.concat(["x1","y1","x2","y2","gradientUnits","gradientTransform"]);break;case"radialGradient":e=e.concat(["gradientUnits","gradientTransform","cx","cy","r","fx","fy","fr"]);break;case"stop":e=e.concat(["offset","stop-color","stop-opacity"])}return e},resolveNamespace:function(t){if(!t)return S;var e,i=t.split("."),r=i.length,o=n||S.window;for(e=0;e<r;++e)o=o[i[e]];return o},loadImage:function(t,e,i,n){if(t){var r=S.util.createImage(),o=function(){e&&e.call(i,r,!1),r=r.onload=r.onerror=null};r.onload=o,r.onerror=function(){S.log("Error loading "+r.src),e&&e.call(i,null,!0),r=r.onload=r.onerror=null},0!==t.indexOf("data")&&null!=n&&(r.crossOrigin=n),"data:image/svg"===t.substring(0,14)&&(r.onload=null,S.util.loadImageInDom(r,o)),r.src=t}else e&&e.call(i,t)},loadImageInDom:function(t,e){var i=S.document.createElement("div");i.style.width=i.style.height="1px",i.style.left=i.style.top="-100%",i.style.position="absolute",i.appendChild(t),S.document.querySelector("body").appendChild(i),t.onload=function(){e(),i.parentNode.removeChild(i),i=null}},enlivenObjects:function(t,e,i,n){var r=[],o=0,a=(t=t||[]).length;function s(){++o===a&&e&&e(r.filter((function(t){return t})))}a?t.forEach((function(t,e){t&&t.type?S.util.getKlass(t.type,i).fromObject(t,(function(i,o){o||(r[e]=i),n&&n(t,i,o),s()})):s()})):e&&e(r)},enlivenPatterns:function(t,e){function i(){++r===o&&e&&e(n)}var n=[],r=0,o=(t=t||[]).length;o?t.forEach((function(t,e){t&&t.source?new S.Pattern(t,(function(t){n[e]=t,i()})):(n[e]=t,i())})):e&&e(n)},groupSVGElements:function(t,e,i){var n;return t&&1===t.length?t[0]:(e&&(e.width&&e.height?e.centerPoint={x:e.width/2,y:e.height/2}:(delete e.width,delete e.height)),n=new S.Group(t,e),void 0!==i&&(n.sourcePath=i),n)},populateWithProperties:function(t,e,i){if(i&&"[object Array]"===Object.prototype.toString.call(i))for(var n=0,r=i.length;n<r;n++)i[n]in t&&(e[i[n]]=t[i[n]])},drawDashedLine:function(t,e,i,n,a,s){var l=n-e,c=a-i,h=r(l*l+c*c),u=o(c,l),f=s.length,d=0,v=!0;for(t.save(),t.translate(e,i),t.moveTo(0,0),t.rotate(u),e=0;h>e;)(e+=s[d++%f])>h&&(e=h),t[v?"lineTo":"moveTo"](e,0),v=!v;t.restore()},createCanvasElement:function(){return S.document.createElement("canvas")},copyCanvasElement:function(t){var e=S.util.createCanvasElement();return e.width=t.width,e.height=t.height,e.getContext("2d").drawImage(t,0,0),e},toDataURL:function(t,e,i){return t.toDataURL("image/"+e,i)},createImage:function(){return S.document.createElement("img")},multiplyTransformMatrices:function(t,e,i){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],i?0:t[0]*e[4]+t[2]*e[5]+t[4],i?0:t[1]*e[4]+t[3]*e[5]+t[5]]},qrDecompose:function(t){var e=o(t[1],t[0]),i=a(t[0],2)+a(t[1],2),n=r(i),l=(t[0]*t[3]-t[2]*t[1])/n,c=o(t[0]*t[2]+t[1]*t[3],i);return{angle:e/s,scaleX:n,scaleY:l,skewX:c/s,skewY:0,translateX:t[4],translateY:t[5]}},calcRotateMatrix:function(t){if(!t.angle)return S.iMatrix.concat();var e=S.util.degreesToRadians(t.angle),i=S.util.cos(e),n=S.util.sin(e);return[i,n,-n,i,0,0]},calcDimensionsMatrix:function(t){var e=void 0===t.scaleX?1:t.scaleX,i=void 0===t.scaleY?1:t.scaleY,n=[t.flipX?-e:e,0,0,t.flipY?-i:i,0,0],r=S.util.multiplyTransformMatrices,o=S.util.degreesToRadians;return t.skewX&&(n=r(n,[1,0,Math.tan(o(t.skewX)),1],!0)),t.skewY&&(n=r(n,[1,Math.tan(o(t.skewY)),0,1],!0)),n},composeMatrix:function(t){var e=[1,0,0,1,t.translateX||0,t.translateY||0],i=S.util.multiplyTransformMatrices;return t.angle&&(e=i(e,S.util.calcRotateMatrix(t))),(1!==t.scaleX||1!==t.scaleY||t.skewX||t.skewY||t.flipX||t.flipY)&&(e=i(e,S.util.calcDimensionsMatrix(t))),e},resetObjectTransform:function(t){t.scaleX=1,t.scaleY=1,t.skewX=0,t.skewY=0,t.flipX=!1,t.flipY=!1,t.rotate(0)},saveObjectTransform:function(t){return{scaleX:t.scaleX,scaleY:t.scaleY,skewX:t.skewX,skewY:t.skewY,angle:t.angle,left:t.left,flipX:t.flipX,flipY:t.flipY,top:t.top}},isTransparent:function(t,e,i,n){n>0&&(e>n?e-=n:e=0,i>n?i-=n:i=0);var r,o=!0,a=t.getImageData(e,i,2*n||1,2*n||1),s=a.data.length;for(r=3;r<s&&!1!=(o=a.data[r]<=0);r+=4);return a=null,o},parsePreserveAspectRatioAttribute:function(t){var e,i="meet",n=t.split(" ");return n&&n.length&&("meet"!==(i=n.pop())&&"slice"!==i?(e=i,i="meet"):n.length&&(e=n.pop())),{meetOrSlice:i,alignX:"none"!==e?e.slice(1,4):"none",alignY:"none"!==e?e.slice(5,8):"none"}},clearFabricFontCache:function(t){(t=(t||"").toLowerCase())?S.charWidthsCache[t]&&delete S.charWidthsCache[t]:S.charWidthsCache={}},limitDimsByArea:function(t,e){var i=Math.sqrt(e*t),n=Math.floor(e/i);return{x:Math.floor(i),y:n}},capValue:function(t,e,i){return Math.max(t,Math.min(e,i))},findScaleToFit:function(t,e){return Math.min(e.width/t.width,e.height/t.height)},findScaleToCover:function(t,e){return Math.max(e.width/t.width,e.height/t.height)},matrixToSVG:function(t){return"matrix("+t.map((function(t){return S.util.toFixed(t,S.Object.NUM_FRACTION_DIGITS)})).join(" ")+")"},removeTransformFromObject:function(t,e){var i=S.util.invertTransform(e),n=S.util.multiplyTransformMatrices(i,t.calcOwnMatrix());S.util.applyTransformToObject(t,n)},addTransformToObject:function(t,e){S.util.applyTransformToObject(t,S.util.multiplyTransformMatrices(e,t.calcOwnMatrix()))},applyTransformToObject:function(t,e){var i=S.util.qrDecompose(e),n=new S.Point(i.translateX,i.translateY);t.flipX=!1,t.flipY=!1,t.set("scaleX",i.scaleX),t.set("scaleY",i.scaleY),t.skewX=i.skewX,t.skewY=i.skewY,t.angle=i.angle,t.setPositionByOrigin(n,"center","center")},sizeAfterTransform:function(t,e,i){var n=t/2,r=e/2,o=[{x:-n,y:-r},{x:n,y:-r},{x:-n,y:r},{x:n,y:r}],a=S.util.calcDimensionsMatrix(i),s=S.util.makeBoundingBoxFromPoints(o,a);return{x:s.width,y:s.height}}},function(){var t=Array.prototype.join,e={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},i={m:"l",M:"L"};function n(t,e,i,n,r,o,a,s,l,c,h){var u=S.util.cos(t),f=S.util.sin(t),d=S.util.cos(e),v=S.util.sin(e),g=i*r*d-n*o*v+a,p=n*r*d+i*o*v+s;return["C",c+l*(-i*r*f-n*o*u),h+l*(-n*r*f+i*o*u),g+l*(i*r*v+n*o*d),p+l*(n*r*v-i*o*d),g,p]}function r(t,e,i,r,a,s,l){var c=Math.PI,h=l*c/180,u=S.util.sin(h),f=S.util.cos(h),d=0,v=0,g=-f*t*.5-u*e*.5,p=-f*e*.5+u*t*.5,m=(i=Math.abs(i))*i,y=(r=Math.abs(r))*r,b=p*p,w=g*g,x=m*y-m*b-y*w,C=0;if(x<0){var k=Math.sqrt(1-x/(m*y));i*=k,r*=k}else C=(a===s?-1:1)*Math.sqrt(x/(m*b+y*w));var _=C*i*p/r,T=-C*r*g/i,O=f*_-u*T+.5*t,E=u*_+f*T+.5*e,R=o(1,0,(g-_)/i,(p-T)/r),A=o((g-_)/i,(p-T)/r,(-g-_)/i,(-p-T)/r);0===s&&A>0?A-=2*c:1===s&&A<0&&(A+=2*c);for(var I=Math.ceil(Math.abs(A/c*2)),P=[],D=A/I,F=8/3*Math.sin(D/4)*Math.sin(D/4)/Math.sin(D/2),M=R+D,j=0;j<I;j++)P[j]=n(R,M,f,u,i,r,O,E,F,d,v),d=P[j][5],v=P[j][6],R=M,M+=D;return P}function o(t,e,i,n){var r=Math.atan2(e,t),o=Math.atan2(n,i);return o>=r?o-r:2*Math.PI-(r-o)}function a(e,i,n,r,o,a,s,l){var c;if(S.cachesBoundsOfCurve&&(c=t.call(arguments),S.boundsOfCurveCache[c]))return S.boundsOfCurveCache[c];var h,u,f,d,v,g,p,m,y=Math.sqrt,b=Math.min,w=Math.max,x=Math.abs,C=[],k=[[],[]];u=6*e-12*n+6*o,h=-3*e+9*n-9*o+3*s,f=3*n-3*e;for(var _=0;_<2;++_)if(_>0&&(u=6*i-12*r+6*a,h=-3*i+9*r-9*a+3*l,f=3*r-3*i),x(h)<1e-12){if(x(u)<1e-12)continue;0<(d=-f/u)&&d<1&&C.push(d)}else(p=u*u-4*f*h)<0||(0<(v=(-u+(m=y(p)))/(2*h))&&v<1&&C.push(v),0<(g=(-u-m)/(2*h))&&g<1&&C.push(g));for(var T,O,E,R=C.length,A=R;R--;)T=(E=1-(d=C[R]))*E*E*e+3*E*E*d*n+3*E*d*d*o+d*d*d*s,k[0][R]=T,O=E*E*E*i+3*E*E*d*r+3*E*d*d*a+d*d*d*l,k[1][R]=O;k[0][A]=e,k[1][A]=i,k[0][A+1]=s,k[1][A+1]=l;var I=[{x:b.apply(null,k[0]),y:b.apply(null,k[1])},{x:w.apply(null,k[0]),y:w.apply(null,k[1])}];return S.cachesBoundsOfCurve&&(S.boundsOfCurveCache[c]=I),I}function s(t,e,i){for(var n=i[1],o=i[2],a=i[3],s=i[4],l=i[5],c=r(i[6]-t,i[7]-e,n,o,s,l,a),h=0,u=c.length;h<u;h++)c[h][1]+=t,c[h][2]+=e,c[h][3]+=t,c[h][4]+=e,c[h][5]+=t,c[h][6]+=e;return c}function l(t,e,i,n){return Math.sqrt((i-t)*(i-t)+(n-e)*(n-e))}function c(t,e,i,n,r,o,a,s){return function(l){var c,h=(c=l)*c*c,u=function(t){return 3*t*t*(1-t)}(l),f=function(t){return 3*t*(1-t)*(1-t)}(l),d=function(t){return(1-t)*(1-t)*(1-t)}(l);return{x:a*h+r*u+i*f+t*d,y:s*h+o*u+n*f+e*d}}}function h(t,e,i,n,r,o,a,s){return function(l){var c=1-l,h=3*c*c*(i-t)+6*c*l*(r-i)+3*l*l*(a-r),u=3*c*c*(n-e)+6*c*l*(o-n)+3*l*l*(s-o);return Math.atan2(u,h)}}function u(t,e,i,n,r,o){return function(a){var s,l=(s=a)*s,c=function(t){return 2*t*(1-t)}(a),h=function(t){return(1-t)*(1-t)}(a);return{x:r*l+i*c+t*h,y:o*l+n*c+e*h}}}function f(t,e,i,n,r,o){return function(a){var s=1-a,l=2*s*(i-t)+2*a*(r-i),c=2*s*(n-e)+2*a*(o-n);return Math.atan2(c,l)}}function d(t,e,i){var n,r,o={x:e,y:i},a=0;for(r=1;r<=100;r+=1)n=t(r/100),a+=l(o.x,o.y,n.x,n.y),o=n;return a}function v(t,e){for(var i,n,r,o=0,a=0,s=t.iterator,c={x:t.x,y:t.y},h=.01,u=t.angleFinder;a<e&&o<=1&&h>1e-4;)i=s(o),r=o,(n=l(c.x,c.y,i.x,i.y))+a>e?o-=h/=2:(c=i,o+=h,a+=n);return i.angle=u(r),i}function g(t){for(var e,i,n,r,o=0,a=t.length,s=0,v=0,g=0,p=0,m=[],y=0;y<a;y++){switch(n={x:s,y:v,command:(e=t[y])[0]},e[0]){case"M":n.length=0,g=s=e[1],p=v=e[2];break;case"L":n.length=l(s,v,e[1],e[2]),s=e[1],v=e[2];break;case"C":i=c(s,v,e[1],e[2],e[3],e[4],e[5],e[6]),r=h(s,v,e[1],e[2],e[3],e[4],e[5],e[6]),n.iterator=i,n.angleFinder=r,n.length=d(i,s,v),s=e[5],v=e[6];break;case"Q":i=u(s,v,e[1],e[2],e[3],e[4]),r=f(s,v,e[1],e[2],e[3],e[4]),n.iterator=i,n.angleFinder=r,n.length=d(i,s,v),s=e[3],v=e[4];break;case"Z":case"z":n.destX=g,n.destY=p,n.length=l(s,v,g,p),s=g,v=p}o+=n.length,m.push(n)}return m.push({length:o,x:s,y:v}),m}S.util.joinPath=function(t){return t.map((function(t){return t.join(" ")})).join(" ")},S.util.parsePath=function(t){var n,r,o,a,s,l=[],c=[],h=S.rePathCommand,u="[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?\\s*",f="("+u+")"+S.commaWsp,d="([01])"+S.commaWsp+"?",v=new RegExp(f+"?"+f+"?"+f+d+d+f+"?("+u+")","g");if(!t||!t.match)return l;for(var g,p=0,m=(s=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi)).length;p<m;p++){a=(n=s[p]).slice(1).trim(),c.length=0;var y=n.charAt(0);if(g=[y],"a"===y.toLowerCase())for(var b;b=v.exec(a);)for(var w=1;w<b.length;w++)c.push(b[w]);else for(;o=h.exec(a);)c.push(o[0]);w=0;for(var x=c.length;w<x;w++)r=parseFloat(c[w]),isNaN(r)||g.push(r);var C=e[y.toLowerCase()],k=i[y]||y;if(g.length-1>C)for(var _=1,T=g.length;_<T;_+=C)l.push([y].concat(g.slice(_,_+C))),y=k;else l.push(g)}return l},S.util.makePathSimpler=function(t){var e,i,n,r,o,a,l=0,c=0,h=t.length,u=0,f=0,d=[];for(i=0;i<h;++i){switch(n=!1,(e=t[i].slice(0))[0]){case"l":e[0]="L",e[1]+=l,e[2]+=c;case"L":l=e[1],c=e[2];break;case"h":e[1]+=l;case"H":e[0]="L",e[2]=c,l=e[1];break;case"v":e[1]+=c;case"V":e[0]="L",c=e[1],e[1]=l,e[2]=c;break;case"m":e[0]="M",e[1]+=l,e[2]+=c;case"M":l=e[1],c=e[2],u=e[1],f=e[2];break;case"c":e[0]="C",e[1]+=l,e[2]+=c,e[3]+=l,e[4]+=c,e[5]+=l,e[6]+=c;case"C":o=e[3],a=e[4],l=e[5],c=e[6];break;case"s":e[0]="S",e[1]+=l,e[2]+=c,e[3]+=l,e[4]+=c;case"S":"C"===r?(o=2*l-o,a=2*c-a):(o=l,a=c),l=e[3],c=e[4],e[0]="C",e[5]=e[3],e[6]=e[4],e[3]=e[1],e[4]=e[2],e[1]=o,e[2]=a,o=e[3],a=e[4];break;case"q":e[0]="Q",e[1]+=l,e[2]+=c,e[3]+=l,e[4]+=c;case"Q":o=e[1],a=e[2],l=e[3],c=e[4];break;case"t":e[0]="T",e[1]+=l,e[2]+=c;case"T":"Q"===r?(o=2*l-o,a=2*c-a):(o=l,a=c),e[0]="Q",l=e[1],c=e[2],e[1]=o,e[2]=a,e[3]=l,e[4]=c;break;case"a":e[0]="A",e[6]+=l,e[7]+=c;case"A":n=!0,d=d.concat(s(l,c,e)),l=e[6],c=e[7];break;case"z":case"Z":l=u,c=f}n||d.push(e),r=e[0]}return d},S.util.getSmoothPathFromPoints=function(t,e){var i,n=[],r=new S.Point(t[0].x,t[0].y),o=new S.Point(t[1].x,t[1].y),a=t.length,s=1,l=0,c=a>2;for(e=e||0,c&&(s=t[2].x<o.x?-1:t[2].x===o.x?0:1,l=t[2].y<o.y?-1:t[2].y===o.y?0:1),n.push(["M",r.x-s*e,r.y-l*e]),i=1;i<a;i++){if(!r.eq(o)){var h=r.midPointFrom(o);n.push(["Q",r.x,r.y,h.x,h.y])}r=t[i],i+1<t.length&&(o=t[i+1])}return c&&(s=r.x>t[i-2].x?1:r.x===t[i-2].x?0:-1,l=r.y>t[i-2].y?1:r.y===t[i-2].y?0:-1),n.push(["L",r.x+s*e,r.y+l*e]),n},S.util.getPathSegmentsInfo=g,S.util.getBoundsOfCurve=a,S.util.getPointOnPath=function(t,e,i){i||(i=g(t));for(var n=0;e-i[n].length>0&&n<i.length-2;)e-=i[n].length,n++;var r,o=i[n],a=e/o.length,s=o.command,l=t[n];switch(s){case"M":return{x:o.x,y:o.y,angle:0};case"Z":case"z":return(r=new S.Point(o.x,o.y).lerp(new S.Point(o.destX,o.destY),a)).angle=Math.atan2(o.destY-o.y,o.destX-o.x),r;case"L":return(r=new S.Point(o.x,o.y).lerp(new S.Point(l[1],l[2]),a)).angle=Math.atan2(l[2]-o.y,l[1]-o.x),r;case"C":case"Q":return v(o,e)}},S.util.transformPath=function(t,e,i){return i&&(e=S.util.multiplyTransformMatrices(e,[1,0,0,1,-i.x,-i.y])),t.map((function(t){for(var i=t.slice(0),n={},r=1;r<t.length-1;r+=2)n.x=t[r],n.y=t[r+1],n=S.util.transformPoint(n,e),i[r]=n.x,i[r+1]=n.y;return i}))},S.util.fromArcToBeizers=s,S.util.getBoundsOfArc=function(t,e,i,n,o,s,l,c,h){for(var u,f=0,d=0,v=[],g=r(c-t,h-e,i,n,s,l,o),p=0,m=g.length;p<m;p++)u=a(f,d,g[p][1],g[p][2],g[p][3],g[p][4],g[p][5],g[p][6]),v.push({x:u[0].x+t,y:u[0].y+e}),v.push({x:u[1].x+t,y:u[1].y+e}),f=g[p][5],d=g[p][6];return v},S.util.drawArc=function(t,e,i,n){s(e,i,n=n.slice(0).unshift("X")).forEach((function(e){t.bezierCurveTo.apply(t,e.slice(1))}))}}(),function(){var t=Array.prototype.slice;function e(t,e,i){if(t&&0!==t.length){var n=t.length-1,r=e?t[n][e]:t[n];if(e)for(;n--;)i(t[n][e],r)&&(r=t[n][e]);else for(;n--;)i(t[n],r)&&(r=t[n]);return r}}S.util.array={fill:function(t,e){for(var i=t.length;i--;)t[i]=e;return t},invoke:function(e,i){for(var n=t.call(arguments,2),r=[],o=0,a=e.length;o<a;o++)r[o]=n.length?e[o][i].apply(e[o],n):e[o][i].call(e[o]);return r},min:function(t,i){return e(t,i,(function(t,e){return t<e}))},max:function(t,i){return e(t,i,(function(t,e){return t>=e}))}}}(),function(){function t(e,i,n){if(n)if(!S.isLikelyNode&&i instanceof Element)e=i;else if(i instanceof Array){e=[];for(var r=0,o=i.length;r<o;r++)e[r]=t({},i[r],n)}else if(i&&"object"==typeof i)for(var a in i)"canvas"===a||"group"===a?e[a]=null:i.hasOwnProperty(a)&&(e[a]=t({},i[a],n));else e=i;else for(var a in i)e[a]=i[a];return e}S.util.object={extend:t,clone:function(e,i){return t({},e,i)}},S.util.object.extend(S.util,S.Observable)}(),function(){function t(t,e){var i=t.charCodeAt(e);if(isNaN(i))return"";if(i<55296||i>57343)return t.charAt(e);if(55296<=i&&i<=56319){if(t.length<=e+1)throw"High surrogate without following low surrogate";var n=t.charCodeAt(e+1);if(56320>n||n>57343)throw"High surrogate without following low surrogate";return t.charAt(e)+t.charAt(e+1)}if(0===e)throw"Low surrogate without preceding high surrogate";var r=t.charCodeAt(e-1);if(55296>r||r>56319)throw"Low surrogate without preceding high surrogate";return!1}S.util.string={camelize:function(t){return t.replace(/-+(.)?/g,(function(t,e){return e?e.toUpperCase():""}))},capitalize:function(t,e){return t.charAt(0).toUpperCase()+(e?t.slice(1):t.slice(1).toLowerCase())},escapeXml:function(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},graphemeSplit:function(e){var i,n=0,r=[];for(n=0;n<e.length;n++)!1!==(i=t(e,n))&&r.push(i);return r}}}(),function(){var t=Array.prototype.slice,e=function(){},i=function(){for(var t in{toString:1})if("toString"===t)return!1;return!0}(),n=function(t,e,n){for(var r in e)r in t.prototype&&"function"==typeof t.prototype[r]&&(e[r]+"").indexOf("callSuper")>-1?t.prototype[r]=function(t){return function(){var i=this.constructor.superclass;this.constructor.superclass=n;var r=e[t].apply(this,arguments);if(this.constructor.superclass=i,"initialize"!==t)return r}}(r):t.prototype[r]=e[r],i&&(e.toString!==Object.prototype.toString&&(t.prototype.toString=e.toString),e.valueOf!==Object.prototype.valueOf&&(t.prototype.valueOf=e.valueOf))};function r(){}function o(e){for(var i=null,n=this;n.constructor.superclass;){var r=n.constructor.superclass.prototype[e];if(n[e]!==r){i=r;break}n=n.constructor.superclass.prototype}return i?arguments.length>1?i.apply(this,t.call(arguments,1)):i.call(this):console.log("tried to callSuper "+e+", method not found in prototype chain",this)}S.util.createClass=function(){var i=null,a=t.call(arguments,0);function s(){this.initialize.apply(this,arguments)}"function"==typeof a[0]&&(i=a.shift()),s.superclass=i,s.subclasses=[],i&&(r.prototype=i.prototype,s.prototype=new r,i.subclasses.push(s));for(var l=0,c=a.length;l<c;l++)n(s,a[l],i);return s.prototype.initialize||(s.prototype.initialize=e),s.prototype.constructor=s,s.prototype.callSuper=o,s}}(),c=!!S.document.createElement("div").attachEvent,h=["touchstart","touchmove","touchend"],S.util.addListener=function(t,e,i,n){t&&t.addEventListener(e,i,!c&&n)},S.util.removeListener=function(t,e,i,n){t&&t.removeEventListener(e,i,!c&&n)},S.util.getPointer=function(t){var e=t.target,i=S.util.getScrollLeftTop(e),n=function(t){var e=t.changedTouches;return e&&e[0]?e[0]:t}(t);return{x:n.clientX+i.left,y:n.clientY+i.top}},S.util.isTouchEvent=function(t){return h.indexOf(t.type)>-1||"touch"===t.pointerType},u=S.document.createElement("div"),f="string"==typeof u.style.opacity,d="string"==typeof u.style.filter,v=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,g=function(t){return t},f?g=function(t,e){return t.style.opacity=e,t}:d&&(g=function(t,e){var i=t.style;return t.currentStyle&&!t.currentStyle.hasLayout&&(i.zoom=1),v.test(i.filter)?(e=e>=.9999?"":"alpha(opacity="+100*e+")",i.filter=i.filter.replace(v,e)):i.filter+=" alpha(opacity="+100*e+")",t}),S.util.setStyle=function(t,e){var i=t.style;if(!i)return t;if("string"==typeof e)return t.style.cssText+=";"+e,e.indexOf("opacity")>-1?g(t,e.match(/opacity:\s*(\d?\.?\d*)/)[1]):t;for(var n in e)"opacity"===n?g(t,e[n]):i["float"===n||"cssFloat"===n?void 0===i.styleFloat?"cssFloat":"styleFloat":n]=e[n];return t},function(){var t=Array.prototype.slice;var e,i,n,r,o=function(e){return t.call(e,0)};try{e=o(S.document.childNodes)instanceof Array}catch(t){}function a(t,e){var i=S.document.createElement(t);for(var n in e)"class"===n?i.className=e[n]:"for"===n?i.htmlFor=e[n]:i.setAttribute(n,e[n]);return i}function s(t){for(var e=0,i=0,n=S.document.documentElement,r=S.document.body||{scrollLeft:0,scrollTop:0};t&&(t.parentNode||t.host)&&((t=t.parentNode||t.host)===S.document?(e=r.scrollLeft||n.scrollLeft||0,i=r.scrollTop||n.scrollTop||0):(e+=t.scrollLeft||0,i+=t.scrollTop||0),1!==t.nodeType||"fixed"!==t.style.position););return{left:e,top:i}}e||(o=function(t){for(var e=new Array(t.length),i=t.length;i--;)e[i]=t[i];return e}),i=S.document.defaultView&&S.document.defaultView.getComputedStyle?function(t,e){var i=S.document.defaultView.getComputedStyle(t,null);return i?i[e]:void 0}:function(t,e){var i=t.style[e];return!i&&t.currentStyle&&(i=t.currentStyle[e]),i},n=S.document.documentElement.style,r="userSelect"in n?"userSelect":"MozUserSelect"in n?"MozUserSelect":"WebkitUserSelect"in n?"WebkitUserSelect":"KhtmlUserSelect"in n?"KhtmlUserSelect":"",S.util.makeElementUnselectable=function(t){return void 0!==t.onselectstart&&(t.onselectstart=S.util.falseFunction),r?t.style[r]="none":"string"==typeof t.unselectable&&(t.unselectable="on"),t},S.util.makeElementSelectable=function(t){return void 0!==t.onselectstart&&(t.onselectstart=null),r?t.style[r]="":"string"==typeof t.unselectable&&(t.unselectable=""),t},S.util.setImageSmoothing=function(t,e){t.imageSmoothingEnabled=t.imageSmoothingEnabled||t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled||t.oImageSmoothingEnabled,t.imageSmoothingEnabled=e},S.util.getById=function(t){return"string"==typeof t?S.document.getElementById(t):t},S.util.toArray=o,S.util.addClass=function(t,e){t&&-1===(" "+t.className+" ").indexOf(" "+e+" ")&&(t.className+=(t.className?" ":"")+e)},S.util.makeElement=a,S.util.wrapElement=function(t,e,i){return"string"==typeof e&&(e=a(e,i)),t.parentNode&&t.parentNode.replaceChild(e,t),e.appendChild(t),e},S.util.getScrollLeftTop=s,S.util.getElementOffset=function(t){var e,n,r=t&&t.ownerDocument,o={left:0,top:0},a={left:0,top:0},l={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!r)return a;for(var c in l)a[l[c]]+=parseInt(i(t,c),10)||0;return e=r.documentElement,void 0!==t.getBoundingClientRect&&(o=t.getBoundingClientRect()),n=s(t),{left:o.left+n.left-(e.clientLeft||0)+a.left,top:o.top+n.top-(e.clientTop||0)+a.top}},S.util.getNodeCanvas=function(t){var e=S.jsdomImplForWrapper(t);return e._canvas||e._image},S.util.cleanUpJsdomNode=function(t){if(S.isLikelyNode){var e=S.jsdomImplForWrapper(t);e&&(e._image=null,e._canvas=null,e._currentSrc=null,e._attributes=null,e._classList=null)}}}(),function(){function t(){}S.util.request=function(e,i){i||(i={});var n=i.method?i.method.toUpperCase():"GET",r=i.onComplete||function(){},o=new S.window.XMLHttpRequest,a=i.body||i.parameters;return o.onreadystatechange=function(){4===o.readyState&&(r(o),o.onreadystatechange=t)},"GET"===n&&(a=null,"string"==typeof i.parameters&&(e=function(t,e){return t+(/\?/.test(t)?"&":"?")+e}(e,i.parameters))),o.open(n,e,!0),"POST"!==n&&"PUT"!==n||o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.send(a),o}}(),S.log=console.log,S.warn=console.warn,function(){function t(){return!1}function e(t,e,i,n){return-i*Math.cos(t/n*(Math.PI/2))+i+e}var i=S.window.requestAnimationFrame||S.window.webkitRequestAnimationFrame||S.window.mozRequestAnimationFrame||S.window.oRequestAnimationFrame||S.window.msRequestAnimationFrame||function(t){return S.window.setTimeout(t,1e3/60)},n=S.window.cancelAnimationFrame||S.window.clearTimeout;function r(){return i.apply(S.window,arguments)}S.util.animate=function(i){var n=!1;return r((function(o){i||(i={});var a,s=o||+new Date,l=i.duration||500,c=s+l,h=i.onChange||t,u=i.abort||t,f=i.onComplete||t,d=i.easing||e,v="startValue"in i?i.startValue:0,g="endValue"in i?i.endValue:100,p=i.byValue||g-v;i.onStart&&i.onStart(),function t(e){var i=(a=e||+new Date)>c?l:a-s,o=i/l,m=d(i,v,p,l),y=Math.abs((m-v)/p);if(!n){if(!u(m,y,o))return a>c?(h(g,1,1),void f(g,1,1)):(h(m,y,o),void r(t));f(g,1,1)}}(s)})),function(){n=!0}},S.util.requestAnimFrame=r,S.util.cancelAnimFrame=function(){return n.apply(S.window,arguments)}}(),function(){function t(t,e,i){var n="rgba("+parseInt(t[0]+i*(e[0]-t[0]),10)+","+parseInt(t[1]+i*(e[1]-t[1]),10)+","+parseInt(t[2]+i*(e[2]-t[2]),10);return n+=","+(t&&e?parseFloat(t[3]+i*(e[3]-t[3])):1),n+=")"}S.util.animateColor=function(e,i,n,r){var o=new S.Color(e).getSource(),a=new S.Color(i).getSource(),s=r.onComplete,l=r.onChange;return r=r||{},S.util.animate(S.util.object.extend(r,{duration:n||500,startValue:o,endValue:a,byValue:a,easing:function(e,i,n,o){return t(i,n,r.colorEasing?r.colorEasing(e,o):1-Math.cos(e/o*(Math.PI/2)))},onComplete:function(e,i,n){if(s)return s(t(a,a,0),i,n)},onChange:function(e,i,n){if(l){if(Array.isArray(e))return l(t(e,e,0),i,n);l(e,i,n)}}}))}}(),function(){function t(t,e,i,n){return t<Math.abs(e)?(t=e,n=i/4):n=0===e&&0===t?i/(2*Math.PI)*Math.asin(1):i/(2*Math.PI)*Math.asin(e/t),{a:t,c:e,p:i,s:n}}function e(t,e,i){return t.a*Math.pow(2,10*(e-=1))*Math.sin((e*i-t.s)*(2*Math.PI)/t.p)}function i(t,e,i,r){return i-n(r-t,0,i,r)+e}function n(t,e,i,n){return(t/=n)<1/2.75?i*(7.5625*t*t)+e:t<2/2.75?i*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?i*(7.5625*(t-=2.25/2.75)*t+.9375)+e:i*(7.5625*(t-=2.625/2.75)*t+.984375)+e}S.util.ease={easeInQuad:function(t,e,i,n){return i*(t/=n)*t+e},easeOutQuad:function(t,e,i,n){return-i*(t/=n)*(t-2)+e},easeInOutQuad:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e},easeInCubic:function(t,e,i,n){return i*(t/=n)*t*t+e},easeOutCubic:function(t,e,i,n){return i*((t=t/n-1)*t*t+1)+e},easeInOutCubic:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t*t+e:i/2*((t-=2)*t*t+2)+e},easeInQuart:function(t,e,i,n){return i*(t/=n)*t*t*t+e},easeOutQuart:function(t,e,i,n){return-i*((t=t/n-1)*t*t*t-1)+e},easeInOutQuart:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t*t*t+e:-i/2*((t-=2)*t*t*t-2)+e},easeInQuint:function(t,e,i,n){return i*(t/=n)*t*t*t*t+e},easeOutQuint:function(t,e,i,n){return i*((t=t/n-1)*t*t*t*t+1)+e},easeInOutQuint:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t*t*t*t+e:i/2*((t-=2)*t*t*t*t+2)+e},easeInSine:function(t,e,i,n){return-i*Math.cos(t/n*(Math.PI/2))+i+e},easeOutSine:function(t,e,i,n){return i*Math.sin(t/n*(Math.PI/2))+e},easeInOutSine:function(t,e,i,n){return-i/2*(Math.cos(Math.PI*t/n)-1)+e},easeInExpo:function(t,e,i,n){return 0===t?e:i*Math.pow(2,10*(t/n-1))+e},easeOutExpo:function(t,e,i,n){return t===n?e+i:i*(1-Math.pow(2,-10*t/n))+e},easeInOutExpo:function(t,e,i,n){return 0===t?e:t===n?e+i:(t/=n/2)<1?i/2*Math.pow(2,10*(t-1))+e:i/2*(2-Math.pow(2,-10*--t))+e},easeInCirc:function(t,e,i,n){return-i*(Math.sqrt(1-(t/=n)*t)-1)+e},easeOutCirc:function(t,e,i,n){return i*Math.sqrt(1-(t=t/n-1)*t)+e},easeInOutCirc:function(t,e,i,n){return(t/=n/2)<1?-i/2*(Math.sqrt(1-t*t)-1)+e:i/2*(Math.sqrt(1-(t-=2)*t)+1)+e},easeInElastic:function(i,n,r,o){var a=0;return 0===i?n:1===(i/=o)?n+r:(a||(a=.3*o),-e(t(r,r,a,1.70158),i,o)+n)},easeOutElastic:function(e,i,n,r){var o=0;if(0===e)return i;if(1===(e/=r))return i+n;o||(o=.3*r);var a=t(n,n,o,1.70158);return a.a*Math.pow(2,-10*e)*Math.sin((e*r-a.s)*(2*Math.PI)/a.p)+a.c+i},easeInOutElastic:function(i,n,r,o){var a=0;if(0===i)return n;if(2===(i/=o/2))return n+r;a||(a=o*(.3*1.5));var s=t(r,r,a,1.70158);return i<1?-.5*e(s,i,o)+n:s.a*Math.pow(2,-10*(i-=1))*Math.sin((i*o-s.s)*(2*Math.PI)/s.p)*.5+s.c+n},easeInBack:function(t,e,i,n,r){return void 0===r&&(r=1.70158),i*(t/=n)*t*((r+1)*t-r)+e},easeOutBack:function(t,e,i,n,r){return void 0===r&&(r=1.70158),i*((t=t/n-1)*t*((r+1)*t+r)+1)+e},easeInOutBack:function(t,e,i,n,r){return void 0===r&&(r=1.70158),(t/=n/2)<1?i/2*(t*t*((1+(r*=1.525))*t-r))+e:i/2*((t-=2)*t*((1+(r*=1.525))*t+r)+2)+e},easeInBounce:i,easeOutBounce:n,easeInOutBounce:function(t,e,r,o){return t<o/2?.5*i(2*t,0,r,o)+e:.5*n(2*t-o,0,r,o)+.5*r+e}}}(),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.util.object.clone,r=e.util.toFixed,o=e.util.parseUnit,a=e.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"},l={stroke:"strokeOpacity",fill:"fillOpacity"};function c(t){return t in s?s[t]:t}function h(t,i,n,r){var s,l="[object Array]"===Object.prototype.toString.call(i);if("fill"!==t&&"stroke"!==t||"none"!==i){if("strokeUniform"===t)return"non-scaling-stroke"===i;if("strokeDashArray"===t)i="none"===i?null:i.replace(/,/g," ").split(/\s+/).map(parseFloat);else if("transformMatrix"===t)i=n&&n.transformMatrix?a(n.transformMatrix,e.parseTransformAttribute(i)):e.parseTransformAttribute(i);else if("visible"===t)i="none"!==i&&"hidden"!==i,n&&!1===n.visible&&(i=!1);else if("opacity"===t)i=parseFloat(i),n&&void 0!==n.opacity&&(i*=n.opacity);else if("textAnchor"===t)i="start"===i?"left":"end"===i?"right":"center";else if("charSpacing"===t)s=o(i,r)/r*1e3;else if("paintFirst"===t){var c=i.indexOf("fill"),h=i.indexOf("stroke");i="fill";(c>-1&&h>-1&&h<c||-1===c&&h>-1)&&(i="stroke")}else{if("href"===t||"xlink:href"===t||"font"===t)return i;if("imageSmoothing"===t)return"optimizeQuality"===i;s=l?i.map(o):o(i,r)}}else i="";return!l&&isNaN(s)?i:s}function u(t){return new RegExp("^("+t.join("|")+")\\b","i")}function f(t,e){var i,n,r,o,a=[];for(r=0,o=e.length;r<o;r++)i=e[r],n=t.getElementsByTagName(i),a=a.concat(Array.prototype.slice.call(n));return a}function d(t,e){var i,n=!0;return(i=v(t,e.pop()))&&e.length&&(n=function(t,e){var i,n=!0;for(;t.parentNode&&1===t.parentNode.nodeType&&e.length;)n&&(i=e.pop()),t=t.parentNode,n=v(t,i);return 0===e.length}(t,e)),i&&n&&0===e.length}function v(t,e){var i,n,r=t.nodeName,o=t.getAttribute("class"),a=t.getAttribute("id");if(i=new RegExp("^"+r,"i"),e=e.replace(i,""),a&&e.length&&(i=new RegExp("#"+a+"(?![a-zA-Z\\-]+)","i"),e=e.replace(i,"")),o&&e.length)for(n=(o=o.split(" ")).length;n--;)i=new RegExp("\\."+o[n]+"(?![a-zA-Z\\-]+)","i"),e=e.replace(i,"");return 0===e.length}function g(t,e){var i;if(t.getElementById&&(i=t.getElementById(e)),i)return i;var n,r,o,a=t.getElementsByTagName("*");for(r=0,o=a.length;r<o;r++)if(e===(n=a[r]).getAttribute("id"))return n}e.svgValidTagNamesRegEx=u(["path","circle","polygon","polyline","ellipse","rect","line","image","text"]),e.svgViewBoxElementsRegEx=u(["symbol","image","marker","pattern","view","svg"]),e.svgInvalidAncestorsRegEx=u(["pattern","defs","symbol","metadata","clipPath","mask","desc"]),e.svgValidParentsRegEx=u(["symbol","g","a","svg","clipPath","defs"]),e.cssRules={},e.gradientDefs={},e.clipPaths={},e.parseTransformAttribute=function(){function t(t,i,n){t[n]=Math.tan(e.util.degreesToRadians(i[0]))}var i=e.iMatrix,n=e.reNum,r=e.commaWsp,o="(?:"+("(?:(matrix)\\s*\\(\\s*("+n+")"+r+"("+n+")"+r+"("+n+")"+r+"("+n+")"+r+"("+n+")"+r+"("+n+")\\s*\\))")+"|"+("(?:(translate)\\s*\\(\\s*("+n+")(?:"+r+"("+n+"))?\\s*\\))")+"|"+("(?:(scale)\\s*\\(\\s*("+n+")(?:"+r+"("+n+"))?\\s*\\))")+"|"+("(?:(rotate)\\s*\\(\\s*("+n+")(?:"+r+"("+n+")"+r+"("+n+"))?\\s*\\))")+"|"+("(?:(skewX)\\s*\\(\\s*("+n+")\\s*\\))")+"|"+("(?:(skewY)\\s*\\(\\s*("+n+")\\s*\\))")+")",a=new RegExp("^\\s*(?:"+("(?:"+o+"(?:"+r+"*"+o+")*)")+"?)\\s*$"),s=new RegExp(o,"g");return function(n){var r=i.concat(),l=[];if(!n||n&&!a.test(n))return r;n.replace(s,(function(n){var a=new RegExp(o).exec(n).filter((function(t){return!!t})),s=a[1],c=a.slice(2).map(parseFloat);switch(s){case"translate":!function(t,e){t[4]=e[0],2===e.length&&(t[5]=e[1])}(r,c);break;case"rotate":c[0]=e.util.degreesToRadians(c[0]),function(t,i){var n=e.util.cos(i[0]),r=e.util.sin(i[0]),o=0,a=0;3===i.length&&(o=i[1],a=i[2]),t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=o-(n*o-r*a),t[5]=a-(r*o+n*a)}(r,c);break;case"scale":!function(t,e){var i=e[0],n=2===e.length?e[1]:e[0];t[0]=i,t[3]=n}(r,c);break;case"skewX":t(r,c,2);break;case"skewY":t(r,c,1);break;case"matrix":r=c}l.push(r.concat()),r=i.concat()}));for(var c=l[0];l.length>1;)l.shift(),c=e.util.multiplyTransformMatrices(c,l[0]);return c}}();var p=new RegExp("^\\s*("+e.reNum+"+)\\s*,?\\s*("+e.reNum+"+)\\s*,?\\s*("+e.reNum+"+)\\s*,?\\s*("+e.reNum+"+)\\s*$");function m(t){if(!e.svgViewBoxElementsRegEx.test(t.nodeName))return{};var i,n,r,a,s,l,c=t.getAttribute("viewBox"),h=1,u=1,f=t.getAttribute("width"),d=t.getAttribute("height"),v=t.getAttribute("x")||0,g=t.getAttribute("y")||0,m=t.getAttribute("preserveAspectRatio")||"",y=!c||!(c=c.match(p)),b=!f||!d||"100%"===f||"100%"===d,w=y&&b,x={},C="",k=0,_=0;if(x.width=0,x.height=0,x.toBeParsed=w,y&&(v||g)&&t.parentNode&&"#document"!==t.parentNode.nodeName&&(C=" translate("+o(v)+" "+o(g)+") ",s=(t.getAttribute("transform")||"")+C,t.setAttribute("transform",s),t.removeAttribute("x"),t.removeAttribute("y")),w)return x;if(y)return x.width=o(f),x.height=o(d),x;if(i=-parseFloat(c[1]),n=-parseFloat(c[2]),r=parseFloat(c[3]),a=parseFloat(c[4]),x.minX=i,x.minY=n,x.viewBoxWidth=r,x.viewBoxHeight=a,b?(x.width=r,x.height=a):(x.width=o(f),x.height=o(d),h=x.width/r,u=x.height/a),"none"!==(m=e.util.parsePreserveAspectRatioAttribute(m)).alignX&&("meet"===m.meetOrSlice&&(u=h=h>u?u:h),"slice"===m.meetOrSlice&&(u=h=h>u?h:u),k=x.width-r*h,_=x.height-a*h,"Mid"===m.alignX&&(k/=2),"Mid"===m.alignY&&(_/=2),"Min"===m.alignX&&(k=0),"Min"===m.alignY&&(_=0)),1===h&&1===u&&0===i&&0===n&&0===v&&0===g)return x;if((v||g)&&"#document"!==t.parentNode.nodeName&&(C=" translate("+o(v)+" "+o(g)+") "),s=C+" matrix("+h+" 0 0 "+u+" "+(i*h+k)+" "+(n*u+_)+") ","svg"===t.nodeName){for(l=t.ownerDocument.createElementNS(e.svgNS,"g");t.firstChild;)l.appendChild(t.firstChild);t.appendChild(l)}else(l=t).removeAttribute("x"),l.removeAttribute("y"),s=l.getAttribute("transform")+s;return l.setAttribute("transform",s),x}function y(t,e){var i=g(t,e.getAttribute("xlink:href").substr(1));if(i&&i.getAttribute("xlink:href")&&y(t,i),["gradientTransform","x1","x2","y1","y2","gradientUnits","cx","cy","r","fx","fy"].forEach((function(t){i&&!e.hasAttribute(t)&&i.hasAttribute(t)&&e.setAttribute(t,i.getAttribute(t))})),!e.children.length)for(var n=i.cloneNode(!0);n.firstChild;)e.appendChild(n.firstChild);e.removeAttribute("xlink:href")}e.parseSVGDocument=function(t,i,r,o){if(t){!function(t){for(var i=f(t,["use","svg:use"]),n=0;i.length&&n<i.length;){var r=i[n],o=r.getAttribute("xlink:href")||r.getAttribute("href");if(null===o)return;var a,s,l,c,h=o.substr(1),u=r.getAttribute("x")||0,d=r.getAttribute("y")||0,v=g(t,h).cloneNode(!0),p=(v.getAttribute("transform")||"")+" translate("+u+", "+d+")",y=i.length,b=e.svgNS;if(m(v),/^svg$/i.test(v.nodeName)){var w=v.ownerDocument.createElementNS(b,"g");for(s=0,c=(l=v.attributes).length;s<c;s++)a=l.item(s),w.setAttributeNS(b,a.nodeName,a.nodeValue);for(;v.firstChild;)w.appendChild(v.firstChild);v=w}for(s=0,c=(l=r.attributes).length;s<c;s++)"x"!==(a=l.item(s)).nodeName&&"y"!==a.nodeName&&"xlink:href"!==a.nodeName&&"href"!==a.nodeName&&("transform"===a.nodeName?p=a.nodeValue+" "+p:v.setAttribute(a.nodeName,a.nodeValue));v.setAttribute("transform",p),v.setAttribute("instantiated_by_use","1"),v.removeAttribute("id"),r.parentNode.replaceChild(v,r),i.length===y&&n++}}(t);var a,s,l=e.Object.__uid++,c=m(t),h=e.util.toArray(t.getElementsByTagName("*"));if(c.crossOrigin=o&&o.crossOrigin,c.svgUid=l,0===h.length&&e.isLikelyNode){var u=[];for(a=0,s=(h=t.selectNodes('//*[name(.)!="svg"]')).length;a<s;a++)u[a]=h[a];h=u}var d=h.filter((function(t){return m(t),e.svgValidTagNamesRegEx.test(t.nodeName.replace("svg:",""))&&!function(t,e){for(;t&&(t=t.parentNode);)if(t.nodeName&&e.test(t.nodeName.replace("svg:",""))&&!t.getAttribute("instantiated_by_use"))return!0;return!1}(t,e.svgInvalidAncestorsRegEx)}));if(!d||d&&!d.length)i&&i([],{});else{var v={};h.filter((function(t){return"clipPath"===t.nodeName.replace("svg:","")})).forEach((function(t){var i=t.getAttribute("id");v[i]=e.util.toArray(t.getElementsByTagName("*")).filter((function(t){return e.svgValidTagNamesRegEx.test(t.nodeName.replace("svg:",""))}))})),e.gradientDefs[l]=e.getGradientDefs(t),e.cssRules[l]=e.getCSSRules(t),e.clipPaths[l]=v,e.parseElements(d,(function(t,n){i&&(i(t,c,n,h),delete e.gradientDefs[l],delete e.cssRules[l],delete e.clipPaths[l])}),n(c),r,o)}}};var b=new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*("+e.reNum+"(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|"+e.reNum+"))?\\s+(.*)");i(e,{parseFontDeclaration:function(t,e){var i=t.match(b);if(i){var n=i[1],r=i[3],a=i[4],s=i[5],l=i[6];n&&(e.fontStyle=n),r&&(e.fontWeight=isNaN(parseFloat(r))?r:parseFloat(r)),a&&(e.fontSize=o(a)),l&&(e.fontFamily=l),s&&(e.lineHeight="normal"===s?1:s)}},getGradientDefs:function(t){var e,i=f(t,["linearGradient","radialGradient","svg:linearGradient","svg:radialGradient"]),n=0,r={};for(n=i.length;n--;)(e=i[n]).getAttribute("xlink:href")&&y(t,e),r[e.getAttribute("id")]=e;return r},parseAttributes:function(t,n,a){if(t){var s,u,f,v={};void 0===a&&(a=t.getAttribute("svgUid")),t.parentNode&&e.svgValidParentsRegEx.test(t.parentNode.nodeName)&&(v=e.parseAttributes(t.parentNode,n,a));var g=n.reduce((function(e,i){return(s=t.getAttribute(i))&&(e[i]=s),e}),{}),p=i(function(t,i){var n={};for(var r in e.cssRules[i])if(d(t,r.split(" ")))for(var o in e.cssRules[i][r])n[o]=e.cssRules[i][r][o];return n}(t,a),e.parseStyleAttribute(t));g=i(g,p),p["clip-path"]&&t.setAttribute("clip-path",p["clip-path"]),u=f=v.fontSize||e.Text.DEFAULT_SVG_FONT_SIZE,g["font-size"]&&(g["font-size"]=u=o(g["font-size"],f));var m,y,b={};for(var w in g)y=h(m=c(w),g[w],v,u),b[m]=y;b&&b.font&&e.parseFontDeclaration(b.font,b);var x=i(v,b);return e.svgValidParentsRegEx.test(t.nodeName)?x:function(t){for(var i in l)if(void 0!==t[l[i]]&&""!==t[i]){if(void 0===t[i]){if(!e.Object.prototype[i])continue;t[i]=e.Object.prototype[i]}if(0!==t[i].indexOf("url(")){var n=new e.Color(t[i]);t[i]=n.setAlpha(r(n.getAlpha()*t[l[i]],2)).toRgba()}}return t}(x)}},parseElements:function(t,i,n,r,o){new e.ElementsParser(t,i,n,r,o).parse()},parseStyleAttribute:function(t){var e={},i=t.getAttribute("style");return i?("string"==typeof i?function(t,e){var i,n;t.replace(/;\s*$/,"").split(";").forEach((function(t){var r=t.split(":");i=r[0].trim().toLowerCase(),n=r[1].trim(),e[i]=n}))}(i,e):function(t,e){var i,n;for(var r in t)void 0!==t[r]&&(i=r.toLowerCase(),n=t[r],e[i]=n)}(i,e),e):e},parsePointsAttribute:function(t){if(!t)return null;var e,i,n=[];for(e=0,i=(t=(t=t.replace(/,/g," ").trim()).split(/\s+/)).length;e<i;e+=2)n.push({x:parseFloat(t[e]),y:parseFloat(t[e+1])});return n},getCSSRules:function(t){var i,n,r=t.getElementsByTagName("style"),o={};for(i=0,n=r.length;i<n;i++){var a=r[i].textContent;""!==(a=a.replace(/\/\*[\s\S]*?\*\//g,"")).trim()&&a.match(/[^{]*\{[\s\S]*?\}/g).map((function(t){return t.trim()})).forEach((function(t){var r=t.match(/([\s\S]*?)\s*\{([^}]*)\}/),a={},s=r[2].trim().replace(/;$/,"").split(/\s*;\s*/);for(i=0,n=s.length;i<n;i++){var l=s[i].split(/\s*:\s*/),c=l[0],h=l[1];a[c]=h}(t=r[1]).split(",").forEach((function(t){""!==(t=t.replace(/^svg/i,"").trim())&&(o[t]?e.util.object.extend(o[t],a):o[t]=e.util.object.clone(a))}))}))}return o},loadSVGFromURL:function(t,i,n,r){t=t.replace(/^\n\s*/,"").trim(),new e.util.request(t,{method:"get",onComplete:function(t){var o=t.responseXML;if(!o||!o.documentElement)return i&&i(null),!1;e.parseSVGDocument(o.documentElement,(function(t,e,n,r){i&&i(t,e,n,r)}),n,r)}})},loadSVGFromString:function(t,i,n,r){var o=(new e.window.DOMParser).parseFromString(t.trim(),"text/xml");e.parseSVGDocument(o.documentElement,(function(t,e,n,r){i(t,e,n,r)}),n,r)}})}(e),S.ElementsParser=function(t,e,i,n,r,o){this.elements=t,this.callback=e,this.options=i,this.reviver=n,this.svgUid=i&&i.svgUid||0,this.parsingOptions=r,this.regexUrl=/^url\(['"]?#([^'"]+)['"]?\)/g,this.doc=o},(p=S.ElementsParser.prototype).parse=function(){this.instances=new Array(this.elements.length),this.numElements=this.elements.length,this.createObjects()},p.createObjects=function(){var t=this;this.elements.forEach((function(e,i){e.setAttribute("svgUid",t.svgUid),t.createObject(e,i)}))},p.findTag=function(t){return S[S.util.string.capitalize(t.tagName.replace("svg:",""))]},p.createObject=function(t,e){var i=this.findTag(t);if(i&&i.fromElement)try{i.fromElement(t,this.createCallback(e,t),this.options)}catch(t){S.log(t)}else this.checkIfDone()},p.createCallback=function(t,e){var i=this;return function(n){var r;i.resolveGradient(n,e,"fill"),i.resolveGradient(n,e,"stroke"),n instanceof S.Image&&n._originalElement&&(r=n.parsePreserveAspectRatioAttribute(e)),n._removeTransformMatrix(r),i.resolveClipPath(n,e),i.reviver&&i.reviver(e,n),i.instances[t]=n,i.checkIfDone()}},p.extractPropertyDefinition=function(t,e,i){var n=t[e],r=this.regexUrl;if(r.test(n)){r.lastIndex=0;var o=r.exec(n)[1];return r.lastIndex=0,S[i][this.svgUid][o]}},p.resolveGradient=function(t,e,i){var n=this.extractPropertyDefinition(t,i,"gradientDefs");if(n){var r=e.getAttribute(i+"-opacity"),o=S.Gradient.fromElement(n,t,r,this.options);t.set(i,o)}},p.createClipPathCallback=function(t,e){return function(t){t._removeTransformMatrix(),t.fillRule=t.clipRule,e.push(t)}},p.resolveClipPath=function(t,e){var i,n,r,o,a=this.extractPropertyDefinition(t,"clipPath","clipPaths");if(a){r=[],n=S.util.invertTransform(t.calcTransformMatrix());for(var s=a[0].parentNode,l=e;l.parentNode&&l.getAttribute("clip-path")!==t.clipPath;)l=l.parentNode;l.parentNode.appendChild(s);for(var c=0;c<a.length;c++)i=a[c],this.findTag(i).fromElement(i,this.createClipPathCallback(t,r),this.options);a=1===r.length?r[0]:new S.Group(r),o=S.util.multiplyTransformMatrices(n,a.calcTransformMatrix()),a.clipPath&&this.resolveClipPath(a,l);var h=S.util.qrDecompose(o);a.flipX=!1,a.flipY=!1,a.set("scaleX",h.scaleX),a.set("scaleY",h.scaleY),a.angle=h.angle,a.skewX=h.skewX,a.skewY=0,a.setPositionByOrigin({x:h.translateX,y:h.translateY},"center","center"),t.clipPath=a}else delete t.clipPath},p.checkIfDone=function(){0==--this.numElements&&(this.instances=this.instances.filter((function(t){return null!=t})),this.callback(this.instances,this.elements))},function(t){"use strict";var e=t.fabric||(t.fabric={});function i(t,e){this.x=t,this.y=e}e.Point?e.warn("fabric.Point is already defined"):(e.Point=i,i.prototype={type:"point",constructor:i,add:function(t){return new i(this.x+t.x,this.y+t.y)},addEquals:function(t){return this.x+=t.x,this.y+=t.y,this},scalarAdd:function(t){return new i(this.x+t,this.y+t)},scalarAddEquals:function(t){return this.x+=t,this.y+=t,this},subtract:function(t){return new i(this.x-t.x,this.y-t.y)},subtractEquals:function(t){return this.x-=t.x,this.y-=t.y,this},scalarSubtract:function(t){return new i(this.x-t,this.y-t)},scalarSubtractEquals:function(t){return this.x-=t,this.y-=t,this},multiply:function(t){return new i(this.x*t,this.y*t)},multiplyEquals:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return new i(this.x/t,this.y/t)},divideEquals:function(t){return this.x/=t,this.y/=t,this},eq:function(t){return this.x===t.x&&this.y===t.y},lt:function(t){return this.x<t.x&&this.y<t.y},lte:function(t){return this.x<=t.x&&this.y<=t.y},gt:function(t){return this.x>t.x&&this.y>t.y},gte:function(t){return this.x>=t.x&&this.y>=t.y},lerp:function(t,e){return void 0===e&&(e=.5),e=Math.max(Math.min(1,e),0),new i(this.x+(t.x-this.x)*e,this.y+(t.y-this.y)*e)},distanceFrom:function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},midPointFrom:function(t){return this.lerp(t)},min:function(t){return new i(Math.min(this.x,t.x),Math.min(this.y,t.y))},max:function(t){return new i(Math.max(this.x,t.x),Math.max(this.y,t.y))},toString:function(){return this.x+","+this.y},setXY:function(t,e){return this.x=t,this.y=e,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setFromPoint:function(t){return this.x=t.x,this.y=t.y,this},swap:function(t){var e=this.x,i=this.y;this.x=t.x,this.y=t.y,t.x=e,t.y=i},clone:function(){return new i(this.x,this.y)}})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={});function i(t){this.status=t,this.points=[]}e.Intersection?e.warn("fabric.Intersection is already defined"):(e.Intersection=i,e.Intersection.prototype={constructor:i,appendPoint:function(t){return this.points.push(t),this},appendPoints:function(t){return this.points=this.points.concat(t),this}},e.Intersection.intersectLineLine=function(t,n,r,o){var a,s=(o.x-r.x)*(t.y-r.y)-(o.y-r.y)*(t.x-r.x),l=(n.x-t.x)*(t.y-r.y)-(n.y-t.y)*(t.x-r.x),c=(o.y-r.y)*(n.x-t.x)-(o.x-r.x)*(n.y-t.y);if(0!==c){var h=s/c,u=l/c;0<=h&&h<=1&&0<=u&&u<=1?(a=new i("Intersection")).appendPoint(new e.Point(t.x+h*(n.x-t.x),t.y+h*(n.y-t.y))):a=new i}else a=new i(0===s||0===l?"Coincident":"Parallel");return a},e.Intersection.intersectLinePolygon=function(t,e,n){var r,o,a,s,l=new i,c=n.length;for(s=0;s<c;s++)r=n[s],o=n[(s+1)%c],a=i.intersectLineLine(t,e,r,o),l.appendPoints(a.points);return l.points.length>0&&(l.status="Intersection"),l},e.Intersection.intersectPolygonPolygon=function(t,e){var n,r=new i,o=t.length;for(n=0;n<o;n++){var a=t[n],s=t[(n+1)%o],l=i.intersectLinePolygon(a,s,e);r.appendPoints(l.points)}return r.points.length>0&&(r.status="Intersection"),r},e.Intersection.intersectPolygonRectangle=function(t,n,r){var o=n.min(r),a=n.max(r),s=new e.Point(a.x,o.y),l=new e.Point(o.x,a.y),c=i.intersectLinePolygon(o,s,t),h=i.intersectLinePolygon(s,a,t),u=i.intersectLinePolygon(a,l,t),f=i.intersectLinePolygon(l,o,t),d=new i;return d.appendPoints(c.points),d.appendPoints(h.points),d.appendPoints(u.points),d.appendPoints(f.points),d.points.length>0&&(d.status="Intersection"),d})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={});function i(t){t?this._tryParsingColor(t):this.setSource([0,0,0,1])}function n(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}e.Color?e.warn("fabric.Color is already defined."):(e.Color=i,e.Color.prototype={_tryParsingColor:function(t){var e;t in i.colorNameMap&&(t=i.colorNameMap[t]),"transparent"===t&&(e=[255,255,255,0]),e||(e=i.sourceFromHex(t)),e||(e=i.sourceFromRgb(t)),e||(e=i.sourceFromHsl(t)),e||(e=[0,0,0,1]),e&&this.setSource(e)},_rgbToHsl:function(t,i,n){t/=255,i/=255,n/=255;var r,o,a,s=e.util.array.max([t,i,n]),l=e.util.array.min([t,i,n]);if(a=(s+l)/2,s===l)r=o=0;else{var c=s-l;switch(o=a>.5?c/(2-s-l):c/(s+l),s){case t:r=(i-n)/c+(i<n?6:0);break;case i:r=(n-t)/c+2;break;case n:r=(t-i)/c+4}r/=6}return[Math.round(360*r),Math.round(100*o),Math.round(100*a)]},getSource:function(){return this._source},setSource:function(t){this._source=t},toRgb:function(){var t=this.getSource();return"rgb("+t[0]+","+t[1]+","+t[2]+")"},toRgba:function(){var t=this.getSource();return"rgba("+t[0]+","+t[1]+","+t[2]+","+t[3]+")"},toHsl:function(){var t=this.getSource(),e=this._rgbToHsl(t[0],t[1],t[2]);return"hsl("+e[0]+","+e[1]+"%,"+e[2]+"%)"},toHsla:function(){var t=this.getSource(),e=this._rgbToHsl(t[0],t[1],t[2]);return"hsla("+e[0]+","+e[1]+"%,"+e[2]+"%,"+t[3]+")"},toHex:function(){var t,e,i,n=this.getSource();return t=1===(t=n[0].toString(16)).length?"0"+t:t,e=1===(e=n[1].toString(16)).length?"0"+e:e,i=1===(i=n[2].toString(16)).length?"0"+i:i,t.toUpperCase()+e.toUpperCase()+i.toUpperCase()},toHexa:function(){var t,e=this.getSource();return t=1===(t=(t=Math.round(255*e[3])).toString(16)).length?"0"+t:t,this.toHex()+t.toUpperCase()},getAlpha:function(){return this.getSource()[3]},setAlpha:function(t){var e=this.getSource();return e[3]=t,this.setSource(e),this},toGrayscale:function(){var t=this.getSource(),e=parseInt((.3*t[0]+.59*t[1]+.11*t[2]).toFixed(0),10),i=t[3];return this.setSource([e,e,e,i]),this},toBlackWhite:function(t){var e=this.getSource(),i=(.3*e[0]+.59*e[1]+.11*e[2]).toFixed(0),n=e[3];return t=t||127,i=Number(i)<Number(t)?0:255,this.setSource([i,i,i,n]),this},overlayWith:function(t){t instanceof i||(t=new i(t));var e,n=[],r=this.getAlpha(),o=this.getSource(),a=t.getSource();for(e=0;e<3;e++)n.push(Math.round(.5*o[e]+.5*a[e]));return n[3]=r,this.setSource(n),this}},e.Color.reRGBa=/^rgba?\(\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*(?:\s*,\s*((?:\d*\.?\d+)?)\s*)?\)$/i,e.Color.reHSLa=/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i,e.Color.reHex=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,e.Color.colorNameMap={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:"#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",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"},e.Color.fromRgb=function(t){return i.fromSource(i.sourceFromRgb(t))},e.Color.sourceFromRgb=function(t){var e=t.match(i.reRGBa);if(e){var n=parseInt(e[1],10)/(/%$/.test(e[1])?100:1)*(/%$/.test(e[1])?255:1),r=parseInt(e[2],10)/(/%$/.test(e[2])?100:1)*(/%$/.test(e[2])?255:1),o=parseInt(e[3],10)/(/%$/.test(e[3])?100:1)*(/%$/.test(e[3])?255:1);return[parseInt(n,10),parseInt(r,10),parseInt(o,10),e[4]?parseFloat(e[4]):1]}},e.Color.fromRgba=i.fromRgb,e.Color.fromHsl=function(t){return i.fromSource(i.sourceFromHsl(t))},e.Color.sourceFromHsl=function(t){var e=t.match(i.reHSLa);if(e){var r,o,a,s=(parseFloat(e[1])%360+360)%360/360,l=parseFloat(e[2])/(/%$/.test(e[2])?100:1),c=parseFloat(e[3])/(/%$/.test(e[3])?100:1);if(0===l)r=o=a=c;else{var h=c<=.5?c*(l+1):c+l-c*l,u=2*c-h;r=n(u,h,s+1/3),o=n(u,h,s),a=n(u,h,s-1/3)}return[Math.round(255*r),Math.round(255*o),Math.round(255*a),e[4]?parseFloat(e[4]):1]}},e.Color.fromHsla=i.fromHsl,e.Color.fromHex=function(t){return i.fromSource(i.sourceFromHex(t))},e.Color.sourceFromHex=function(t){if(t.match(i.reHex)){var e=t.slice(t.indexOf("#")+1),n=3===e.length||4===e.length,r=8===e.length||4===e.length,o=n?e.charAt(0)+e.charAt(0):e.substring(0,2),a=n?e.charAt(1)+e.charAt(1):e.substring(2,4),s=n?e.charAt(2)+e.charAt(2):e.substring(4,6),l=r?n?e.charAt(3)+e.charAt(3):e.substring(6,8):"FF";return[parseInt(o,16),parseInt(a,16),parseInt(s,16),parseFloat((parseInt(l,16)/255).toFixed(2))]}},e.Color.fromSource=function(t){var e=new i;return e.setSource(t),e})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=["e","se","s","sw","w","nw","n","ne","e"],n=["ns","nesw","ew","nwse"],r={},o="left",a="top",s={top:"bottom",bottom:a,left:"right",right:o,center:"center"},l=e.util.radiansToDegrees,c=Math.sign||function(t){return(t>0)-(t<0)||+t};function h(t,e){var i=t.angle+l(Math.atan2(e.y,e.x))+360;return Math.round(i%360/45)}function u(t,i){var n=i.transform.target,r=n.canvas,o=e.util.object.clone(i);o.target=n,r&&r.fire("object:"+t,o),n.fire(t,i)}function f(t,e){var i=e.canvas,n=t[i.uniScaleKey];return i.uniformScaling&&!n||!i.uniformScaling&&n}function d(t){return"center"===t.originX&&"center"===t.originY}function v(t,e,i){var n=t.lockScalingX,r=t.lockScalingY;return!(!n||!r)||(!(e||!n&&!r||!i)||(!(!n||"x"!==e)||!(!r||"y"!==e)))}function g(t,e,i,n){return{e:t,transform:e,pointer:{x:i,y:n}}}function p(t){return function(e,i,n,r){var o=i.target,a=o.getCenterPoint(),s=o.translateToOriginPoint(a,i.originX,i.originY),l=t(e,i,n,r);return o.setPositionByOrigin(s,i.originX,i.originY),l}}function m(t,e){return function(i,n,r,o){var a=e(i,n,r,o);return a&&u(t,g(i,n,r,o)),a}}function y(t,i,n,r,o){var a=t.target,s=a.controls[t.corner],l=a.canvas.getZoom(),c=a.padding/l,h=a.toLocalPoint(new e.Point(r,o),i,n);return h.x>=c&&(h.x-=c),h.x<=-c&&(h.x+=c),h.y>=c&&(h.y-=c),h.y<=c&&(h.y+=c),h.x-=s.offsetX,h.y-=s.offsetY,h}function b(t){return t.flipX!==t.flipY}function w(t,e,i,n,r){if(0!==t[e]){var o=r/t._getTransformedDimensions()[n]*t[i];t.set(i,o)}}function x(t,e,i,n){var r,s=e.target,c=s._getTransformedDimensions(0,s.skewY),h=y(e,e.originX,e.originY,i,n),u=Math.abs(2*h.x)-c.x,f=s.skewX;u<2?r=0:(r=l(Math.atan2(u/s.scaleX,c.y/s.scaleY)),e.originX===o&&"bottom"===e.originY&&(r=-r),"right"===e.originX&&e.originY===a&&(r=-r),b(s)&&(r=-r));var d=f!==r;if(d){var v=s._getTransformedDimensions().y;s.set("skewX",r),w(s,"skewY","scaleY","y",v)}return d}function C(t,e,i,n){var r,s=e.target,c=s._getTransformedDimensions(s.skewX,0),h=y(e,e.originX,e.originY,i,n),u=Math.abs(2*h.y)-c.y,f=s.skewY;u<2?r=0:(r=l(Math.atan2(u/s.scaleY,c.x/s.scaleX)),e.originX===o&&"bottom"===e.originY&&(r=-r),"right"===e.originX&&e.originY===a&&(r=-r),b(s)&&(r=-r));var d=f!==r;if(d){var v=s._getTransformedDimensions().x;s.set("skewY",r),w(s,"skewX","scaleX","x",v)}return d}function k(t,e,i,n,r){r=r||{};var o,a,l,h,u,g,p=e.target,m=p.lockScalingX,b=p.lockScalingY,w=r.by,x=f(t,p),C=v(p,w,x),k=e.gestureScale;if(C)return!1;if(k)a=e.scaleX*k,l=e.scaleY*k;else{if(o=y(e,e.originX,e.originY,i,n),u="y"!==w?c(o.x):1,g="x"!==w?c(o.y):1,e.signX||(e.signX=u),e.signY||(e.signY=g),p.lockScalingFlip&&(e.signX!==u||e.signY!==g))return!1;if(h=p._getTransformedDimensions(),x&&!w){var _=Math.abs(o.x)+Math.abs(o.y),S=e.original,T=_/(Math.abs(h.x*S.scaleX/p.scaleX)+Math.abs(h.y*S.scaleY/p.scaleY));a=S.scaleX*T,l=S.scaleY*T}else a=Math.abs(o.x*p.scaleX/h.x),l=Math.abs(o.y*p.scaleY/h.y);d(e)&&(a*=2,l*=2),e.signX!==u&&"y"!==w&&(e.originX=s[e.originX],a*=-1,e.signX=u),e.signY!==g&&"x"!==w&&(e.originY=s[e.originY],l*=-1,e.signY=g)}var O=p.scaleX,E=p.scaleY;return w?("x"===w&&p.set("scaleX",a),"y"===w&&p.set("scaleY",l)):(!m&&p.set("scaleX",a),!b&&p.set("scaleY",l)),O!==p.scaleX||E!==p.scaleY}r.scaleCursorStyleHandler=function(t,e,n){var r=f(t,n),o="";if(0!==e.x&&0===e.y?o="x":0===e.x&&0!==e.y&&(o="y"),v(n,o,r))return"not-allowed";var a=h(n,e);return i[a]+"-resize"},r.skewCursorStyleHandler=function(t,e,i){if(0!==e.x&&i.lockSkewingY)return"not-allowed";if(0!==e.y&&i.lockSkewingX)return"not-allowed";var r=h(i,e)%4;return n[r]+"-resize"},r.scaleSkewCursorStyleHandler=function(t,e,i){return t[i.canvas.altActionKey]?r.skewCursorStyleHandler(t,e,i):r.scaleCursorStyleHandler(t,e,i)},r.rotationWithSnapping=m("rotating",p((function(t,e,i,n){var r=e,o=r.target,a=o.translateToOriginPoint(o.getCenterPoint(),r.originX,r.originY);if(o.lockRotation)return!1;var s,c=Math.atan2(r.ey-a.y,r.ex-a.x),h=Math.atan2(n-a.y,i-a.x),u=l(h-c+r.theta);if(o.snapAngle>0){var f=o.snapAngle,d=o.snapThreshold||f,v=Math.ceil(u/f)*f,g=Math.floor(u/f)*f;Math.abs(u-g)<d?u=g:Math.abs(u-v)<d&&(u=v)}return u<0&&(u=360+u),u%=360,s=o.angle!==u,o.angle=u,s}))),r.scalingEqually=m("scaling",p((function(t,e,i,n){return k(t,e,i,n)}))),r.scalingX=m("scaling",p((function(t,e,i,n){return k(t,e,i,n,{by:"x"})}))),r.scalingY=m("scaling",p((function(t,e,i,n){return k(t,e,i,n,{by:"y"})}))),r.scalingYOrSkewingX=function(t,e,i,n){return t[e.target.canvas.altActionKey]?r.skewHandlerX(t,e,i,n):r.scalingY(t,e,i,n)},r.scalingXOrSkewingY=function(t,e,i,n){return t[e.target.canvas.altActionKey]?r.skewHandlerY(t,e,i,n):r.scalingX(t,e,i,n)},r.changeWidth=m("resizing",p((function(t,e,i,n){var r=e.target,o=y(e,e.originX,e.originY,i,n),a=r.strokeWidth/(r.strokeUniform?r.scaleX:1),s=d(e)?2:1,l=r.width,c=Math.abs(o.x*s/r.scaleX)-a;return r.set("width",Math.max(c,0)),l!==c}))),r.skewHandlerX=function(t,e,i,n){var r,s=e.target,l=s.skewX,c=e.originY;return!s.lockSkewingX&&(0===l?r=y(e,"center","center",i,n).x>0?o:"right":(l>0&&(r=c===a?o:"right"),l<0&&(r=c===a?"right":o),b(s)&&(r=r===o?"right":o)),e.originX=r,m("skewing",p(x))(t,e,i,n))},r.skewHandlerY=function(t,e,i,n){var r,s=e.target,l=s.skewY,c=e.originX;return!s.lockSkewingY&&(0===l?r=y(e,"center","center",i,n).y>0?a:"bottom":(l>0&&(r=c===o?a:"bottom"),l<0&&(r=c===o?"bottom":a),b(s)&&(r=r===a?"bottom":a)),e.originY=r,m("skewing",p(C))(t,e,i,n))},r.dragHandler=function(t,e,i,n){var r=e.target,o=i-e.offsetX,a=n-e.offsetY,s=!r.get("lockMovementX")&&r.left!==o,l=!r.get("lockMovementY")&&r.top!==a;return s&&r.set("left",o),l&&r.set("top",a),(s||l)&&u("moving",g(t,e,i,n)),s||l},r.scaleOrSkewActionName=function(t,e,i){var n=t[i.canvas.altActionKey];return 0===e.x?n?"skewX":"scaleY":0===e.y?n?"skewY":"scaleX":void 0},r.rotationStyleHandler=function(t,e,i){return i.lockRotation?"not-allowed":e.cursorStyle},r.fireEvent=u,r.wrapWithFixedAnchor=p,r.wrapWithFireEvent=m,r.getLocalPoint=y,e.controlsUtils=r}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.degreesToRadians,n=e.controlsUtils;n.renderCircleControl=function(t,e,i,n,r){n=n||{};var o,a=this.sizeX||n.cornerSize||r.cornerSize,s=this.sizeY||n.cornerSize||r.cornerSize,l=void 0!==n.transparentCorners?n.transparentCorners:r.transparentCorners,c=l?"stroke":"fill",h=!l&&(n.cornerStrokeColor||r.cornerStrokeColor),u=e,f=i;t.save(),t.fillStyle=n.cornerColor||r.cornerColor,t.strokeStyle=n.cornerStrokeColor||r.cornerStrokeColor,a>s?(o=a,t.scale(1,s/a),f=i*a/s):s>a?(o=s,t.scale(a/s,1),u=e*s/a):o=a,t.lineWidth=1,t.beginPath(),t.arc(u,f,o/2,0,2*Math.PI,!1),t[c](),h&&t.stroke(),t.restore()},n.renderSquareControl=function(t,e,n,r,o){r=r||{};var a=this.sizeX||r.cornerSize||o.cornerSize,s=this.sizeY||r.cornerSize||o.cornerSize,l=void 0!==r.transparentCorners?r.transparentCorners:o.transparentCorners,c=l?"stroke":"fill",h=!l&&(r.cornerStrokeColor||o.cornerStrokeColor),u=a/2,f=s/2;t.save(),t.fillStyle=r.cornerColor||o.cornerColor,t.strokeStyle=r.cornerStrokeColor||o.cornerStrokeColor,t.lineWidth=1,t.translate(e,n),t.rotate(i(o.angle)),t[c+"Rect"](-u,-f,a,s),h&&t.strokeRect(-u,-f,a,s),t.restore()}}(e),function(t){"use strict";var e=t.fabric||(t.fabric={});e.Control=function(t){for(var e in t)this[e]=t[e]},e.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(t,e){return e.cursorStyle},getActionName:function(t,e){return e.actionName},getVisibility:function(t,e){var i=t._controlsVisibility;return i&&void 0!==i[e]?i[e]:this.visible},setVisibility:function(t){this.visible=t},positionHandler:function(t,i){return e.util.transformPoint({x:this.x*t.x+this.offsetX,y:this.y*t.y+this.offsetY},i)},calcCornerCoords:function(t,i,n,r,o){var a,s,l,c,h=o?this.touchSizeX:this.sizeX,u=o?this.touchSizeY:this.sizeY;if(h&&u&&h!==u){var f=Math.atan2(u,h),d=Math.sqrt(h*h+u*u)/2,v=f-e.util.degreesToRadians(t),g=Math.PI/2-f-e.util.degreesToRadians(t);a=d*e.util.cos(v),s=d*e.util.sin(v),l=d*e.util.cos(g),c=d*e.util.sin(g)}else{d=.7071067812*(h&&u?h:i);v=e.util.degreesToRadians(45-t);a=l=d*e.util.cos(v),s=c=d*e.util.sin(v)}return{tl:{x:n-c,y:r-l},tr:{x:n+a,y:r-s},bl:{x:n-a,y:r+s},br:{x:n+c,y:r+l}}},render:function(t,i,n,r,o){switch((r=r||{}).cornerStyle||o.cornerStyle){case"circle":e.controlsUtils.renderCircleControl.call(this,t,i,n,r,o);break;default:e.controlsUtils.renderSquareControl.call(this,t,i,n,r,o)}}}}(e),function(){function t(t,e){var i,n,r,o,a=t.getAttribute("style"),s=t.getAttribute("offset")||0;if(s=(s=parseFloat(s)/(/%$/.test(s)?100:1))<0?0:s>1?1:s,a){var l=a.split(/\s*;\s*/);for(""===l[l.length-1]&&l.pop(),o=l.length;o--;){var c=l[o].split(/\s*:\s*/),h=c[0].trim(),u=c[1].trim();"stop-color"===h?i=u:"stop-opacity"===h&&(r=u)}}return i||(i=t.getAttribute("stop-color")||"rgb(0,0,0)"),r||(r=t.getAttribute("stop-opacity")),n=(i=new S.Color(i)).getAlpha(),r=isNaN(parseFloat(r))?1:parseFloat(r),r*=n*e,{offset:s,color:i.toRgb(),opacity:r}}var e=S.util.object.clone;S.Gradient=S.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(t){t||(t={}),t.coords||(t.coords={});var e,i=this;Object.keys(t).forEach((function(e){i[e]=t[e]})),this.id?this.id+="_"+S.Object.__uid++:this.id=S.Object.__uid++,e={x1:t.coords.x1||0,y1:t.coords.y1||0,x2:t.coords.x2||0,y2:t.coords.y2||0},"radial"===this.type&&(e.r1=t.coords.r1||0,e.r2=t.coords.r2||0),this.coords=e,this.colorStops=t.colorStops.slice()},addColorStop:function(t){for(var e in t){var i=new S.Color(t[e]);this.colorStops.push({offset:parseFloat(e),color:i.toRgb(),opacity:i.getAlpha()})}return this},toObject:function(t){var e={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return S.util.populateWithProperties(this,e,t),e},toSVG:function(t,i){var n,r,o,a,s=e(this.coords,!0),l=(i=i||{},e(this.colorStops,!0)),c=s.r1>s.r2,h=this.gradientTransform?this.gradientTransform.concat():S.iMatrix.concat(),u=-this.offsetX,f=-this.offsetY,d=!!i.additionalTransform,v="pixels"===this.gradientUnits?"userSpaceOnUse":"objectBoundingBox";if(l.sort((function(t,e){return t.offset-e.offset})),"objectBoundingBox"===v?(u/=t.width,f/=t.height):(u+=t.width/2,f+=t.height/2),"path"===t.type&&"percentage"!==this.gradientUnits&&(u-=t.pathOffset.x,f-=t.pathOffset.y),h[4]-=u,h[5]-=f,a='id="SVGID_'+this.id+'" gradientUnits="'+v+'"',a+=' gradientTransform="'+(d?i.additionalTransform+" ":"")+S.util.matrixToSVG(h)+'" ',"linear"===this.type?o=["<linearGradient ",a,' x1="',s.x1,'" y1="',s.y1,'" x2="',s.x2,'" y2="',s.y2,'">\n']:"radial"===this.type&&(o=["<radialGradient ",a,' cx="',c?s.x1:s.x2,'" cy="',c?s.y1:s.y2,'" r="',c?s.r1:s.r2,'" fx="',c?s.x2:s.x1,'" fy="',c?s.y2:s.y1,'">\n']),"radial"===this.type){if(c)for((l=l.concat()).reverse(),n=0,r=l.length;n<r;n++)l[n].offset=1-l[n].offset;var g=Math.min(s.r1,s.r2);if(g>0){var p=g/Math.max(s.r1,s.r2);for(n=0,r=l.length;n<r;n++)l[n].offset+=p*(1-l[n].offset)}}for(n=0,r=l.length;n<r;n++){var m=l[n];o.push("<stop ",'offset="',100*m.offset+"%",'" style="stop-color:',m.color,void 0!==m.opacity?";stop-opacity: "+m.opacity:";",'"/>\n')}return o.push("linear"===this.type?"</linearGradient>\n":"</radialGradient>\n"),o.join("")},toLive:function(t){var e,i,n,r=S.util.object.clone(this.coords);if(this.type){for("linear"===this.type?e=t.createLinearGradient(r.x1,r.y1,r.x2,r.y2):"radial"===this.type&&(e=t.createRadialGradient(r.x1,r.y1,r.r1,r.x2,r.y2,r.r2)),i=0,n=this.colorStops.length;i<n;i++){var o=this.colorStops[i].color,a=this.colorStops[i].opacity,s=this.colorStops[i].offset;void 0!==a&&(o=new S.Color(o).setAlpha(a).toRgba()),e.addColorStop(s,o)}return e}}}),S.util.object.extend(S.Gradient,{fromElement:function(e,i,n,r){var o=parseFloat(n)/(/%$/.test(n)?100:1);o=o<0?0:o>1?1:o,isNaN(o)&&(o=1);var a,s,l,c,h=e.getElementsByTagName("stop"),u="userSpaceOnUse"===e.getAttribute("gradientUnits")?"pixels":"percentage",f=e.getAttribute("gradientTransform")||"",d=[],v=0,g=0;for("linearGradient"===e.nodeName||"LINEARGRADIENT"===e.nodeName?(a="linear",s=function(t){return{x1:t.getAttribute("x1")||0,y1:t.getAttribute("y1")||0,x2:t.getAttribute("x2")||"100%",y2:t.getAttribute("y2")||0}}(e)):(a="radial",s=function(t){return{x1:t.getAttribute("fx")||t.getAttribute("cx")||"50%",y1:t.getAttribute("fy")||t.getAttribute("cy")||"50%",r1:0,x2:t.getAttribute("cx")||"50%",y2:t.getAttribute("cy")||"50%",r2:t.getAttribute("r")||"50%"}}(e)),l=h.length;l--;)d.push(t(h[l],o));return c=S.parseTransformAttribute(f),function(t,e,i,n){var r,o;Object.keys(e).forEach((function(t){"Infinity"===(r=e[t])?o=1:"-Infinity"===r?o=0:(o=parseFloat(e[t],10),"string"==typeof r&&/^(\d+\.\d+)%|(\d+)%$/.test(r)&&(o*=.01,"pixels"===n&&("x1"!==t&&"x2"!==t&&"r2"!==t||(o*=i.viewBoxWidth||i.width),"y1"!==t&&"y2"!==t||(o*=i.viewBoxHeight||i.height)))),e[t]=o}))}(0,s,r,u),"pixels"===u&&(v=-i.left,g=-i.top),new S.Gradient({id:e.getAttribute("id"),type:a,coords:s,colorStops:d,gradientUnits:u,gradientTransform:c,offsetX:v,offsetY:g})}})}(),function(){"use strict";var t=S.util.toFixed;S.Pattern=S.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(t,e){if(t||(t={}),this.id=S.Object.__uid++,this.setOptions(t),!t.source||t.source&&"string"!=typeof t.source)e&&e(this);else{var i=this;this.source=S.util.createImage(),S.util.loadImage(t.source,(function(t,n){i.source=t,e&&e(i,n)}),null,this.crossOrigin)}},toObject:function(e){var i,n,r=S.Object.NUM_FRACTION_DIGITS;return"string"==typeof this.source.src?i=this.source.src:"object"==typeof this.source&&this.source.toDataURL&&(i=this.source.toDataURL()),n={type:"pattern",source:i,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:t(this.offsetX,r),offsetY:t(this.offsetY,r),patternTransform:this.patternTransform?this.patternTransform.concat():null},S.util.populateWithProperties(this,n,e),n},toSVG:function(t){var e="function"==typeof this.source?this.source():this.source,i=e.width/t.width,n=e.height/t.height,r=this.offsetX/t.width,o=this.offsetY/t.height,a="";return"repeat-x"!==this.repeat&&"no-repeat"!==this.repeat||(n=1,o&&(n+=Math.abs(o))),"repeat-y"!==this.repeat&&"no-repeat"!==this.repeat||(i=1,r&&(i+=Math.abs(r))),e.src?a=e.src:e.toDataURL&&(a=e.toDataURL()),'<pattern id="SVGID_'+this.id+'" x="'+r+'" y="'+o+'" width="'+i+'" height="'+n+'">\n<image x="0" y="0" width="'+e.width+'" height="'+e.height+'" xlink:href="'+a+'"></image>\n</pattern>\n'},setOptions:function(t){for(var e in t)this[e]=t[e]},toLive:function(t){var e=this.source;if(!e)return"";if(void 0!==e.src){if(!e.complete)return"";if(0===e.naturalWidth||0===e.naturalHeight)return""}return t.createPattern(e,this.repeat)}})}(),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.toFixed;e.Shadow?e.warn("fabric.Shadow is already defined."):(e.Shadow=e.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(t){for(var i in"string"==typeof t&&(t=this._parseShadow(t)),t)this[i]=t[i];this.id=e.Object.__uid++},_parseShadow:function(t){var i=t.trim(),n=e.Shadow.reOffsetsAndBlur.exec(i)||[];return{color:(i.replace(e.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)").trim(),offsetX:parseFloat(n[1],10)||0,offsetY:parseFloat(n[2],10)||0,blur:parseFloat(n[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(t){var n=40,r=40,o=e.Object.NUM_FRACTION_DIGITS,a=e.util.rotateVector({x:this.offsetX,y:this.offsetY},e.util.degreesToRadians(-t.angle)),s=new e.Color(this.color);return t.width&&t.height&&(n=100*i((Math.abs(a.x)+this.blur)/t.width,o)+20,r=100*i((Math.abs(a.y)+this.blur)/t.height,o)+20),t.flipX&&(a.x*=-1),t.flipY&&(a.y*=-1),'<filter id="SVGID_'+this.id+'" y="-'+r+'%" height="'+(100+2*r)+'%" x="-'+n+'%" width="'+(100+2*n)+'%" >\n\t<feGaussianBlur in="SourceAlpha" stdDeviation="'+i(this.blur?this.blur/2:0,o)+'"></feGaussianBlur>\n\t<feOffset dx="'+i(a.x,o)+'" dy="'+i(a.y,o)+'" result="oBlur" ></feOffset>\n\t<feFlood flood-color="'+s.toRgb()+'" flood-opacity="'+s.getAlpha()+'"/>\n\t<feComposite in2="oBlur" operator="in" />\n\t<feMerge>\n\t\t<feMergeNode></feMergeNode>\n\t\t<feMergeNode in="SourceGraphic"></feMergeNode>\n\t</feMerge>\n</filter>\n'},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var t={},i=e.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach((function(e){this[e]!==i[e]&&(t[e]=this[e])}),this),t}}),e.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/)}(e),function(){"use strict";if(S.StaticCanvas)S.warn("fabric.StaticCanvas is already defined.");else{var t=S.util.object.extend,e=S.util.getElementOffset,i=S.util.removeFromArray,n=S.util.toFixed,r=S.util.transformPoint,o=S.util.invertTransform,a=S.util.getNodeCanvas,s=S.util.createCanvasElement,l=new Error("Could not initialize `canvas` element");S.StaticCanvas=S.util.createClass(S.CommonMethods,{initialize:function(t,e){e||(e={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(t,e)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:S.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(t,e){var i=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(t),this._initOptions(e),this.interactive||this._initRetinaScaling(),e.overlayImage&&this.setOverlayImage(e.overlayImage,i),e.backgroundImage&&this.setBackgroundImage(e.backgroundImage,i),e.backgroundColor&&this.setBackgroundColor(e.backgroundColor,i),e.overlayColor&&this.setOverlayColor(e.overlayColor,i),this.calcOffset()},_isRetinaScaling:function(){return 1!==S.devicePixelRatio&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?S.devicePixelRatio:1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var t=S.devicePixelRatio;this.__initRetinaScaling(t,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(t,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(t,e,i){e.setAttribute("width",this.width*t),e.setAttribute("height",this.height*t),i.scale(t,t)},calcOffset:function(){return this._offset=e(this.lowerCanvasEl),this},setOverlayImage:function(t,e,i){return this.__setBgOverlayImage("overlayImage",t,e,i)},setBackgroundImage:function(t,e,i){return this.__setBgOverlayImage("backgroundImage",t,e,i)},setOverlayColor:function(t,e){return this.__setBgOverlayColor("overlayColor",t,e)},setBackgroundColor:function(t,e){return this.__setBgOverlayColor("backgroundColor",t,e)},__setBgOverlayImage:function(t,e,i,n){return"string"==typeof e?S.util.loadImage(e,(function(e,r){if(e){var o=new S.Image(e,n);this[t]=o,o.canvas=this}i&&i(e,r)}),this,n&&n.crossOrigin):(n&&e.setOptions(n),this[t]=e,e&&(e.canvas=this),i&&i(e,!1)),this},__setBgOverlayColor:function(t,e,i){return this[t]=e,this._initGradient(e,t),this._initPattern(e,t,i),this},_createCanvasElement:function(){var t=s();if(!t)throw l;if(t.style||(t.style={}),void 0===t.getContext)throw l;return t},_initOptions:function(t){var e=this.lowerCanvasEl;this._setOptions(t),this.width=this.width||parseInt(e.width,10)||0,this.height=this.height||parseInt(e.height,10)||0,this.lowerCanvasEl.style&&(e.width=this.width,e.height=this.height,e.style.width=this.width+"px",e.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(t){t&&t.getContext?this.lowerCanvasEl=t:this.lowerCanvasEl=S.util.getById(t)||this._createCanvasElement(),S.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(t,e){return this.setDimensions({width:t},e)},setHeight:function(t,e){return this.setDimensions({height:t},e)},setDimensions:function(t,e){var i;for(var n in e=e||{},t)i=t[n],e.cssOnly||(this._setBackstoreDimension(n,t[n]),i+="px",this.hasLostContext=!0),e.backstoreOnly||this._setCssDimension(n,i);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(),this._initRetinaScaling(),this.calcOffset(),e.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(t,e){return this.lowerCanvasEl[t]=e,this.upperCanvasEl&&(this.upperCanvasEl[t]=e),this.cacheCanvasEl&&(this.cacheCanvasEl[t]=e),this[t]=e,this},_setCssDimension:function(t,e){return this.lowerCanvasEl.style[t]=e,this.upperCanvasEl&&(this.upperCanvasEl.style[t]=e),this.wrapperEl&&(this.wrapperEl.style[t]=e),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(t){var e,i,n,r=this._activeObject,o=this.backgroundImage,a=this.overlayImage;for(this.viewportTransform=t,i=0,n=this._objects.length;i<n;i++)(e=this._objects[i]).group||e.setCoords(!0);return r&&r.setCoords(),o&&o.setCoords(!0),a&&a.setCoords(!0),this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll(),this},zoomToPoint:function(t,e){var i=t,n=this.viewportTransform.slice(0);t=r(t,o(this.viewportTransform)),n[0]=e,n[3]=e;var a=r(t,n);return n[4]+=i.x-a.x,n[5]+=i.y-a.y,this.setViewportTransform(n)},setZoom:function(t){return this.zoomToPoint(new S.Point(0,0),t),this},absolutePan:function(t){var e=this.viewportTransform.slice(0);return e[4]=-t.x,e[5]=-t.y,this.setViewportTransform(e)},relativePan:function(t){return this.absolutePan(new S.Point(-t.x-this.viewportTransform[4],-t.y-this.viewportTransform[5]))},getElement:function(){return this.lowerCanvasEl},_onObjectAdded:function(t){this.stateful&&t.setupState(),t._set("canvas",this),t.setCoords(),this.fire("object:added",{target:t}),t.fire("added")},_onObjectRemoved:function(t){this.fire("object:removed",{target:t}),t.fire("removed"),delete t.canvas},clearContext:function(t){return t.clearRect(0,0,this.width,this.height),this},getContext:function(){return this.contextContainer},clear:function(){return this.remove.apply(this,this.getObjects()),this.backgroundImage=null,this.overlayImage=null,this.backgroundColor="",this.overlayColor="",this._hasITextHandlers&&(this.off("mouse:up",this._mouseUpITextHandler),this._iTextInstances=null,this._hasITextHandlers=!1),this.clearContext(this.contextContainer),this.fire("canvas:cleared"),this.renderOnAddRemove&&this.requestRenderAll(),this},renderAll:function(){var t=this.contextContainer;return this.renderCanvas(t,this._objects),this},renderAndReset:function(){this.isRendering=0,this.renderAll()},requestRenderAll:function(){return this.isRendering||(this.isRendering=S.util.requestAnimFrame(this.renderAndResetBound)),this},calcViewportBoundaries:function(){var t={},e=this.width,i=this.height,n=o(this.viewportTransform);return t.tl=r({x:0,y:0},n),t.br=r({x:e,y:i},n),t.tr=new S.Point(t.br.x,t.tl.y),t.bl=new S.Point(t.tl.x,t.br.y),this.vptCoords=t,t},cancelRequestedRender:function(){this.isRendering&&(S.util.cancelAnimFrame(this.isRendering),this.isRendering=0)},renderCanvas:function(t,e){var i=this.viewportTransform,n=this.clipPath;this.cancelRequestedRender(),this.calcViewportBoundaries(),this.clearContext(t),S.util.setImageSmoothing(t,this.imageSmoothingEnabled),this.fire("before:render",{ctx:t}),this._renderBackground(t),t.save(),t.transform(i[0],i[1],i[2],i[3],i[4],i[5]),this._renderObjects(t,e),t.restore(),!this.controlsAboveOverlay&&this.interactive&&this.drawControls(t),n&&(n.canvas=this,n.shouldCache(),n._transformDone=!0,n.renderCache({forClipping:!0}),this.drawClipPathOnCanvas(t)),this._renderOverlay(t),this.controlsAboveOverlay&&this.interactive&&this.drawControls(t),this.fire("after:render",{ctx:t})},drawClipPathOnCanvas:function(t){var e=this.viewportTransform,i=this.clipPath;t.save(),t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t.globalCompositeOperation="destination-in",i.transform(t),t.scale(1/i.zoomX,1/i.zoomY),t.drawImage(i._cacheCanvas,-i.cacheTranslationX,-i.cacheTranslationY),t.restore()},_renderObjects:function(t,e){var i,n;for(i=0,n=e.length;i<n;++i)e[i]&&e[i].render(t)},_renderBackgroundOrOverlay:function(t,e){var i=this[e+"Color"],n=this[e+"Image"],r=this.viewportTransform,o=this[e+"Vpt"];if(i||n){if(i){t.save(),t.beginPath(),t.moveTo(0,0),t.lineTo(this.width,0),t.lineTo(this.width,this.height),t.lineTo(0,this.height),t.closePath(),t.fillStyle=i.toLive?i.toLive(t,this):i,o&&t.transform(r[0],r[1],r[2],r[3],r[4],r[5]),t.transform(1,0,0,1,i.offsetX||0,i.offsetY||0);var a=i.gradientTransform||i.patternTransform;a&&t.transform(a[0],a[1],a[2],a[3],a[4],a[5]),t.fill(),t.restore()}n&&(t.save(),o&&t.transform(r[0],r[1],r[2],r[3],r[4],r[5]),n.render(t),t.restore())}},_renderBackground:function(t){this._renderBackgroundOrOverlay(t,"background")},_renderOverlay:function(t){this._renderBackgroundOrOverlay(t,"overlay")},getCenter:function(){return{top:this.height/2,left:this.width/2}},centerObjectH:function(t){return this._centerObject(t,new S.Point(this.getCenter().left,t.getCenterPoint().y))},centerObjectV:function(t){return this._centerObject(t,new S.Point(t.getCenterPoint().x,this.getCenter().top))},centerObject:function(t){var e=this.getCenter();return this._centerObject(t,new S.Point(e.left,e.top))},viewportCenterObject:function(t){var e=this.getVpCenter();return this._centerObject(t,e)},viewportCenterObjectH:function(t){var e=this.getVpCenter();return this._centerObject(t,new S.Point(e.x,t.getCenterPoint().y)),this},viewportCenterObjectV:function(t){var e=this.getVpCenter();return this._centerObject(t,new S.Point(t.getCenterPoint().x,e.y))},getVpCenter:function(){var t=this.getCenter(),e=o(this.viewportTransform);return r({x:t.left,y:t.top},e)},_centerObject:function(t,e){return t.setPositionByOrigin(e,"center","center"),t.setCoords(),this.renderOnAddRemove&&this.requestRenderAll(),this},toDatalessJSON:function(t){return this.toDatalessObject(t)},toObject:function(t){return this._toObjectMethod("toObject",t)},toDatalessObject:function(t){return this._toObjectMethod("toDatalessObject",t)},_toObjectMethod:function(e,i){var n=this.clipPath,r={version:S.version,objects:this._toObjects(e,i)};return n&&!n.excludeFromExport&&(r.clipPath=this._toObject(this.clipPath,e,i)),t(r,this.__serializeBgOverlay(e,i)),S.util.populateWithProperties(this,r,i),r},_toObjects:function(t,e){return this._objects.filter((function(t){return!t.excludeFromExport})).map((function(i){return this._toObject(i,t,e)}),this)},_toObject:function(t,e,i){var n;this.includeDefaultValues||(n=t.includeDefaultValues,t.includeDefaultValues=!1);var r=t[e](i);return this.includeDefaultValues||(t.includeDefaultValues=n),r},__serializeBgOverlay:function(t,e){var i={},n=this.backgroundImage,r=this.overlayImage,o=this.backgroundColor,a=this.overlayColor;return o&&o.toObject?o.excludeFromExport||(i.background=o.toObject(e)):o&&(i.background=o),a&&a.toObject?a.excludeFromExport||(i.overlay=a.toObject(e)):a&&(i.overlay=a),n&&!n.excludeFromExport&&(i.backgroundImage=this._toObject(n,t,e)),r&&!r.excludeFromExport&&(i.overlayImage=this._toObject(r,t,e)),i},svgViewportTransformation:!0,toSVG:function(t,e){t||(t={}),t.reviver=e;var i=[];return this._setSVGPreamble(i,t),this._setSVGHeader(i,t),this.clipPath&&i.push('<g clip-path="url(#'+this.clipPath.clipPathId+')" >\n'),this._setSVGBgOverlayColor(i,"background"),this._setSVGBgOverlayImage(i,"backgroundImage",e),this._setSVGObjects(i,e),this.clipPath&&i.push("</g>\n"),this._setSVGBgOverlayColor(i,"overlay"),this._setSVGBgOverlayImage(i,"overlayImage",e),i.push("</svg>"),i.join("")},_setSVGPreamble:function(t,e){e.suppressPreamble||t.push('<?xml version="1.0" encoding="',e.encoding||"UTF-8",'" standalone="no" ?>\n','<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ','"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')},_setSVGHeader:function(t,e){var i,r=e.width||this.width,o=e.height||this.height,a='viewBox="0 0 '+this.width+" "+this.height+'" ',s=S.Object.NUM_FRACTION_DIGITS;e.viewBox?a='viewBox="'+e.viewBox.x+" "+e.viewBox.y+" "+e.viewBox.width+" "+e.viewBox.height+'" ':this.svgViewportTransformation&&(i=this.viewportTransform,a='viewBox="'+n(-i[4]/i[0],s)+" "+n(-i[5]/i[3],s)+" "+n(this.width/i[0],s)+" "+n(this.height/i[3],s)+'" '),t.push("<svg ",'xmlns="http://www.w3.org/2000/svg" ','xmlns:xlink="http://www.w3.org/1999/xlink" ','version="1.1" ','width="',r,'" ','height="',o,'" ',a,'xml:space="preserve">\n',"<desc>Created with Fabric.js ",S.version,"</desc>\n","<defs>\n",this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(e),"</defs>\n")},createSVGClipPathMarkup:function(t){var e=this.clipPath;return e?(e.clipPathId="CLIPPATH_"+S.Object.__uid++,'<clipPath id="'+e.clipPathId+'" >\n'+this.clipPath.toClipPathSVG(t.reviver)+"</clipPath>\n"):""},createSVGRefElementsMarkup:function(){var t=this;return["background","overlay"].map((function(e){var i=t[e+"Color"];if(i&&i.toLive){var n=t[e+"Vpt"],r=t.viewportTransform,o={width:t.width/(n?r[0]:1),height:t.height/(n?r[3]:1)};return i.toSVG(o,{additionalTransform:n?S.util.matrixToSVG(r):""})}})).join("")},createSVGFontFacesMarkup:function(){var t,e,i,n,r,o,a,s,l="",c={},h=S.fontPaths,u=[];for(this._objects.forEach((function t(e){u.push(e),e._objects&&e._objects.forEach(t)})),a=0,s=u.length;a<s;a++)if(e=(t=u[a]).fontFamily,-1!==t.type.indexOf("text")&&!c[e]&&h[e]&&(c[e]=!0,t.styles))for(r in i=t.styles)for(o in n=i[r])!c[e=n[o].fontFamily]&&h[e]&&(c[e]=!0);for(var f in c)l+=["\t\t@font-face {\n","\t\t\tfont-family: '",f,"';\n","\t\t\tsrc: url('",h[f],"');\n","\t\t}\n"].join("");return l&&(l=['\t<style type="text/css">',"<![CDATA[\n",l,"]]>","</style>\n"].join("")),l},_setSVGObjects:function(t,e){var i,n,r,o=this._objects;for(n=0,r=o.length;n<r;n++)(i=o[n]).excludeFromExport||this._setSVGObject(t,i,e)},_setSVGObject:function(t,e,i){t.push(e.toSVG(i))},_setSVGBgOverlayImage:function(t,e,i){this[e]&&!this[e].excludeFromExport&&this[e].toSVG&&t.push(this[e].toSVG(i))},_setSVGBgOverlayColor:function(t,e){var i=this[e+"Color"],n=this.viewportTransform,r=this.width,o=this.height;if(i)if(i.toLive){var a=i.repeat,s=S.util.invertTransform(n),l=this[e+"Vpt"]?S.util.matrixToSVG(s):"";t.push('<rect transform="'+l+" translate(",r/2,",",o/2,')"',' x="',i.offsetX-r/2,'" y="',i.offsetY-o/2,'" ','width="',"repeat-y"===a||"no-repeat"===a?i.source.width:r,'" height="',"repeat-x"===a||"no-repeat"===a?i.source.height:o,'" fill="url(#SVGID_'+i.id+')"',"></rect>\n")}else t.push('<rect x="0" y="0" width="100%" height="100%" ','fill="',i,'"',"></rect>\n")},sendToBack:function(t){if(!t)return this;var e,n,r,o=this._activeObject;if(t===o&&"activeSelection"===t.type)for(e=(r=o._objects).length;e--;)n=r[e],i(this._objects,n),this._objects.unshift(n);else i(this._objects,t),this._objects.unshift(t);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(t){if(!t)return this;var e,n,r,o=this._activeObject;if(t===o&&"activeSelection"===t.type)for(r=o._objects,e=0;e<r.length;e++)n=r[e],i(this._objects,n),this._objects.push(n);else i(this._objects,t),this._objects.push(t);return this.renderOnAddRemove&&this.requestRenderAll(),this},sendBackwards:function(t,e){if(!t)return this;var n,r,o,a,s,l=this._activeObject,c=0;if(t===l&&"activeSelection"===t.type)for(s=l._objects,n=0;n<s.length;n++)r=s[n],(o=this._objects.indexOf(r))>0+c&&(a=o-1,i(this._objects,r),this._objects.splice(a,0,r)),c++;else 0!==(o=this._objects.indexOf(t))&&(a=this._findNewLowerIndex(t,o,e),i(this._objects,t),this._objects.splice(a,0,t));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(t,e,i){var n,r;if(i)for(n=e,r=e-1;r>=0;--r){if(t.intersectsWithObject(this._objects[r])||t.isContainedWithinObject(this._objects[r])||this._objects[r].isContainedWithinObject(t)){n=r;break}}else n=e-1;return n},bringForward:function(t,e){if(!t)return this;var n,r,o,a,s,l=this._activeObject,c=0;if(t===l&&"activeSelection"===t.type)for(n=(s=l._objects).length;n--;)r=s[n],(o=this._objects.indexOf(r))<this._objects.length-1-c&&(a=o+1,i(this._objects,r),this._objects.splice(a,0,r)),c++;else(o=this._objects.indexOf(t))!==this._objects.length-1&&(a=this._findNewUpperIndex(t,o,e),i(this._objects,t),this._objects.splice(a,0,t));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewUpperIndex:function(t,e,i){var n,r,o;if(i)for(n=e,r=e+1,o=this._objects.length;r<o;++r){if(t.intersectsWithObject(this._objects[r])||t.isContainedWithinObject(this._objects[r])||this._objects[r].isContainedWithinObject(t)){n=r;break}}else n=e+1;return n},moveTo:function(t,e){return i(this._objects,t),this._objects.splice(e,0,t),this.renderOnAddRemove&&this.requestRenderAll()},dispose:function(){return this.isRendering&&(S.util.cancelAnimFrame(this.isRendering),this.isRendering=0),this.forEachObject((function(t){t.dispose&&t.dispose()})),this._objects=[],this.backgroundImage&&this.backgroundImage.dispose&&this.backgroundImage.dispose(),this.backgroundImage=null,this.overlayImage&&this.overlayImage.dispose&&this.overlayImage.dispose(),this.overlayImage=null,this._iTextInstances=null,this.contextContainer=null,this.lowerCanvasEl.classList.remove("lower-canvas"),this.lowerCanvasEl.style=this._originalCanvasStyle,delete this._originalCanvasStyle,this.lowerCanvasEl.setAttribute("width",this.width),this.lowerCanvasEl.setAttribute("height",this.height),S.util.cleanUpJsdomNode(this.lowerCanvasEl),this.lowerCanvasEl=void 0,this},toString:function(){return"#<fabric.Canvas ("+this.complexity()+"): { objects: "+this._objects.length+" }>"}}),t(S.StaticCanvas.prototype,S.Observable),t(S.StaticCanvas.prototype,S.Collection),t(S.StaticCanvas.prototype,S.DataURLExporter),t(S.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(t){var e=s();if(!e||!e.getContext)return null;var i=e.getContext("2d");if(!i)return null;switch(t){case"setLineDash":return void 0!==i.setLineDash;default:return null}}}),S.StaticCanvas.prototype.toJSON=S.StaticCanvas.prototype.toObject,S.isLikelyNode&&(S.StaticCanvas.prototype.createPNGStream=function(){var t=a(this.lowerCanvasEl);return t&&t.createPNGStream()},S.StaticCanvas.prototype.createJPEGStream=function(t){var e=a(this.lowerCanvasEl);return e&&e.createJPEGStream(t)})}}(),S.BaseBrush=S.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(){var t=this.canvas.contextTop;t.strokeStyle=this.color,t.lineWidth=this.width,t.lineCap=this.strokeLineCap,t.miterLimit=this.strokeMiterLimit,t.lineJoin=this.strokeLineJoin,t.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(t){var e=this.canvas.viewportTransform;t.save(),t.transform(e[0],e[1],e[2],e[3],e[4],e[5])},_setShadow:function(){if(this.shadow){var t=this.canvas,e=this.shadow,i=t.contextTop,n=t.getZoom();t&&t._isRetinaScaling()&&(n*=S.devicePixelRatio),i.shadowColor=e.color,i.shadowBlur=e.blur*n,i.shadowOffsetX=e.offsetX*n,i.shadowOffsetY=e.offsetY*n}},needsFullRender:function(){return new S.Color(this.color).getAlpha()<1||!!this.shadow},_resetShadow:function(){var t=this.canvas.contextTop;t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0},_isOutSideCanvas:function(t){return t.x<0||t.x>this.canvas.getWidth()||t.y<0||t.y>this.canvas.getHeight()}}),S.PencilBrush=S.util.createClass(S.BaseBrush,{decimate:.4,initialize:function(t){this.canvas=t,this._points=[]},_drawSegment:function(t,e,i){var n=e.midPointFrom(i);return t.quadraticCurveTo(e.x,e.y,n.x,n.y),n},onMouseDown:function(t,e){this.canvas._isMainEvent(e.e)&&(this._prepareForDrawing(t),this._captureDrawingPath(t),this._render())},onMouseMove:function(t,e){if(this.canvas._isMainEvent(e.e)&&(!0!==this.limitedToCanvasSize||!this._isOutSideCanvas(t))&&this._captureDrawingPath(t)&&this._points.length>1)if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var i=this._points,n=i.length,r=this.canvas.contextTop;this._saveAndTransform(r),this.oldEnd&&(r.beginPath(),r.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(r,i[n-2],i[n-1],!0),r.stroke(),r.restore()}},onMouseUp:function(t){return!this.canvas._isMainEvent(t.e)||(this.oldEnd=void 0,this._finalizeAndAddPath(),!1)},_prepareForDrawing:function(t){var e=new S.Point(t.x,t.y);this._reset(),this._addPoint(e),this.canvas.contextTop.moveTo(e.x,e.y)},_addPoint:function(t){return!(this._points.length>1&&t.eq(this._points[this._points.length-1])||(this._points.push(t),0))},_reset:function(){this._points=[],this._setBrushStyles(),this._setShadow()},_captureDrawingPath:function(t){var e=new S.Point(t.x,t.y);return this._addPoint(e)},_render:function(){var t,e,i=this.canvas.contextTop,n=this._points[0],r=this._points[1];if(this._saveAndTransform(i),i.beginPath(),2===this._points.length&&n.x===r.x&&n.y===r.y){var o=this.width/1e3;n=new S.Point(n.x,n.y),r=new S.Point(r.x,r.y),n.x-=o,r.x+=o}for(i.moveTo(n.x,n.y),t=1,e=this._points.length;t<e;t++)this._drawSegment(i,n,r),n=this._points[t],r=this._points[t+1];i.lineTo(n.x,n.y),i.stroke(),i.restore()},convertPointsToSVGPath:function(t){var e=this.width/1e3;return S.util.getSmoothPathFromPoints(t,e)},_isEmptySVGPath:function(t){return"M 0 0 Q 0 0 0 0 L 0 0"===S.util.joinPath(t)},createPath:function(t){var e=new S.Path(t,{fill:null,stroke:this.color,strokeWidth:this.width,strokeLineCap:this.strokeLineCap,strokeMiterLimit:this.strokeMiterLimit,strokeLineJoin:this.strokeLineJoin,strokeDashArray:this.strokeDashArray});return this.shadow&&(this.shadow.affectStroke=!0,e.shadow=new S.Shadow(this.shadow)),e},decimatePoints:function(t,e){if(t.length<=2)return t;var i,n=this.canvas.getZoom(),r=Math.pow(e/n,2),o=t.length-1,a=t[0],s=[a];for(i=1;i<o-1;i++)Math.pow(a.x-t[i].x,2)+Math.pow(a.y-t[i].y,2)>=r&&(a=t[i],s.push(a));return s.push(t[o]),s},_finalizeAndAddPath:function(){this.canvas.contextTop.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var t=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(t))this.canvas.requestRenderAll();else{var e=this.createPath(t);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:e}),this.canvas.add(e),this.canvas.requestRenderAll(),e.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:e})}}}),S.CircleBrush=S.util.createClass(S.BaseBrush,{width:10,initialize:function(t){this.canvas=t,this.points=[]},drawDot:function(t){var e=this.addPoint(t),i=this.canvas.contextTop;this._saveAndTransform(i),this.dot(i,e),i.restore()},dot:function(t,e){t.fillStyle=e.fill,t.beginPath(),t.arc(e.x,e.y,e.radius,0,2*Math.PI,!1),t.closePath(),t.fill()},onMouseDown:function(t){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(t)},_render:function(){var t,e,i=this.canvas.contextTop,n=this.points;for(this._saveAndTransform(i),t=0,e=n.length;t<e;t++)this.dot(i,n[t]);i.restore()},onMouseMove:function(t){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(t)||(this.needsFullRender()?(this.canvas.clearContext(this.canvas.contextTop),this.addPoint(t),this._render()):this.drawDot(t))},onMouseUp:function(){var t,e,i=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;var n=[];for(t=0,e=this.points.length;t<e;t++){var r=this.points[t],o=new S.Circle({radius:r.radius,left:r.x,top:r.y,originX:"center",originY:"center",fill:r.fill});this.shadow&&(o.shadow=new S.Shadow(this.shadow)),n.push(o)}var a=new S.Group(n);a.canvas=this.canvas,this.canvas.fire("before:path:created",{path:a}),this.canvas.add(a),this.canvas.fire("path:created",{path:a}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=i,this.canvas.requestRenderAll()},addPoint:function(t){var e=new S.Point(t.x,t.y),i=S.util.getRandomInt(Math.max(0,this.width-20),this.width+20)/2,n=new S.Color(this.color).setAlpha(S.util.getRandomInt(0,100)/100).toRgba();return e.radius=i,e.fill=n,this.points.push(e),e}}),S.SprayBrush=S.util.createClass(S.BaseBrush,{width:10,density:20,dotWidth:1,dotWidthVariance:1,randomOpacity:!1,optimizeOverlapping:!0,initialize:function(t){this.canvas=t,this.sprayChunks=[]},onMouseDown:function(t){this.sprayChunks.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.addSprayChunk(t),this.render(this.sprayChunkPoints)},onMouseMove:function(t){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(t)||(this.addSprayChunk(t),this.render(this.sprayChunkPoints))},onMouseUp:function(){var t=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;for(var e=[],i=0,n=this.sprayChunks.length;i<n;i++)for(var r=this.sprayChunks[i],o=0,a=r.length;o<a;o++){var s=new S.Rect({width:r[o].width,height:r[o].width,left:r[o].x+1,top:r[o].y+1,originX:"center",originY:"center",fill:this.color});e.push(s)}this.optimizeOverlapping&&(e=this._getOptimizedRects(e));var l=new S.Group(e);this.shadow&&l.set("shadow",new S.Shadow(this.shadow)),this.canvas.fire("before:path:created",{path:l}),this.canvas.add(l),this.canvas.fire("path:created",{path:l}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=t,this.canvas.requestRenderAll()},_getOptimizedRects:function(t){var e,i,n,r={};for(i=0,n=t.length;i<n;i++)r[e=t[i].left+""+t[i].top]||(r[e]=t[i]);var o=[];for(e in r)o.push(r[e]);return o},render:function(t){var e,i,n=this.canvas.contextTop;for(n.fillStyle=this.color,this._saveAndTransform(n),e=0,i=t.length;e<i;e++){var r=t[e];void 0!==r.opacity&&(n.globalAlpha=r.opacity),n.fillRect(r.x,r.y,r.width,r.width)}n.restore()},_render:function(){var t,e,i=this.canvas.contextTop;for(i.fillStyle=this.color,this._saveAndTransform(i),t=0,e=this.sprayChunks.length;t<e;t++)this.render(this.sprayChunks[t]);i.restore()},addSprayChunk:function(t){this.sprayChunkPoints=[];var e,i,n,r,o=this.width/2;for(r=0;r<this.density;r++){e=S.util.getRandomInt(t.x-o,t.x+o),i=S.util.getRandomInt(t.y-o,t.y+o),n=this.dotWidthVariance?S.util.getRandomInt(Math.max(1,this.dotWidth-this.dotWidthVariance),this.dotWidth+this.dotWidthVariance):this.dotWidth;var a=new S.Point(e,i);a.width=n,this.randomOpacity&&(a.opacity=S.util.getRandomInt(0,100)/100),this.sprayChunkPoints.push(a)}this.sprayChunks.push(this.sprayChunkPoints)}}),S.PatternBrush=S.util.createClass(S.PencilBrush,{getPatternSrc:function(){var t=S.util.createCanvasElement(),e=t.getContext("2d");return t.width=t.height=25,e.fillStyle=this.color,e.beginPath(),e.arc(10,10,10,0,2*Math.PI,!1),e.closePath(),e.fill(),t},getPatternSrcFunction:function(){return String(this.getPatternSrc).replace("this.color",'"'+this.color+'"')},getPattern:function(){return this.canvas.contextTop.createPattern(this.source||this.getPatternSrc(),"repeat")},_setBrushStyles:function(){this.callSuper("_setBrushStyles"),this.canvas.contextTop.strokeStyle=this.getPattern()},createPath:function(t){var e=this.callSuper("createPath",t),i=e._getLeftTopCoords().scalarAdd(e.strokeWidth/2);return e.stroke=new S.Pattern({source:this.source||this.getPatternSrcFunction(),offsetX:-i.x,offsetY:-i.y}),e}}),function(){var t=S.util.getPointer,e=S.util.degreesToRadians,i=S.util.isTouchEvent;for(var n in S.Canvas=S.util.createClass(S.StaticCanvas,{initialize:function(t,e){e||(e={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(t,e),this._initInteractive(),this._createCacheCanvas()},uniformScaling:!0,uniScaleKey:"shiftKey",centeredScaling:!1,centeredRotation:!1,centeredKey:"altKey",altActionKey:"shiftKey",interactive:!0,selection:!0,selectionKey:"shiftKey",altSelectionKey:null,selectionColor:"rgba(100, 100, 255, 0.3)",selectionDashArray:[],selectionBorderColor:"rgba(255, 255, 255, 0.3)",selectionLineWidth:1,selectionFullyContained:!1,hoverCursor:"move",moveCursor:"move",defaultCursor:"default",freeDrawingCursor:"crosshair",rotationCursor:"crosshair",notAllowedCursor:"not-allowed",containerClass:"canvas-container",perPixelTargetFind:!1,targetFindTolerance:0,skipTargetFind:!1,isDrawingMode:!1,preserveObjectStacking:!1,snapAngle:0,snapThreshold:null,stopContextMenu:!1,fireRightClick:!1,fireMiddleClick:!1,targets:[],_hoveredTarget:null,_hoveredTargets:[],_initInteractive:function(){this._currentTransform=null,this._groupSelector=null,this._initWrapperElement(),this._createUpperCanvas(),this._initEventListeners(),this._initRetinaScaling(),this.freeDrawingBrush=S.PencilBrush&&new S.PencilBrush(this),this.calcOffset()},_chooseObjectsToRender:function(){var t,e,i,n=this.getActiveObjects();if(n.length>0&&!this.preserveObjectStacking){e=[],i=[];for(var r=0,o=this._objects.length;r<o;r++)t=this._objects[r],-1===n.indexOf(t)?e.push(t):i.push(t);n.length>1&&(this._activeObject._objects=i),e.push.apply(e,i)}else e=this._objects;return e},renderAll:function(){!this.contextTopDirty||this._groupSelector||this.isDrawingMode||(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&this.renderTopLayer(this.contextTop);var t=this.contextContainer;return this.renderCanvas(t,this._chooseObjectsToRender()),this},renderTopLayer:function(t){t.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(t),this.contextTopDirty=!0),t.restore()},renderTop:function(){var t=this.contextTop;return this.clearContext(t),this.renderTopLayer(t),this.fire("after:render"),this},_normalizePointer:function(t,e){var i=t.calcTransformMatrix(),n=S.util.invertTransform(i),r=this.restorePointerVpt(e);return S.util.transformPoint(r,n)},isTargetTransparent:function(t,e,i){if(t.shouldCache()&&t._cacheCanvas&&t!==this._activeObject){var n=this._normalizePointer(t,{x:e,y:i}),r=Math.max(t.cacheTranslationX+n.x*t.zoomX,0),o=Math.max(t.cacheTranslationY+n.y*t.zoomY,0);return S.util.isTransparent(t._cacheContext,Math.round(r),Math.round(o),this.targetFindTolerance)}var a=this.contextCache,s=t.selectionBackgroundColor,l=this.viewportTransform;return t.selectionBackgroundColor="",this.clearContext(a),a.save(),a.transform(l[0],l[1],l[2],l[3],l[4],l[5]),t.render(a),a.restore(),t.selectionBackgroundColor=s,S.util.isTransparent(a,e,i,this.targetFindTolerance)},_isSelectionKeyPressed:function(t){return"[object Array]"===Object.prototype.toString.call(this.selectionKey)?!!this.selectionKey.find((function(e){return!0===t[e]})):t[this.selectionKey]},_shouldClearSelection:function(t,e){var i=this.getActiveObjects(),n=this._activeObject;return!e||e&&n&&i.length>1&&-1===i.indexOf(e)&&n!==e&&!this._isSelectionKeyPressed(t)||e&&!e.evented||e&&!e.selectable&&n&&n!==e},_shouldCenterTransform:function(t,e,i){var n;if(t)return"scale"===e||"scaleX"===e||"scaleY"===e||"resizing"===e?n=this.centeredScaling||t.centeredScaling:"rotate"===e&&(n=this.centeredRotation||t.centeredRotation),n?!i:i},_getOriginFromCorner:function(t,e){var i={x:t.originX,y:t.originY};return"ml"===e||"tl"===e||"bl"===e?i.x="right":"mr"!==e&&"tr"!==e&&"br"!==e||(i.x="left"),"tl"===e||"mt"===e||"tr"===e?i.y="bottom":"bl"!==e&&"mb"!==e&&"br"!==e||(i.y="top"),i},_getActionFromCorner:function(t,e,i,n){if(!e||!t)return"drag";var r=n.controls[e];return r.getActionName(i,r,n)},_setupCurrentTransform:function(t,i,n){if(i){var r=this.getPointer(t),o=i.__corner,a=i.controls[o],s=n&&o?a.getActionHandler(t,i,a):S.controlsUtils.dragHandler,l=this._getActionFromCorner(n,o,t,i),c=this._getOriginFromCorner(i,o),h=t[this.centeredKey],u={target:i,action:l,actionHandler:s,corner:o,scaleX:i.scaleX,scaleY:i.scaleY,skewX:i.skewX,skewY:i.skewY,offsetX:r.x-i.left,offsetY:r.y-i.top,originX:c.x,originY:c.y,ex:r.x,ey:r.y,lastX:r.x,lastY:r.y,theta:e(i.angle),width:i.width*i.scaleX,shiftKey:t.shiftKey,altKey:h,original:S.util.saveObjectTransform(i)};this._shouldCenterTransform(i,l,h)&&(u.originX="center",u.originY="center"),u.original.originX=c.x,u.original.originY=c.y,this._currentTransform=u,this._beforeTransform(t)}},setCursor:function(t){this.upperCanvasEl.style.cursor=t},_drawSelection:function(t){var e=this._groupSelector,i=new S.Point(e.ex,e.ey),n=S.util.transformPoint(i,this.viewportTransform),r=new S.Point(e.ex+e.left,e.ey+e.top),o=S.util.transformPoint(r,this.viewportTransform),a=Math.min(n.x,o.x),s=Math.min(n.y,o.y),l=Math.max(n.x,o.x),c=Math.max(n.y,o.y),h=this.selectionLineWidth/2;this.selectionColor&&(t.fillStyle=this.selectionColor,t.fillRect(a,s,l-a,c-s)),this.selectionLineWidth&&this.selectionBorderColor&&(t.lineWidth=this.selectionLineWidth,t.strokeStyle=this.selectionBorderColor,a+=h,s+=h,l-=h,c-=h,S.Object.prototype._setLineDash.call(this,t,this.selectionDashArray),t.strokeRect(a,s,l-a,c-s))},findTarget:function(t,e){if(!this.skipTargetFind){var n,r,o=this.getPointer(t,!0),a=this._activeObject,s=this.getActiveObjects(),l=i(t),c=s.length>1&&!e||1===s.length;if(this.targets=[],c&&a._findTargetCorner(o,l))return a;if(s.length>1&&!e&&a===this._searchPossibleTargets([a],o))return a;if(1===s.length&&a===this._searchPossibleTargets([a],o)){if(!this.preserveObjectStacking)return a;n=a,r=this.targets,this.targets=[]}var h=this._searchPossibleTargets(this._objects,o);return t[this.altSelectionKey]&&h&&n&&h!==n&&(h=n,this.targets=r),h}},_checkTarget:function(t,e,i){if(e&&e.visible&&e.evented&&e.containsPoint(t)){if(!this.perPixelTargetFind&&!e.perPixelTargetFind||e.isEditing)return!0;if(!this.isTargetTransparent(e,i.x,i.y))return!0}},_searchPossibleTargets:function(t,e){for(var i,n,r=t.length;r--;){var o=t[r],a=o.group?this._normalizePointer(o.group,e):e;if(this._checkTarget(a,o,e)){(i=t[r]).subTargetCheck&&i instanceof S.Group&&(n=this._searchPossibleTargets(i._objects,e))&&this.targets.push(n);break}}return i},restorePointerVpt:function(t){return S.util.transformPoint(t,S.util.invertTransform(this.viewportTransform))},getPointer:function(e,i){if(this._absolutePointer&&!i)return this._absolutePointer;if(this._pointer&&i)return this._pointer;var n,r=t(e),o=this.upperCanvasEl,a=o.getBoundingClientRect(),s=a.width||0,l=a.height||0;s&&l||("top"in a&&"bottom"in a&&(l=Math.abs(a.top-a.bottom)),"right"in a&&"left"in a&&(s=Math.abs(a.right-a.left))),this.calcOffset(),r.x=r.x-this._offset.left,r.y=r.y-this._offset.top,i||(r=this.restorePointerVpt(r));var c=this.getRetinaScaling();return 1!==c&&(r.x/=c,r.y/=c),n=0===s||0===l?{width:1,height:1}:{width:o.width/s,height:o.height/l},{x:r.x*n.width,y:r.y*n.height}},_createUpperCanvas:function(){var t=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),e=this.lowerCanvasEl,i=this.upperCanvasEl;i?i.className="":(i=this._createCanvasElement(),this.upperCanvasEl=i),S.util.addClass(i,"upper-canvas "+t),this.wrapperEl.appendChild(i),this._copyCanvasStyle(e,i),this._applyCanvasStyle(i),this.contextTop=i.getContext("2d")},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=S.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),S.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),S.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(t){var e=this.width||t.width,i=this.height||t.height;S.util.setStyle(t,{position:"absolute",width:e+"px",height:i+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),t.width=e,t.height=i,S.util.makeElementUnselectable(t)},_copyCanvasStyle:function(t,e){e.style.cssText=t.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var t=this._activeObject;return t?"activeSelection"===t.type&&t._objects?t._objects.slice(0):[t]:[]},_onObjectRemoved:function(t){t===this._activeObject&&(this.fire("before:selection:cleared",{target:t}),this._discardActiveObject(),this.fire("selection:cleared",{target:t}),t.fire("deselected")),t===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",t)},_fireSelectionEvents:function(t,e){var i=!1,n=this.getActiveObjects(),r=[],o=[];t.forEach((function(t){-1===n.indexOf(t)&&(i=!0,t.fire("deselected",{e:e,target:t}),o.push(t))})),n.forEach((function(n){-1===t.indexOf(n)&&(i=!0,n.fire("selected",{e:e,target:n}),r.push(n))})),t.length>0&&n.length>0?i&&this.fire("selection:updated",{e:e,selected:r,deselected:o,updated:r[0]||o[0],target:this._activeObject}):n.length>0?this.fire("selection:created",{e:e,selected:r,target:this._activeObject}):t.length>0&&this.fire("selection:cleared",{e:e,deselected:o})},setActiveObject:function(t,e){var i=this.getActiveObjects();return this._setActiveObject(t,e),this._fireSelectionEvents(i,e),this},_setActiveObject:function(t,e){return this._activeObject!==t&&(!!this._discardActiveObject(e,t)&&(!t.onSelect({e:e})&&(this._activeObject=t,!0)))},_discardActiveObject:function(t,e){var i=this._activeObject;if(i){if(i.onDeselect({e:t,object:e}))return!1;this._activeObject=null}return!0},discardActiveObject:function(t){var e=this.getActiveObjects(),i=this.getActiveObject();return e.length&&this.fire("before:selection:cleared",{target:i,e:t}),this._discardActiveObject(t),this._fireSelectionEvents(e,t),this},dispose:function(){var t=this.wrapperEl;return this.removeListeners(),t.removeChild(this.upperCanvasEl),t.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(t){S.util.cleanUpJsdomNode(this[t]),this[t]=void 0}.bind(this)),t.parentNode&&t.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,S.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(t){var e=this._activeObject;e&&e._renderControls(t)},_toObject:function(t,e,i){var n=this._realizeGroupTransformOnObject(t),r=this.callSuper("_toObject",t,e,i);return this._unwindGroupTransformOnObject(t,n),r},_realizeGroupTransformOnObject:function(t){if(t.group&&"activeSelection"===t.group.type&&this._activeObject===t.group){var e={};return["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"].forEach((function(i){e[i]=t[i]})),S.util.addTransformToObject(t,this._activeObject.calcOwnMatrix()),e}return null},_unwindGroupTransformOnObject:function(t,e){e&&t.set(e)},_setSVGObject:function(t,e,i){var n=this._realizeGroupTransformOnObject(e);this.callSuper("_setSVGObject",t,e,i),this._unwindGroupTransformOnObject(e,n)},setViewportTransform:function(t){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),S.StaticCanvas.prototype.setViewportTransform.call(this,t)}}),S.StaticCanvas)"prototype"!==n&&(S.Canvas[n]=S.StaticCanvas[n])}(),function(){var t=S.util.addListener,e=S.util.removeListener,i={passive:!1};function n(t,e){return t.button&&t.button===e-1}S.util.object.extend(S.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(t,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(t,e){var n=this.upperCanvasEl,r=this._getEventPrefix();t(S.window,"resize",this._onResize),t(n,r+"down",this._onMouseDown),t(n,r+"move",this._onMouseMove,i),t(n,r+"out",this._onMouseOut),t(n,r+"enter",this._onMouseEnter),t(n,"wheel",this._onMouseWheel),t(n,"contextmenu",this._onContextMenu),t(n,"dblclick",this._onDoubleClick),t(n,"dragover",this._onDragOver),t(n,"dragenter",this._onDragEnter),t(n,"dragleave",this._onDragLeave),t(n,"drop",this._onDrop),this.enablePointerEvents||t(n,"touchstart",this._onTouchStart,i),"undefined"!=typeof eventjs&&e in eventjs&&(eventjs[e](n,"gesture",this._onGesture),eventjs[e](n,"drag",this._onDrag),eventjs[e](n,"orientation",this._onOrientationChange),eventjs[e](n,"shake",this._onShake),eventjs[e](n,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(e,"remove");var t=this._getEventPrefix();e(S.document,t+"up",this._onMouseUp),e(S.document,"touchend",this._onTouchEnd,i),e(S.document,t+"move",this._onMouseMove,i),e(S.document,"touchmove",this._onMouseMove,i)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._simpleEventHandler.bind(this,"drop"),this.eventsBound=!0)},_onGesture:function(t,e){this.__onTransformGesture&&this.__onTransformGesture(t,e)},_onDrag:function(t,e){this.__onDrag&&this.__onDrag(t,e)},_onMouseWheel:function(t){this.__onMouseWheel(t)},_onMouseOut:function(t){var e=this._hoveredTarget;this.fire("mouse:out",{target:e,e:t}),this._hoveredTarget=null,e&&e.fire("mouseout",{e:t});var i=this;this._hoveredTargets.forEach((function(n){i.fire("mouse:out",{target:e,e:t}),n&&e.fire("mouseout",{e:t})})),this._hoveredTargets=[],this._iTextInstances&&this._iTextInstances.forEach((function(t){t.isEditing&&t.hiddenTextarea.focus()}))},_onMouseEnter:function(t){this._currentTransform||this.findTarget(t)||(this.fire("mouse:over",{target:null,e:t}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(t,e){this.__onOrientationChange&&this.__onOrientationChange(t,e)},_onShake:function(t,e){this.__onShake&&this.__onShake(t,e)},_onLongPress:function(t,e){this.__onLongPress&&this.__onLongPress(t,e)},_onDragOver:function(t){t.preventDefault();var e=this._simpleEventHandler("dragover",t);this._fireEnterLeaveEvents(e,t)},_onContextMenu:function(t){return this.stopContextMenu&&(t.stopPropagation(),t.preventDefault()),!1},_onDoubleClick:function(t){this._cacheTransformEventData(t),this._handleEvent(t,"dblclick"),this._resetTransformEventData(t)},getPointerId:function(t){var e=t.changedTouches;return e?e[0]&&e[0].identifier:this.enablePointerEvents?t.pointerId:-1},_isMainEvent:function(t){return!0===t.isPrimary||!1!==t.isPrimary&&("touchend"===t.type&&0===t.touches.length||(!t.changedTouches||t.changedTouches[0].identifier===this.mainTouchId))},_onTouchStart:function(n){n.preventDefault(),null===this.mainTouchId&&(this.mainTouchId=this.getPointerId(n)),this.__onMouseDown(n),this._resetTransformEventData();var r=this.upperCanvasEl,o=this._getEventPrefix();t(S.document,"touchend",this._onTouchEnd,i),t(S.document,"touchmove",this._onMouseMove,i),e(r,o+"down",this._onMouseDown)},_onMouseDown:function(n){this.__onMouseDown(n),this._resetTransformEventData();var r=this.upperCanvasEl,o=this._getEventPrefix();e(r,o+"move",this._onMouseMove,i),t(S.document,o+"up",this._onMouseUp),t(S.document,o+"move",this._onMouseMove,i)},_onTouchEnd:function(n){if(!(n.touches.length>0)){this.__onMouseUp(n),this._resetTransformEventData(),this.mainTouchId=null;var r=this._getEventPrefix();e(S.document,"touchend",this._onTouchEnd,i),e(S.document,"touchmove",this._onMouseMove,i);var o=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout((function(){t(o.upperCanvasEl,r+"down",o._onMouseDown),o._willAddMouseDown=0}),400)}},_onMouseUp:function(n){this.__onMouseUp(n),this._resetTransformEventData();var r=this.upperCanvasEl,o=this._getEventPrefix();this._isMainEvent(n)&&(e(S.document,o+"up",this._onMouseUp),e(S.document,o+"move",this._onMouseMove,i),t(r,o+"move",this._onMouseMove,i))},_onMouseMove:function(t){!this.allowTouchScrolling&&t.preventDefault&&t.preventDefault(),this.__onMouseMove(t)},_onResize:function(){this.calcOffset()},_shouldRender:function(t){var e=this._activeObject;return!!(!!e!=!!t||e&&t&&e!==t)||(e&&e.isEditing,!1)},__onMouseUp:function(t){var e,i=this._currentTransform,r=this._groupSelector,o=!1,a=!r||0===r.left&&0===r.top;if(this._cacheTransformEventData(t),e=this._target,this._handleEvent(t,"up:before"),n(t,3))this.fireRightClick&&this._handleEvent(t,"up",3,a);else{if(n(t,2))return this.fireMiddleClick&&this._handleEvent(t,"up",2,a),void this._resetTransformEventData();if(this.isDrawingMode&&this._isCurrentlyDrawing)this._onMouseUpInDrawingMode(t);else if(this._isMainEvent(t)){if(i&&(this._finalizeCurrentTransform(t),o=i.actionPerformed),!a){var s=e===this._activeObject;this._maybeGroupObjects(t),o||(o=this._shouldRender(e)||!s&&e===this._activeObject)}if(e){if(e.selectable&&e!==this._activeObject&&"up"===e.activeOn)this.setActiveObject(e,t),o=!0;else{var l=e._findTargetCorner(this.getPointer(t,!0),S.util.isTouchEvent(t)),c=e.controls[l],h=c&&c.getMouseUpHandler(t,e,c);if(h){var u=this.getPointer(t);h(t,i,u.x,u.y)}}e.isMoving=!1}this._setCursorFromEvent(t,e),this._handleEvent(t,"up",1,a),this._groupSelector=null,this._currentTransform=null,e&&(e.__corner=0),o?this.requestRenderAll():a||this.renderTop()}}},_simpleEventHandler:function(t,e){var i=this.findTarget(e),n=this.targets,r={e:e,target:i,subTargets:n};if(this.fire(t,r),i&&i.fire(t,r),!n)return i;for(var o=0;o<n.length;o++)n[o].fire(t,r);return i},_handleEvent:function(t,e,i,n){var r=this._target,o=this.targets||[],a={e:t,target:r,subTargets:o,button:i||1,isClick:n||!1,pointer:this._pointer,absolutePointer:this._absolutePointer,transform:this._currentTransform};"up"===e&&(a.currentTarget=this.findTarget(t),a.currentSubTargets=this.targets),this.fire("mouse:"+e,a),r&&r.fire("mouse"+e,a);for(var s=0;s<o.length;s++)o[s].fire("mouse"+e,a)},_finalizeCurrentTransform:function(t){var e,i=this._currentTransform,n=i.target,r={e:t,target:n,transform:i,action:i.action};n._scaling&&(n._scaling=!1),n.setCoords(),(i.actionPerformed||this.stateful&&n.hasStateChanged())&&(i.actionPerformed&&(e=this._addEventOptions(r,i),this._fire(e,r)),this._fire("modified",r))},_addEventOptions:function(t,e){var i,n;switch(e.action){case"scaleX":i="scaled",n="x";break;case"scaleY":i="scaled",n="y";break;case"skewX":i="skewed",n="x";break;case"skewY":i="skewed",n="y";break;case"scale":i="scaled",n="equally";break;case"rotate":i="rotated";break;case"drag":i="moved"}return t.by=n,i},_onMouseDownInDrawingMode:function(t){this._isCurrentlyDrawing=!0,this.getActiveObject()&&this.discardActiveObject(t).requestRenderAll();var e=this.getPointer(t);this.freeDrawingBrush.onMouseDown(e,{e:t,pointer:e}),this._handleEvent(t,"down")},_onMouseMoveInDrawingMode:function(t){if(this._isCurrentlyDrawing){var e=this.getPointer(t);this.freeDrawingBrush.onMouseMove(e,{e:t,pointer:e})}this.setCursor(this.freeDrawingCursor),this._handleEvent(t,"move")},_onMouseUpInDrawingMode:function(t){var e=this.getPointer(t);this._isCurrentlyDrawing=this.freeDrawingBrush.onMouseUp({e:t,pointer:e}),this._handleEvent(t,"up")},__onMouseDown:function(t){this._cacheTransformEventData(t),this._handleEvent(t,"down:before");var e=this._target;if(n(t,3))this.fireRightClick&&this._handleEvent(t,"down",3);else if(n(t,2))this.fireMiddleClick&&this._handleEvent(t,"down",2);else if(this.isDrawingMode)this._onMouseDownInDrawingMode(t);else if(this._isMainEvent(t)&&!this._currentTransform){var i=this._pointer;this._previousPointer=i;var r=this._shouldRender(e),o=this._shouldGroup(t,e);if(this._shouldClearSelection(t,e)?this.discardActiveObject(t):o&&(this._handleGrouping(t,e),e=this._activeObject),!this.selection||e&&(e.selectable||e.isEditing||e===this._activeObject)||(this._groupSelector={ex:this._absolutePointer.x,ey:this._absolutePointer.y,top:0,left:0}),e){var a=e===this._activeObject;e.selectable&&"down"===e.activeOn&&this.setActiveObject(e,t);var s=e._findTargetCorner(this.getPointer(t,!0),S.util.isTouchEvent(t));if(e.__corner=s,e===this._activeObject&&(s||!o)){this._setupCurrentTransform(t,e,a);var l=e.controls[s],c=(i=this.getPointer(t),l&&l.getMouseDownHandler(t,e,l));c&&c(t,this._currentTransform,i.x,i.y)}}this._handleEvent(t,"down"),(r||o)&&this.requestRenderAll()}},_resetTransformEventData:function(){this._target=null,this._pointer=null,this._absolutePointer=null},_cacheTransformEventData:function(t){this._resetTransformEventData(),this._pointer=this.getPointer(t,!0),this._absolutePointer=this.restorePointerVpt(this._pointer),this._target=this._currentTransform?this._currentTransform.target:this.findTarget(t)||null},_beforeTransform:function(t){var e=this._currentTransform;this.stateful&&e.target.saveState(),this.fire("before:transform",{e:t,transform:e})},__onMouseMove:function(t){var e,i;if(this._handleEvent(t,"move:before"),this._cacheTransformEventData(t),this.isDrawingMode)this._onMouseMoveInDrawingMode(t);else if(this._isMainEvent(t)){var n=this._groupSelector;n?(i=this._absolutePointer,n.left=i.x-n.ex,n.top=i.y-n.ey,this.renderTop()):this._currentTransform?this._transformObject(t):(e=this.findTarget(t)||null,this._setCursorFromEvent(t,e),this._fireOverOutEvents(e,t)),this._handleEvent(t,"move"),this._resetTransformEventData()}},_fireOverOutEvents:function(t,e){var i=this._hoveredTarget,n=this._hoveredTargets,r=this.targets,o=Math.max(n.length,r.length);this.fireSyntheticInOutEvents(t,e,{oldTarget:i,evtOut:"mouseout",canvasEvtOut:"mouse:out",evtIn:"mouseover",canvasEvtIn:"mouse:over"});for(var a=0;a<o;a++)this.fireSyntheticInOutEvents(r[a],e,{oldTarget:n[a],evtOut:"mouseout",evtIn:"mouseover"});this._hoveredTarget=t,this._hoveredTargets=this.targets.concat()},_fireEnterLeaveEvents:function(t,e){var i=this._draggedoverTarget,n=this._hoveredTargets,r=this.targets,o=Math.max(n.length,r.length);this.fireSyntheticInOutEvents(t,e,{oldTarget:i,evtOut:"dragleave",evtIn:"dragenter"});for(var a=0;a<o;a++)this.fireSyntheticInOutEvents(r[a],e,{oldTarget:n[a],evtOut:"dragleave",evtIn:"dragenter"});this._draggedoverTarget=t},fireSyntheticInOutEvents:function(t,e,i){var n,r,o,a=i.oldTarget,s=a!==t,l=i.canvasEvtIn,c=i.canvasEvtOut;s&&(n={e:e,target:t,previousTarget:a},r={e:e,target:a,nextTarget:t}),o=t&&s,a&&s&&(c&&this.fire(c,r),a.fire(i.evtOut,r)),o&&(l&&this.fire(l,n),t.fire(i.evtIn,n))},__onMouseWheel:function(t){this._cacheTransformEventData(t),this._handleEvent(t,"wheel"),this._resetTransformEventData()},_transformObject:function(t){var e=this.getPointer(t),i=this._currentTransform;i.reset=!1,i.shiftKey=t.shiftKey,i.altKey=t[this.centeredKey],this._performTransformAction(t,i,e),i.actionPerformed&&this.requestRenderAll()},_performTransformAction:function(t,e,i){var n=i.x,r=i.y,o=e.action,a=!1,s=e.actionHandler;s&&(a=s(t,e,n,r)),"drag"===o&&a&&(e.target.isMoving=!0,this.setCursor(e.target.moveCursor||this.moveCursor)),e.actionPerformed=e.actionPerformed||a},_fire:S.controlsUtils.fireEvent,_setCursorFromEvent:function(t,e){if(!e)return this.setCursor(this.defaultCursor),!1;var i=e.hoverCursor||this.hoverCursor,n=this._activeObject&&"activeSelection"===this._activeObject.type?this._activeObject:null,r=(!n||!n.contains(e))&&e._findTargetCorner(this.getPointer(t,!0));r?this.setCursor(this.getCornerCursor(r,e,t)):(e.subTargetCheck&&this.targets.concat().reverse().map((function(t){i=t.hoverCursor||i})),this.setCursor(i))},getCornerCursor:function(t,e,i){var n=e.controls[t];return n.cursorStyleHandler(i,n,e)}})}(),m=Math.min,y=Math.max,S.util.object.extend(S.Canvas.prototype,{_shouldGroup:function(t,e){var i=this._activeObject;return i&&this._isSelectionKeyPressed(t)&&e&&e.selectable&&this.selection&&(i!==e||"activeSelection"===i.type)&&!e.onSelect({e:t})},_handleGrouping:function(t,e){var i=this._activeObject;i.__corner||(e!==i||(e=this.findTarget(t,!0))&&e.selectable)&&(i&&"activeSelection"===i.type?this._updateActiveSelection(e,t):this._createActiveSelection(e,t))},_updateActiveSelection:function(t,e){var i=this._activeObject,n=i._objects.slice(0);i.contains(t)?(i.removeWithUpdate(t),this._hoveredTarget=t,this._hoveredTargets=this.targets.concat(),1===i.size()&&this._setActiveObject(i.item(0),e)):(i.addWithUpdate(t),this._hoveredTarget=i,this._hoveredTargets=this.targets.concat()),this._fireSelectionEvents(n,e)},_createActiveSelection:function(t,e){var i=this.getActiveObjects(),n=this._createGroup(t);this._hoveredTarget=n,this._setActiveObject(n,e),this._fireSelectionEvents(i,e)},_createGroup:function(t){var e=this._objects,i=e.indexOf(this._activeObject)<e.indexOf(t)?[this._activeObject,t]:[t,this._activeObject];return this._activeObject.isEditing&&this._activeObject.exitEditing(),new S.ActiveSelection(i,{canvas:this})},_groupSelectedObjects:function(t){var e,i=this._collectObjects(t);1===i.length?this.setActiveObject(i[0],t):i.length>1&&(e=new S.ActiveSelection(i.reverse(),{canvas:this}),this.setActiveObject(e,t))},_collectObjects:function(t){for(var e,i=[],n=this._groupSelector.ex,r=this._groupSelector.ey,o=n+this._groupSelector.left,a=r+this._groupSelector.top,s=new S.Point(m(n,o),m(r,a)),l=new S.Point(y(n,o),y(r,a)),c=!this.selectionFullyContained,h=n===o&&r===a,u=this._objects.length;u--&&!((e=this._objects[u])&&e.selectable&&e.visible&&(c&&e.intersectsWithRect(s,l,!0)||e.isContainedWithinRect(s,l,!0)||c&&e.containsPoint(s,null,!0)||c&&e.containsPoint(l,null,!0))&&(i.push(e),h)););return i.length>1&&(i=i.filter((function(e){return!e.onSelect({e:t})}))),i},_maybeGroupObjects:function(t){this.selection&&this._groupSelector&&this._groupSelectedObjects(t),this.setCursor(this.defaultCursor),this._groupSelector=null}}),S.util.object.extend(S.StaticCanvas.prototype,{toDataURL:function(t){t||(t={});var e=t.format||"png",i=t.quality||1,n=(t.multiplier||1)*(t.enableRetinaScaling?this.getRetinaScaling():1),r=this.toCanvasElement(n,t);return S.util.toDataURL(r,e,i)},toCanvasElement:function(t,e){t=t||1;var i=((e=e||{}).width||this.width)*t,n=(e.height||this.height)*t,r=this.getZoom(),o=this.width,a=this.height,s=r*t,l=this.viewportTransform,c=(l[4]-(e.left||0))*t,h=(l[5]-(e.top||0))*t,u=this.interactive,f=[s,0,0,s,c,h],d=this.enableRetinaScaling,v=S.util.createCanvasElement(),g=this.contextTop;return v.width=i,v.height=n,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=f,this.width=i,this.height=n,this.calcViewportBoundaries(),this.renderCanvas(v.getContext("2d"),this._objects),this.viewportTransform=l,this.width=o,this.height=a,this.calcViewportBoundaries(),this.interactive=u,this.enableRetinaScaling=d,this.contextTop=g,v}}),S.util.object.extend(S.StaticCanvas.prototype,{loadFromJSON:function(t,e,i){if(t){var n="string"==typeof t?JSON.parse(t):S.util.object.clone(t),r=this,o=n.clipPath,a=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete n.clipPath,this._enlivenObjects(n.objects,(function(t){r.clear(),r._setBgOverlay(n,(function(){o?r._enlivenObjects([o],(function(i){r.clipPath=i[0],r.__setupCanvas.call(r,n,t,a,e)})):r.__setupCanvas.call(r,n,t,a,e)}))}),i),this}},__setupCanvas:function(t,e,i,n){var r=this;e.forEach((function(t,e){r.insertAt(t,e)})),this.renderOnAddRemove=i,delete t.objects,delete t.backgroundImage,delete t.overlayImage,delete t.background,delete t.overlay,this._setOptions(t),this.renderAll(),n&&n()},_setBgOverlay:function(t,e){var i={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(t.backgroundImage||t.overlayImage||t.background||t.overlay){var n=function(){i.backgroundImage&&i.overlayImage&&i.backgroundColor&&i.overlayColor&&e&&e()};this.__setBgOverlay("backgroundImage",t.backgroundImage,i,n),this.__setBgOverlay("overlayImage",t.overlayImage,i,n),this.__setBgOverlay("backgroundColor",t.background,i,n),this.__setBgOverlay("overlayColor",t.overlay,i,n)}else e&&e()},__setBgOverlay:function(t,e,i,n){var r=this;if(!e)return i[t]=!0,void(n&&n());"backgroundImage"===t||"overlayImage"===t?S.util.enlivenObjects([e],(function(e){r[t]=e[0],i[t]=!0,n&&n()})):this["set"+S.util.string.capitalize(t,!0)](e,(function(){i[t]=!0,n&&n()}))},_enlivenObjects:function(t,e,i){t&&0!==t.length?S.util.enlivenObjects(t,(function(t){e&&e(t)}),null,i):e&&e([])},_toDataURL:function(t,e){this.clone((function(i){e(i.toDataURL(t))}))},_toDataURLWithMultiplier:function(t,e,i){this.clone((function(n){i(n.toDataURLWithMultiplier(t,e))}))},clone:function(t,e){var i=JSON.stringify(this.toJSON(e));this.cloneWithoutData((function(e){e.loadFromJSON(i,(function(){t&&t(e)}))}))},cloneWithoutData:function(t){var e=S.util.createCanvasElement();e.width=this.width,e.height=this.height;var i=new S.Canvas(e);this.backgroundImage?(i.setBackgroundImage(this.backgroundImage.src,(function(){i.renderAll(),t&&t(i)})),i.backgroundImageOpacity=this.backgroundImageOpacity,i.backgroundImageStretch=this.backgroundImageStretch):t&&t(i)}}),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.util.object.clone,r=e.util.toFixed,o=e.util.string.capitalize,a=e.util.degreesToRadians,s=!e.isLikelyNode;e.Object||(e.Object=e.util.createClass(e.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:s,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(t){t&&this.setOptions(t)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=e.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(t){var i=e.perfLimitSizeTotal,n=t.width,r=t.height,o=e.maxCacheSideLimit,a=e.minCacheSideLimit;if(n<=o&&r<=o&&n*r<=i)return n<a&&(t.width=a),r<a&&(t.height=a),t;var s=n/r,l=e.util.limitDimsByArea(s,i),c=e.util.capValue,h=c(a,l.x,o),u=c(a,l.y,o);return n>h&&(t.zoomX/=n/h,t.width=h,t.capped=!0),r>u&&(t.zoomY/=r/u,t.height=u,t.capped=!0),t},_getCacheCanvasDimensions:function(){var t=this.getTotalObjectScaling(),e=this._getTransformedDimensions(0,0),i=e.x*t.scaleX/this.scaleX,n=e.y*t.scaleY/this.scaleY;return{width:i+2,height:n+2,zoomX:t.scaleX,zoomY:t.scaleY,x:i,y:n}},_updateCacheCanvas:function(){var t=this.canvas;if(this.noScaleCache&&t&&t._currentTransform){var i=t._currentTransform.target,n=t._currentTransform.action;if(this===i&&n.slice&&"scale"===n.slice(0,5))return!1}var r,o,a=this._cacheCanvas,s=this._limitCacheSize(this._getCacheCanvasDimensions()),l=e.minCacheSideLimit,c=s.width,h=s.height,u=s.zoomX,f=s.zoomY,d=c!==this.cacheWidth||h!==this.cacheHeight,v=this.zoomX!==u||this.zoomY!==f,g=d||v,p=0,m=0,y=!1;if(d){var b=this._cacheCanvas.width,w=this._cacheCanvas.height,x=c>b||h>w;y=x||(c<.9*b||h<.9*w)&&b>l&&w>l,x&&!s.capped&&(c>l||h>l)&&(p=.1*c,m=.1*h)}return this instanceof e.Text&&this.path&&(g=!0,y=!0,p+=this.getHeightOfLine(0)*this.zoomX,m+=this.getHeightOfLine(0)*this.zoomY),!!g&&(y?(a.width=Math.ceil(c+p),a.height=Math.ceil(h+m)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,a.width,a.height)),r=s.x/2,o=s.y/2,this.cacheTranslationX=Math.round(a.width/2-r)+r,this.cacheTranslationY=Math.round(a.height/2-o)+o,this.cacheWidth=c,this.cacheHeight=h,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(u,f),this.zoomX=u,this.zoomY=f,!0)},setOptions:function(t){this._setOptions(t),this._initGradient(t.fill,"fill"),this._initGradient(t.stroke,"stroke"),this._initPattern(t.fill,"fill"),this._initPattern(t.stroke,"stroke")},transform:function(t){var e=this.group&&!this.group._transformDone||this.group&&this.canvas&&t===this.canvas.contextTop,i=this.calcTransformMatrix(!e);t.transform(i[0],i[1],i[2],i[3],i[4],i[5])},toObject:function(t){var i=e.Object.NUM_FRACTION_DIGITS,n={type:this.type,version:e.version,originX:this.originX,originY:this.originY,left:r(this.left,i),top:r(this.top,i),width:r(this.width,i),height:r(this.height,i),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:r(this.strokeWidth,i),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:r(this.strokeMiterLimit,i),scaleX:r(this.scaleX,i),scaleY:r(this.scaleY,i),angle:r(this.angle,i),flipX:this.flipX,flipY:this.flipY,opacity:r(this.opacity,i),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:r(this.skewX,i),skewY:r(this.skewY,i)};return this.clipPath&&!this.clipPath.excludeFromExport&&(n.clipPath=this.clipPath.toObject(t),n.clipPath.inverted=this.clipPath.inverted,n.clipPath.absolutePositioned=this.clipPath.absolutePositioned),e.util.populateWithProperties(this,n,t),this.includeDefaultValues||(n=this._removeDefaultValues(n)),n},toDatalessObject:function(t){return this.toObject(t)},_removeDefaultValues:function(t){var i=e.util.getKlass(t.type).prototype;return i.stateProperties.forEach((function(e){"left"!==e&&"top"!==e&&(t[e]===i[e]&&delete t[e],"[object Array]"===Object.prototype.toString.call(t[e])&&"[object Array]"===Object.prototype.toString.call(i[e])&&0===t[e].length&&0===i[e].length&&delete t[e])})),t},toString:function(){return"#<fabric."+o(this.type)+">"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var t=e.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(t.scaleX),scaleY:Math.abs(t.scaleY)}},getTotalObjectScaling:function(){var t=this.getObjectScaling(),e=t.scaleX,i=t.scaleY;if(this.canvas){var n=this.canvas.getZoom(),r=this.canvas.getRetinaScaling();e*=n*r,i*=n*r}return{scaleX:e,scaleY:i}},getObjectOpacity:function(){var t=this.opacity;return this.group&&(t*=this.group.getObjectOpacity()),t},_set:function(t,i){var n="scaleX"===t||"scaleY"===t,r=this[t]!==i,o=!1;return n&&(i=this._constrainScale(i)),"scaleX"===t&&i<0?(this.flipX=!this.flipX,i*=-1):"scaleY"===t&&i<0?(this.flipY=!this.flipY,i*=-1):"shadow"!==t||!i||i instanceof e.Shadow?"dirty"===t&&this.group&&this.group.set("dirty",i):i=new e.Shadow(i),this[t]=i,r&&(o=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(t)>-1?(this.dirty=!0,o&&this.group.set("dirty",!0)):o&&this.stateProperties.indexOf(t)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:e.iMatrix.concat()},isNotVisible:function(){return 0===this.opacity||!this.width&&!this.height&&0===this.strokeWidth||!this.visible},render:function(t){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(t.save(),this._setupCompositeOperation(t),this.drawSelectionBackground(t),this.transform(t),this._setOpacity(t),this._setShadow(t,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(t)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(t),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),t.restore())},renderCache:function(t){t=t||{},this._cacheCanvas||this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,t.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&"transparent"!==this.stroke&&0!==this.strokeWidth},hasFill:function(){return this.fill&&"transparent"!==this.fill},needsItsOwnCache:function(){return!("stroke"!==this.paintFirst||!this.hasFill()||!this.hasStroke()||"object"!=typeof this.shadow)||!!this.clipPath},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(0!==this.shadow.offsetX||0!==this.shadow.offsetY)},drawClipPathOnCache:function(t){var i=this.clipPath;if(t.save(),i.inverted?t.globalCompositeOperation="destination-out":t.globalCompositeOperation="destination-in",i.absolutePositioned){var n=e.util.invertTransform(this.calcTransformMatrix());t.transform(n[0],n[1],n[2],n[3],n[4],n[5])}i.transform(t),t.scale(1/i.zoomX,1/i.zoomY),t.drawImage(i._cacheCanvas,-i.cacheTranslationX,-i.cacheTranslationY),t.restore()},drawObject:function(t,e){var i=this.fill,n=this.stroke;e?(this.fill="black",this.stroke="",this._setClippingProperties(t)):this._renderBackground(t),this._render(t),this._drawClipPath(t),this.fill=i,this.stroke=n},_drawClipPath:function(t){var e=this.clipPath;e&&(e.canvas=this.canvas,e.shouldCache(),e._transformDone=!0,e.renderCache({forClipping:!0}),this.drawClipPathOnCache(t))},drawCacheOnCanvas:function(t){t.scale(1/this.zoomX,1/this.zoomY),t.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(t){if(this.isNotVisible())return!1;if(this._cacheCanvas&&!t&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&!t){var e=this.cacheWidth/this.zoomX,i=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-e/2,-i/2,e,i)}return!0}return!1},_renderBackground:function(t){if(this.backgroundColor){var e=this._getNonTransformedDimensions();t.fillStyle=this.backgroundColor,t.fillRect(-e.x/2,-e.y/2,e.x,e.y),this._removeShadow(t)}},_setOpacity:function(t){this.group&&!this.group._transformDone?t.globalAlpha=this.getObjectOpacity():t.globalAlpha*=this.opacity},_setStrokeStyles:function(t,e){var i=e.stroke;i&&(t.lineWidth=e.strokeWidth,t.lineCap=e.strokeLineCap,t.lineDashOffset=e.strokeDashOffset,t.lineJoin=e.strokeLineJoin,t.miterLimit=e.strokeMiterLimit,i.toLive?"percentage"===i.gradientUnits||i.gradientTransform||i.patternTransform?this._applyPatternForTransformedGradient(t,i):(t.strokeStyle=i.toLive(t,this),this._applyPatternGradientTransform(t,i)):t.strokeStyle=e.stroke)},_setFillStyles:function(t,e){var i=e.fill;i&&(i.toLive?(t.fillStyle=i.toLive(t,this),this._applyPatternGradientTransform(t,e.fill)):t.fillStyle=i)},_setClippingProperties:function(t){t.globalAlpha=1,t.strokeStyle="transparent",t.fillStyle="#000000"},_setLineDash:function(t,e){e&&0!==e.length&&(1&e.length&&e.push.apply(e,e),t.setLineDash(e))},_renderControls:function(t,i){var n,r,o,s=this.getViewportTransform(),l=this.calcTransformMatrix();r=void 0!==(i=i||{}).hasBorders?i.hasBorders:this.hasBorders,o=void 0!==i.hasControls?i.hasControls:this.hasControls,l=e.util.multiplyTransformMatrices(s,l),n=e.util.qrDecompose(l),t.save(),t.translate(n.translateX,n.translateY),t.lineWidth=1*this.borderScaleFactor,this.group||(t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),t.rotate(a(n.angle)),i.forActiveSelection||this.group?r&&this.drawBordersInGroup(t,n,i):r&&this.drawBorders(t,i),o&&this.drawControls(t,i),t.restore()},_setShadow:function(t){if(this.shadow){var i,n=this.shadow,r=this.canvas,o=r&&r.viewportTransform[0]||1,a=r&&r.viewportTransform[3]||1;i=n.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),r&&r._isRetinaScaling()&&(o*=e.devicePixelRatio,a*=e.devicePixelRatio),t.shadowColor=n.color,t.shadowBlur=n.blur*e.browserShadowBlurConstant*(o+a)*(i.scaleX+i.scaleY)/4,t.shadowOffsetX=n.offsetX*o*i.scaleX,t.shadowOffsetY=n.offsetY*a*i.scaleY}},_removeShadow:function(t){this.shadow&&(t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0)},_applyPatternGradientTransform:function(t,e){if(!e||!e.toLive)return{offsetX:0,offsetY:0};var i=e.gradientTransform||e.patternTransform,n=-this.width/2+e.offsetX||0,r=-this.height/2+e.offsetY||0;return"percentage"===e.gradientUnits?t.transform(this.width,0,0,this.height,n,r):t.transform(1,0,0,1,n,r),i&&t.transform(i[0],i[1],i[2],i[3],i[4],i[5]),{offsetX:n,offsetY:r}},_renderPaintInOrder:function(t){"stroke"===this.paintFirst?(this._renderStroke(t),this._renderFill(t)):(this._renderFill(t),this._renderStroke(t))},_render:function(){},_renderFill:function(t){this.fill&&(t.save(),this._setFillStyles(t,this),"evenodd"===this.fillRule?t.fill("evenodd"):t.fill(),t.restore())},_renderStroke:function(t){if(this.stroke&&0!==this.strokeWidth){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(t),t.save(),this.strokeUniform&&this.group){var e=this.getObjectScaling();t.scale(1/e.scaleX,1/e.scaleY)}else this.strokeUniform&&t.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(t,this.strokeDashArray),this._setStrokeStyles(t,this),t.stroke(),t.restore()}},_applyPatternForTransformedGradient:function(t,i){var n,r=this._limitCacheSize(this._getCacheCanvasDimensions()),o=e.util.createCanvasElement(),a=this.canvas.getRetinaScaling(),s=r.x/this.scaleX/a,l=r.y/this.scaleY/a;o.width=s,o.height=l,(n=o.getContext("2d")).beginPath(),n.moveTo(0,0),n.lineTo(s,0),n.lineTo(s,l),n.lineTo(0,l),n.closePath(),n.translate(s/2,l/2),n.scale(r.zoomX/this.scaleX/a,r.zoomY/this.scaleY/a),this._applyPatternGradientTransform(n,i),n.fillStyle=i.toLive(t),n.fill(),t.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),t.scale(a*this.scaleX/r.zoomX,a*this.scaleY/r.zoomY),t.strokeStyle=n.createPattern(o,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var t=e.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",t.scaleX),this.set("scaleY",t.scaleY),this.angle=t.angle,this.skewX=t.skewX,this.skewY=0}},_removeTransformMatrix:function(t){var i=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),i=e.util.transformPoint(i,this.transformMatrix)),this.transformMatrix=null,t&&(this.scaleX*=t.scaleX,this.scaleY*=t.scaleY,this.cropX=t.cropX,this.cropY=t.cropY,i.x+=t.offsetLeft,i.y+=t.offsetTop,this.width=t.width,this.height=t.height),this.setPositionByOrigin(i,"center","center")},clone:function(t,i){var n=this.toObject(i);this.constructor.fromObject?this.constructor.fromObject(n,t):e.Object._fromObject("Object",n,t)},cloneAsImage:function(t,i){var n=this.toCanvasElement(i);return t&&t(new e.Image(n)),this},toCanvasElement:function(t){t||(t={});var i=e.util,n=i.saveObjectTransform(this),r=this.group,o=this.shadow,a=Math.abs,s=(t.multiplier||1)*(t.enableRetinaScaling?e.devicePixelRatio:1);delete this.group,t.withoutTransform&&i.resetObjectTransform(this),t.withoutShadow&&(this.shadow=null);var l,c,h,u,f=e.util.createCanvasElement(),d=this.getBoundingRect(!0,!0),v=this.shadow,g={x:0,y:0};v&&(c=v.blur,l=v.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),g.x=2*Math.round(a(v.offsetX)+c)*a(l.scaleX),g.y=2*Math.round(a(v.offsetY)+c)*a(l.scaleY)),h=d.width+g.x,u=d.height+g.y,f.width=Math.ceil(h),f.height=Math.ceil(u);var p=new e.StaticCanvas(f,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});"jpeg"===t.format&&(p.backgroundColor="#fff"),this.setPositionByOrigin(new e.Point(p.width/2,p.height/2),"center","center");var m=this.canvas;p.add(this);var y=p.toCanvasElement(s||1,t);return this.shadow=o,this.set("canvas",m),r&&(this.group=r),this.set(n).setCoords(),p._objects=[],p.dispose(),p=null,y},toDataURL:function(t){return t||(t={}),e.util.toDataURL(this.toCanvasElement(t),t.format||"png",t.quality||1)},isType:function(t){return this.type===t},complexity:function(){return 1},toJSON:function(t){return this.toObject(t)},rotate:function(t){var e=("center"!==this.originX||"center"!==this.originY)&&this.centeredRotation;return e&&this._setOriginToCenter(),this.set("angle",t),e&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(t,i){i=i||this.canvas.getPointer(t);var n=new e.Point(i.x,i.y),r=this._getLeftTopCoords();return this.angle&&(n=e.util.rotatePoint(n,r,a(-this.angle))),{x:n.x-r.x,y:n.y-r.y}},_setupCompositeOperation:function(t){this.globalCompositeOperation&&(t.globalCompositeOperation=this.globalCompositeOperation)}}),e.util.createAccessors&&e.util.createAccessors(e.Object),i(e.Object.prototype,e.Observable),e.Object.NUM_FRACTION_DIGITS=2,e.Object._fromObject=function(t,i,r,o){var a=e[t];i=n(i,!0),e.util.enlivenPatterns([i.fill,i.stroke],(function(t){void 0!==t[0]&&(i.fill=t[0]),void 0!==t[1]&&(i.stroke=t[1]),e.util.enlivenObjects([i.clipPath],(function(t){i.clipPath=t[0];var e=o?new a(i[o],i):new a(i);r&&r(e)}))}))},e.Object.__uid=0)}(e),b=S.util.degreesToRadians,w={left:-.5,center:0,right:.5},x={top:-.5,center:0,bottom:.5},S.util.object.extend(S.Object.prototype,{translateToGivenOrigin:function(t,e,i,n,r){var o,a,s,l=t.x,c=t.y;return"string"==typeof e?e=w[e]:e-=.5,"string"==typeof n?n=w[n]:n-=.5,"string"==typeof i?i=x[i]:i-=.5,"string"==typeof r?r=x[r]:r-=.5,a=r-i,((o=n-e)||a)&&(s=this._getTransformedDimensions(),l=t.x+o*s.x,c=t.y+a*s.y),new S.Point(l,c)},translateToCenterPoint:function(t,e,i){var n=this.translateToGivenOrigin(t,e,i,"center","center");return this.angle?S.util.rotatePoint(n,t,b(this.angle)):n},translateToOriginPoint:function(t,e,i){var n=this.translateToGivenOrigin(t,"center","center",e,i);return this.angle?S.util.rotatePoint(n,t,b(this.angle)):n},getCenterPoint:function(){var t=new S.Point(this.left,this.top);return this.translateToCenterPoint(t,this.originX,this.originY)},getPointByOrigin:function(t,e){var i=this.getCenterPoint();return this.translateToOriginPoint(i,t,e)},toLocalPoint:function(t,e,i){var n,r,o=this.getCenterPoint();return n=void 0!==e&&void 0!==i?this.translateToGivenOrigin(o,"center","center",e,i):new S.Point(this.left,this.top),r=new S.Point(t.x,t.y),this.angle&&(r=S.util.rotatePoint(r,o,-b(this.angle))),r.subtractEquals(n)},setPositionByOrigin:function(t,e,i){var n=this.translateToCenterPoint(t,e,i),r=this.translateToOriginPoint(n,this.originX,this.originY);this.set("left",r.x),this.set("top",r.y)},adjustPosition:function(t){var e,i,n=b(this.angle),r=this.getScaledWidth(),o=S.util.cos(n)*r,a=S.util.sin(n)*r;e="string"==typeof this.originX?w[this.originX]:this.originX-.5,i="string"==typeof t?w[t]:t-.5,this.left+=o*(i-e),this.top+=a*(i-e),this.setCoords(),this.originX=t},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var t=this.getCenterPoint();this.originX="center",this.originY="center",this.left=t.x,this.top=t.y},_resetOrigin:function(){var t=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=t.x,this.top=t.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}}),function(){var t=S.util,e=t.degreesToRadians,i=t.multiplyTransformMatrices,n=t.transformPoint;t.object.extend(S.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(t,e){return e?t?this.calcACoords():this.calcLineCoords():(this.aCoords&&this.lineCoords||this.setCoords(!0),t?this.aCoords:this.lineCoords)},getCoords:function(t,e){return i=this._getCoords(t,e),[new S.Point(i.tl.x,i.tl.y),new S.Point(i.tr.x,i.tr.y),new S.Point(i.br.x,i.br.y),new S.Point(i.bl.x,i.bl.y)];var i},intersectsWithRect:function(t,e,i,n){var r=this.getCoords(i,n);return"Intersection"===S.Intersection.intersectPolygonRectangle(r,t,e).status},intersectsWithObject:function(t,e,i){return"Intersection"===S.Intersection.intersectPolygonPolygon(this.getCoords(e,i),t.getCoords(e,i)).status||t.isContainedWithinObject(this,e,i)||this.isContainedWithinObject(t,e,i)},isContainedWithinObject:function(t,e,i){for(var n=this.getCoords(e,i),r=e?t.aCoords:t.lineCoords,o=0,a=t._getImageLines(r);o<4;o++)if(!t.containsPoint(n[o],a))return!1;return!0},isContainedWithinRect:function(t,e,i,n){var r=this.getBoundingRect(i,n);return r.left>=t.x&&r.left+r.width<=e.x&&r.top>=t.y&&r.top+r.height<=e.y},containsPoint:function(t,e,i,n){var r=this._getCoords(i,n),o=(e=e||this._getImageLines(r),this._findCrossPoints(t,e));return 0!==o&&o%2==1},isOnScreen:function(t){if(!this.canvas)return!1;var e=this.canvas.vptCoords.tl,i=this.canvas.vptCoords.br;return!!this.getCoords(!0,t).some((function(t){return t.x<=i.x&&t.x>=e.x&&t.y<=i.y&&t.y>=e.y}))||(!!this.intersectsWithRect(e,i,!0,t)||this._containsCenterOfCanvas(e,i,t))},_containsCenterOfCanvas:function(t,e,i){var n={x:(t.x+e.x)/2,y:(t.y+e.y)/2};return!!this.containsPoint(n,null,!0,i)},isPartiallyOnScreen:function(t){if(!this.canvas)return!1;var e=this.canvas.vptCoords.tl,i=this.canvas.vptCoords.br;return!!this.intersectsWithRect(e,i,!0,t)||this.getCoords(!0,t).every((function(t){return(t.x>=i.x||t.x<=e.x)&&(t.y>=i.y||t.y<=e.y)}))&&this._containsCenterOfCanvas(e,i,t)},_getImageLines:function(t){return{topline:{o:t.tl,d:t.tr},rightline:{o:t.tr,d:t.br},bottomline:{o:t.br,d:t.bl},leftline:{o:t.bl,d:t.tl}}},_findCrossPoints:function(t,e){var i,n,r,o=0;for(var a in e)if(!((r=e[a]).o.y<t.y&&r.d.y<t.y||r.o.y>=t.y&&r.d.y>=t.y||(r.o.x===r.d.x&&r.o.x>=t.x?n=r.o.x:(0,i=(r.d.y-r.o.y)/(r.d.x-r.o.x),n=-(t.y-0*t.x-(r.o.y-i*r.o.x))/(0-i)),n>=t.x&&(o+=1),2!==o)))break;return o},getBoundingRect:function(e,i){var n=this.getCoords(e,i);return t.makeBoundingBoxFromPoints(n)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(t){return Math.abs(t)<this.minScaleLimit?t<0?-this.minScaleLimit:this.minScaleLimit:0===t?1e-4:t},scale:function(t){return this._set("scaleX",t),this._set("scaleY",t),this.setCoords()},scaleToWidth:function(t,e){var i=this.getBoundingRect(e).width/this.getScaledWidth();return this.scale(t/this.width/i)},scaleToHeight:function(t,e){var i=this.getBoundingRect(e).height/this.getScaledHeight();return this.scale(t/this.height/i)},calcCoords:function(t){return t?this.calcACoords():this.calcOCoords()},calcLineCoords:function(){var i=this.getViewportTransform(),r=this.padding,o=e(this.angle),a=t.cos(o)*r,s=t.sin(o)*r,l=a+s,c=a-s,h=this.calcACoords(),u={tl:n(h.tl,i),tr:n(h.tr,i),bl:n(h.bl,i),br:n(h.br,i)};return r&&(u.tl.x-=c,u.tl.y-=l,u.tr.x+=l,u.tr.y-=c,u.bl.x-=l,u.bl.y+=c,u.br.x+=c,u.br.y+=l),u},calcOCoords:function(){var t=this._calcRotateMatrix(),e=this._calcTranslateMatrix(),n=this.getViewportTransform(),r=i(n,e),o=i(r,t),a=(o=i(o,[1/n[0],0,0,1/n[3],0,0]),this._calculateCurrentDimensions()),s={};return this.forEachControl((function(t,e,i){s[e]=t.positionHandler(a,o,i)})),s},calcACoords:function(){var t=this._calcRotateMatrix(),e=this._calcTranslateMatrix(),r=i(e,t),o=this._getTransformedDimensions(),a=o.x/2,s=o.y/2;return{tl:n({x:-a,y:-s},r),tr:n({x:a,y:-s},r),bl:n({x:-a,y:s},r),br:n({x:a,y:s},r)}},setCoords:function(t){return this.aCoords=this.calcACoords(),this.lineCoords=this.group?this.aCoords:this.calcLineCoords(),t||(this.oCoords=this.calcOCoords(),this._setCornerCoords&&this._setCornerCoords()),this},_calcRotateMatrix:function(){return t.calcRotateMatrix(this)},_calcTranslateMatrix:function(){var t=this.getCenterPoint();return[1,0,0,1,t.x,t.y]},transformMatrixKey:function(t){var e="";return!t&&this.group&&(e=this.group.transformMatrixKey(t)+"_"),e+this.top+"_"+this.left+"_"+this.scaleX+"_"+this.scaleY+"_"+this.skewX+"_"+this.skewY+"_"+this.angle+"_"+this.originX+"_"+this.originY+"_"+this.width+"_"+this.height+"_"+this.strokeWidth+this.flipX+this.flipY},calcTransformMatrix:function(t){var e=this.calcOwnMatrix();if(t||!this.group)return e;var n=this.transformMatrixKey(t),r=this.matrixCache||(this.matrixCache={});return r.key===n?r.value:(this.group&&(e=i(this.group.calcTransformMatrix(!1),e)),r.key=n,r.value=e,e)},calcOwnMatrix:function(){var e=this.transformMatrixKey(!0),i=this.ownMatrixCache||(this.ownMatrixCache={});if(i.key===e)return i.value;var n=this._calcTranslateMatrix(),r={angle:this.angle,translateX:n[4],translateY:n[5],scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY};return i.key=e,i.value=t.composeMatrix(r),i.value},_calcDimensionsTransformMatrix:function(e,i,n){return t.calcDimensionsMatrix({skewX:e,skewY:i,scaleX:this.scaleX*(n&&this.flipX?-1:1),scaleY:this.scaleY*(n&&this.flipY?-1:1)})},_getNonTransformedDimensions:function(){var t=this.strokeWidth;return{x:this.width+t,y:this.height+t}},_getTransformedDimensions:function(e,i){void 0===e&&(e=this.skewX),void 0===i&&(i=this.skewY);var n,r,o,a=0===e&&0===i;if(this.strokeUniform?(r=this.width,o=this.height):(r=(n=this._getNonTransformedDimensions()).x,o=n.y),a)return this._finalizeDimensions(r*this.scaleX,o*this.scaleY);var s=t.sizeAfterTransform(r,o,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:e,skewY:i});return this._finalizeDimensions(s.x,s.y)},_finalizeDimensions:function(t,e){return this.strokeUniform?{x:t+this.strokeWidth,y:e+this.strokeWidth}:{x:t,y:e}},_calculateCurrentDimensions:function(){var t=this.getViewportTransform(),e=this._getTransformedDimensions();return n(e,t,!0).scalarAdd(2*this.padding)}})}(),S.util.object.extend(S.Object.prototype,{sendToBack:function(){return this.group?S.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?S.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(t){return this.group?S.StaticCanvas.prototype.sendBackwards.call(this.group,this,t):this.canvas&&this.canvas.sendBackwards(this,t),this},bringForward:function(t){return this.group?S.StaticCanvas.prototype.bringForward.call(this.group,this,t):this.canvas&&this.canvas.bringForward(this,t),this},moveTo:function(t){return this.group&&"activeSelection"!==this.group.type?S.StaticCanvas.prototype.moveTo.call(this.group,this,t):this.canvas&&this.canvas.moveTo(this,t),this}}),function(){function t(t,e){if(e){if(e.toLive)return t+": url(#SVGID_"+e.id+"); ";var i=new S.Color(e),n=t+": "+i.toRgb()+"; ",r=i.getAlpha();return 1!==r&&(n+=t+"-opacity: "+r.toString()+"; "),n}return t+": none; "}var e=S.util.toFixed;S.util.object.extend(S.Object.prototype,{getSvgStyles:function(e){var i=this.fillRule?this.fillRule:"nonzero",n=this.strokeWidth?this.strokeWidth:"0",r=this.strokeDashArray?this.strokeDashArray.join(" "):"none",o=this.strokeDashOffset?this.strokeDashOffset:"0",a=this.strokeLineCap?this.strokeLineCap:"butt",s=this.strokeLineJoin?this.strokeLineJoin:"miter",l=this.strokeMiterLimit?this.strokeMiterLimit:"4",c=void 0!==this.opacity?this.opacity:"1",h=this.visible?"":" visibility: hidden;",u=e?"":this.getSvgFilter(),f=t("fill",this.fill);return[t("stroke",this.stroke),"stroke-width: ",n,"; ","stroke-dasharray: ",r,"; ","stroke-linecap: ",a,"; ","stroke-dashoffset: ",o,"; ","stroke-linejoin: ",s,"; ","stroke-miterlimit: ",l,"; ",f,"fill-rule: ",i,"; ","opacity: ",c,";",u,h].join("")},getSvgSpanStyles:function(e,i){var n=e.fontFamily?"font-family: "+(-1===e.fontFamily.indexOf("'")&&-1===e.fontFamily.indexOf('"')?"'"+e.fontFamily+"'":e.fontFamily)+"; ":"",r=e.strokeWidth?"stroke-width: "+e.strokeWidth+"; ":"",o=(n=n,e.fontSize?"font-size: "+e.fontSize+"px; ":""),a=e.fontStyle?"font-style: "+e.fontStyle+"; ":"",s=e.fontWeight?"font-weight: "+e.fontWeight+"; ":"",l=e.fill?t("fill",e.fill):"",c=e.stroke?t("stroke",e.stroke):"",h=this.getSvgTextDecoration(e);return h&&(h="text-decoration: "+h+"; "),[c,r,n,o,a,s,h,l,e.deltaY?"baseline-shift: "+-e.deltaY+"; ":"",i?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(t){return["overline","underline","line-through"].filter((function(e){return t[e.replace("-","")]})).join(" ")},getSvgFilter:function(){return this.shadow?"filter: url(#SVGID_"+this.shadow.id+");":""},getSvgCommons:function(){return[this.id?'id="'+this.id+'" ':"",this.clipPath?'clip-path="url(#'+this.clipPath.clipPathId+')" ':""].join("")},getSvgTransform:function(t,e){var i=t?this.calcTransformMatrix():this.calcOwnMatrix();return'transform="'+S.util.matrixToSVG(i)+(e||"")+'" '},_setSVGBg:function(t){if(this.backgroundColor){var i=S.Object.NUM_FRACTION_DIGITS;t.push("\t\t<rect ",this._getFillAttributes(this.backgroundColor),' x="',e(-this.width/2,i),'" y="',e(-this.height/2,i),'" width="',e(this.width,i),'" height="',e(this.height,i),'"></rect>\n')}},toSVG:function(t){return this._createBaseSVGMarkup(this._toSVG(t),{reviver:t})},toClipPathSVG:function(t){return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(t),{reviver:t})},_createBaseClipPathSVGMarkup:function(t,e){var i=(e=e||{}).reviver,n=e.additionalTransform||"",r=[this.getSvgTransform(!0,n),this.getSvgCommons()].join(""),o=t.indexOf("COMMON_PARTS");return t[o]=r,i?i(t.join("")):t.join("")},_createBaseSVGMarkup:function(t,e){var i,n,r=(e=e||{}).noStyle,o=e.reviver,a=r?"":'style="'+this.getSvgStyles()+'" ',s=e.withShadow?'style="'+this.getSvgFilter()+'" ':"",l=this.clipPath,c=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",h=l&&l.absolutePositioned,u=this.stroke,f=this.fill,d=this.shadow,v=[],g=t.indexOf("COMMON_PARTS"),p=e.additionalTransform;return l&&(l.clipPathId="CLIPPATH_"+S.Object.__uid++,n='<clipPath id="'+l.clipPathId+'" >\n'+l.toClipPathSVG(o)+"</clipPath>\n"),h&&v.push("<g ",s,this.getSvgCommons()," >\n"),v.push("<g ",this.getSvgTransform(!1),h?"":s+this.getSvgCommons()," >\n"),i=[a,c,r?"":this.addPaintOrder()," ",p?'transform="'+p+'" ':""].join(""),t[g]=i,f&&f.toLive&&v.push(f.toSVG(this)),u&&u.toLive&&v.push(u.toSVG(this)),d&&v.push(d.toSVG(this)),l&&v.push(n),v.push(t.join("")),v.push("</g>\n"),h&&v.push("</g>\n"),o?o(v.join("")):v.join("")},addPaintOrder:function(){return"fill"!==this.paintFirst?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var t=S.util.object.extend;function e(e,i,n){var r={};n.forEach((function(t){r[t]=e[t]})),t(e[i],r,!0)}S.util.object.extend(S.Object.prototype,{hasStateChanged:function(t){var e="_"+(t=t||"stateProperties");return Object.keys(this[e]).length<this[t].length||!function t(e,i,n){if(e===i)return!0;if(Array.isArray(e)){if(!Array.isArray(i)||e.length!==i.length)return!1;for(var r=0,o=e.length;r<o;r++)if(!t(e[r],i[r]))return!1;return!0}if(e&&"object"==typeof e){var a,s=Object.keys(e);if(!i||"object"!=typeof i||!n&&s.length!==Object.keys(i).length)return!1;for(r=0,o=s.length;r<o;r++)if("canvas"!==(a=s[r])&&"group"!==a&&!t(e[a],i[a]))return!1;return!0}}(this[e],this,!0)},saveState:function(t){var i=t&&t.propertySet||"stateProperties",n="_"+i;return this[n]?(e(this,n,this[i]),t&&t.stateProperties&&e(this,n,t.stateProperties),this):this.setupState(t)},setupState:function(t){var e=(t=t||{}).propertySet||"stateProperties";return t.propertySet=e,this["_"+e]={},this.saveState(t),this}})}(),function(){var t=S.util.degreesToRadians;S.util.object.extend(S.Object.prototype,{_findTargetCorner:function(t,e){if(!this.hasControls||this.group||!this.canvas||this.canvas._activeObject!==this)return!1;var i,n,r,o=t.x,a=t.y,s=Object.keys(this.oCoords),l=s.length-1;for(this.__corner=0;l>=0;l--)if(r=s[l],this.isControlVisible(r)&&(n=this._getImageLines(e?this.oCoords[r].touchCorner:this.oCoords[r].corner),0!==(i=this._findCrossPoints({x:o,y:a},n))&&i%2==1))return this.__corner=r,r;return!1},forEachControl:function(t){for(var e in this.controls)t(this.controls[e],e,this)},_setCornerCoords:function(){var t=this.oCoords;for(var e in t){var i=this.controls[e];t[e].corner=i.calcCornerCoords(this.angle,this.cornerSize,t[e].x,t[e].y,!1),t[e].touchCorner=i.calcCornerCoords(this.angle,this.touchCornerSize,t[e].x,t[e].y,!0)}},drawSelectionBackground:function(e){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;e.save();var i=this.getCenterPoint(),n=this._calculateCurrentDimensions(),r=this.canvas.viewportTransform;return e.translate(i.x,i.y),e.scale(1/r[0],1/r[3]),e.rotate(t(this.angle)),e.fillStyle=this.selectionBackgroundColor,e.fillRect(-n.x/2,-n.y/2,n.x,n.y),e.restore(),this},drawBorders:function(t,e){e=e||{};var i=this._calculateCurrentDimensions(),n=this.borderScaleFactor,r=i.x+n,o=i.y+n,a=void 0!==e.hasControls?e.hasControls:this.hasControls,s=!1;return t.save(),t.strokeStyle=e.borderColor||this.borderColor,this._setLineDash(t,e.borderDashArray||this.borderDashArray),t.strokeRect(-r/2,-o/2,r,o),a&&(t.beginPath(),this.forEachControl((function(e,i,n){e.withConnection&&e.getVisibility(n,i)&&(s=!0,t.moveTo(e.x*r,e.y*o),t.lineTo(e.x*r+e.offsetX,e.y*o+e.offsetY))})),s&&t.stroke()),t.restore(),this},drawBordersInGroup:function(t,e,i){i=i||{};var n=S.util.sizeAfterTransform(this.width,this.height,e),r=this.strokeWidth,o=this.strokeUniform,a=this.borderScaleFactor,s=n.x+r*(o?this.canvas.getZoom():e.scaleX)+a,l=n.y+r*(o?this.canvas.getZoom():e.scaleY)+a;return t.save(),this._setLineDash(t,i.borderDashArray||this.borderDashArray),t.strokeStyle=i.borderColor||this.borderColor,t.strokeRect(-s/2,-l/2,s,l),t.restore(),this},drawControls:function(t,e){e=e||{},t.save();var i,n,r=this.canvas.getRetinaScaling();return t.setTransform(r,0,0,r,0,0),t.strokeStyle=t.fillStyle=e.cornerColor||this.cornerColor,this.transparentCorners||(t.strokeStyle=e.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(t,e.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(i=this.group.calcTransformMatrix()),this.forEachControl((function(r,o,a){n=a.oCoords[o],r.getVisibility(a,o)&&(i&&(n=S.util.transformPoint(n,i)),r.render(t,n.x,n.y,e,a))})),t.restore(),this},isControlVisible:function(t){return this.controls[t]&&this.controls[t].getVisibility(this,t)},setControlVisible:function(t,e){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[t]=e,this},setControlsVisibility:function(t){for(var e in t||(t={}),t)this.setControlVisible(e,t[e]);return this},onDeselect:function(){},onSelect:function(){}})}(),S.util.object.extend(S.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(t,e){var i=function(){},n=(e=e||{}).onComplete||i,r=e.onChange||i,o=this;return S.util.animate({startValue:t.left,endValue:this.getCenter().left,duration:this.FX_DURATION,onChange:function(e){t.set("left",e),o.requestRenderAll(),r()},onComplete:function(){t.setCoords(),n()}}),this},fxCenterObjectV:function(t,e){var i=function(){},n=(e=e||{}).onComplete||i,r=e.onChange||i,o=this;return S.util.animate({startValue:t.top,endValue:this.getCenter().top,duration:this.FX_DURATION,onChange:function(e){t.set("top",e),o.requestRenderAll(),r()},onComplete:function(){t.setCoords(),n()}}),this},fxRemove:function(t,e){var i=function(){},n=(e=e||{}).onComplete||i,r=e.onChange||i,o=this;return S.util.animate({startValue:t.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(e){t.set("opacity",e),o.requestRenderAll(),r()},onComplete:function(){o.remove(t),n()}}),this}}),S.util.object.extend(S.Object.prototype,{animate:function(){if(arguments[0]&&"object"==typeof arguments[0]){var t,e,i=[];for(t in arguments[0])i.push(t);for(var n=0,r=i.length;n<r;n++)t=i[n],e=n!==r-1,this._animate(t,arguments[0][t],arguments[1],e)}else this._animate.apply(this,arguments);return this},_animate:function(t,e,i,n){var r,o=this;e=e.toString(),i=i?S.util.object.clone(i):{},~t.indexOf(".")&&(r=t.split("."));var a=o.colorProperties.indexOf(t)>-1||r&&o.colorProperties.indexOf(r[1])>-1,s=r?this.get(r[0])[r[1]]:this.get(t);"from"in i||(i.from=s),a||(e=~e.indexOf("=")?s+parseFloat(e.replace("=","")):parseFloat(e));var l={startValue:i.from,endValue:e,byValue:i.by,easing:i.easing,duration:i.duration,abort:i.abort&&function(t,e,n){return i.abort.call(o,t,e,n)},onChange:function(e,a,s){r?o[r[0]][r[1]]=e:o.set(t,e),n||i.onChange&&i.onChange(e,a,s)},onComplete:function(t,e,r){n||(o.setCoords(),i.onComplete&&i.onComplete(t,e,r))}};return a?S.util.animateColor(l.startValue,l.endValue,l.duration,l):S.util.animate(l)}}),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.util.object.clone,r={x1:1,x2:1,y1:1,y2:1};function o(t,e){var i=t.origin,n=t.axis1,r=t.axis2,o=t.dimension,a=e.nearest,s=e.center,l=e.farthest;return function(){switch(this.get(i)){case a:return Math.min(this.get(n),this.get(r));case s:return Math.min(this.get(n),this.get(r))+.5*this.get(o);case l:return Math.max(this.get(n),this.get(r))}}}e.Line?e.warn("fabric.Line is already defined"):(e.Line=e.util.createClass(e.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:e.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(t,e){t||(t=[0,0,0,0]),this.callSuper("initialize",e),this.set("x1",t[0]),this.set("y1",t[1]),this.set("x2",t[2]),this.set("y2",t[3]),this._setWidthHeight(e)},_setWidthHeight:function(t){t||(t={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in t?t.left:this._getLeftToOriginX(),this.top="top"in t?t.top:this._getTopToOriginY()},_set:function(t,e){return this.callSuper("_set",t,e),void 0!==r[t]&&this._setWidthHeight(),this},_getLeftToOriginX:o({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:o({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(t){t.beginPath();var e=this.calcLinePoints();t.moveTo(e.x1,e.y1),t.lineTo(e.x2,e.y2),t.lineWidth=this.strokeWidth;var i=t.strokeStyle;t.strokeStyle=this.stroke||t.fillStyle,this.stroke&&this._renderStroke(t),t.strokeStyle=i},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(t){return i(this.callSuper("toObject",t),this.calcLinePoints())},_getNonTransformedDimensions:function(){var t=this.callSuper("_getNonTransformedDimensions");return"butt"===this.strokeLineCap&&(0===this.width&&(t.y-=this.strokeWidth),0===this.height&&(t.x-=this.strokeWidth)),t},calcLinePoints:function(){var t=this.x1<=this.x2?-1:1,e=this.y1<=this.y2?-1:1,i=t*this.width*.5,n=e*this.height*.5;return{x1:i,x2:t*this.width*-.5,y1:n,y2:e*this.height*-.5}},_toSVG:function(){var t=this.calcLinePoints();return["<line ","COMMON_PARTS",'x1="',t.x1,'" y1="',t.y1,'" x2="',t.x2,'" y2="',t.y2,'" />\n']}}),e.Line.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),e.Line.fromElement=function(t,n,r){r=r||{};var o=e.parseAttributes(t,e.Line.ATTRIBUTE_NAMES),a=[o.x1||0,o.y1||0,o.x2||0,o.y2||0];n(new e.Line(a,i(o,r)))},e.Line.fromObject=function(t,i){var r=n(t,!0);r.points=[t.x1,t.y1,t.x2,t.y2],e.Object._fromObject("Line",r,(function(t){delete t.points,i&&i(t)}),"points")})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=Math.PI;e.Circle?e.warn("fabric.Circle is already defined."):(e.Circle=e.util.createClass(e.Object,{type:"circle",radius:0,startAngle:0,endAngle:2*i,cacheProperties:e.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(t,e){return this.callSuper("_set",t,e),"radius"===t&&this.setRadius(e),this},toObject:function(t){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(t))},_toSVG:function(){var t,n=(this.endAngle-this.startAngle)%(2*i);if(0===n)t=["<circle ","COMMON_PARTS",'cx="0" cy="0" ','r="',this.radius,'" />\n'];else{var r=e.util.cos(this.startAngle)*this.radius,o=e.util.sin(this.startAngle)*this.radius,a=e.util.cos(this.endAngle)*this.radius,s=e.util.sin(this.endAngle)*this.radius,l=n>i?"1":"0";t=['<path d="M '+r+" "+o," A "+this.radius+" "+this.radius," 0 ",+l+" 1"," "+a+" "+s,'" ',"COMMON_PARTS"," />\n"]}return t},_render:function(t){t.beginPath(),t.arc(0,0,this.radius,this.startAngle,this.endAngle,!1),this._renderPaintInOrder(t)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(t){return this.radius=t,this.set("width",2*t).set("height",2*t)}}),e.Circle.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),e.Circle.fromElement=function(t,i){var n,r=e.parseAttributes(t,e.Circle.ATTRIBUTE_NAMES);if(!("radius"in(n=r)&&n.radius>=0))throw new Error("value of `r` attribute is required and can not be negative");r.left=(r.left||0)-r.radius,r.top=(r.top||0)-r.radius,i(new e.Circle(r))},e.Circle.fromObject=function(t,i){e.Object._fromObject("Circle",t,i)})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={});e.Triangle?e.warn("fabric.Triangle is already defined"):(e.Triangle=e.util.createClass(e.Object,{type:"triangle",width:100,height:100,_render:function(t){var e=this.width/2,i=this.height/2;t.beginPath(),t.moveTo(-e,i),t.lineTo(0,-i),t.lineTo(e,i),t.closePath(),this._renderPaintInOrder(t)},_toSVG:function(){var t=this.width/2,e=this.height/2;return["<polygon ","COMMON_PARTS",'points="',[-t+" "+e,"0 "+-e,t+" "+e].join(","),'" />']}}),e.Triangle.fromObject=function(t,i){return e.Object._fromObject("Triangle",t,i)})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=2*Math.PI;e.Ellipse?e.warn("fabric.Ellipse is already defined."):(e.Ellipse=e.util.createClass(e.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:e.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(t){this.callSuper("initialize",t),this.set("rx",t&&t.rx||0),this.set("ry",t&&t.ry||0)},_set:function(t,e){switch(this.callSuper("_set",t,e),t){case"rx":this.rx=e,this.set("width",2*e);break;case"ry":this.ry=e,this.set("height",2*e)}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(t){return this.callSuper("toObject",["rx","ry"].concat(t))},_toSVG:function(){return["<ellipse ","COMMON_PARTS",'cx="0" cy="0" ','rx="',this.rx,'" ry="',this.ry,'" />\n']},_render:function(t){t.beginPath(),t.save(),t.transform(1,0,0,this.ry/this.rx,0,0),t.arc(0,0,this.rx,0,i,!1),t.restore(),this._renderPaintInOrder(t)}}),e.Ellipse.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),e.Ellipse.fromElement=function(t,i){var n=e.parseAttributes(t,e.Ellipse.ATTRIBUTE_NAMES);n.left=(n.left||0)-n.rx,n.top=(n.top||0)-n.ry,i(new e.Ellipse(n))},e.Ellipse.fromObject=function(t,i){e.Object._fromObject("Ellipse",t,i)})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend;e.Rect?e.warn("fabric.Rect is already defined"):(e.Rect=e.util.createClass(e.Object,{stateProperties:e.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:e.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(t){this.callSuper("initialize",t),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(t){var e=this.rx?Math.min(this.rx,this.width/2):0,i=this.ry?Math.min(this.ry,this.height/2):0,n=this.width,r=this.height,o=-this.width/2,a=-this.height/2,s=0!==e||0!==i,l=.4477152502;t.beginPath(),t.moveTo(o+e,a),t.lineTo(o+n-e,a),s&&t.bezierCurveTo(o+n-l*e,a,o+n,a+l*i,o+n,a+i),t.lineTo(o+n,a+r-i),s&&t.bezierCurveTo(o+n,a+r-l*i,o+n-l*e,a+r,o+n-e,a+r),t.lineTo(o+e,a+r),s&&t.bezierCurveTo(o+l*e,a+r,o,a+r-l*i,o,a+r-i),t.lineTo(o,a+i),s&&t.bezierCurveTo(o,a+l*i,o+l*e,a,o+e,a),t.closePath(),this._renderPaintInOrder(t)},toObject:function(t){return this.callSuper("toObject",["rx","ry"].concat(t))},_toSVG:function(){return["<rect ","COMMON_PARTS",'x="',-this.width/2,'" y="',-this.height/2,'" rx="',this.rx,'" ry="',this.ry,'" width="',this.width,'" height="',this.height,'" />\n']}}),e.Rect.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),e.Rect.fromElement=function(t,n,r){if(!t)return n(null);r=r||{};var o=e.parseAttributes(t,e.Rect.ATTRIBUTE_NAMES);o.left=o.left||0,o.top=o.top||0,o.height=o.height||0,o.width=o.width||0;var a=new e.Rect(i(r?e.util.object.clone(r):{},o));a.visible=a.visible&&a.width>0&&a.height>0,n(a)},e.Rect.fromObject=function(t,i){return e.Object._fromObject("Rect",t,i)})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.util.array.min,r=e.util.array.max,o=e.util.toFixed;e.Polyline?e.warn("fabric.Polyline is already defined"):(e.Polyline=e.util.createClass(e.Object,{type:"polyline",points:null,cacheProperties:e.Object.prototype.cacheProperties.concat("points"),initialize:function(t,e){e=e||{},this.points=t||[],this.callSuper("initialize",e),this._setPositionDimensions(e)},_setPositionDimensions:function(t){var e,i=this._calcDimensions(t);this.width=i.width,this.height=i.height,t.fromSVG||(e=this.translateToGivenOrigin({x:i.left-this.strokeWidth/2,y:i.top-this.strokeWidth/2},"left","top",this.originX,this.originY)),void 0===t.left&&(this.left=t.fromSVG?i.left:e.x),void 0===t.top&&(this.top=t.fromSVG?i.top:e.y),this.pathOffset={x:i.left+this.width/2,y:i.top+this.height/2}},_calcDimensions:function(){var t=this.points,e=n(t,"x")||0,i=n(t,"y")||0;return{left:e,top:i,width:(r(t,"x")||0)-e,height:(r(t,"y")||0)-i}},toObject:function(t){return i(this.callSuper("toObject",t),{points:this.points.concat()})},_toSVG:function(){for(var t=[],i=this.pathOffset.x,n=this.pathOffset.y,r=e.Object.NUM_FRACTION_DIGITS,a=0,s=this.points.length;a<s;a++)t.push(o(this.points[a].x-i,r),",",o(this.points[a].y-n,r)," ");return["<"+this.type+" ","COMMON_PARTS",'points="',t.join(""),'" />\n']},commonRender:function(t){var e,i=this.points.length,n=this.pathOffset.x,r=this.pathOffset.y;if(!i||isNaN(this.points[i-1].y))return!1;t.beginPath(),t.moveTo(this.points[0].x-n,this.points[0].y-r);for(var o=0;o<i;o++)e=this.points[o],t.lineTo(e.x-n,e.y-r);return!0},_render:function(t){this.commonRender(t)&&this._renderPaintInOrder(t)},complexity:function(){return this.get("points").length}}),e.Polyline.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat(),e.Polyline.fromElementGenerator=function(t){return function(n,r,o){if(!n)return r(null);o||(o={});var a=e.parsePointsAttribute(n.getAttribute("points")),s=e.parseAttributes(n,e[t].ATTRIBUTE_NAMES);s.fromSVG=!0,r(new e[t](a,i(s,o)))}},e.Polyline.fromElement=e.Polyline.fromElementGenerator("Polyline"),e.Polyline.fromObject=function(t,i){return e.Object._fromObject("Polyline",t,i,"points")})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={});e.Polygon?e.warn("fabric.Polygon is already defined"):(e.Polygon=e.util.createClass(e.Polyline,{type:"polygon",_render:function(t){this.commonRender(t)&&(t.closePath(),this._renderPaintInOrder(t))}}),e.Polygon.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat(),e.Polygon.fromElement=e.Polyline.fromElementGenerator("Polygon"),e.Polygon.fromObject=function(t,i){e.Object._fromObject("Polygon",t,i,"points")})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.array.min,n=e.util.array.max,r=e.util.object.extend,o=Object.prototype.toString,a=e.util.toFixed;e.Path?e.warn("fabric.Path is already defined"):(e.Path=e.util.createClass(e.Object,{type:"path",path:null,cacheProperties:e.Object.prototype.cacheProperties.concat("path","fillRule"),stateProperties:e.Object.prototype.stateProperties.concat("path"),initialize:function(t,i){i=i||{},this.callSuper("initialize",i),t||(t=[]);var n="[object Array]"===o.call(t);this.path=e.util.makePathSimpler(n?t:e.util.parsePath(t)),this.path&&e.Polyline.prototype._setPositionDimensions.call(this,i)},_renderPathCommands:function(t){var e,i=0,n=0,r=0,o=0,a=0,s=0,l=-this.pathOffset.x,c=-this.pathOffset.y;t.beginPath();for(var h=0,u=this.path.length;h<u;++h)switch((e=this.path[h])[0]){case"L":r=e[1],o=e[2],t.lineTo(r+l,o+c);break;case"M":i=r=e[1],n=o=e[2],t.moveTo(r+l,o+c);break;case"C":r=e[5],o=e[6],a=e[3],s=e[4],t.bezierCurveTo(e[1]+l,e[2]+c,a+l,s+c,r+l,o+c);break;case"Q":t.quadraticCurveTo(e[1]+l,e[2]+c,e[3]+l,e[4]+c),r=e[3],o=e[4],a=e[1],s=e[2];break;case"z":case"Z":r=i,o=n,t.closePath()}},_render:function(t){this._renderPathCommands(t),this._renderPaintInOrder(t)},toString:function(){return"#<fabric.Path ("+this.complexity()+'): { "top": '+this.top+', "left": '+this.left+" }>"},toObject:function(t){return r(this.callSuper("toObject",t),{path:this.path.map((function(t){return t.slice()}))})},toDatalessObject:function(t){var e=this.toObject(["sourcePath"].concat(t));return e.sourcePath&&delete e.path,e},_toSVG:function(){return["<path ","COMMON_PARTS",'d="',e.util.joinPath(this.path),'" stroke-linecap="round" ',"/>\n"]},_getOffsetTransform:function(){var t=e.Object.NUM_FRACTION_DIGITS;return" translate("+a(-this.pathOffset.x,t)+", "+a(-this.pathOffset.y,t)+")"},toClipPathSVG:function(t){var e=this._getOffsetTransform();return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:t,additionalTransform:e})},toSVG:function(t){var e=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:t,additionalTransform:e})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var t,r,o=[],a=[],s=0,l=0,c=0,h=0,u=0,f=this.path.length;u<f;++u){switch((t=this.path[u])[0]){case"L":c=t[1],h=t[2],r=[];break;case"M":s=c=t[1],l=h=t[2],r=[];break;case"C":r=e.util.getBoundsOfCurve(c,h,t[1],t[2],t[3],t[4],t[5],t[6]),c=t[5],h=t[6];break;case"Q":r=e.util.getBoundsOfCurve(c,h,t[1],t[2],t[1],t[2],t[3],t[4]),c=t[3],h=t[4];break;case"z":case"Z":c=s,h=l}r.forEach((function(t){o.push(t.x),a.push(t.y)})),o.push(c),a.push(h)}var d=i(o)||0,v=i(a)||0;return{left:d,top:v,width:(n(o)||0)-d,height:(n(a)||0)-v}}}),e.Path.fromObject=function(t,i){if("string"==typeof t.sourcePath){var n=t.sourcePath;e.loadSVGFromURL(n,(function(e){var n=e[0];n.setOptions(t),i&&i(n)}))}else e.Object._fromObject("Path",t,i,"path")},e.Path.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat(["d"]),e.Path.fromElement=function(t,i,n){var o=e.parseAttributes(t,e.Path.ATTRIBUTE_NAMES);o.fromSVG=!0,i(new e.Path(o.d,r(o,n)))})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.array.min,n=e.util.array.max;e.Group||(e.Group=e.util.createClass(e.Object,e.Collection,{type:"group",strokeWidth:0,subTargetCheck:!1,cacheProperties:[],useSetOnGroup:!1,initialize:function(t,e,i){e=e||{},this._objects=[],i&&this.callSuper("initialize",e),this._objects=t||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;if(i)this._updateObjectsACoords();else{var r=e&&e.centerPoint;void 0!==e.originX&&(this.originX=e.originX),void 0!==e.originY&&(this.originY=e.originY),r||this._calcBounds(),this._updateObjectsCoords(r),delete e.centerPoint,this.callSuper("initialize",e)}this.setCoords()},_updateObjectsACoords:function(){for(var t=this._objects.length;t--;)this._objects[t].setCoords(!0)},_updateObjectsCoords:function(t){t=t||this.getCenterPoint();for(var e=this._objects.length;e--;)this._updateObjectCoords(this._objects[e],t)},_updateObjectCoords:function(t,e){var i=t.left,n=t.top;t.set({left:i-e.x,top:n-e.y}),t.group=this,t.setCoords(!0)},toString:function(){return"#<fabric.Group: ("+this.complexity()+")>"},addWithUpdate:function(t){var i=!!this.group;return this._restoreObjectsState(),e.util.resetObjectTransform(this),t&&(i&&e.util.removeTransformFromObject(t,this.group.calcTransformMatrix()),this._objects.push(t),t.group=this,t._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,i?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(t){return this._restoreObjectsState(),e.util.resetObjectTransform(this),this.remove(t),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(t){this.dirty=!0,t.group=this,t._set("canvas",this.canvas)},_onObjectRemoved:function(t){this.dirty=!0,delete t.group},_set:function(t,i){var n=this._objects.length;if(this.useSetOnGroup)for(;n--;)this._objects[n].setOnGroup(t,i);if("canvas"===t)for(;n--;)this._objects[n]._set(t,i);e.Object.prototype._set.call(this,t,i)},toObject:function(t){var i=this.includeDefaultValues,n=this._objects.filter((function(t){return!t.excludeFromExport})).map((function(e){var n=e.includeDefaultValues;e.includeDefaultValues=i;var r=e.toObject(t);return e.includeDefaultValues=n,r})),r=e.Object.prototype.toObject.call(this,t);return r.objects=n,r},toDatalessObject:function(t){var i,n=this.sourcePath;if(n)i=n;else{var r=this.includeDefaultValues;i=this._objects.map((function(e){var i=e.includeDefaultValues;e.includeDefaultValues=r;var n=e.toDatalessObject(t);return e.includeDefaultValues=i,n}))}var o=e.Object.prototype.toDatalessObject.call(this,t);return o.objects=i,o},render:function(t){this._transformDone=!0,this.callSuper("render",t),this._transformDone=!1},shouldCache:function(){var t=e.Object.prototype.shouldCache.call(this);if(t)for(var i=0,n=this._objects.length;i<n;i++)if(this._objects[i].willDrawShadow())return this.ownCaching=!1,!1;return t},willDrawShadow:function(){if(e.Object.prototype.willDrawShadow.call(this))return!0;for(var t=0,i=this._objects.length;t<i;t++)if(this._objects[t].willDrawShadow())return!0;return!1},isOnACache:function(){return this.ownCaching||this.group&&this.group.isOnACache()},drawObject:function(t){for(var e=0,i=this._objects.length;e<i;e++)this._objects[e].render(t);this._drawClipPath(t)},isCacheDirty:function(t){if(this.callSuper("isCacheDirty",t))return!0;if(!this.statefullCache)return!1;for(var e=0,i=this._objects.length;e<i;e++)if(this._objects[e].isCacheDirty(!0)){if(this._cacheCanvas){var n=this.cacheWidth/this.zoomX,r=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-n/2,-r/2,n,r)}return!0}return!1},_restoreObjectsState:function(){var t=this.calcOwnMatrix();return this._objects.forEach((function(i){e.util.addTransformToObject(i,t),delete i.group,i.setCoords()})),this},realizeTransform:function(t,i){return e.util.addTransformToObject(t,i),t},destroy:function(){return this._objects.forEach((function(t){t.set("dirty",!0)})),this._restoreObjectsState()},toActiveSelection:function(){if(this.canvas){var t=this._objects,i=this.canvas;this._objects=[];var n=this.toObject();delete n.objects;var r=new e.ActiveSelection([]);return r.set(n),r.type="activeSelection",i.remove(this),t.forEach((function(t){t.group=r,t.dirty=!0,i.add(t)})),r.canvas=i,r._objects=t,i._activeObject=r,r.setCoords(),r}},ungroupOnCanvas:function(){return this._restoreObjectsState()},setObjectsCoords:function(){return this.forEachObject((function(t){t.setCoords(!0)})),this},_calcBounds:function(t){for(var e,i,n,r,o=[],a=[],s=["tr","br","bl","tl"],l=0,c=this._objects.length,h=s.length;l<c;++l){for(n=(e=this._objects[l]).calcACoords(),r=0;r<h;r++)i=s[r],o.push(n[i].x),a.push(n[i].y);e.aCoords=n}this._getBounds(o,a,t)},_getBounds:function(t,r,o){var a=new e.Point(i(t),i(r)),s=new e.Point(n(t),n(r)),l=a.y||0,c=a.x||0,h=s.x-a.x||0,u=s.y-a.y||0;this.width=h,this.height=u,o||this.setPositionByOrigin({x:c,y:l},"left","top")},_toSVG:function(t){for(var e=["<g ","COMMON_PARTS"," >\n"],i=0,n=this._objects.length;i<n;i++)e.push("\t\t",this._objects[i].toSVG(t));return e.push("</g>\n"),e},getSvgStyles:function(){var t=void 0!==this.opacity&&1!==this.opacity?"opacity: "+this.opacity+";":"",e=this.visible?"":" visibility: hidden;";return[t,this.getSvgFilter(),e].join("")},toClipPathSVG:function(t){for(var e=[],i=0,n=this._objects.length;i<n;i++)e.push("\t",this._objects[i].toClipPathSVG(t));return this._createBaseClipPathSVGMarkup(e,{reviver:t})}}),e.Group.fromObject=function(t,i){var n=t.objects,r=e.util.object.clone(t,!0);delete r.objects,"string"!=typeof n?e.util.enlivenObjects(n,(function(n){e.util.enlivenObjects([t.clipPath],(function(r){var o=e.util.object.clone(t,!0);o.clipPath=r[0],delete o.objects,i&&i(new e.Group(n,o,!0))}))})):e.loadSVGFromURL(n,(function(o){var a=e.util.groupSVGElements(o,t,n);a.set(r),i&&i(a)}))})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={});e.ActiveSelection||(e.ActiveSelection=e.util.createClass(e.Group,{type:"activeSelection",initialize:function(t,i){i=i||{},this._objects=t||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;i.originX&&(this.originX=i.originX),i.originY&&(this.originY=i.originY),this._calcBounds(),this._updateObjectsCoords(),e.Object.prototype.initialize.call(this,i),this.setCoords()},toGroup:function(){var t=this._objects.concat();this._objects=[];var i=e.Object.prototype.toObject.call(this),n=new e.Group([]);if(delete i.type,n.set(i),t.forEach((function(t){t.canvas.remove(t),t.group=n})),n._objects=t,!this.canvas)return n;var r=this.canvas;return r.add(n),r._activeObject=n,n.setCoords(),n},onDeselect:function(){return this.destroy(),!1},toString:function(){return"#<fabric.ActiveSelection: ("+this.complexity()+")>"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(t,e,i){t.save(),t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",t,e),void 0===(i=i||{}).hasControls&&(i.hasControls=!1),i.forActiveSelection=!0;for(var n=0,r=this._objects.length;n<r;n++)this._objects[n]._renderControls(t,i);t.restore()}}),e.ActiveSelection.fromObject=function(t,i){e.util.enlivenObjects(t.objects,(function(n){delete t.objects,i&&i(new e.ActiveSelection(n,t,!0))}))})}(e),function(t){"use strict";var e=S.util.object.extend;t.fabric||(t.fabric={}),t.fabric.Image?S.warn("fabric.Image is already defined."):(S.Image=S.util.createClass(S.Object,{type:"image",strokeWidth:0,srcFromAttribute:!1,_lastScaleX:1,_lastScaleY:1,_filterScalingX:1,_filterScalingY:1,minimumScaleTrigger:.5,stateProperties:S.Object.prototype.stateProperties.concat("cropX","cropY"),cacheProperties:S.Object.prototype.cacheProperties.concat("cropX","cropY"),cacheKey:"",cropX:0,cropY:0,imageSmoothing:!0,initialize:function(t,e){e||(e={}),this.filters=[],this.cacheKey="texture"+S.Object.__uid++,this.callSuper("initialize",e),this._initElement(t,e)},getElement:function(){return this._element||{}},setElement:function(t,e){return this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._element=t,this._originalElement=t,this._initConfig(e),0!==this.filters.length&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters(),this},removeTexture:function(t){var e=S.filterBackend;e&&e.evictCachesForKey&&e.evictCachesForKey(t)},dispose:function(){this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._cacheContext=void 0,["_originalElement","_element","_filteredEl","_cacheCanvas"].forEach(function(t){S.util.cleanUpJsdomNode(this[t]),this[t]=void 0}.bind(this))},getCrossOrigin:function(){return this._originalElement&&(this._originalElement.crossOrigin||null)},getOriginalSize:function(){var t=this.getElement();return{width:t.naturalWidth||t.width,height:t.naturalHeight||t.height}},_stroke:function(t){if(this.stroke&&0!==this.strokeWidth){var e=this.width/2,i=this.height/2;t.beginPath(),t.moveTo(-e,-i),t.lineTo(e,-i),t.lineTo(e,i),t.lineTo(-e,i),t.lineTo(-e,-i),t.closePath()}},toObject:function(t){var i=[];this.filters.forEach((function(t){t&&i.push(t.toObject())}));var n=e(this.callSuper("toObject",["cropX","cropY"].concat(t)),{src:this.getSrc(),crossOrigin:this.getCrossOrigin(),filters:i});return this.resizeFilter&&(n.resizeFilter=this.resizeFilter.toObject()),n},hasCrop:function(){return this.cropX||this.cropY||this.width<this._element.width||this.height<this._element.height},_toSVG:function(){var t,e=[],i=[],n=this._element,r=-this.width/2,o=-this.height/2,a="",s="";if(!n)return[];if(this.hasCrop()){var l=S.Object.__uid++;e.push('<clipPath id="imageCrop_'+l+'">\n','\t<rect x="'+r+'" y="'+o+'" width="'+this.width+'" height="'+this.height+'" />\n',"</clipPath>\n"),a=' clip-path="url(#imageCrop_'+l+')" '}if(this.imageSmoothing||(s='" image-rendering="optimizeSpeed'),i.push("\t<image ","COMMON_PARTS",'xlink:href="',this.getSvgSrc(!0),'" x="',r-this.cropX,'" y="',o-this.cropY,'" width="',n.width||n.naturalWidth,'" height="',n.height||n.height,s,'"',a,"></image>\n"),this.stroke||this.strokeDashArray){var c=this.fill;this.fill=null,t=["\t<rect ",'x="',r,'" y="',o,'" width="',this.width,'" height="',this.height,'" style="',this.getSvgStyles(),'"/>\n'],this.fill=c}return e="fill"!==this.paintFirst?e.concat(t,i):e.concat(i,t)},getSrc:function(t){var e=t?this._element:this._originalElement;return e?e.toDataURL?e.toDataURL():this.srcFromAttribute?e.getAttribute("src"):e.src:this.src||""},setSrc:function(t,e,i){return S.util.loadImage(t,(function(t,n){this.setElement(t,i),this._setWidthHeight(),e&&e(this,n)}),this,i&&i.crossOrigin),this},toString:function(){return'#<fabric.Image: { src: "'+this.getSrc()+'" }>'},applyResizeFilters:function(){var t=this.resizeFilter,e=this.minimumScaleTrigger,i=this.getTotalObjectScaling(),n=i.scaleX,r=i.scaleY,o=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!t||n>e&&r>e)return this._element=o,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=n,void(this._lastScaleY=r);S.filterBackend||(S.filterBackend=S.initFilterBackend());var a=S.util.createCanvasElement(),s=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,l=o.width,c=o.height;a.width=l,a.height=c,this._element=a,this._lastScaleX=t.scaleX=n,this._lastScaleY=t.scaleY=r,S.filterBackend.applyFilters([t],o,l,c,this._element,s),this._filterScalingX=a.width/this._originalElement.width,this._filterScalingY=a.height/this._originalElement.height},applyFilters:function(t){if(t=(t=t||this.filters||[]).filter((function(t){return t&&!t.isNeutralState()})),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),0===t.length)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var e=this._originalElement,i=e.naturalWidth||e.width,n=e.naturalHeight||e.height;if(this._element===this._originalElement){var r=S.util.createCanvasElement();r.width=i,r.height=n,this._element=r,this._filteredEl=r}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,i,n),this._lastScaleX=1,this._lastScaleY=1;return S.filterBackend||(S.filterBackend=S.initFilterBackend()),S.filterBackend.applyFilters(t,this._originalElement,i,n,this._element,this.cacheKey),this._originalElement.width===this._element.width&&this._originalElement.height===this._element.height||(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(t){S.util.setImageSmoothing(t,this.imageSmoothing),!0!==this.isMoving&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(t),this._renderPaintInOrder(t)},drawCacheOnCanvas:function(t){S.util.setImageSmoothing(t,this.imageSmoothing),S.Object.prototype.drawCacheOnCanvas.call(this,t)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(t){var e=this._element;if(e){var i=this._filterScalingX,n=this._filterScalingY,r=this.width,o=this.height,a=Math.min,s=Math.max,l=s(this.cropX,0),c=s(this.cropY,0),h=e.naturalWidth||e.width,u=e.naturalHeight||e.height,f=l*i,d=c*n,v=a(r*i,h-f),g=a(o*n,u-d),p=-r/2,m=-o/2,y=a(r,h/i-l),b=a(o,u/n-c);e&&t.drawImage(e,f,d,v,g,p,m,y,b)}},_needsResize:function(){var t=this.getTotalObjectScaling();return t.scaleX!==this._lastScaleX||t.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(t,e){this.setElement(S.util.getById(t),e),S.util.addClass(this.getElement(),S.Image.CSS_CANVAS)},_initConfig:function(t){t||(t={}),this.setOptions(t),this._setWidthHeight(t)},_initFilters:function(t,e){t&&t.length?S.util.enlivenObjects(t,(function(t){e&&e(t)}),"fabric.Image.filters"):e&&e()},_setWidthHeight:function(t){t||(t={});var e=this.getElement();this.width=t.width||e.naturalWidth||e.width||0,this.height=t.height||e.naturalHeight||e.height||0},parsePreserveAspectRatioAttribute:function(){var t,e=S.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),i=this._element.width,n=this._element.height,r=1,o=1,a=0,s=0,l=0,c=0,h=this.width,u=this.height,f={width:h,height:u};return!e||"none"===e.alignX&&"none"===e.alignY?(r=h/i,o=u/n):("meet"===e.meetOrSlice&&(t=(h-i*(r=o=S.util.findScaleToFit(this._element,f)))/2,"Min"===e.alignX&&(a=-t),"Max"===e.alignX&&(a=t),t=(u-n*o)/2,"Min"===e.alignY&&(s=-t),"Max"===e.alignY&&(s=t)),"slice"===e.meetOrSlice&&(t=i-h/(r=o=S.util.findScaleToCover(this._element,f)),"Mid"===e.alignX&&(l=t/2),"Max"===e.alignX&&(l=t),t=n-u/o,"Mid"===e.alignY&&(c=t/2),"Max"===e.alignY&&(c=t),i=h/r,n=u/o)),{width:i,height:n,scaleX:r,scaleY:o,offsetLeft:a,offsetTop:s,cropX:l,cropY:c}}}),S.Image.CSS_CANVAS="canvas-img",S.Image.prototype.getSvgSrc=S.Image.prototype.getSrc,S.Image.fromObject=function(t,e){var i=S.util.object.clone(t);S.util.loadImage(i.src,(function(t,n){n?e&&e(null,!0):S.Image.prototype._initFilters.call(i,i.filters,(function(n){i.filters=n||[],S.Image.prototype._initFilters.call(i,[i.resizeFilter],(function(n){i.resizeFilter=n[0],S.util.enlivenObjects([i.clipPath],(function(n){i.clipPath=n[0];var r=new S.Image(t,i);e(r,!1)}))}))}))}),null,i.crossOrigin)},S.Image.fromURL=function(t,e,i){S.util.loadImage(t,(function(t,n){e&&e(new S.Image(t,i),n)}),null,i&&i.crossOrigin)},S.Image.ATTRIBUTE_NAMES=S.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),S.Image.fromElement=function(t,i,n){var r=S.parseAttributes(t,S.Image.ATTRIBUTE_NAMES);S.Image.fromURL(r["xlink:href"],i,e(n?S.util.object.clone(n):{},r))})}(e),S.util.object.extend(S.Object.prototype,{_getAngleValueForStraighten:function(){var t=this.angle%360;return t>0?90*Math.round((t-1)/90):90*Math.round(t/90)},straighten:function(){return this.rotate(this._getAngleValueForStraighten()),this},fxStraighten:function(t){var e=function(){},i=(t=t||{}).onComplete||e,n=t.onChange||e,r=this;return S.util.animate({startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(t){r.rotate(t),n()},onComplete:function(){r.setCoords(),i()}}),this}}),S.util.object.extend(S.StaticCanvas.prototype,{straightenObject:function(t){return t.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(t){return t.fxStraighten({onChange:this.requestRenderAllBound}),this}}),function(){"use strict";function t(t,e){var i="precision "+e+" float;\nvoid main(){}",n=t.createShader(t.FRAGMENT_SHADER);return t.shaderSource(n,i),t.compileShader(n),!!t.getShaderParameter(n,t.COMPILE_STATUS)}function e(t){t&&t.tileSize&&(this.tileSize=t.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}S.isWebglSupported=function(e){if(S.isLikelyNode)return!1;e=e||S.WebglFilterBackend.prototype.tileSize;var i=document.createElement("canvas"),n=i.getContext("webgl")||i.getContext("experimental-webgl"),r=!1;if(n){S.maxTextureSize=n.getParameter(n.MAX_TEXTURE_SIZE),r=S.maxTextureSize>=e;for(var o=["highp","mediump","lowp"],a=0;a<3;a++)if(t(n,o[a])){S.webGlPrecision=o[a];break}}return this.isSupported=r,r},S.WebglFilterBackend=e,e.prototype={tileSize:2048,resources:{},setupGLContext:function(t,e){this.dispose(),this.createWebGLCanvas(t,e),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(t,e)},chooseFastestCopyGLTo2DMethod:function(t,e){var i,n=void 0!==window.performance;try{new ImageData(1,1),i=!0}catch(t){i=!1}var r="undefined"!=typeof ArrayBuffer,o="undefined"!=typeof Uint8ClampedArray;if(n&&i&&r&&o){var a=S.util.createCanvasElement(),s=new ArrayBuffer(t*e*4);if(S.forceGLPutImageData)return this.imageBuffer=s,void(this.copyGLTo2D=E);var l,c,h={imageBuffer:s,destinationWidth:t,destinationHeight:e,targetCanvas:a};a.width=t,a.height=e,l=window.performance.now(),O.call(h,this.gl,h),c=window.performance.now()-l,l=window.performance.now(),E.call(h,this.gl,h),c>window.performance.now()-l?(this.imageBuffer=s,this.copyGLTo2D=E):this.copyGLTo2D=O}},createWebGLCanvas:function(t,e){var i=S.util.createCanvasElement();i.width=t,i.height=e;var n={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},r=i.getContext("webgl",n);r||(r=i.getContext("experimental-webgl",n)),r&&(r.clearColor(0,0,0,0),this.canvas=i,this.gl=r)},applyFilters:function(t,e,i,n,r,o){var a,s=this.gl;o&&(a=this.getCachedTexture(o,e));var l={originalWidth:e.width||e.originalWidth,originalHeight:e.height||e.originalHeight,sourceWidth:i,sourceHeight:n,destinationWidth:i,destinationHeight:n,context:s,sourceTexture:this.createTexture(s,i,n,!a&&e),targetTexture:this.createTexture(s,i,n),originalTexture:a||this.createTexture(s,i,n,!a&&e),passes:t.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:r},c=s.createFramebuffer();return s.bindFramebuffer(s.FRAMEBUFFER,c),t.forEach((function(t){t&&t.applyTo(l)})),function(t){var e=t.targetCanvas,i=e.width,n=e.height,r=t.destinationWidth,o=t.destinationHeight;i===r&&n===o||(e.width=r,e.height=o)}(l),this.copyGLTo2D(s,l),s.bindTexture(s.TEXTURE_2D,null),s.deleteTexture(l.sourceTexture),s.deleteTexture(l.targetTexture),s.deleteFramebuffer(c),r.getContext("2d").setTransform(1,0,0,1,0,0),l},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(t,e,i,n){var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),n?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,i,0,t.RGBA,t.UNSIGNED_BYTE,null),r},getCachedTexture:function(t,e){if(this.textureCache[t])return this.textureCache[t];var i=this.createTexture(this.gl,e.width,e.height,e);return this.textureCache[t]=i,i},evictCachesForKey:function(t){this.textureCache[t]&&(this.gl.deleteTexture(this.textureCache[t]),delete this.textureCache[t])},copyGLTo2D:O,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var t=this.gl,e={renderer:"",vendor:""};if(!t)return e;var i=t.getExtension("WEBGL_debug_renderer_info");if(i){var n=t.getParameter(i.UNMASKED_RENDERER_WEBGL),r=t.getParameter(i.UNMASKED_VENDOR_WEBGL);n&&(e.renderer=n.toLowerCase()),r&&(e.vendor=r.toLowerCase())}return this.gpuInfo=e,e}}}(),function(){"use strict";var t=function(){};function e(){}S.Canvas2dFilterBackend=e,e.prototype={evictCachesForKey:t,dispose:t,clearWebGLCaches:t,resources:{},applyFilters:function(t,e,i,n,r){var o=r.getContext("2d");o.drawImage(e,0,0,i,n);var a={sourceWidth:i,sourceHeight:n,imageData:o.getImageData(0,0,i,n),originalEl:e,originalImageData:o.getImageData(0,0,i,n),canvasEl:r,ctx:o,filterBackend:this};return t.forEach((function(t){t.applyTo(a)})),a.imageData.width===i&&a.imageData.height===n||(r.width=a.imageData.width,r.height=a.imageData.height),o.putImageData(a.imageData,0,0),a}}}(),S.Image=S.Image||{},S.Image.filters=S.Image.filters||{},S.Image.filters.BaseFilter=S.util.createClass({type:"BaseFilter",vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvoid main() {\nvTexCoord = aPosition;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:"precision highp float;\nvarying vec2 vTexCoord;\nuniform sampler2D uTexture;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\n}",initialize:function(t){t&&this.setOptions(t)},setOptions:function(t){for(var e in t)this[e]=t[e]},createProgram:function(t,e,i){e=e||this.fragmentSource,i=i||this.vertexSource,"highp"!==S.webGlPrecision&&(e=e.replace(/precision highp float/g,"precision "+S.webGlPrecision+" float"));var n=t.createShader(t.VERTEX_SHADER);if(t.shaderSource(n,i),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+t.getShaderInfoLog(n));var r=t.createShader(t.FRAGMENT_SHADER);if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+t.getShaderInfoLog(r));var o=t.createProgram();if(t.attachShader(o,n),t.attachShader(o,r),t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+t.getProgramInfoLog(o));var a=this.getAttributeLocations(t,o),s=this.getUniformLocations(t,o)||{};return s.uStepW=t.getUniformLocation(o,"uStepW"),s.uStepH=t.getUniformLocation(o,"uStepH"),{program:o,attributeLocations:a,uniformLocations:s}},getAttributeLocations:function(t,e){return{aPosition:t.getAttribLocation(e,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(t,e,i){var n=e.aPosition,r=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,r),t.enableVertexAttribArray(n),t.vertexAttribPointer(n,2,t.FLOAT,!1,0,0),t.bufferData(t.ARRAY_BUFFER,i,t.STATIC_DRAW)},_setupFrameBuffer:function(t){var e,i,n=t.context;t.passes>1?(e=t.destinationWidth,i=t.destinationHeight,t.sourceWidth===e&&t.sourceHeight===i||(n.deleteTexture(t.targetTexture),t.targetTexture=t.filterBackend.createTexture(n,e,i)),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,t.targetTexture,0)):(n.bindFramebuffer(n.FRAMEBUFFER,null),n.finish())},_swapTextures:function(t){t.passes--,t.pass++;var e=t.targetTexture;t.targetTexture=t.sourceTexture,t.sourceTexture=e},isNeutralState:function(){var t=this.mainParameter,e=S.Image.filters[this.type].prototype;if(t){if(Array.isArray(e[t])){for(var i=e[t].length;i--;)if(this[t][i]!==e[t][i])return!1;return!0}return e[t]===this[t]}return!1},applyTo:function(t){t.webgl?(this._setupFrameBuffer(t),this.applyToWebGL(t),this._swapTextures(t)):this.applyTo2d(t)},retrieveShader:function(t){return t.programCache.hasOwnProperty(this.type)||(t.programCache[this.type]=this.createProgram(t.context)),t.programCache[this.type]},applyToWebGL:function(t){var e=t.context,i=this.retrieveShader(t);0===t.pass&&t.originalTexture?e.bindTexture(e.TEXTURE_2D,t.originalTexture):e.bindTexture(e.TEXTURE_2D,t.sourceTexture),e.useProgram(i.program),this.sendAttributeData(e,i.attributeLocations,t.aPosition),e.uniform1f(i.uniformLocations.uStepW,1/t.sourceWidth),e.uniform1f(i.uniformLocations.uStepH,1/t.sourceHeight),this.sendUniformData(e,i.uniformLocations),e.viewport(0,0,t.destinationWidth,t.destinationHeight),e.drawArrays(e.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(t,e,i){t.activeTexture(i),t.bindTexture(t.TEXTURE_2D,e),t.activeTexture(t.TEXTURE0)},unbindAdditionalTexture:function(t,e){t.activeTexture(e),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(t){this[this.mainParameter]=t},sendUniformData:function(){},createHelpLayer:function(t){if(!t.helpLayer){var e=document.createElement("canvas");e.width=t.sourceWidth,e.height=t.sourceHeight,t.helpLayer=e}},toObject:function(){var t={type:this.type},e=this.mainParameter;return e&&(t[e]=this[e]),t},toJSON:function(){return this.toObject()}}),S.Image.filters.BaseFilter.fromObject=function(t,e){var i=new S.Image.filters[t.type](t);return e&&e(i),i},function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.ColorMatrix=n(i.BaseFilter,{type:"ColorMatrix",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nuniform mat4 uColorMatrix;\nuniform vec4 uConstants;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor *= uColorMatrix;\ncolor += uConstants;\ngl_FragColor = color;\n}",matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:"matrix",colorsOnly:!0,initialize:function(t){this.callSuper("initialize",t),this.matrix=this.matrix.slice(0)},applyTo2d:function(t){var e,i,n,r,o,a=t.imageData.data,s=a.length,l=this.matrix,c=this.colorsOnly;for(o=0;o<s;o+=4)e=a[o],i=a[o+1],n=a[o+2],c?(a[o]=e*l[0]+i*l[1]+n*l[2]+255*l[4],a[o+1]=e*l[5]+i*l[6]+n*l[7]+255*l[9],a[o+2]=e*l[10]+i*l[11]+n*l[12]+255*l[14]):(r=a[o+3],a[o]=e*l[0]+i*l[1]+n*l[2]+r*l[3]+255*l[4],a[o+1]=e*l[5]+i*l[6]+n*l[7]+r*l[8]+255*l[9],a[o+2]=e*l[10]+i*l[11]+n*l[12]+r*l[13]+255*l[14],a[o+3]=e*l[15]+i*l[16]+n*l[17]+r*l[18]+255*l[19])},getUniformLocations:function(t,e){return{uColorMatrix:t.getUniformLocation(e,"uColorMatrix"),uConstants:t.getUniformLocation(e,"uConstants")}},sendUniformData:function(t,e){var i=this.matrix,n=[i[0],i[1],i[2],i[3],i[5],i[6],i[7],i[8],i[10],i[11],i[12],i[13],i[15],i[16],i[17],i[18]],r=[i[4],i[9],i[14],i[19]];t.uniformMatrix4fv(e.uColorMatrix,!1,n),t.uniform4fv(e.uConstants,r)}}),e.Image.filters.ColorMatrix.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Brightness=n(i.BaseFilter,{type:"Brightness",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBrightness;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += uBrightness;\ngl_FragColor = color;\n}",brightness:0,mainParameter:"brightness",applyTo2d:function(t){if(0!==this.brightness){var e,i=t.imageData.data,n=i.length,r=Math.round(255*this.brightness);for(e=0;e<n;e+=4)i[e]=i[e]+r,i[e+1]=i[e+1]+r,i[e+2]=i[e+2]+r}},getUniformLocations:function(t,e){return{uBrightness:t.getUniformLocation(e,"uBrightness")}},sendUniformData:function(t,e){t.uniform1f(e.uBrightness,this.brightness)}}),e.Image.filters.Brightness.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.Image.filters,r=e.util.createClass;n.Convolute=r(n.BaseFilter,{type:"Convolute",opaque:!1,matrix:[0,0,0,0,1,0,0,0,0],fragmentSource:{Convolute_3_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1), uStepH * (h - 1));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 3.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_3_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1.0), uStepH * (h - 1.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 3.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_5_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 5.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_5_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 5.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_7_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 7.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_7_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 7.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_9_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 9.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_9_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 9.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}"},retrieveShader:function(t){var e=Math.sqrt(this.matrix.length),i=this.type+"_"+e+"_"+(this.opaque?1:0),n=this.fragmentSource[i];return t.programCache.hasOwnProperty(i)||(t.programCache[i]=this.createProgram(t.context,n)),t.programCache[i]},applyTo2d:function(t){var e,i,n,r,o,a,s,l,c,h,u,f,d,v=t.imageData,g=v.data,p=this.matrix,m=Math.round(Math.sqrt(p.length)),y=Math.floor(m/2),b=v.width,w=v.height,x=t.ctx.createImageData(b,w),C=x.data,k=this.opaque?1:0;for(u=0;u<w;u++)for(h=0;h<b;h++){for(o=4*(u*b+h),e=0,i=0,n=0,r=0,d=0;d<m;d++)for(f=0;f<m;f++)a=h+f-y,(s=u+d-y)<0||s>=w||a<0||a>=b||(l=4*(s*b+a),c=p[d*m+f],e+=g[l]*c,i+=g[l+1]*c,n+=g[l+2]*c,k||(r+=g[l+3]*c));C[o]=e,C[o+1]=i,C[o+2]=n,C[o+3]=k?g[o+3]:r}t.imageData=x},getUniformLocations:function(t,e){return{uMatrix:t.getUniformLocation(e,"uMatrix"),uOpaque:t.getUniformLocation(e,"uOpaque"),uHalfSize:t.getUniformLocation(e,"uHalfSize"),uSize:t.getUniformLocation(e,"uSize")}},sendUniformData:function(t,e){t.uniform1fv(e.uMatrix,this.matrix)},toObject:function(){return i(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),e.Image.filters.Convolute.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Grayscale=n(i.BaseFilter,{type:"Grayscale",fragmentSource:{average:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat average = (color.r + color.b + color.g) / 3.0;\ngl_FragColor = vec4(average, average, average, color.a);\n}",lightness:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;\ngl_FragColor = vec4(average, average, average, col.a);\n}",luminosity:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b;\ngl_FragColor = vec4(average, average, average, col.a);\n}"},mode:"average",mainParameter:"mode",applyTo2d:function(t){var e,i,n=t.imageData.data,r=n.length,o=this.mode;for(e=0;e<r;e+=4)"average"===o?i=(n[e]+n[e+1]+n[e+2])/3:"lightness"===o?i=(Math.min(n[e],n[e+1],n[e+2])+Math.max(n[e],n[e+1],n[e+2]))/2:"luminosity"===o&&(i=.21*n[e]+.72*n[e+1]+.07*n[e+2]),n[e]=i,n[e+1]=i,n[e+2]=i},retrieveShader:function(t){var e=this.type+"_"+this.mode;if(!t.programCache.hasOwnProperty(e)){var i=this.fragmentSource[this.mode];t.programCache[e]=this.createProgram(t.context,i)}return t.programCache[e]},getUniformLocations:function(t,e){return{uMode:t.getUniformLocation(e,"uMode")}},sendUniformData:function(t,e){t.uniform1i(e.uMode,1)},isNeutralState:function(){return!1}}),e.Image.filters.Grayscale.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Invert=n(i.BaseFilter,{type:"Invert",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uInvert;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nif (uInvert == 1) {\ngl_FragColor = vec4(1.0 - color.r,1.0 -color.g,1.0 -color.b,color.a);\n} else {\ngl_FragColor = color;\n}\n}",invert:!0,mainParameter:"invert",applyTo2d:function(t){var e,i=t.imageData.data,n=i.length;for(e=0;e<n;e+=4)i[e]=255-i[e],i[e+1]=255-i[e+1],i[e+2]=255-i[e+2]},isNeutralState:function(){return!this.invert},getUniformLocations:function(t,e){return{uInvert:t.getUniformLocation(e,"uInvert")}},sendUniformData:function(t,e){t.uniform1i(e.uInvert,this.invert)}}),e.Image.filters.Invert.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.Image.filters,r=e.util.createClass;n.Noise=r(n.BaseFilter,{type:"Noise",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uStepH;\nuniform float uNoise;\nuniform float uSeed;\nvarying vec2 vTexCoord;\nfloat rand(vec2 co, float seed, float vScale) {\nreturn fract(sin(dot(co.xy * vScale ,vec2(12.9898 , 78.233))) * 43758.5453 * (seed + 0.01) / 2.0);\n}\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += (0.5 - rand(vTexCoord, uSeed, 0.1 / uStepH)) * uNoise;\ngl_FragColor = color;\n}",mainParameter:"noise",noise:0,applyTo2d:function(t){if(0!==this.noise){var e,i,n=t.imageData.data,r=n.length,o=this.noise;for(e=0,r=n.length;e<r;e+=4)i=(.5-Math.random())*o,n[e]+=i,n[e+1]+=i,n[e+2]+=i}},getUniformLocations:function(t,e){return{uNoise:t.getUniformLocation(e,"uNoise"),uSeed:t.getUniformLocation(e,"uSeed")}},sendUniformData:function(t,e){t.uniform1f(e.uNoise,this.noise/255),t.uniform1f(e.uSeed,Math.random())},toObject:function(){return i(this.callSuper("toObject"),{noise:this.noise})}}),e.Image.filters.Noise.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Pixelate=n(i.BaseFilter,{type:"Pixelate",blocksize:4,mainParameter:"blocksize",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBlocksize;\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nfloat blockW = uBlocksize * uStepW;\nfloat blockH = uBlocksize * uStepW;\nint posX = int(vTexCoord.x / blockW);\nint posY = int(vTexCoord.y / blockH);\nfloat fposX = float(posX);\nfloat fposY = float(posY);\nvec2 squareCoords = vec2(fposX * blockW, fposY * blockH);\nvec4 color = texture2D(uTexture, squareCoords);\ngl_FragColor = color;\n}",applyTo2d:function(t){var e,i,n,r,o,a,s,l,c,h,u,f=t.imageData,d=f.data,v=f.height,g=f.width;for(i=0;i<v;i+=this.blocksize)for(n=0;n<g;n+=this.blocksize)for(r=d[e=4*i*g+4*n],o=d[e+1],a=d[e+2],s=d[e+3],h=Math.min(i+this.blocksize,v),u=Math.min(n+this.blocksize,g),l=i;l<h;l++)for(c=n;c<u;c++)d[e=4*l*g+4*c]=r,d[e+1]=o,d[e+2]=a,d[e+3]=s},isNeutralState:function(){return 1===this.blocksize},getUniformLocations:function(t,e){return{uBlocksize:t.getUniformLocation(e,"uBlocksize"),uStepW:t.getUniformLocation(e,"uStepW"),uStepH:t.getUniformLocation(e,"uStepH")}},sendUniformData:function(t,e){t.uniform1f(e.uBlocksize,this.blocksize)}}),e.Image.filters.Pixelate.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.Image.filters,r=e.util.createClass;n.RemoveColor=r(n.BaseFilter,{type:"RemoveColor",color:"#FFFFFF",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uLow;\nuniform vec4 uHigh;\nvarying vec2 vTexCoord;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\nif(all(greaterThan(gl_FragColor.rgb,uLow.rgb)) && all(greaterThan(uHigh.rgb,gl_FragColor.rgb))) {\ngl_FragColor.a = 0.0;\n}\n}",distance:.02,useAlpha:!1,applyTo2d:function(t){var i,n,r,o,a=t.imageData.data,s=255*this.distance,l=new e.Color(this.color).getSource(),c=[l[0]-s,l[1]-s,l[2]-s],h=[l[0]+s,l[1]+s,l[2]+s];for(i=0;i<a.length;i+=4)n=a[i],r=a[i+1],o=a[i+2],n>c[0]&&r>c[1]&&o>c[2]&&n<h[0]&&r<h[1]&&o<h[2]&&(a[i+3]=0)},getUniformLocations:function(t,e){return{uLow:t.getUniformLocation(e,"uLow"),uHigh:t.getUniformLocation(e,"uHigh")}},sendUniformData:function(t,i){var n=new e.Color(this.color).getSource(),r=parseFloat(this.distance),o=[0+n[0]/255-r,0+n[1]/255-r,0+n[2]/255-r,1],a=[n[0]/255+r,n[1]/255+r,n[2]/255+r,1];t.uniform4fv(i.uLow,o),t.uniform4fv(i.uHigh,a)},toObject:function(){return i(this.callSuper("toObject"),{color:this.color,distance:this.distance})}}),e.Image.filters.RemoveColor.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass,r={Brownie:[.5997,.34553,-.27082,0,.186,-.0377,.86095,.15059,0,-.1449,.24113,-.07441,.44972,0,-.02965,0,0,0,1,0],Vintage:[.62793,.32021,-.03965,0,.03784,.02578,.64411,.03259,0,.02926,.0466,-.08512,.52416,0,.02023,0,0,0,1,0],Kodachrome:[1.12855,-.39673,-.03992,0,.24991,-.16404,1.08352,-.05498,0,.09698,-.16786,-.56034,1.60148,0,.13972,0,0,0,1,0],Technicolor:[1.91252,-.85453,-.09155,0,.04624,-.30878,1.76589,-.10601,0,-.27589,-.2311,-.75018,1.84759,0,.12137,0,0,0,1,0],Polaroid:[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],Sepia:[.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0],BlackWhite:[1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,0,0,0,1,0]};for(var o in r)i[o]=n(i.ColorMatrix,{type:o,matrix:r[o],mainParameter:!1,colorsOnly:!0}),e.Image.filters[o].fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric,i=e.Image.filters,n=e.util.createClass;i.BlendColor=n(i.BaseFilter,{type:"BlendColor",color:"#F95C63",mode:"multiply",alpha:1,fragmentSource:{multiply:"gl_FragColor.rgb *= uColor.rgb;\n",screen:"gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);\n",add:"gl_FragColor.rgb += uColor.rgb;\n",diff:"gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb);\n",subtract:"gl_FragColor.rgb -= uColor.rgb;\n",lighten:"gl_FragColor.rgb = max(gl_FragColor.rgb, uColor.rgb);\n",darken:"gl_FragColor.rgb = min(gl_FragColor.rgb, uColor.rgb);\n",exclusion:"gl_FragColor.rgb += uColor.rgb - 2.0 * (uColor.rgb * gl_FragColor.rgb);\n",overlay:"if (uColor.r < 0.5) {\ngl_FragColor.r *= 2.0 * uColor.r;\n} else {\ngl_FragColor.r = 1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r);\n}\nif (uColor.g < 0.5) {\ngl_FragColor.g *= 2.0 * uColor.g;\n} else {\ngl_FragColor.g = 1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g);\n}\nif (uColor.b < 0.5) {\ngl_FragColor.b *= 2.0 * uColor.b;\n} else {\ngl_FragColor.b = 1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b);\n}\n",tint:"gl_FragColor.rgb *= (1.0 - uColor.a);\ngl_FragColor.rgb += uColor.rgb;\n"},buildSource:function(t){return"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ngl_FragColor = color;\nif (color.a > 0.0) {\n"+this.fragmentSource[t]+"}\n}"},retrieveShader:function(t){var e,i=this.type+"_"+this.mode;return t.programCache.hasOwnProperty(i)||(e=this.buildSource(this.mode),t.programCache[i]=this.createProgram(t.context,e)),t.programCache[i]},applyTo2d:function(t){var i,n,r,o,a,s,l,c=t.imageData.data,h=c.length,u=1-this.alpha;i=(l=new e.Color(this.color).getSource())[0]*this.alpha,n=l[1]*this.alpha,r=l[2]*this.alpha;for(var f=0;f<h;f+=4)switch(o=c[f],a=c[f+1],s=c[f+2],this.mode){case"multiply":c[f]=o*i/255,c[f+1]=a*n/255,c[f+2]=s*r/255;break;case"screen":c[f]=255-(255-o)*(255-i)/255,c[f+1]=255-(255-a)*(255-n)/255,c[f+2]=255-(255-s)*(255-r)/255;break;case"add":c[f]=o+i,c[f+1]=a+n,c[f+2]=s+r;break;case"diff":case"difference":c[f]=Math.abs(o-i),c[f+1]=Math.abs(a-n),c[f+2]=Math.abs(s-r);break;case"subtract":c[f]=o-i,c[f+1]=a-n,c[f+2]=s-r;break;case"darken":c[f]=Math.min(o,i),c[f+1]=Math.min(a,n),c[f+2]=Math.min(s,r);break;case"lighten":c[f]=Math.max(o,i),c[f+1]=Math.max(a,n),c[f+2]=Math.max(s,r);break;case"overlay":c[f]=i<128?2*o*i/255:255-2*(255-o)*(255-i)/255,c[f+1]=n<128?2*a*n/255:255-2*(255-a)*(255-n)/255,c[f+2]=r<128?2*s*r/255:255-2*(255-s)*(255-r)/255;break;case"exclusion":c[f]=i+o-2*i*o/255,c[f+1]=n+a-2*n*a/255,c[f+2]=r+s-2*r*s/255;break;case"tint":c[f]=i+o*u,c[f+1]=n+a*u,c[f+2]=r+s*u}},getUniformLocations:function(t,e){return{uColor:t.getUniformLocation(e,"uColor")}},sendUniformData:function(t,i){var n=new e.Color(this.color).getSource();n[0]=this.alpha*n[0]/255,n[1]=this.alpha*n[1]/255,n[2]=this.alpha*n[2]/255,n[3]=this.alpha,t.uniform4fv(i.uColor,n)},toObject:function(){return{type:this.type,color:this.color,mode:this.mode,alpha:this.alpha}}}),e.Image.filters.BlendColor.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric,i=e.Image.filters,n=e.util.createClass;i.BlendImage=n(i.BaseFilter,{type:"BlendImage",image:null,mode:"multiply",alpha:1,vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nuniform mat3 uTransformMatrix;\nvoid main() {\nvTexCoord = aPosition;\nvTexCoord2 = (uTransformMatrix * vec3(aPosition, 1.0)).xy;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:{multiply:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.rgba *= color2.rgba;\ngl_FragColor = color;\n}",mask:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.a = color2.a;\ngl_FragColor = color;\n}"},retrieveShader:function(t){var e=this.type+"_"+this.mode,i=this.fragmentSource[this.mode];return t.programCache.hasOwnProperty(e)||(t.programCache[e]=this.createProgram(t.context,i)),t.programCache[e]},applyToWebGL:function(t){var e=t.context,i=this.createTexture(t.filterBackend,this.image);this.bindAdditionalTexture(e,i,e.TEXTURE1),this.callSuper("applyToWebGL",t),this.unbindAdditionalTexture(e,e.TEXTURE1)},createTexture:function(t,e){return t.getCachedTexture(e.cacheKey,e._element)},calculateMatrix:function(){var t=this.image,e=t._element.width,i=t._element.height;return[1/t.scaleX,0,0,0,1/t.scaleY,0,-t.left/e,-t.top/i,1]},applyTo2d:function(t){var i,n,r,o,a,s,l,c,h,u,f,d=t.imageData,v=t.filterBackend.resources,g=d.data,p=g.length,m=d.width,y=d.height,b=this.image;v.blendImage||(v.blendImage=e.util.createCanvasElement()),u=(h=v.blendImage).getContext("2d"),h.width!==m||h.height!==y?(h.width=m,h.height=y):u.clearRect(0,0,m,y),u.setTransform(b.scaleX,0,0,b.scaleY,b.left,b.top),u.drawImage(b._element,0,0,m,y),f=u.getImageData(0,0,m,y).data;for(var w=0;w<p;w+=4)switch(a=g[w],s=g[w+1],l=g[w+2],c=g[w+3],i=f[w],n=f[w+1],r=f[w+2],o=f[w+3],this.mode){case"multiply":g[w]=a*i/255,g[w+1]=s*n/255,g[w+2]=l*r/255,g[w+3]=c*o/255;break;case"mask":g[w+3]=o}},getUniformLocations:function(t,e){return{uTransformMatrix:t.getUniformLocation(e,"uTransformMatrix"),uImage:t.getUniformLocation(e,"uImage")}},sendUniformData:function(t,e){var i=this.calculateMatrix();t.uniform1i(e.uImage,1),t.uniformMatrix3fv(e.uTransformMatrix,!1,i)},toObject:function(){return{type:this.type,image:this.image&&this.image.toObject(),mode:this.mode,alpha:this.alpha}}}),e.Image.filters.BlendImage.fromObject=function(t,i){e.Image.fromObject(t.image,(function(n){var r=e.util.object.clone(t);r.image=n,i(new e.Image.filters.BlendImage(r))}))}}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=Math.pow,n=Math.floor,r=Math.sqrt,o=Math.abs,a=Math.round,s=Math.sin,l=Math.ceil,c=e.Image.filters,h=e.util.createClass;c.Resize=h(c.BaseFilter,{type:"Resize",resizeType:"hermite",scaleX:1,scaleY:1,lanczosLobes:3,getUniformLocations:function(t,e){return{uDelta:t.getUniformLocation(e,"uDelta"),uTaps:t.getUniformLocation(e,"uTaps")}},sendUniformData:function(t,e){t.uniform2fv(e.uDelta,this.horizontal?[1/this.width,0]:[0,1/this.height]),t.uniform1fv(e.uTaps,this.taps)},retrieveShader:function(t){var e=this.getFilterWindow(),i=this.type+"_"+e;if(!t.programCache.hasOwnProperty(i)){var n=this.generateShader(e);t.programCache[i]=this.createProgram(t.context,n)}return t.programCache[i]},getFilterWindow:function(){var t=this.tempScale;return Math.ceil(this.lanczosLobes/t)},getTaps:function(){for(var t=this.lanczosCreate(this.lanczosLobes),e=this.tempScale,i=this.getFilterWindow(),n=new Array(i),r=1;r<=i;r++)n[r-1]=t(r*e);return n},generateShader:function(t){for(var e=new Array(t),i=this.fragmentSourceTOP,n=1;n<=t;n++)e[n-1]=n+".0 * uDelta";return i+="uniform float uTaps["+t+"];\n",i+="void main() {\n",i+=" vec4 color = texture2D(uTexture, vTexCoord);\n",i+=" float sum = 1.0;\n",e.forEach((function(t,e){i+=" color += texture2D(uTexture, vTexCoord + "+t+") * uTaps["+e+"];\n",i+=" color += texture2D(uTexture, vTexCoord - "+t+") * uTaps["+e+"];\n",i+=" sum += 2.0 * uTaps["+e+"];\n"})),i+=" gl_FragColor = color / sum;\n",i+="}"},fragmentSourceTOP:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\n",applyTo:function(t){t.webgl?(t.passes++,this.width=t.sourceWidth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=t.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),t.destinationWidth=this.dW,this._setupFrameBuffer(t),this.applyToWebGL(t),this._swapTextures(t),t.sourceWidth=t.destinationWidth,this.height=t.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),t.destinationHeight=this.dH,this._setupFrameBuffer(t),this.applyToWebGL(t),this._swapTextures(t),t.sourceHeight=t.destinationHeight):this.applyTo2d(t)},isNeutralState:function(){return 1===this.scaleX&&1===this.scaleY},lanczosCreate:function(t){return function(e){if(e>=t||e<=-t)return 0;if(e<1.1920929e-7&&e>-1.1920929e-7)return 1;var i=(e*=Math.PI)/t;return s(e)/e*s(i)/i}},applyTo2d:function(t){var e=t.imageData,i=this.scaleX,n=this.scaleY;this.rcpScaleX=1/i,this.rcpScaleY=1/n;var r,o=e.width,s=e.height,l=a(o*i),c=a(s*n);"sliceHack"===this.resizeType?r=this.sliceByTwo(t,o,s,l,c):"hermite"===this.resizeType?r=this.hermiteFastResize(t,o,s,l,c):"bilinear"===this.resizeType?r=this.bilinearFiltering(t,o,s,l,c):"lanczos"===this.resizeType&&(r=this.lanczosResize(t,o,s,l,c)),t.imageData=r},sliceByTwo:function(t,i,r,o,a){var s,l,c=t.imageData,h=!1,u=!1,f=.5*i,d=.5*r,v=e.filterBackend.resources,g=0,p=0,m=i,y=0;for(v.sliceByTwo||(v.sliceByTwo=document.createElement("canvas")),((s=v.sliceByTwo).width<1.5*i||s.height<r)&&(s.width=1.5*i,s.height=r),(l=s.getContext("2d")).clearRect(0,0,1.5*i,r),l.putImageData(c,0,0),o=n(o),a=n(a);!h||!u;)i=f,r=d,o<n(.5*f)?f=n(.5*f):(f=o,h=!0),a<n(.5*d)?d=n(.5*d):(d=a,u=!0),l.drawImage(s,g,p,i,r,m,y,f,d),g=m,p=y,y+=d;return l.getImageData(g,p,o,a)},lanczosResize:function(t,e,a,s,c){var h=t.imageData.data,u=t.ctx.createImageData(s,c),f=u.data,d=this.lanczosCreate(this.lanczosLobes),v=this.rcpScaleX,g=this.rcpScaleY,p=2/this.rcpScaleX,m=2/this.rcpScaleY,y=l(v*this.lanczosLobes/2),b=l(g*this.lanczosLobes/2),w={},x={},C={};return function t(l){var k,_,S,T,O,E,R,A,I,P,D;for(x.x=(l+.5)*v,C.x=n(x.x),k=0;k<c;k++){for(x.y=(k+.5)*g,C.y=n(x.y),O=0,E=0,R=0,A=0,I=0,_=C.x-y;_<=C.x+y;_++)if(!(_<0||_>=e)){P=n(1e3*o(_-x.x)),w[P]||(w[P]={});for(var F=C.y-b;F<=C.y+b;F++)F<0||F>=a||(D=n(1e3*o(F-x.y)),w[P][D]||(w[P][D]=d(r(i(P*p,2)+i(D*m,2))/1e3)),(S=w[P][D])>0&&(O+=S,E+=S*h[T=4*(F*e+_)],R+=S*h[T+1],A+=S*h[T+2],I+=S*h[T+3]))}f[T=4*(k*s+l)]=E/O,f[T+1]=R/O,f[T+2]=A/O,f[T+3]=I/O}return++l<s?t(l):u}(0)},bilinearFiltering:function(t,e,i,r,o){var a,s,l,c,h,u,f,d,v,g=0,p=this.rcpScaleX,m=this.rcpScaleY,y=4*(e-1),b=t.imageData.data,w=t.ctx.createImageData(r,o),x=w.data;for(l=0;l<o;l++)for(c=0;c<r;c++)for(h=p*c-(a=n(p*c)),u=m*l-(s=n(m*l)),v=4*(s*e+a),f=0;f<4;f++)d=b[v+f]*(1-h)*(1-u)+b[v+4+f]*h*(1-u)+b[v+y+f]*u*(1-h)+b[v+y+4+f]*h*u,x[g++]=d;return w},hermiteFastResize:function(t,e,i,a,s){for(var c=this.rcpScaleX,h=this.rcpScaleY,u=l(c/2),f=l(h/2),d=t.imageData.data,v=t.ctx.createImageData(a,s),g=v.data,p=0;p<s;p++)for(var m=0;m<a;m++){for(var y=4*(m+p*a),b=0,w=0,x=0,C=0,k=0,_=0,S=0,T=(p+.5)*h,O=n(p*h);O<(p+1)*h;O++)for(var E=o(T-(O+.5))/f,R=(m+.5)*c,A=E*E,I=n(m*c);I<(m+1)*c;I++){var P=o(R-(I+.5))/u,D=r(A+P*P);D>1&&D<-1||(b=2*D*D*D-3*D*D+1)>0&&(S+=b*d[(P=4*(I+O*e))+3],x+=b,d[P+3]<255&&(b=b*d[P+3]/250),C+=b*d[P],k+=b*d[P+1],_+=b*d[P+2],w+=b)}g[y]=C/w,g[y+1]=k/w,g[y+2]=_/w,g[y+3]=S/x}return v},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),e.Image.filters.Resize.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Contrast=n(i.BaseFilter,{type:"Contrast",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uContrast;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));\ncolor.rgb = contrastF * (color.rgb - 0.5) + 0.5;\ngl_FragColor = color;\n}",contrast:0,mainParameter:"contrast",applyTo2d:function(t){if(0!==this.contrast){var e,i=t.imageData.data,n=i.length,r=Math.floor(255*this.contrast),o=259*(r+255)/(255*(259-r));for(e=0;e<n;e+=4)i[e]=o*(i[e]-128)+128,i[e+1]=o*(i[e+1]-128)+128,i[e+2]=o*(i[e+2]-128)+128}},getUniformLocations:function(t,e){return{uContrast:t.getUniformLocation(e,"uContrast")}},sendUniformData:function(t,e){t.uniform1f(e.uContrast,this.contrast)}}),e.Image.filters.Contrast.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Saturation=n(i.BaseFilter,{type:"Saturation",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uSaturation;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat rgMax = max(color.r, color.g);\nfloat rgbMax = max(rgMax, color.b);\ncolor.r += rgbMax != color.r ? (rgbMax - color.r) * uSaturation : 0.00;\ncolor.g += rgbMax != color.g ? (rgbMax - color.g) * uSaturation : 0.00;\ncolor.b += rgbMax != color.b ? (rgbMax - color.b) * uSaturation : 0.00;\ngl_FragColor = color;\n}",saturation:0,mainParameter:"saturation",applyTo2d:function(t){if(0!==this.saturation){var e,i,n=t.imageData.data,r=n.length,o=-this.saturation;for(e=0;e<r;e+=4)i=Math.max(n[e],n[e+1],n[e+2]),n[e]+=i!==n[e]?(i-n[e])*o:0,n[e+1]+=i!==n[e+1]?(i-n[e+1])*o:0,n[e+2]+=i!==n[e+2]?(i-n[e+2])*o:0}},getUniformLocations:function(t,e){return{uSaturation:t.getUniformLocation(e,"uSaturation")}},sendUniformData:function(t,e){t.uniform1f(e.uSaturation,-this.saturation)}}),e.Image.filters.Saturation.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Vibrance=n(i.BaseFilter,{type:"Vibrance",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uVibrance;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat max = max(color.r, max(color.g, color.b));\nfloat avg = (color.r + color.g + color.b) / 3.0;\nfloat amt = (abs(max - avg) * 2.0) * uVibrance;\ncolor.r += max != color.r ? (max - color.r) * amt : 0.00;\ncolor.g += max != color.g ? (max - color.g) * amt : 0.00;\ncolor.b += max != color.b ? (max - color.b) * amt : 0.00;\ngl_FragColor = color;\n}",vibrance:0,mainParameter:"vibrance",applyTo2d:function(t){if(0!==this.vibrance){var e,i,n,r,o=t.imageData.data,a=o.length,s=-this.vibrance;for(e=0;e<a;e+=4)i=Math.max(o[e],o[e+1],o[e+2]),n=(o[e]+o[e+1]+o[e+2])/3,r=2*Math.abs(i-n)/255*s,o[e]+=i!==o[e]?(i-o[e])*r:0,o[e+1]+=i!==o[e+1]?(i-o[e+1])*r:0,o[e+2]+=i!==o[e+2]?(i-o[e+2])*r:0}},getUniformLocations:function(t,e){return{uVibrance:t.getUniformLocation(e,"uVibrance")}},sendUniformData:function(t,e){t.uniform1f(e.uVibrance,-this.vibrance)}}),e.Image.filters.Vibrance.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Blur=n(i.BaseFilter,{type:"Blur",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\nconst float nSamples = 15.0;\nvec3 v3offset = vec3(12.9898, 78.233, 151.7182);\nfloat random(vec3 scale) {\nreturn fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453);\n}\nvoid main() {\nvec4 color = vec4(0.0);\nfloat total = 0.0;\nfloat offset = random(v3offset);\nfor (float t = -nSamples; t <= nSamples; t++) {\nfloat percent = (t + offset - 0.5) / nSamples;\nfloat weight = 1.0 - abs(percent);\ncolor += texture2D(uTexture, vTexCoord + uDelta * percent) * weight;\ntotal += weight;\n}\ngl_FragColor = color / total;\n}",blur:0,mainParameter:"blur",applyTo:function(t){t.webgl?(this.aspectRatio=t.sourceWidth/t.sourceHeight,t.passes++,this._setupFrameBuffer(t),this.horizontal=!0,this.applyToWebGL(t),this._swapTextures(t),this._setupFrameBuffer(t),this.horizontal=!1,this.applyToWebGL(t),this._swapTextures(t)):this.applyTo2d(t)},applyTo2d:function(t){t.imageData=this.simpleBlur(t)},simpleBlur:function(t){var i,n,r=t.filterBackend.resources,o=t.imageData.width,a=t.imageData.height;r.blurLayer1||(r.blurLayer1=e.util.createCanvasElement(),r.blurLayer2=e.util.createCanvasElement()),i=r.blurLayer1,n=r.blurLayer2,i.width===o&&i.height===a||(n.width=i.width=o,n.height=i.height=a);var s,l,c,h,u=i.getContext("2d"),f=n.getContext("2d"),d=.06*this.blur*.5;for(u.putImageData(t.imageData,0,0),f.clearRect(0,0,o,a),h=-15;h<=15;h++)c=d*(l=h/15)*o+(s=(Math.random()-.5)/4),f.globalAlpha=1-Math.abs(l),f.drawImage(i,c,s),u.drawImage(n,0,0),f.globalAlpha=1,f.clearRect(0,0,n.width,n.height);for(h=-15;h<=15;h++)c=d*(l=h/15)*a+(s=(Math.random()-.5)/4),f.globalAlpha=1-Math.abs(l),f.drawImage(i,s,c),u.drawImage(n,0,0),f.globalAlpha=1,f.clearRect(0,0,n.width,n.height);t.ctx.drawImage(i,0,0);var v=t.ctx.getImageData(0,0,i.width,i.height);return u.globalAlpha=1,u.clearRect(0,0,i.width,i.height),v},getUniformLocations:function(t,e){return{delta:t.getUniformLocation(e,"uDelta")}},sendUniformData:function(t,e){var i=this.chooseRightDelta();t.uniform2fv(e.delta,i)},chooseRightDelta:function(){var t,e=1,i=[0,0];return this.horizontal?this.aspectRatio>1&&(e=1/this.aspectRatio):this.aspectRatio<1&&(e=this.aspectRatio),t=e*this.blur*.12,this.horizontal?i[0]=t:i[1]=t,i}}),i.Blur.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Gamma=n(i.BaseFilter,{type:"Gamma",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec3 uGamma;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec3 correction = (1.0 / uGamma);\ncolor.r = pow(color.r, correction.r);\ncolor.g = pow(color.g, correction.g);\ncolor.b = pow(color.b, correction.b);\ngl_FragColor = color;\ngl_FragColor.rgb *= color.a;\n}",gamma:[1,1,1],mainParameter:"gamma",initialize:function(t){this.gamma=[1,1,1],i.BaseFilter.prototype.initialize.call(this,t)},applyTo2d:function(t){var e,i=t.imageData.data,n=this.gamma,r=i.length,o=1/n[0],a=1/n[1],s=1/n[2];for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),e=0,r=256;e<r;e++)this.rVals[e]=255*Math.pow(e/255,o),this.gVals[e]=255*Math.pow(e/255,a),this.bVals[e]=255*Math.pow(e/255,s);for(e=0,r=i.length;e<r;e+=4)i[e]=this.rVals[i[e]],i[e+1]=this.gVals[i[e+1]],i[e+2]=this.bVals[i[e+2]]},getUniformLocations:function(t,e){return{uGamma:t.getUniformLocation(e,"uGamma")}},sendUniformData:function(t,e){t.uniform3fv(e.uGamma,this.gamma)}}),e.Image.filters.Gamma.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Composed=n(i.BaseFilter,{type:"Composed",subFilters:[],initialize:function(t){this.callSuper("initialize",t),this.subFilters=this.subFilters.slice(0)},applyTo:function(t){t.passes+=this.subFilters.length-1,this.subFilters.forEach((function(e){e.applyTo(t)}))},toObject:function(){return e.util.object.extend(this.callSuper("toObject"),{subFilters:this.subFilters.map((function(t){return t.toObject()}))})},isNeutralState:function(){return!this.subFilters.some((function(t){return!t.isNeutralState()}))}}),e.Image.filters.Composed.fromObject=function(t,i){var n=(t.subFilters||[]).map((function(t){return new e.Image.filters[t.type](t)})),r=new e.Image.filters.Composed({subFilters:n});return i&&i(r),r}}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.HueRotation=n(i.ColorMatrix,{type:"HueRotation",rotation:0,mainParameter:"rotation",calculateMatrix:function(){var t=this.rotation*Math.PI,i=e.util.cos(t),n=e.util.sin(t),r=Math.sqrt(1/3)*n,o=1-i;this.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.matrix[0]=i+o/3,this.matrix[1]=1/3*o-r,this.matrix[2]=1/3*o+r,this.matrix[5]=1/3*o+r,this.matrix[6]=i+1/3*o,this.matrix[7]=1/3*o-r,this.matrix[10]=1/3*o-r,this.matrix[11]=1/3*o+r,this.matrix[12]=i+1/3*o},isNeutralState:function(t){return this.calculateMatrix(),i.BaseFilter.prototype.isNeutralState.call(this,t)},applyTo:function(t){this.calculateMatrix(),i.BaseFilter.prototype.applyTo.call(this,t)}}),e.Image.filters.HueRotation.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.clone;if(e.Text)e.warn("fabric.Text is already defined");else{var n="fontFamily fontWeight fontSize text underline overline linethrough textAlign fontStyle lineHeight textBackgroundColor charSpacing styles direction path pathStartOffset pathSide".split(" ");e.Text=e.util.createClass(e.Object,{_dimensionAffectingProps:["fontSize","fontWeight","fontFamily","fontStyle","lineHeight","text","charSpacing","textAlign","styles","path","pathStartOffset","pathSide"],_reNewline:/\r?\n/,_reSpacesAndTabs:/[ \t\r]/g,_reSpaceAndTab:/[ \t\r]/,_reWords:/\S+/g,type:"text",fontSize:40,fontWeight:"normal",fontFamily:"Times New Roman",underline:!1,overline:!1,linethrough:!1,textAlign:"left",fontStyle:"normal",lineHeight:1.16,superscript:{size:.6,baseline:-.35},subscript:{size:.6,baseline:.11},textBackgroundColor:"",stateProperties:e.Object.prototype.stateProperties.concat(n),cacheProperties:e.Object.prototype.cacheProperties.concat(n),stroke:null,shadow:null,path:null,pathStartOffset:0,pathSide:"left",_fontSizeFraction:.222,offsets:{underline:.1,linethrough:-.315,overline:-.88},_fontSizeMult:1.13,charSpacing:0,styles:null,_measuringContext:null,deltaY:0,direction:"ltr",_styleProperties:["stroke","strokeWidth","fill","fontFamily","fontSize","fontWeight","fontStyle","underline","overline","linethrough","deltaY","textBackgroundColor"],__charBounds:[],CACHE_FONT_SIZE:400,MIN_TEXT_WIDTH:2,initialize:function(t,e){this.styles=e&&e.styles||{},this.text=t,this.__skipDimension=!0,this.callSuper("initialize",e),this.path&&this.setPathInfo(),this.__skipDimension=!1,this.initDimensions(),this.setCoords(),this.setupState({propertySet:"_dimensionAffectingProps"})},setPathInfo:function(){var t=this.path;t&&(t.segmentsInfo=e.util.getPathSegmentsInfo(t.path))},getMeasuringContext:function(){return e._measuringContext||(e._measuringContext=this.canvas&&this.canvas.contextCache||e.util.createCanvasElement().getContext("2d")),e._measuringContext},_splitText:function(){var t=this._splitTextIntoLines(this.text);return this.textLines=t.lines,this._textLines=t.graphemeLines,this._unwrappedTextLines=t._unwrappedLines,this._text=t.graphemeText,t},initDimensions:function(){this.__skipDimension||(this._splitText(),this._clearCache(),this.path?(this.width=this.path.width,this.height=this.path.height):(this.width=this.calcTextWidth()||this.cursorWidth||this.MIN_TEXT_WIDTH,this.height=this.calcTextHeight()),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.saveState({propertySet:"_dimensionAffectingProps"}))},enlargeSpaces:function(){for(var t,e,i,n,r,o,a,s=0,l=this._textLines.length;s<l;s++)if(("justify"===this.textAlign||s!==l-1&&!this.isEndOfWrapping(s))&&(n=0,r=this._textLines[s],(e=this.getLineWidth(s))<this.width&&(a=this.textLines[s].match(this._reSpacesAndTabs)))){i=a.length,t=(this.width-e)/i;for(var c=0,h=r.length;c<=h;c++)o=this.__charBounds[s][c],this._reSpaceAndTab.test(r[c])?(o.width+=t,o.kernedWidth+=t,o.left+=n,n+=t):o.left+=n}},isEndOfWrapping:function(t){return t===this._textLines.length-1},missingNewlineOffset:function(){return 1},toString:function(){return"#<fabric.Text ("+this.complexity()+'): { "text": "'+this.text+'", "fontFamily": "'+this.fontFamily+'" }>'},_getCacheCanvasDimensions:function(){var t=this.callSuper("_getCacheCanvasDimensions"),e=this.fontSize;return t.width+=e*t.zoomX,t.height+=e*t.zoomY,t},_render:function(t){var e=this.path;e&&!e.isNotVisible()&&e._render(t),this._setTextStyles(t),this._renderTextLinesBackground(t),this._renderTextDecoration(t,"underline"),this._renderText(t),this._renderTextDecoration(t,"overline"),this._renderTextDecoration(t,"linethrough")},_renderText:function(t){"stroke"===this.paintFirst?(this._renderTextStroke(t),this._renderTextFill(t)):(this._renderTextFill(t),this._renderTextStroke(t))},_setTextStyles:function(t,e,i){t.textBaseline="alphabetic",t.font=this._getFontDeclaration(e,i)},calcTextWidth:function(){for(var t=this.getLineWidth(0),e=1,i=this._textLines.length;e<i;e++){var n=this.getLineWidth(e);n>t&&(t=n)}return t},_renderTextLine:function(t,e,i,n,r,o){this._renderChars(t,e,i,n,r,o)},_renderTextLinesBackground:function(t){if(this.textBackgroundColor||this.styleHas("textBackgroundColor")){for(var e,i,n,r,o,a,s,l=t.fillStyle,c=this._getLeftOffset(),h=this._getTopOffset(),u=0,f=0,d=this.path,v=0,g=this._textLines.length;v<g;v++)if(e=this.getHeightOfLine(v),this.textBackgroundColor||this.styleHas("textBackgroundColor",v)){n=this._textLines[v],i=this._getLineLeftOffset(v),f=0,u=0,r=this.getValueOfPropertyAt(v,0,"textBackgroundColor");for(var p=0,m=n.length;p<m;p++)o=this.__charBounds[v][p],a=this.getValueOfPropertyAt(v,p,"textBackgroundColor"),d?(t.save(),t.translate(o.renderLeft,o.renderTop),t.rotate(o.angle),t.fillStyle=a,a&&t.fillRect(-o.width/2,-e/this.lineHeight*(1-this._fontSizeFraction),o.width,e/this.lineHeight),t.restore()):a!==r?(s=c+i+u,"rtl"===this.direction&&(s=this.width-s-f),t.fillStyle=r,r&&t.fillRect(s,h,f,e/this.lineHeight),u=o.left,f=o.width,r=a):f+=o.kernedWidth;a&&!d&&(s=c+i+u,"rtl"===this.direction&&(s=this.width-s-f),t.fillStyle=a,t.fillRect(s,h,f,e/this.lineHeight)),h+=e}else h+=e;t.fillStyle=l,this._removeShadow(t)}},getFontCache:function(t){var i=t.fontFamily.toLowerCase();e.charWidthsCache[i]||(e.charWidthsCache[i]={});var n=e.charWidthsCache[i],r=t.fontStyle.toLowerCase()+"_"+(t.fontWeight+"").toLowerCase();return n[r]||(n[r]={}),n[r]},_measureChar:function(t,e,i,n){var r,o,a,s,l=this.getFontCache(e),c=i+t,h=this._getFontDeclaration(e)===this._getFontDeclaration(n),u=e.fontSize/this.CACHE_FONT_SIZE;if(i&&void 0!==l[i]&&(a=l[i]),void 0!==l[t]&&(s=r=l[t]),h&&void 0!==l[c]&&(s=(o=l[c])-a),void 0===r||void 0===a||void 0===o){var f=this.getMeasuringContext();this._setTextStyles(f,e,!0)}return void 0===r&&(s=r=f.measureText(t).width,l[t]=r),void 0===a&&h&&i&&(a=f.measureText(i).width,l[i]=a),h&&void 0===o&&(o=f.measureText(c).width,l[c]=o,s=o-a),{width:r*u,kernedWidth:s*u}},getHeightOfChar:function(t,e){return this.getValueOfPropertyAt(t,e,"fontSize")},measureLine:function(t){var e=this._measureLine(t);return 0!==this.charSpacing&&(e.width-=this._getWidthOfCharSpacing()),e.width<0&&(e.width=0),e},_measureLine:function(t){var i,n,r,o,a,s,l=0,c=this._textLines[t],h=new Array(c.length),u=0,f=this.path,d="right"===this.pathSide;for(this.__charBounds[t]=h,i=0;i<c.length;i++)n=c[i],o=this._getGraphemeBox(n,t,i,r),h[i]=o,l+=o.kernedWidth,r=n;if(h[i]={left:o?o.left+o.width:0,width:0,kernedWidth:0,height:this.fontSize},f){switch(s=f.segmentsInfo[f.segmentsInfo.length-1].length,(a=e.util.getPointOnPath(f.path,0,f.segmentsInfo)).x+=f.pathOffset.x,a.y+=f.pathOffset.y,this.textAlign){case"left":u=d?s-l:0;break;case"center":u=(s-l)/2;break;case"right":u=d?0:s-l}for(u+=this.pathStartOffset*(d?-1:1),i=d?c.length-1:0;d?i>=0:i<c.length;d?i--:i++)o=h[i],u>s?u%=s:u<0&&(u+=s),this._setGraphemeOnPath(u,o,a),u+=o.kernedWidth}return{width:l,numOfSpaces:0}},_setGraphemeOnPath:function(t,i,n){var r=t+i.kernedWidth/2,o=this.path,a=e.util.getPointOnPath(o.path,r,o.segmentsInfo);i.renderLeft=a.x-n.x,i.renderTop=a.y-n.y,i.angle=a.angle+("right"===this.pathSide?Math.PI:0)},_getGraphemeBox:function(t,e,i,n,r){var o,a=this.getCompleteStyleDeclaration(e,i),s=n?this.getCompleteStyleDeclaration(e,i-1):{},l=this._measureChar(t,a,n,s),c=l.kernedWidth,h=l.width;0!==this.charSpacing&&(h+=o=this._getWidthOfCharSpacing(),c+=o);var u={width:h,left:0,height:a.fontSize,kernedWidth:c,deltaY:a.deltaY};if(i>0&&!r){var f=this.__charBounds[e][i-1];u.left=f.left+f.width+l.kernedWidth-l.width}return u},getHeightOfLine:function(t){if(this.__lineHeights[t])return this.__lineHeights[t];for(var e=this._textLines[t],i=this.getHeightOfChar(t,0),n=1,r=e.length;n<r;n++)i=Math.max(this.getHeightOfChar(t,n),i);return this.__lineHeights[t]=i*this.lineHeight*this._fontSizeMult},calcTextHeight:function(){for(var t,e=0,i=0,n=this._textLines.length;i<n;i++)t=this.getHeightOfLine(i),e+=i===n-1?t/this.lineHeight:t;return e},_getLeftOffset:function(){return"ltr"===this.direction?-this.width/2:this.width/2},_getTopOffset:function(){return-this.height/2},_renderTextCommon:function(t,e){t.save();for(var i=0,n=this._getLeftOffset(),r=this._getTopOffset(),o=0,a=this._textLines.length;o<a;o++){var s=this.getHeightOfLine(o),l=s/this.lineHeight,c=this._getLineLeftOffset(o);this._renderTextLine(e,t,this._textLines[o],n+c,r+i+l,o),i+=s}t.restore()},_renderTextFill:function(t){(this.fill||this.styleHas("fill"))&&this._renderTextCommon(t,"fillText")},_renderTextStroke:function(t){(this.stroke&&0!==this.strokeWidth||!this.isEmptyStyles())&&(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(t),t.save(),this._setLineDash(t,this.strokeDashArray),t.beginPath(),this._renderTextCommon(t,"strokeText"),t.closePath(),t.restore())},_renderChars:function(t,e,i,n,r,o){var a,s,l,c,h,u=this.getHeightOfLine(o),f=-1!==this.textAlign.indexOf("justify"),d="",v=0,g=this.path,p=!f&&0===this.charSpacing&&this.isEmptyStyles(o)&&!g,m="ltr"===this.direction,y="ltr"===this.direction?1:-1;if(e.save(),r-=u*this._fontSizeFraction/this.lineHeight,p)return e.canvas.setAttribute("dir",m?"ltr":"rtl"),e.direction=m?"ltr":"rtl",e.textAlign=m?"left":"right",this._renderChar(t,e,o,0,i.join(""),n,r,u),void e.restore();for(var b=0,w=i.length-1;b<=w;b++)c=b===w||this.charSpacing||g,d+=i[b],l=this.__charBounds[o][b],0===v?(n+=y*(l.kernedWidth-l.width),v+=l.width):v+=l.kernedWidth,f&&!c&&this._reSpaceAndTab.test(i[b])&&(c=!0),c||(a=a||this.getCompleteStyleDeclaration(o,b),s=this.getCompleteStyleDeclaration(o,b+1),c=this._hasStyleChanged(a,s)),c&&(g?(e.save(),e.translate(l.renderLeft,l.renderTop),e.rotate(l.angle),this._renderChar(t,e,o,b,d,-v/2,0,u),e.restore()):(h=n,e.canvas.setAttribute("dir",m?"ltr":"rtl"),e.direction=m?"ltr":"rtl",e.textAlign=m?"left":"right",this._renderChar(t,e,o,b,d,h,r,u)),d="",a=s,n+=y*v,v=0);e.restore()},_applyPatternGradientTransformText:function(t){var i,n=e.util.createCanvasElement(),r=this.width+this.strokeWidth,o=this.height+this.strokeWidth;return n.width=r,n.height=o,(i=n.getContext("2d")).beginPath(),i.moveTo(0,0),i.lineTo(r,0),i.lineTo(r,o),i.lineTo(0,o),i.closePath(),i.translate(r/2,o/2),i.fillStyle=t.toLive(i),this._applyPatternGradientTransform(i,t),i.fill(),i.createPattern(n,"no-repeat")},handleFiller:function(t,e,i){var n,r;return i.toLive?"percentage"===i.gradientUnits||i.gradientTransform||i.patternTransform?(n=-this.width/2,r=-this.height/2,t.translate(n,r),t[e]=this._applyPatternGradientTransformText(i),{offsetX:n,offsetY:r}):(t[e]=i.toLive(t,this),this._applyPatternGradientTransform(t,i)):(t[e]=i,{offsetX:0,offsetY:0})},_setStrokeStyles:function(t,e){return t.lineWidth=e.strokeWidth,t.lineCap=this.strokeLineCap,t.lineDashOffset=this.strokeDashOffset,t.lineJoin=this.strokeLineJoin,t.miterLimit=this.strokeMiterLimit,this.handleFiller(t,"strokeStyle",e.stroke)},_setFillStyles:function(t,e){return this.handleFiller(t,"fillStyle",e.fill)},_renderChar:function(t,e,i,n,r,o,a){var s,l,c=this._getStyleDeclaration(i,n),h=this.getCompleteStyleDeclaration(i,n),u="fillText"===t&&h.fill,f="strokeText"===t&&h.stroke&&h.strokeWidth;(f||u)&&(e.save(),u&&(s=this._setFillStyles(e,h)),f&&(l=this._setStrokeStyles(e,h)),e.font=this._getFontDeclaration(h),c&&c.textBackgroundColor&&this._removeShadow(e),c&&c.deltaY&&(a+=c.deltaY),u&&e.fillText(r,o-s.offsetX,a-s.offsetY),f&&e.strokeText(r,o-l.offsetX,a-l.offsetY),e.restore())},setSuperscript:function(t,e){return this._setScript(t,e,this.superscript)},setSubscript:function(t,e){return this._setScript(t,e,this.subscript)},_setScript:function(t,e,i){var n=this.get2DCursorLocation(t,!0),r=this.getValueOfPropertyAt(n.lineIndex,n.charIndex,"fontSize"),o=this.getValueOfPropertyAt(n.lineIndex,n.charIndex,"deltaY"),a={fontSize:r*i.size,deltaY:o+r*i.baseline};return this.setSelectionStyles(a,t,e),this},_hasStyleChanged:function(t,e){return t.fill!==e.fill||t.stroke!==e.stroke||t.strokeWidth!==e.strokeWidth||t.fontSize!==e.fontSize||t.fontFamily!==e.fontFamily||t.fontWeight!==e.fontWeight||t.fontStyle!==e.fontStyle||t.deltaY!==e.deltaY},_hasStyleChangedForSvg:function(t,e){return this._hasStyleChanged(t,e)||t.overline!==e.overline||t.underline!==e.underline||t.linethrough!==e.linethrough},_getLineLeftOffset:function(t){var e=this.getLineWidth(t),i=this.width-e,n=this.textAlign,r=this.direction,o=0,a=this.isEndOfWrapping(t);return"justify"===n||"justify-center"===n&&!a||"justify-right"===n&&!a||"justify-left"===n&&!a?0:("center"===n&&(o=i/2),"right"===n&&(o=i),"justify-center"===n&&(o=i/2),"justify-right"===n&&(o=i),"rtl"===r&&(o-=i),o)},_clearCache:function(){this.__lineWidths=[],this.__lineHeights=[],this.__charBounds=[]},_shouldClearDimensionCache:function(){var t=this._forceClearCache;return t||(t=this.hasStateChanged("_dimensionAffectingProps")),t&&(this.dirty=!0,this._forceClearCache=!1),t},getLineWidth:function(t){return this.__lineWidths[t]?this.__lineWidths[t]:(e=""===this._textLines[t]?0:this.measureLine(t).width,this.__lineWidths[t]=e,e);var e},_getWidthOfCharSpacing:function(){return 0!==this.charSpacing?this.fontSize*this.charSpacing/1e3:0},getValueOfPropertyAt:function(t,e,i){var n=this._getStyleDeclaration(t,e);return n&&void 0!==n[i]?n[i]:this[i]},_renderTextDecoration:function(t,e){if(this[e]||this.styleHas(e)){for(var i,n,r,o,a,s,l,c,h,u,f,d,v,g,p,m,y=this._getLeftOffset(),b=this._getTopOffset(),w=this.path,x=this._getWidthOfCharSpacing(),C=this.offsets[e],k=0,_=this._textLines.length;k<_;k++)if(i=this.getHeightOfLine(k),this[e]||this.styleHas(e,k)){l=this._textLines[k],g=i/this.lineHeight,o=this._getLineLeftOffset(k),u=0,f=0,c=this.getValueOfPropertyAt(k,0,e),m=this.getValueOfPropertyAt(k,0,"fill"),h=b+g*(1-this._fontSizeFraction),n=this.getHeightOfChar(k,0),a=this.getValueOfPropertyAt(k,0,"deltaY");for(var S=0,T=l.length;S<T;S++)if(d=this.__charBounds[k][S],v=this.getValueOfPropertyAt(k,S,e),p=this.getValueOfPropertyAt(k,S,"fill"),r=this.getHeightOfChar(k,S),s=this.getValueOfPropertyAt(k,S,"deltaY"),w&&v&&p)t.save(),t.fillStyle=m,t.translate(d.renderLeft,d.renderTop),t.rotate(d.angle),t.fillRect(-d.kernedWidth/2,C*r+s,d.kernedWidth,this.fontSize/15),t.restore();else if((v!==c||p!==m||r!==n||s!==a)&&f>0){var O=y+o+u;"rtl"===this.direction&&(O=this.width-O-f),c&&m&&(t.fillStyle=m,t.fillRect(O,h+C*n+a,f,this.fontSize/15)),u=d.left,f=d.width,c=v,m=p,n=r,a=s}else f+=d.kernedWidth;O=y+o+u;"rtl"===this.direction&&(O=this.width-O-f),t.fillStyle=p,v&&p&&t.fillRect(O,h+C*n+a,f-x,this.fontSize/15),b+=i}else b+=i;this._removeShadow(t)}},_getFontDeclaration:function(t,i){var n=t||this,r=this.fontFamily,o=e.Text.genericFonts.indexOf(r.toLowerCase())>-1,a=void 0===r||r.indexOf("'")>-1||r.indexOf(",")>-1||r.indexOf('"')>-1||o?n.fontFamily:'"'+n.fontFamily+'"';return[e.isLikelyNode?n.fontWeight:n.fontStyle,e.isLikelyNode?n.fontStyle:n.fontWeight,i?this.CACHE_FONT_SIZE+"px":n.fontSize+"px",a].join(" ")},render:function(t){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",t)))},_splitTextIntoLines:function(t){for(var i=t.split(this._reNewline),n=new Array(i.length),r=["\n"],o=[],a=0;a<i.length;a++)n[a]=e.util.string.graphemeSplit(i[a]),o=o.concat(n[a],r);return o.pop(),{_unwrappedLines:n,lines:i,graphemeText:o,graphemeLines:n}},toObject:function(t){var e=n.concat(t),r=this.callSuper("toObject",e);return r.styles=i(this.styles,!0),r.path&&(r.path=this.path.toObject()),r},set:function(t,e){this.callSuper("set",t,e);var i=!1,n=!1;if("object"==typeof t)for(var r in t)"path"===r&&this.setPathInfo(),i=i||-1!==this._dimensionAffectingProps.indexOf(r),n=n||"path"===r;else i=-1!==this._dimensionAffectingProps.indexOf(t),n="path"===t;return n&&this.setPathInfo(),i&&(this.initDimensions(),this.setCoords()),this},complexity:function(){return 1}}),e.Text.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("x y dx dy font-family font-style font-weight font-size letter-spacing text-decoration text-anchor".split(" ")),e.Text.DEFAULT_SVG_FONT_SIZE=16,e.Text.fromElement=function(t,n,r){if(!t)return n(null);var o=e.parseAttributes(t,e.Text.ATTRIBUTE_NAMES),a=o.textAnchor||"left";if((r=e.util.object.extend(r?i(r):{},o)).top=r.top||0,r.left=r.left||0,o.textDecoration){var s=o.textDecoration;-1!==s.indexOf("underline")&&(r.underline=!0),-1!==s.indexOf("overline")&&(r.overline=!0),-1!==s.indexOf("line-through")&&(r.linethrough=!0),delete r.textDecoration}"dx"in o&&(r.left+=o.dx),"dy"in o&&(r.top+=o.dy),"fontSize"in r||(r.fontSize=e.Text.DEFAULT_SVG_FONT_SIZE);var l="";"textContent"in t?l=t.textContent:"firstChild"in t&&null!==t.firstChild&&"data"in t.firstChild&&null!==t.firstChild.data&&(l=t.firstChild.data),l=l.replace(/^\s+|\s+$|\n+/g,"").replace(/\s+/g," ");var c=r.strokeWidth;r.strokeWidth=0;var h=new e.Text(l,r),u=h.getScaledHeight()/h.height,f=((h.height+h.strokeWidth)*h.lineHeight-h.height)*u,d=h.getScaledHeight()+f,v=0;"center"===a&&(v=h.getScaledWidth()/2),"right"===a&&(v=h.getScaledWidth()),h.set({left:h.left-v,top:h.top-(d-h.fontSize*(.07+h._fontSizeFraction))/h.lineHeight,strokeWidth:void 0!==c?c:1}),n(h)},e.Text.fromObject=function(t,n){var r=i(t),o=t.path;return delete r.path,e.Object._fromObject("Text",r,(function(t){o?e.Object._fromObject("Path",o,(function(e){t.set("path",e),n(t)}),"path"):n(t)}),"text")},e.Text.genericFonts=["sans-serif","serif","cursive","fantasy","monospace"],e.util.createAccessors&&e.util.createAccessors(e.Text)}}(e),S.util.object.extend(S.Text.prototype,{isEmptyStyles:function(t){if(!this.styles)return!0;if(void 0!==t&&!this.styles[t])return!0;var e=void 0===t?this.styles:{line:this.styles[t]};for(var i in e)for(var n in e[i])for(var r in e[i][n])return!1;return!0},styleHas:function(t,e){if(!this.styles||!t||""===t)return!1;if(void 0!==e&&!this.styles[e])return!1;var i=void 0===e?this.styles:{0:this.styles[e]};for(var n in i)for(var r in i[n])if(void 0!==i[n][r][t])return!0;return!1},cleanStyle:function(t){if(!this.styles||!t||""===t)return!1;var e,i,n=this.styles,r=0,o=!0,a=0;for(var s in n){for(var l in e=0,n[s]){var c;r++,(c=n[s][l]).hasOwnProperty(t)?(i?c[t]!==i&&(o=!1):i=c[t],c[t]===this[t]&&delete c[t]):o=!1,0!==Object.keys(c).length?e++:delete n[s][l]}0===e&&delete n[s]}for(var h=0;h<this._textLines.length;h++)a+=this._textLines[h].length;o&&r===a&&(this[t]=i,this.removeStyle(t))},removeStyle:function(t){if(this.styles&&t&&""!==t){var e,i,n,r=this.styles;for(i in r){for(n in e=r[i])delete e[n][t],0===Object.keys(e[n]).length&&delete e[n];0===Object.keys(e).length&&delete r[i]}}},_extendStyles:function(t,e){var i=this.get2DCursorLocation(t);this._getLineStyle(i.lineIndex)||this._setLineStyle(i.lineIndex),this._getStyleDeclaration(i.lineIndex,i.charIndex)||this._setStyleDeclaration(i.lineIndex,i.charIndex,{}),S.util.object.extend(this._getStyleDeclaration(i.lineIndex,i.charIndex),e)},get2DCursorLocation:function(t,e){void 0===t&&(t=this.selectionStart);for(var i=e?this._unwrappedTextLines:this._textLines,n=i.length,r=0;r<n;r++){if(t<=i[r].length)return{lineIndex:r,charIndex:t};t-=i[r].length+this.missingNewlineOffset(r)}return{lineIndex:r-1,charIndex:i[r-1].length<t?i[r-1].length:t}},getSelectionStyles:function(t,e,i){void 0===t&&(t=this.selectionStart||0),void 0===e&&(e=this.selectionEnd||t);for(var n=[],r=t;r<e;r++)n.push(this.getStyleAtPosition(r,i));return n},getStyleAtPosition:function(t,e){var i=this.get2DCursorLocation(t);return(e?this.getCompleteStyleDeclaration(i.lineIndex,i.charIndex):this._getStyleDeclaration(i.lineIndex,i.charIndex))||{}},setSelectionStyles:function(t,e,i){void 0===e&&(e=this.selectionStart||0),void 0===i&&(i=this.selectionEnd||e);for(var n=e;n<i;n++)this._extendStyles(n,t);return this._forceClearCache=!0,this},_getStyleDeclaration:function(t,e){var i=this.styles&&this.styles[t];return i?i[e]:null},getCompleteStyleDeclaration:function(t,e){for(var i,n=this._getStyleDeclaration(t,e)||{},r={},o=0;o<this._styleProperties.length;o++)r[i=this._styleProperties[o]]=void 0===n[i]?this[i]:n[i];return r},_setStyleDeclaration:function(t,e,i){this.styles[t][e]=i},_deleteStyleDeclaration:function(t,e){delete this.styles[t][e]},_getLineStyle:function(t){return!!this.styles[t]},_setLineStyle:function(t){this.styles[t]={}},_deleteLineStyle:function(t){delete this.styles[t]}}),function(){function t(t){t.textDecoration&&(t.textDecoration.indexOf("underline")>-1&&(t.underline=!0),t.textDecoration.indexOf("line-through")>-1&&(t.linethrough=!0),t.textDecoration.indexOf("overline")>-1&&(t.overline=!0),delete t.textDecoration)}S.IText=S.util.createClass(S.Text,S.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(t,e){this.callSuper("initialize",t,e),this.initBehavior()},setSelectionStart:function(t){t=Math.max(t,0),this._updateAndFire("selectionStart",t)},setSelectionEnd:function(t){t=Math.min(t,this.text.length),this._updateAndFire("selectionEnd",t)},_updateAndFire:function(t,e){this[t]!==e&&(this._fireSelectionChanged(),this[t]=e),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(t){this.clearContextTop(),this.callSuper("render",t),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(t){this.callSuper("_render",t)},clearContextTop:function(t){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var e=this.canvas.contextTop,i=this.canvas.viewportTransform;e.save(),e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),this.transform(e),this._clearTextArea(e),t||e.restore()}},renderCursorOrSelection:function(){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var t=this._getCursorBoundaries(),e=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(t,e):this.renderSelection(t,e),e.restore()}},_clearTextArea:function(t){var e=this.width+4,i=this.height+4;t.clearRect(-e/2,-i/2,e,i)},_getCursorBoundaries:function(t){void 0===t&&(t=this.selectionStart);var e=this._getLeftOffset(),i=this._getTopOffset(),n=this._getCursorBoundariesOffsets(t);return{left:e,top:i,leftOffset:n.left,topOffset:n.top}},_getCursorBoundariesOffsets:function(t){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var e,i,n,r,o=0,a=0,s=this.get2DCursorLocation(t);n=s.charIndex,i=s.lineIndex;for(var l=0;l<i;l++)o+=this.getHeightOfLine(l);e=this._getLineLeftOffset(i);var c=this.__charBounds[i][n];return c&&(a=c.left),0!==this.charSpacing&&n===this._textLines[i].length&&(a-=this._getWidthOfCharSpacing()),r={top:o,left:e+(a>0?a:0)},"rtl"===this.direction&&(r.left*=-1),this.cursorOffsetCache=r,this.cursorOffsetCache},renderCursor:function(t,e){var i=this.get2DCursorLocation(),n=i.lineIndex,r=i.charIndex>0?i.charIndex-1:0,o=this.getValueOfPropertyAt(n,r,"fontSize"),a=this.scaleX*this.canvas.getZoom(),s=this.cursorWidth/a,l=t.topOffset,c=this.getValueOfPropertyAt(n,r,"deltaY");l+=(1-this._fontSizeFraction)*this.getHeightOfLine(n)/this.lineHeight-o*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(t,e),e.fillStyle=this.cursorColor||this.getValueOfPropertyAt(n,r,"fill"),e.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,e.fillRect(t.left+t.leftOffset-s/2,l+t.top+c,s,o)},renderSelection:function(t,e){for(var i=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,n=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,r=-1!==this.textAlign.indexOf("justify"),o=this.get2DCursorLocation(i),a=this.get2DCursorLocation(n),s=o.lineIndex,l=a.lineIndex,c=o.charIndex<0?0:o.charIndex,h=a.charIndex<0?0:a.charIndex,u=s;u<=l;u++){var f,d=this._getLineLeftOffset(u)||0,v=this.getHeightOfLine(u),g=0,p=0;if(u===s&&(g=this.__charBounds[s][c].left),u>=s&&u<l)p=r&&!this.isEndOfWrapping(u)?this.width:this.getLineWidth(u)||5;else if(u===l)if(0===h)p=this.__charBounds[l][h].left;else{var m=this._getWidthOfCharSpacing();p=this.__charBounds[l][h-1].left+this.__charBounds[l][h-1].width-m}f=v,(this.lineHeight<1||u===l&&this.lineHeight>1)&&(v/=this.lineHeight);var y=t.left+d+g,b=p-g,w=v,x=0;this.inCompositionMode?(e.fillStyle=this.compositionColor||"black",w=1,x=v):e.fillStyle=this.selectionColor,"rtl"===this.direction&&(y=this.width-y-b),e.fillRect(y,t.top+t.topOffset+x,b,w),t.topOffset+=f}},getCurrentCharFontSize:function(){var t=this._getCurrentCharIndex();return this.getValueOfPropertyAt(t.l,t.c,"fontSize")},getCurrentCharColor:function(){var t=this._getCurrentCharIndex();return this.getValueOfPropertyAt(t.l,t.c,"fill")},_getCurrentCharIndex:function(){var t=this.get2DCursorLocation(this.selectionStart,!0),e=t.charIndex>0?t.charIndex-1:0;return{l:t.lineIndex,c:e}}}),S.IText.fromObject=function(e,i){if(t(e),e.styles)for(var n in e.styles)for(var r in e.styles[n])t(e.styles[n][r]);S.Object._fromObject("IText",e,i,"text")}}(),C=S.util.object.clone,S.util.object.extend(S.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var t=this;this.on("added",(function(){var e=t.canvas;e&&(e._hasITextHandlers||(e._hasITextHandlers=!0,t._initCanvasHandlers(e)),e._iTextInstances=e._iTextInstances||[],e._iTextInstances.push(t))}))},initRemovedHandler:function(){var t=this;this.on("removed",(function(){var e=t.canvas;e&&(e._iTextInstances=e._iTextInstances||[],S.util.removeFromArray(e._iTextInstances,t),0===e._iTextInstances.length&&(e._hasITextHandlers=!1,t._removeCanvasHandlers(e)))}))},_initCanvasHandlers:function(t){t._mouseUpITextHandler=function(){t._iTextInstances&&t._iTextInstances.forEach((function(t){t.__isMousedown=!1}))},t.on("mouse:up",t._mouseUpITextHandler)},_removeCanvasHandlers:function(t){t.off("mouse:up",t._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(t,e,i,n){var r;return r={isAborted:!1,abort:function(){this.isAborted=!0}},t.animate("_currentCursorOpacity",e,{duration:i,onComplete:function(){r.isAborted||t[n]()},onChange:function(){t.canvas&&t.selectionStart===t.selectionEnd&&t.renderCursorOrSelection()},abort:function(){return r.isAborted}}),r},_onTickComplete:function(){var t=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout((function(){t._currentTickCompleteState=t._animateCursor(t,0,this.cursorDuration/2,"_tick")}),100)},initDelayedCursor:function(t){var e=this,i=t?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout((function(){e._tick()}),i)},abortCursorAnimation:function(){var t=this._currentTickState||this._currentTickCompleteState,e=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,t&&e&&e.clearContext(e.contextTop||e.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(t){var e=0,i=t-1;if(this._reSpace.test(this._text[i]))for(;this._reSpace.test(this._text[i]);)e++,i--;for(;/\S/.test(this._text[i])&&i>-1;)e++,i--;return t-e},findWordBoundaryRight:function(t){var e=0,i=t;if(this._reSpace.test(this._text[i]))for(;this._reSpace.test(this._text[i]);)e++,i++;for(;/\S/.test(this._text[i])&&i<this._text.length;)e++,i++;return t+e},findLineBoundaryLeft:function(t){for(var e=0,i=t-1;!/\n/.test(this._text[i])&&i>-1;)e++,i--;return t-e},findLineBoundaryRight:function(t){for(var e=0,i=t;!/\n/.test(this._text[i])&&i<this._text.length;)e++,i++;return t+e},searchWordBoundary:function(t,e){for(var i=this._text,n=this._reSpace.test(i[t])?t-1:t,r=i[n],o=S.reNonWord;!o.test(r)&&n>0&&n<i.length;)r=i[n+=e];return o.test(r)&&(n+=1===e?0:1),n},selectWord:function(t){t=t||this.selectionStart;var e=this.searchWordBoundary(t,-1),i=this.searchWordBoundary(t,1);this.selectionStart=e,this.selectionEnd=i,this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()},selectLine:function(t){t=t||this.selectionStart;var e=this.findLineBoundaryLeft(t),i=this.findLineBoundaryRight(t);return this.selectionStart=e,this.selectionEnd=i,this._fireSelectionChanged(),this._updateTextarea(),this},enterEditing:function(t){if(!this.isEditing&&this.editable)return this.canvas&&(this.canvas.calcOffset(),this.exitEditingOnOthers(this.canvas)),this.isEditing=!0,this.initHiddenTextarea(t),this.hiddenTextarea.focus(),this.hiddenTextarea.value=this.text,this._updateTextarea(),this._saveEditingProps(),this._setEditingProps(),this._textBeforeEdit=this.text,this._tick(),this.fire("editing:entered"),this._fireSelectionChanged(),this.canvas?(this.canvas.fire("text:editing:entered",{target:this}),this.initMouseMoveHandler(),this.canvas.requestRenderAll(),this):this},exitEditingOnOthers:function(t){t._iTextInstances&&t._iTextInstances.forEach((function(t){t.selected=!1,t.isEditing&&t.exitEditing()}))},initMouseMoveHandler:function(){this.canvas.on("mouse:move",this.mouseMoveHandler)},mouseMoveHandler:function(t){if(this.__isMousedown&&this.isEditing){var e=this.getSelectionStartFromPointer(t.e),i=this.selectionStart,n=this.selectionEnd;(e===this.__selectionStartOnMouseDown&&i!==n||i!==e&&n!==e)&&(e>this.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=e):(this.selectionStart=e,this.selectionEnd=this.__selectionStartOnMouseDown),this.selectionStart===i&&this.selectionEnd===n||(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(t,e,i){var n=i.slice(0,t),r=S.util.string.graphemeSplit(n).length;if(t===e)return{selectionStart:r,selectionEnd:r};var o=i.slice(t,e);return{selectionStart:r,selectionEnd:r+S.util.string.graphemeSplit(o).length}},fromGraphemeToStringSelection:function(t,e,i){var n=i.slice(0,t).join("").length;return t===e?{selectionStart:n,selectionEnd:n}:{selectionStart:n,selectionEnd:n+i.slice(t,e).join("").length}},_updateTextarea:function(){if(this.cursorOffsetCache={},this.hiddenTextarea){if(!this.inCompositionMode){var t=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=t.selectionStart,this.hiddenTextarea.selectionEnd=t.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var t=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=t.selectionEnd,this.inCompositionMode||(this.selectionStart=t.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var t=this._calcTextareaPosition();this.hiddenTextarea.style.left=t.left,this.hiddenTextarea.style.top=t.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var t=this.inCompositionMode?this.compositionStart:this.selectionStart,e=this._getCursorBoundaries(t),i=this.get2DCursorLocation(t),n=i.lineIndex,r=i.charIndex,o=this.getValueOfPropertyAt(n,r,"fontSize")*this.lineHeight,a=e.leftOffset,s=this.calcTransformMatrix(),l={x:e.left+a,y:e.top+e.topOffset+o},c=this.canvas.getRetinaScaling(),h=this.canvas.upperCanvasEl,u=h.width/c,f=h.height/c,d=u-o,v=f-o,g=h.clientWidth/u,p=h.clientHeight/f;return l=S.util.transformPoint(l,s),(l=S.util.transformPoint(l,this.canvas.viewportTransform)).x*=g,l.y*=p,l.x<0&&(l.x=0),l.x>d&&(l.x=d),l.y<0&&(l.y=0),l.y>v&&(l.y=v),l.x+=this.canvas._offset.left,l.y+=this.canvas._offset.top,{left:l.x+"px",top:l.y+"px",fontSize:o+"px",charHeight:o}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var t=this._textBeforeEdit!==this.text,e=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,e&&(e.blur&&e.blur(),e.parentNode&&e.parentNode.removeChild(e)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),t&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),t&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var t in this.styles)this._textLines[t]||delete this.styles[t]},removeStyleFromTo:function(t,e){var i,n,r=this.get2DCursorLocation(t,!0),o=this.get2DCursorLocation(e,!0),a=r.lineIndex,s=r.charIndex,l=o.lineIndex,c=o.charIndex;if(a!==l){if(this.styles[a])for(i=s;i<this._unwrappedTextLines[a].length;i++)delete this.styles[a][i];if(this.styles[l])for(i=c;i<this._unwrappedTextLines[l].length;i++)(n=this.styles[l][i])&&(this.styles[a]||(this.styles[a]={}),this.styles[a][s+i-c]=n);for(i=a+1;i<=l;i++)delete this.styles[i];this.shiftLineStyles(l,a-l)}else if(this.styles[a]){n=this.styles[a];var h,u,f=c-s;for(i=s;i<c;i++)delete n[i];for(u in this.styles[a])(h=parseInt(u,10))>=c&&(n[h-f]=n[u],delete n[u])}},shiftLineStyles:function(t,e){var i=C(this.styles);for(var n in this.styles){var r=parseInt(n,10);r>t&&(this.styles[r+e]=i[r],i[r-e]||delete this.styles[r])}},restartCursorIfNeeded:function(){this._currentTickState&&!this._currentTickState.isAborted&&this._currentTickCompleteState&&!this._currentTickCompleteState.isAborted||this.initDelayedCursor()},insertNewlineStyleObject:function(t,e,i,n){var r,o={},a=!1,s=this._unwrappedTextLines[t].length===e;for(var l in i||(i=1),this.shiftLineStyles(t,i),this.styles[t]&&(r=this.styles[t][0===e?e:e-1]),this.styles[t]){var c=parseInt(l,10);c>=e&&(a=!0,o[c-e]=this.styles[t][l],s&&0===e||delete this.styles[t][l])}var h=!1;for(a&&!s&&(this.styles[t+i]=o,h=!0),h&&i--;i>0;)n&&n[i-1]?this.styles[t+i]={0:C(n[i-1])}:r?this.styles[t+i]={0:C(r)}:delete this.styles[t+i],i--;this._forceClearCache=!0},insertCharStyleObject:function(t,e,i,n){this.styles||(this.styles={});var r=this.styles[t],o=r?C(r):{};for(var a in i||(i=1),o){var s=parseInt(a,10);s>=e&&(r[s+i]=o[s],o[s-i]||delete r[s])}if(this._forceClearCache=!0,n)for(;i--;)Object.keys(n[i]).length&&(this.styles[t]||(this.styles[t]={}),this.styles[t][e+i]=C(n[i]));else if(r)for(var l=r[e?e-1:1];l&&i--;)this.styles[t][e+i]=C(l)},insertNewStyleBlock:function(t,e,i){for(var n=this.get2DCursorLocation(e,!0),r=[0],o=0,a=0;a<t.length;a++)"\n"===t[a]?r[++o]=0:r[o]++;for(r[0]>0&&(this.insertCharStyleObject(n.lineIndex,n.charIndex,r[0],i),i=i&&i.slice(r[0]+1)),o&&this.insertNewlineStyleObject(n.lineIndex,n.charIndex+r[0],o),a=1;a<o;a++)r[a]>0?this.insertCharStyleObject(n.lineIndex+a,0,r[a],i):i&&(this.styles[n.lineIndex+a][0]=i[0]),i=i&&i.slice(r[a]+1);r[a]>0&&this.insertCharStyleObject(n.lineIndex+a,0,r[a],i)},setSelectionStartEndWithShift:function(t,e,i){i<=t?(e===t?this._selectionDirection="left":"right"===this._selectionDirection&&(this._selectionDirection="left",this.selectionEnd=t),this.selectionStart=i):i>t&&i<e?"right"===this._selectionDirection?this.selectionEnd=i:this.selectionStart=i:(e===t?this._selectionDirection="right":"left"===this._selectionDirection&&(this._selectionDirection="right",this.selectionStart=e),this.selectionEnd=i)},setSelectionInBoundaries:function(){var t=this.text.length;this.selectionStart>t?this.selectionStart=t:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>t?this.selectionEnd=t:this.selectionEnd<0&&(this.selectionEnd=0)}}),S.util.object.extend(S.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(t){if(this.canvas){this.__newClickTime=+new Date;var e=t.pointer;this.isTripleClick(e)&&(this.fire("tripleclick",t),this._stopEvent(t.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=e,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(t){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===t.x&&this.__lastPointer.y===t.y},_stopEvent:function(t){t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(t){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(t.e))},tripleClickHandler:function(t){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(t.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(t){!this.canvas||!this.editable||t.e.button&&1!==t.e.button||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(t.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(t){!this.canvas||!this.editable||t.e.button&&1!==t.e.button||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(t){if(this.__isMousedown=!1,!(!this.editable||this.group||t.transform&&t.transform.actionPerformed||t.e.button&&1!==t.e.button)){if(this.canvas){var e=this.canvas._activeObject;if(e&&e!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(t.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(t){var e=this.getSelectionStartFromPointer(t),i=this.selectionStart,n=this.selectionEnd;t.shiftKey?this.setSelectionStartEndWithShift(i,n,e):(this.selectionStart=e,this.selectionEnd=e),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(t){for(var e,i=this.getLocalPointer(t),n=0,r=0,o=0,a=0,s=0,l=0,c=this._textLines.length;l<c&&o<=i.y;l++)o+=this.getHeightOfLine(l)*this.scaleY,s=l,l>0&&(a+=this._textLines[l-1].length+this.missingNewlineOffset(l-1));r=this._getLineLeftOffset(s)*this.scaleX,e=this._textLines[s],"rtl"===this.direction&&(i.x=this.width*this.scaleX-i.x+r);for(var h=0,u=e.length;h<u&&(n=r,(r+=this.__charBounds[s][h].kernedWidth*this.scaleX)<=i.x);h++)a++;return this._getNewSelectionStartFromOffset(i,n,r,a,u)},_getNewSelectionStartFromOffset:function(t,e,i,n,r){var o=t.x-e,a=i-t.x,s=n+(a>o||a<0?0:1);return this.flipX&&(s=r-s),s>this._text.length&&(s=this._text.length),s}}),S.util.object.extend(S.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=S.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","false"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var t=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+t.top+"; left: "+t.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; paddingーtop: "+t.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):S.document.body.appendChild(this.hiddenTextarea),S.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),S.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),S.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),S.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),S.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),S.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),S.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),S.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),S.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(S.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},keysMapRtl:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorLeft",36:"moveCursorRight",37:"moveCursorRight",38:"moveCursorUp",39:"moveCursorLeft",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(t){if(this.isEditing){var e="rtl"===this.direction?this.keysMapRtl:this.keysMap;if(t.keyCode in e)this[e[t.keyCode]](t);else{if(!(t.keyCode in this.ctrlKeysMapDown)||!t.ctrlKey&&!t.metaKey)return;this[this.ctrlKeysMapDown[t.keyCode]](t)}t.stopImmediatePropagation(),t.preventDefault(),t.keyCode>=33&&t.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(t){!this.isEditing||this._copyDone||this.inCompositionMode?this._copyDone=!1:t.keyCode in this.ctrlKeysMapUp&&(t.ctrlKey||t.metaKey)&&(this[this.ctrlKeysMapUp[t.keyCode]](t),t.stopImmediatePropagation(),t.preventDefault(),this.canvas&&this.canvas.requestRenderAll())},onInput:function(t){var e=this.fromPaste;if(this.fromPaste=!1,t&&t.stopPropagation(),this.isEditing){var i,n,r,o,a,s=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,l=this._text.length,c=s.length,h=c-l,u=this.selectionStart,f=this.selectionEnd,d=u!==f;if(""===this.hiddenTextarea.value)return this.styles={},this.updateFromTextArea(),this.fire("changed"),void(this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll()));var v=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),g=u>v.selectionStart;d?(i=this._text.slice(u,f),h+=f-u):c<l&&(i=g?this._text.slice(f+h,f):this._text.slice(u,u-h)),n=s.slice(v.selectionEnd-h,v.selectionEnd),i&&i.length&&(n.length&&(r=this.getSelectionStyles(u,u+1,!1),r=n.map((function(){return r[0]}))),d?(o=u,a=f):g?(o=f-i.length,a=f):(o=f,a=f+i.length),this.removeStyleFromTo(o,a)),n.length&&(e&&n.join("")===S.copiedText&&!S.disableStyleCopyPaste&&(r=S.copiedTextStyle),this.insertNewStyleBlock(n,u,r)),this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll())}},onCompositionStart:function(){this.inCompositionMode=!0},onCompositionEnd:function(){this.inCompositionMode=!1},onCompositionUpdate:function(t){this.compositionStart=t.target.selectionStart,this.compositionEnd=t.target.selectionEnd,this.updateTextareaPosition()},copy:function(){this.selectionStart!==this.selectionEnd&&(S.copiedText=this.getSelectedText(),S.disableStyleCopyPaste?S.copiedTextStyle=null:S.copiedTextStyle=this.getSelectionStyles(this.selectionStart,this.selectionEnd,!0),this._copyDone=!0)},paste:function(){this.fromPaste=!0},_getClipboardData:function(t){return t&&t.clipboardData||S.window.clipboardData},_getWidthBeforeCursor:function(t,e){var i,n=this._getLineLeftOffset(t);return e>0&&(n+=(i=this.__charBounds[t][e-1]).left+i.width),n},getDownCursorOffset:function(t,e){var i=this._getSelectionForOffset(t,e),n=this.get2DCursorLocation(i),r=n.lineIndex;if(r===this._textLines.length-1||t.metaKey||34===t.keyCode)return this._text.length-i;var o=n.charIndex,a=this._getWidthBeforeCursor(r,o),s=this._getIndexOnLine(r+1,a);return this._textLines[r].slice(o).length+s+1+this.missingNewlineOffset(r)},_getSelectionForOffset:function(t,e){return t.shiftKey&&this.selectionStart!==this.selectionEnd&&e?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(t,e){var i=this._getSelectionForOffset(t,e),n=this.get2DCursorLocation(i),r=n.lineIndex;if(0===r||t.metaKey||33===t.keyCode)return-i;var o=n.charIndex,a=this._getWidthBeforeCursor(r,o),s=this._getIndexOnLine(r-1,a),l=this._textLines[r].slice(0,o),c=this.missingNewlineOffset(r-1);return-this._textLines[r-1].length+s-l.length+(1-c)},_getIndexOnLine:function(t,e){for(var i,n,r=this._textLines[t],o=this._getLineLeftOffset(t),a=0,s=0,l=r.length;s<l;s++)if((o+=i=this.__charBounds[t][s].width)>e){n=!0;var c=o-i,h=o,u=Math.abs(c-e);a=Math.abs(h-e)<u?s:s-1;break}return n||(a=r.length-1),a},moveCursorDown:function(t){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",t)},moveCursorUp:function(t){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorUpOrDown("Up",t)},_moveCursorUpOrDown:function(t,e){var i=this["get"+t+"CursorOffset"](e,"right"===this._selectionDirection);e.shiftKey?this.moveCursorWithShift(i):this.moveCursorWithoutShift(i),0!==i&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(t){var e="left"===this._selectionDirection?this.selectionStart+t:this.selectionEnd+t;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,e),0!==t},moveCursorWithoutShift:function(t){return t<0?(this.selectionStart+=t,this.selectionEnd=this.selectionStart):(this.selectionEnd+=t,this.selectionStart=this.selectionEnd),0!==t},moveCursorLeft:function(t){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorLeftOrRight("Left",t)},_move:function(t,e,i){var n;if(t.altKey)n=this["findWordBoundary"+i](this[e]);else{if(!t.metaKey&&35!==t.keyCode&&36!==t.keyCode)return this[e]+="Left"===i?-1:1,!0;n=this["findLineBoundary"+i](this[e])}if(void 0!==typeof n&&this[e]!==n)return this[e]=n,!0},_moveLeft:function(t,e){return this._move(t,e,"Left")},_moveRight:function(t,e){return this._move(t,e,"Right")},moveCursorLeftWithoutShift:function(t){var e=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&0!==this.selectionStart&&(e=this._moveLeft(t,"selectionStart")),this.selectionEnd=this.selectionStart,e},moveCursorLeftWithShift:function(t){return"right"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveLeft(t,"selectionEnd"):0!==this.selectionStart?(this._selectionDirection="left",this._moveLeft(t,"selectionStart")):void 0},moveCursorRight:function(t){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",t)},_moveCursorLeftOrRight:function(t,e){var i="moveCursor"+t+"With";this._currentCursorOpacity=1,e.shiftKey?i+="Shift":i+="outShift",this[i](e)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(t){return"left"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveRight(t,"selectionStart"):this.selectionEnd!==this._text.length?(this._selectionDirection="right",this._moveRight(t,"selectionEnd")):void 0},moveCursorRightWithoutShift:function(t){var e=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(e=this._moveRight(t,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,e},removeChars:function(t,e){void 0===e&&(e=t+1),this.removeStyleFromTo(t,e),this._text.splice(t,e-t),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(t,e,i,n){void 0===n&&(n=i),n>i&&this.removeStyleFromTo(i,n);var r=S.util.string.graphemeSplit(t);this.insertNewStyleBlock(r,i,e),this._text=[].concat(this._text.slice(0,i),r,this._text.slice(n)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),k=S.util.toFixed,_=/ +/g,S.util.object.extend(S.Text.prototype,{_toSVG:function(){var t=this._getSVGLeftTopOffsets(),e=this._getSVGTextAndBg(t.textTop,t.textLeft);return this._wrapSVGTextAndBg(e)},toSVG:function(t){return this._createBaseSVGMarkup(this._toSVG(),{reviver:t,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(t){var e=this.getSvgTextDecoration(this);return[t.textBgRects.join(""),'\t\t<text xml:space="preserve" ',this.fontFamily?'font-family="'+this.fontFamily.replace(/"/g,"'")+'" ':"",this.fontSize?'font-size="'+this.fontSize+'" ':"",this.fontStyle?'font-style="'+this.fontStyle+'" ':"",this.fontWeight?'font-weight="'+this.fontWeight+'" ':"",e?'text-decoration="'+e+'" ':"",'style="',this.getSvgStyles(!0),'"',this.addPaintOrder()," >",t.textSpans.join(""),"</text>\n"]},_getSVGTextAndBg:function(t,e){var i,n=[],r=[],o=t;this._setSVGBg(r);for(var a=0,s=this._textLines.length;a<s;a++)i=this._getLineLeftOffset(a),(this.textBackgroundColor||this.styleHas("textBackgroundColor",a))&&this._setSVGTextLineBg(r,a,e+i,o),this._setSVGTextLineText(n,a,e+i,o),o+=this.getHeightOfLine(a);return{textSpans:n,textBgRects:r}},_createTextCharSpan:function(t,e,i,n){var r=t!==t.trim()||t.match(_),o=this.getSvgSpanStyles(e,r),a=o?'style="'+o+'"':"",s=e.deltaY,l="",c=S.Object.NUM_FRACTION_DIGITS;return s&&(l=' dy="'+k(s,c)+'" '),['<tspan x="',k(i,c),'" y="',k(n,c),'" ',l,a,">",S.util.string.escapeXml(t),"</tspan>"].join("")},_setSVGTextLineText:function(t,e,i,n){var r,o,a,s,l,c=this.getHeightOfLine(e),h=-1!==this.textAlign.indexOf("justify"),u="",f=0,d=this._textLines[e];n+=c*(1-this._fontSizeFraction)/this.lineHeight;for(var v=0,g=d.length-1;v<=g;v++)l=v===g||this.charSpacing,u+=d[v],a=this.__charBounds[e][v],0===f?(i+=a.kernedWidth-a.width,f+=a.width):f+=a.kernedWidth,h&&!l&&this._reSpaceAndTab.test(d[v])&&(l=!0),l||(r=r||this.getCompleteStyleDeclaration(e,v),o=this.getCompleteStyleDeclaration(e,v+1),l=this._hasStyleChangedForSvg(r,o)),l&&(s=this._getStyleDeclaration(e,v)||{},t.push(this._createTextCharSpan(u,s,i,n)),u="",r=o,i+=f,f=0)},_pushTextBgRect:function(t,e,i,n,r,o){var a=S.Object.NUM_FRACTION_DIGITS;t.push("\t\t<rect ",this._getFillAttributes(e),' x="',k(i,a),'" y="',k(n,a),'" width="',k(r,a),'" height="',k(o,a),'"></rect>\n')},_setSVGTextLineBg:function(t,e,i,n){for(var r,o,a=this._textLines[e],s=this.getHeightOfLine(e)/this.lineHeight,l=0,c=0,h=this.getValueOfPropertyAt(e,0,"textBackgroundColor"),u=0,f=a.length;u<f;u++)r=this.__charBounds[e][u],(o=this.getValueOfPropertyAt(e,u,"textBackgroundColor"))!==h?(h&&this._pushTextBgRect(t,h,i+c,n,l,s),c=r.left,l=r.width,h=o):l+=r.kernedWidth;o&&this._pushTextBgRect(t,o,i+c,n,l,s)},_getFillAttributes:function(t){var e=t&&"string"==typeof t?new S.Color(t):"";return e&&e.getSource()&&1!==e.getAlpha()?'opacity="'+e.getAlpha()+'" fill="'+e.setAlpha(1).toRgb()+'"':'fill="'+t+'"'},_getSVGLineTopOffset:function(t){for(var e,i=0,n=0;n<t;n++)i+=this.getHeightOfLine(n);return e=this.getHeightOfLine(n),{lineTop:i,offset:(this._fontSizeMult-this._fontSizeFraction)*e/(this.lineHeight*this._fontSizeMult)}},getSvgStyles:function(t){return S.Object.prototype.getSvgStyles.call(this,t)+" white-space: pre;"}}),function(t){"use strict";var e=t.fabric||(t.fabric={});e.Textbox=e.util.createClass(e.IText,e.Observable,{type:"textbox",minWidth:20,dynamicMinWidth:2,__cachedLines:null,lockScalingFlip:!0,noScaleCache:!1,_dimensionAffectingProps:e.Text.prototype._dimensionAffectingProps.concat("width"),_wordJoiners:/[ \t\r]/,splitByGrapheme:!1,initDimensions:function(){this.__skipDimension||(this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this._clearCache(),this.dynamicMinWidth=0,this._styleMap=this._generateStyleMap(this._splitText()),this.dynamicMinWidth>this.width&&this._set("width",this.dynamicMinWidth),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(t){for(var e=0,i=0,n=0,r={},o=0;o<t.graphemeLines.length;o++)"\n"===t.graphemeText[n]&&o>0?(i=0,n++,e++):!this.splitByGrapheme&&this._reSpaceAndTab.test(t.graphemeText[n])&&o>0&&(i++,n++),r[o]={line:e,offset:i},n+=t.graphemeLines[o].length,i+=t.graphemeLines[o].length;return r},styleHas:function(t,i){if(this._styleMap&&!this.isWrapping){var n=this._styleMap[i];n&&(i=n.line)}return e.Text.prototype.styleHas.call(this,t,i)},isEmptyStyles:function(t){if(!this.styles)return!0;var e,i,n=0,r=!1,o=this._styleMap[t],a=this._styleMap[t+1];for(var s in o&&(t=o.line,n=o.offset),a&&(r=a.line===t,e=a.offset),i=void 0===t?this.styles:{line:this.styles[t]})for(var l in i[s])if(l>=n&&(!r||l<e))for(var c in i[s][l])return!1;return!0},_getStyleDeclaration:function(t,e){if(this._styleMap&&!this.isWrapping){var i=this._styleMap[t];if(!i)return null;t=i.line,e=i.offset+e}return this.callSuper("_getStyleDeclaration",t,e)},_setStyleDeclaration:function(t,e,i){var n=this._styleMap[t];t=n.line,e=n.offset+e,this.styles[t][e]=i},_deleteStyleDeclaration:function(t,e){var i=this._styleMap[t];t=i.line,e=i.offset+e,delete this.styles[t][e]},_getLineStyle:function(t){var e=this._styleMap[t];return!!this.styles[e.line]},_setLineStyle:function(t){var e=this._styleMap[t];this.styles[e.line]={}},_wrapText:function(t,e){var i,n=[];for(this.isWrapping=!0,i=0;i<t.length;i++)n=n.concat(this._wrapLine(t[i],i,e));return this.isWrapping=!1,n},_measureWord:function(t,e,i){var n,r=0;i=i||0;for(var o=0,a=t.length;o<a;o++){r+=this._getGraphemeBox(t[o],e,o+i,n,!0).kernedWidth,n=t[o]}return r},_wrapLine:function(t,i,n,r){var o=0,a=this.splitByGrapheme,s=[],l=[],c=a?e.util.string.graphemeSplit(t):t.split(this._wordJoiners),h="",u=0,f=a?"":" ",d=0,v=0,g=0,p=!0,m=this._getWidthOfCharSpacing();r=r||0;0===c.length&&c.push([]),n-=r;for(var y=0;y<c.length;y++)h=a?c[y]:e.util.string.graphemeSplit(c[y]),d=this._measureWord(h,i,u),u+=h.length,(o+=v+d-m)>n&&!p?(s.push(l),l=[],o=d,p=!0):o+=m,p||a||l.push(f),l=l.concat(h),v=a?0:this._measureWord([f],i,u),u++,p=!1,d>g&&(g=d);return y&&s.push(l),g+r>this.dynamicMinWidth&&(this.dynamicMinWidth=g-m+r),s},isEndOfWrapping:function(t){return!this._styleMap[t+1]||this._styleMap[t+1].line!==this._styleMap[t].line},missingNewlineOffset:function(t){return this.splitByGrapheme?this.isEndOfWrapping(t)?1:0:1},_splitTextIntoLines:function(t){for(var i=e.Text.prototype._splitTextIntoLines.call(this,t),n=this._wrapText(i.lines,this.width),r=new Array(n.length),o=0;o<n.length;o++)r[o]=n[o].join("");return i.lines=r,i.graphemeLines=n,i},getMinWidth:function(){return Math.max(this.minWidth,this.dynamicMinWidth)},_removeExtraneousStyles:function(){var t={};for(var e in this._styleMap)this._textLines[e]&&(t[this._styleMap[e].line]=1);for(var e in this.styles)t[e]||delete this.styles[e]},toObject:function(t){return this.callSuper("toObject",["minWidth","splitByGrapheme"].concat(t))}}),e.Textbox.fromObject=function(t,i){return e.Object._fromObject("Textbox",t,i,"text")}}(e),function(){var t=S.controlsUtils,e=t.scaleSkewCursorStyleHandler,i=t.scaleCursorStyleHandler,n=t.scalingEqually,r=t.scalingYOrSkewingX,o=t.scalingXOrSkewingY,a=t.scaleOrSkewActionName,s=S.Object.prototype.controls;if(s.ml=new S.Control({x:-.5,y:0,cursorStyleHandler:e,actionHandler:o,getActionName:a}),s.mr=new S.Control({x:.5,y:0,cursorStyleHandler:e,actionHandler:o,getActionName:a}),s.mb=new S.Control({x:0,y:.5,cursorStyleHandler:e,actionHandler:r,getActionName:a}),s.mt=new S.Control({x:0,y:-.5,cursorStyleHandler:e,actionHandler:r,getActionName:a}),s.tl=new S.Control({x:-.5,y:-.5,cursorStyleHandler:i,actionHandler:n}),s.tr=new S.Control({x:.5,y:-.5,cursorStyleHandler:i,actionHandler:n}),s.bl=new S.Control({x:-.5,y:.5,cursorStyleHandler:i,actionHandler:n}),s.br=new S.Control({x:.5,y:.5,cursorStyleHandler:i,actionHandler:n}),s.mtr=new S.Control({x:0,y:-.5,actionHandler:t.rotationWithSnapping,cursorStyleHandler:t.rotationStyleHandler,offsetY:-40,withConnection:!0,actionName:"rotate"}),S.Textbox){var l=S.Textbox.prototype.controls={};l.mtr=s.mtr,l.tr=s.tr,l.br=s.br,l.tl=s.tl,l.bl=s.bl,l.mt=s.mt,l.mb=s.mb,l.mr=new S.Control({x:.5,y:0,actionHandler:t.changeWidth,cursorStyleHandler:e,actionName:"resizing"}),l.ml=new S.Control({x:-.5,y:0,actionHandler:t.changeWidth,cursorStyleHandler:e,actionName:"resizing"})}}()}).call(this,i(27).Buffer)},function(t,e,i){t.exports=i(25)},function(t,e){function i(t,e,i,n,r,o,a){try{var s=t[o](a),l=s.value}catch(t){return void i(t)}s.done?e(l):Promise.resolve(l).then(n,r)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var a=t.apply(e,n);function s(t){i(a,r,o,s,l,"next",t)}function l(t){i(a,r,o,s,l,"throw",t)}s(void 0)}))}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function i(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=i=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=i=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),i(e)}t.exports=i,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,i){var n=i(16),r=i(19),o=i(15),a=i(18);t.exports=function(t){return n(t)||r(t)||o(t)||a()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,i){var n=i(17);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){},function(t,e){t.exports=function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,r,o=[],a=!0,s=!1;try{for(i=i.call(t);!(a=(n=i.next()).done)&&(o.push(n.value),!e||o.length!==e);a=!0);}catch(t){s=!0,r=t}finally{try{a||null==i.return||i.return()}finally{if(s)throw r}}return o}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,i){var n=i(17);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function i(e,n){return t.exports=i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.default=t.exports,t.exports.__esModule=!0,i(e,n)}t.exports=i,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,i){var n=function(t){"use strict";var e=Object.prototype,i=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,i){return t[e]=i}}function l(t,e,i,n){var r=e&&e.prototype instanceof u?e:u,o=Object.create(r.prototype),a=new k(n||[]);return o._invoke=function(t,e,i){var n="suspendedStart";return function(r,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw o;return S()}for(i.method=r,i.arg=o;;){var a=i.delegate;if(a){var s=w(a,i);if(s){if(s===h)continue;return s}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===n)throw n="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n="executing";var l=c(t,e,i);if("normal"===l.type){if(n=i.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n="completed",i.method="throw",i.arg=l.arg)}}}(t,i,a),o}function c(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var h={};function u(){}function f(){}function d(){}var v={};s(v,r,(function(){return this}));var g=Object.getPrototypeOf,p=g&&g(g(_([])));p&&p!==e&&i.call(p,r)&&(v=p);var m=d.prototype=u.prototype=Object.create(v);function y(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var n;this._invoke=function(r,o){function a(){return new e((function(n,a){!function n(r,o,a,s){var l=c(t[r],t,o);if("throw"!==l.type){var h=l.arg,u=h.value;return u&&"object"==typeof u&&i.call(u,"__await")?e.resolve(u.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(u).then((function(t){h.value=t,a(h)}),(function(t){return n("throw",t,a,s)}))}s(l.arg)}(r,o,n,a)}))}return n=n?n.then(a,a):a()}}function w(t,e){var i=t.iterator[e.method];if(void 0===i){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=c(i,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var r=n.arg;return r?r.done?(e[t.resultName]=r.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):r:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function _(t){if(t){var e=t[r];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(i.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return f.prototype=d,s(m,"constructor",d),s(d,"constructor",f),f.displayName=s(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,a,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},y(b.prototype),s(b.prototype,o,(function(){return this})),t.AsyncIterator=b,t.async=function(e,i,n,r,o){void 0===o&&(o=Promise);var a=new b(l(e,i,n,r),o);return t.isGeneratorFunction(i)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},y(m),s(m,a,"Generator"),s(m,r,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var i in t)e.push(i);return e.reverse(),function i(){for(;e.length;){var n=e.pop();if(n in t)return i.value=n,i.done=!1,i}return i.done=!0,i}},t.values=_,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(i,n){return a.type="throw",a.arg=t,e.next=i,n&&(e.method="next",e.arg=void 0),!!n}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),C(i),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var r=n.arg;C(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,i){return this.delegate={iterator:_(t),resultName:e,nextLoc:i},"next"===this.method&&(this.arg=void 0),h}},t}(t.exports);try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(t,e,i){var n=i(1);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=n(t)););return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,i){"use strict";(function(t){
3
+ var n,r,a,o,s,l,c,h,u,f,d,m,g,v,p,y,b,w,x,k,C,S,_=_||{version:"4.6.0"};if(t.fabric=_,"undefined"!=typeof document&&"undefined"!=typeof window)document instanceof("undefined"!=typeof HTMLDocument?HTMLDocument:Document)?_.document=document:_.document=document.implementation.createHTMLDocument(""),_.window=window;else{var T=new(i(32).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;_.document=T.document,_.jsdomImplForWrapper=i(33).implForWrapper,_.nodeCanvas=i(34).Canvas,_.window=T,DOMParser=_.window.DOMParser}function O(e,t){var i=e.canvas,n=t.targetCanvas,r=n.getContext("2d");r.translate(0,n.height),r.scale(1,-1);var a=i.height-n.height;r.drawImage(i,0,a,n.width,n.height,0,0,n.width,n.height)}function E(e,t){var i=t.targetCanvas.getContext("2d"),n=t.destinationWidth,r=t.destinationHeight,a=n*r*4,o=new Uint8Array(this.imageBuffer,0,a),s=new Uint8ClampedArray(this.imageBuffer,0,a);e.readPixels(0,0,n,r,e.RGBA,e.UNSIGNED_BYTE,o);var l=new ImageData(s,n,r);i.putImageData(l,0,0)}_.isTouchSupported="ontouchstart"in _.window||"ontouchstart"in _.document||_.window&&_.window.navigator&&_.window.navigator.maxTouchPoints>0,_.isLikelyNode=void 0!==e&&"undefined"==typeof window,_.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"],_.DPI=96,_.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",_.commaWsp="(?:\\s+,?\\s*|,\\s*)",_.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,_.reNonWord=/[ \n\.,;!\?\-]/,_.fontPaths={},_.iMatrix=[1,0,0,1,0,0],_.svgNS="http://www.w3.org/2000/svg",_.perfLimitSizeTotal=2097152,_.maxCacheSideLimit=4096,_.minCacheSideLimit=256,_.charWidthsCache={},_.textureSize=2048,_.disableStyleCopyPaste=!1,_.enableGLFiltering=!0,_.devicePixelRatio=_.window.devicePixelRatio||_.window.webkitDevicePixelRatio||_.window.mozDevicePixelRatio||1,_.browserShadowBlurConstant=1,_.arcToSegmentsCache={},_.boundsOfCurveCache={},_.cachesBoundsOfCurve=!0,_.forceGLPutImageData=!1,_.initFilterBackend=function(){return _.enableGLFiltering&&_.isWebglSupported&&_.isWebglSupported(_.textureSize)?(console.log("max texture size: "+_.maxTextureSize),new _.WebglFilterBackend({tileSize:_.textureSize})):_.Canvas2dFilterBackend?new _.Canvas2dFilterBackend:void 0},"undefined"!=typeof document&&"undefined"!=typeof window&&(window.fabric=_),function(){function e(e,t){if(this.__eventListeners[e]){var i=this.__eventListeners[e];t?i[i.indexOf(t)]=!1:_.util.array.fill(i,!1)}}function t(e,t){var i=function(){t.apply(this,arguments),this.off(e,i)}.bind(this);this.on(e,i)}_.Observable={fire:function(e,t){if(!this.__eventListeners)return this;var i=this.__eventListeners[e];if(!i)return this;for(var n=0,r=i.length;n<r;n++)i[n]&&i[n].call(this,t||{});return this.__eventListeners[e]=i.filter((function(e){return!1!==e})),this},on:function(e,t){if(this.__eventListeners||(this.__eventListeners={}),1===arguments.length)for(var i in e)this.on(i,e[i]);else this.__eventListeners[e]||(this.__eventListeners[e]=[]),this.__eventListeners[e].push(t);return this},once:function(e,i){if(1===arguments.length)for(var n in e)t.call(this,n,e[n]);else t.call(this,e,i);return this},off:function(t,i){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 n in t)e.call(this,n,t[n]);else e.call(this,t,i);return this}}}(),_.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,i){var n=this._objects;return i?n[t]=e:n.splice(t,0,e),this._onObjectAdded&&this._onObjectAdded(e),this.renderOnAddRemove&&this.requestRenderAll(),this},remove:function(){for(var e,t=this._objects,i=!1,n=0,r=arguments.length;n<r;n++)-1!==(e=t.indexOf(arguments[n]))&&(i=!0,t.splice(e,1),this._onObjectRemoved&&this._onObjectRemoved(arguments[n]));return this.renderOnAddRemove&&i&&this.requestRenderAll(),this},forEachObject:function(e,t){for(var i=this.getObjects(),n=0,r=i.length;n<r;n++)e.call(t,i[n],n,i);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,t){return this._objects.indexOf(e)>-1||!!t&&this._objects.some((function(t){return"function"==typeof t.contains&&t.contains(e,!0)}))},complexity:function(){return this._objects.reduce((function(e,t){return e+=t.complexity?t.complexity():0}),0)}},_.CommonMethods={_setOptions:function(e){for(var t in e)this.set(t,e[t])},_initGradient:function(e,t){!e||!e.colorStops||e instanceof _.Gradient||this.set(t,new _.Gradient(e))},_initPattern:function(e,t,i){!e||!e.source||e instanceof _.Pattern?i&&i():this.set(t,new _.Pattern(e,i))},_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]}},n=t,r=Math.sqrt,a=Math.atan2,o=Math.pow,s=Math.PI/180,l=Math.PI/2,_.util={cos:function(e){if(0===e)return 1;switch(e<0&&(e=-e),e/l){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/l){case 1:return t;case 2:return 0;case 3:return-t}return Math.sin(e)},removeFromArray:function(e,t){var i=e.indexOf(t);return-1!==i&&e.splice(i,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,i){var n=new _.Point(e.x-t.x,e.y-t.y),r=_.util.rotateVector(n,i);return new _.Point(r.x,r.y).addEquals(t)},rotateVector:function(e,t){var i=_.util.sin(t),n=_.util.cos(t);return{x:e.x*n-e.y*i,y:e.x*i+e.y*n}},transformPoint:function(e,t,i){return i?new _.Point(t[0]*e.x+t[2]*e.y,t[1]*e.x+t[3]*e.y):new _.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 i=0;i<e.length;i++)e[i]=_.util.transformPoint(e[i],t);var n=[e[0].x,e[1].x,e[2].x,e[3].x],r=_.util.array.min(n),a=_.util.array.max(n)-r,o=[e[0].y,e[1].y,e[2].y,e[3].y],s=_.util.array.min(o);return{left:r,top:s,width:a,height:_.util.array.max(o)-s}},invertTransform:function(e){var t=1/(e[0]*e[3]-e[1]*e[2]),i=[t*e[3],-t*e[1],-t*e[2],t*e[0]],n=_.util.transformPoint({x:e[4],y:e[5]},i,!0);return i[4]=-n.x,i[5]=-n.y,i},toFixed:function(e,t){return parseFloat(Number(e).toFixed(t))},parseUnit:function(e,t){var i=/\D{0,2}$/.exec(e),n=parseFloat(e);switch(t||(t=_.Text.DEFAULT_SVG_FONT_SIZE),i[0]){case"mm":return n*_.DPI/25.4;case"cm":return n*_.DPI/2.54;case"in":return n*_.DPI;case"pt":return n*_.DPI/72;case"pc":return n*_.DPI/72*12;case"em":return n*t;default:return n}},falseFunction:function(){return!1},getKlass:function(e,t){return e=_.util.string.camelize(e.charAt(0).toUpperCase()+e.slice(1)),_.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 _;var t,i=e.split("."),r=i.length,a=n||_.window;for(t=0;t<r;++t)a=a[i[t]];return a},loadImage:function(e,t,i,n){if(e){var r=_.util.createImage(),a=function(){t&&t.call(i,r,!1),r=r.onload=r.onerror=null};r.onload=a,r.onerror=function(){_.log("Error loading "+r.src),t&&t.call(i,null,!0),r=r.onload=r.onerror=null},0!==e.indexOf("data")&&null!=n&&(r.crossOrigin=n),"data:image/svg"===e.substring(0,14)&&(r.onload=null,_.util.loadImageInDom(r,a)),r.src=e}else t&&t.call(i,e)},loadImageInDom:function(e,t){var i=_.document.createElement("div");i.style.width=i.style.height="1px",i.style.left=i.style.top="-100%",i.style.position="absolute",i.appendChild(e),_.document.querySelector("body").appendChild(i),e.onload=function(){t(),i.parentNode.removeChild(i),i=null}},enlivenObjects:function(e,t,i,n){var r=[],a=0,o=(e=e||[]).length;function s(){++a===o&&t&&t(r.filter((function(e){return e})))}o?e.forEach((function(e,t){e&&e.type?_.util.getKlass(e.type,i).fromObject(e,(function(i,a){a||(r[t]=i),n&&n(e,i,a),s()})):s()})):t&&t(r)},enlivenPatterns:function(e,t){function i(){++r===a&&t&&t(n)}var n=[],r=0,a=(e=e||[]).length;a?e.forEach((function(e,t){e&&e.source?new _.Pattern(e,(function(e){n[t]=e,i()})):(n[t]=e,i())})):t&&t(n)},groupSVGElements:function(e,t,i){var n;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)),n=new _.Group(e,t),void 0!==i&&(n.sourcePath=i),n)},populateWithProperties:function(e,t,i){if(i&&"[object Array]"===Object.prototype.toString.call(i))for(var n=0,r=i.length;n<r;n++)i[n]in e&&(t[i[n]]=e[i[n]])},drawDashedLine:function(e,t,i,n,o,s){var l=n-t,c=o-i,h=r(l*l+c*c),u=a(c,l),f=s.length,d=0,m=!0;for(e.save(),e.translate(t,i),e.moveTo(0,0),e.rotate(u),t=0;h>t;)(t+=s[d++%f])>h&&(t=h),e[m?"lineTo":"moveTo"](t,0),m=!m;e.restore()},createCanvasElement:function(){return _.document.createElement("canvas")},copyCanvasElement:function(e){var t=_.util.createCanvasElement();return t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t},toDataURL:function(e,t,i){return e.toDataURL("image/"+t,i)},createImage:function(){return _.document.createElement("img")},multiplyTransformMatrices:function(e,t,i){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],i?0:e[0]*t[4]+e[2]*t[5]+e[4],i?0:e[1]*t[4]+e[3]*t[5]+e[5]]},qrDecompose:function(e){var t=a(e[1],e[0]),i=o(e[0],2)+o(e[1],2),n=r(i),l=(e[0]*e[3]-e[2]*e[1])/n,c=a(e[0]*e[2]+e[1]*e[3],i);return{angle:t/s,scaleX:n,scaleY:l,skewX:c/s,skewY:0,translateX:e[4],translateY:e[5]}},calcRotateMatrix:function(e){if(!e.angle)return _.iMatrix.concat();var t=_.util.degreesToRadians(e.angle),i=_.util.cos(t),n=_.util.sin(t);return[i,n,-n,i,0,0]},calcDimensionsMatrix:function(e){var t=void 0===e.scaleX?1:e.scaleX,i=void 0===e.scaleY?1:e.scaleY,n=[e.flipX?-t:t,0,0,e.flipY?-i:i,0,0],r=_.util.multiplyTransformMatrices,a=_.util.degreesToRadians;return e.skewX&&(n=r(n,[1,0,Math.tan(a(e.skewX)),1],!0)),e.skewY&&(n=r(n,[1,Math.tan(a(e.skewY)),0,1],!0)),n},composeMatrix:function(e){var t=[1,0,0,1,e.translateX||0,e.translateY||0],i=_.util.multiplyTransformMatrices;return e.angle&&(t=i(t,_.util.calcRotateMatrix(e))),(1!==e.scaleX||1!==e.scaleY||e.skewX||e.skewY||e.flipX||e.flipY)&&(t=i(t,_.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,i,n){n>0&&(t>n?t-=n:t=0,i>n?i-=n:i=0);var r,a=!0,o=e.getImageData(t,i,2*n||1,2*n||1),s=o.data.length;for(r=3;r<s&&!1!=(a=o.data[r]<=0);r+=4);return o=null,a},parsePreserveAspectRatioAttribute:function(e){var t,i="meet",n=e.split(" ");return n&&n.length&&("meet"!==(i=n.pop())&&"slice"!==i?(t=i,i="meet"):n.length&&(t=n.pop())),{meetOrSlice:i,alignX:"none"!==t?t.slice(1,4):"none",alignY:"none"!==t?t.slice(5,8):"none"}},clearFabricFontCache:function(e){(e=(e||"").toLowerCase())?_.charWidthsCache[e]&&delete _.charWidthsCache[e]:_.charWidthsCache={}},limitDimsByArea:function(e,t){var i=Math.sqrt(t*e),n=Math.floor(t/i);return{x:Math.floor(i),y:n}},capValue:function(e,t,i){return Math.max(e,Math.min(t,i))},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 _.util.toFixed(e,_.Object.NUM_FRACTION_DIGITS)})).join(" ")+")"},removeTransformFromObject:function(e,t){var i=_.util.invertTransform(t),n=_.util.multiplyTransformMatrices(i,e.calcOwnMatrix());_.util.applyTransformToObject(e,n)},addTransformToObject:function(e,t){_.util.applyTransformToObject(e,_.util.multiplyTransformMatrices(t,e.calcOwnMatrix()))},applyTransformToObject:function(e,t){var i=_.util.qrDecompose(t),n=new _.Point(i.translateX,i.translateY);e.flipX=!1,e.flipY=!1,e.set("scaleX",i.scaleX),e.set("scaleY",i.scaleY),e.skewX=i.skewX,e.skewY=i.skewY,e.angle=i.angle,e.setPositionByOrigin(n,"center","center")},sizeAfterTransform:function(e,t,i){var n=e/2,r=t/2,a=[{x:-n,y:-r},{x:n,y:-r},{x:-n,y:r},{x:n,y:r}],o=_.util.calcDimensionsMatrix(i),s=_.util.makeBoundingBoxFromPoints(a,o);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},i={m:"l",M:"L"};function n(e,t,i,n,r,a,o,s,l,c,h){var u=_.util.cos(e),f=_.util.sin(e),d=_.util.cos(t),m=_.util.sin(t),g=i*r*d-n*a*m+o,v=n*r*d+i*a*m+s;return["C",c+l*(-i*r*f-n*a*u),h+l*(-n*r*f+i*a*u),g+l*(i*r*m+n*a*d),v+l*(n*r*m-i*a*d),g,v]}function r(e,t,i,r,o,s,l){var c=Math.PI,h=l*c/180,u=_.util.sin(h),f=_.util.cos(h),d=0,m=0,g=-f*e*.5-u*t*.5,v=-f*t*.5+u*e*.5,p=(i=Math.abs(i))*i,y=(r=Math.abs(r))*r,b=v*v,w=g*g,x=p*y-p*b-y*w,k=0;if(x<0){var C=Math.sqrt(1-x/(p*y));i*=C,r*=C}else k=(o===s?-1:1)*Math.sqrt(x/(p*b+y*w));var S=k*i*v/r,T=-k*r*g/i,O=f*S-u*T+.5*e,E=u*S+f*T+.5*t,R=a(1,0,(g-S)/i,(v-T)/r),I=a((g-S)/i,(v-T)/r,(-g-S)/i,(-v-T)/r);0===s&&I>0?I-=2*c:1===s&&I<0&&(I+=2*c);for(var A=Math.ceil(Math.abs(I/c*2)),D=[],P=I/A,F=8/3*Math.sin(P/4)*Math.sin(P/4)/Math.sin(P/2),M=R+P,L=0;L<A;L++)D[L]=n(R,M,f,u,i,r,O,E,F,d,m),d=D[L][5],m=D[L][6],R=M,M+=P;return D}function a(e,t,i,n){var r=Math.atan2(t,e),a=Math.atan2(n,i);return a>=r?a-r:2*Math.PI-(r-a)}function o(t,i,n,r,a,o,s,l){var c;if(_.cachesBoundsOfCurve&&(c=e.call(arguments),_.boundsOfCurveCache[c]))return _.boundsOfCurveCache[c];var h,u,f,d,m,g,v,p,y=Math.sqrt,b=Math.min,w=Math.max,x=Math.abs,k=[],C=[[],[]];u=6*t-12*n+6*a,h=-3*t+9*n-9*a+3*s,f=3*n-3*t;for(var S=0;S<2;++S)if(S>0&&(u=6*i-12*r+6*o,h=-3*i+9*r-9*o+3*l,f=3*r-3*i),x(h)<1e-12){if(x(u)<1e-12)continue;0<(d=-f/u)&&d<1&&k.push(d)}else(v=u*u-4*f*h)<0||(0<(m=(-u+(p=y(v)))/(2*h))&&m<1&&k.push(m),0<(g=(-u-p)/(2*h))&&g<1&&k.push(g));for(var T,O,E,R=k.length,I=R;R--;)T=(E=1-(d=k[R]))*E*E*t+3*E*E*d*n+3*E*d*d*a+d*d*d*s,C[0][R]=T,O=E*E*E*i+3*E*E*d*r+3*E*d*d*o+d*d*d*l,C[1][R]=O;C[0][I]=t,C[1][I]=i,C[0][I+1]=s,C[1][I+1]=l;var A=[{x:b.apply(null,C[0]),y:b.apply(null,C[1])},{x:w.apply(null,C[0]),y:w.apply(null,C[1])}];return _.cachesBoundsOfCurve&&(_.boundsOfCurveCache[c]=A),A}function s(e,t,i){for(var n=i[1],a=i[2],o=i[3],s=i[4],l=i[5],c=r(i[6]-e,i[7]-t,n,a,s,l,o),h=0,u=c.length;h<u;h++)c[h][1]+=e,c[h][2]+=t,c[h][3]+=e,c[h][4]+=t,c[h][5]+=e,c[h][6]+=t;return c}function l(e,t,i,n){return Math.sqrt((i-e)*(i-e)+(n-t)*(n-t))}function c(e,t,i,n,r,a,o,s){return function(l){var c,h=(c=l)*c*c,u=function(e){return 3*e*e*(1-e)}(l),f=function(e){return 3*e*(1-e)*(1-e)}(l),d=function(e){return(1-e)*(1-e)*(1-e)}(l);return{x:o*h+r*u+i*f+e*d,y:s*h+a*u+n*f+t*d}}}function h(e,t,i,n,r,a,o,s){return function(l){var c=1-l,h=3*c*c*(i-e)+6*c*l*(r-i)+3*l*l*(o-r),u=3*c*c*(n-t)+6*c*l*(a-n)+3*l*l*(s-a);return Math.atan2(u,h)}}function u(e,t,i,n,r,a){return function(o){var s,l=(s=o)*s,c=function(e){return 2*e*(1-e)}(o),h=function(e){return(1-e)*(1-e)}(o);return{x:r*l+i*c+e*h,y:a*l+n*c+t*h}}}function f(e,t,i,n,r,a){return function(o){var s=1-o,l=2*s*(i-e)+2*o*(r-i),c=2*s*(n-t)+2*o*(a-n);return Math.atan2(c,l)}}function d(e,t,i){var n,r,a={x:t,y:i},o=0;for(r=1;r<=100;r+=1)n=e(r/100),o+=l(a.x,a.y,n.x,n.y),a=n;return o}function m(e,t){for(var i,n,r,a=0,o=0,s=e.iterator,c={x:e.x,y:e.y},h=.01,u=e.angleFinder;o<t&&a<=1&&h>1e-4;)i=s(a),r=a,(n=l(c.x,c.y,i.x,i.y))+o>t?a-=h/=2:(c=i,a+=h,o+=n);return i.angle=u(r),i}function g(e){for(var t,i,n,r,a=0,o=e.length,s=0,m=0,g=0,v=0,p=[],y=0;y<o;y++){switch(n={x:s,y:m,command:(t=e[y])[0]},t[0]){case"M":n.length=0,g=s=t[1],v=m=t[2];break;case"L":n.length=l(s,m,t[1],t[2]),s=t[1],m=t[2];break;case"C":i=c(s,m,t[1],t[2],t[3],t[4],t[5],t[6]),r=h(s,m,t[1],t[2],t[3],t[4],t[5],t[6]),n.iterator=i,n.angleFinder=r,n.length=d(i,s,m),s=t[5],m=t[6];break;case"Q":i=u(s,m,t[1],t[2],t[3],t[4]),r=f(s,m,t[1],t[2],t[3],t[4]),n.iterator=i,n.angleFinder=r,n.length=d(i,s,m),s=t[3],m=t[4];break;case"Z":case"z":n.destX=g,n.destY=v,n.length=l(s,m,g,v),s=g,m=v}a+=n.length,p.push(n)}return p.push({length:a,x:s,y:m}),p}_.util.joinPath=function(e){return e.map((function(e){return e.join(" ")})).join(" ")},_.util.parsePath=function(e){var n,r,a,o,s,l=[],c=[],h=_.rePathCommand,u="[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?\\s*",f="("+u+")"+_.commaWsp,d="([01])"+_.commaWsp+"?",m=new RegExp(f+"?"+f+"?"+f+d+d+f+"?("+u+")","g");if(!e||!e.match)return l;for(var g,v=0,p=(s=e.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi)).length;v<p;v++){o=(n=s[v]).slice(1).trim(),c.length=0;var y=n.charAt(0);if(g=[y],"a"===y.toLowerCase())for(var b;b=m.exec(o);)for(var w=1;w<b.length;w++)c.push(b[w]);else for(;a=h.exec(o);)c.push(a[0]);w=0;for(var x=c.length;w<x;w++)r=parseFloat(c[w]),isNaN(r)||g.push(r);var k=t[y.toLowerCase()],C=i[y]||y;if(g.length-1>k)for(var S=1,T=g.length;S<T;S+=k)l.push([y].concat(g.slice(S,S+k))),y=C;else l.push(g)}return l},_.util.makePathSimpler=function(e){var t,i,n,r,a,o,l=0,c=0,h=e.length,u=0,f=0,d=[];for(i=0;i<h;++i){switch(n=!1,(t=e[i].slice(0))[0]){case"l":t[0]="L",t[1]+=l,t[2]+=c;case"L":l=t[1],c=t[2];break;case"h":t[1]+=l;case"H":t[0]="L",t[2]=c,l=t[1];break;case"v":t[1]+=c;case"V":t[0]="L",c=t[1],t[1]=l,t[2]=c;break;case"m":t[0]="M",t[1]+=l,t[2]+=c;case"M":l=t[1],c=t[2],u=t[1],f=t[2];break;case"c":t[0]="C",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c,t[5]+=l,t[6]+=c;case"C":a=t[3],o=t[4],l=t[5],c=t[6];break;case"s":t[0]="S",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c;case"S":"C"===r?(a=2*l-a,o=2*c-o):(a=l,o=c),l=t[3],c=t[4],t[0]="C",t[5]=t[3],t[6]=t[4],t[3]=t[1],t[4]=t[2],t[1]=a,t[2]=o,a=t[3],o=t[4];break;case"q":t[0]="Q",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c;case"Q":a=t[1],o=t[2],l=t[3],c=t[4];break;case"t":t[0]="T",t[1]+=l,t[2]+=c;case"T":"Q"===r?(a=2*l-a,o=2*c-o):(a=l,o=c),t[0]="Q",l=t[1],c=t[2],t[1]=a,t[2]=o,t[3]=l,t[4]=c;break;case"a":t[0]="A",t[6]+=l,t[7]+=c;case"A":n=!0,d=d.concat(s(l,c,t)),l=t[6],c=t[7];break;case"z":case"Z":l=u,c=f}n||d.push(t),r=t[0]}return d},_.util.getSmoothPathFromPoints=function(e,t){var i,n=[],r=new _.Point(e[0].x,e[0].y),a=new _.Point(e[1].x,e[1].y),o=e.length,s=1,l=0,c=o>2;for(t=t||0,c&&(s=e[2].x<a.x?-1:e[2].x===a.x?0:1,l=e[2].y<a.y?-1:e[2].y===a.y?0:1),n.push(["M",r.x-s*t,r.y-l*t]),i=1;i<o;i++){if(!r.eq(a)){var h=r.midPointFrom(a);n.push(["Q",r.x,r.y,h.x,h.y])}r=e[i],i+1<e.length&&(a=e[i+1])}return c&&(s=r.x>e[i-2].x?1:r.x===e[i-2].x?0:-1,l=r.y>e[i-2].y?1:r.y===e[i-2].y?0:-1),n.push(["L",r.x+s*t,r.y+l*t]),n},_.util.getPathSegmentsInfo=g,_.util.getBoundsOfCurve=o,_.util.getPointOnPath=function(e,t,i){i||(i=g(e));for(var n=0;t-i[n].length>0&&n<i.length-2;)t-=i[n].length,n++;var r,a=i[n],o=t/a.length,s=a.command,l=e[n];switch(s){case"M":return{x:a.x,y:a.y,angle:0};case"Z":case"z":return(r=new _.Point(a.x,a.y).lerp(new _.Point(a.destX,a.destY),o)).angle=Math.atan2(a.destY-a.y,a.destX-a.x),r;case"L":return(r=new _.Point(a.x,a.y).lerp(new _.Point(l[1],l[2]),o)).angle=Math.atan2(l[2]-a.y,l[1]-a.x),r;case"C":case"Q":return m(a,t)}},_.util.transformPath=function(e,t,i){return i&&(t=_.util.multiplyTransformMatrices(t,[1,0,0,1,-i.x,-i.y])),e.map((function(e){for(var i=e.slice(0),n={},r=1;r<e.length-1;r+=2)n.x=e[r],n.y=e[r+1],n=_.util.transformPoint(n,t),i[r]=n.x,i[r+1]=n.y;return i}))},_.util.fromArcToBeizers=s,_.util.getBoundsOfArc=function(e,t,i,n,a,s,l,c,h){for(var u,f=0,d=0,m=[],g=r(c-e,h-t,i,n,s,l,a),v=0,p=g.length;v<p;v++)u=o(f,d,g[v][1],g[v][2],g[v][3],g[v][4],g[v][5],g[v][6]),m.push({x:u[0].x+e,y:u[0].y+t}),m.push({x:u[1].x+e,y:u[1].y+t}),f=g[v][5],d=g[v][6];return m},_.util.drawArc=function(e,t,i,n){s(t,i,n=n.slice(0).unshift("X")).forEach((function(t){e.bezierCurveTo.apply(e,t.slice(1))}))}}(),function(){var e=Array.prototype.slice;function t(e,t,i){if(e&&0!==e.length){var n=e.length-1,r=t?e[n][t]:e[n];if(t)for(;n--;)i(e[n][t],r)&&(r=e[n][t]);else for(;n--;)i(e[n],r)&&(r=e[n]);return r}}_.util.array={fill:function(e,t){for(var i=e.length;i--;)e[i]=t;return e},invoke:function(t,i){for(var n=e.call(arguments,2),r=[],a=0,o=t.length;a<o;a++)r[a]=n.length?t[a][i].apply(t[a],n):t[a][i].call(t[a]);return r},min:function(e,i){return t(e,i,(function(e,t){return e<t}))},max:function(e,i){return t(e,i,(function(e,t){return e>=t}))}}}(),function(){function e(t,i,n){if(n)if(!_.isLikelyNode&&i instanceof Element)t=i;else if(i instanceof Array){t=[];for(var r=0,a=i.length;r<a;r++)t[r]=e({},i[r],n)}else if(i&&"object"==typeof i)for(var o in i)"canvas"===o||"group"===o?t[o]=null:i.hasOwnProperty(o)&&(t[o]=e({},i[o],n));else t=i;else for(var o in i)t[o]=i[o];return t}_.util.object={extend:e,clone:function(t,i){return e({},t,i)}},_.util.object.extend(_.util,_.Observable)}(),function(){function e(e,t){var i=e.charCodeAt(t);if(isNaN(i))return"";if(i<55296||i>57343)return e.charAt(t);if(55296<=i&&i<=56319){if(e.length<=t+1)throw"High surrogate without following low surrogate";var n=e.charCodeAt(t+1);if(56320>n||n>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 r=e.charCodeAt(t-1);if(55296>r||r>56319)throw"Low surrogate without preceding high surrogate";return!1}_.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,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},graphemeSplit:function(t){var i,n=0,r=[];for(n=0;n<t.length;n++)!1!==(i=e(t,n))&&r.push(i);return r}}}(),function(){var e=Array.prototype.slice,t=function(){},i=function(){for(var e in{toString:1})if("toString"===e)return!1;return!0}(),n=function(e,t,n){for(var r in t)r in e.prototype&&"function"==typeof e.prototype[r]&&(t[r]+"").indexOf("callSuper")>-1?e.prototype[r]=function(e){return function(){var i=this.constructor.superclass;this.constructor.superclass=n;var r=t[e].apply(this,arguments);if(this.constructor.superclass=i,"initialize"!==e)return r}}(r):e.prototype[r]=t[r],i&&(t.toString!==Object.prototype.toString&&(e.prototype.toString=t.toString),t.valueOf!==Object.prototype.valueOf&&(e.prototype.valueOf=t.valueOf))};function r(){}function a(t){for(var i=null,n=this;n.constructor.superclass;){var r=n.constructor.superclass.prototype[t];if(n[t]!==r){i=r;break}n=n.constructor.superclass.prototype}return i?arguments.length>1?i.apply(this,e.call(arguments,1)):i.call(this):console.log("tried to callSuper "+t+", method not found in prototype chain",this)}_.util.createClass=function(){var i=null,o=e.call(arguments,0);function s(){this.initialize.apply(this,arguments)}"function"==typeof o[0]&&(i=o.shift()),s.superclass=i,s.subclasses=[],i&&(r.prototype=i.prototype,s.prototype=new r,i.subclasses.push(s));for(var l=0,c=o.length;l<c;l++)n(s,o[l],i);return s.prototype.initialize||(s.prototype.initialize=t),s.prototype.constructor=s,s.prototype.callSuper=a,s}}(),c=!!_.document.createElement("div").attachEvent,h=["touchstart","touchmove","touchend"],_.util.addListener=function(e,t,i,n){e&&e.addEventListener(t,i,!c&&n)},_.util.removeListener=function(e,t,i,n){e&&e.removeEventListener(t,i,!c&&n)},_.util.getPointer=function(e){var t=e.target,i=_.util.getScrollLeftTop(t),n=function(e){var t=e.changedTouches;return t&&t[0]?t[0]:e}(e);return{x:n.clientX+i.left,y:n.clientY+i.top}},_.util.isTouchEvent=function(e){return h.indexOf(e.type)>-1||"touch"===e.pointerType},u=_.document.createElement("div"),f="string"==typeof u.style.opacity,d="string"==typeof u.style.filter,m=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,g=function(e){return e},f?g=function(e,t){return e.style.opacity=t,e}:d&&(g=function(e,t){var i=e.style;return e.currentStyle&&!e.currentStyle.hasLayout&&(i.zoom=1),m.test(i.filter)?(t=t>=.9999?"":"alpha(opacity="+100*t+")",i.filter=i.filter.replace(m,t)):i.filter+=" alpha(opacity="+100*t+")",e}),_.util.setStyle=function(e,t){var i=e.style;if(!i)return e;if("string"==typeof t)return e.style.cssText+=";"+t,t.indexOf("opacity")>-1?g(e,t.match(/opacity:\s*(\d?\.?\d*)/)[1]):e;for(var n in t)"opacity"===n?g(e,t[n]):i["float"===n||"cssFloat"===n?void 0===i.styleFloat?"cssFloat":"styleFloat":n]=t[n];return e},function(){var e=Array.prototype.slice;var t,i,n,r,a=function(t){return e.call(t,0)};try{t=a(_.document.childNodes)instanceof Array}catch(e){}function o(e,t){var i=_.document.createElement(e);for(var n in t)"class"===n?i.className=t[n]:"for"===n?i.htmlFor=t[n]:i.setAttribute(n,t[n]);return i}function s(e){for(var t=0,i=0,n=_.document.documentElement,r=_.document.body||{scrollLeft:0,scrollTop:0};e&&(e.parentNode||e.host)&&((e=e.parentNode||e.host)===_.document?(t=r.scrollLeft||n.scrollLeft||0,i=r.scrollTop||n.scrollTop||0):(t+=e.scrollLeft||0,i+=e.scrollTop||0),1!==e.nodeType||"fixed"!==e.style.position););return{left:t,top:i}}t||(a=function(e){for(var t=new Array(e.length),i=e.length;i--;)t[i]=e[i];return t}),i=_.document.defaultView&&_.document.defaultView.getComputedStyle?function(e,t){var i=_.document.defaultView.getComputedStyle(e,null);return i?i[t]:void 0}:function(e,t){var i=e.style[t];return!i&&e.currentStyle&&(i=e.currentStyle[t]),i},n=_.document.documentElement.style,r="userSelect"in n?"userSelect":"MozUserSelect"in n?"MozUserSelect":"WebkitUserSelect"in n?"WebkitUserSelect":"KhtmlUserSelect"in n?"KhtmlUserSelect":"",_.util.makeElementUnselectable=function(e){return void 0!==e.onselectstart&&(e.onselectstart=_.util.falseFunction),r?e.style[r]="none":"string"==typeof e.unselectable&&(e.unselectable="on"),e},_.util.makeElementSelectable=function(e){return void 0!==e.onselectstart&&(e.onselectstart=null),r?e.style[r]="":"string"==typeof e.unselectable&&(e.unselectable=""),e},_.util.setImageSmoothing=function(e,t){e.imageSmoothingEnabled=e.imageSmoothingEnabled||e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled||e.oImageSmoothingEnabled,e.imageSmoothingEnabled=t},_.util.getById=function(e){return"string"==typeof e?_.document.getElementById(e):e},_.util.toArray=a,_.util.addClass=function(e,t){e&&-1===(" "+e.className+" ").indexOf(" "+t+" ")&&(e.className+=(e.className?" ":"")+t)},_.util.makeElement=o,_.util.wrapElement=function(e,t,i){return"string"==typeof t&&(t=o(t,i)),e.parentNode&&e.parentNode.replaceChild(t,e),t.appendChild(e),t},_.util.getScrollLeftTop=s,_.util.getElementOffset=function(e){var t,n,r=e&&e.ownerDocument,a={left:0,top:0},o={left:0,top:0},l={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!r)return o;for(var c in l)o[l[c]]+=parseInt(i(e,c),10)||0;return t=r.documentElement,void 0!==e.getBoundingClientRect&&(a=e.getBoundingClientRect()),n=s(e),{left:a.left+n.left-(t.clientLeft||0)+o.left,top:a.top+n.top-(t.clientTop||0)+o.top}},_.util.getNodeCanvas=function(e){var t=_.jsdomImplForWrapper(e);return t._canvas||t._image},_.util.cleanUpJsdomNode=function(e){if(_.isLikelyNode){var t=_.jsdomImplForWrapper(e);t&&(t._image=null,t._canvas=null,t._currentSrc=null,t._attributes=null,t._classList=null)}}}(),function(){function e(){}_.util.request=function(t,i){i||(i={});var n=i.method?i.method.toUpperCase():"GET",r=i.onComplete||function(){},a=new _.window.XMLHttpRequest,o=i.body||i.parameters;return a.onreadystatechange=function(){4===a.readyState&&(r(a),a.onreadystatechange=e)},"GET"===n&&(o=null,"string"==typeof i.parameters&&(t=function(e,t){return e+(/\?/.test(e)?"&":"?")+t}(t,i.parameters))),a.open(n,t,!0),"POST"!==n&&"PUT"!==n||a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.send(o),a}}(),_.log=console.log,_.warn=console.warn,function(){function e(){return!1}function t(e,t,i,n){return-i*Math.cos(e/n*(Math.PI/2))+i+t}var i=_.window.requestAnimationFrame||_.window.webkitRequestAnimationFrame||_.window.mozRequestAnimationFrame||_.window.oRequestAnimationFrame||_.window.msRequestAnimationFrame||function(e){return _.window.setTimeout(e,1e3/60)},n=_.window.cancelAnimationFrame||_.window.clearTimeout;function r(){return i.apply(_.window,arguments)}_.util.animate=function(i){var n=!1;return r((function(a){i||(i={});var o,s=a||+new Date,l=i.duration||500,c=s+l,h=i.onChange||e,u=i.abort||e,f=i.onComplete||e,d=i.easing||t,m="startValue"in i?i.startValue:0,g="endValue"in i?i.endValue:100,v=i.byValue||g-m;i.onStart&&i.onStart(),function e(t){var i=(o=t||+new Date)>c?l:o-s,a=i/l,p=d(i,m,v,l),y=Math.abs((p-m)/v);if(!n){if(!u(p,y,a))return o>c?(h(g,1,1),void f(g,1,1)):(h(p,y,a),void r(e));f(g,1,1)}}(s)})),function(){n=!0}},_.util.requestAnimFrame=r,_.util.cancelAnimFrame=function(){return n.apply(_.window,arguments)}}(),function(){function e(e,t,i){var n="rgba("+parseInt(e[0]+i*(t[0]-e[0]),10)+","+parseInt(e[1]+i*(t[1]-e[1]),10)+","+parseInt(e[2]+i*(t[2]-e[2]),10);return n+=","+(e&&t?parseFloat(e[3]+i*(t[3]-e[3])):1),n+=")"}_.util.animateColor=function(t,i,n,r){var a=new _.Color(t).getSource(),o=new _.Color(i).getSource(),s=r.onComplete,l=r.onChange;return r=r||{},_.util.animate(_.util.object.extend(r,{duration:n||500,startValue:a,endValue:o,byValue:o,easing:function(t,i,n,a){return e(i,n,r.colorEasing?r.colorEasing(t,a):1-Math.cos(t/a*(Math.PI/2)))},onComplete:function(t,i,n){if(s)return s(e(o,o,0),i,n)},onChange:function(t,i,n){if(l){if(Array.isArray(t))return l(e(t,t,0),i,n);l(t,i,n)}}}))}}(),function(){function e(e,t,i,n){return e<Math.abs(t)?(e=t,n=i/4):n=0===t&&0===e?i/(2*Math.PI)*Math.asin(1):i/(2*Math.PI)*Math.asin(t/e),{a:e,c:t,p:i,s:n}}function t(e,t,i){return e.a*Math.pow(2,10*(t-=1))*Math.sin((t*i-e.s)*(2*Math.PI)/e.p)}function i(e,t,i,r){return i-n(r-e,0,i,r)+t}function n(e,t,i,n){return(e/=n)<1/2.75?i*(7.5625*e*e)+t:e<2/2.75?i*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?i*(7.5625*(e-=2.25/2.75)*e+.9375)+t:i*(7.5625*(e-=2.625/2.75)*e+.984375)+t}_.util.ease={easeInQuad:function(e,t,i,n){return i*(e/=n)*e+t},easeOutQuad:function(e,t,i,n){return-i*(e/=n)*(e-2)+t},easeInOutQuad:function(e,t,i,n){return(e/=n/2)<1?i/2*e*e+t:-i/2*(--e*(e-2)-1)+t},easeInCubic:function(e,t,i,n){return i*(e/=n)*e*e+t},easeOutCubic:function(e,t,i,n){return i*((e=e/n-1)*e*e+1)+t},easeInOutCubic:function(e,t,i,n){return(e/=n/2)<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t},easeInQuart:function(e,t,i,n){return i*(e/=n)*e*e*e+t},easeOutQuart:function(e,t,i,n){return-i*((e=e/n-1)*e*e*e-1)+t},easeInOutQuart:function(e,t,i,n){return(e/=n/2)<1?i/2*e*e*e*e+t:-i/2*((e-=2)*e*e*e-2)+t},easeInQuint:function(e,t,i,n){return i*(e/=n)*e*e*e*e+t},easeOutQuint:function(e,t,i,n){return i*((e=e/n-1)*e*e*e*e+1)+t},easeInOutQuint:function(e,t,i,n){return(e/=n/2)<1?i/2*e*e*e*e*e+t:i/2*((e-=2)*e*e*e*e+2)+t},easeInSine:function(e,t,i,n){return-i*Math.cos(e/n*(Math.PI/2))+i+t},easeOutSine:function(e,t,i,n){return i*Math.sin(e/n*(Math.PI/2))+t},easeInOutSine:function(e,t,i,n){return-i/2*(Math.cos(Math.PI*e/n)-1)+t},easeInExpo:function(e,t,i,n){return 0===e?t:i*Math.pow(2,10*(e/n-1))+t},easeOutExpo:function(e,t,i,n){return e===n?t+i:i*(1-Math.pow(2,-10*e/n))+t},easeInOutExpo:function(e,t,i,n){return 0===e?t:e===n?t+i:(e/=n/2)<1?i/2*Math.pow(2,10*(e-1))+t:i/2*(2-Math.pow(2,-10*--e))+t},easeInCirc:function(e,t,i,n){return-i*(Math.sqrt(1-(e/=n)*e)-1)+t},easeOutCirc:function(e,t,i,n){return i*Math.sqrt(1-(e=e/n-1)*e)+t},easeInOutCirc:function(e,t,i,n){return(e/=n/2)<1?-i/2*(Math.sqrt(1-e*e)-1)+t:i/2*(Math.sqrt(1-(e-=2)*e)+1)+t},easeInElastic:function(i,n,r,a){var o=0;return 0===i?n:1===(i/=a)?n+r:(o||(o=.3*a),-t(e(r,r,o,1.70158),i,a)+n)},easeOutElastic:function(t,i,n,r){var a=0;if(0===t)return i;if(1===(t/=r))return i+n;a||(a=.3*r);var o=e(n,n,a,1.70158);return o.a*Math.pow(2,-10*t)*Math.sin((t*r-o.s)*(2*Math.PI)/o.p)+o.c+i},easeInOutElastic:function(i,n,r,a){var o=0;if(0===i)return n;if(2===(i/=a/2))return n+r;o||(o=a*(.3*1.5));var s=e(r,r,o,1.70158);return i<1?-.5*t(s,i,a)+n:s.a*Math.pow(2,-10*(i-=1))*Math.sin((i*a-s.s)*(2*Math.PI)/s.p)*.5+s.c+n},easeInBack:function(e,t,i,n,r){return void 0===r&&(r=1.70158),i*(e/=n)*e*((r+1)*e-r)+t},easeOutBack:function(e,t,i,n,r){return void 0===r&&(r=1.70158),i*((e=e/n-1)*e*((r+1)*e+r)+1)+t},easeInOutBack:function(e,t,i,n,r){return void 0===r&&(r=1.70158),(e/=n/2)<1?i/2*(e*e*((1+(r*=1.525))*e-r))+t:i/2*((e-=2)*e*((1+(r*=1.525))*e+r)+2)+t},easeInBounce:i,easeOutBounce:n,easeInOutBounce:function(e,t,r,a){return e<a/2?.5*i(2*e,0,r,a)+t:.5*n(2*e-a,0,r,a)+.5*r+t}}}(),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend,n=t.util.object.clone,r=t.util.toFixed,a=t.util.parseUnit,o=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"},l={stroke:"strokeOpacity",fill:"fillOpacity"};function c(e){return e in s?s[e]:e}function h(e,i,n,r){var s,l="[object Array]"===Object.prototype.toString.call(i);if("fill"!==e&&"stroke"!==e||"none"!==i){if("strokeUniform"===e)return"non-scaling-stroke"===i;if("strokeDashArray"===e)i="none"===i?null:i.replace(/,/g," ").split(/\s+/).map(parseFloat);else if("transformMatrix"===e)i=n&&n.transformMatrix?o(n.transformMatrix,t.parseTransformAttribute(i)):t.parseTransformAttribute(i);else if("visible"===e)i="none"!==i&&"hidden"!==i,n&&!1===n.visible&&(i=!1);else if("opacity"===e)i=parseFloat(i),n&&void 0!==n.opacity&&(i*=n.opacity);else if("textAnchor"===e)i="start"===i?"left":"end"===i?"right":"center";else if("charSpacing"===e)s=a(i,r)/r*1e3;else if("paintFirst"===e){var c=i.indexOf("fill"),h=i.indexOf("stroke");i="fill";(c>-1&&h>-1&&h<c||-1===c&&h>-1)&&(i="stroke")}else{if("href"===e||"xlink:href"===e||"font"===e)return i;if("imageSmoothing"===e)return"optimizeQuality"===i;s=l?i.map(a):a(i,r)}}else i="";return!l&&isNaN(s)?i:s}function u(e){return new RegExp("^("+e.join("|")+")\\b","i")}function f(e,t){var i,n,r,a,o=[];for(r=0,a=t.length;r<a;r++)i=t[r],n=e.getElementsByTagName(i),o=o.concat(Array.prototype.slice.call(n));return o}function d(e,t){var i,n=!0;return(i=m(e,t.pop()))&&t.length&&(n=function(e,t){var i,n=!0;for(;e.parentNode&&1===e.parentNode.nodeType&&t.length;)n&&(i=t.pop()),e=e.parentNode,n=m(e,i);return 0===t.length}(e,t)),i&&n&&0===t.length}function m(e,t){var i,n,r=e.nodeName,a=e.getAttribute("class"),o=e.getAttribute("id");if(i=new RegExp("^"+r,"i"),t=t.replace(i,""),o&&t.length&&(i=new RegExp("#"+o+"(?![a-zA-Z\\-]+)","i"),t=t.replace(i,"")),a&&t.length)for(n=(a=a.split(" ")).length;n--;)i=new RegExp("\\."+a[n]+"(?![a-zA-Z\\-]+)","i"),t=t.replace(i,"");return 0===t.length}function g(e,t){var i;if(e.getElementById&&(i=e.getElementById(t)),i)return i;var n,r,a,o=e.getElementsByTagName("*");for(r=0,a=o.length;r<a;r++)if(t===(n=o[r]).getAttribute("id"))return n}t.svgValidTagNamesRegEx=u(["path","circle","polygon","polyline","ellipse","rect","line","image","text"]),t.svgViewBoxElementsRegEx=u(["symbol","image","marker","pattern","view","svg"]),t.svgInvalidAncestorsRegEx=u(["pattern","defs","symbol","metadata","clipPath","mask","desc"]),t.svgValidParentsRegEx=u(["symbol","g","a","svg","clipPath","defs"]),t.cssRules={},t.gradientDefs={},t.clipPaths={},t.parseTransformAttribute=function(){function e(e,i,n){e[n]=Math.tan(t.util.degreesToRadians(i[0]))}var i=t.iMatrix,n=t.reNum,r=t.commaWsp,a="(?:"+("(?:(matrix)\\s*\\(\\s*("+n+")"+r+"("+n+")"+r+"("+n+")"+r+"("+n+")"+r+"("+n+")"+r+"("+n+")\\s*\\))")+"|"+("(?:(translate)\\s*\\(\\s*("+n+")(?:"+r+"("+n+"))?\\s*\\))")+"|"+("(?:(scale)\\s*\\(\\s*("+n+")(?:"+r+"("+n+"))?\\s*\\))")+"|"+("(?:(rotate)\\s*\\(\\s*("+n+")(?:"+r+"("+n+")"+r+"("+n+"))?\\s*\\))")+"|"+("(?:(skewX)\\s*\\(\\s*("+n+")\\s*\\))")+"|"+("(?:(skewY)\\s*\\(\\s*("+n+")\\s*\\))")+")",o=new RegExp("^\\s*(?:"+("(?:"+a+"(?:"+r+"*"+a+")*)")+"?)\\s*$"),s=new RegExp(a,"g");return function(n){var r=i.concat(),l=[];if(!n||n&&!o.test(n))return r;n.replace(s,(function(n){var o=new RegExp(a).exec(n).filter((function(e){return!!e})),s=o[1],c=o.slice(2).map(parseFloat);switch(s){case"translate":!function(e,t){e[4]=t[0],2===t.length&&(e[5]=t[1])}(r,c);break;case"rotate":c[0]=t.util.degreesToRadians(c[0]),function(e,i){var n=t.util.cos(i[0]),r=t.util.sin(i[0]),a=0,o=0;3===i.length&&(a=i[1],o=i[2]),e[0]=n,e[1]=r,e[2]=-r,e[3]=n,e[4]=a-(n*a-r*o),e[5]=o-(r*a+n*o)}(r,c);break;case"scale":!function(e,t){var i=t[0],n=2===t.length?t[1]:t[0];e[0]=i,e[3]=n}(r,c);break;case"skewX":e(r,c,2);break;case"skewY":e(r,c,1);break;case"matrix":r=c}l.push(r.concat()),r=i.concat()}));for(var c=l[0];l.length>1;)l.shift(),c=t.util.multiplyTransformMatrices(c,l[0]);return c}}();var v=new RegExp("^\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*$");function p(e){if(!t.svgViewBoxElementsRegEx.test(e.nodeName))return{};var i,n,r,o,s,l,c=e.getAttribute("viewBox"),h=1,u=1,f=e.getAttribute("width"),d=e.getAttribute("height"),m=e.getAttribute("x")||0,g=e.getAttribute("y")||0,p=e.getAttribute("preserveAspectRatio")||"",y=!c||!(c=c.match(v)),b=!f||!d||"100%"===f||"100%"===d,w=y&&b,x={},k="",C=0,S=0;if(x.width=0,x.height=0,x.toBeParsed=w,y&&(m||g)&&e.parentNode&&"#document"!==e.parentNode.nodeName&&(k=" translate("+a(m)+" "+a(g)+") ",s=(e.getAttribute("transform")||"")+k,e.setAttribute("transform",s),e.removeAttribute("x"),e.removeAttribute("y")),w)return x;if(y)return x.width=a(f),x.height=a(d),x;if(i=-parseFloat(c[1]),n=-parseFloat(c[2]),r=parseFloat(c[3]),o=parseFloat(c[4]),x.minX=i,x.minY=n,x.viewBoxWidth=r,x.viewBoxHeight=o,b?(x.width=r,x.height=o):(x.width=a(f),x.height=a(d),h=x.width/r,u=x.height/o),"none"!==(p=t.util.parsePreserveAspectRatioAttribute(p)).alignX&&("meet"===p.meetOrSlice&&(u=h=h>u?u:h),"slice"===p.meetOrSlice&&(u=h=h>u?h:u),C=x.width-r*h,S=x.height-o*h,"Mid"===p.alignX&&(C/=2),"Mid"===p.alignY&&(S/=2),"Min"===p.alignX&&(C=0),"Min"===p.alignY&&(S=0)),1===h&&1===u&&0===i&&0===n&&0===m&&0===g)return x;if((m||g)&&"#document"!==e.parentNode.nodeName&&(k=" translate("+a(m)+" "+a(g)+") "),s=k+" matrix("+h+" 0 0 "+u+" "+(i*h+C)+" "+(n*u+S)+") ","svg"===e.nodeName){for(l=e.ownerDocument.createElementNS(t.svgNS,"g");e.firstChild;)l.appendChild(e.firstChild);e.appendChild(l)}else(l=e).removeAttribute("x"),l.removeAttribute("y"),s=l.getAttribute("transform")+s;return l.setAttribute("transform",s),x}function y(e,t){var i=g(e,t.getAttribute("xlink:href").substr(1));if(i&&i.getAttribute("xlink:href")&&y(e,i),["gradientTransform","x1","x2","y1","y2","gradientUnits","cx","cy","r","fx","fy"].forEach((function(e){i&&!t.hasAttribute(e)&&i.hasAttribute(e)&&t.setAttribute(e,i.getAttribute(e))})),!t.children.length)for(var n=i.cloneNode(!0);n.firstChild;)t.appendChild(n.firstChild);t.removeAttribute("xlink:href")}t.parseSVGDocument=function(e,i,r,a){if(e){!function(e){for(var i=f(e,["use","svg:use"]),n=0;i.length&&n<i.length;){var r=i[n],a=r.getAttribute("xlink:href")||r.getAttribute("href");if(null===a)return;var o,s,l,c,h=a.substr(1),u=r.getAttribute("x")||0,d=r.getAttribute("y")||0,m=g(e,h).cloneNode(!0),v=(m.getAttribute("transform")||"")+" translate("+u+", "+d+")",y=i.length,b=t.svgNS;if(p(m),/^svg$/i.test(m.nodeName)){var w=m.ownerDocument.createElementNS(b,"g");for(s=0,c=(l=m.attributes).length;s<c;s++)o=l.item(s),w.setAttributeNS(b,o.nodeName,o.nodeValue);for(;m.firstChild;)w.appendChild(m.firstChild);m=w}for(s=0,c=(l=r.attributes).length;s<c;s++)"x"!==(o=l.item(s)).nodeName&&"y"!==o.nodeName&&"xlink:href"!==o.nodeName&&"href"!==o.nodeName&&("transform"===o.nodeName?v=o.nodeValue+" "+v:m.setAttribute(o.nodeName,o.nodeValue));m.setAttribute("transform",v),m.setAttribute("instantiated_by_use","1"),m.removeAttribute("id"),r.parentNode.replaceChild(m,r),i.length===y&&n++}}(e);var o,s,l=t.Object.__uid++,c=p(e),h=t.util.toArray(e.getElementsByTagName("*"));if(c.crossOrigin=a&&a.crossOrigin,c.svgUid=l,0===h.length&&t.isLikelyNode){var u=[];for(o=0,s=(h=e.selectNodes('//*[name(.)!="svg"]')).length;o<s;o++)u[o]=h[o];h=u}var d=h.filter((function(e){return p(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(!d||d&&!d.length)i&&i([],{});else{var m={};h.filter((function(e){return"clipPath"===e.nodeName.replace("svg:","")})).forEach((function(e){var i=e.getAttribute("id");m[i]=t.util.toArray(e.getElementsByTagName("*")).filter((function(e){return t.svgValidTagNamesRegEx.test(e.nodeName.replace("svg:",""))}))})),t.gradientDefs[l]=t.getGradientDefs(e),t.cssRules[l]=t.getCSSRules(e),t.clipPaths[l]=m,t.parseElements(d,(function(e,n){i&&(i(e,c,n,h),delete t.gradientDefs[l],delete t.cssRules[l],delete t.clipPaths[l])}),n(c),r,a)}}};var b=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+(.*)");i(t,{parseFontDeclaration:function(e,t){var i=e.match(b);if(i){var n=i[1],r=i[3],o=i[4],s=i[5],l=i[6];n&&(t.fontStyle=n),r&&(t.fontWeight=isNaN(parseFloat(r))?r:parseFloat(r)),o&&(t.fontSize=a(o)),l&&(t.fontFamily=l),s&&(t.lineHeight="normal"===s?1:s)}},getGradientDefs:function(e){var t,i=f(e,["linearGradient","radialGradient","svg:linearGradient","svg:radialGradient"]),n=0,r={};for(n=i.length;n--;)(t=i[n]).getAttribute("xlink:href")&&y(e,t),r[t.getAttribute("id")]=t;return r},parseAttributes:function(e,n,o){if(e){var s,u,f,m={};void 0===o&&(o=e.getAttribute("svgUid")),e.parentNode&&t.svgValidParentsRegEx.test(e.parentNode.nodeName)&&(m=t.parseAttributes(e.parentNode,n,o));var g=n.reduce((function(t,i){return(s=e.getAttribute(i))&&(t[i]=s),t}),{}),v=i(function(e,i){var n={};for(var r in t.cssRules[i])if(d(e,r.split(" ")))for(var a in t.cssRules[i][r])n[a]=t.cssRules[i][r][a];return n}(e,o),t.parseStyleAttribute(e));g=i(g,v),v["clip-path"]&&e.setAttribute("clip-path",v["clip-path"]),u=f=m.fontSize||t.Text.DEFAULT_SVG_FONT_SIZE,g["font-size"]&&(g["font-size"]=u=a(g["font-size"],f));var p,y,b={};for(var w in g)y=h(p=c(w),g[w],m,u),b[p]=y;b&&b.font&&t.parseFontDeclaration(b.font,b);var x=i(m,b);return t.svgValidParentsRegEx.test(e.nodeName)?x:function(e){for(var i in l)if(void 0!==e[l[i]]&&""!==e[i]){if(void 0===e[i]){if(!t.Object.prototype[i])continue;e[i]=t.Object.prototype[i]}if(0!==e[i].indexOf("url(")){var n=new t.Color(e[i]);e[i]=n.setAlpha(r(n.getAlpha()*e[l[i]],2)).toRgba()}}return e}(x)}},parseElements:function(e,i,n,r,a){new t.ElementsParser(e,i,n,r,a).parse()},parseStyleAttribute:function(e){var t={},i=e.getAttribute("style");return i?("string"==typeof i?function(e,t){var i,n;e.replace(/;\s*$/,"").split(";").forEach((function(e){var r=e.split(":");i=r[0].trim().toLowerCase(),n=r[1].trim(),t[i]=n}))}(i,t):function(e,t){var i,n;for(var r in e)void 0!==e[r]&&(i=r.toLowerCase(),n=e[r],t[i]=n)}(i,t),t):t},parsePointsAttribute:function(e){if(!e)return null;var t,i,n=[];for(t=0,i=(e=(e=e.replace(/,/g," ").trim()).split(/\s+/)).length;t<i;t+=2)n.push({x:parseFloat(e[t]),y:parseFloat(e[t+1])});return n},getCSSRules:function(e){var i,n,r=e.getElementsByTagName("style"),a={};for(i=0,n=r.length;i<n;i++){var o=r[i].textContent;""!==(o=o.replace(/\/\*[\s\S]*?\*\//g,"")).trim()&&o.match(/[^{]*\{[\s\S]*?\}/g).map((function(e){return e.trim()})).forEach((function(e){var r=e.match(/([\s\S]*?)\s*\{([^}]*)\}/),o={},s=r[2].trim().replace(/;$/,"").split(/\s*;\s*/);for(i=0,n=s.length;i<n;i++){var l=s[i].split(/\s*:\s*/),c=l[0],h=l[1];o[c]=h}(e=r[1]).split(",").forEach((function(e){""!==(e=e.replace(/^svg/i,"").trim())&&(a[e]?t.util.object.extend(a[e],o):a[e]=t.util.object.clone(o))}))}))}return a},loadSVGFromURL:function(e,i,n,r){e=e.replace(/^\n\s*/,"").trim(),new t.util.request(e,{method:"get",onComplete:function(e){var a=e.responseXML;if(!a||!a.documentElement)return i&&i(null),!1;t.parseSVGDocument(a.documentElement,(function(e,t,n,r){i&&i(e,t,n,r)}),n,r)}})},loadSVGFromString:function(e,i,n,r){var a=(new t.window.DOMParser).parseFromString(e.trim(),"text/xml");t.parseSVGDocument(a.documentElement,(function(e,t,n,r){i(e,t,n,r)}),n,r)}})}(t),_.ElementsParser=function(e,t,i,n,r,a){this.elements=e,this.callback=t,this.options=i,this.reviver=n,this.svgUid=i&&i.svgUid||0,this.parsingOptions=r,this.regexUrl=/^url\(['"]?#([^'"]+)['"]?\)/g,this.doc=a},(v=_.ElementsParser.prototype).parse=function(){this.instances=new Array(this.elements.length),this.numElements=this.elements.length,this.createObjects()},v.createObjects=function(){var e=this;this.elements.forEach((function(t,i){t.setAttribute("svgUid",e.svgUid),e.createObject(t,i)}))},v.findTag=function(e){return _[_.util.string.capitalize(e.tagName.replace("svg:",""))]},v.createObject=function(e,t){var i=this.findTag(e);if(i&&i.fromElement)try{i.fromElement(e,this.createCallback(t,e),this.options)}catch(e){_.log(e)}else this.checkIfDone()},v.createCallback=function(e,t){var i=this;return function(n){var r;i.resolveGradient(n,t,"fill"),i.resolveGradient(n,t,"stroke"),n instanceof _.Image&&n._originalElement&&(r=n.parsePreserveAspectRatioAttribute(t)),n._removeTransformMatrix(r),i.resolveClipPath(n,t),i.reviver&&i.reviver(t,n),i.instances[e]=n,i.checkIfDone()}},v.extractPropertyDefinition=function(e,t,i){var n=e[t],r=this.regexUrl;if(r.test(n)){r.lastIndex=0;var a=r.exec(n)[1];return r.lastIndex=0,_[i][this.svgUid][a]}},v.resolveGradient=function(e,t,i){var n=this.extractPropertyDefinition(e,i,"gradientDefs");if(n){var r=t.getAttribute(i+"-opacity"),a=_.Gradient.fromElement(n,e,r,this.options);e.set(i,a)}},v.createClipPathCallback=function(e,t){return function(e){e._removeTransformMatrix(),e.fillRule=e.clipRule,t.push(e)}},v.resolveClipPath=function(e,t){var i,n,r,a,o=this.extractPropertyDefinition(e,"clipPath","clipPaths");if(o){r=[],n=_.util.invertTransform(e.calcTransformMatrix());for(var s=o[0].parentNode,l=t;l.parentNode&&l.getAttribute("clip-path")!==e.clipPath;)l=l.parentNode;l.parentNode.appendChild(s);for(var c=0;c<o.length;c++)i=o[c],this.findTag(i).fromElement(i,this.createClipPathCallback(e,r),this.options);o=1===r.length?r[0]:new _.Group(r),a=_.util.multiplyTransformMatrices(n,o.calcTransformMatrix()),o.clipPath&&this.resolveClipPath(o,l);var h=_.util.qrDecompose(a);o.flipX=!1,o.flipY=!1,o.set("scaleX",h.scaleX),o.set("scaleY",h.scaleY),o.angle=h.angle,o.skewX=h.skewX,o.skewY=0,o.setPositionByOrigin({x:h.translateX,y:h.translateY},"center","center"),e.clipPath=o}else delete e.clipPath},v.checkIfDone=function(){0==--this.numElements&&(this.instances=this.instances.filter((function(e){return null!=e})),this.callback(this.instances,this.elements))},function(e){"use strict";var t=e.fabric||(e.fabric={});function i(e,t){this.x=e,this.y=t}t.Point?t.warn("fabric.Point is already defined"):(t.Point=i,i.prototype={type:"point",constructor:i,add:function(e){return new i(this.x+e.x,this.y+e.y)},addEquals:function(e){return this.x+=e.x,this.y+=e.y,this},scalarAdd:function(e){return new i(this.x+e,this.y+e)},scalarAddEquals:function(e){return this.x+=e,this.y+=e,this},subtract:function(e){return new i(this.x-e.x,this.y-e.y)},subtractEquals:function(e){return this.x-=e.x,this.y-=e.y,this},scalarSubtract:function(e){return new i(this.x-e,this.y-e)},scalarSubtractEquals:function(e){return this.x-=e,this.y-=e,this},multiply:function(e){return new i(this.x*e,this.y*e)},multiplyEquals:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return new i(this.x/e,this.y/e)},divideEquals:function(e){return this.x/=e,this.y/=e,this},eq:function(e){return this.x===e.x&&this.y===e.y},lt:function(e){return this.x<e.x&&this.y<e.y},lte:function(e){return this.x<=e.x&&this.y<=e.y},gt:function(e){return this.x>e.x&&this.y>e.y},gte:function(e){return this.x>=e.x&&this.y>=e.y},lerp:function(e,t){return void 0===t&&(t=.5),t=Math.max(Math.min(1,t),0),new i(this.x+(e.x-this.x)*t,this.y+(e.y-this.y)*t)},distanceFrom:function(e){var t=this.x-e.x,i=this.y-e.y;return Math.sqrt(t*t+i*i)},midPointFrom:function(e){return this.lerp(e)},min:function(e){return new i(Math.min(this.x,e.x),Math.min(this.y,e.y))},max:function(e){return new i(Math.max(this.x,e.x),Math.max(this.y,e.y))},toString:function(){return this.x+","+this.y},setXY:function(e,t){return this.x=e,this.y=t,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setFromPoint:function(e){return this.x=e.x,this.y=e.y,this},swap:function(e){var t=this.x,i=this.y;this.x=e.x,this.y=e.y,e.x=t,e.y=i},clone:function(){return new i(this.x,this.y)}})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});function i(e){this.status=e,this.points=[]}t.Intersection?t.warn("fabric.Intersection is already defined"):(t.Intersection=i,t.Intersection.prototype={constructor:i,appendPoint:function(e){return this.points.push(e),this},appendPoints:function(e){return this.points=this.points.concat(e),this}},t.Intersection.intersectLineLine=function(e,n,r,a){var o,s=(a.x-r.x)*(e.y-r.y)-(a.y-r.y)*(e.x-r.x),l=(n.x-e.x)*(e.y-r.y)-(n.y-e.y)*(e.x-r.x),c=(a.y-r.y)*(n.x-e.x)-(a.x-r.x)*(n.y-e.y);if(0!==c){var h=s/c,u=l/c;0<=h&&h<=1&&0<=u&&u<=1?(o=new i("Intersection")).appendPoint(new t.Point(e.x+h*(n.x-e.x),e.y+h*(n.y-e.y))):o=new i}else o=new i(0===s||0===l?"Coincident":"Parallel");return o},t.Intersection.intersectLinePolygon=function(e,t,n){var r,a,o,s,l=new i,c=n.length;for(s=0;s<c;s++)r=n[s],a=n[(s+1)%c],o=i.intersectLineLine(e,t,r,a),l.appendPoints(o.points);return l.points.length>0&&(l.status="Intersection"),l},t.Intersection.intersectPolygonPolygon=function(e,t){var n,r=new i,a=e.length;for(n=0;n<a;n++){var o=e[n],s=e[(n+1)%a],l=i.intersectLinePolygon(o,s,t);r.appendPoints(l.points)}return r.points.length>0&&(r.status="Intersection"),r},t.Intersection.intersectPolygonRectangle=function(e,n,r){var a=n.min(r),o=n.max(r),s=new t.Point(o.x,a.y),l=new t.Point(a.x,o.y),c=i.intersectLinePolygon(a,s,e),h=i.intersectLinePolygon(s,o,e),u=i.intersectLinePolygon(o,l,e),f=i.intersectLinePolygon(l,a,e),d=new i;return d.appendPoints(c.points),d.appendPoints(h.points),d.appendPoints(u.points),d.appendPoints(f.points),d.points.length>0&&(d.status="Intersection"),d})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});function i(e){e?this._tryParsingColor(e):this.setSource([0,0,0,1])}function n(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}t.Color?t.warn("fabric.Color is already defined."):(t.Color=i,t.Color.prototype={_tryParsingColor:function(e){var t;e in i.colorNameMap&&(e=i.colorNameMap[e]),"transparent"===e&&(t=[255,255,255,0]),t||(t=i.sourceFromHex(e)),t||(t=i.sourceFromRgb(e)),t||(t=i.sourceFromHsl(e)),t||(t=[0,0,0,1]),t&&this.setSource(t)},_rgbToHsl:function(e,i,n){e/=255,i/=255,n/=255;var r,a,o,s=t.util.array.max([e,i,n]),l=t.util.array.min([e,i,n]);if(o=(s+l)/2,s===l)r=a=0;else{var c=s-l;switch(a=o>.5?c/(2-s-l):c/(s+l),s){case e:r=(i-n)/c+(i<n?6:0);break;case i:r=(n-e)/c+2;break;case n:r=(e-i)/c+4}r/=6}return[Math.round(360*r),Math.round(100*a),Math.round(100*o)]},getSource:function(){return this._source},setSource:function(e){this._source=e},toRgb:function(){var e=this.getSource();return"rgb("+e[0]+","+e[1]+","+e[2]+")"},toRgba:function(){var e=this.getSource();return"rgba("+e[0]+","+e[1]+","+e[2]+","+e[3]+")"},toHsl:function(){var e=this.getSource(),t=this._rgbToHsl(e[0],e[1],e[2]);return"hsl("+t[0]+","+t[1]+"%,"+t[2]+"%)"},toHsla:function(){var e=this.getSource(),t=this._rgbToHsl(e[0],e[1],e[2]);return"hsla("+t[0]+","+t[1]+"%,"+t[2]+"%,"+e[3]+")"},toHex:function(){var e,t,i,n=this.getSource();return e=1===(e=n[0].toString(16)).length?"0"+e:e,t=1===(t=n[1].toString(16)).length?"0"+t:t,i=1===(i=n[2].toString(16)).length?"0"+i:i,e.toUpperCase()+t.toUpperCase()+i.toUpperCase()},toHexa:function(){var e,t=this.getSource();return e=1===(e=(e=Math.round(255*t[3])).toString(16)).length?"0"+e:e,this.toHex()+e.toUpperCase()},getAlpha:function(){return this.getSource()[3]},setAlpha:function(e){var t=this.getSource();return t[3]=e,this.setSource(t),this},toGrayscale:function(){var e=this.getSource(),t=parseInt((.3*e[0]+.59*e[1]+.11*e[2]).toFixed(0),10),i=e[3];return this.setSource([t,t,t,i]),this},toBlackWhite:function(e){var t=this.getSource(),i=(.3*t[0]+.59*t[1]+.11*t[2]).toFixed(0),n=t[3];return e=e||127,i=Number(i)<Number(e)?0:255,this.setSource([i,i,i,n]),this},overlayWith:function(e){e instanceof i||(e=new i(e));var t,n=[],r=this.getAlpha(),a=this.getSource(),o=e.getSource();for(t=0;t<3;t++)n.push(Math.round(.5*a[t]+.5*o[t]));return n[3]=r,this.setSource(n),this}},t.Color.reRGBa=/^rgba?\(\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*(?:\s*,\s*((?:\d*\.?\d+)?)\s*)?\)$/i,t.Color.reHSLa=/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i,t.Color.reHex=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,t.Color.colorNameMap={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:"#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",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"},t.Color.fromRgb=function(e){return i.fromSource(i.sourceFromRgb(e))},t.Color.sourceFromRgb=function(e){var t=e.match(i.reRGBa);if(t){var n=parseInt(t[1],10)/(/%$/.test(t[1])?100:1)*(/%$/.test(t[1])?255:1),r=parseInt(t[2],10)/(/%$/.test(t[2])?100:1)*(/%$/.test(t[2])?255:1),a=parseInt(t[3],10)/(/%$/.test(t[3])?100:1)*(/%$/.test(t[3])?255:1);return[parseInt(n,10),parseInt(r,10),parseInt(a,10),t[4]?parseFloat(t[4]):1]}},t.Color.fromRgba=i.fromRgb,t.Color.fromHsl=function(e){return i.fromSource(i.sourceFromHsl(e))},t.Color.sourceFromHsl=function(e){var t=e.match(i.reHSLa);if(t){var r,a,o,s=(parseFloat(t[1])%360+360)%360/360,l=parseFloat(t[2])/(/%$/.test(t[2])?100:1),c=parseFloat(t[3])/(/%$/.test(t[3])?100:1);if(0===l)r=a=o=c;else{var h=c<=.5?c*(l+1):c+l-c*l,u=2*c-h;r=n(u,h,s+1/3),a=n(u,h,s),o=n(u,h,s-1/3)}return[Math.round(255*r),Math.round(255*a),Math.round(255*o),t[4]?parseFloat(t[4]):1]}},t.Color.fromHsla=i.fromHsl,t.Color.fromHex=function(e){return i.fromSource(i.sourceFromHex(e))},t.Color.sourceFromHex=function(e){if(e.match(i.reHex)){var t=e.slice(e.indexOf("#")+1),n=3===t.length||4===t.length,r=8===t.length||4===t.length,a=n?t.charAt(0)+t.charAt(0):t.substring(0,2),o=n?t.charAt(1)+t.charAt(1):t.substring(2,4),s=n?t.charAt(2)+t.charAt(2):t.substring(4,6),l=r?n?t.charAt(3)+t.charAt(3):t.substring(6,8):"FF";return[parseInt(a,16),parseInt(o,16),parseInt(s,16),parseFloat((parseInt(l,16)/255).toFixed(2))]}},t.Color.fromSource=function(e){var t=new i;return t.setSource(e),t})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=["e","se","s","sw","w","nw","n","ne","e"],n=["ns","nesw","ew","nwse"],r={},a="left",o="top",s={top:"bottom",bottom:o,left:"right",right:a,center:"center"},l=t.util.radiansToDegrees,c=Math.sign||function(e){return(e>0)-(e<0)||+e};function h(e,t){var i=e.angle+l(Math.atan2(t.y,t.x))+360;return Math.round(i%360/45)}function u(e,i){var n=i.transform.target,r=n.canvas,a=t.util.object.clone(i);a.target=n,r&&r.fire("object:"+e,a),n.fire(e,i)}function f(e,t){var i=t.canvas,n=e[i.uniScaleKey];return i.uniformScaling&&!n||!i.uniformScaling&&n}function d(e){return"center"===e.originX&&"center"===e.originY}function m(e,t,i){var n=e.lockScalingX,r=e.lockScalingY;return!(!n||!r)||(!(t||!n&&!r||!i)||(!(!n||"x"!==t)||!(!r||"y"!==t)))}function g(e,t,i,n){return{e:e,transform:t,pointer:{x:i,y:n}}}function v(e){return function(t,i,n,r){var a=i.target,o=a.getCenterPoint(),s=a.translateToOriginPoint(o,i.originX,i.originY),l=e(t,i,n,r);return a.setPositionByOrigin(s,i.originX,i.originY),l}}function p(e,t){return function(i,n,r,a){var o=t(i,n,r,a);return o&&u(e,g(i,n,r,a)),o}}function y(e,i,n,r,a){var o=e.target,s=o.controls[e.corner],l=o.canvas.getZoom(),c=o.padding/l,h=o.toLocalPoint(new t.Point(r,a),i,n);return h.x>=c&&(h.x-=c),h.x<=-c&&(h.x+=c),h.y>=c&&(h.y-=c),h.y<=c&&(h.y+=c),h.x-=s.offsetX,h.y-=s.offsetY,h}function b(e){return e.flipX!==e.flipY}function w(e,t,i,n,r){if(0!==e[t]){var a=r/e._getTransformedDimensions()[n]*e[i];e.set(i,a)}}function x(e,t,i,n){var r,s=t.target,c=s._getTransformedDimensions(0,s.skewY),h=y(t,t.originX,t.originY,i,n),u=Math.abs(2*h.x)-c.x,f=s.skewX;u<2?r=0:(r=l(Math.atan2(u/s.scaleX,c.y/s.scaleY)),t.originX===a&&"bottom"===t.originY&&(r=-r),"right"===t.originX&&t.originY===o&&(r=-r),b(s)&&(r=-r));var d=f!==r;if(d){var m=s._getTransformedDimensions().y;s.set("skewX",r),w(s,"skewY","scaleY","y",m)}return d}function k(e,t,i,n){var r,s=t.target,c=s._getTransformedDimensions(s.skewX,0),h=y(t,t.originX,t.originY,i,n),u=Math.abs(2*h.y)-c.y,f=s.skewY;u<2?r=0:(r=l(Math.atan2(u/s.scaleY,c.x/s.scaleX)),t.originX===a&&"bottom"===t.originY&&(r=-r),"right"===t.originX&&t.originY===o&&(r=-r),b(s)&&(r=-r));var d=f!==r;if(d){var m=s._getTransformedDimensions().x;s.set("skewY",r),w(s,"skewX","scaleX","x",m)}return d}function C(e,t,i,n,r){r=r||{};var a,o,l,h,u,g,v=t.target,p=v.lockScalingX,b=v.lockScalingY,w=r.by,x=f(e,v),k=m(v,w,x),C=t.gestureScale;if(k)return!1;if(C)o=t.scaleX*C,l=t.scaleY*C;else{if(a=y(t,t.originX,t.originY,i,n),u="y"!==w?c(a.x):1,g="x"!==w?c(a.y):1,t.signX||(t.signX=u),t.signY||(t.signY=g),v.lockScalingFlip&&(t.signX!==u||t.signY!==g))return!1;if(h=v._getTransformedDimensions(),x&&!w){var S=Math.abs(a.x)+Math.abs(a.y),_=t.original,T=S/(Math.abs(h.x*_.scaleX/v.scaleX)+Math.abs(h.y*_.scaleY/v.scaleY));o=_.scaleX*T,l=_.scaleY*T}else o=Math.abs(a.x*v.scaleX/h.x),l=Math.abs(a.y*v.scaleY/h.y);d(t)&&(o*=2,l*=2),t.signX!==u&&"y"!==w&&(t.originX=s[t.originX],o*=-1,t.signX=u),t.signY!==g&&"x"!==w&&(t.originY=s[t.originY],l*=-1,t.signY=g)}var O=v.scaleX,E=v.scaleY;return w?("x"===w&&v.set("scaleX",o),"y"===w&&v.set("scaleY",l)):(!p&&v.set("scaleX",o),!b&&v.set("scaleY",l)),O!==v.scaleX||E!==v.scaleY}r.scaleCursorStyleHandler=function(e,t,n){var r=f(e,n),a="";if(0!==t.x&&0===t.y?a="x":0===t.x&&0!==t.y&&(a="y"),m(n,a,r))return"not-allowed";var o=h(n,t);return i[o]+"-resize"},r.skewCursorStyleHandler=function(e,t,i){if(0!==t.x&&i.lockSkewingY)return"not-allowed";if(0!==t.y&&i.lockSkewingX)return"not-allowed";var r=h(i,t)%4;return n[r]+"-resize"},r.scaleSkewCursorStyleHandler=function(e,t,i){return e[i.canvas.altActionKey]?r.skewCursorStyleHandler(e,t,i):r.scaleCursorStyleHandler(e,t,i)},r.rotationWithSnapping=p("rotating",v((function(e,t,i,n){var r=t,a=r.target,o=a.translateToOriginPoint(a.getCenterPoint(),r.originX,r.originY);if(a.lockRotation)return!1;var s,c=Math.atan2(r.ey-o.y,r.ex-o.x),h=Math.atan2(n-o.y,i-o.x),u=l(h-c+r.theta);if(a.snapAngle>0){var f=a.snapAngle,d=a.snapThreshold||f,m=Math.ceil(u/f)*f,g=Math.floor(u/f)*f;Math.abs(u-g)<d?u=g:Math.abs(u-m)<d&&(u=m)}return u<0&&(u=360+u),u%=360,s=a.angle!==u,a.angle=u,s}))),r.scalingEqually=p("scaling",v((function(e,t,i,n){return C(e,t,i,n)}))),r.scalingX=p("scaling",v((function(e,t,i,n){return C(e,t,i,n,{by:"x"})}))),r.scalingY=p("scaling",v((function(e,t,i,n){return C(e,t,i,n,{by:"y"})}))),r.scalingYOrSkewingX=function(e,t,i,n){return e[t.target.canvas.altActionKey]?r.skewHandlerX(e,t,i,n):r.scalingY(e,t,i,n)},r.scalingXOrSkewingY=function(e,t,i,n){return e[t.target.canvas.altActionKey]?r.skewHandlerY(e,t,i,n):r.scalingX(e,t,i,n)},r.changeWidth=p("resizing",v((function(e,t,i,n){var r=t.target,a=y(t,t.originX,t.originY,i,n),o=r.strokeWidth/(r.strokeUniform?r.scaleX:1),s=d(t)?2:1,l=r.width,c=Math.abs(a.x*s/r.scaleX)-o;return r.set("width",Math.max(c,0)),l!==c}))),r.skewHandlerX=function(e,t,i,n){var r,s=t.target,l=s.skewX,c=t.originY;return!s.lockSkewingX&&(0===l?r=y(t,"center","center",i,n).x>0?a:"right":(l>0&&(r=c===o?a:"right"),l<0&&(r=c===o?"right":a),b(s)&&(r=r===a?"right":a)),t.originX=r,p("skewing",v(x))(e,t,i,n))},r.skewHandlerY=function(e,t,i,n){var r,s=t.target,l=s.skewY,c=t.originX;return!s.lockSkewingY&&(0===l?r=y(t,"center","center",i,n).y>0?o:"bottom":(l>0&&(r=c===a?o:"bottom"),l<0&&(r=c===a?"bottom":o),b(s)&&(r=r===o?"bottom":o)),t.originY=r,p("skewing",v(k))(e,t,i,n))},r.dragHandler=function(e,t,i,n){var r=t.target,a=i-t.offsetX,o=n-t.offsetY,s=!r.get("lockMovementX")&&r.left!==a,l=!r.get("lockMovementY")&&r.top!==o;return s&&r.set("left",a),l&&r.set("top",o),(s||l)&&u("moving",g(e,t,i,n)),s||l},r.scaleOrSkewActionName=function(e,t,i){var n=e[i.canvas.altActionKey];return 0===t.x?n?"skewX":"scaleY":0===t.y?n?"skewY":"scaleX":void 0},r.rotationStyleHandler=function(e,t,i){return i.lockRotation?"not-allowed":t.cursorStyle},r.fireEvent=u,r.wrapWithFixedAnchor=v,r.wrapWithFireEvent=p,r.getLocalPoint=y,t.controlsUtils=r}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.degreesToRadians,n=t.controlsUtils;n.renderCircleControl=function(e,t,i,n,r){n=n||{};var a,o=this.sizeX||n.cornerSize||r.cornerSize,s=this.sizeY||n.cornerSize||r.cornerSize,l=void 0!==n.transparentCorners?n.transparentCorners:r.transparentCorners,c=l?"stroke":"fill",h=!l&&(n.cornerStrokeColor||r.cornerStrokeColor),u=t,f=i;e.save(),e.fillStyle=n.cornerColor||r.cornerColor,e.strokeStyle=n.cornerStrokeColor||r.cornerStrokeColor,o>s?(a=o,e.scale(1,s/o),f=i*o/s):s>o?(a=s,e.scale(o/s,1),u=t*s/o):a=o,e.lineWidth=1,e.beginPath(),e.arc(u,f,a/2,0,2*Math.PI,!1),e[c](),h&&e.stroke(),e.restore()},n.renderSquareControl=function(e,t,n,r,a){r=r||{};var o=this.sizeX||r.cornerSize||a.cornerSize,s=this.sizeY||r.cornerSize||a.cornerSize,l=void 0!==r.transparentCorners?r.transparentCorners:a.transparentCorners,c=l?"stroke":"fill",h=!l&&(r.cornerStrokeColor||a.cornerStrokeColor),u=o/2,f=s/2;e.save(),e.fillStyle=r.cornerColor||a.cornerColor,e.strokeStyle=r.cornerStrokeColor||a.cornerStrokeColor,e.lineWidth=1,e.translate(t,n),e.rotate(i(a.angle)),e[c+"Rect"](-u,-f,o,s),h&&e.strokeRect(-u,-f,o,s),e.restore()}}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});t.Control=function(e){for(var t in e)this[t]=e[t]},t.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(e,t){return t.cursorStyle},getActionName:function(e,t){return t.actionName},getVisibility:function(e,t){var i=e._controlsVisibility;return i&&void 0!==i[t]?i[t]:this.visible},setVisibility:function(e){this.visible=e},positionHandler:function(e,i){return t.util.transformPoint({x:this.x*e.x+this.offsetX,y:this.y*e.y+this.offsetY},i)},calcCornerCoords:function(e,i,n,r,a){var o,s,l,c,h=a?this.touchSizeX:this.sizeX,u=a?this.touchSizeY:this.sizeY;if(h&&u&&h!==u){var f=Math.atan2(u,h),d=Math.sqrt(h*h+u*u)/2,m=f-t.util.degreesToRadians(e),g=Math.PI/2-f-t.util.degreesToRadians(e);o=d*t.util.cos(m),s=d*t.util.sin(m),l=d*t.util.cos(g),c=d*t.util.sin(g)}else{d=.7071067812*(h&&u?h:i);m=t.util.degreesToRadians(45-e);o=l=d*t.util.cos(m),s=c=d*t.util.sin(m)}return{tl:{x:n-c,y:r-l},tr:{x:n+o,y:r-s},bl:{x:n-o,y:r+s},br:{x:n+c,y:r+l}}},render:function(e,i,n,r,a){switch((r=r||{}).cornerStyle||a.cornerStyle){case"circle":t.controlsUtils.renderCircleControl.call(this,e,i,n,r,a);break;default:t.controlsUtils.renderSquareControl.call(this,e,i,n,r,a)}}}}(t),function(){function e(e,t){var i,n,r,a,o=e.getAttribute("style"),s=e.getAttribute("offset")||0;if(s=(s=parseFloat(s)/(/%$/.test(s)?100:1))<0?0:s>1?1:s,o){var l=o.split(/\s*;\s*/);for(""===l[l.length-1]&&l.pop(),a=l.length;a--;){var c=l[a].split(/\s*:\s*/),h=c[0].trim(),u=c[1].trim();"stop-color"===h?i=u:"stop-opacity"===h&&(r=u)}}return i||(i=e.getAttribute("stop-color")||"rgb(0,0,0)"),r||(r=e.getAttribute("stop-opacity")),n=(i=new _.Color(i)).getAlpha(),r=isNaN(parseFloat(r))?1:parseFloat(r),r*=n*t,{offset:s,color:i.toRgb(),opacity:r}}var t=_.util.object.clone;_.Gradient=_.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(e){e||(e={}),e.coords||(e.coords={});var t,i=this;Object.keys(e).forEach((function(t){i[t]=e[t]})),this.id?this.id+="_"+_.Object.__uid++:this.id=_.Object.__uid++,t={x1:e.coords.x1||0,y1:e.coords.y1||0,x2:e.coords.x2||0,y2:e.coords.y2||0},"radial"===this.type&&(t.r1=e.coords.r1||0,t.r2=e.coords.r2||0),this.coords=t,this.colorStops=e.colorStops.slice()},addColorStop:function(e){for(var t in e){var i=new _.Color(e[t]);this.colorStops.push({offset:parseFloat(t),color:i.toRgb(),opacity:i.getAlpha()})}return this},toObject:function(e){var t={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return _.util.populateWithProperties(this,t,e),t},toSVG:function(e,i){var n,r,a,o,s=t(this.coords,!0),l=(i=i||{},t(this.colorStops,!0)),c=s.r1>s.r2,h=this.gradientTransform?this.gradientTransform.concat():_.iMatrix.concat(),u=-this.offsetX,f=-this.offsetY,d=!!i.additionalTransform,m="pixels"===this.gradientUnits?"userSpaceOnUse":"objectBoundingBox";if(l.sort((function(e,t){return e.offset-t.offset})),"objectBoundingBox"===m?(u/=e.width,f/=e.height):(u+=e.width/2,f+=e.height/2),"path"===e.type&&"percentage"!==this.gradientUnits&&(u-=e.pathOffset.x,f-=e.pathOffset.y),h[4]-=u,h[5]-=f,o='id="SVGID_'+this.id+'" gradientUnits="'+m+'"',o+=' gradientTransform="'+(d?i.additionalTransform+" ":"")+_.util.matrixToSVG(h)+'" ',"linear"===this.type?a=["<linearGradient ",o,' x1="',s.x1,'" y1="',s.y1,'" x2="',s.x2,'" y2="',s.y2,'">\n']:"radial"===this.type&&(a=["<radialGradient ",o,' cx="',c?s.x1:s.x2,'" cy="',c?s.y1:s.y2,'" r="',c?s.r1:s.r2,'" fx="',c?s.x2:s.x1,'" fy="',c?s.y2:s.y1,'">\n']),"radial"===this.type){if(c)for((l=l.concat()).reverse(),n=0,r=l.length;n<r;n++)l[n].offset=1-l[n].offset;var g=Math.min(s.r1,s.r2);if(g>0){var v=g/Math.max(s.r1,s.r2);for(n=0,r=l.length;n<r;n++)l[n].offset+=v*(1-l[n].offset)}}for(n=0,r=l.length;n<r;n++){var p=l[n];a.push("<stop ",'offset="',100*p.offset+"%",'" style="stop-color:',p.color,void 0!==p.opacity?";stop-opacity: "+p.opacity:";",'"/>\n')}return a.push("linear"===this.type?"</linearGradient>\n":"</radialGradient>\n"),a.join("")},toLive:function(e){var t,i,n,r=_.util.object.clone(this.coords);if(this.type){for("linear"===this.type?t=e.createLinearGradient(r.x1,r.y1,r.x2,r.y2):"radial"===this.type&&(t=e.createRadialGradient(r.x1,r.y1,r.r1,r.x2,r.y2,r.r2)),i=0,n=this.colorStops.length;i<n;i++){var a=this.colorStops[i].color,o=this.colorStops[i].opacity,s=this.colorStops[i].offset;void 0!==o&&(a=new _.Color(a).setAlpha(o).toRgba()),t.addColorStop(s,a)}return t}}}),_.util.object.extend(_.Gradient,{fromElement:function(t,i,n,r){var a=parseFloat(n)/(/%$/.test(n)?100:1);a=a<0?0:a>1?1:a,isNaN(a)&&(a=1);var o,s,l,c,h=t.getElementsByTagName("stop"),u="userSpaceOnUse"===t.getAttribute("gradientUnits")?"pixels":"percentage",f=t.getAttribute("gradientTransform")||"",d=[],m=0,g=0;for("linearGradient"===t.nodeName||"LINEARGRADIENT"===t.nodeName?(o="linear",s=function(e){return{x1:e.getAttribute("x1")||0,y1:e.getAttribute("y1")||0,x2:e.getAttribute("x2")||"100%",y2:e.getAttribute("y2")||0}}(t)):(o="radial",s=function(e){return{x1:e.getAttribute("fx")||e.getAttribute("cx")||"50%",y1:e.getAttribute("fy")||e.getAttribute("cy")||"50%",r1:0,x2:e.getAttribute("cx")||"50%",y2:e.getAttribute("cy")||"50%",r2:e.getAttribute("r")||"50%"}}(t)),l=h.length;l--;)d.push(e(h[l],a));return c=_.parseTransformAttribute(f),function(e,t,i,n){var r,a;Object.keys(t).forEach((function(e){"Infinity"===(r=t[e])?a=1:"-Infinity"===r?a=0:(a=parseFloat(t[e],10),"string"==typeof r&&/^(\d+\.\d+)%|(\d+)%$/.test(r)&&(a*=.01,"pixels"===n&&("x1"!==e&&"x2"!==e&&"r2"!==e||(a*=i.viewBoxWidth||i.width),"y1"!==e&&"y2"!==e||(a*=i.viewBoxHeight||i.height)))),t[e]=a}))}(0,s,r,u),"pixels"===u&&(m=-i.left,g=-i.top),new _.Gradient({id:t.getAttribute("id"),type:o,coords:s,colorStops:d,gradientUnits:u,gradientTransform:c,offsetX:m,offsetY:g})}})}(),function(){"use strict";var e=_.util.toFixed;_.Pattern=_.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(e,t){if(e||(e={}),this.id=_.Object.__uid++,this.setOptions(e),!e.source||e.source&&"string"!=typeof e.source)t&&t(this);else{var i=this;this.source=_.util.createImage(),_.util.loadImage(e.source,(function(e,n){i.source=e,t&&t(i,n)}),null,this.crossOrigin)}},toObject:function(t){var i,n,r=_.Object.NUM_FRACTION_DIGITS;return"string"==typeof this.source.src?i=this.source.src:"object"==typeof this.source&&this.source.toDataURL&&(i=this.source.toDataURL()),n={type:"pattern",source:i,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:e(this.offsetX,r),offsetY:e(this.offsetY,r),patternTransform:this.patternTransform?this.patternTransform.concat():null},_.util.populateWithProperties(this,n,t),n},toSVG:function(e){var t="function"==typeof this.source?this.source():this.source,i=t.width/e.width,n=t.height/e.height,r=this.offsetX/e.width,a=this.offsetY/e.height,o="";return"repeat-x"!==this.repeat&&"no-repeat"!==this.repeat||(n=1,a&&(n+=Math.abs(a))),"repeat-y"!==this.repeat&&"no-repeat"!==this.repeat||(i=1,r&&(i+=Math.abs(r))),t.src?o=t.src:t.toDataURL&&(o=t.toDataURL()),'<pattern id="SVGID_'+this.id+'" x="'+r+'" y="'+a+'" width="'+i+'" height="'+n+'">\n<image x="0" y="0" width="'+t.width+'" height="'+t.height+'" xlink:href="'+o+'"></image>\n</pattern>\n'},setOptions:function(e){for(var t in e)this[t]=e[t]},toLive:function(e){var t=this.source;if(!t)return"";if(void 0!==t.src){if(!t.complete)return"";if(0===t.naturalWidth||0===t.naturalHeight)return""}return e.createPattern(t,this.repeat)}})}(),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.toFixed;t.Shadow?t.warn("fabric.Shadow is already defined."):(t.Shadow=t.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(e){for(var i in"string"==typeof e&&(e=this._parseShadow(e)),e)this[i]=e[i];this.id=t.Object.__uid++},_parseShadow:function(e){var i=e.trim(),n=t.Shadow.reOffsetsAndBlur.exec(i)||[];return{color:(i.replace(t.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)").trim(),offsetX:parseFloat(n[1],10)||0,offsetY:parseFloat(n[2],10)||0,blur:parseFloat(n[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(e){var n=40,r=40,a=t.Object.NUM_FRACTION_DIGITS,o=t.util.rotateVector({x:this.offsetX,y:this.offsetY},t.util.degreesToRadians(-e.angle)),s=new t.Color(this.color);return e.width&&e.height&&(n=100*i((Math.abs(o.x)+this.blur)/e.width,a)+20,r=100*i((Math.abs(o.y)+this.blur)/e.height,a)+20),e.flipX&&(o.x*=-1),e.flipY&&(o.y*=-1),'<filter id="SVGID_'+this.id+'" y="-'+r+'%" height="'+(100+2*r)+'%" x="-'+n+'%" width="'+(100+2*n)+'%" >\n\t<feGaussianBlur in="SourceAlpha" stdDeviation="'+i(this.blur?this.blur/2:0,a)+'"></feGaussianBlur>\n\t<feOffset dx="'+i(o.x,a)+'" dy="'+i(o.y,a)+'" result="oBlur" ></feOffset>\n\t<feFlood flood-color="'+s.toRgb()+'" flood-opacity="'+s.getAlpha()+'"/>\n\t<feComposite in2="oBlur" operator="in" />\n\t<feMerge>\n\t\t<feMergeNode></feMergeNode>\n\t\t<feMergeNode in="SourceGraphic"></feMergeNode>\n\t</feMerge>\n</filter>\n'},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var e={},i=t.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach((function(t){this[t]!==i[t]&&(e[t]=this[t])}),this),e}}),t.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/)}(t),function(){"use strict";if(_.StaticCanvas)_.warn("fabric.StaticCanvas is already defined.");else{var e=_.util.object.extend,t=_.util.getElementOffset,i=_.util.removeFromArray,n=_.util.toFixed,r=_.util.transformPoint,a=_.util.invertTransform,o=_.util.getNodeCanvas,s=_.util.createCanvasElement,l=new Error("Could not initialize `canvas` element");_.StaticCanvas=_.util.createClass(_.CommonMethods,{initialize:function(e,t){t||(t={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(e,t)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:_.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(e,t){var i=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(e),this._initOptions(t),this.interactive||this._initRetinaScaling(),t.overlayImage&&this.setOverlayImage(t.overlayImage,i),t.backgroundImage&&this.setBackgroundImage(t.backgroundImage,i),t.backgroundColor&&this.setBackgroundColor(t.backgroundColor,i),t.overlayColor&&this.setOverlayColor(t.overlayColor,i),this.calcOffset()},_isRetinaScaling:function(){return 1!==_.devicePixelRatio&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?_.devicePixelRatio:1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var e=_.devicePixelRatio;this.__initRetinaScaling(e,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(e,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(e,t,i){t.setAttribute("width",this.width*e),t.setAttribute("height",this.height*e),i.scale(e,e)},calcOffset:function(){return this._offset=t(this.lowerCanvasEl),this},setOverlayImage:function(e,t,i){return this.__setBgOverlayImage("overlayImage",e,t,i)},setBackgroundImage:function(e,t,i){return this.__setBgOverlayImage("backgroundImage",e,t,i)},setOverlayColor:function(e,t){return this.__setBgOverlayColor("overlayColor",e,t)},setBackgroundColor:function(e,t){return this.__setBgOverlayColor("backgroundColor",e,t)},__setBgOverlayImage:function(e,t,i,n){return"string"==typeof t?_.util.loadImage(t,(function(t,r){if(t){var a=new _.Image(t,n);this[e]=a,a.canvas=this}i&&i(t,r)}),this,n&&n.crossOrigin):(n&&t.setOptions(n),this[e]=t,t&&(t.canvas=this),i&&i(t,!1)),this},__setBgOverlayColor:function(e,t,i){return this[e]=t,this._initGradient(t,e),this._initPattern(t,e,i),this},_createCanvasElement:function(){var e=s();if(!e)throw l;if(e.style||(e.style={}),void 0===e.getContext)throw l;return e},_initOptions:function(e){var t=this.lowerCanvasEl;this._setOptions(e),this.width=this.width||parseInt(t.width,10)||0,this.height=this.height||parseInt(t.height,10)||0,this.lowerCanvasEl.style&&(t.width=this.width,t.height=this.height,t.style.width=this.width+"px",t.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(e){e&&e.getContext?this.lowerCanvasEl=e:this.lowerCanvasEl=_.util.getById(e)||this._createCanvasElement(),_.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(e,t){return this.setDimensions({width:e},t)},setHeight:function(e,t){return this.setDimensions({height:e},t)},setDimensions:function(e,t){var i;for(var n in t=t||{},e)i=e[n],t.cssOnly||(this._setBackstoreDimension(n,e[n]),i+="px",this.hasLostContext=!0),t.backstoreOnly||this._setCssDimension(n,i);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(),this._initRetinaScaling(),this.calcOffset(),t.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(e,t){return this.lowerCanvasEl[e]=t,this.upperCanvasEl&&(this.upperCanvasEl[e]=t),this.cacheCanvasEl&&(this.cacheCanvasEl[e]=t),this[e]=t,this},_setCssDimension:function(e,t){return this.lowerCanvasEl.style[e]=t,this.upperCanvasEl&&(this.upperCanvasEl.style[e]=t),this.wrapperEl&&(this.wrapperEl.style[e]=t),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(e){var t,i,n,r=this._activeObject,a=this.backgroundImage,o=this.overlayImage;for(this.viewportTransform=e,i=0,n=this._objects.length;i<n;i++)(t=this._objects[i]).group||t.setCoords(!0);return r&&r.setCoords(),a&&a.setCoords(!0),o&&o.setCoords(!0),this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll(),this},zoomToPoint:function(e,t){var i=e,n=this.viewportTransform.slice(0);e=r(e,a(this.viewportTransform)),n[0]=t,n[3]=t;var o=r(e,n);return n[4]+=i.x-o.x,n[5]+=i.y-o.y,this.setViewportTransform(n)},setZoom:function(e){return this.zoomToPoint(new _.Point(0,0),e),this},absolutePan:function(e){var t=this.viewportTransform.slice(0);return t[4]=-e.x,t[5]=-e.y,this.setViewportTransform(t)},relativePan:function(e){return this.absolutePan(new _.Point(-e.x-this.viewportTransform[4],-e.y-this.viewportTransform[5]))},getElement:function(){return this.lowerCanvasEl},_onObjectAdded:function(e){this.stateful&&e.setupState(),e._set("canvas",this),e.setCoords(),this.fire("object:added",{target:e}),e.fire("added")},_onObjectRemoved:function(e){this.fire("object:removed",{target:e}),e.fire("removed"),delete e.canvas},clearContext:function(e){return e.clearRect(0,0,this.width,this.height),this},getContext:function(){return this.contextContainer},clear:function(){return this.remove.apply(this,this.getObjects()),this.backgroundImage=null,this.overlayImage=null,this.backgroundColor="",this.overlayColor="",this._hasITextHandlers&&(this.off("mouse:up",this._mouseUpITextHandler),this._iTextInstances=null,this._hasITextHandlers=!1),this.clearContext(this.contextContainer),this.fire("canvas:cleared"),this.renderOnAddRemove&&this.requestRenderAll(),this},renderAll:function(){var e=this.contextContainer;return this.renderCanvas(e,this._objects),this},renderAndReset:function(){this.isRendering=0,this.renderAll()},requestRenderAll:function(){return this.isRendering||(this.isRendering=_.util.requestAnimFrame(this.renderAndResetBound)),this},calcViewportBoundaries:function(){var e={},t=this.width,i=this.height,n=a(this.viewportTransform);return e.tl=r({x:0,y:0},n),e.br=r({x:t,y:i},n),e.tr=new _.Point(e.br.x,e.tl.y),e.bl=new _.Point(e.tl.x,e.br.y),this.vptCoords=e,e},cancelRequestedRender:function(){this.isRendering&&(_.util.cancelAnimFrame(this.isRendering),this.isRendering=0)},renderCanvas:function(e,t){var i=this.viewportTransform,n=this.clipPath;this.cancelRequestedRender(),this.calcViewportBoundaries(),this.clearContext(e),_.util.setImageSmoothing(e,this.imageSmoothingEnabled),this.fire("before:render",{ctx:e}),this._renderBackground(e),e.save(),e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),this._renderObjects(e,t),e.restore(),!this.controlsAboveOverlay&&this.interactive&&this.drawControls(e),n&&(n.canvas=this,n.shouldCache(),n._transformDone=!0,n.renderCache({forClipping:!0}),this.drawClipPathOnCanvas(e)),this._renderOverlay(e),this.controlsAboveOverlay&&this.interactive&&this.drawControls(e),this.fire("after:render",{ctx:e})},drawClipPathOnCanvas:function(e){var t=this.viewportTransform,i=this.clipPath;e.save(),e.transform(t[0],t[1],t[2],t[3],t[4],t[5]),e.globalCompositeOperation="destination-in",i.transform(e),e.scale(1/i.zoomX,1/i.zoomY),e.drawImage(i._cacheCanvas,-i.cacheTranslationX,-i.cacheTranslationY),e.restore()},_renderObjects:function(e,t){var i,n;for(i=0,n=t.length;i<n;++i)t[i]&&t[i].render(e)},_renderBackgroundOrOverlay:function(e,t){var i=this[t+"Color"],n=this[t+"Image"],r=this.viewportTransform,a=this[t+"Vpt"];if(i||n){if(i){e.save(),e.beginPath(),e.moveTo(0,0),e.lineTo(this.width,0),e.lineTo(this.width,this.height),e.lineTo(0,this.height),e.closePath(),e.fillStyle=i.toLive?i.toLive(e,this):i,a&&e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),e.transform(1,0,0,1,i.offsetX||0,i.offsetY||0);var o=i.gradientTransform||i.patternTransform;o&&e.transform(o[0],o[1],o[2],o[3],o[4],o[5]),e.fill(),e.restore()}n&&(e.save(),a&&e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),n.render(e),e.restore())}},_renderBackground:function(e){this._renderBackgroundOrOverlay(e,"background")},_renderOverlay:function(e){this._renderBackgroundOrOverlay(e,"overlay")},getCenter:function(){return{top:this.height/2,left:this.width/2}},centerObjectH:function(e){return this._centerObject(e,new _.Point(this.getCenter().left,e.getCenterPoint().y))},centerObjectV:function(e){return this._centerObject(e,new _.Point(e.getCenterPoint().x,this.getCenter().top))},centerObject:function(e){var t=this.getCenter();return this._centerObject(e,new _.Point(t.left,t.top))},viewportCenterObject:function(e){var t=this.getVpCenter();return this._centerObject(e,t)},viewportCenterObjectH:function(e){var t=this.getVpCenter();return this._centerObject(e,new _.Point(t.x,e.getCenterPoint().y)),this},viewportCenterObjectV:function(e){var t=this.getVpCenter();return this._centerObject(e,new _.Point(e.getCenterPoint().x,t.y))},getVpCenter:function(){var e=this.getCenter(),t=a(this.viewportTransform);return r({x:e.left,y:e.top},t)},_centerObject:function(e,t){return e.setPositionByOrigin(t,"center","center"),e.setCoords(),this.renderOnAddRemove&&this.requestRenderAll(),this},toDatalessJSON:function(e){return this.toDatalessObject(e)},toObject:function(e){return this._toObjectMethod("toObject",e)},toDatalessObject:function(e){return this._toObjectMethod("toDatalessObject",e)},_toObjectMethod:function(t,i){var n=this.clipPath,r={version:_.version,objects:this._toObjects(t,i)};return n&&!n.excludeFromExport&&(r.clipPath=this._toObject(this.clipPath,t,i)),e(r,this.__serializeBgOverlay(t,i)),_.util.populateWithProperties(this,r,i),r},_toObjects:function(e,t){return this._objects.filter((function(e){return!e.excludeFromExport})).map((function(i){return this._toObject(i,e,t)}),this)},_toObject:function(e,t,i){var n;this.includeDefaultValues||(n=e.includeDefaultValues,e.includeDefaultValues=!1);var r=e[t](i);return this.includeDefaultValues||(e.includeDefaultValues=n),r},__serializeBgOverlay:function(e,t){var i={},n=this.backgroundImage,r=this.overlayImage,a=this.backgroundColor,o=this.overlayColor;return a&&a.toObject?a.excludeFromExport||(i.background=a.toObject(t)):a&&(i.background=a),o&&o.toObject?o.excludeFromExport||(i.overlay=o.toObject(t)):o&&(i.overlay=o),n&&!n.excludeFromExport&&(i.backgroundImage=this._toObject(n,e,t)),r&&!r.excludeFromExport&&(i.overlayImage=this._toObject(r,e,t)),i},svgViewportTransformation:!0,toSVG:function(e,t){e||(e={}),e.reviver=t;var i=[];return this._setSVGPreamble(i,e),this._setSVGHeader(i,e),this.clipPath&&i.push('<g clip-path="url(#'+this.clipPath.clipPathId+')" >\n'),this._setSVGBgOverlayColor(i,"background"),this._setSVGBgOverlayImage(i,"backgroundImage",t),this._setSVGObjects(i,t),this.clipPath&&i.push("</g>\n"),this._setSVGBgOverlayColor(i,"overlay"),this._setSVGBgOverlayImage(i,"overlayImage",t),i.push("</svg>"),i.join("")},_setSVGPreamble:function(e,t){t.suppressPreamble||e.push('<?xml version="1.0" encoding="',t.encoding||"UTF-8",'" standalone="no" ?>\n','<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ','"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')},_setSVGHeader:function(e,t){var i,r=t.width||this.width,a=t.height||this.height,o='viewBox="0 0 '+this.width+" "+this.height+'" ',s=_.Object.NUM_FRACTION_DIGITS;t.viewBox?o='viewBox="'+t.viewBox.x+" "+t.viewBox.y+" "+t.viewBox.width+" "+t.viewBox.height+'" ':this.svgViewportTransformation&&(i=this.viewportTransform,o='viewBox="'+n(-i[4]/i[0],s)+" "+n(-i[5]/i[3],s)+" "+n(this.width/i[0],s)+" "+n(this.height/i[3],s)+'" '),e.push("<svg ",'xmlns="http://www.w3.org/2000/svg" ','xmlns:xlink="http://www.w3.org/1999/xlink" ','version="1.1" ','width="',r,'" ','height="',a,'" ',o,'xml:space="preserve">\n',"<desc>Created with Fabric.js ",_.version,"</desc>\n","<defs>\n",this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(t),"</defs>\n")},createSVGClipPathMarkup:function(e){var t=this.clipPath;return t?(t.clipPathId="CLIPPATH_"+_.Object.__uid++,'<clipPath id="'+t.clipPathId+'" >\n'+this.clipPath.toClipPathSVG(e.reviver)+"</clipPath>\n"):""},createSVGRefElementsMarkup:function(){var e=this;return["background","overlay"].map((function(t){var i=e[t+"Color"];if(i&&i.toLive){var n=e[t+"Vpt"],r=e.viewportTransform,a={width:e.width/(n?r[0]:1),height:e.height/(n?r[3]:1)};return i.toSVG(a,{additionalTransform:n?_.util.matrixToSVG(r):""})}})).join("")},createSVGFontFacesMarkup:function(){var e,t,i,n,r,a,o,s,l="",c={},h=_.fontPaths,u=[];for(this._objects.forEach((function e(t){u.push(t),t._objects&&t._objects.forEach(e)})),o=0,s=u.length;o<s;o++)if(t=(e=u[o]).fontFamily,-1!==e.type.indexOf("text")&&!c[t]&&h[t]&&(c[t]=!0,e.styles))for(r in i=e.styles)for(a in n=i[r])!c[t=n[a].fontFamily]&&h[t]&&(c[t]=!0);for(var f in c)l+=["\t\t@font-face {\n","\t\t\tfont-family: '",f,"';\n","\t\t\tsrc: url('",h[f],"');\n","\t\t}\n"].join("");return l&&(l=['\t<style type="text/css">',"<![CDATA[\n",l,"]]>","</style>\n"].join("")),l},_setSVGObjects:function(e,t){var i,n,r,a=this._objects;for(n=0,r=a.length;n<r;n++)(i=a[n]).excludeFromExport||this._setSVGObject(e,i,t)},_setSVGObject:function(e,t,i){e.push(t.toSVG(i))},_setSVGBgOverlayImage:function(e,t,i){this[t]&&!this[t].excludeFromExport&&this[t].toSVG&&e.push(this[t].toSVG(i))},_setSVGBgOverlayColor:function(e,t){var i=this[t+"Color"],n=this.viewportTransform,r=this.width,a=this.height;if(i)if(i.toLive){var o=i.repeat,s=_.util.invertTransform(n),l=this[t+"Vpt"]?_.util.matrixToSVG(s):"";e.push('<rect transform="'+l+" translate(",r/2,",",a/2,')"',' x="',i.offsetX-r/2,'" y="',i.offsetY-a/2,'" ','width="',"repeat-y"===o||"no-repeat"===o?i.source.width:r,'" height="',"repeat-x"===o||"no-repeat"===o?i.source.height:a,'" fill="url(#SVGID_'+i.id+')"',"></rect>\n")}else e.push('<rect x="0" y="0" width="100%" height="100%" ','fill="',i,'"',"></rect>\n")},sendToBack:function(e){if(!e)return this;var t,n,r,a=this._activeObject;if(e===a&&"activeSelection"===e.type)for(t=(r=a._objects).length;t--;)n=r[t],i(this._objects,n),this._objects.unshift(n);else i(this._objects,e),this._objects.unshift(e);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(e){if(!e)return this;var t,n,r,a=this._activeObject;if(e===a&&"activeSelection"===e.type)for(r=a._objects,t=0;t<r.length;t++)n=r[t],i(this._objects,n),this._objects.push(n);else i(this._objects,e),this._objects.push(e);return this.renderOnAddRemove&&this.requestRenderAll(),this},sendBackwards:function(e,t){if(!e)return this;var n,r,a,o,s,l=this._activeObject,c=0;if(e===l&&"activeSelection"===e.type)for(s=l._objects,n=0;n<s.length;n++)r=s[n],(a=this._objects.indexOf(r))>0+c&&(o=a-1,i(this._objects,r),this._objects.splice(o,0,r)),c++;else 0!==(a=this._objects.indexOf(e))&&(o=this._findNewLowerIndex(e,a,t),i(this._objects,e),this._objects.splice(o,0,e));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(e,t,i){var n,r;if(i)for(n=t,r=t-1;r>=0;--r){if(e.intersectsWithObject(this._objects[r])||e.isContainedWithinObject(this._objects[r])||this._objects[r].isContainedWithinObject(e)){n=r;break}}else n=t-1;return n},bringForward:function(e,t){if(!e)return this;var n,r,a,o,s,l=this._activeObject,c=0;if(e===l&&"activeSelection"===e.type)for(n=(s=l._objects).length;n--;)r=s[n],(a=this._objects.indexOf(r))<this._objects.length-1-c&&(o=a+1,i(this._objects,r),this._objects.splice(o,0,r)),c++;else(a=this._objects.indexOf(e))!==this._objects.length-1&&(o=this._findNewUpperIndex(e,a,t),i(this._objects,e),this._objects.splice(o,0,e));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewUpperIndex:function(e,t,i){var n,r,a;if(i)for(n=t,r=t+1,a=this._objects.length;r<a;++r){if(e.intersectsWithObject(this._objects[r])||e.isContainedWithinObject(this._objects[r])||this._objects[r].isContainedWithinObject(e)){n=r;break}}else n=t+1;return n},moveTo:function(e,t){return i(this._objects,e),this._objects.splice(t,0,e),this.renderOnAddRemove&&this.requestRenderAll()},dispose:function(){return this.isRendering&&(_.util.cancelAnimFrame(this.isRendering),this.isRendering=0),this.forEachObject((function(e){e.dispose&&e.dispose()})),this._objects=[],this.backgroundImage&&this.backgroundImage.dispose&&this.backgroundImage.dispose(),this.backgroundImage=null,this.overlayImage&&this.overlayImage.dispose&&this.overlayImage.dispose(),this.overlayImage=null,this._iTextInstances=null,this.contextContainer=null,this.lowerCanvasEl.classList.remove("lower-canvas"),this.lowerCanvasEl.style=this._originalCanvasStyle,delete this._originalCanvasStyle,this.lowerCanvasEl.setAttribute("width",this.width),this.lowerCanvasEl.setAttribute("height",this.height),_.util.cleanUpJsdomNode(this.lowerCanvasEl),this.lowerCanvasEl=void 0,this},toString:function(){return"#<fabric.Canvas ("+this.complexity()+"): { objects: "+this._objects.length+" }>"}}),e(_.StaticCanvas.prototype,_.Observable),e(_.StaticCanvas.prototype,_.Collection),e(_.StaticCanvas.prototype,_.DataURLExporter),e(_.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(e){var t=s();if(!t||!t.getContext)return null;var i=t.getContext("2d");if(!i)return null;switch(e){case"setLineDash":return void 0!==i.setLineDash;default:return null}}}),_.StaticCanvas.prototype.toJSON=_.StaticCanvas.prototype.toObject,_.isLikelyNode&&(_.StaticCanvas.prototype.createPNGStream=function(){var e=o(this.lowerCanvasEl);return e&&e.createPNGStream()},_.StaticCanvas.prototype.createJPEGStream=function(e){var t=o(this.lowerCanvasEl);return t&&t.createJPEGStream(e)})}}(),_.BaseBrush=_.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(){var e=this.canvas.contextTop;e.strokeStyle=this.color,e.lineWidth=this.width,e.lineCap=this.strokeLineCap,e.miterLimit=this.strokeMiterLimit,e.lineJoin=this.strokeLineJoin,e.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(e){var t=this.canvas.viewportTransform;e.save(),e.transform(t[0],t[1],t[2],t[3],t[4],t[5])},_setShadow:function(){if(this.shadow){var e=this.canvas,t=this.shadow,i=e.contextTop,n=e.getZoom();e&&e._isRetinaScaling()&&(n*=_.devicePixelRatio),i.shadowColor=t.color,i.shadowBlur=t.blur*n,i.shadowOffsetX=t.offsetX*n,i.shadowOffsetY=t.offsetY*n}},needsFullRender:function(){return new _.Color(this.color).getAlpha()<1||!!this.shadow},_resetShadow:function(){var e=this.canvas.contextTop;e.shadowColor="",e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0},_isOutSideCanvas:function(e){return e.x<0||e.x>this.canvas.getWidth()||e.y<0||e.y>this.canvas.getHeight()}}),_.PencilBrush=_.util.createClass(_.BaseBrush,{decimate:.4,initialize:function(e){this.canvas=e,this._points=[]},_drawSegment:function(e,t,i){var n=t.midPointFrom(i);return e.quadraticCurveTo(t.x,t.y,n.x,n.y),n},onMouseDown:function(e,t){this.canvas._isMainEvent(t.e)&&(this._prepareForDrawing(e),this._captureDrawingPath(e),this._render())},onMouseMove:function(e,t){if(this.canvas._isMainEvent(t.e)&&(!0!==this.limitedToCanvasSize||!this._isOutSideCanvas(e))&&this._captureDrawingPath(e)&&this._points.length>1)if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var i=this._points,n=i.length,r=this.canvas.contextTop;this._saveAndTransform(r),this.oldEnd&&(r.beginPath(),r.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(r,i[n-2],i[n-1],!0),r.stroke(),r.restore()}},onMouseUp:function(e){return!this.canvas._isMainEvent(e.e)||(this.oldEnd=void 0,this._finalizeAndAddPath(),!1)},_prepareForDrawing:function(e){var t=new _.Point(e.x,e.y);this._reset(),this._addPoint(t),this.canvas.contextTop.moveTo(t.x,t.y)},_addPoint:function(e){return!(this._points.length>1&&e.eq(this._points[this._points.length-1])||(this._points.push(e),0))},_reset:function(){this._points=[],this._setBrushStyles(),this._setShadow()},_captureDrawingPath:function(e){var t=new _.Point(e.x,e.y);return this._addPoint(t)},_render:function(){var e,t,i=this.canvas.contextTop,n=this._points[0],r=this._points[1];if(this._saveAndTransform(i),i.beginPath(),2===this._points.length&&n.x===r.x&&n.y===r.y){var a=this.width/1e3;n=new _.Point(n.x,n.y),r=new _.Point(r.x,r.y),n.x-=a,r.x+=a}for(i.moveTo(n.x,n.y),e=1,t=this._points.length;e<t;e++)this._drawSegment(i,n,r),n=this._points[e],r=this._points[e+1];i.lineTo(n.x,n.y),i.stroke(),i.restore()},convertPointsToSVGPath:function(e){var t=this.width/1e3;return _.util.getSmoothPathFromPoints(e,t)},_isEmptySVGPath:function(e){return"M 0 0 Q 0 0 0 0 L 0 0"===_.util.joinPath(e)},createPath:function(e){var t=new _.Path(e,{fill:null,stroke:this.color,strokeWidth:this.width,strokeLineCap:this.strokeLineCap,strokeMiterLimit:this.strokeMiterLimit,strokeLineJoin:this.strokeLineJoin,strokeDashArray:this.strokeDashArray});return this.shadow&&(this.shadow.affectStroke=!0,t.shadow=new _.Shadow(this.shadow)),t},decimatePoints:function(e,t){if(e.length<=2)return e;var i,n=this.canvas.getZoom(),r=Math.pow(t/n,2),a=e.length-1,o=e[0],s=[o];for(i=1;i<a-1;i++)Math.pow(o.x-e[i].x,2)+Math.pow(o.y-e[i].y,2)>=r&&(o=e[i],s.push(o));return s.push(e[a]),s},_finalizeAndAddPath:function(){this.canvas.contextTop.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var e=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(e))this.canvas.requestRenderAll();else{var t=this.createPath(e);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:t}),this.canvas.add(t),this.canvas.requestRenderAll(),t.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:t})}}}),_.CircleBrush=_.util.createClass(_.BaseBrush,{width:10,initialize:function(e){this.canvas=e,this.points=[]},drawDot:function(e){var t=this.addPoint(e),i=this.canvas.contextTop;this._saveAndTransform(i),this.dot(i,t),i.restore()},dot:function(e,t){e.fillStyle=t.fill,e.beginPath(),e.arc(t.x,t.y,t.radius,0,2*Math.PI,!1),e.closePath(),e.fill()},onMouseDown:function(e){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(e)},_render:function(){var e,t,i=this.canvas.contextTop,n=this.points;for(this._saveAndTransform(i),e=0,t=n.length;e<t;e++)this.dot(i,n[e]);i.restore()},onMouseMove:function(e){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(e)||(this.needsFullRender()?(this.canvas.clearContext(this.canvas.contextTop),this.addPoint(e),this._render()):this.drawDot(e))},onMouseUp:function(){var e,t,i=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;var n=[];for(e=0,t=this.points.length;e<t;e++){var r=this.points[e],a=new _.Circle({radius:r.radius,left:r.x,top:r.y,originX:"center",originY:"center",fill:r.fill});this.shadow&&(a.shadow=new _.Shadow(this.shadow)),n.push(a)}var o=new _.Group(n);o.canvas=this.canvas,this.canvas.fire("before:path:created",{path:o}),this.canvas.add(o),this.canvas.fire("path:created",{path:o}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=i,this.canvas.requestRenderAll()},addPoint:function(e){var t=new _.Point(e.x,e.y),i=_.util.getRandomInt(Math.max(0,this.width-20),this.width+20)/2,n=new _.Color(this.color).setAlpha(_.util.getRandomInt(0,100)/100).toRgba();return t.radius=i,t.fill=n,this.points.push(t),t}}),_.SprayBrush=_.util.createClass(_.BaseBrush,{width:10,density:20,dotWidth:1,dotWidthVariance:1,randomOpacity:!1,optimizeOverlapping:!0,initialize:function(e){this.canvas=e,this.sprayChunks=[]},onMouseDown:function(e){this.sprayChunks.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.addSprayChunk(e),this.render(this.sprayChunkPoints)},onMouseMove:function(e){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(e)||(this.addSprayChunk(e),this.render(this.sprayChunkPoints))},onMouseUp:function(){var e=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;for(var t=[],i=0,n=this.sprayChunks.length;i<n;i++)for(var r=this.sprayChunks[i],a=0,o=r.length;a<o;a++){var s=new _.Rect({width:r[a].width,height:r[a].width,left:r[a].x+1,top:r[a].y+1,originX:"center",originY:"center",fill:this.color});t.push(s)}this.optimizeOverlapping&&(t=this._getOptimizedRects(t));var l=new _.Group(t);this.shadow&&l.set("shadow",new _.Shadow(this.shadow)),this.canvas.fire("before:path:created",{path:l}),this.canvas.add(l),this.canvas.fire("path:created",{path:l}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=e,this.canvas.requestRenderAll()},_getOptimizedRects:function(e){var t,i,n,r={};for(i=0,n=e.length;i<n;i++)r[t=e[i].left+""+e[i].top]||(r[t]=e[i]);var a=[];for(t in r)a.push(r[t]);return a},render:function(e){var t,i,n=this.canvas.contextTop;for(n.fillStyle=this.color,this._saveAndTransform(n),t=0,i=e.length;t<i;t++){var r=e[t];void 0!==r.opacity&&(n.globalAlpha=r.opacity),n.fillRect(r.x,r.y,r.width,r.width)}n.restore()},_render:function(){var e,t,i=this.canvas.contextTop;for(i.fillStyle=this.color,this._saveAndTransform(i),e=0,t=this.sprayChunks.length;e<t;e++)this.render(this.sprayChunks[e]);i.restore()},addSprayChunk:function(e){this.sprayChunkPoints=[];var t,i,n,r,a=this.width/2;for(r=0;r<this.density;r++){t=_.util.getRandomInt(e.x-a,e.x+a),i=_.util.getRandomInt(e.y-a,e.y+a),n=this.dotWidthVariance?_.util.getRandomInt(Math.max(1,this.dotWidth-this.dotWidthVariance),this.dotWidth+this.dotWidthVariance):this.dotWidth;var o=new _.Point(t,i);o.width=n,this.randomOpacity&&(o.opacity=_.util.getRandomInt(0,100)/100),this.sprayChunkPoints.push(o)}this.sprayChunks.push(this.sprayChunkPoints)}}),_.PatternBrush=_.util.createClass(_.PencilBrush,{getPatternSrc:function(){var e=_.util.createCanvasElement(),t=e.getContext("2d");return e.width=e.height=25,t.fillStyle=this.color,t.beginPath(),t.arc(10,10,10,0,2*Math.PI,!1),t.closePath(),t.fill(),e},getPatternSrcFunction:function(){return String(this.getPatternSrc).replace("this.color",'"'+this.color+'"')},getPattern:function(){return this.canvas.contextTop.createPattern(this.source||this.getPatternSrc(),"repeat")},_setBrushStyles:function(){this.callSuper("_setBrushStyles"),this.canvas.contextTop.strokeStyle=this.getPattern()},createPath:function(e){var t=this.callSuper("createPath",e),i=t._getLeftTopCoords().scalarAdd(t.strokeWidth/2);return t.stroke=new _.Pattern({source:this.source||this.getPatternSrcFunction(),offsetX:-i.x,offsetY:-i.y}),t}}),function(){var e=_.util.getPointer,t=_.util.degreesToRadians,i=_.util.isTouchEvent;for(var n in _.Canvas=_.util.createClass(_.StaticCanvas,{initialize:function(e,t){t||(t={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(e,t),this._initInteractive(),this._createCacheCanvas()},uniformScaling:!0,uniScaleKey:"shiftKey",centeredScaling:!1,centeredRotation:!1,centeredKey:"altKey",altActionKey:"shiftKey",interactive:!0,selection:!0,selectionKey:"shiftKey",altSelectionKey:null,selectionColor:"rgba(100, 100, 255, 0.3)",selectionDashArray:[],selectionBorderColor:"rgba(255, 255, 255, 0.3)",selectionLineWidth:1,selectionFullyContained:!1,hoverCursor:"move",moveCursor:"move",defaultCursor:"default",freeDrawingCursor:"crosshair",rotationCursor:"crosshair",notAllowedCursor:"not-allowed",containerClass:"canvas-container",perPixelTargetFind:!1,targetFindTolerance:0,skipTargetFind:!1,isDrawingMode:!1,preserveObjectStacking:!1,snapAngle:0,snapThreshold:null,stopContextMenu:!1,fireRightClick:!1,fireMiddleClick:!1,targets:[],_hoveredTarget:null,_hoveredTargets:[],_initInteractive:function(){this._currentTransform=null,this._groupSelector=null,this._initWrapperElement(),this._createUpperCanvas(),this._initEventListeners(),this._initRetinaScaling(),this.freeDrawingBrush=_.PencilBrush&&new _.PencilBrush(this),this.calcOffset()},_chooseObjectsToRender:function(){var e,t,i,n=this.getActiveObjects();if(n.length>0&&!this.preserveObjectStacking){t=[],i=[];for(var r=0,a=this._objects.length;r<a;r++)e=this._objects[r],-1===n.indexOf(e)?t.push(e):i.push(e);n.length>1&&(this._activeObject._objects=i),t.push.apply(t,i)}else t=this._objects;return t},renderAll:function(){!this.contextTopDirty||this._groupSelector||this.isDrawingMode||(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&this.renderTopLayer(this.contextTop);var e=this.contextContainer;return this.renderCanvas(e,this._chooseObjectsToRender()),this},renderTopLayer:function(e){e.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(e),this.contextTopDirty=!0),e.restore()},renderTop:function(){var e=this.contextTop;return this.clearContext(e),this.renderTopLayer(e),this.fire("after:render"),this},_normalizePointer:function(e,t){var i=e.calcTransformMatrix(),n=_.util.invertTransform(i),r=this.restorePointerVpt(t);return _.util.transformPoint(r,n)},isTargetTransparent:function(e,t,i){if(e.shouldCache()&&e._cacheCanvas&&e!==this._activeObject){var n=this._normalizePointer(e,{x:t,y:i}),r=Math.max(e.cacheTranslationX+n.x*e.zoomX,0),a=Math.max(e.cacheTranslationY+n.y*e.zoomY,0);return _.util.isTransparent(e._cacheContext,Math.round(r),Math.round(a),this.targetFindTolerance)}var o=this.contextCache,s=e.selectionBackgroundColor,l=this.viewportTransform;return e.selectionBackgroundColor="",this.clearContext(o),o.save(),o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),e.render(o),o.restore(),e.selectionBackgroundColor=s,_.util.isTransparent(o,t,i,this.targetFindTolerance)},_isSelectionKeyPressed:function(e){return"[object Array]"===Object.prototype.toString.call(this.selectionKey)?!!this.selectionKey.find((function(t){return!0===e[t]})):e[this.selectionKey]},_shouldClearSelection:function(e,t){var i=this.getActiveObjects(),n=this._activeObject;return!t||t&&n&&i.length>1&&-1===i.indexOf(t)&&n!==t&&!this._isSelectionKeyPressed(e)||t&&!t.evented||t&&!t.selectable&&n&&n!==t},_shouldCenterTransform:function(e,t,i){var n;if(e)return"scale"===t||"scaleX"===t||"scaleY"===t||"resizing"===t?n=this.centeredScaling||e.centeredScaling:"rotate"===t&&(n=this.centeredRotation||e.centeredRotation),n?!i:i},_getOriginFromCorner:function(e,t){var i={x:e.originX,y:e.originY};return"ml"===t||"tl"===t||"bl"===t?i.x="right":"mr"!==t&&"tr"!==t&&"br"!==t||(i.x="left"),"tl"===t||"mt"===t||"tr"===t?i.y="bottom":"bl"!==t&&"mb"!==t&&"br"!==t||(i.y="top"),i},_getActionFromCorner:function(e,t,i,n){if(!t||!e)return"drag";var r=n.controls[t];return r.getActionName(i,r,n)},_setupCurrentTransform:function(e,i,n){if(i){var r=this.getPointer(e),a=i.__corner,o=i.controls[a],s=n&&a?o.getActionHandler(e,i,o):_.controlsUtils.dragHandler,l=this._getActionFromCorner(n,a,e,i),c=this._getOriginFromCorner(i,a),h=e[this.centeredKey],u={target:i,action:l,actionHandler:s,corner:a,scaleX:i.scaleX,scaleY:i.scaleY,skewX:i.skewX,skewY:i.skewY,offsetX:r.x-i.left,offsetY:r.y-i.top,originX:c.x,originY:c.y,ex:r.x,ey:r.y,lastX:r.x,lastY:r.y,theta:t(i.angle),width:i.width*i.scaleX,shiftKey:e.shiftKey,altKey:h,original:_.util.saveObjectTransform(i)};this._shouldCenterTransform(i,l,h)&&(u.originX="center",u.originY="center"),u.original.originX=c.x,u.original.originY=c.y,this._currentTransform=u,this._beforeTransform(e)}},setCursor:function(e){this.upperCanvasEl.style.cursor=e},_drawSelection:function(e){var t=this._groupSelector,i=new _.Point(t.ex,t.ey),n=_.util.transformPoint(i,this.viewportTransform),r=new _.Point(t.ex+t.left,t.ey+t.top),a=_.util.transformPoint(r,this.viewportTransform),o=Math.min(n.x,a.x),s=Math.min(n.y,a.y),l=Math.max(n.x,a.x),c=Math.max(n.y,a.y),h=this.selectionLineWidth/2;this.selectionColor&&(e.fillStyle=this.selectionColor,e.fillRect(o,s,l-o,c-s)),this.selectionLineWidth&&this.selectionBorderColor&&(e.lineWidth=this.selectionLineWidth,e.strokeStyle=this.selectionBorderColor,o+=h,s+=h,l-=h,c-=h,_.Object.prototype._setLineDash.call(this,e,this.selectionDashArray),e.strokeRect(o,s,l-o,c-s))},findTarget:function(e,t){if(!this.skipTargetFind){var n,r,a=this.getPointer(e,!0),o=this._activeObject,s=this.getActiveObjects(),l=i(e),c=s.length>1&&!t||1===s.length;if(this.targets=[],c&&o._findTargetCorner(a,l))return o;if(s.length>1&&!t&&o===this._searchPossibleTargets([o],a))return o;if(1===s.length&&o===this._searchPossibleTargets([o],a)){if(!this.preserveObjectStacking)return o;n=o,r=this.targets,this.targets=[]}var h=this._searchPossibleTargets(this._objects,a);return e[this.altSelectionKey]&&h&&n&&h!==n&&(h=n,this.targets=r),h}},_checkTarget:function(e,t,i){if(t&&t.visible&&t.evented&&t.containsPoint(e)){if(!this.perPixelTargetFind&&!t.perPixelTargetFind||t.isEditing)return!0;if(!this.isTargetTransparent(t,i.x,i.y))return!0}},_searchPossibleTargets:function(e,t){for(var i,n,r=e.length;r--;){var a=e[r],o=a.group?this._normalizePointer(a.group,t):t;if(this._checkTarget(o,a,t)){(i=e[r]).subTargetCheck&&i instanceof _.Group&&(n=this._searchPossibleTargets(i._objects,t))&&this.targets.push(n);break}}return i},restorePointerVpt:function(e){return _.util.transformPoint(e,_.util.invertTransform(this.viewportTransform))},getPointer:function(t,i){if(this._absolutePointer&&!i)return this._absolutePointer;if(this._pointer&&i)return this._pointer;var n,r=e(t),a=this.upperCanvasEl,o=a.getBoundingClientRect(),s=o.width||0,l=o.height||0;s&&l||("top"in o&&"bottom"in o&&(l=Math.abs(o.top-o.bottom)),"right"in o&&"left"in o&&(s=Math.abs(o.right-o.left))),this.calcOffset(),r.x=r.x-this._offset.left,r.y=r.y-this._offset.top,i||(r=this.restorePointerVpt(r));var c=this.getRetinaScaling();return 1!==c&&(r.x/=c,r.y/=c),n=0===s||0===l?{width:1,height:1}:{width:a.width/s,height:a.height/l},{x:r.x*n.width,y:r.y*n.height}},_createUpperCanvas:function(){var e=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),t=this.lowerCanvasEl,i=this.upperCanvasEl;i?i.className="":(i=this._createCanvasElement(),this.upperCanvasEl=i),_.util.addClass(i,"upper-canvas "+e),this.wrapperEl.appendChild(i),this._copyCanvasStyle(t,i),this._applyCanvasStyle(i),this.contextTop=i.getContext("2d")},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=_.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),_.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),_.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(e){var t=this.width||e.width,i=this.height||e.height;_.util.setStyle(e,{position:"absolute",width:t+"px",height:i+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),e.width=t,e.height=i,_.util.makeElementUnselectable(e)},_copyCanvasStyle:function(e,t){t.style.cssText=e.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var e=this._activeObject;return e?"activeSelection"===e.type&&e._objects?e._objects.slice(0):[e]:[]},_onObjectRemoved:function(e){e===this._activeObject&&(this.fire("before:selection:cleared",{target:e}),this._discardActiveObject(),this.fire("selection:cleared",{target:e}),e.fire("deselected")),e===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",e)},_fireSelectionEvents:function(e,t){var i=!1,n=this.getActiveObjects(),r=[],a=[];e.forEach((function(e){-1===n.indexOf(e)&&(i=!0,e.fire("deselected",{e:t,target:e}),a.push(e))})),n.forEach((function(n){-1===e.indexOf(n)&&(i=!0,n.fire("selected",{e:t,target:n}),r.push(n))})),e.length>0&&n.length>0?i&&this.fire("selection:updated",{e:t,selected:r,deselected:a,updated:r[0]||a[0],target:this._activeObject}):n.length>0?this.fire("selection:created",{e:t,selected:r,target:this._activeObject}):e.length>0&&this.fire("selection:cleared",{e:t,deselected:a})},setActiveObject:function(e,t){var i=this.getActiveObjects();return this._setActiveObject(e,t),this._fireSelectionEvents(i,t),this},_setActiveObject:function(e,t){return this._activeObject!==e&&(!!this._discardActiveObject(t,e)&&(!e.onSelect({e:t})&&(this._activeObject=e,!0)))},_discardActiveObject:function(e,t){var i=this._activeObject;if(i){if(i.onDeselect({e:e,object:t}))return!1;this._activeObject=null}return!0},discardActiveObject:function(e){var t=this.getActiveObjects(),i=this.getActiveObject();return t.length&&this.fire("before:selection:cleared",{target:i,e:e}),this._discardActiveObject(e),this._fireSelectionEvents(t,e),this},dispose:function(){var e=this.wrapperEl;return this.removeListeners(),e.removeChild(this.upperCanvasEl),e.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(e){_.util.cleanUpJsdomNode(this[e]),this[e]=void 0}.bind(this)),e.parentNode&&e.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,_.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(e){var t=this._activeObject;t&&t._renderControls(e)},_toObject:function(e,t,i){var n=this._realizeGroupTransformOnObject(e),r=this.callSuper("_toObject",e,t,i);return this._unwindGroupTransformOnObject(e,n),r},_realizeGroupTransformOnObject:function(e){if(e.group&&"activeSelection"===e.group.type&&this._activeObject===e.group){var t={};return["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"].forEach((function(i){t[i]=e[i]})),_.util.addTransformToObject(e,this._activeObject.calcOwnMatrix()),t}return null},_unwindGroupTransformOnObject:function(e,t){t&&e.set(t)},_setSVGObject:function(e,t,i){var n=this._realizeGroupTransformOnObject(t);this.callSuper("_setSVGObject",e,t,i),this._unwindGroupTransformOnObject(t,n)},setViewportTransform:function(e){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),_.StaticCanvas.prototype.setViewportTransform.call(this,e)}}),_.StaticCanvas)"prototype"!==n&&(_.Canvas[n]=_.StaticCanvas[n])}(),function(){var e=_.util.addListener,t=_.util.removeListener,i={passive:!1};function n(e,t){return e.button&&e.button===t-1}_.util.object.extend(_.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(e,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(e,t){var n=this.upperCanvasEl,r=this._getEventPrefix();e(_.window,"resize",this._onResize),e(n,r+"down",this._onMouseDown),e(n,r+"move",this._onMouseMove,i),e(n,r+"out",this._onMouseOut),e(n,r+"enter",this._onMouseEnter),e(n,"wheel",this._onMouseWheel),e(n,"contextmenu",this._onContextMenu),e(n,"dblclick",this._onDoubleClick),e(n,"dragover",this._onDragOver),e(n,"dragenter",this._onDragEnter),e(n,"dragleave",this._onDragLeave),e(n,"drop",this._onDrop),this.enablePointerEvents||e(n,"touchstart",this._onTouchStart,i),"undefined"!=typeof eventjs&&t in eventjs&&(eventjs[t](n,"gesture",this._onGesture),eventjs[t](n,"drag",this._onDrag),eventjs[t](n,"orientation",this._onOrientationChange),eventjs[t](n,"shake",this._onShake),eventjs[t](n,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(t,"remove");var e=this._getEventPrefix();t(_.document,e+"up",this._onMouseUp),t(_.document,"touchend",this._onTouchEnd,i),t(_.document,e+"move",this._onMouseMove,i),t(_.document,"touchmove",this._onMouseMove,i)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._simpleEventHandler.bind(this,"drop"),this.eventsBound=!0)},_onGesture:function(e,t){this.__onTransformGesture&&this.__onTransformGesture(e,t)},_onDrag:function(e,t){this.__onDrag&&this.__onDrag(e,t)},_onMouseWheel:function(e){this.__onMouseWheel(e)},_onMouseOut:function(e){var t=this._hoveredTarget;this.fire("mouse:out",{target:t,e:e}),this._hoveredTarget=null,t&&t.fire("mouseout",{e:e});var i=this;this._hoveredTargets.forEach((function(n){i.fire("mouse:out",{target:t,e:e}),n&&t.fire("mouseout",{e:e})})),this._hoveredTargets=[],this._iTextInstances&&this._iTextInstances.forEach((function(e){e.isEditing&&e.hiddenTextarea.focus()}))},_onMouseEnter:function(e){this._currentTransform||this.findTarget(e)||(this.fire("mouse:over",{target:null,e:e}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(e,t){this.__onOrientationChange&&this.__onOrientationChange(e,t)},_onShake:function(e,t){this.__onShake&&this.__onShake(e,t)},_onLongPress:function(e,t){this.__onLongPress&&this.__onLongPress(e,t)},_onDragOver:function(e){e.preventDefault();var t=this._simpleEventHandler("dragover",e);this._fireEnterLeaveEvents(t,e)},_onContextMenu:function(e){return this.stopContextMenu&&(e.stopPropagation(),e.preventDefault()),!1},_onDoubleClick:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"dblclick"),this._resetTransformEventData(e)},getPointerId:function(e){var t=e.changedTouches;return t?t[0]&&t[0].identifier:this.enablePointerEvents?e.pointerId:-1},_isMainEvent:function(e){return!0===e.isPrimary||!1!==e.isPrimary&&("touchend"===e.type&&0===e.touches.length||(!e.changedTouches||e.changedTouches[0].identifier===this.mainTouchId))},_onTouchStart:function(n){n.preventDefault(),null===this.mainTouchId&&(this.mainTouchId=this.getPointerId(n)),this.__onMouseDown(n),this._resetTransformEventData();var r=this.upperCanvasEl,a=this._getEventPrefix();e(_.document,"touchend",this._onTouchEnd,i),e(_.document,"touchmove",this._onMouseMove,i),t(r,a+"down",this._onMouseDown)},_onMouseDown:function(n){this.__onMouseDown(n),this._resetTransformEventData();var r=this.upperCanvasEl,a=this._getEventPrefix();t(r,a+"move",this._onMouseMove,i),e(_.document,a+"up",this._onMouseUp),e(_.document,a+"move",this._onMouseMove,i)},_onTouchEnd:function(n){if(!(n.touches.length>0)){this.__onMouseUp(n),this._resetTransformEventData(),this.mainTouchId=null;var r=this._getEventPrefix();t(_.document,"touchend",this._onTouchEnd,i),t(_.document,"touchmove",this._onMouseMove,i);var a=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout((function(){e(a.upperCanvasEl,r+"down",a._onMouseDown),a._willAddMouseDown=0}),400)}},_onMouseUp:function(n){this.__onMouseUp(n),this._resetTransformEventData();var r=this.upperCanvasEl,a=this._getEventPrefix();this._isMainEvent(n)&&(t(_.document,a+"up",this._onMouseUp),t(_.document,a+"move",this._onMouseMove,i),e(r,a+"move",this._onMouseMove,i))},_onMouseMove:function(e){!this.allowTouchScrolling&&e.preventDefault&&e.preventDefault(),this.__onMouseMove(e)},_onResize:function(){this.calcOffset()},_shouldRender:function(e){var t=this._activeObject;return!!(!!t!=!!e||t&&e&&t!==e)||(t&&t.isEditing,!1)},__onMouseUp:function(e){var t,i=this._currentTransform,r=this._groupSelector,a=!1,o=!r||0===r.left&&0===r.top;if(this._cacheTransformEventData(e),t=this._target,this._handleEvent(e,"up:before"),n(e,3))this.fireRightClick&&this._handleEvent(e,"up",3,o);else{if(n(e,2))return this.fireMiddleClick&&this._handleEvent(e,"up",2,o),void this._resetTransformEventData();if(this.isDrawingMode&&this._isCurrentlyDrawing)this._onMouseUpInDrawingMode(e);else if(this._isMainEvent(e)){if(i&&(this._finalizeCurrentTransform(e),a=i.actionPerformed),!o){var s=t===this._activeObject;this._maybeGroupObjects(e),a||(a=this._shouldRender(t)||!s&&t===this._activeObject)}if(t){if(t.selectable&&t!==this._activeObject&&"up"===t.activeOn)this.setActiveObject(t,e),a=!0;else{var l=t._findTargetCorner(this.getPointer(e,!0),_.util.isTouchEvent(e)),c=t.controls[l],h=c&&c.getMouseUpHandler(e,t,c);if(h){var u=this.getPointer(e);h(e,i,u.x,u.y)}}t.isMoving=!1}this._setCursorFromEvent(e,t),this._handleEvent(e,"up",1,o),this._groupSelector=null,this._currentTransform=null,t&&(t.__corner=0),a?this.requestRenderAll():o||this.renderTop()}}},_simpleEventHandler:function(e,t){var i=this.findTarget(t),n=this.targets,r={e:t,target:i,subTargets:n};if(this.fire(e,r),i&&i.fire(e,r),!n)return i;for(var a=0;a<n.length;a++)n[a].fire(e,r);return i},_handleEvent:function(e,t,i,n){var r=this._target,a=this.targets||[],o={e:e,target:r,subTargets:a,button:i||1,isClick:n||!1,pointer:this._pointer,absolutePointer:this._absolutePointer,transform:this._currentTransform};"up"===t&&(o.currentTarget=this.findTarget(e),o.currentSubTargets=this.targets),this.fire("mouse:"+t,o),r&&r.fire("mouse"+t,o);for(var s=0;s<a.length;s++)a[s].fire("mouse"+t,o)},_finalizeCurrentTransform:function(e){var t,i=this._currentTransform,n=i.target,r={e:e,target:n,transform:i,action:i.action};n._scaling&&(n._scaling=!1),n.setCoords(),(i.actionPerformed||this.stateful&&n.hasStateChanged())&&(i.actionPerformed&&(t=this._addEventOptions(r,i),this._fire(t,r)),this._fire("modified",r))},_addEventOptions:function(e,t){var i,n;switch(t.action){case"scaleX":i="scaled",n="x";break;case"scaleY":i="scaled",n="y";break;case"skewX":i="skewed",n="x";break;case"skewY":i="skewed",n="y";break;case"scale":i="scaled",n="equally";break;case"rotate":i="rotated";break;case"drag":i="moved"}return e.by=n,i},_onMouseDownInDrawingMode:function(e){this._isCurrentlyDrawing=!0,this.getActiveObject()&&this.discardActiveObject(e).requestRenderAll();var t=this.getPointer(e);this.freeDrawingBrush.onMouseDown(t,{e:e,pointer:t}),this._handleEvent(e,"down")},_onMouseMoveInDrawingMode:function(e){if(this._isCurrentlyDrawing){var t=this.getPointer(e);this.freeDrawingBrush.onMouseMove(t,{e:e,pointer:t})}this.setCursor(this.freeDrawingCursor),this._handleEvent(e,"move")},_onMouseUpInDrawingMode:function(e){var t=this.getPointer(e);this._isCurrentlyDrawing=this.freeDrawingBrush.onMouseUp({e:e,pointer:t}),this._handleEvent(e,"up")},__onMouseDown:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"down:before");var t=this._target;if(n(e,3))this.fireRightClick&&this._handleEvent(e,"down",3);else if(n(e,2))this.fireMiddleClick&&this._handleEvent(e,"down",2);else if(this.isDrawingMode)this._onMouseDownInDrawingMode(e);else if(this._isMainEvent(e)&&!this._currentTransform){var i=this._pointer;this._previousPointer=i;var r=this._shouldRender(t),a=this._shouldGroup(e,t);if(this._shouldClearSelection(e,t)?this.discardActiveObject(e):a&&(this._handleGrouping(e,t),t=this._activeObject),!this.selection||t&&(t.selectable||t.isEditing||t===this._activeObject)||(this._groupSelector={ex:this._absolutePointer.x,ey:this._absolutePointer.y,top:0,left:0}),t){var o=t===this._activeObject;t.selectable&&"down"===t.activeOn&&this.setActiveObject(t,e);var s=t._findTargetCorner(this.getPointer(e,!0),_.util.isTouchEvent(e));if(t.__corner=s,t===this._activeObject&&(s||!a)){this._setupCurrentTransform(e,t,o);var l=t.controls[s],c=(i=this.getPointer(e),l&&l.getMouseDownHandler(e,t,l));c&&c(e,this._currentTransform,i.x,i.y)}}this._handleEvent(e,"down"),(r||a)&&this.requestRenderAll()}},_resetTransformEventData:function(){this._target=null,this._pointer=null,this._absolutePointer=null},_cacheTransformEventData:function(e){this._resetTransformEventData(),this._pointer=this.getPointer(e,!0),this._absolutePointer=this.restorePointerVpt(this._pointer),this._target=this._currentTransform?this._currentTransform.target:this.findTarget(e)||null},_beforeTransform:function(e){var t=this._currentTransform;this.stateful&&t.target.saveState(),this.fire("before:transform",{e:e,transform:t})},__onMouseMove:function(e){var t,i;if(this._handleEvent(e,"move:before"),this._cacheTransformEventData(e),this.isDrawingMode)this._onMouseMoveInDrawingMode(e);else if(this._isMainEvent(e)){var n=this._groupSelector;n?(i=this._absolutePointer,n.left=i.x-n.ex,n.top=i.y-n.ey,this.renderTop()):this._currentTransform?this._transformObject(e):(t=this.findTarget(e)||null,this._setCursorFromEvent(e,t),this._fireOverOutEvents(t,e)),this._handleEvent(e,"move"),this._resetTransformEventData()}},_fireOverOutEvents:function(e,t){var i=this._hoveredTarget,n=this._hoveredTargets,r=this.targets,a=Math.max(n.length,r.length);this.fireSyntheticInOutEvents(e,t,{oldTarget:i,evtOut:"mouseout",canvasEvtOut:"mouse:out",evtIn:"mouseover",canvasEvtIn:"mouse:over"});for(var o=0;o<a;o++)this.fireSyntheticInOutEvents(r[o],t,{oldTarget:n[o],evtOut:"mouseout",evtIn:"mouseover"});this._hoveredTarget=e,this._hoveredTargets=this.targets.concat()},_fireEnterLeaveEvents:function(e,t){var i=this._draggedoverTarget,n=this._hoveredTargets,r=this.targets,a=Math.max(n.length,r.length);this.fireSyntheticInOutEvents(e,t,{oldTarget:i,evtOut:"dragleave",evtIn:"dragenter"});for(var o=0;o<a;o++)this.fireSyntheticInOutEvents(r[o],t,{oldTarget:n[o],evtOut:"dragleave",evtIn:"dragenter"});this._draggedoverTarget=e},fireSyntheticInOutEvents:function(e,t,i){var n,r,a,o=i.oldTarget,s=o!==e,l=i.canvasEvtIn,c=i.canvasEvtOut;s&&(n={e:t,target:e,previousTarget:o},r={e:t,target:o,nextTarget:e}),a=e&&s,o&&s&&(c&&this.fire(c,r),o.fire(i.evtOut,r)),a&&(l&&this.fire(l,n),e.fire(i.evtIn,n))},__onMouseWheel:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"wheel"),this._resetTransformEventData()},_transformObject:function(e){var t=this.getPointer(e),i=this._currentTransform;i.reset=!1,i.shiftKey=e.shiftKey,i.altKey=e[this.centeredKey],this._performTransformAction(e,i,t),i.actionPerformed&&this.requestRenderAll()},_performTransformAction:function(e,t,i){var n=i.x,r=i.y,a=t.action,o=!1,s=t.actionHandler;s&&(o=s(e,t,n,r)),"drag"===a&&o&&(t.target.isMoving=!0,this.setCursor(t.target.moveCursor||this.moveCursor)),t.actionPerformed=t.actionPerformed||o},_fire:_.controlsUtils.fireEvent,_setCursorFromEvent:function(e,t){if(!t)return this.setCursor(this.defaultCursor),!1;var i=t.hoverCursor||this.hoverCursor,n=this._activeObject&&"activeSelection"===this._activeObject.type?this._activeObject:null,r=(!n||!n.contains(t))&&t._findTargetCorner(this.getPointer(e,!0));r?this.setCursor(this.getCornerCursor(r,t,e)):(t.subTargetCheck&&this.targets.concat().reverse().map((function(e){i=e.hoverCursor||i})),this.setCursor(i))},getCornerCursor:function(e,t,i){var n=t.controls[e];return n.cursorStyleHandler(i,n,t)}})}(),p=Math.min,y=Math.max,_.util.object.extend(_.Canvas.prototype,{_shouldGroup:function(e,t){var i=this._activeObject;return i&&this._isSelectionKeyPressed(e)&&t&&t.selectable&&this.selection&&(i!==t||"activeSelection"===i.type)&&!t.onSelect({e:e})},_handleGrouping:function(e,t){var i=this._activeObject;i.__corner||(t!==i||(t=this.findTarget(e,!0))&&t.selectable)&&(i&&"activeSelection"===i.type?this._updateActiveSelection(t,e):this._createActiveSelection(t,e))},_updateActiveSelection:function(e,t){var i=this._activeObject,n=i._objects.slice(0);i.contains(e)?(i.removeWithUpdate(e),this._hoveredTarget=e,this._hoveredTargets=this.targets.concat(),1===i.size()&&this._setActiveObject(i.item(0),t)):(i.addWithUpdate(e),this._hoveredTarget=i,this._hoveredTargets=this.targets.concat()),this._fireSelectionEvents(n,t)},_createActiveSelection:function(e,t){var i=this.getActiveObjects(),n=this._createGroup(e);this._hoveredTarget=n,this._setActiveObject(n,t),this._fireSelectionEvents(i,t)},_createGroup:function(e){var t=this._objects,i=t.indexOf(this._activeObject)<t.indexOf(e)?[this._activeObject,e]:[e,this._activeObject];return this._activeObject.isEditing&&this._activeObject.exitEditing(),new _.ActiveSelection(i,{canvas:this})},_groupSelectedObjects:function(e){var t,i=this._collectObjects(e);1===i.length?this.setActiveObject(i[0],e):i.length>1&&(t=new _.ActiveSelection(i.reverse(),{canvas:this}),this.setActiveObject(t,e))},_collectObjects:function(e){for(var t,i=[],n=this._groupSelector.ex,r=this._groupSelector.ey,a=n+this._groupSelector.left,o=r+this._groupSelector.top,s=new _.Point(p(n,a),p(r,o)),l=new _.Point(y(n,a),y(r,o)),c=!this.selectionFullyContained,h=n===a&&r===o,u=this._objects.length;u--&&!((t=this._objects[u])&&t.selectable&&t.visible&&(c&&t.intersectsWithRect(s,l,!0)||t.isContainedWithinRect(s,l,!0)||c&&t.containsPoint(s,null,!0)||c&&t.containsPoint(l,null,!0))&&(i.push(t),h)););return i.length>1&&(i=i.filter((function(t){return!t.onSelect({e:e})}))),i},_maybeGroupObjects:function(e){this.selection&&this._groupSelector&&this._groupSelectedObjects(e),this.setCursor(this.defaultCursor),this._groupSelector=null}}),_.util.object.extend(_.StaticCanvas.prototype,{toDataURL:function(e){e||(e={});var t=e.format||"png",i=e.quality||1,n=(e.multiplier||1)*(e.enableRetinaScaling?this.getRetinaScaling():1),r=this.toCanvasElement(n,e);return _.util.toDataURL(r,t,i)},toCanvasElement:function(e,t){e=e||1;var i=((t=t||{}).width||this.width)*e,n=(t.height||this.height)*e,r=this.getZoom(),a=this.width,o=this.height,s=r*e,l=this.viewportTransform,c=(l[4]-(t.left||0))*e,h=(l[5]-(t.top||0))*e,u=this.interactive,f=[s,0,0,s,c,h],d=this.enableRetinaScaling,m=_.util.createCanvasElement(),g=this.contextTop;return m.width=i,m.height=n,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=f,this.width=i,this.height=n,this.calcViewportBoundaries(),this.renderCanvas(m.getContext("2d"),this._objects),this.viewportTransform=l,this.width=a,this.height=o,this.calcViewportBoundaries(),this.interactive=u,this.enableRetinaScaling=d,this.contextTop=g,m}}),_.util.object.extend(_.StaticCanvas.prototype,{loadFromJSON:function(e,t,i){if(e){var n="string"==typeof e?JSON.parse(e):_.util.object.clone(e),r=this,a=n.clipPath,o=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete n.clipPath,this._enlivenObjects(n.objects,(function(e){r.clear(),r._setBgOverlay(n,(function(){a?r._enlivenObjects([a],(function(i){r.clipPath=i[0],r.__setupCanvas.call(r,n,e,o,t)})):r.__setupCanvas.call(r,n,e,o,t)}))}),i),this}},__setupCanvas:function(e,t,i,n){var r=this;t.forEach((function(e,t){r.insertAt(e,t)})),this.renderOnAddRemove=i,delete e.objects,delete e.backgroundImage,delete e.overlayImage,delete e.background,delete e.overlay,this._setOptions(e),this.renderAll(),n&&n()},_setBgOverlay:function(e,t){var i={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(e.backgroundImage||e.overlayImage||e.background||e.overlay){var n=function(){i.backgroundImage&&i.overlayImage&&i.backgroundColor&&i.overlayColor&&t&&t()};this.__setBgOverlay("backgroundImage",e.backgroundImage,i,n),this.__setBgOverlay("overlayImage",e.overlayImage,i,n),this.__setBgOverlay("backgroundColor",e.background,i,n),this.__setBgOverlay("overlayColor",e.overlay,i,n)}else t&&t()},__setBgOverlay:function(e,t,i,n){var r=this;if(!t)return i[e]=!0,void(n&&n());"backgroundImage"===e||"overlayImage"===e?_.util.enlivenObjects([t],(function(t){r[e]=t[0],i[e]=!0,n&&n()})):this["set"+_.util.string.capitalize(e,!0)](t,(function(){i[e]=!0,n&&n()}))},_enlivenObjects:function(e,t,i){e&&0!==e.length?_.util.enlivenObjects(e,(function(e){t&&t(e)}),null,i):t&&t([])},_toDataURL:function(e,t){this.clone((function(i){t(i.toDataURL(e))}))},_toDataURLWithMultiplier:function(e,t,i){this.clone((function(n){i(n.toDataURLWithMultiplier(e,t))}))},clone:function(e,t){var i=JSON.stringify(this.toJSON(t));this.cloneWithoutData((function(t){t.loadFromJSON(i,(function(){e&&e(t)}))}))},cloneWithoutData:function(e){var t=_.util.createCanvasElement();t.width=this.width,t.height=this.height;var i=new _.Canvas(t);this.backgroundImage?(i.setBackgroundImage(this.backgroundImage.src,(function(){i.renderAll(),e&&e(i)})),i.backgroundImageOpacity=this.backgroundImageOpacity,i.backgroundImageStretch=this.backgroundImageStretch):e&&e(i)}}),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend,n=t.util.object.clone,r=t.util.toFixed,a=t.util.string.capitalize,o=t.util.degreesToRadians,s=!t.isLikelyNode;t.Object||(t.Object=t.util.createClass(t.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:s,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(e){e&&this.setOptions(e)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=t.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(e){var i=t.perfLimitSizeTotal,n=e.width,r=e.height,a=t.maxCacheSideLimit,o=t.minCacheSideLimit;if(n<=a&&r<=a&&n*r<=i)return n<o&&(e.width=o),r<o&&(e.height=o),e;var s=n/r,l=t.util.limitDimsByArea(s,i),c=t.util.capValue,h=c(o,l.x,a),u=c(o,l.y,a);return n>h&&(e.zoomX/=n/h,e.width=h,e.capped=!0),r>u&&(e.zoomY/=r/u,e.height=u,e.capped=!0),e},_getCacheCanvasDimensions:function(){var e=this.getTotalObjectScaling(),t=this._getTransformedDimensions(0,0),i=t.x*e.scaleX/this.scaleX,n=t.y*e.scaleY/this.scaleY;return{width:i+2,height:n+2,zoomX:e.scaleX,zoomY:e.scaleY,x:i,y:n}},_updateCacheCanvas:function(){var e=this.canvas;if(this.noScaleCache&&e&&e._currentTransform){var i=e._currentTransform.target,n=e._currentTransform.action;if(this===i&&n.slice&&"scale"===n.slice(0,5))return!1}var r,a,o=this._cacheCanvas,s=this._limitCacheSize(this._getCacheCanvasDimensions()),l=t.minCacheSideLimit,c=s.width,h=s.height,u=s.zoomX,f=s.zoomY,d=c!==this.cacheWidth||h!==this.cacheHeight,m=this.zoomX!==u||this.zoomY!==f,g=d||m,v=0,p=0,y=!1;if(d){var b=this._cacheCanvas.width,w=this._cacheCanvas.height,x=c>b||h>w;y=x||(c<.9*b||h<.9*w)&&b>l&&w>l,x&&!s.capped&&(c>l||h>l)&&(v=.1*c,p=.1*h)}return this instanceof t.Text&&this.path&&(g=!0,y=!0,v+=this.getHeightOfLine(0)*this.zoomX,p+=this.getHeightOfLine(0)*this.zoomY),!!g&&(y?(o.width=Math.ceil(c+v),o.height=Math.ceil(h+p)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,o.width,o.height)),r=s.x/2,a=s.y/2,this.cacheTranslationX=Math.round(o.width/2-r)+r,this.cacheTranslationY=Math.round(o.height/2-a)+a,this.cacheWidth=c,this.cacheHeight=h,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(u,f),this.zoomX=u,this.zoomY=f,!0)},setOptions:function(e){this._setOptions(e),this._initGradient(e.fill,"fill"),this._initGradient(e.stroke,"stroke"),this._initPattern(e.fill,"fill"),this._initPattern(e.stroke,"stroke")},transform:function(e){var t=this.group&&!this.group._transformDone||this.group&&this.canvas&&e===this.canvas.contextTop,i=this.calcTransformMatrix(!t);e.transform(i[0],i[1],i[2],i[3],i[4],i[5])},toObject:function(e){var i=t.Object.NUM_FRACTION_DIGITS,n={type:this.type,version:t.version,originX:this.originX,originY:this.originY,left:r(this.left,i),top:r(this.top,i),width:r(this.width,i),height:r(this.height,i),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:r(this.strokeWidth,i),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:r(this.strokeMiterLimit,i),scaleX:r(this.scaleX,i),scaleY:r(this.scaleY,i),angle:r(this.angle,i),flipX:this.flipX,flipY:this.flipY,opacity:r(this.opacity,i),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:r(this.skewX,i),skewY:r(this.skewY,i)};return this.clipPath&&!this.clipPath.excludeFromExport&&(n.clipPath=this.clipPath.toObject(e),n.clipPath.inverted=this.clipPath.inverted,n.clipPath.absolutePositioned=this.clipPath.absolutePositioned),t.util.populateWithProperties(this,n,e),this.includeDefaultValues||(n=this._removeDefaultValues(n)),n},toDatalessObject:function(e){return this.toObject(e)},_removeDefaultValues:function(e){var i=t.util.getKlass(e.type).prototype;return i.stateProperties.forEach((function(t){"left"!==t&&"top"!==t&&(e[t]===i[t]&&delete e[t],"[object Array]"===Object.prototype.toString.call(e[t])&&"[object Array]"===Object.prototype.toString.call(i[t])&&0===e[t].length&&0===i[t].length&&delete e[t])})),e},toString:function(){return"#<fabric."+a(this.type)+">"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var e=t.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(e.scaleX),scaleY:Math.abs(e.scaleY)}},getTotalObjectScaling:function(){var e=this.getObjectScaling(),t=e.scaleX,i=e.scaleY;if(this.canvas){var n=this.canvas.getZoom(),r=this.canvas.getRetinaScaling();t*=n*r,i*=n*r}return{scaleX:t,scaleY:i}},getObjectOpacity:function(){var e=this.opacity;return this.group&&(e*=this.group.getObjectOpacity()),e},_set:function(e,i){var n="scaleX"===e||"scaleY"===e,r=this[e]!==i,a=!1;return n&&(i=this._constrainScale(i)),"scaleX"===e&&i<0?(this.flipX=!this.flipX,i*=-1):"scaleY"===e&&i<0?(this.flipY=!this.flipY,i*=-1):"shadow"!==e||!i||i instanceof t.Shadow?"dirty"===e&&this.group&&this.group.set("dirty",i):i=new t.Shadow(i),this[e]=i,r&&(a=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(e)>-1?(this.dirty=!0,a&&this.group.set("dirty",!0)):a&&this.stateProperties.indexOf(e)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:t.iMatrix.concat()},isNotVisible:function(){return 0===this.opacity||!this.width&&!this.height&&0===this.strokeWidth||!this.visible},render:function(e){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(e.save(),this._setupCompositeOperation(e),this.drawSelectionBackground(e),this.transform(e),this._setOpacity(e),this._setShadow(e,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(e)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(e),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),e.restore())},renderCache:function(e){e=e||{},this._cacheCanvas||this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,e.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&"transparent"!==this.stroke&&0!==this.strokeWidth},hasFill:function(){return this.fill&&"transparent"!==this.fill},needsItsOwnCache:function(){return!("stroke"!==this.paintFirst||!this.hasFill()||!this.hasStroke()||"object"!=typeof this.shadow)||!!this.clipPath},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(0!==this.shadow.offsetX||0!==this.shadow.offsetY)},drawClipPathOnCache:function(e){var i=this.clipPath;if(e.save(),i.inverted?e.globalCompositeOperation="destination-out":e.globalCompositeOperation="destination-in",i.absolutePositioned){var n=t.util.invertTransform(this.calcTransformMatrix());e.transform(n[0],n[1],n[2],n[3],n[4],n[5])}i.transform(e),e.scale(1/i.zoomX,1/i.zoomY),e.drawImage(i._cacheCanvas,-i.cacheTranslationX,-i.cacheTranslationY),e.restore()},drawObject:function(e,t){var i=this.fill,n=this.stroke;t?(this.fill="black",this.stroke="",this._setClippingProperties(e)):this._renderBackground(e),this._render(e),this._drawClipPath(e),this.fill=i,this.stroke=n},_drawClipPath:function(e){var t=this.clipPath;t&&(t.canvas=this.canvas,t.shouldCache(),t._transformDone=!0,t.renderCache({forClipping:!0}),this.drawClipPathOnCache(e))},drawCacheOnCanvas:function(e){e.scale(1/this.zoomX,1/this.zoomY),e.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(e){if(this.isNotVisible())return!1;if(this._cacheCanvas&&!e&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&!e){var t=this.cacheWidth/this.zoomX,i=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-t/2,-i/2,t,i)}return!0}return!1},_renderBackground:function(e){if(this.backgroundColor){var t=this._getNonTransformedDimensions();e.fillStyle=this.backgroundColor,e.fillRect(-t.x/2,-t.y/2,t.x,t.y),this._removeShadow(e)}},_setOpacity:function(e){this.group&&!this.group._transformDone?e.globalAlpha=this.getObjectOpacity():e.globalAlpha*=this.opacity},_setStrokeStyles:function(e,t){var i=t.stroke;i&&(e.lineWidth=t.strokeWidth,e.lineCap=t.strokeLineCap,e.lineDashOffset=t.strokeDashOffset,e.lineJoin=t.strokeLineJoin,e.miterLimit=t.strokeMiterLimit,i.toLive?"percentage"===i.gradientUnits||i.gradientTransform||i.patternTransform?this._applyPatternForTransformedGradient(e,i):(e.strokeStyle=i.toLive(e,this),this._applyPatternGradientTransform(e,i)):e.strokeStyle=t.stroke)},_setFillStyles:function(e,t){var i=t.fill;i&&(i.toLive?(e.fillStyle=i.toLive(e,this),this._applyPatternGradientTransform(e,t.fill)):e.fillStyle=i)},_setClippingProperties:function(e){e.globalAlpha=1,e.strokeStyle="transparent",e.fillStyle="#000000"},_setLineDash:function(e,t){t&&0!==t.length&&(1&t.length&&t.push.apply(t,t),e.setLineDash(t))},_renderControls:function(e,i){var n,r,a,s=this.getViewportTransform(),l=this.calcTransformMatrix();r=void 0!==(i=i||{}).hasBorders?i.hasBorders:this.hasBorders,a=void 0!==i.hasControls?i.hasControls:this.hasControls,l=t.util.multiplyTransformMatrices(s,l),n=t.util.qrDecompose(l),e.save(),e.translate(n.translateX,n.translateY),e.lineWidth=1*this.borderScaleFactor,this.group||(e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),e.rotate(o(n.angle)),i.forActiveSelection||this.group?r&&this.drawBordersInGroup(e,n,i):r&&this.drawBorders(e,i),a&&this.drawControls(e,i),e.restore()},_setShadow:function(e){if(this.shadow){var i,n=this.shadow,r=this.canvas,a=r&&r.viewportTransform[0]||1,o=r&&r.viewportTransform[3]||1;i=n.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),r&&r._isRetinaScaling()&&(a*=t.devicePixelRatio,o*=t.devicePixelRatio),e.shadowColor=n.color,e.shadowBlur=n.blur*t.browserShadowBlurConstant*(a+o)*(i.scaleX+i.scaleY)/4,e.shadowOffsetX=n.offsetX*a*i.scaleX,e.shadowOffsetY=n.offsetY*o*i.scaleY}},_removeShadow:function(e){this.shadow&&(e.shadowColor="",e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0)},_applyPatternGradientTransform:function(e,t){if(!t||!t.toLive)return{offsetX:0,offsetY:0};var i=t.gradientTransform||t.patternTransform,n=-this.width/2+t.offsetX||0,r=-this.height/2+t.offsetY||0;return"percentage"===t.gradientUnits?e.transform(this.width,0,0,this.height,n,r):e.transform(1,0,0,1,n,r),i&&e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),{offsetX:n,offsetY:r}},_renderPaintInOrder:function(e){"stroke"===this.paintFirst?(this._renderStroke(e),this._renderFill(e)):(this._renderFill(e),this._renderStroke(e))},_render:function(){},_renderFill:function(e){this.fill&&(e.save(),this._setFillStyles(e,this),"evenodd"===this.fillRule?e.fill("evenodd"):e.fill(),e.restore())},_renderStroke:function(e){if(this.stroke&&0!==this.strokeWidth){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(e),e.save(),this.strokeUniform&&this.group){var t=this.getObjectScaling();e.scale(1/t.scaleX,1/t.scaleY)}else this.strokeUniform&&e.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(e,this.strokeDashArray),this._setStrokeStyles(e,this),e.stroke(),e.restore()}},_applyPatternForTransformedGradient:function(e,i){var n,r=this._limitCacheSize(this._getCacheCanvasDimensions()),a=t.util.createCanvasElement(),o=this.canvas.getRetinaScaling(),s=r.x/this.scaleX/o,l=r.y/this.scaleY/o;a.width=s,a.height=l,(n=a.getContext("2d")).beginPath(),n.moveTo(0,0),n.lineTo(s,0),n.lineTo(s,l),n.lineTo(0,l),n.closePath(),n.translate(s/2,l/2),n.scale(r.zoomX/this.scaleX/o,r.zoomY/this.scaleY/o),this._applyPatternGradientTransform(n,i),n.fillStyle=i.toLive(e),n.fill(),e.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),e.scale(o*this.scaleX/r.zoomX,o*this.scaleY/r.zoomY),e.strokeStyle=n.createPattern(a,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var e=t.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",e.scaleX),this.set("scaleY",e.scaleY),this.angle=e.angle,this.skewX=e.skewX,this.skewY=0}},_removeTransformMatrix:function(e){var i=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),i=t.util.transformPoint(i,this.transformMatrix)),this.transformMatrix=null,e&&(this.scaleX*=e.scaleX,this.scaleY*=e.scaleY,this.cropX=e.cropX,this.cropY=e.cropY,i.x+=e.offsetLeft,i.y+=e.offsetTop,this.width=e.width,this.height=e.height),this.setPositionByOrigin(i,"center","center")},clone:function(e,i){var n=this.toObject(i);this.constructor.fromObject?this.constructor.fromObject(n,e):t.Object._fromObject("Object",n,e)},cloneAsImage:function(e,i){var n=this.toCanvasElement(i);return e&&e(new t.Image(n)),this},toCanvasElement:function(e){e||(e={});var i=t.util,n=i.saveObjectTransform(this),r=this.group,a=this.shadow,o=Math.abs,s=(e.multiplier||1)*(e.enableRetinaScaling?t.devicePixelRatio:1);delete this.group,e.withoutTransform&&i.resetObjectTransform(this),e.withoutShadow&&(this.shadow=null);var l,c,h,u,f=t.util.createCanvasElement(),d=this.getBoundingRect(!0,!0),m=this.shadow,g={x:0,y:0};m&&(c=m.blur,l=m.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),g.x=2*Math.round(o(m.offsetX)+c)*o(l.scaleX),g.y=2*Math.round(o(m.offsetY)+c)*o(l.scaleY)),h=d.width+g.x,u=d.height+g.y,f.width=Math.ceil(h),f.height=Math.ceil(u);var v=new t.StaticCanvas(f,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});"jpeg"===e.format&&(v.backgroundColor="#fff"),this.setPositionByOrigin(new t.Point(v.width/2,v.height/2),"center","center");var p=this.canvas;v.add(this);var y=v.toCanvasElement(s||1,e);return this.shadow=a,this.set("canvas",p),r&&(this.group=r),this.set(n).setCoords(),v._objects=[],v.dispose(),v=null,y},toDataURL:function(e){return e||(e={}),t.util.toDataURL(this.toCanvasElement(e),e.format||"png",e.quality||1)},isType:function(e){return this.type===e},complexity:function(){return 1},toJSON:function(e){return this.toObject(e)},rotate:function(e){var t=("center"!==this.originX||"center"!==this.originY)&&this.centeredRotation;return t&&this._setOriginToCenter(),this.set("angle",e),t&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(e,i){i=i||this.canvas.getPointer(e);var n=new t.Point(i.x,i.y),r=this._getLeftTopCoords();return this.angle&&(n=t.util.rotatePoint(n,r,o(-this.angle))),{x:n.x-r.x,y:n.y-r.y}},_setupCompositeOperation:function(e){this.globalCompositeOperation&&(e.globalCompositeOperation=this.globalCompositeOperation)}}),t.util.createAccessors&&t.util.createAccessors(t.Object),i(t.Object.prototype,t.Observable),t.Object.NUM_FRACTION_DIGITS=2,t.Object._fromObject=function(e,i,r,a){var o=t[e];i=n(i,!0),t.util.enlivenPatterns([i.fill,i.stroke],(function(e){void 0!==e[0]&&(i.fill=e[0]),void 0!==e[1]&&(i.stroke=e[1]),t.util.enlivenObjects([i.clipPath],(function(e){i.clipPath=e[0];var t=a?new o(i[a],i):new o(i);r&&r(t)}))}))},t.Object.__uid=0)}(t),b=_.util.degreesToRadians,w={left:-.5,center:0,right:.5},x={top:-.5,center:0,bottom:.5},_.util.object.extend(_.Object.prototype,{translateToGivenOrigin:function(e,t,i,n,r){var a,o,s,l=e.x,c=e.y;return"string"==typeof t?t=w[t]:t-=.5,"string"==typeof n?n=w[n]:n-=.5,"string"==typeof i?i=x[i]:i-=.5,"string"==typeof r?r=x[r]:r-=.5,o=r-i,((a=n-t)||o)&&(s=this._getTransformedDimensions(),l=e.x+a*s.x,c=e.y+o*s.y),new _.Point(l,c)},translateToCenterPoint:function(e,t,i){var n=this.translateToGivenOrigin(e,t,i,"center","center");return this.angle?_.util.rotatePoint(n,e,b(this.angle)):n},translateToOriginPoint:function(e,t,i){var n=this.translateToGivenOrigin(e,"center","center",t,i);return this.angle?_.util.rotatePoint(n,e,b(this.angle)):n},getCenterPoint:function(){var e=new _.Point(this.left,this.top);return this.translateToCenterPoint(e,this.originX,this.originY)},getPointByOrigin:function(e,t){var i=this.getCenterPoint();return this.translateToOriginPoint(i,e,t)},toLocalPoint:function(e,t,i){var n,r,a=this.getCenterPoint();return n=void 0!==t&&void 0!==i?this.translateToGivenOrigin(a,"center","center",t,i):new _.Point(this.left,this.top),r=new _.Point(e.x,e.y),this.angle&&(r=_.util.rotatePoint(r,a,-b(this.angle))),r.subtractEquals(n)},setPositionByOrigin:function(e,t,i){var n=this.translateToCenterPoint(e,t,i),r=this.translateToOriginPoint(n,this.originX,this.originY);this.set("left",r.x),this.set("top",r.y)},adjustPosition:function(e){var t,i,n=b(this.angle),r=this.getScaledWidth(),a=_.util.cos(n)*r,o=_.util.sin(n)*r;t="string"==typeof this.originX?w[this.originX]:this.originX-.5,i="string"==typeof e?w[e]:e-.5,this.left+=a*(i-t),this.top+=o*(i-t),this.setCoords(),this.originX=e},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var e=this.getCenterPoint();this.originX="center",this.originY="center",this.left=e.x,this.top=e.y},_resetOrigin:function(){var e=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=e.x,this.top=e.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}}),function(){var e=_.util,t=e.degreesToRadians,i=e.multiplyTransformMatrices,n=e.transformPoint;e.object.extend(_.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(e,t){return t?e?this.calcACoords():this.calcLineCoords():(this.aCoords&&this.lineCoords||this.setCoords(!0),e?this.aCoords:this.lineCoords)},getCoords:function(e,t){return i=this._getCoords(e,t),[new _.Point(i.tl.x,i.tl.y),new _.Point(i.tr.x,i.tr.y),new _.Point(i.br.x,i.br.y),new _.Point(i.bl.x,i.bl.y)];var i},intersectsWithRect:function(e,t,i,n){var r=this.getCoords(i,n);return"Intersection"===_.Intersection.intersectPolygonRectangle(r,e,t).status},intersectsWithObject:function(e,t,i){return"Intersection"===_.Intersection.intersectPolygonPolygon(this.getCoords(t,i),e.getCoords(t,i)).status||e.isContainedWithinObject(this,t,i)||this.isContainedWithinObject(e,t,i)},isContainedWithinObject:function(e,t,i){for(var n=this.getCoords(t,i),r=t?e.aCoords:e.lineCoords,a=0,o=e._getImageLines(r);a<4;a++)if(!e.containsPoint(n[a],o))return!1;return!0},isContainedWithinRect:function(e,t,i,n){var r=this.getBoundingRect(i,n);return r.left>=e.x&&r.left+r.width<=t.x&&r.top>=e.y&&r.top+r.height<=t.y},containsPoint:function(e,t,i,n){var r=this._getCoords(i,n),a=(t=t||this._getImageLines(r),this._findCrossPoints(e,t));return 0!==a&&a%2==1},isOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,i=this.canvas.vptCoords.br;return!!this.getCoords(!0,e).some((function(e){return e.x<=i.x&&e.x>=t.x&&e.y<=i.y&&e.y>=t.y}))||(!!this.intersectsWithRect(t,i,!0,e)||this._containsCenterOfCanvas(t,i,e))},_containsCenterOfCanvas:function(e,t,i){var n={x:(e.x+t.x)/2,y:(e.y+t.y)/2};return!!this.containsPoint(n,null,!0,i)},isPartiallyOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,i=this.canvas.vptCoords.br;return!!this.intersectsWithRect(t,i,!0,e)||this.getCoords(!0,e).every((function(e){return(e.x>=i.x||e.x<=t.x)&&(e.y>=i.y||e.y<=t.y)}))&&this._containsCenterOfCanvas(t,i,e)},_getImageLines:function(e){return{topline:{o:e.tl,d:e.tr},rightline:{o:e.tr,d:e.br},bottomline:{o:e.br,d:e.bl},leftline:{o:e.bl,d:e.tl}}},_findCrossPoints:function(e,t){var i,n,r,a=0;for(var o in t)if(!((r=t[o]).o.y<e.y&&r.d.y<e.y||r.o.y>=e.y&&r.d.y>=e.y||(r.o.x===r.d.x&&r.o.x>=e.x?n=r.o.x:(0,i=(r.d.y-r.o.y)/(r.d.x-r.o.x),n=-(e.y-0*e.x-(r.o.y-i*r.o.x))/(0-i)),n>=e.x&&(a+=1),2!==a)))break;return a},getBoundingRect:function(t,i){var n=this.getCoords(t,i);return e.makeBoundingBoxFromPoints(n)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(e){return Math.abs(e)<this.minScaleLimit?e<0?-this.minScaleLimit:this.minScaleLimit:0===e?1e-4:e},scale:function(e){return this._set("scaleX",e),this._set("scaleY",e),this.setCoords()},scaleToWidth:function(e,t){var i=this.getBoundingRect(t).width/this.getScaledWidth();return this.scale(e/this.width/i)},scaleToHeight:function(e,t){var i=this.getBoundingRect(t).height/this.getScaledHeight();return this.scale(e/this.height/i)},calcCoords:function(e){return e?this.calcACoords():this.calcOCoords()},calcLineCoords:function(){var i=this.getViewportTransform(),r=this.padding,a=t(this.angle),o=e.cos(a)*r,s=e.sin(a)*r,l=o+s,c=o-s,h=this.calcACoords(),u={tl:n(h.tl,i),tr:n(h.tr,i),bl:n(h.bl,i),br:n(h.br,i)};return r&&(u.tl.x-=c,u.tl.y-=l,u.tr.x+=l,u.tr.y-=c,u.bl.x-=l,u.bl.y+=c,u.br.x+=c,u.br.y+=l),u},calcOCoords:function(){var e=this._calcRotateMatrix(),t=this._calcTranslateMatrix(),n=this.getViewportTransform(),r=i(n,t),a=i(r,e),o=(a=i(a,[1/n[0],0,0,1/n[3],0,0]),this._calculateCurrentDimensions()),s={};return this.forEachControl((function(e,t,i){s[t]=e.positionHandler(o,a,i)})),s},calcACoords:function(){var e=this._calcRotateMatrix(),t=this._calcTranslateMatrix(),r=i(t,e),a=this._getTransformedDimensions(),o=a.x/2,s=a.y/2;return{tl:n({x:-o,y:-s},r),tr:n({x:o,y:-s},r),bl:n({x:-o,y:s},r),br:n({x:o,y:s},r)}},setCoords:function(e){return this.aCoords=this.calcACoords(),this.lineCoords=this.group?this.aCoords:this.calcLineCoords(),e||(this.oCoords=this.calcOCoords(),this._setCornerCoords&&this._setCornerCoords()),this},_calcRotateMatrix:function(){return e.calcRotateMatrix(this)},_calcTranslateMatrix:function(){var e=this.getCenterPoint();return[1,0,0,1,e.x,e.y]},transformMatrixKey:function(e){var t="";return!e&&this.group&&(t=this.group.transformMatrixKey(e)+"_"),t+this.top+"_"+this.left+"_"+this.scaleX+"_"+this.scaleY+"_"+this.skewX+"_"+this.skewY+"_"+this.angle+"_"+this.originX+"_"+this.originY+"_"+this.width+"_"+this.height+"_"+this.strokeWidth+this.flipX+this.flipY},calcTransformMatrix:function(e){var t=this.calcOwnMatrix();if(e||!this.group)return t;var n=this.transformMatrixKey(e),r=this.matrixCache||(this.matrixCache={});return r.key===n?r.value:(this.group&&(t=i(this.group.calcTransformMatrix(!1),t)),r.key=n,r.value=t,t)},calcOwnMatrix:function(){var t=this.transformMatrixKey(!0),i=this.ownMatrixCache||(this.ownMatrixCache={});if(i.key===t)return i.value;var n=this._calcTranslateMatrix(),r={angle:this.angle,translateX:n[4],translateY:n[5],scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY};return i.key=t,i.value=e.composeMatrix(r),i.value},_calcDimensionsTransformMatrix:function(t,i,n){return e.calcDimensionsMatrix({skewX:t,skewY:i,scaleX:this.scaleX*(n&&this.flipX?-1:1),scaleY:this.scaleY*(n&&this.flipY?-1:1)})},_getNonTransformedDimensions:function(){var e=this.strokeWidth;return{x:this.width+e,y:this.height+e}},_getTransformedDimensions:function(t,i){void 0===t&&(t=this.skewX),void 0===i&&(i=this.skewY);var n,r,a,o=0===t&&0===i;if(this.strokeUniform?(r=this.width,a=this.height):(r=(n=this._getNonTransformedDimensions()).x,a=n.y),o)return this._finalizeDimensions(r*this.scaleX,a*this.scaleY);var s=e.sizeAfterTransform(r,a,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:t,skewY:i});return this._finalizeDimensions(s.x,s.y)},_finalizeDimensions:function(e,t){return this.strokeUniform?{x:e+this.strokeWidth,y:t+this.strokeWidth}:{x:e,y:t}},_calculateCurrentDimensions:function(){var e=this.getViewportTransform(),t=this._getTransformedDimensions();return n(t,e,!0).scalarAdd(2*this.padding)}})}(),_.util.object.extend(_.Object.prototype,{sendToBack:function(){return this.group?_.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?_.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(e){return this.group?_.StaticCanvas.prototype.sendBackwards.call(this.group,this,e):this.canvas&&this.canvas.sendBackwards(this,e),this},bringForward:function(e){return this.group?_.StaticCanvas.prototype.bringForward.call(this.group,this,e):this.canvas&&this.canvas.bringForward(this,e),this},moveTo:function(e){return this.group&&"activeSelection"!==this.group.type?_.StaticCanvas.prototype.moveTo.call(this.group,this,e):this.canvas&&this.canvas.moveTo(this,e),this}}),function(){function e(e,t){if(t){if(t.toLive)return e+": url(#SVGID_"+t.id+"); ";var i=new _.Color(t),n=e+": "+i.toRgb()+"; ",r=i.getAlpha();return 1!==r&&(n+=e+"-opacity: "+r.toString()+"; "),n}return e+": none; "}var t=_.util.toFixed;_.util.object.extend(_.Object.prototype,{getSvgStyles:function(t){var i=this.fillRule?this.fillRule:"nonzero",n=this.strokeWidth?this.strokeWidth:"0",r=this.strokeDashArray?this.strokeDashArray.join(" "):"none",a=this.strokeDashOffset?this.strokeDashOffset:"0",o=this.strokeLineCap?this.strokeLineCap:"butt",s=this.strokeLineJoin?this.strokeLineJoin:"miter",l=this.strokeMiterLimit?this.strokeMiterLimit:"4",c=void 0!==this.opacity?this.opacity:"1",h=this.visible?"":" visibility: hidden;",u=t?"":this.getSvgFilter(),f=e("fill",this.fill);return[e("stroke",this.stroke),"stroke-width: ",n,"; ","stroke-dasharray: ",r,"; ","stroke-linecap: ",o,"; ","stroke-dashoffset: ",a,"; ","stroke-linejoin: ",s,"; ","stroke-miterlimit: ",l,"; ",f,"fill-rule: ",i,"; ","opacity: ",c,";",u,h].join("")},getSvgSpanStyles:function(t,i){var n=t.fontFamily?"font-family: "+(-1===t.fontFamily.indexOf("'")&&-1===t.fontFamily.indexOf('"')?"'"+t.fontFamily+"'":t.fontFamily)+"; ":"",r=t.strokeWidth?"stroke-width: "+t.strokeWidth+"; ":"",a=(n=n,t.fontSize?"font-size: "+t.fontSize+"px; ":""),o=t.fontStyle?"font-style: "+t.fontStyle+"; ":"",s=t.fontWeight?"font-weight: "+t.fontWeight+"; ":"",l=t.fill?e("fill",t.fill):"",c=t.stroke?e("stroke",t.stroke):"",h=this.getSvgTextDecoration(t);return h&&(h="text-decoration: "+h+"; "),[c,r,n,a,o,s,h,l,t.deltaY?"baseline-shift: "+-t.deltaY+"; ":"",i?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(e){return["overline","underline","line-through"].filter((function(t){return e[t.replace("-","")]})).join(" ")},getSvgFilter:function(){return this.shadow?"filter: url(#SVGID_"+this.shadow.id+");":""},getSvgCommons:function(){return[this.id?'id="'+this.id+'" ':"",this.clipPath?'clip-path="url(#'+this.clipPath.clipPathId+')" ':""].join("")},getSvgTransform:function(e,t){var i=e?this.calcTransformMatrix():this.calcOwnMatrix();return'transform="'+_.util.matrixToSVG(i)+(t||"")+'" '},_setSVGBg:function(e){if(this.backgroundColor){var i=_.Object.NUM_FRACTION_DIGITS;e.push("\t\t<rect ",this._getFillAttributes(this.backgroundColor),' x="',t(-this.width/2,i),'" y="',t(-this.height/2,i),'" width="',t(this.width,i),'" height="',t(this.height,i),'"></rect>\n')}},toSVG:function(e){return this._createBaseSVGMarkup(this._toSVG(e),{reviver:e})},toClipPathSVG:function(e){return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(e),{reviver:e})},_createBaseClipPathSVGMarkup:function(e,t){var i=(t=t||{}).reviver,n=t.additionalTransform||"",r=[this.getSvgTransform(!0,n),this.getSvgCommons()].join(""),a=e.indexOf("COMMON_PARTS");return e[a]=r,i?i(e.join("")):e.join("")},_createBaseSVGMarkup:function(e,t){var i,n,r=(t=t||{}).noStyle,a=t.reviver,o=r?"":'style="'+this.getSvgStyles()+'" ',s=t.withShadow?'style="'+this.getSvgFilter()+'" ':"",l=this.clipPath,c=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",h=l&&l.absolutePositioned,u=this.stroke,f=this.fill,d=this.shadow,m=[],g=e.indexOf("COMMON_PARTS"),v=t.additionalTransform;return l&&(l.clipPathId="CLIPPATH_"+_.Object.__uid++,n='<clipPath id="'+l.clipPathId+'" >\n'+l.toClipPathSVG(a)+"</clipPath>\n"),h&&m.push("<g ",s,this.getSvgCommons()," >\n"),m.push("<g ",this.getSvgTransform(!1),h?"":s+this.getSvgCommons()," >\n"),i=[o,c,r?"":this.addPaintOrder()," ",v?'transform="'+v+'" ':""].join(""),e[g]=i,f&&f.toLive&&m.push(f.toSVG(this)),u&&u.toLive&&m.push(u.toSVG(this)),d&&m.push(d.toSVG(this)),l&&m.push(n),m.push(e.join("")),m.push("</g>\n"),h&&m.push("</g>\n"),a?a(m.join("")):m.join("")},addPaintOrder:function(){return"fill"!==this.paintFirst?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var e=_.util.object.extend;function t(t,i,n){var r={};n.forEach((function(e){r[e]=t[e]})),e(t[i],r,!0)}_.util.object.extend(_.Object.prototype,{hasStateChanged:function(e){var t="_"+(e=e||"stateProperties");return Object.keys(this[t]).length<this[e].length||!function e(t,i,n){if(t===i)return!0;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(var r=0,a=t.length;r<a;r++)if(!e(t[r],i[r]))return!1;return!0}if(t&&"object"==typeof t){var o,s=Object.keys(t);if(!i||"object"!=typeof i||!n&&s.length!==Object.keys(i).length)return!1;for(r=0,a=s.length;r<a;r++)if("canvas"!==(o=s[r])&&"group"!==o&&!e(t[o],i[o]))return!1;return!0}}(this[t],this,!0)},saveState:function(e){var i=e&&e.propertySet||"stateProperties",n="_"+i;return this[n]?(t(this,n,this[i]),e&&e.stateProperties&&t(this,n,e.stateProperties),this):this.setupState(e)},setupState:function(e){var t=(e=e||{}).propertySet||"stateProperties";return e.propertySet=t,this["_"+t]={},this.saveState(e),this}})}(),function(){var e=_.util.degreesToRadians;_.util.object.extend(_.Object.prototype,{_findTargetCorner:function(e,t){if(!this.hasControls||this.group||!this.canvas||this.canvas._activeObject!==this)return!1;var i,n,r,a=e.x,o=e.y,s=Object.keys(this.oCoords),l=s.length-1;for(this.__corner=0;l>=0;l--)if(r=s[l],this.isControlVisible(r)&&(n=this._getImageLines(t?this.oCoords[r].touchCorner:this.oCoords[r].corner),0!==(i=this._findCrossPoints({x:a,y:o},n))&&i%2==1))return this.__corner=r,r;return!1},forEachControl:function(e){for(var t in this.controls)e(this.controls[t],t,this)},_setCornerCoords:function(){var e=this.oCoords;for(var t in e){var i=this.controls[t];e[t].corner=i.calcCornerCoords(this.angle,this.cornerSize,e[t].x,e[t].y,!1),e[t].touchCorner=i.calcCornerCoords(this.angle,this.touchCornerSize,e[t].x,e[t].y,!0)}},drawSelectionBackground:function(t){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;t.save();var i=this.getCenterPoint(),n=this._calculateCurrentDimensions(),r=this.canvas.viewportTransform;return t.translate(i.x,i.y),t.scale(1/r[0],1/r[3]),t.rotate(e(this.angle)),t.fillStyle=this.selectionBackgroundColor,t.fillRect(-n.x/2,-n.y/2,n.x,n.y),t.restore(),this},drawBorders:function(e,t){t=t||{};var i=this._calculateCurrentDimensions(),n=this.borderScaleFactor,r=i.x+n,a=i.y+n,o=void 0!==t.hasControls?t.hasControls:this.hasControls,s=!1;return e.save(),e.strokeStyle=t.borderColor||this.borderColor,this._setLineDash(e,t.borderDashArray||this.borderDashArray),e.strokeRect(-r/2,-a/2,r,a),o&&(e.beginPath(),this.forEachControl((function(t,i,n){t.withConnection&&t.getVisibility(n,i)&&(s=!0,e.moveTo(t.x*r,t.y*a),e.lineTo(t.x*r+t.offsetX,t.y*a+t.offsetY))})),s&&e.stroke()),e.restore(),this},drawBordersInGroup:function(e,t,i){i=i||{};var n=_.util.sizeAfterTransform(this.width,this.height,t),r=this.strokeWidth,a=this.strokeUniform,o=this.borderScaleFactor,s=n.x+r*(a?this.canvas.getZoom():t.scaleX)+o,l=n.y+r*(a?this.canvas.getZoom():t.scaleY)+o;return e.save(),this._setLineDash(e,i.borderDashArray||this.borderDashArray),e.strokeStyle=i.borderColor||this.borderColor,e.strokeRect(-s/2,-l/2,s,l),e.restore(),this},drawControls:function(e,t){t=t||{},e.save();var i,n,r=this.canvas.getRetinaScaling();return e.setTransform(r,0,0,r,0,0),e.strokeStyle=e.fillStyle=t.cornerColor||this.cornerColor,this.transparentCorners||(e.strokeStyle=t.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(e,t.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(i=this.group.calcTransformMatrix()),this.forEachControl((function(r,a,o){n=o.oCoords[a],r.getVisibility(o,a)&&(i&&(n=_.util.transformPoint(n,i)),r.render(e,n.x,n.y,t,o))})),e.restore(),this},isControlVisible:function(e){return this.controls[e]&&this.controls[e].getVisibility(this,e)},setControlVisible:function(e,t){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[e]=t,this},setControlsVisibility:function(e){for(var t in e||(e={}),e)this.setControlVisible(t,e[t]);return this},onDeselect:function(){},onSelect:function(){}})}(),_.util.object.extend(_.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(e,t){var i=function(){},n=(t=t||{}).onComplete||i,r=t.onChange||i,a=this;return _.util.animate({startValue:e.left,endValue:this.getCenter().left,duration:this.FX_DURATION,onChange:function(t){e.set("left",t),a.requestRenderAll(),r()},onComplete:function(){e.setCoords(),n()}}),this},fxCenterObjectV:function(e,t){var i=function(){},n=(t=t||{}).onComplete||i,r=t.onChange||i,a=this;return _.util.animate({startValue:e.top,endValue:this.getCenter().top,duration:this.FX_DURATION,onChange:function(t){e.set("top",t),a.requestRenderAll(),r()},onComplete:function(){e.setCoords(),n()}}),this},fxRemove:function(e,t){var i=function(){},n=(t=t||{}).onComplete||i,r=t.onChange||i,a=this;return _.util.animate({startValue:e.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(t){e.set("opacity",t),a.requestRenderAll(),r()},onComplete:function(){a.remove(e),n()}}),this}}),_.util.object.extend(_.Object.prototype,{animate:function(){if(arguments[0]&&"object"==typeof arguments[0]){var e,t,i=[];for(e in arguments[0])i.push(e);for(var n=0,r=i.length;n<r;n++)e=i[n],t=n!==r-1,this._animate(e,arguments[0][e],arguments[1],t)}else this._animate.apply(this,arguments);return this},_animate:function(e,t,i,n){var r,a=this;t=t.toString(),i=i?_.util.object.clone(i):{},~e.indexOf(".")&&(r=e.split("."));var o=a.colorProperties.indexOf(e)>-1||r&&a.colorProperties.indexOf(r[1])>-1,s=r?this.get(r[0])[r[1]]:this.get(e);"from"in i||(i.from=s),o||(t=~t.indexOf("=")?s+parseFloat(t.replace("=","")):parseFloat(t));var l={startValue:i.from,endValue:t,byValue:i.by,easing:i.easing,duration:i.duration,abort:i.abort&&function(e,t,n){return i.abort.call(a,e,t,n)},onChange:function(t,o,s){r?a[r[0]][r[1]]=t:a.set(e,t),n||i.onChange&&i.onChange(t,o,s)},onComplete:function(e,t,r){n||(a.setCoords(),i.onComplete&&i.onComplete(e,t,r))}};return o?_.util.animateColor(l.startValue,l.endValue,l.duration,l):_.util.animate(l)}}),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend,n=t.util.object.clone,r={x1:1,x2:1,y1:1,y2:1};function a(e,t){var i=e.origin,n=e.axis1,r=e.axis2,a=e.dimension,o=t.nearest,s=t.center,l=t.farthest;return function(){switch(this.get(i)){case o:return Math.min(this.get(n),this.get(r));case s:return Math.min(this.get(n),this.get(r))+.5*this.get(a);case l:return Math.max(this.get(n),this.get(r))}}}t.Line?t.warn("fabric.Line is already defined"):(t.Line=t.util.createClass(t.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:t.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(e,t){e||(e=[0,0,0,0]),this.callSuper("initialize",t),this.set("x1",e[0]),this.set("y1",e[1]),this.set("x2",e[2]),this.set("y2",e[3]),this._setWidthHeight(t)},_setWidthHeight:function(e){e||(e={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in e?e.left:this._getLeftToOriginX(),this.top="top"in e?e.top:this._getTopToOriginY()},_set:function(e,t){return this.callSuper("_set",e,t),void 0!==r[e]&&this._setWidthHeight(),this},_getLeftToOriginX:a({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:a({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(e){e.beginPath();var t=this.calcLinePoints();e.moveTo(t.x1,t.y1),e.lineTo(t.x2,t.y2),e.lineWidth=this.strokeWidth;var i=e.strokeStyle;e.strokeStyle=this.stroke||e.fillStyle,this.stroke&&this._renderStroke(e),e.strokeStyle=i},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(e){return i(this.callSuper("toObject",e),this.calcLinePoints())},_getNonTransformedDimensions:function(){var e=this.callSuper("_getNonTransformedDimensions");return"butt"===this.strokeLineCap&&(0===this.width&&(e.y-=this.strokeWidth),0===this.height&&(e.x-=this.strokeWidth)),e},calcLinePoints:function(){var e=this.x1<=this.x2?-1:1,t=this.y1<=this.y2?-1:1,i=e*this.width*.5,n=t*this.height*.5;return{x1:i,x2:e*this.width*-.5,y1:n,y2:t*this.height*-.5}},_toSVG:function(){var e=this.calcLinePoints();return["<line ","COMMON_PARTS",'x1="',e.x1,'" y1="',e.y1,'" x2="',e.x2,'" y2="',e.y2,'" />\n']}}),t.Line.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),t.Line.fromElement=function(e,n,r){r=r||{};var a=t.parseAttributes(e,t.Line.ATTRIBUTE_NAMES),o=[a.x1||0,a.y1||0,a.x2||0,a.y2||0];n(new t.Line(o,i(a,r)))},t.Line.fromObject=function(e,i){var r=n(e,!0);r.points=[e.x1,e.y1,e.x2,e.y2],t.Object._fromObject("Line",r,(function(e){delete e.points,i&&i(e)}),"points")})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=Math.PI;t.Circle?t.warn("fabric.Circle is already defined."):(t.Circle=t.util.createClass(t.Object,{type:"circle",radius:0,startAngle:0,endAngle:2*i,cacheProperties:t.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(e,t){return this.callSuper("_set",e,t),"radius"===e&&this.setRadius(t),this},toObject:function(e){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(e))},_toSVG:function(){var e,n=(this.endAngle-this.startAngle)%(2*i);if(0===n)e=["<circle ","COMMON_PARTS",'cx="0" cy="0" ','r="',this.radius,'" />\n'];else{var r=t.util.cos(this.startAngle)*this.radius,a=t.util.sin(this.startAngle)*this.radius,o=t.util.cos(this.endAngle)*this.radius,s=t.util.sin(this.endAngle)*this.radius,l=n>i?"1":"0";e=['<path d="M '+r+" "+a," A "+this.radius+" "+this.radius," 0 ",+l+" 1"," "+o+" "+s,'" ',"COMMON_PARTS"," />\n"]}return e},_render:function(e){e.beginPath(),e.arc(0,0,this.radius,this.startAngle,this.endAngle,!1),this._renderPaintInOrder(e)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(e){return this.radius=e,this.set("width",2*e).set("height",2*e)}}),t.Circle.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),t.Circle.fromElement=function(e,i){var n,r=t.parseAttributes(e,t.Circle.ATTRIBUTE_NAMES);if(!("radius"in(n=r)&&n.radius>=0))throw new Error("value of `r` attribute is required and can not be negative");r.left=(r.left||0)-r.radius,r.top=(r.top||0)-r.radius,i(new t.Circle(r))},t.Circle.fromObject=function(e,i){t.Object._fromObject("Circle",e,i)})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});t.Triangle?t.warn("fabric.Triangle is already defined"):(t.Triangle=t.util.createClass(t.Object,{type:"triangle",width:100,height:100,_render:function(e){var t=this.width/2,i=this.height/2;e.beginPath(),e.moveTo(-t,i),e.lineTo(0,-i),e.lineTo(t,i),e.closePath(),this._renderPaintInOrder(e)},_toSVG:function(){var e=this.width/2,t=this.height/2;return["<polygon ","COMMON_PARTS",'points="',[-e+" "+t,"0 "+-t,e+" "+t].join(","),'" />']}}),t.Triangle.fromObject=function(e,i){return t.Object._fromObject("Triangle",e,i)})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=2*Math.PI;t.Ellipse?t.warn("fabric.Ellipse is already defined."):(t.Ellipse=t.util.createClass(t.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(e){this.callSuper("initialize",e),this.set("rx",e&&e.rx||0),this.set("ry",e&&e.ry||0)},_set:function(e,t){switch(this.callSuper("_set",e,t),e){case"rx":this.rx=t,this.set("width",2*t);break;case"ry":this.ry=t,this.set("height",2*t)}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(e){return this.callSuper("toObject",["rx","ry"].concat(e))},_toSVG:function(){return["<ellipse ","COMMON_PARTS",'cx="0" cy="0" ','rx="',this.rx,'" ry="',this.ry,'" />\n']},_render:function(e){e.beginPath(),e.save(),e.transform(1,0,0,this.ry/this.rx,0,0),e.arc(0,0,this.rx,0,i,!1),e.restore(),this._renderPaintInOrder(e)}}),t.Ellipse.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),t.Ellipse.fromElement=function(e,i){var n=t.parseAttributes(e,t.Ellipse.ATTRIBUTE_NAMES);n.left=(n.left||0)-n.rx,n.top=(n.top||0)-n.ry,i(new t.Ellipse(n))},t.Ellipse.fromObject=function(e,i){t.Object._fromObject("Ellipse",e,i)})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend;t.Rect?t.warn("fabric.Rect is already defined"):(t.Rect=t.util.createClass(t.Object,{stateProperties:t.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(e){this.callSuper("initialize",e),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(e){var t=this.rx?Math.min(this.rx,this.width/2):0,i=this.ry?Math.min(this.ry,this.height/2):0,n=this.width,r=this.height,a=-this.width/2,o=-this.height/2,s=0!==t||0!==i,l=.4477152502;e.beginPath(),e.moveTo(a+t,o),e.lineTo(a+n-t,o),s&&e.bezierCurveTo(a+n-l*t,o,a+n,o+l*i,a+n,o+i),e.lineTo(a+n,o+r-i),s&&e.bezierCurveTo(a+n,o+r-l*i,a+n-l*t,o+r,a+n-t,o+r),e.lineTo(a+t,o+r),s&&e.bezierCurveTo(a+l*t,o+r,a,o+r-l*i,a,o+r-i),e.lineTo(a,o+i),s&&e.bezierCurveTo(a,o+l*i,a+l*t,o,a+t,o),e.closePath(),this._renderPaintInOrder(e)},toObject:function(e){return this.callSuper("toObject",["rx","ry"].concat(e))},_toSVG:function(){return["<rect ","COMMON_PARTS",'x="',-this.width/2,'" y="',-this.height/2,'" rx="',this.rx,'" ry="',this.ry,'" width="',this.width,'" height="',this.height,'" />\n']}}),t.Rect.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),t.Rect.fromElement=function(e,n,r){if(!e)return n(null);r=r||{};var a=t.parseAttributes(e,t.Rect.ATTRIBUTE_NAMES);a.left=a.left||0,a.top=a.top||0,a.height=a.height||0,a.width=a.width||0;var o=new t.Rect(i(r?t.util.object.clone(r):{},a));o.visible=o.visible&&o.width>0&&o.height>0,n(o)},t.Rect.fromObject=function(e,i){return t.Object._fromObject("Rect",e,i)})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend,n=t.util.array.min,r=t.util.array.max,a=t.util.toFixed;t.Polyline?t.warn("fabric.Polyline is already defined"):(t.Polyline=t.util.createClass(t.Object,{type:"polyline",points:null,cacheProperties:t.Object.prototype.cacheProperties.concat("points"),initialize:function(e,t){t=t||{},this.points=e||[],this.callSuper("initialize",t),this._setPositionDimensions(t)},_setPositionDimensions:function(e){var t,i=this._calcDimensions(e);this.width=i.width,this.height=i.height,e.fromSVG||(t=this.translateToGivenOrigin({x:i.left-this.strokeWidth/2,y:i.top-this.strokeWidth/2},"left","top",this.originX,this.originY)),void 0===e.left&&(this.left=e.fromSVG?i.left:t.x),void 0===e.top&&(this.top=e.fromSVG?i.top:t.y),this.pathOffset={x:i.left+this.width/2,y:i.top+this.height/2}},_calcDimensions:function(){var e=this.points,t=n(e,"x")||0,i=n(e,"y")||0;return{left:t,top:i,width:(r(e,"x")||0)-t,height:(r(e,"y")||0)-i}},toObject:function(e){return i(this.callSuper("toObject",e),{points:this.points.concat()})},_toSVG:function(){for(var e=[],i=this.pathOffset.x,n=this.pathOffset.y,r=t.Object.NUM_FRACTION_DIGITS,o=0,s=this.points.length;o<s;o++)e.push(a(this.points[o].x-i,r),",",a(this.points[o].y-n,r)," ");return["<"+this.type+" ","COMMON_PARTS",'points="',e.join(""),'" />\n']},commonRender:function(e){var t,i=this.points.length,n=this.pathOffset.x,r=this.pathOffset.y;if(!i||isNaN(this.points[i-1].y))return!1;e.beginPath(),e.moveTo(this.points[0].x-n,this.points[0].y-r);for(var a=0;a<i;a++)t=this.points[a],e.lineTo(t.x-n,t.y-r);return!0},_render:function(e){this.commonRender(e)&&this._renderPaintInOrder(e)},complexity:function(){return this.get("points").length}}),t.Polyline.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(),t.Polyline.fromElementGenerator=function(e){return function(n,r,a){if(!n)return r(null);a||(a={});var o=t.parsePointsAttribute(n.getAttribute("points")),s=t.parseAttributes(n,t[e].ATTRIBUTE_NAMES);s.fromSVG=!0,r(new t[e](o,i(s,a)))}},t.Polyline.fromElement=t.Polyline.fromElementGenerator("Polyline"),t.Polyline.fromObject=function(e,i){return t.Object._fromObject("Polyline",e,i,"points")})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});t.Polygon?t.warn("fabric.Polygon is already defined"):(t.Polygon=t.util.createClass(t.Polyline,{type:"polygon",_render:function(e){this.commonRender(e)&&(e.closePath(),this._renderPaintInOrder(e))}}),t.Polygon.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(),t.Polygon.fromElement=t.Polyline.fromElementGenerator("Polygon"),t.Polygon.fromObject=function(e,i){t.Object._fromObject("Polygon",e,i,"points")})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.array.min,n=t.util.array.max,r=t.util.object.extend,a=Object.prototype.toString,o=t.util.toFixed;t.Path?t.warn("fabric.Path is already defined"):(t.Path=t.util.createClass(t.Object,{type:"path",path:null,cacheProperties:t.Object.prototype.cacheProperties.concat("path","fillRule"),stateProperties:t.Object.prototype.stateProperties.concat("path"),initialize:function(e,i){i=i||{},this.callSuper("initialize",i),e||(e=[]);var n="[object Array]"===a.call(e);this.path=t.util.makePathSimpler(n?e:t.util.parsePath(e)),this.path&&t.Polyline.prototype._setPositionDimensions.call(this,i)},_renderPathCommands:function(e){var t,i=0,n=0,r=0,a=0,o=0,s=0,l=-this.pathOffset.x,c=-this.pathOffset.y;e.beginPath();for(var h=0,u=this.path.length;h<u;++h)switch((t=this.path[h])[0]){case"L":r=t[1],a=t[2],e.lineTo(r+l,a+c);break;case"M":i=r=t[1],n=a=t[2],e.moveTo(r+l,a+c);break;case"C":r=t[5],a=t[6],o=t[3],s=t[4],e.bezierCurveTo(t[1]+l,t[2]+c,o+l,s+c,r+l,a+c);break;case"Q":e.quadraticCurveTo(t[1]+l,t[2]+c,t[3]+l,t[4]+c),r=t[3],a=t[4],o=t[1],s=t[2];break;case"z":case"Z":r=i,a=n,e.closePath()}},_render:function(e){this._renderPathCommands(e),this._renderPaintInOrder(e)},toString:function(){return"#<fabric.Path ("+this.complexity()+'): { "top": '+this.top+', "left": '+this.left+" }>"},toObject:function(e){return r(this.callSuper("toObject",e),{path:this.path.map((function(e){return e.slice()}))})},toDatalessObject:function(e){var t=this.toObject(["sourcePath"].concat(e));return t.sourcePath&&delete t.path,t},_toSVG:function(){return["<path ","COMMON_PARTS",'d="',t.util.joinPath(this.path),'" stroke-linecap="round" ',"/>\n"]},_getOffsetTransform:function(){var e=t.Object.NUM_FRACTION_DIGITS;return" translate("+o(-this.pathOffset.x,e)+", "+o(-this.pathOffset.y,e)+")"},toClipPathSVG:function(e){var t=this._getOffsetTransform();return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},toSVG:function(e){var t=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var e,r,a=[],o=[],s=0,l=0,c=0,h=0,u=0,f=this.path.length;u<f;++u){switch((e=this.path[u])[0]){case"L":c=e[1],h=e[2],r=[];break;case"M":s=c=e[1],l=h=e[2],r=[];break;case"C":r=t.util.getBoundsOfCurve(c,h,e[1],e[2],e[3],e[4],e[5],e[6]),c=e[5],h=e[6];break;case"Q":r=t.util.getBoundsOfCurve(c,h,e[1],e[2],e[1],e[2],e[3],e[4]),c=e[3],h=e[4];break;case"z":case"Z":c=s,h=l}r.forEach((function(e){a.push(e.x),o.push(e.y)})),a.push(c),o.push(h)}var d=i(a)||0,m=i(o)||0;return{left:d,top:m,width:(n(a)||0)-d,height:(n(o)||0)-m}}}),t.Path.fromObject=function(e,i){if("string"==typeof e.sourcePath){var n=e.sourcePath;t.loadSVGFromURL(n,(function(t){var n=t[0];n.setOptions(e),i&&i(n)}))}else t.Object._fromObject("Path",e,i,"path")},t.Path.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(["d"]),t.Path.fromElement=function(e,i,n){var a=t.parseAttributes(e,t.Path.ATTRIBUTE_NAMES);a.fromSVG=!0,i(new t.Path(a.d,r(a,n)))})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.array.min,n=t.util.array.max;t.Group||(t.Group=t.util.createClass(t.Object,t.Collection,{type:"group",strokeWidth:0,subTargetCheck:!1,cacheProperties:[],useSetOnGroup:!1,initialize:function(e,t,i){t=t||{},this._objects=[],i&&this.callSuper("initialize",t),this._objects=e||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;if(i)this._updateObjectsACoords();else{var r=t&&t.centerPoint;void 0!==t.originX&&(this.originX=t.originX),void 0!==t.originY&&(this.originY=t.originY),r||this._calcBounds(),this._updateObjectsCoords(r),delete t.centerPoint,this.callSuper("initialize",t)}this.setCoords()},_updateObjectsACoords:function(){for(var e=this._objects.length;e--;)this._objects[e].setCoords(!0)},_updateObjectsCoords:function(e){e=e||this.getCenterPoint();for(var t=this._objects.length;t--;)this._updateObjectCoords(this._objects[t],e)},_updateObjectCoords:function(e,t){var i=e.left,n=e.top;e.set({left:i-t.x,top:n-t.y}),e.group=this,e.setCoords(!0)},toString:function(){return"#<fabric.Group: ("+this.complexity()+")>"},addWithUpdate:function(e){var i=!!this.group;return this._restoreObjectsState(),t.util.resetObjectTransform(this),e&&(i&&t.util.removeTransformFromObject(e,this.group.calcTransformMatrix()),this._objects.push(e),e.group=this,e._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,i?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(e){return this._restoreObjectsState(),t.util.resetObjectTransform(this),this.remove(e),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(e){this.dirty=!0,e.group=this,e._set("canvas",this.canvas)},_onObjectRemoved:function(e){this.dirty=!0,delete e.group},_set:function(e,i){var n=this._objects.length;if(this.useSetOnGroup)for(;n--;)this._objects[n].setOnGroup(e,i);if("canvas"===e)for(;n--;)this._objects[n]._set(e,i);t.Object.prototype._set.call(this,e,i)},toObject:function(e){var i=this.includeDefaultValues,n=this._objects.filter((function(e){return!e.excludeFromExport})).map((function(t){var n=t.includeDefaultValues;t.includeDefaultValues=i;var r=t.toObject(e);return t.includeDefaultValues=n,r})),r=t.Object.prototype.toObject.call(this,e);return r.objects=n,r},toDatalessObject:function(e){var i,n=this.sourcePath;if(n)i=n;else{var r=this.includeDefaultValues;i=this._objects.map((function(t){var i=t.includeDefaultValues;t.includeDefaultValues=r;var n=t.toDatalessObject(e);return t.includeDefaultValues=i,n}))}var a=t.Object.prototype.toDatalessObject.call(this,e);return a.objects=i,a},render:function(e){this._transformDone=!0,this.callSuper("render",e),this._transformDone=!1},shouldCache:function(){var e=t.Object.prototype.shouldCache.call(this);if(e)for(var i=0,n=this._objects.length;i<n;i++)if(this._objects[i].willDrawShadow())return this.ownCaching=!1,!1;return e},willDrawShadow:function(){if(t.Object.prototype.willDrawShadow.call(this))return!0;for(var e=0,i=this._objects.length;e<i;e++)if(this._objects[e].willDrawShadow())return!0;return!1},isOnACache:function(){return this.ownCaching||this.group&&this.group.isOnACache()},drawObject:function(e){for(var t=0,i=this._objects.length;t<i;t++)this._objects[t].render(e);this._drawClipPath(e)},isCacheDirty:function(e){if(this.callSuper("isCacheDirty",e))return!0;if(!this.statefullCache)return!1;for(var t=0,i=this._objects.length;t<i;t++)if(this._objects[t].isCacheDirty(!0)){if(this._cacheCanvas){var n=this.cacheWidth/this.zoomX,r=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-n/2,-r/2,n,r)}return!0}return!1},_restoreObjectsState:function(){var e=this.calcOwnMatrix();return this._objects.forEach((function(i){t.util.addTransformToObject(i,e),delete i.group,i.setCoords()})),this},realizeTransform:function(e,i){return t.util.addTransformToObject(e,i),e},destroy:function(){return this._objects.forEach((function(e){e.set("dirty",!0)})),this._restoreObjectsState()},toActiveSelection:function(){if(this.canvas){var e=this._objects,i=this.canvas;this._objects=[];var n=this.toObject();delete n.objects;var r=new t.ActiveSelection([]);return r.set(n),r.type="activeSelection",i.remove(this),e.forEach((function(e){e.group=r,e.dirty=!0,i.add(e)})),r.canvas=i,r._objects=e,i._activeObject=r,r.setCoords(),r}},ungroupOnCanvas:function(){return this._restoreObjectsState()},setObjectsCoords:function(){return this.forEachObject((function(e){e.setCoords(!0)})),this},_calcBounds:function(e){for(var t,i,n,r,a=[],o=[],s=["tr","br","bl","tl"],l=0,c=this._objects.length,h=s.length;l<c;++l){for(n=(t=this._objects[l]).calcACoords(),r=0;r<h;r++)i=s[r],a.push(n[i].x),o.push(n[i].y);t.aCoords=n}this._getBounds(a,o,e)},_getBounds:function(e,r,a){var o=new t.Point(i(e),i(r)),s=new t.Point(n(e),n(r)),l=o.y||0,c=o.x||0,h=s.x-o.x||0,u=s.y-o.y||0;this.width=h,this.height=u,a||this.setPositionByOrigin({x:c,y:l},"left","top")},_toSVG:function(e){for(var t=["<g ","COMMON_PARTS"," >\n"],i=0,n=this._objects.length;i<n;i++)t.push("\t\t",this._objects[i].toSVG(e));return t.push("</g>\n"),t},getSvgStyles:function(){var e=void 0!==this.opacity&&1!==this.opacity?"opacity: "+this.opacity+";":"",t=this.visible?"":" visibility: hidden;";return[e,this.getSvgFilter(),t].join("")},toClipPathSVG:function(e){for(var t=[],i=0,n=this._objects.length;i<n;i++)t.push("\t",this._objects[i].toClipPathSVG(e));return this._createBaseClipPathSVGMarkup(t,{reviver:e})}}),t.Group.fromObject=function(e,i){var n=e.objects,r=t.util.object.clone(e,!0);delete r.objects,"string"!=typeof n?t.util.enlivenObjects(n,(function(n){t.util.enlivenObjects([e.clipPath],(function(r){var a=t.util.object.clone(e,!0);a.clipPath=r[0],delete a.objects,i&&i(new t.Group(n,a,!0))}))})):t.loadSVGFromURL(n,(function(a){var o=t.util.groupSVGElements(a,e,n);o.set(r),i&&i(o)}))})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});t.ActiveSelection||(t.ActiveSelection=t.util.createClass(t.Group,{type:"activeSelection",initialize:function(e,i){i=i||{},this._objects=e||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;i.originX&&(this.originX=i.originX),i.originY&&(this.originY=i.originY),this._calcBounds(),this._updateObjectsCoords(),t.Object.prototype.initialize.call(this,i),this.setCoords()},toGroup:function(){var e=this._objects.concat();this._objects=[];var i=t.Object.prototype.toObject.call(this),n=new t.Group([]);if(delete i.type,n.set(i),e.forEach((function(e){e.canvas.remove(e),e.group=n})),n._objects=e,!this.canvas)return n;var r=this.canvas;return r.add(n),r._activeObject=n,n.setCoords(),n},onDeselect:function(){return this.destroy(),!1},toString:function(){return"#<fabric.ActiveSelection: ("+this.complexity()+")>"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(e,t,i){e.save(),e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",e,t),void 0===(i=i||{}).hasControls&&(i.hasControls=!1),i.forActiveSelection=!0;for(var n=0,r=this._objects.length;n<r;n++)this._objects[n]._renderControls(e,i);e.restore()}}),t.ActiveSelection.fromObject=function(e,i){t.util.enlivenObjects(e.objects,(function(n){delete e.objects,i&&i(new t.ActiveSelection(n,e,!0))}))})}(t),function(e){"use strict";var t=_.util.object.extend;e.fabric||(e.fabric={}),e.fabric.Image?_.warn("fabric.Image is already defined."):(_.Image=_.util.createClass(_.Object,{type:"image",strokeWidth:0,srcFromAttribute:!1,_lastScaleX:1,_lastScaleY:1,_filterScalingX:1,_filterScalingY:1,minimumScaleTrigger:.5,stateProperties:_.Object.prototype.stateProperties.concat("cropX","cropY"),cacheProperties:_.Object.prototype.cacheProperties.concat("cropX","cropY"),cacheKey:"",cropX:0,cropY:0,imageSmoothing:!0,initialize:function(e,t){t||(t={}),this.filters=[],this.cacheKey="texture"+_.Object.__uid++,this.callSuper("initialize",t),this._initElement(e,t)},getElement:function(){return this._element||{}},setElement:function(e,t){return this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._element=e,this._originalElement=e,this._initConfig(t),0!==this.filters.length&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters(),this},removeTexture:function(e){var t=_.filterBackend;t&&t.evictCachesForKey&&t.evictCachesForKey(e)},dispose:function(){this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._cacheContext=void 0,["_originalElement","_element","_filteredEl","_cacheCanvas"].forEach(function(e){_.util.cleanUpJsdomNode(this[e]),this[e]=void 0}.bind(this))},getCrossOrigin:function(){return this._originalElement&&(this._originalElement.crossOrigin||null)},getOriginalSize:function(){var e=this.getElement();return{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height}},_stroke:function(e){if(this.stroke&&0!==this.strokeWidth){var t=this.width/2,i=this.height/2;e.beginPath(),e.moveTo(-t,-i),e.lineTo(t,-i),e.lineTo(t,i),e.lineTo(-t,i),e.lineTo(-t,-i),e.closePath()}},toObject:function(e){var i=[];this.filters.forEach((function(e){e&&i.push(e.toObject())}));var n=t(this.callSuper("toObject",["cropX","cropY"].concat(e)),{src:this.getSrc(),crossOrigin:this.getCrossOrigin(),filters:i});return this.resizeFilter&&(n.resizeFilter=this.resizeFilter.toObject()),n},hasCrop:function(){return this.cropX||this.cropY||this.width<this._element.width||this.height<this._element.height},_toSVG:function(){var e,t=[],i=[],n=this._element,r=-this.width/2,a=-this.height/2,o="",s="";if(!n)return[];if(this.hasCrop()){var l=_.Object.__uid++;t.push('<clipPath id="imageCrop_'+l+'">\n','\t<rect x="'+r+'" y="'+a+'" width="'+this.width+'" height="'+this.height+'" />\n',"</clipPath>\n"),o=' clip-path="url(#imageCrop_'+l+')" '}if(this.imageSmoothing||(s='" image-rendering="optimizeSpeed'),i.push("\t<image ","COMMON_PARTS",'xlink:href="',this.getSvgSrc(!0),'" x="',r-this.cropX,'" y="',a-this.cropY,'" width="',n.width||n.naturalWidth,'" height="',n.height||n.height,s,'"',o,"></image>\n"),this.stroke||this.strokeDashArray){var c=this.fill;this.fill=null,e=["\t<rect ",'x="',r,'" y="',a,'" width="',this.width,'" height="',this.height,'" style="',this.getSvgStyles(),'"/>\n'],this.fill=c}return t="fill"!==this.paintFirst?t.concat(e,i):t.concat(i,e)},getSrc:function(e){var t=e?this._element:this._originalElement;return t?t.toDataURL?t.toDataURL():this.srcFromAttribute?t.getAttribute("src"):t.src:this.src||""},setSrc:function(e,t,i){return _.util.loadImage(e,(function(e,n){this.setElement(e,i),this._setWidthHeight(),t&&t(this,n)}),this,i&&i.crossOrigin),this},toString:function(){return'#<fabric.Image: { src: "'+this.getSrc()+'" }>'},applyResizeFilters:function(){var e=this.resizeFilter,t=this.minimumScaleTrigger,i=this.getTotalObjectScaling(),n=i.scaleX,r=i.scaleY,a=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!e||n>t&&r>t)return this._element=a,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=n,void(this._lastScaleY=r);_.filterBackend||(_.filterBackend=_.initFilterBackend());var o=_.util.createCanvasElement(),s=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,l=a.width,c=a.height;o.width=l,o.height=c,this._element=o,this._lastScaleX=e.scaleX=n,this._lastScaleY=e.scaleY=r,_.filterBackend.applyFilters([e],a,l,c,this._element,s),this._filterScalingX=o.width/this._originalElement.width,this._filterScalingY=o.height/this._originalElement.height},applyFilters:function(e){if(e=(e=e||this.filters||[]).filter((function(e){return e&&!e.isNeutralState()})),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),0===e.length)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var t=this._originalElement,i=t.naturalWidth||t.width,n=t.naturalHeight||t.height;if(this._element===this._originalElement){var r=_.util.createCanvasElement();r.width=i,r.height=n,this._element=r,this._filteredEl=r}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,i,n),this._lastScaleX=1,this._lastScaleY=1;return _.filterBackend||(_.filterBackend=_.initFilterBackend()),_.filterBackend.applyFilters(e,this._originalElement,i,n,this._element,this.cacheKey),this._originalElement.width===this._element.width&&this._originalElement.height===this._element.height||(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(e){_.util.setImageSmoothing(e,this.imageSmoothing),!0!==this.isMoving&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(e),this._renderPaintInOrder(e)},drawCacheOnCanvas:function(e){_.util.setImageSmoothing(e,this.imageSmoothing),_.Object.prototype.drawCacheOnCanvas.call(this,e)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(e){var t=this._element;if(t){var i=this._filterScalingX,n=this._filterScalingY,r=this.width,a=this.height,o=Math.min,s=Math.max,l=s(this.cropX,0),c=s(this.cropY,0),h=t.naturalWidth||t.width,u=t.naturalHeight||t.height,f=l*i,d=c*n,m=o(r*i,h-f),g=o(a*n,u-d),v=-r/2,p=-a/2,y=o(r,h/i-l),b=o(a,u/n-c);t&&e.drawImage(t,f,d,m,g,v,p,y,b)}},_needsResize:function(){var e=this.getTotalObjectScaling();return e.scaleX!==this._lastScaleX||e.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(e,t){this.setElement(_.util.getById(e),t),_.util.addClass(this.getElement(),_.Image.CSS_CANVAS)},_initConfig:function(e){e||(e={}),this.setOptions(e),this._setWidthHeight(e)},_initFilters:function(e,t){e&&e.length?_.util.enlivenObjects(e,(function(e){t&&t(e)}),"fabric.Image.filters"):t&&t()},_setWidthHeight:function(e){e||(e={});var t=this.getElement();this.width=e.width||t.naturalWidth||t.width||0,this.height=e.height||t.naturalHeight||t.height||0},parsePreserveAspectRatioAttribute:function(){var e,t=_.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),i=this._element.width,n=this._element.height,r=1,a=1,o=0,s=0,l=0,c=0,h=this.width,u=this.height,f={width:h,height:u};return!t||"none"===t.alignX&&"none"===t.alignY?(r=h/i,a=u/n):("meet"===t.meetOrSlice&&(e=(h-i*(r=a=_.util.findScaleToFit(this._element,f)))/2,"Min"===t.alignX&&(o=-e),"Max"===t.alignX&&(o=e),e=(u-n*a)/2,"Min"===t.alignY&&(s=-e),"Max"===t.alignY&&(s=e)),"slice"===t.meetOrSlice&&(e=i-h/(r=a=_.util.findScaleToCover(this._element,f)),"Mid"===t.alignX&&(l=e/2),"Max"===t.alignX&&(l=e),e=n-u/a,"Mid"===t.alignY&&(c=e/2),"Max"===t.alignY&&(c=e),i=h/r,n=u/a)),{width:i,height:n,scaleX:r,scaleY:a,offsetLeft:o,offsetTop:s,cropX:l,cropY:c}}}),_.Image.CSS_CANVAS="canvas-img",_.Image.prototype.getSvgSrc=_.Image.prototype.getSrc,_.Image.fromObject=function(e,t){var i=_.util.object.clone(e);_.util.loadImage(i.src,(function(e,n){n?t&&t(null,!0):_.Image.prototype._initFilters.call(i,i.filters,(function(n){i.filters=n||[],_.Image.prototype._initFilters.call(i,[i.resizeFilter],(function(n){i.resizeFilter=n[0],_.util.enlivenObjects([i.clipPath],(function(n){i.clipPath=n[0];var r=new _.Image(e,i);t(r,!1)}))}))}))}),null,i.crossOrigin)},_.Image.fromURL=function(e,t,i){_.util.loadImage(e,(function(e,n){t&&t(new _.Image(e,i),n)}),null,i&&i.crossOrigin)},_.Image.ATTRIBUTE_NAMES=_.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),_.Image.fromElement=function(e,i,n){var r=_.parseAttributes(e,_.Image.ATTRIBUTE_NAMES);_.Image.fromURL(r["xlink:href"],i,t(n?_.util.object.clone(n):{},r))})}(t),_.util.object.extend(_.Object.prototype,{_getAngleValueForStraighten:function(){var e=this.angle%360;return e>0?90*Math.round((e-1)/90):90*Math.round(e/90)},straighten:function(){return this.rotate(this._getAngleValueForStraighten()),this},fxStraighten:function(e){var t=function(){},i=(e=e||{}).onComplete||t,n=e.onChange||t,r=this;return _.util.animate({startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(e){r.rotate(e),n()},onComplete:function(){r.setCoords(),i()}}),this}}),_.util.object.extend(_.StaticCanvas.prototype,{straightenObject:function(e){return e.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(e){return e.fxStraighten({onChange:this.requestRenderAllBound}),this}}),function(){"use strict";function e(e,t){var i="precision "+t+" float;\nvoid main(){}",n=e.createShader(e.FRAGMENT_SHADER);return e.shaderSource(n,i),e.compileShader(n),!!e.getShaderParameter(n,e.COMPILE_STATUS)}function t(e){e&&e.tileSize&&(this.tileSize=e.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}_.isWebglSupported=function(t){if(_.isLikelyNode)return!1;t=t||_.WebglFilterBackend.prototype.tileSize;var i=document.createElement("canvas"),n=i.getContext("webgl")||i.getContext("experimental-webgl"),r=!1;if(n){_.maxTextureSize=n.getParameter(n.MAX_TEXTURE_SIZE),r=_.maxTextureSize>=t;for(var a=["highp","mediump","lowp"],o=0;o<3;o++)if(e(n,a[o])){_.webGlPrecision=a[o];break}}return this.isSupported=r,r},_.WebglFilterBackend=t,t.prototype={tileSize:2048,resources:{},setupGLContext:function(e,t){this.dispose(),this.createWebGLCanvas(e,t),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(e,t)},chooseFastestCopyGLTo2DMethod:function(e,t){var i,n=void 0!==window.performance;try{new ImageData(1,1),i=!0}catch(e){i=!1}var r="undefined"!=typeof ArrayBuffer,a="undefined"!=typeof Uint8ClampedArray;if(n&&i&&r&&a){var o=_.util.createCanvasElement(),s=new ArrayBuffer(e*t*4);if(_.forceGLPutImageData)return this.imageBuffer=s,void(this.copyGLTo2D=E);var l,c,h={imageBuffer:s,destinationWidth:e,destinationHeight:t,targetCanvas:o};o.width=e,o.height=t,l=window.performance.now(),O.call(h,this.gl,h),c=window.performance.now()-l,l=window.performance.now(),E.call(h,this.gl,h),c>window.performance.now()-l?(this.imageBuffer=s,this.copyGLTo2D=E):this.copyGLTo2D=O}},createWebGLCanvas:function(e,t){var i=_.util.createCanvasElement();i.width=e,i.height=t;var n={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},r=i.getContext("webgl",n);r||(r=i.getContext("experimental-webgl",n)),r&&(r.clearColor(0,0,0,0),this.canvas=i,this.gl=r)},applyFilters:function(e,t,i,n,r,a){var o,s=this.gl;a&&(o=this.getCachedTexture(a,t));var l={originalWidth:t.width||t.originalWidth,originalHeight:t.height||t.originalHeight,sourceWidth:i,sourceHeight:n,destinationWidth:i,destinationHeight:n,context:s,sourceTexture:this.createTexture(s,i,n,!o&&t),targetTexture:this.createTexture(s,i,n),originalTexture:o||this.createTexture(s,i,n,!o&&t),passes:e.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:r},c=s.createFramebuffer();return s.bindFramebuffer(s.FRAMEBUFFER,c),e.forEach((function(e){e&&e.applyTo(l)})),function(e){var t=e.targetCanvas,i=t.width,n=t.height,r=e.destinationWidth,a=e.destinationHeight;i===r&&n===a||(t.width=r,t.height=a)}(l),this.copyGLTo2D(s,l),s.bindTexture(s.TEXTURE_2D,null),s.deleteTexture(l.sourceTexture),s.deleteTexture(l.targetTexture),s.deleteFramebuffer(c),r.getContext("2d").setTransform(1,0,0,1,0,0),l},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(e,t,i,n){var r=e.createTexture();return e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),n?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,i,0,e.RGBA,e.UNSIGNED_BYTE,null),r},getCachedTexture:function(e,t){if(this.textureCache[e])return this.textureCache[e];var i=this.createTexture(this.gl,t.width,t.height,t);return this.textureCache[e]=i,i},evictCachesForKey:function(e){this.textureCache[e]&&(this.gl.deleteTexture(this.textureCache[e]),delete this.textureCache[e])},copyGLTo2D:O,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var e=this.gl,t={renderer:"",vendor:""};if(!e)return t;var i=e.getExtension("WEBGL_debug_renderer_info");if(i){var n=e.getParameter(i.UNMASKED_RENDERER_WEBGL),r=e.getParameter(i.UNMASKED_VENDOR_WEBGL);n&&(t.renderer=n.toLowerCase()),r&&(t.vendor=r.toLowerCase())}return this.gpuInfo=t,t}}}(),function(){"use strict";var e=function(){};function t(){}_.Canvas2dFilterBackend=t,t.prototype={evictCachesForKey:e,dispose:e,clearWebGLCaches:e,resources:{},applyFilters:function(e,t,i,n,r){var a=r.getContext("2d");a.drawImage(t,0,0,i,n);var o={sourceWidth:i,sourceHeight:n,imageData:a.getImageData(0,0,i,n),originalEl:t,originalImageData:a.getImageData(0,0,i,n),canvasEl:r,ctx:a,filterBackend:this};return e.forEach((function(e){e.applyTo(o)})),o.imageData.width===i&&o.imageData.height===n||(r.width=o.imageData.width,r.height=o.imageData.height),a.putImageData(o.imageData,0,0),o}}}(),_.Image=_.Image||{},_.Image.filters=_.Image.filters||{},_.Image.filters.BaseFilter=_.util.createClass({type:"BaseFilter",vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvoid main() {\nvTexCoord = aPosition;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:"precision highp float;\nvarying vec2 vTexCoord;\nuniform sampler2D uTexture;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\n}",initialize:function(e){e&&this.setOptions(e)},setOptions:function(e){for(var t in e)this[t]=e[t]},createProgram:function(e,t,i){t=t||this.fragmentSource,i=i||this.vertexSource,"highp"!==_.webGlPrecision&&(t=t.replace(/precision highp float/g,"precision "+_.webGlPrecision+" float"));var n=e.createShader(e.VERTEX_SHADER);if(e.shaderSource(n,i),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+e.getShaderInfoLog(n));var r=e.createShader(e.FRAGMENT_SHADER);if(e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+e.getShaderInfoLog(r));var a=e.createProgram();if(e.attachShader(a,n),e.attachShader(a,r),e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+e.getProgramInfoLog(a));var o=this.getAttributeLocations(e,a),s=this.getUniformLocations(e,a)||{};return s.uStepW=e.getUniformLocation(a,"uStepW"),s.uStepH=e.getUniformLocation(a,"uStepH"),{program:a,attributeLocations:o,uniformLocations:s}},getAttributeLocations:function(e,t){return{aPosition:e.getAttribLocation(t,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(e,t,i){var n=t.aPosition,r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.enableVertexAttribArray(n),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0),e.bufferData(e.ARRAY_BUFFER,i,e.STATIC_DRAW)},_setupFrameBuffer:function(e){var t,i,n=e.context;e.passes>1?(t=e.destinationWidth,i=e.destinationHeight,e.sourceWidth===t&&e.sourceHeight===i||(n.deleteTexture(e.targetTexture),e.targetTexture=e.filterBackend.createTexture(n,t,i)),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e.targetTexture,0)):(n.bindFramebuffer(n.FRAMEBUFFER,null),n.finish())},_swapTextures:function(e){e.passes--,e.pass++;var t=e.targetTexture;e.targetTexture=e.sourceTexture,e.sourceTexture=t},isNeutralState:function(){var e=this.mainParameter,t=_.Image.filters[this.type].prototype;if(e){if(Array.isArray(t[e])){for(var i=t[e].length;i--;)if(this[e][i]!==t[e][i])return!1;return!0}return t[e]===this[e]}return!1},applyTo:function(e){e.webgl?(this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e)):this.applyTo2d(e)},retrieveShader:function(e){return e.programCache.hasOwnProperty(this.type)||(e.programCache[this.type]=this.createProgram(e.context)),e.programCache[this.type]},applyToWebGL:function(e){var t=e.context,i=this.retrieveShader(e);0===e.pass&&e.originalTexture?t.bindTexture(t.TEXTURE_2D,e.originalTexture):t.bindTexture(t.TEXTURE_2D,e.sourceTexture),t.useProgram(i.program),this.sendAttributeData(t,i.attributeLocations,e.aPosition),t.uniform1f(i.uniformLocations.uStepW,1/e.sourceWidth),t.uniform1f(i.uniformLocations.uStepH,1/e.sourceHeight),this.sendUniformData(t,i.uniformLocations),t.viewport(0,0,e.destinationWidth,e.destinationHeight),t.drawArrays(t.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(e,t,i){e.activeTexture(i),e.bindTexture(e.TEXTURE_2D,t),e.activeTexture(e.TEXTURE0)},unbindAdditionalTexture:function(e,t){e.activeTexture(t),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(e.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(e){this[this.mainParameter]=e},sendUniformData:function(){},createHelpLayer:function(e){if(!e.helpLayer){var t=document.createElement("canvas");t.width=e.sourceWidth,t.height=e.sourceHeight,e.helpLayer=t}},toObject:function(){var e={type:this.type},t=this.mainParameter;return t&&(e[t]=this[t]),e},toJSON:function(){return this.toObject()}}),_.Image.filters.BaseFilter.fromObject=function(e,t){var i=new _.Image.filters[e.type](e);return t&&t(i),i},function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.ColorMatrix=n(i.BaseFilter,{type:"ColorMatrix",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nuniform mat4 uColorMatrix;\nuniform vec4 uConstants;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor *= uColorMatrix;\ncolor += uConstants;\ngl_FragColor = color;\n}",matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:"matrix",colorsOnly:!0,initialize:function(e){this.callSuper("initialize",e),this.matrix=this.matrix.slice(0)},applyTo2d:function(e){var t,i,n,r,a,o=e.imageData.data,s=o.length,l=this.matrix,c=this.colorsOnly;for(a=0;a<s;a+=4)t=o[a],i=o[a+1],n=o[a+2],c?(o[a]=t*l[0]+i*l[1]+n*l[2]+255*l[4],o[a+1]=t*l[5]+i*l[6]+n*l[7]+255*l[9],o[a+2]=t*l[10]+i*l[11]+n*l[12]+255*l[14]):(r=o[a+3],o[a]=t*l[0]+i*l[1]+n*l[2]+r*l[3]+255*l[4],o[a+1]=t*l[5]+i*l[6]+n*l[7]+r*l[8]+255*l[9],o[a+2]=t*l[10]+i*l[11]+n*l[12]+r*l[13]+255*l[14],o[a+3]=t*l[15]+i*l[16]+n*l[17]+r*l[18]+255*l[19])},getUniformLocations:function(e,t){return{uColorMatrix:e.getUniformLocation(t,"uColorMatrix"),uConstants:e.getUniformLocation(t,"uConstants")}},sendUniformData:function(e,t){var i=this.matrix,n=[i[0],i[1],i[2],i[3],i[5],i[6],i[7],i[8],i[10],i[11],i[12],i[13],i[15],i[16],i[17],i[18]],r=[i[4],i[9],i[14],i[19]];e.uniformMatrix4fv(t.uColorMatrix,!1,n),e.uniform4fv(t.uConstants,r)}}),t.Image.filters.ColorMatrix.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Brightness=n(i.BaseFilter,{type:"Brightness",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBrightness;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += uBrightness;\ngl_FragColor = color;\n}",brightness:0,mainParameter:"brightness",applyTo2d:function(e){if(0!==this.brightness){var t,i=e.imageData.data,n=i.length,r=Math.round(255*this.brightness);for(t=0;t<n;t+=4)i[t]=i[t]+r,i[t+1]=i[t+1]+r,i[t+2]=i[t+2]+r}},getUniformLocations:function(e,t){return{uBrightness:e.getUniformLocation(t,"uBrightness")}},sendUniformData:function(e,t){e.uniform1f(t.uBrightness,this.brightness)}}),t.Image.filters.Brightness.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend,n=t.Image.filters,r=t.util.createClass;n.Convolute=r(n.BaseFilter,{type:"Convolute",opaque:!1,matrix:[0,0,0,0,1,0,0,0,0],fragmentSource:{Convolute_3_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1), uStepH * (h - 1));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 3.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_3_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1.0), uStepH * (h - 1.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 3.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_5_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 5.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_5_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 5.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_7_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 7.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_7_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 7.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_9_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 9.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_9_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 9.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}"},retrieveShader:function(e){var t=Math.sqrt(this.matrix.length),i=this.type+"_"+t+"_"+(this.opaque?1:0),n=this.fragmentSource[i];return e.programCache.hasOwnProperty(i)||(e.programCache[i]=this.createProgram(e.context,n)),e.programCache[i]},applyTo2d:function(e){var t,i,n,r,a,o,s,l,c,h,u,f,d,m=e.imageData,g=m.data,v=this.matrix,p=Math.round(Math.sqrt(v.length)),y=Math.floor(p/2),b=m.width,w=m.height,x=e.ctx.createImageData(b,w),k=x.data,C=this.opaque?1:0;for(u=0;u<w;u++)for(h=0;h<b;h++){for(a=4*(u*b+h),t=0,i=0,n=0,r=0,d=0;d<p;d++)for(f=0;f<p;f++)o=h+f-y,(s=u+d-y)<0||s>=w||o<0||o>=b||(l=4*(s*b+o),c=v[d*p+f],t+=g[l]*c,i+=g[l+1]*c,n+=g[l+2]*c,C||(r+=g[l+3]*c));k[a]=t,k[a+1]=i,k[a+2]=n,k[a+3]=C?g[a+3]:r}e.imageData=x},getUniformLocations:function(e,t){return{uMatrix:e.getUniformLocation(t,"uMatrix"),uOpaque:e.getUniformLocation(t,"uOpaque"),uHalfSize:e.getUniformLocation(t,"uHalfSize"),uSize:e.getUniformLocation(t,"uSize")}},sendUniformData:function(e,t){e.uniform1fv(t.uMatrix,this.matrix)},toObject:function(){return i(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),t.Image.filters.Convolute.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Grayscale=n(i.BaseFilter,{type:"Grayscale",fragmentSource:{average:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat average = (color.r + color.b + color.g) / 3.0;\ngl_FragColor = vec4(average, average, average, color.a);\n}",lightness:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;\ngl_FragColor = vec4(average, average, average, col.a);\n}",luminosity:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b;\ngl_FragColor = vec4(average, average, average, col.a);\n}"},mode:"average",mainParameter:"mode",applyTo2d:function(e){var t,i,n=e.imageData.data,r=n.length,a=this.mode;for(t=0;t<r;t+=4)"average"===a?i=(n[t]+n[t+1]+n[t+2])/3:"lightness"===a?i=(Math.min(n[t],n[t+1],n[t+2])+Math.max(n[t],n[t+1],n[t+2]))/2:"luminosity"===a&&(i=.21*n[t]+.72*n[t+1]+.07*n[t+2]),n[t]=i,n[t+1]=i,n[t+2]=i},retrieveShader:function(e){var t=this.type+"_"+this.mode;if(!e.programCache.hasOwnProperty(t)){var i=this.fragmentSource[this.mode];e.programCache[t]=this.createProgram(e.context,i)}return e.programCache[t]},getUniformLocations:function(e,t){return{uMode:e.getUniformLocation(t,"uMode")}},sendUniformData:function(e,t){e.uniform1i(t.uMode,1)},isNeutralState:function(){return!1}}),t.Image.filters.Grayscale.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Invert=n(i.BaseFilter,{type:"Invert",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uInvert;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nif (uInvert == 1) {\ngl_FragColor = vec4(1.0 - color.r,1.0 -color.g,1.0 -color.b,color.a);\n} else {\ngl_FragColor = color;\n}\n}",invert:!0,mainParameter:"invert",applyTo2d:function(e){var t,i=e.imageData.data,n=i.length;for(t=0;t<n;t+=4)i[t]=255-i[t],i[t+1]=255-i[t+1],i[t+2]=255-i[t+2]},isNeutralState:function(){return!this.invert},getUniformLocations:function(e,t){return{uInvert:e.getUniformLocation(t,"uInvert")}},sendUniformData:function(e,t){e.uniform1i(t.uInvert,this.invert)}}),t.Image.filters.Invert.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend,n=t.Image.filters,r=t.util.createClass;n.Noise=r(n.BaseFilter,{type:"Noise",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uStepH;\nuniform float uNoise;\nuniform float uSeed;\nvarying vec2 vTexCoord;\nfloat rand(vec2 co, float seed, float vScale) {\nreturn fract(sin(dot(co.xy * vScale ,vec2(12.9898 , 78.233))) * 43758.5453 * (seed + 0.01) / 2.0);\n}\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += (0.5 - rand(vTexCoord, uSeed, 0.1 / uStepH)) * uNoise;\ngl_FragColor = color;\n}",mainParameter:"noise",noise:0,applyTo2d:function(e){if(0!==this.noise){var t,i,n=e.imageData.data,r=n.length,a=this.noise;for(t=0,r=n.length;t<r;t+=4)i=(.5-Math.random())*a,n[t]+=i,n[t+1]+=i,n[t+2]+=i}},getUniformLocations:function(e,t){return{uNoise:e.getUniformLocation(t,"uNoise"),uSeed:e.getUniformLocation(t,"uSeed")}},sendUniformData:function(e,t){e.uniform1f(t.uNoise,this.noise/255),e.uniform1f(t.uSeed,Math.random())},toObject:function(){return i(this.callSuper("toObject"),{noise:this.noise})}}),t.Image.filters.Noise.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Pixelate=n(i.BaseFilter,{type:"Pixelate",blocksize:4,mainParameter:"blocksize",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBlocksize;\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nfloat blockW = uBlocksize * uStepW;\nfloat blockH = uBlocksize * uStepW;\nint posX = int(vTexCoord.x / blockW);\nint posY = int(vTexCoord.y / blockH);\nfloat fposX = float(posX);\nfloat fposY = float(posY);\nvec2 squareCoords = vec2(fposX * blockW, fposY * blockH);\nvec4 color = texture2D(uTexture, squareCoords);\ngl_FragColor = color;\n}",applyTo2d:function(e){var t,i,n,r,a,o,s,l,c,h,u,f=e.imageData,d=f.data,m=f.height,g=f.width;for(i=0;i<m;i+=this.blocksize)for(n=0;n<g;n+=this.blocksize)for(r=d[t=4*i*g+4*n],a=d[t+1],o=d[t+2],s=d[t+3],h=Math.min(i+this.blocksize,m),u=Math.min(n+this.blocksize,g),l=i;l<h;l++)for(c=n;c<u;c++)d[t=4*l*g+4*c]=r,d[t+1]=a,d[t+2]=o,d[t+3]=s},isNeutralState:function(){return 1===this.blocksize},getUniformLocations:function(e,t){return{uBlocksize:e.getUniformLocation(t,"uBlocksize"),uStepW:e.getUniformLocation(t,"uStepW"),uStepH:e.getUniformLocation(t,"uStepH")}},sendUniformData:function(e,t){e.uniform1f(t.uBlocksize,this.blocksize)}}),t.Image.filters.Pixelate.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend,n=t.Image.filters,r=t.util.createClass;n.RemoveColor=r(n.BaseFilter,{type:"RemoveColor",color:"#FFFFFF",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uLow;\nuniform vec4 uHigh;\nvarying vec2 vTexCoord;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\nif(all(greaterThan(gl_FragColor.rgb,uLow.rgb)) && all(greaterThan(uHigh.rgb,gl_FragColor.rgb))) {\ngl_FragColor.a = 0.0;\n}\n}",distance:.02,useAlpha:!1,applyTo2d:function(e){var i,n,r,a,o=e.imageData.data,s=255*this.distance,l=new t.Color(this.color).getSource(),c=[l[0]-s,l[1]-s,l[2]-s],h=[l[0]+s,l[1]+s,l[2]+s];for(i=0;i<o.length;i+=4)n=o[i],r=o[i+1],a=o[i+2],n>c[0]&&r>c[1]&&a>c[2]&&n<h[0]&&r<h[1]&&a<h[2]&&(o[i+3]=0)},getUniformLocations:function(e,t){return{uLow:e.getUniformLocation(t,"uLow"),uHigh:e.getUniformLocation(t,"uHigh")}},sendUniformData:function(e,i){var n=new t.Color(this.color).getSource(),r=parseFloat(this.distance),a=[0+n[0]/255-r,0+n[1]/255-r,0+n[2]/255-r,1],o=[n[0]/255+r,n[1]/255+r,n[2]/255+r,1];e.uniform4fv(i.uLow,a),e.uniform4fv(i.uHigh,o)},toObject:function(){return i(this.callSuper("toObject"),{color:this.color,distance:this.distance})}}),t.Image.filters.RemoveColor.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass,r={Brownie:[.5997,.34553,-.27082,0,.186,-.0377,.86095,.15059,0,-.1449,.24113,-.07441,.44972,0,-.02965,0,0,0,1,0],Vintage:[.62793,.32021,-.03965,0,.03784,.02578,.64411,.03259,0,.02926,.0466,-.08512,.52416,0,.02023,0,0,0,1,0],Kodachrome:[1.12855,-.39673,-.03992,0,.24991,-.16404,1.08352,-.05498,0,.09698,-.16786,-.56034,1.60148,0,.13972,0,0,0,1,0],Technicolor:[1.91252,-.85453,-.09155,0,.04624,-.30878,1.76589,-.10601,0,-.27589,-.2311,-.75018,1.84759,0,.12137,0,0,0,1,0],Polaroid:[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],Sepia:[.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0],BlackWhite:[1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,0,0,0,1,0]};for(var a in r)i[a]=n(i.ColorMatrix,{type:a,matrix:r[a],mainParameter:!1,colorsOnly:!0}),t.Image.filters[a].fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric,i=t.Image.filters,n=t.util.createClass;i.BlendColor=n(i.BaseFilter,{type:"BlendColor",color:"#F95C63",mode:"multiply",alpha:1,fragmentSource:{multiply:"gl_FragColor.rgb *= uColor.rgb;\n",screen:"gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);\n",add:"gl_FragColor.rgb += uColor.rgb;\n",diff:"gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb);\n",subtract:"gl_FragColor.rgb -= uColor.rgb;\n",lighten:"gl_FragColor.rgb = max(gl_FragColor.rgb, uColor.rgb);\n",darken:"gl_FragColor.rgb = min(gl_FragColor.rgb, uColor.rgb);\n",exclusion:"gl_FragColor.rgb += uColor.rgb - 2.0 * (uColor.rgb * gl_FragColor.rgb);\n",overlay:"if (uColor.r < 0.5) {\ngl_FragColor.r *= 2.0 * uColor.r;\n} else {\ngl_FragColor.r = 1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r);\n}\nif (uColor.g < 0.5) {\ngl_FragColor.g *= 2.0 * uColor.g;\n} else {\ngl_FragColor.g = 1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g);\n}\nif (uColor.b < 0.5) {\ngl_FragColor.b *= 2.0 * uColor.b;\n} else {\ngl_FragColor.b = 1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b);\n}\n",tint:"gl_FragColor.rgb *= (1.0 - uColor.a);\ngl_FragColor.rgb += uColor.rgb;\n"},buildSource:function(e){return"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ngl_FragColor = color;\nif (color.a > 0.0) {\n"+this.fragmentSource[e]+"}\n}"},retrieveShader:function(e){var t,i=this.type+"_"+this.mode;return e.programCache.hasOwnProperty(i)||(t=this.buildSource(this.mode),e.programCache[i]=this.createProgram(e.context,t)),e.programCache[i]},applyTo2d:function(e){var i,n,r,a,o,s,l,c=e.imageData.data,h=c.length,u=1-this.alpha;i=(l=new t.Color(this.color).getSource())[0]*this.alpha,n=l[1]*this.alpha,r=l[2]*this.alpha;for(var f=0;f<h;f+=4)switch(a=c[f],o=c[f+1],s=c[f+2],this.mode){case"multiply":c[f]=a*i/255,c[f+1]=o*n/255,c[f+2]=s*r/255;break;case"screen":c[f]=255-(255-a)*(255-i)/255,c[f+1]=255-(255-o)*(255-n)/255,c[f+2]=255-(255-s)*(255-r)/255;break;case"add":c[f]=a+i,c[f+1]=o+n,c[f+2]=s+r;break;case"diff":case"difference":c[f]=Math.abs(a-i),c[f+1]=Math.abs(o-n),c[f+2]=Math.abs(s-r);break;case"subtract":c[f]=a-i,c[f+1]=o-n,c[f+2]=s-r;break;case"darken":c[f]=Math.min(a,i),c[f+1]=Math.min(o,n),c[f+2]=Math.min(s,r);break;case"lighten":c[f]=Math.max(a,i),c[f+1]=Math.max(o,n),c[f+2]=Math.max(s,r);break;case"overlay":c[f]=i<128?2*a*i/255:255-2*(255-a)*(255-i)/255,c[f+1]=n<128?2*o*n/255:255-2*(255-o)*(255-n)/255,c[f+2]=r<128?2*s*r/255:255-2*(255-s)*(255-r)/255;break;case"exclusion":c[f]=i+a-2*i*a/255,c[f+1]=n+o-2*n*o/255,c[f+2]=r+s-2*r*s/255;break;case"tint":c[f]=i+a*u,c[f+1]=n+o*u,c[f+2]=r+s*u}},getUniformLocations:function(e,t){return{uColor:e.getUniformLocation(t,"uColor")}},sendUniformData:function(e,i){var n=new t.Color(this.color).getSource();n[0]=this.alpha*n[0]/255,n[1]=this.alpha*n[1]/255,n[2]=this.alpha*n[2]/255,n[3]=this.alpha,e.uniform4fv(i.uColor,n)},toObject:function(){return{type:this.type,color:this.color,mode:this.mode,alpha:this.alpha}}}),t.Image.filters.BlendColor.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric,i=t.Image.filters,n=t.util.createClass;i.BlendImage=n(i.BaseFilter,{type:"BlendImage",image:null,mode:"multiply",alpha:1,vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nuniform mat3 uTransformMatrix;\nvoid main() {\nvTexCoord = aPosition;\nvTexCoord2 = (uTransformMatrix * vec3(aPosition, 1.0)).xy;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:{multiply:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.rgba *= color2.rgba;\ngl_FragColor = color;\n}",mask:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.a = color2.a;\ngl_FragColor = color;\n}"},retrieveShader:function(e){var t=this.type+"_"+this.mode,i=this.fragmentSource[this.mode];return e.programCache.hasOwnProperty(t)||(e.programCache[t]=this.createProgram(e.context,i)),e.programCache[t]},applyToWebGL:function(e){var t=e.context,i=this.createTexture(e.filterBackend,this.image);this.bindAdditionalTexture(t,i,t.TEXTURE1),this.callSuper("applyToWebGL",e),this.unbindAdditionalTexture(t,t.TEXTURE1)},createTexture:function(e,t){return e.getCachedTexture(t.cacheKey,t._element)},calculateMatrix:function(){var e=this.image,t=e._element.width,i=e._element.height;return[1/e.scaleX,0,0,0,1/e.scaleY,0,-e.left/t,-e.top/i,1]},applyTo2d:function(e){var i,n,r,a,o,s,l,c,h,u,f,d=e.imageData,m=e.filterBackend.resources,g=d.data,v=g.length,p=d.width,y=d.height,b=this.image;m.blendImage||(m.blendImage=t.util.createCanvasElement()),u=(h=m.blendImage).getContext("2d"),h.width!==p||h.height!==y?(h.width=p,h.height=y):u.clearRect(0,0,p,y),u.setTransform(b.scaleX,0,0,b.scaleY,b.left,b.top),u.drawImage(b._element,0,0,p,y),f=u.getImageData(0,0,p,y).data;for(var w=0;w<v;w+=4)switch(o=g[w],s=g[w+1],l=g[w+2],c=g[w+3],i=f[w],n=f[w+1],r=f[w+2],a=f[w+3],this.mode){case"multiply":g[w]=o*i/255,g[w+1]=s*n/255,g[w+2]=l*r/255,g[w+3]=c*a/255;break;case"mask":g[w+3]=a}},getUniformLocations:function(e,t){return{uTransformMatrix:e.getUniformLocation(t,"uTransformMatrix"),uImage:e.getUniformLocation(t,"uImage")}},sendUniformData:function(e,t){var i=this.calculateMatrix();e.uniform1i(t.uImage,1),e.uniformMatrix3fv(t.uTransformMatrix,!1,i)},toObject:function(){return{type:this.type,image:this.image&&this.image.toObject(),mode:this.mode,alpha:this.alpha}}}),t.Image.filters.BlendImage.fromObject=function(e,i){t.Image.fromObject(e.image,(function(n){var r=t.util.object.clone(e);r.image=n,i(new t.Image.filters.BlendImage(r))}))}}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=Math.pow,n=Math.floor,r=Math.sqrt,a=Math.abs,o=Math.round,s=Math.sin,l=Math.ceil,c=t.Image.filters,h=t.util.createClass;c.Resize=h(c.BaseFilter,{type:"Resize",resizeType:"hermite",scaleX:1,scaleY:1,lanczosLobes:3,getUniformLocations:function(e,t){return{uDelta:e.getUniformLocation(t,"uDelta"),uTaps:e.getUniformLocation(t,"uTaps")}},sendUniformData:function(e,t){e.uniform2fv(t.uDelta,this.horizontal?[1/this.width,0]:[0,1/this.height]),e.uniform1fv(t.uTaps,this.taps)},retrieveShader:function(e){var t=this.getFilterWindow(),i=this.type+"_"+t;if(!e.programCache.hasOwnProperty(i)){var n=this.generateShader(t);e.programCache[i]=this.createProgram(e.context,n)}return e.programCache[i]},getFilterWindow:function(){var e=this.tempScale;return Math.ceil(this.lanczosLobes/e)},getTaps:function(){for(var e=this.lanczosCreate(this.lanczosLobes),t=this.tempScale,i=this.getFilterWindow(),n=new Array(i),r=1;r<=i;r++)n[r-1]=e(r*t);return n},generateShader:function(e){for(var t=new Array(e),i=this.fragmentSourceTOP,n=1;n<=e;n++)t[n-1]=n+".0 * uDelta";return i+="uniform float uTaps["+e+"];\n",i+="void main() {\n",i+=" vec4 color = texture2D(uTexture, vTexCoord);\n",i+=" float sum = 1.0;\n",t.forEach((function(e,t){i+=" color += texture2D(uTexture, vTexCoord + "+e+") * uTaps["+t+"];\n",i+=" color += texture2D(uTexture, vTexCoord - "+e+") * uTaps["+t+"];\n",i+=" sum += 2.0 * uTaps["+t+"];\n"})),i+=" gl_FragColor = color / sum;\n",i+="}"},fragmentSourceTOP:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\n",applyTo:function(e){e.webgl?(e.passes++,this.width=e.sourceWidth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=e.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),e.destinationWidth=this.dW,this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e),e.sourceWidth=e.destinationWidth,this.height=e.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),e.destinationHeight=this.dH,this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e),e.sourceHeight=e.destinationHeight):this.applyTo2d(e)},isNeutralState:function(){return 1===this.scaleX&&1===this.scaleY},lanczosCreate:function(e){return function(t){if(t>=e||t<=-e)return 0;if(t<1.1920929e-7&&t>-1.1920929e-7)return 1;var i=(t*=Math.PI)/e;return s(t)/t*s(i)/i}},applyTo2d:function(e){var t=e.imageData,i=this.scaleX,n=this.scaleY;this.rcpScaleX=1/i,this.rcpScaleY=1/n;var r,a=t.width,s=t.height,l=o(a*i),c=o(s*n);"sliceHack"===this.resizeType?r=this.sliceByTwo(e,a,s,l,c):"hermite"===this.resizeType?r=this.hermiteFastResize(e,a,s,l,c):"bilinear"===this.resizeType?r=this.bilinearFiltering(e,a,s,l,c):"lanczos"===this.resizeType&&(r=this.lanczosResize(e,a,s,l,c)),e.imageData=r},sliceByTwo:function(e,i,r,a,o){var s,l,c=e.imageData,h=!1,u=!1,f=.5*i,d=.5*r,m=t.filterBackend.resources,g=0,v=0,p=i,y=0;for(m.sliceByTwo||(m.sliceByTwo=document.createElement("canvas")),((s=m.sliceByTwo).width<1.5*i||s.height<r)&&(s.width=1.5*i,s.height=r),(l=s.getContext("2d")).clearRect(0,0,1.5*i,r),l.putImageData(c,0,0),a=n(a),o=n(o);!h||!u;)i=f,r=d,a<n(.5*f)?f=n(.5*f):(f=a,h=!0),o<n(.5*d)?d=n(.5*d):(d=o,u=!0),l.drawImage(s,g,v,i,r,p,y,f,d),g=p,v=y,y+=d;return l.getImageData(g,v,a,o)},lanczosResize:function(e,t,o,s,c){var h=e.imageData.data,u=e.ctx.createImageData(s,c),f=u.data,d=this.lanczosCreate(this.lanczosLobes),m=this.rcpScaleX,g=this.rcpScaleY,v=2/this.rcpScaleX,p=2/this.rcpScaleY,y=l(m*this.lanczosLobes/2),b=l(g*this.lanczosLobes/2),w={},x={},k={};return function e(l){var C,S,_,T,O,E,R,I,A,D,P;for(x.x=(l+.5)*m,k.x=n(x.x),C=0;C<c;C++){for(x.y=(C+.5)*g,k.y=n(x.y),O=0,E=0,R=0,I=0,A=0,S=k.x-y;S<=k.x+y;S++)if(!(S<0||S>=t)){D=n(1e3*a(S-x.x)),w[D]||(w[D]={});for(var F=k.y-b;F<=k.y+b;F++)F<0||F>=o||(P=n(1e3*a(F-x.y)),w[D][P]||(w[D][P]=d(r(i(D*v,2)+i(P*p,2))/1e3)),(_=w[D][P])>0&&(O+=_,E+=_*h[T=4*(F*t+S)],R+=_*h[T+1],I+=_*h[T+2],A+=_*h[T+3]))}f[T=4*(C*s+l)]=E/O,f[T+1]=R/O,f[T+2]=I/O,f[T+3]=A/O}return++l<s?e(l):u}(0)},bilinearFiltering:function(e,t,i,r,a){var o,s,l,c,h,u,f,d,m,g=0,v=this.rcpScaleX,p=this.rcpScaleY,y=4*(t-1),b=e.imageData.data,w=e.ctx.createImageData(r,a),x=w.data;for(l=0;l<a;l++)for(c=0;c<r;c++)for(h=v*c-(o=n(v*c)),u=p*l-(s=n(p*l)),m=4*(s*t+o),f=0;f<4;f++)d=b[m+f]*(1-h)*(1-u)+b[m+4+f]*h*(1-u)+b[m+y+f]*u*(1-h)+b[m+y+4+f]*h*u,x[g++]=d;return w},hermiteFastResize:function(e,t,i,o,s){for(var c=this.rcpScaleX,h=this.rcpScaleY,u=l(c/2),f=l(h/2),d=e.imageData.data,m=e.ctx.createImageData(o,s),g=m.data,v=0;v<s;v++)for(var p=0;p<o;p++){for(var y=4*(p+v*o),b=0,w=0,x=0,k=0,C=0,S=0,_=0,T=(v+.5)*h,O=n(v*h);O<(v+1)*h;O++)for(var E=a(T-(O+.5))/f,R=(p+.5)*c,I=E*E,A=n(p*c);A<(p+1)*c;A++){var D=a(R-(A+.5))/u,P=r(I+D*D);P>1&&P<-1||(b=2*P*P*P-3*P*P+1)>0&&(_+=b*d[(D=4*(A+O*t))+3],x+=b,d[D+3]<255&&(b=b*d[D+3]/250),k+=b*d[D],C+=b*d[D+1],S+=b*d[D+2],w+=b)}g[y]=k/w,g[y+1]=C/w,g[y+2]=S/w,g[y+3]=_/x}return m},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),t.Image.filters.Resize.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Contrast=n(i.BaseFilter,{type:"Contrast",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uContrast;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));\ncolor.rgb = contrastF * (color.rgb - 0.5) + 0.5;\ngl_FragColor = color;\n}",contrast:0,mainParameter:"contrast",applyTo2d:function(e){if(0!==this.contrast){var t,i=e.imageData.data,n=i.length,r=Math.floor(255*this.contrast),a=259*(r+255)/(255*(259-r));for(t=0;t<n;t+=4)i[t]=a*(i[t]-128)+128,i[t+1]=a*(i[t+1]-128)+128,i[t+2]=a*(i[t+2]-128)+128}},getUniformLocations:function(e,t){return{uContrast:e.getUniformLocation(t,"uContrast")}},sendUniformData:function(e,t){e.uniform1f(t.uContrast,this.contrast)}}),t.Image.filters.Contrast.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Saturation=n(i.BaseFilter,{type:"Saturation",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uSaturation;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat rgMax = max(color.r, color.g);\nfloat rgbMax = max(rgMax, color.b);\ncolor.r += rgbMax != color.r ? (rgbMax - color.r) * uSaturation : 0.00;\ncolor.g += rgbMax != color.g ? (rgbMax - color.g) * uSaturation : 0.00;\ncolor.b += rgbMax != color.b ? (rgbMax - color.b) * uSaturation : 0.00;\ngl_FragColor = color;\n}",saturation:0,mainParameter:"saturation",applyTo2d:function(e){if(0!==this.saturation){var t,i,n=e.imageData.data,r=n.length,a=-this.saturation;for(t=0;t<r;t+=4)i=Math.max(n[t],n[t+1],n[t+2]),n[t]+=i!==n[t]?(i-n[t])*a:0,n[t+1]+=i!==n[t+1]?(i-n[t+1])*a:0,n[t+2]+=i!==n[t+2]?(i-n[t+2])*a:0}},getUniformLocations:function(e,t){return{uSaturation:e.getUniformLocation(t,"uSaturation")}},sendUniformData:function(e,t){e.uniform1f(t.uSaturation,-this.saturation)}}),t.Image.filters.Saturation.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Vibrance=n(i.BaseFilter,{type:"Vibrance",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uVibrance;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat max = max(color.r, max(color.g, color.b));\nfloat avg = (color.r + color.g + color.b) / 3.0;\nfloat amt = (abs(max - avg) * 2.0) * uVibrance;\ncolor.r += max != color.r ? (max - color.r) * amt : 0.00;\ncolor.g += max != color.g ? (max - color.g) * amt : 0.00;\ncolor.b += max != color.b ? (max - color.b) * amt : 0.00;\ngl_FragColor = color;\n}",vibrance:0,mainParameter:"vibrance",applyTo2d:function(e){if(0!==this.vibrance){var t,i,n,r,a=e.imageData.data,o=a.length,s=-this.vibrance;for(t=0;t<o;t+=4)i=Math.max(a[t],a[t+1],a[t+2]),n=(a[t]+a[t+1]+a[t+2])/3,r=2*Math.abs(i-n)/255*s,a[t]+=i!==a[t]?(i-a[t])*r:0,a[t+1]+=i!==a[t+1]?(i-a[t+1])*r:0,a[t+2]+=i!==a[t+2]?(i-a[t+2])*r:0}},getUniformLocations:function(e,t){return{uVibrance:e.getUniformLocation(t,"uVibrance")}},sendUniformData:function(e,t){e.uniform1f(t.uVibrance,-this.vibrance)}}),t.Image.filters.Vibrance.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Blur=n(i.BaseFilter,{type:"Blur",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\nconst float nSamples = 15.0;\nvec3 v3offset = vec3(12.9898, 78.233, 151.7182);\nfloat random(vec3 scale) {\nreturn fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453);\n}\nvoid main() {\nvec4 color = vec4(0.0);\nfloat total = 0.0;\nfloat offset = random(v3offset);\nfor (float t = -nSamples; t <= nSamples; t++) {\nfloat percent = (t + offset - 0.5) / nSamples;\nfloat weight = 1.0 - abs(percent);\ncolor += texture2D(uTexture, vTexCoord + uDelta * percent) * weight;\ntotal += weight;\n}\ngl_FragColor = color / total;\n}",blur:0,mainParameter:"blur",applyTo:function(e){e.webgl?(this.aspectRatio=e.sourceWidth/e.sourceHeight,e.passes++,this._setupFrameBuffer(e),this.horizontal=!0,this.applyToWebGL(e),this._swapTextures(e),this._setupFrameBuffer(e),this.horizontal=!1,this.applyToWebGL(e),this._swapTextures(e)):this.applyTo2d(e)},applyTo2d:function(e){e.imageData=this.simpleBlur(e)},simpleBlur:function(e){var i,n,r=e.filterBackend.resources,a=e.imageData.width,o=e.imageData.height;r.blurLayer1||(r.blurLayer1=t.util.createCanvasElement(),r.blurLayer2=t.util.createCanvasElement()),i=r.blurLayer1,n=r.blurLayer2,i.width===a&&i.height===o||(n.width=i.width=a,n.height=i.height=o);var s,l,c,h,u=i.getContext("2d"),f=n.getContext("2d"),d=.06*this.blur*.5;for(u.putImageData(e.imageData,0,0),f.clearRect(0,0,a,o),h=-15;h<=15;h++)c=d*(l=h/15)*a+(s=(Math.random()-.5)/4),f.globalAlpha=1-Math.abs(l),f.drawImage(i,c,s),u.drawImage(n,0,0),f.globalAlpha=1,f.clearRect(0,0,n.width,n.height);for(h=-15;h<=15;h++)c=d*(l=h/15)*o+(s=(Math.random()-.5)/4),f.globalAlpha=1-Math.abs(l),f.drawImage(i,s,c),u.drawImage(n,0,0),f.globalAlpha=1,f.clearRect(0,0,n.width,n.height);e.ctx.drawImage(i,0,0);var m=e.ctx.getImageData(0,0,i.width,i.height);return u.globalAlpha=1,u.clearRect(0,0,i.width,i.height),m},getUniformLocations:function(e,t){return{delta:e.getUniformLocation(t,"uDelta")}},sendUniformData:function(e,t){var i=this.chooseRightDelta();e.uniform2fv(t.delta,i)},chooseRightDelta:function(){var e,t=1,i=[0,0];return this.horizontal?this.aspectRatio>1&&(t=1/this.aspectRatio):this.aspectRatio<1&&(t=this.aspectRatio),e=t*this.blur*.12,this.horizontal?i[0]=e:i[1]=e,i}}),i.Blur.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Gamma=n(i.BaseFilter,{type:"Gamma",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec3 uGamma;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec3 correction = (1.0 / uGamma);\ncolor.r = pow(color.r, correction.r);\ncolor.g = pow(color.g, correction.g);\ncolor.b = pow(color.b, correction.b);\ngl_FragColor = color;\ngl_FragColor.rgb *= color.a;\n}",gamma:[1,1,1],mainParameter:"gamma",initialize:function(e){this.gamma=[1,1,1],i.BaseFilter.prototype.initialize.call(this,e)},applyTo2d:function(e){var t,i=e.imageData.data,n=this.gamma,r=i.length,a=1/n[0],o=1/n[1],s=1/n[2];for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),t=0,r=256;t<r;t++)this.rVals[t]=255*Math.pow(t/255,a),this.gVals[t]=255*Math.pow(t/255,o),this.bVals[t]=255*Math.pow(t/255,s);for(t=0,r=i.length;t<r;t+=4)i[t]=this.rVals[i[t]],i[t+1]=this.gVals[i[t+1]],i[t+2]=this.bVals[i[t+2]]},getUniformLocations:function(e,t){return{uGamma:e.getUniformLocation(t,"uGamma")}},sendUniformData:function(e,t){e.uniform3fv(t.uGamma,this.gamma)}}),t.Image.filters.Gamma.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Composed=n(i.BaseFilter,{type:"Composed",subFilters:[],initialize:function(e){this.callSuper("initialize",e),this.subFilters=this.subFilters.slice(0)},applyTo:function(e){e.passes+=this.subFilters.length-1,this.subFilters.forEach((function(t){t.applyTo(e)}))},toObject:function(){return t.util.object.extend(this.callSuper("toObject"),{subFilters:this.subFilters.map((function(e){return e.toObject()}))})},isNeutralState:function(){return!this.subFilters.some((function(e){return!e.isNeutralState()}))}}),t.Image.filters.Composed.fromObject=function(e,i){var n=(e.subFilters||[]).map((function(e){return new t.Image.filters[e.type](e)})),r=new t.Image.filters.Composed({subFilters:n});return i&&i(r),r}}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.HueRotation=n(i.ColorMatrix,{type:"HueRotation",rotation:0,mainParameter:"rotation",calculateMatrix:function(){var e=this.rotation*Math.PI,i=t.util.cos(e),n=t.util.sin(e),r=Math.sqrt(1/3)*n,a=1-i;this.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.matrix[0]=i+a/3,this.matrix[1]=1/3*a-r,this.matrix[2]=1/3*a+r,this.matrix[5]=1/3*a+r,this.matrix[6]=i+1/3*a,this.matrix[7]=1/3*a-r,this.matrix[10]=1/3*a-r,this.matrix[11]=1/3*a+r,this.matrix[12]=i+1/3*a},isNeutralState:function(e){return this.calculateMatrix(),i.BaseFilter.prototype.isNeutralState.call(this,e)},applyTo:function(e){this.calculateMatrix(),i.BaseFilter.prototype.applyTo.call(this,e)}}),t.Image.filters.HueRotation.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.clone;if(t.Text)t.warn("fabric.Text is already defined");else{var n="fontFamily fontWeight fontSize text underline overline linethrough textAlign fontStyle lineHeight textBackgroundColor charSpacing styles direction path pathStartOffset pathSide".split(" ");t.Text=t.util.createClass(t.Object,{_dimensionAffectingProps:["fontSize","fontWeight","fontFamily","fontStyle","lineHeight","text","charSpacing","textAlign","styles","path","pathStartOffset","pathSide"],_reNewline:/\r?\n/,_reSpacesAndTabs:/[ \t\r]/g,_reSpaceAndTab:/[ \t\r]/,_reWords:/\S+/g,type:"text",fontSize:40,fontWeight:"normal",fontFamily:"Times New Roman",underline:!1,overline:!1,linethrough:!1,textAlign:"left",fontStyle:"normal",lineHeight:1.16,superscript:{size:.6,baseline:-.35},subscript:{size:.6,baseline:.11},textBackgroundColor:"",stateProperties:t.Object.prototype.stateProperties.concat(n),cacheProperties:t.Object.prototype.cacheProperties.concat(n),stroke:null,shadow:null,path:null,pathStartOffset:0,pathSide:"left",_fontSizeFraction:.222,offsets:{underline:.1,linethrough:-.315,overline:-.88},_fontSizeMult:1.13,charSpacing:0,styles:null,_measuringContext:null,deltaY:0,direction:"ltr",_styleProperties:["stroke","strokeWidth","fill","fontFamily","fontSize","fontWeight","fontStyle","underline","overline","linethrough","deltaY","textBackgroundColor"],__charBounds:[],CACHE_FONT_SIZE:400,MIN_TEXT_WIDTH:2,initialize:function(e,t){this.styles=t&&t.styles||{},this.text=e,this.__skipDimension=!0,this.callSuper("initialize",t),this.path&&this.setPathInfo(),this.__skipDimension=!1,this.initDimensions(),this.setCoords(),this.setupState({propertySet:"_dimensionAffectingProps"})},setPathInfo:function(){var e=this.path;e&&(e.segmentsInfo=t.util.getPathSegmentsInfo(e.path))},getMeasuringContext:function(){return t._measuringContext||(t._measuringContext=this.canvas&&this.canvas.contextCache||t.util.createCanvasElement().getContext("2d")),t._measuringContext},_splitText:function(){var e=this._splitTextIntoLines(this.text);return this.textLines=e.lines,this._textLines=e.graphemeLines,this._unwrappedTextLines=e._unwrappedLines,this._text=e.graphemeText,e},initDimensions:function(){this.__skipDimension||(this._splitText(),this._clearCache(),this.path?(this.width=this.path.width,this.height=this.path.height):(this.width=this.calcTextWidth()||this.cursorWidth||this.MIN_TEXT_WIDTH,this.height=this.calcTextHeight()),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.saveState({propertySet:"_dimensionAffectingProps"}))},enlargeSpaces:function(){for(var e,t,i,n,r,a,o,s=0,l=this._textLines.length;s<l;s++)if(("justify"===this.textAlign||s!==l-1&&!this.isEndOfWrapping(s))&&(n=0,r=this._textLines[s],(t=this.getLineWidth(s))<this.width&&(o=this.textLines[s].match(this._reSpacesAndTabs)))){i=o.length,e=(this.width-t)/i;for(var c=0,h=r.length;c<=h;c++)a=this.__charBounds[s][c],this._reSpaceAndTab.test(r[c])?(a.width+=e,a.kernedWidth+=e,a.left+=n,n+=e):a.left+=n}},isEndOfWrapping:function(e){return e===this._textLines.length-1},missingNewlineOffset:function(){return 1},toString:function(){return"#<fabric.Text ("+this.complexity()+'): { "text": "'+this.text+'", "fontFamily": "'+this.fontFamily+'" }>'},_getCacheCanvasDimensions:function(){var e=this.callSuper("_getCacheCanvasDimensions"),t=this.fontSize;return e.width+=t*e.zoomX,e.height+=t*e.zoomY,e},_render:function(e){var t=this.path;t&&!t.isNotVisible()&&t._render(e),this._setTextStyles(e),this._renderTextLinesBackground(e),this._renderTextDecoration(e,"underline"),this._renderText(e),this._renderTextDecoration(e,"overline"),this._renderTextDecoration(e,"linethrough")},_renderText:function(e){"stroke"===this.paintFirst?(this._renderTextStroke(e),this._renderTextFill(e)):(this._renderTextFill(e),this._renderTextStroke(e))},_setTextStyles:function(e,t,i){e.textBaseline="alphabetic",e.font=this._getFontDeclaration(t,i)},calcTextWidth:function(){for(var e=this.getLineWidth(0),t=1,i=this._textLines.length;t<i;t++){var n=this.getLineWidth(t);n>e&&(e=n)}return e},_renderTextLine:function(e,t,i,n,r,a){this._renderChars(e,t,i,n,r,a)},_renderTextLinesBackground:function(e){if(this.textBackgroundColor||this.styleHas("textBackgroundColor")){for(var t,i,n,r,a,o,s,l=e.fillStyle,c=this._getLeftOffset(),h=this._getTopOffset(),u=0,f=0,d=this.path,m=0,g=this._textLines.length;m<g;m++)if(t=this.getHeightOfLine(m),this.textBackgroundColor||this.styleHas("textBackgroundColor",m)){n=this._textLines[m],i=this._getLineLeftOffset(m),f=0,u=0,r=this.getValueOfPropertyAt(m,0,"textBackgroundColor");for(var v=0,p=n.length;v<p;v++)a=this.__charBounds[m][v],o=this.getValueOfPropertyAt(m,v,"textBackgroundColor"),d?(e.save(),e.translate(a.renderLeft,a.renderTop),e.rotate(a.angle),e.fillStyle=o,o&&e.fillRect(-a.width/2,-t/this.lineHeight*(1-this._fontSizeFraction),a.width,t/this.lineHeight),e.restore()):o!==r?(s=c+i+u,"rtl"===this.direction&&(s=this.width-s-f),e.fillStyle=r,r&&e.fillRect(s,h,f,t/this.lineHeight),u=a.left,f=a.width,r=o):f+=a.kernedWidth;o&&!d&&(s=c+i+u,"rtl"===this.direction&&(s=this.width-s-f),e.fillStyle=o,e.fillRect(s,h,f,t/this.lineHeight)),h+=t}else h+=t;e.fillStyle=l,this._removeShadow(e)}},getFontCache:function(e){var i=e.fontFamily.toLowerCase();t.charWidthsCache[i]||(t.charWidthsCache[i]={});var n=t.charWidthsCache[i],r=e.fontStyle.toLowerCase()+"_"+(e.fontWeight+"").toLowerCase();return n[r]||(n[r]={}),n[r]},_measureChar:function(e,t,i,n){var r,a,o,s,l=this.getFontCache(t),c=i+e,h=this._getFontDeclaration(t)===this._getFontDeclaration(n),u=t.fontSize/this.CACHE_FONT_SIZE;if(i&&void 0!==l[i]&&(o=l[i]),void 0!==l[e]&&(s=r=l[e]),h&&void 0!==l[c]&&(s=(a=l[c])-o),void 0===r||void 0===o||void 0===a){var f=this.getMeasuringContext();this._setTextStyles(f,t,!0)}return void 0===r&&(s=r=f.measureText(e).width,l[e]=r),void 0===o&&h&&i&&(o=f.measureText(i).width,l[i]=o),h&&void 0===a&&(a=f.measureText(c).width,l[c]=a,s=a-o),{width:r*u,kernedWidth:s*u}},getHeightOfChar:function(e,t){return this.getValueOfPropertyAt(e,t,"fontSize")},measureLine:function(e){var t=this._measureLine(e);return 0!==this.charSpacing&&(t.width-=this._getWidthOfCharSpacing()),t.width<0&&(t.width=0),t},_measureLine:function(e){var i,n,r,a,o,s,l=0,c=this._textLines[e],h=new Array(c.length),u=0,f=this.path,d="right"===this.pathSide;for(this.__charBounds[e]=h,i=0;i<c.length;i++)n=c[i],a=this._getGraphemeBox(n,e,i,r),h[i]=a,l+=a.kernedWidth,r=n;if(h[i]={left:a?a.left+a.width:0,width:0,kernedWidth:0,height:this.fontSize},f){switch(s=f.segmentsInfo[f.segmentsInfo.length-1].length,(o=t.util.getPointOnPath(f.path,0,f.segmentsInfo)).x+=f.pathOffset.x,o.y+=f.pathOffset.y,this.textAlign){case"left":u=d?s-l:0;break;case"center":u=(s-l)/2;break;case"right":u=d?0:s-l}for(u+=this.pathStartOffset*(d?-1:1),i=d?c.length-1:0;d?i>=0:i<c.length;d?i--:i++)a=h[i],u>s?u%=s:u<0&&(u+=s),this._setGraphemeOnPath(u,a,o),u+=a.kernedWidth}return{width:l,numOfSpaces:0}},_setGraphemeOnPath:function(e,i,n){var r=e+i.kernedWidth/2,a=this.path,o=t.util.getPointOnPath(a.path,r,a.segmentsInfo);i.renderLeft=o.x-n.x,i.renderTop=o.y-n.y,i.angle=o.angle+("right"===this.pathSide?Math.PI:0)},_getGraphemeBox:function(e,t,i,n,r){var a,o=this.getCompleteStyleDeclaration(t,i),s=n?this.getCompleteStyleDeclaration(t,i-1):{},l=this._measureChar(e,o,n,s),c=l.kernedWidth,h=l.width;0!==this.charSpacing&&(h+=a=this._getWidthOfCharSpacing(),c+=a);var u={width:h,left:0,height:o.fontSize,kernedWidth:c,deltaY:o.deltaY};if(i>0&&!r){var f=this.__charBounds[t][i-1];u.left=f.left+f.width+l.kernedWidth-l.width}return u},getHeightOfLine:function(e){if(this.__lineHeights[e])return this.__lineHeights[e];for(var t=this._textLines[e],i=this.getHeightOfChar(e,0),n=1,r=t.length;n<r;n++)i=Math.max(this.getHeightOfChar(e,n),i);return this.__lineHeights[e]=i*this.lineHeight*this._fontSizeMult},calcTextHeight:function(){for(var e,t=0,i=0,n=this._textLines.length;i<n;i++)e=this.getHeightOfLine(i),t+=i===n-1?e/this.lineHeight:e;return t},_getLeftOffset:function(){return"ltr"===this.direction?-this.width/2:this.width/2},_getTopOffset:function(){return-this.height/2},_renderTextCommon:function(e,t){e.save();for(var i=0,n=this._getLeftOffset(),r=this._getTopOffset(),a=0,o=this._textLines.length;a<o;a++){var s=this.getHeightOfLine(a),l=s/this.lineHeight,c=this._getLineLeftOffset(a);this._renderTextLine(t,e,this._textLines[a],n+c,r+i+l,a),i+=s}e.restore()},_renderTextFill:function(e){(this.fill||this.styleHas("fill"))&&this._renderTextCommon(e,"fillText")},_renderTextStroke:function(e){(this.stroke&&0!==this.strokeWidth||!this.isEmptyStyles())&&(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(e),e.save(),this._setLineDash(e,this.strokeDashArray),e.beginPath(),this._renderTextCommon(e,"strokeText"),e.closePath(),e.restore())},_renderChars:function(e,t,i,n,r,a){var o,s,l,c,h,u=this.getHeightOfLine(a),f=-1!==this.textAlign.indexOf("justify"),d="",m=0,g=this.path,v=!f&&0===this.charSpacing&&this.isEmptyStyles(a)&&!g,p="ltr"===this.direction,y="ltr"===this.direction?1:-1;if(t.save(),r-=u*this._fontSizeFraction/this.lineHeight,v)return t.canvas.setAttribute("dir",p?"ltr":"rtl"),t.direction=p?"ltr":"rtl",t.textAlign=p?"left":"right",this._renderChar(e,t,a,0,i.join(""),n,r,u),void t.restore();for(var b=0,w=i.length-1;b<=w;b++)c=b===w||this.charSpacing||g,d+=i[b],l=this.__charBounds[a][b],0===m?(n+=y*(l.kernedWidth-l.width),m+=l.width):m+=l.kernedWidth,f&&!c&&this._reSpaceAndTab.test(i[b])&&(c=!0),c||(o=o||this.getCompleteStyleDeclaration(a,b),s=this.getCompleteStyleDeclaration(a,b+1),c=this._hasStyleChanged(o,s)),c&&(g?(t.save(),t.translate(l.renderLeft,l.renderTop),t.rotate(l.angle),this._renderChar(e,t,a,b,d,-m/2,0,u),t.restore()):(h=n,t.canvas.setAttribute("dir",p?"ltr":"rtl"),t.direction=p?"ltr":"rtl",t.textAlign=p?"left":"right",this._renderChar(e,t,a,b,d,h,r,u)),d="",o=s,n+=y*m,m=0);t.restore()},_applyPatternGradientTransformText:function(e){var i,n=t.util.createCanvasElement(),r=this.width+this.strokeWidth,a=this.height+this.strokeWidth;return n.width=r,n.height=a,(i=n.getContext("2d")).beginPath(),i.moveTo(0,0),i.lineTo(r,0),i.lineTo(r,a),i.lineTo(0,a),i.closePath(),i.translate(r/2,a/2),i.fillStyle=e.toLive(i),this._applyPatternGradientTransform(i,e),i.fill(),i.createPattern(n,"no-repeat")},handleFiller:function(e,t,i){var n,r;return i.toLive?"percentage"===i.gradientUnits||i.gradientTransform||i.patternTransform?(n=-this.width/2,r=-this.height/2,e.translate(n,r),e[t]=this._applyPatternGradientTransformText(i),{offsetX:n,offsetY:r}):(e[t]=i.toLive(e,this),this._applyPatternGradientTransform(e,i)):(e[t]=i,{offsetX:0,offsetY:0})},_setStrokeStyles:function(e,t){return e.lineWidth=t.strokeWidth,e.lineCap=this.strokeLineCap,e.lineDashOffset=this.strokeDashOffset,e.lineJoin=this.strokeLineJoin,e.miterLimit=this.strokeMiterLimit,this.handleFiller(e,"strokeStyle",t.stroke)},_setFillStyles:function(e,t){return this.handleFiller(e,"fillStyle",t.fill)},_renderChar:function(e,t,i,n,r,a,o){var s,l,c=this._getStyleDeclaration(i,n),h=this.getCompleteStyleDeclaration(i,n),u="fillText"===e&&h.fill,f="strokeText"===e&&h.stroke&&h.strokeWidth;(f||u)&&(t.save(),u&&(s=this._setFillStyles(t,h)),f&&(l=this._setStrokeStyles(t,h)),t.font=this._getFontDeclaration(h),c&&c.textBackgroundColor&&this._removeShadow(t),c&&c.deltaY&&(o+=c.deltaY),u&&t.fillText(r,a-s.offsetX,o-s.offsetY),f&&t.strokeText(r,a-l.offsetX,o-l.offsetY),t.restore())},setSuperscript:function(e,t){return this._setScript(e,t,this.superscript)},setSubscript:function(e,t){return this._setScript(e,t,this.subscript)},_setScript:function(e,t,i){var n=this.get2DCursorLocation(e,!0),r=this.getValueOfPropertyAt(n.lineIndex,n.charIndex,"fontSize"),a=this.getValueOfPropertyAt(n.lineIndex,n.charIndex,"deltaY"),o={fontSize:r*i.size,deltaY:a+r*i.baseline};return this.setSelectionStyles(o,e,t),this},_hasStyleChanged:function(e,t){return e.fill!==t.fill||e.stroke!==t.stroke||e.strokeWidth!==t.strokeWidth||e.fontSize!==t.fontSize||e.fontFamily!==t.fontFamily||e.fontWeight!==t.fontWeight||e.fontStyle!==t.fontStyle||e.deltaY!==t.deltaY},_hasStyleChangedForSvg:function(e,t){return this._hasStyleChanged(e,t)||e.overline!==t.overline||e.underline!==t.underline||e.linethrough!==t.linethrough},_getLineLeftOffset:function(e){var t=this.getLineWidth(e),i=this.width-t,n=this.textAlign,r=this.direction,a=0,o=this.isEndOfWrapping(e);return"justify"===n||"justify-center"===n&&!o||"justify-right"===n&&!o||"justify-left"===n&&!o?0:("center"===n&&(a=i/2),"right"===n&&(a=i),"justify-center"===n&&(a=i/2),"justify-right"===n&&(a=i),"rtl"===r&&(a-=i),a)},_clearCache:function(){this.__lineWidths=[],this.__lineHeights=[],this.__charBounds=[]},_shouldClearDimensionCache:function(){var e=this._forceClearCache;return e||(e=this.hasStateChanged("_dimensionAffectingProps")),e&&(this.dirty=!0,this._forceClearCache=!1),e},getLineWidth:function(e){return this.__lineWidths[e]?this.__lineWidths[e]:(t=""===this._textLines[e]?0:this.measureLine(e).width,this.__lineWidths[e]=t,t);var t},_getWidthOfCharSpacing:function(){return 0!==this.charSpacing?this.fontSize*this.charSpacing/1e3:0},getValueOfPropertyAt:function(e,t,i){var n=this._getStyleDeclaration(e,t);return n&&void 0!==n[i]?n[i]:this[i]},_renderTextDecoration:function(e,t){if(this[t]||this.styleHas(t)){for(var i,n,r,a,o,s,l,c,h,u,f,d,m,g,v,p,y=this._getLeftOffset(),b=this._getTopOffset(),w=this.path,x=this._getWidthOfCharSpacing(),k=this.offsets[t],C=0,S=this._textLines.length;C<S;C++)if(i=this.getHeightOfLine(C),this[t]||this.styleHas(t,C)){l=this._textLines[C],g=i/this.lineHeight,a=this._getLineLeftOffset(C),u=0,f=0,c=this.getValueOfPropertyAt(C,0,t),p=this.getValueOfPropertyAt(C,0,"fill"),h=b+g*(1-this._fontSizeFraction),n=this.getHeightOfChar(C,0),o=this.getValueOfPropertyAt(C,0,"deltaY");for(var _=0,T=l.length;_<T;_++)if(d=this.__charBounds[C][_],m=this.getValueOfPropertyAt(C,_,t),v=this.getValueOfPropertyAt(C,_,"fill"),r=this.getHeightOfChar(C,_),s=this.getValueOfPropertyAt(C,_,"deltaY"),w&&m&&v)e.save(),e.fillStyle=p,e.translate(d.renderLeft,d.renderTop),e.rotate(d.angle),e.fillRect(-d.kernedWidth/2,k*r+s,d.kernedWidth,this.fontSize/15),e.restore();else if((m!==c||v!==p||r!==n||s!==o)&&f>0){var O=y+a+u;"rtl"===this.direction&&(O=this.width-O-f),c&&p&&(e.fillStyle=p,e.fillRect(O,h+k*n+o,f,this.fontSize/15)),u=d.left,f=d.width,c=m,p=v,n=r,o=s}else f+=d.kernedWidth;O=y+a+u;"rtl"===this.direction&&(O=this.width-O-f),e.fillStyle=v,m&&v&&e.fillRect(O,h+k*n+o,f-x,this.fontSize/15),b+=i}else b+=i;this._removeShadow(e)}},_getFontDeclaration:function(e,i){var n=e||this,r=this.fontFamily,a=t.Text.genericFonts.indexOf(r.toLowerCase())>-1,o=void 0===r||r.indexOf("'")>-1||r.indexOf(",")>-1||r.indexOf('"')>-1||a?n.fontFamily:'"'+n.fontFamily+'"';return[t.isLikelyNode?n.fontWeight:n.fontStyle,t.isLikelyNode?n.fontStyle:n.fontWeight,i?this.CACHE_FONT_SIZE+"px":n.fontSize+"px",o].join(" ")},render:function(e){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",e)))},_splitTextIntoLines:function(e){for(var i=e.split(this._reNewline),n=new Array(i.length),r=["\n"],a=[],o=0;o<i.length;o++)n[o]=t.util.string.graphemeSplit(i[o]),a=a.concat(n[o],r);return a.pop(),{_unwrappedLines:n,lines:i,graphemeText:a,graphemeLines:n}},toObject:function(e){var t=n.concat(e),r=this.callSuper("toObject",t);return r.styles=i(this.styles,!0),r.path&&(r.path=this.path.toObject()),r},set:function(e,t){this.callSuper("set",e,t);var i=!1,n=!1;if("object"==typeof e)for(var r in e)"path"===r&&this.setPathInfo(),i=i||-1!==this._dimensionAffectingProps.indexOf(r),n=n||"path"===r;else i=-1!==this._dimensionAffectingProps.indexOf(e),n="path"===e;return n&&this.setPathInfo(),i&&(this.initDimensions(),this.setCoords()),this},complexity:function(){return 1}}),t.Text.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x y dx dy font-family font-style font-weight font-size letter-spacing text-decoration text-anchor".split(" ")),t.Text.DEFAULT_SVG_FONT_SIZE=16,t.Text.fromElement=function(e,n,r){if(!e)return n(null);var a=t.parseAttributes(e,t.Text.ATTRIBUTE_NAMES),o=a.textAnchor||"left";if((r=t.util.object.extend(r?i(r):{},a)).top=r.top||0,r.left=r.left||0,a.textDecoration){var s=a.textDecoration;-1!==s.indexOf("underline")&&(r.underline=!0),-1!==s.indexOf("overline")&&(r.overline=!0),-1!==s.indexOf("line-through")&&(r.linethrough=!0),delete r.textDecoration}"dx"in a&&(r.left+=a.dx),"dy"in a&&(r.top+=a.dy),"fontSize"in r||(r.fontSize=t.Text.DEFAULT_SVG_FONT_SIZE);var l="";"textContent"in e?l=e.textContent:"firstChild"in e&&null!==e.firstChild&&"data"in e.firstChild&&null!==e.firstChild.data&&(l=e.firstChild.data),l=l.replace(/^\s+|\s+$|\n+/g,"").replace(/\s+/g," ");var c=r.strokeWidth;r.strokeWidth=0;var h=new t.Text(l,r),u=h.getScaledHeight()/h.height,f=((h.height+h.strokeWidth)*h.lineHeight-h.height)*u,d=h.getScaledHeight()+f,m=0;"center"===o&&(m=h.getScaledWidth()/2),"right"===o&&(m=h.getScaledWidth()),h.set({left:h.left-m,top:h.top-(d-h.fontSize*(.07+h._fontSizeFraction))/h.lineHeight,strokeWidth:void 0!==c?c:1}),n(h)},t.Text.fromObject=function(e,n){var r=i(e),a=e.path;return delete r.path,t.Object._fromObject("Text",r,(function(e){a?t.Object._fromObject("Path",a,(function(t){e.set("path",t),n(e)}),"path"):n(e)}),"text")},t.Text.genericFonts=["sans-serif","serif","cursive","fantasy","monospace"],t.util.createAccessors&&t.util.createAccessors(t.Text)}}(t),_.util.object.extend(_.Text.prototype,{isEmptyStyles:function(e){if(!this.styles)return!0;if(void 0!==e&&!this.styles[e])return!0;var t=void 0===e?this.styles:{line:this.styles[e]};for(var i in t)for(var n in t[i])for(var r in t[i][n])return!1;return!0},styleHas:function(e,t){if(!this.styles||!e||""===e)return!1;if(void 0!==t&&!this.styles[t])return!1;var i=void 0===t?this.styles:{0:this.styles[t]};for(var n in i)for(var r in i[n])if(void 0!==i[n][r][e])return!0;return!1},cleanStyle:function(e){if(!this.styles||!e||""===e)return!1;var t,i,n=this.styles,r=0,a=!0,o=0;for(var s in n){for(var l in t=0,n[s]){var c;r++,(c=n[s][l]).hasOwnProperty(e)?(i?c[e]!==i&&(a=!1):i=c[e],c[e]===this[e]&&delete c[e]):a=!1,0!==Object.keys(c).length?t++:delete n[s][l]}0===t&&delete n[s]}for(var h=0;h<this._textLines.length;h++)o+=this._textLines[h].length;a&&r===o&&(this[e]=i,this.removeStyle(e))},removeStyle:function(e){if(this.styles&&e&&""!==e){var t,i,n,r=this.styles;for(i in r){for(n in t=r[i])delete t[n][e],0===Object.keys(t[n]).length&&delete t[n];0===Object.keys(t).length&&delete r[i]}}},_extendStyles:function(e,t){var i=this.get2DCursorLocation(e);this._getLineStyle(i.lineIndex)||this._setLineStyle(i.lineIndex),this._getStyleDeclaration(i.lineIndex,i.charIndex)||this._setStyleDeclaration(i.lineIndex,i.charIndex,{}),_.util.object.extend(this._getStyleDeclaration(i.lineIndex,i.charIndex),t)},get2DCursorLocation:function(e,t){void 0===e&&(e=this.selectionStart);for(var i=t?this._unwrappedTextLines:this._textLines,n=i.length,r=0;r<n;r++){if(e<=i[r].length)return{lineIndex:r,charIndex:e};e-=i[r].length+this.missingNewlineOffset(r)}return{lineIndex:r-1,charIndex:i[r-1].length<e?i[r-1].length:e}},getSelectionStyles:function(e,t,i){void 0===e&&(e=this.selectionStart||0),void 0===t&&(t=this.selectionEnd||e);for(var n=[],r=e;r<t;r++)n.push(this.getStyleAtPosition(r,i));return n},getStyleAtPosition:function(e,t){var i=this.get2DCursorLocation(e);return(t?this.getCompleteStyleDeclaration(i.lineIndex,i.charIndex):this._getStyleDeclaration(i.lineIndex,i.charIndex))||{}},setSelectionStyles:function(e,t,i){void 0===t&&(t=this.selectionStart||0),void 0===i&&(i=this.selectionEnd||t);for(var n=t;n<i;n++)this._extendStyles(n,e);return this._forceClearCache=!0,this},_getStyleDeclaration:function(e,t){var i=this.styles&&this.styles[e];return i?i[t]:null},getCompleteStyleDeclaration:function(e,t){for(var i,n=this._getStyleDeclaration(e,t)||{},r={},a=0;a<this._styleProperties.length;a++)r[i=this._styleProperties[a]]=void 0===n[i]?this[i]:n[i];return r},_setStyleDeclaration:function(e,t,i){this.styles[e][t]=i},_deleteStyleDeclaration:function(e,t){delete this.styles[e][t]},_getLineStyle:function(e){return!!this.styles[e]},_setLineStyle:function(e){this.styles[e]={}},_deleteLineStyle:function(e){delete this.styles[e]}}),function(){function e(e){e.textDecoration&&(e.textDecoration.indexOf("underline")>-1&&(e.underline=!0),e.textDecoration.indexOf("line-through")>-1&&(e.linethrough=!0),e.textDecoration.indexOf("overline")>-1&&(e.overline=!0),delete e.textDecoration)}_.IText=_.util.createClass(_.Text,_.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(e,t){this.callSuper("initialize",e,t),this.initBehavior()},setSelectionStart:function(e){e=Math.max(e,0),this._updateAndFire("selectionStart",e)},setSelectionEnd:function(e){e=Math.min(e,this.text.length),this._updateAndFire("selectionEnd",e)},_updateAndFire:function(e,t){this[e]!==t&&(this._fireSelectionChanged(),this[e]=t),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(e){this.clearContextTop(),this.callSuper("render",e),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(e){this.callSuper("_render",e)},clearContextTop:function(e){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var t=this.canvas.contextTop,i=this.canvas.viewportTransform;t.save(),t.transform(i[0],i[1],i[2],i[3],i[4],i[5]),this.transform(t),this._clearTextArea(t),e||t.restore()}},renderCursorOrSelection:function(){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var e=this._getCursorBoundaries(),t=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(e,t):this.renderSelection(e,t),t.restore()}},_clearTextArea:function(e){var t=this.width+4,i=this.height+4;e.clearRect(-t/2,-i/2,t,i)},_getCursorBoundaries:function(e){void 0===e&&(e=this.selectionStart);var t=this._getLeftOffset(),i=this._getTopOffset(),n=this._getCursorBoundariesOffsets(e);return{left:t,top:i,leftOffset:n.left,topOffset:n.top}},_getCursorBoundariesOffsets:function(e){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var t,i,n,r,a=0,o=0,s=this.get2DCursorLocation(e);n=s.charIndex,i=s.lineIndex;for(var l=0;l<i;l++)a+=this.getHeightOfLine(l);t=this._getLineLeftOffset(i);var c=this.__charBounds[i][n];return c&&(o=c.left),0!==this.charSpacing&&n===this._textLines[i].length&&(o-=this._getWidthOfCharSpacing()),r={top:a,left:t+(o>0?o:0)},"rtl"===this.direction&&(r.left*=-1),this.cursorOffsetCache=r,this.cursorOffsetCache},renderCursor:function(e,t){var i=this.get2DCursorLocation(),n=i.lineIndex,r=i.charIndex>0?i.charIndex-1:0,a=this.getValueOfPropertyAt(n,r,"fontSize"),o=this.scaleX*this.canvas.getZoom(),s=this.cursorWidth/o,l=e.topOffset,c=this.getValueOfPropertyAt(n,r,"deltaY");l+=(1-this._fontSizeFraction)*this.getHeightOfLine(n)/this.lineHeight-a*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(e,t),t.fillStyle=this.cursorColor||this.getValueOfPropertyAt(n,r,"fill"),t.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,t.fillRect(e.left+e.leftOffset-s/2,l+e.top+c,s,a)},renderSelection:function(e,t){for(var i=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,n=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,r=-1!==this.textAlign.indexOf("justify"),a=this.get2DCursorLocation(i),o=this.get2DCursorLocation(n),s=a.lineIndex,l=o.lineIndex,c=a.charIndex<0?0:a.charIndex,h=o.charIndex<0?0:o.charIndex,u=s;u<=l;u++){var f,d=this._getLineLeftOffset(u)||0,m=this.getHeightOfLine(u),g=0,v=0;if(u===s&&(g=this.__charBounds[s][c].left),u>=s&&u<l)v=r&&!this.isEndOfWrapping(u)?this.width:this.getLineWidth(u)||5;else if(u===l)if(0===h)v=this.__charBounds[l][h].left;else{var p=this._getWidthOfCharSpacing();v=this.__charBounds[l][h-1].left+this.__charBounds[l][h-1].width-p}f=m,(this.lineHeight<1||u===l&&this.lineHeight>1)&&(m/=this.lineHeight);var y=e.left+d+g,b=v-g,w=m,x=0;this.inCompositionMode?(t.fillStyle=this.compositionColor||"black",w=1,x=m):t.fillStyle=this.selectionColor,"rtl"===this.direction&&(y=this.width-y-b),t.fillRect(y,e.top+e.topOffset+x,b,w),e.topOffset+=f}},getCurrentCharFontSize:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,"fontSize")},getCurrentCharColor:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,"fill")},_getCurrentCharIndex:function(){var e=this.get2DCursorLocation(this.selectionStart,!0),t=e.charIndex>0?e.charIndex-1:0;return{l:e.lineIndex,c:t}}}),_.IText.fromObject=function(t,i){if(e(t),t.styles)for(var n in t.styles)for(var r in t.styles[n])e(t.styles[n][r]);_.Object._fromObject("IText",t,i,"text")}}(),k=_.util.object.clone,_.util.object.extend(_.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var e=this;this.on("added",(function(){var t=e.canvas;t&&(t._hasITextHandlers||(t._hasITextHandlers=!0,e._initCanvasHandlers(t)),t._iTextInstances=t._iTextInstances||[],t._iTextInstances.push(e))}))},initRemovedHandler:function(){var e=this;this.on("removed",(function(){var t=e.canvas;t&&(t._iTextInstances=t._iTextInstances||[],_.util.removeFromArray(t._iTextInstances,e),0===t._iTextInstances.length&&(t._hasITextHandlers=!1,e._removeCanvasHandlers(t)))}))},_initCanvasHandlers:function(e){e._mouseUpITextHandler=function(){e._iTextInstances&&e._iTextInstances.forEach((function(e){e.__isMousedown=!1}))},e.on("mouse:up",e._mouseUpITextHandler)},_removeCanvasHandlers:function(e){e.off("mouse:up",e._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(e,t,i,n){var r;return r={isAborted:!1,abort:function(){this.isAborted=!0}},e.animate("_currentCursorOpacity",t,{duration:i,onComplete:function(){r.isAborted||e[n]()},onChange:function(){e.canvas&&e.selectionStart===e.selectionEnd&&e.renderCursorOrSelection()},abort:function(){return r.isAborted}}),r},_onTickComplete:function(){var e=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout((function(){e._currentTickCompleteState=e._animateCursor(e,0,this.cursorDuration/2,"_tick")}),100)},initDelayedCursor:function(e){var t=this,i=e?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout((function(){t._tick()}),i)},abortCursorAnimation:function(){var e=this._currentTickState||this._currentTickCompleteState,t=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,e&&t&&t.clearContext(t.contextTop||t.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(e){var t=0,i=e-1;if(this._reSpace.test(this._text[i]))for(;this._reSpace.test(this._text[i]);)t++,i--;for(;/\S/.test(this._text[i])&&i>-1;)t++,i--;return e-t},findWordBoundaryRight:function(e){var t=0,i=e;if(this._reSpace.test(this._text[i]))for(;this._reSpace.test(this._text[i]);)t++,i++;for(;/\S/.test(this._text[i])&&i<this._text.length;)t++,i++;return e+t},findLineBoundaryLeft:function(e){for(var t=0,i=e-1;!/\n/.test(this._text[i])&&i>-1;)t++,i--;return e-t},findLineBoundaryRight:function(e){for(var t=0,i=e;!/\n/.test(this._text[i])&&i<this._text.length;)t++,i++;return e+t},searchWordBoundary:function(e,t){for(var i=this._text,n=this._reSpace.test(i[e])?e-1:e,r=i[n],a=_.reNonWord;!a.test(r)&&n>0&&n<i.length;)r=i[n+=t];return a.test(r)&&(n+=1===t?0:1),n},selectWord:function(e){e=e||this.selectionStart;var t=this.searchWordBoundary(e,-1),i=this.searchWordBoundary(e,1);this.selectionStart=t,this.selectionEnd=i,this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()},selectLine:function(e){e=e||this.selectionStart;var t=this.findLineBoundaryLeft(e),i=this.findLineBoundaryRight(e);return this.selectionStart=t,this.selectionEnd=i,this._fireSelectionChanged(),this._updateTextarea(),this},enterEditing:function(e){if(!this.isEditing&&this.editable)return this.canvas&&(this.canvas.calcOffset(),this.exitEditingOnOthers(this.canvas)),this.isEditing=!0,this.initHiddenTextarea(e),this.hiddenTextarea.focus(),this.hiddenTextarea.value=this.text,this._updateTextarea(),this._saveEditingProps(),this._setEditingProps(),this._textBeforeEdit=this.text,this._tick(),this.fire("editing:entered"),this._fireSelectionChanged(),this.canvas?(this.canvas.fire("text:editing:entered",{target:this}),this.initMouseMoveHandler(),this.canvas.requestRenderAll(),this):this},exitEditingOnOthers:function(e){e._iTextInstances&&e._iTextInstances.forEach((function(e){e.selected=!1,e.isEditing&&e.exitEditing()}))},initMouseMoveHandler:function(){this.canvas.on("mouse:move",this.mouseMoveHandler)},mouseMoveHandler:function(e){if(this.__isMousedown&&this.isEditing){var t=this.getSelectionStartFromPointer(e.e),i=this.selectionStart,n=this.selectionEnd;(t===this.__selectionStartOnMouseDown&&i!==n||i!==t&&n!==t)&&(t>this.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=t):(this.selectionStart=t,this.selectionEnd=this.__selectionStartOnMouseDown),this.selectionStart===i&&this.selectionEnd===n||(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(e,t,i){var n=i.slice(0,e),r=_.util.string.graphemeSplit(n).length;if(e===t)return{selectionStart:r,selectionEnd:r};var a=i.slice(e,t);return{selectionStart:r,selectionEnd:r+_.util.string.graphemeSplit(a).length}},fromGraphemeToStringSelection:function(e,t,i){var n=i.slice(0,e).join("").length;return e===t?{selectionStart:n,selectionEnd:n}:{selectionStart:n,selectionEnd:n+i.slice(e,t).join("").length}},_updateTextarea:function(){if(this.cursorOffsetCache={},this.hiddenTextarea){if(!this.inCompositionMode){var e=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=e.selectionStart,this.hiddenTextarea.selectionEnd=e.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var e=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=e.selectionEnd,this.inCompositionMode||(this.selectionStart=e.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var e=this._calcTextareaPosition();this.hiddenTextarea.style.left=e.left,this.hiddenTextarea.style.top=e.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var e=this.inCompositionMode?this.compositionStart:this.selectionStart,t=this._getCursorBoundaries(e),i=this.get2DCursorLocation(e),n=i.lineIndex,r=i.charIndex,a=this.getValueOfPropertyAt(n,r,"fontSize")*this.lineHeight,o=t.leftOffset,s=this.calcTransformMatrix(),l={x:t.left+o,y:t.top+t.topOffset+a},c=this.canvas.getRetinaScaling(),h=this.canvas.upperCanvasEl,u=h.width/c,f=h.height/c,d=u-a,m=f-a,g=h.clientWidth/u,v=h.clientHeight/f;return l=_.util.transformPoint(l,s),(l=_.util.transformPoint(l,this.canvas.viewportTransform)).x*=g,l.y*=v,l.x<0&&(l.x=0),l.x>d&&(l.x=d),l.y<0&&(l.y=0),l.y>m&&(l.y=m),l.x+=this.canvas._offset.left,l.y+=this.canvas._offset.top,{left:l.x+"px",top:l.y+"px",fontSize:a+"px",charHeight:a}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var e=this._textBeforeEdit!==this.text,t=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,t&&(t.blur&&t.blur(),t.parentNode&&t.parentNode.removeChild(t)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),e&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),e&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var e in this.styles)this._textLines[e]||delete this.styles[e]},removeStyleFromTo:function(e,t){var i,n,r=this.get2DCursorLocation(e,!0),a=this.get2DCursorLocation(t,!0),o=r.lineIndex,s=r.charIndex,l=a.lineIndex,c=a.charIndex;if(o!==l){if(this.styles[o])for(i=s;i<this._unwrappedTextLines[o].length;i++)delete this.styles[o][i];if(this.styles[l])for(i=c;i<this._unwrappedTextLines[l].length;i++)(n=this.styles[l][i])&&(this.styles[o]||(this.styles[o]={}),this.styles[o][s+i-c]=n);for(i=o+1;i<=l;i++)delete this.styles[i];this.shiftLineStyles(l,o-l)}else if(this.styles[o]){n=this.styles[o];var h,u,f=c-s;for(i=s;i<c;i++)delete n[i];for(u in this.styles[o])(h=parseInt(u,10))>=c&&(n[h-f]=n[u],delete n[u])}},shiftLineStyles:function(e,t){var i=k(this.styles);for(var n in this.styles){var r=parseInt(n,10);r>e&&(this.styles[r+t]=i[r],i[r-t]||delete this.styles[r])}},restartCursorIfNeeded:function(){this._currentTickState&&!this._currentTickState.isAborted&&this._currentTickCompleteState&&!this._currentTickCompleteState.isAborted||this.initDelayedCursor()},insertNewlineStyleObject:function(e,t,i,n){var r,a={},o=!1,s=this._unwrappedTextLines[e].length===t;for(var l in i||(i=1),this.shiftLineStyles(e,i),this.styles[e]&&(r=this.styles[e][0===t?t:t-1]),this.styles[e]){var c=parseInt(l,10);c>=t&&(o=!0,a[c-t]=this.styles[e][l],s&&0===t||delete this.styles[e][l])}var h=!1;for(o&&!s&&(this.styles[e+i]=a,h=!0),h&&i--;i>0;)n&&n[i-1]?this.styles[e+i]={0:k(n[i-1])}:r?this.styles[e+i]={0:k(r)}:delete this.styles[e+i],i--;this._forceClearCache=!0},insertCharStyleObject:function(e,t,i,n){this.styles||(this.styles={});var r=this.styles[e],a=r?k(r):{};for(var o in i||(i=1),a){var s=parseInt(o,10);s>=t&&(r[s+i]=a[s],a[s-i]||delete r[s])}if(this._forceClearCache=!0,n)for(;i--;)Object.keys(n[i]).length&&(this.styles[e]||(this.styles[e]={}),this.styles[e][t+i]=k(n[i]));else if(r)for(var l=r[t?t-1:1];l&&i--;)this.styles[e][t+i]=k(l)},insertNewStyleBlock:function(e,t,i){for(var n=this.get2DCursorLocation(t,!0),r=[0],a=0,o=0;o<e.length;o++)"\n"===e[o]?r[++a]=0:r[a]++;for(r[0]>0&&(this.insertCharStyleObject(n.lineIndex,n.charIndex,r[0],i),i=i&&i.slice(r[0]+1)),a&&this.insertNewlineStyleObject(n.lineIndex,n.charIndex+r[0],a),o=1;o<a;o++)r[o]>0?this.insertCharStyleObject(n.lineIndex+o,0,r[o],i):i&&(this.styles[n.lineIndex+o][0]=i[0]),i=i&&i.slice(r[o]+1);r[o]>0&&this.insertCharStyleObject(n.lineIndex+o,0,r[o],i)},setSelectionStartEndWithShift:function(e,t,i){i<=e?(t===e?this._selectionDirection="left":"right"===this._selectionDirection&&(this._selectionDirection="left",this.selectionEnd=e),this.selectionStart=i):i>e&&i<t?"right"===this._selectionDirection?this.selectionEnd=i:this.selectionStart=i:(t===e?this._selectionDirection="right":"left"===this._selectionDirection&&(this._selectionDirection="right",this.selectionStart=t),this.selectionEnd=i)},setSelectionInBoundaries:function(){var e=this.text.length;this.selectionStart>e?this.selectionStart=e:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>e?this.selectionEnd=e:this.selectionEnd<0&&(this.selectionEnd=0)}}),_.util.object.extend(_.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(e){if(this.canvas){this.__newClickTime=+new Date;var t=e.pointer;this.isTripleClick(t)&&(this.fire("tripleclick",e),this._stopEvent(e.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=t,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(e){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===e.x&&this.__lastPointer.y===e.y},_stopEvent:function(e){e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(e){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(e.e))},tripleClickHandler:function(e){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(e.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(e){!this.canvas||!this.editable||e.e.button&&1!==e.e.button||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(e.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(e){!this.canvas||!this.editable||e.e.button&&1!==e.e.button||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(e){if(this.__isMousedown=!1,!(!this.editable||this.group||e.transform&&e.transform.actionPerformed||e.e.button&&1!==e.e.button)){if(this.canvas){var t=this.canvas._activeObject;if(t&&t!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(e.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(e){var t=this.getSelectionStartFromPointer(e),i=this.selectionStart,n=this.selectionEnd;e.shiftKey?this.setSelectionStartEndWithShift(i,n,t):(this.selectionStart=t,this.selectionEnd=t),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(e){for(var t,i=this.getLocalPointer(e),n=0,r=0,a=0,o=0,s=0,l=0,c=this._textLines.length;l<c&&a<=i.y;l++)a+=this.getHeightOfLine(l)*this.scaleY,s=l,l>0&&(o+=this._textLines[l-1].length+this.missingNewlineOffset(l-1));r=this._getLineLeftOffset(s)*this.scaleX,t=this._textLines[s],"rtl"===this.direction&&(i.x=this.width*this.scaleX-i.x+r);for(var h=0,u=t.length;h<u&&(n=r,(r+=this.__charBounds[s][h].kernedWidth*this.scaleX)<=i.x);h++)o++;return this._getNewSelectionStartFromOffset(i,n,r,o,u)},_getNewSelectionStartFromOffset:function(e,t,i,n,r){var a=e.x-t,o=i-e.x,s=n+(o>a||o<0?0:1);return this.flipX&&(s=r-s),s>this._text.length&&(s=this._text.length),s}}),_.util.object.extend(_.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=_.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","false"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var e=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+e.top+"; left: "+e.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; paddingーtop: "+e.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):_.document.body.appendChild(this.hiddenTextarea),_.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),_.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),_.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),_.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),_.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),_.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),_.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),_.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),_.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(_.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},keysMapRtl:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorLeft",36:"moveCursorRight",37:"moveCursorRight",38:"moveCursorUp",39:"moveCursorLeft",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(e){if(this.isEditing){var t="rtl"===this.direction?this.keysMapRtl:this.keysMap;if(e.keyCode in t)this[t[e.keyCode]](e);else{if(!(e.keyCode in this.ctrlKeysMapDown)||!e.ctrlKey&&!e.metaKey)return;this[this.ctrlKeysMapDown[e.keyCode]](e)}e.stopImmediatePropagation(),e.preventDefault(),e.keyCode>=33&&e.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(e){!this.isEditing||this._copyDone||this.inCompositionMode?this._copyDone=!1:e.keyCode in this.ctrlKeysMapUp&&(e.ctrlKey||e.metaKey)&&(this[this.ctrlKeysMapUp[e.keyCode]](e),e.stopImmediatePropagation(),e.preventDefault(),this.canvas&&this.canvas.requestRenderAll())},onInput:function(e){var t=this.fromPaste;if(this.fromPaste=!1,e&&e.stopPropagation(),this.isEditing){var i,n,r,a,o,s=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,l=this._text.length,c=s.length,h=c-l,u=this.selectionStart,f=this.selectionEnd,d=u!==f;if(""===this.hiddenTextarea.value)return this.styles={},this.updateFromTextArea(),this.fire("changed"),void(this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll()));var m=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),g=u>m.selectionStart;d?(i=this._text.slice(u,f),h+=f-u):c<l&&(i=g?this._text.slice(f+h,f):this._text.slice(u,u-h)),n=s.slice(m.selectionEnd-h,m.selectionEnd),i&&i.length&&(n.length&&(r=this.getSelectionStyles(u,u+1,!1),r=n.map((function(){return r[0]}))),d?(a=u,o=f):g?(a=f-i.length,o=f):(a=f,o=f+i.length),this.removeStyleFromTo(a,o)),n.length&&(t&&n.join("")===_.copiedText&&!_.disableStyleCopyPaste&&(r=_.copiedTextStyle),this.insertNewStyleBlock(n,u,r)),this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll())}},onCompositionStart:function(){this.inCompositionMode=!0},onCompositionEnd:function(){this.inCompositionMode=!1},onCompositionUpdate:function(e){this.compositionStart=e.target.selectionStart,this.compositionEnd=e.target.selectionEnd,this.updateTextareaPosition()},copy:function(){this.selectionStart!==this.selectionEnd&&(_.copiedText=this.getSelectedText(),_.disableStyleCopyPaste?_.copiedTextStyle=null:_.copiedTextStyle=this.getSelectionStyles(this.selectionStart,this.selectionEnd,!0),this._copyDone=!0)},paste:function(){this.fromPaste=!0},_getClipboardData:function(e){return e&&e.clipboardData||_.window.clipboardData},_getWidthBeforeCursor:function(e,t){var i,n=this._getLineLeftOffset(e);return t>0&&(n+=(i=this.__charBounds[e][t-1]).left+i.width),n},getDownCursorOffset:function(e,t){var i=this._getSelectionForOffset(e,t),n=this.get2DCursorLocation(i),r=n.lineIndex;if(r===this._textLines.length-1||e.metaKey||34===e.keyCode)return this._text.length-i;var a=n.charIndex,o=this._getWidthBeforeCursor(r,a),s=this._getIndexOnLine(r+1,o);return this._textLines[r].slice(a).length+s+1+this.missingNewlineOffset(r)},_getSelectionForOffset:function(e,t){return e.shiftKey&&this.selectionStart!==this.selectionEnd&&t?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(e,t){var i=this._getSelectionForOffset(e,t),n=this.get2DCursorLocation(i),r=n.lineIndex;if(0===r||e.metaKey||33===e.keyCode)return-i;var a=n.charIndex,o=this._getWidthBeforeCursor(r,a),s=this._getIndexOnLine(r-1,o),l=this._textLines[r].slice(0,a),c=this.missingNewlineOffset(r-1);return-this._textLines[r-1].length+s-l.length+(1-c)},_getIndexOnLine:function(e,t){for(var i,n,r=this._textLines[e],a=this._getLineLeftOffset(e),o=0,s=0,l=r.length;s<l;s++)if((a+=i=this.__charBounds[e][s].width)>t){n=!0;var c=a-i,h=a,u=Math.abs(c-t);o=Math.abs(h-t)<u?s:s-1;break}return n||(o=r.length-1),o},moveCursorDown:function(e){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",e)},moveCursorUp:function(e){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorUpOrDown("Up",e)},_moveCursorUpOrDown:function(e,t){var i=this["get"+e+"CursorOffset"](t,"right"===this._selectionDirection);t.shiftKey?this.moveCursorWithShift(i):this.moveCursorWithoutShift(i),0!==i&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(e){var t="left"===this._selectionDirection?this.selectionStart+e:this.selectionEnd+e;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,t),0!==e},moveCursorWithoutShift:function(e){return e<0?(this.selectionStart+=e,this.selectionEnd=this.selectionStart):(this.selectionEnd+=e,this.selectionStart=this.selectionEnd),0!==e},moveCursorLeft:function(e){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorLeftOrRight("Left",e)},_move:function(e,t,i){var n;if(e.altKey)n=this["findWordBoundary"+i](this[t]);else{if(!e.metaKey&&35!==e.keyCode&&36!==e.keyCode)return this[t]+="Left"===i?-1:1,!0;n=this["findLineBoundary"+i](this[t])}if(void 0!==typeof n&&this[t]!==n)return this[t]=n,!0},_moveLeft:function(e,t){return this._move(e,t,"Left")},_moveRight:function(e,t){return this._move(e,t,"Right")},moveCursorLeftWithoutShift:function(e){var t=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&0!==this.selectionStart&&(t=this._moveLeft(e,"selectionStart")),this.selectionEnd=this.selectionStart,t},moveCursorLeftWithShift:function(e){return"right"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveLeft(e,"selectionEnd"):0!==this.selectionStart?(this._selectionDirection="left",this._moveLeft(e,"selectionStart")):void 0},moveCursorRight:function(e){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",e)},_moveCursorLeftOrRight:function(e,t){var i="moveCursor"+e+"With";this._currentCursorOpacity=1,t.shiftKey?i+="Shift":i+="outShift",this[i](t)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(e){return"left"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveRight(e,"selectionStart"):this.selectionEnd!==this._text.length?(this._selectionDirection="right",this._moveRight(e,"selectionEnd")):void 0},moveCursorRightWithoutShift:function(e){var t=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(t=this._moveRight(e,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,t},removeChars:function(e,t){void 0===t&&(t=e+1),this.removeStyleFromTo(e,t),this._text.splice(e,t-e),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(e,t,i,n){void 0===n&&(n=i),n>i&&this.removeStyleFromTo(i,n);var r=_.util.string.graphemeSplit(e);this.insertNewStyleBlock(r,i,t),this._text=[].concat(this._text.slice(0,i),r,this._text.slice(n)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),C=_.util.toFixed,S=/ +/g,_.util.object.extend(_.Text.prototype,{_toSVG:function(){var e=this._getSVGLeftTopOffsets(),t=this._getSVGTextAndBg(e.textTop,e.textLeft);return this._wrapSVGTextAndBg(t)},toSVG:function(e){return this._createBaseSVGMarkup(this._toSVG(),{reviver:e,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(e){var t=this.getSvgTextDecoration(this);return[e.textBgRects.join(""),'\t\t<text xml:space="preserve" ',this.fontFamily?'font-family="'+this.fontFamily.replace(/"/g,"'")+'" ':"",this.fontSize?'font-size="'+this.fontSize+'" ':"",this.fontStyle?'font-style="'+this.fontStyle+'" ':"",this.fontWeight?'font-weight="'+this.fontWeight+'" ':"",t?'text-decoration="'+t+'" ':"",'style="',this.getSvgStyles(!0),'"',this.addPaintOrder()," >",e.textSpans.join(""),"</text>\n"]},_getSVGTextAndBg:function(e,t){var i,n=[],r=[],a=e;this._setSVGBg(r);for(var o=0,s=this._textLines.length;o<s;o++)i=this._getLineLeftOffset(o),(this.textBackgroundColor||this.styleHas("textBackgroundColor",o))&&this._setSVGTextLineBg(r,o,t+i,a),this._setSVGTextLineText(n,o,t+i,a),a+=this.getHeightOfLine(o);return{textSpans:n,textBgRects:r}},_createTextCharSpan:function(e,t,i,n){var r=e!==e.trim()||e.match(S),a=this.getSvgSpanStyles(t,r),o=a?'style="'+a+'"':"",s=t.deltaY,l="",c=_.Object.NUM_FRACTION_DIGITS;return s&&(l=' dy="'+C(s,c)+'" '),['<tspan x="',C(i,c),'" y="',C(n,c),'" ',l,o,">",_.util.string.escapeXml(e),"</tspan>"].join("")},_setSVGTextLineText:function(e,t,i,n){var r,a,o,s,l,c=this.getHeightOfLine(t),h=-1!==this.textAlign.indexOf("justify"),u="",f=0,d=this._textLines[t];n+=c*(1-this._fontSizeFraction)/this.lineHeight;for(var m=0,g=d.length-1;m<=g;m++)l=m===g||this.charSpacing,u+=d[m],o=this.__charBounds[t][m],0===f?(i+=o.kernedWidth-o.width,f+=o.width):f+=o.kernedWidth,h&&!l&&this._reSpaceAndTab.test(d[m])&&(l=!0),l||(r=r||this.getCompleteStyleDeclaration(t,m),a=this.getCompleteStyleDeclaration(t,m+1),l=this._hasStyleChangedForSvg(r,a)),l&&(s=this._getStyleDeclaration(t,m)||{},e.push(this._createTextCharSpan(u,s,i,n)),u="",r=a,i+=f,f=0)},_pushTextBgRect:function(e,t,i,n,r,a){var o=_.Object.NUM_FRACTION_DIGITS;e.push("\t\t<rect ",this._getFillAttributes(t),' x="',C(i,o),'" y="',C(n,o),'" width="',C(r,o),'" height="',C(a,o),'"></rect>\n')},_setSVGTextLineBg:function(e,t,i,n){for(var r,a,o=this._textLines[t],s=this.getHeightOfLine(t)/this.lineHeight,l=0,c=0,h=this.getValueOfPropertyAt(t,0,"textBackgroundColor"),u=0,f=o.length;u<f;u++)r=this.__charBounds[t][u],(a=this.getValueOfPropertyAt(t,u,"textBackgroundColor"))!==h?(h&&this._pushTextBgRect(e,h,i+c,n,l,s),c=r.left,l=r.width,h=a):l+=r.kernedWidth;a&&this._pushTextBgRect(e,a,i+c,n,l,s)},_getFillAttributes:function(e){var t=e&&"string"==typeof e?new _.Color(e):"";return t&&t.getSource()&&1!==t.getAlpha()?'opacity="'+t.getAlpha()+'" fill="'+t.setAlpha(1).toRgb()+'"':'fill="'+e+'"'},_getSVGLineTopOffset:function(e){for(var t,i=0,n=0;n<e;n++)i+=this.getHeightOfLine(n);return t=this.getHeightOfLine(n),{lineTop:i,offset:(this._fontSizeMult-this._fontSizeFraction)*t/(this.lineHeight*this._fontSizeMult)}},getSvgStyles:function(e){return _.Object.prototype.getSvgStyles.call(this,e)+" white-space: pre;"}}),function(e){"use strict";var t=e.fabric||(e.fabric={});t.Textbox=t.util.createClass(t.IText,t.Observable,{type:"textbox",minWidth:20,dynamicMinWidth:2,__cachedLines:null,lockScalingFlip:!0,noScaleCache:!1,_dimensionAffectingProps:t.Text.prototype._dimensionAffectingProps.concat("width"),_wordJoiners:/[ \t\r]/,splitByGrapheme:!1,initDimensions:function(){this.__skipDimension||(this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this._clearCache(),this.dynamicMinWidth=0,this._styleMap=this._generateStyleMap(this._splitText()),this.dynamicMinWidth>this.width&&this._set("width",this.dynamicMinWidth),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(e){for(var t=0,i=0,n=0,r={},a=0;a<e.graphemeLines.length;a++)"\n"===e.graphemeText[n]&&a>0?(i=0,n++,t++):!this.splitByGrapheme&&this._reSpaceAndTab.test(e.graphemeText[n])&&a>0&&(i++,n++),r[a]={line:t,offset:i},n+=e.graphemeLines[a].length,i+=e.graphemeLines[a].length;return r},styleHas:function(e,i){if(this._styleMap&&!this.isWrapping){var n=this._styleMap[i];n&&(i=n.line)}return t.Text.prototype.styleHas.call(this,e,i)},isEmptyStyles:function(e){if(!this.styles)return!0;var t,i,n=0,r=!1,a=this._styleMap[e],o=this._styleMap[e+1];for(var s in a&&(e=a.line,n=a.offset),o&&(r=o.line===e,t=o.offset),i=void 0===e?this.styles:{line:this.styles[e]})for(var l in i[s])if(l>=n&&(!r||l<t))for(var c in i[s][l])return!1;return!0},_getStyleDeclaration:function(e,t){if(this._styleMap&&!this.isWrapping){var i=this._styleMap[e];if(!i)return null;e=i.line,t=i.offset+t}return this.callSuper("_getStyleDeclaration",e,t)},_setStyleDeclaration:function(e,t,i){var n=this._styleMap[e];e=n.line,t=n.offset+t,this.styles[e][t]=i},_deleteStyleDeclaration:function(e,t){var i=this._styleMap[e];e=i.line,t=i.offset+t,delete this.styles[e][t]},_getLineStyle:function(e){var t=this._styleMap[e];return!!this.styles[t.line]},_setLineStyle:function(e){var t=this._styleMap[e];this.styles[t.line]={}},_wrapText:function(e,t){var i,n=[];for(this.isWrapping=!0,i=0;i<e.length;i++)n=n.concat(this._wrapLine(e[i],i,t));return this.isWrapping=!1,n},_measureWord:function(e,t,i){var n,r=0;i=i||0;for(var a=0,o=e.length;a<o;a++){r+=this._getGraphemeBox(e[a],t,a+i,n,!0).kernedWidth,n=e[a]}return r},_wrapLine:function(e,i,n,r){var a=0,o=this.splitByGrapheme,s=[],l=[],c=o?t.util.string.graphemeSplit(e):e.split(this._wordJoiners),h="",u=0,f=o?"":" ",d=0,m=0,g=0,v=!0,p=this._getWidthOfCharSpacing();r=r||0;0===c.length&&c.push([]),n-=r;for(var y=0;y<c.length;y++)h=o?c[y]:t.util.string.graphemeSplit(c[y]),d=this._measureWord(h,i,u),u+=h.length,(a+=m+d-p)>n&&!v?(s.push(l),l=[],a=d,v=!0):a+=p,v||o||l.push(f),l=l.concat(h),m=o?0:this._measureWord([f],i,u),u++,v=!1,d>g&&(g=d);return y&&s.push(l),g+r>this.dynamicMinWidth&&(this.dynamicMinWidth=g-p+r),s},isEndOfWrapping:function(e){return!this._styleMap[e+1]||this._styleMap[e+1].line!==this._styleMap[e].line},missingNewlineOffset:function(e){return this.splitByGrapheme?this.isEndOfWrapping(e)?1:0:1},_splitTextIntoLines:function(e){for(var i=t.Text.prototype._splitTextIntoLines.call(this,e),n=this._wrapText(i.lines,this.width),r=new Array(n.length),a=0;a<n.length;a++)r[a]=n[a].join("");return i.lines=r,i.graphemeLines=n,i},getMinWidth:function(){return Math.max(this.minWidth,this.dynamicMinWidth)},_removeExtraneousStyles:function(){var e={};for(var t in this._styleMap)this._textLines[t]&&(e[this._styleMap[t].line]=1);for(var t in this.styles)e[t]||delete this.styles[t]},toObject:function(e){return this.callSuper("toObject",["minWidth","splitByGrapheme"].concat(e))}}),t.Textbox.fromObject=function(e,i){return t.Object._fromObject("Textbox",e,i,"text")}}(t),function(){var e=_.controlsUtils,t=e.scaleSkewCursorStyleHandler,i=e.scaleCursorStyleHandler,n=e.scalingEqually,r=e.scalingYOrSkewingX,a=e.scalingXOrSkewingY,o=e.scaleOrSkewActionName,s=_.Object.prototype.controls;if(s.ml=new _.Control({x:-.5,y:0,cursorStyleHandler:t,actionHandler:a,getActionName:o}),s.mr=new _.Control({x:.5,y:0,cursorStyleHandler:t,actionHandler:a,getActionName:o}),s.mb=new _.Control({x:0,y:.5,cursorStyleHandler:t,actionHandler:r,getActionName:o}),s.mt=new _.Control({x:0,y:-.5,cursorStyleHandler:t,actionHandler:r,getActionName:o}),s.tl=new _.Control({x:-.5,y:-.5,cursorStyleHandler:i,actionHandler:n}),s.tr=new _.Control({x:.5,y:-.5,cursorStyleHandler:i,actionHandler:n}),s.bl=new _.Control({x:-.5,y:.5,cursorStyleHandler:i,actionHandler:n}),s.br=new _.Control({x:.5,y:.5,cursorStyleHandler:i,actionHandler:n}),s.mtr=new _.Control({x:0,y:-.5,actionHandler:e.rotationWithSnapping,cursorStyleHandler:e.rotationStyleHandler,offsetY:-40,withConnection:!0,actionName:"rotate"}),_.Textbox){var l=_.Textbox.prototype.controls={};l.mtr=s.mtr,l.tr=s.tr,l.br=s.br,l.tl=s.tl,l.bl=s.bl,l.mt=s.mt,l.mb=s.mb,l.mr=new _.Control({x:.5,y:0,actionHandler:e.changeWidth,cursorStyleHandler:t,actionName:"resizing"}),l.ml=new _.Control({x:-.5,y:0,actionHandler:e.changeWidth,cursorStyleHandler:t,actionName:"resizing"})}}()}).call(this,i(27).Buffer)},function(e,t,i){e.exports=i(25)},function(e,t){function i(e,t,i,n,r,a,o){try{var s=e[a](o),l=s.value}catch(e){return void i(e)}s.done?t(l):Promise.resolve(l).then(n,r)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,l,"next",e)}function l(e){i(o,r,a,s,l,"throw",e)}s(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function i(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=i=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=i=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),i(t)}e.exports=i,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=i(16),r=i(19),a=i(15),o=i(18);e.exports=function(e){return n(e)||r(e)||a(e)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=i(17);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},function(e,t){e.exports=function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,a=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,r=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw r}}return a}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=i(17);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function i(t,n){return e.exports=i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,i(t,n)}e.exports=i,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=function(e){"use strict";var t=Object.prototype,i=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",o=n.toStringTag||"@@toStringTag";function s(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,i){return e[t]=i}}function l(e,t,i,n){var r=t&&t.prototype instanceof u?t:u,a=Object.create(r.prototype),o=new C(n||[]);return a._invoke=function(e,t,i){var n="suspendedStart";return function(r,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw a;return _()}for(i.method=r,i.arg=a;;){var o=i.delegate;if(o){var s=w(o,i);if(s){if(s===h)continue;return s}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===n)throw n="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n="executing";var l=c(e,t,i);if("normal"===l.type){if(n=i.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n="completed",i.method="throw",i.arg=l.arg)}}}(e,i,o),a}function c(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var h={};function u(){}function f(){}function d(){}var m={};s(m,r,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&i.call(v,r)&&(m=v);var p=d.prototype=u.prototype=Object.create(m);function y(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var n;this._invoke=function(r,a){function o(){return new t((function(n,o){!function n(r,a,o,s){var l=c(e[r],e,a);if("throw"!==l.type){var h=l.arg,u=h.value;return u&&"object"==typeof u&&i.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(u).then((function(e){h.value=e,o(h)}),(function(e){return n("throw",e,o,s)}))}s(l.arg)}(r,a,n,o)}))}return n=n?n.then(o,o):o()}}function w(e,t){var i=e.iterator[t.method];if(void 0===i){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=c(i,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,h;var r=n.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function S(e){if(e){var t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(i.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:_}}function _(){return{value:void 0,done:!0}}return f.prototype=d,s(p,"constructor",d),s(d,"constructor",f),f.displayName=s(d,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,s(e,o,"GeneratorFunction")),e.prototype=Object.create(p),e},e.awrap=function(e){return{__await:e}},y(b.prototype),s(b.prototype,a,(function(){return this})),e.AsyncIterator=b,e.async=function(t,i,n,r,a){void 0===a&&(a=Promise);var o=new b(l(t,i,n,r),a);return e.isGeneratorFunction(i)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},y(p),s(p,o,"Generator"),s(p,r,(function(){return this})),s(p,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var i in e)t.push(i);return t.reverse(),function i(){for(;t.length;){var n=t.pop();if(n in e)return i.value=n,i.done=!1,i}return i.done=!0,i}},e.values=S,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(i,n){return o.type="throw",o.arg=e,t.next=i,n&&(t.method="next",t.arg=void 0),!!n}for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(s&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var a=r;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),k(i),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var r=n.arg;k(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:S(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),h}},e}(e.exports);try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(e,t,i){var n=i(1);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){"use strict";(function(e){
4
4
  /*!
5
5
  * The buffer module from node.js, for the browser.
6
6
  *
7
7
  * @author Feross Aboukhadijeh <http://feross.org>
8
8
  * @license MIT
9
9
  */
10
- var n=i(29),r=i(30),o=i(31);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=l.prototype:(null===t&&(t=new l(e)),t.length=e),t}function l(t,e,i){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(t,e,i);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return u(this,t)}return c(this,t,e,i)}function c(t,e,i,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,i,n){if(e.byteLength,i<0||e.byteLength<i)throw new RangeError("'offset' is out of bounds");if(e.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===i&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,i):new Uint8Array(e,i,n);l.TYPED_ARRAY_SUPPORT?(t=e).__proto__=l.prototype:t=f(t,e);return t}(t,e,i,n):"string"==typeof e?function(t,e,i){"string"==typeof i&&""!==i||(i="utf8");if(!l.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(e,i),r=(t=s(t,n)).write(e,i);r!==n&&(t=t.slice(0,r));return t}(t,e,i):function(t,e){if(l.isBuffer(e)){var i=0|d(e.length);return 0===(t=s(t,i)).length||e.copy(t,0,0,i),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?s(t,0):f(t,e);if("Buffer"===e.type&&o(e.data))return f(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function u(t,e){if(h(e),t=s(t,e<0?0:0|d(e)),!l.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)t[i]=0;return t}function f(t,e){var i=e.length<0?0:0|d(e.length);t=s(t,i);for(var n=0;n<i;n+=1)t[n]=255&e[n];return t}function d(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function v(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var i=t.length;if(0===i)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return N(t).length;default:if(n)return H(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,i){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,i);case"utf8":case"utf-8":return T(this,e,i);case"ascii":return O(this,e,i);case"latin1":case"binary":return E(this,e,i);case"base64":return S(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,i);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function p(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function m(t,e,i,n,r){if(0===t.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=r?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(r)return-1;i=t.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof e&&(e=l.from(e,n)),l.isBuffer(e))return 0===e.length?-1:y(t,e,i,n,r);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):y(t,[e],i,n,r);throw new TypeError("val must be string, number or Buffer")}function y(t,e,i,n,r){var o,a=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,l/=2,i/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(r){var h=-1;for(o=i;o<s;o++)if(c(t,o)===c(e,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===l)return h*a}else-1!==h&&(o-=o-h),h=-1}else for(i+l>s&&(i=s-l),o=i;o>=0;o--){for(var u=!0,f=0;f<l;f++)if(c(t,o+f)!==c(e,f)){u=!1;break}if(u)return o}return-1}function b(t,e,i,n){i=Number(i)||0;var r=t.length-i;n?(n=Number(n))>r&&(n=r):n=r;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[i+a]=s}return a}function w(t,e,i,n){return W(H(e,t.length-i),t,i,n)}function x(t,e,i,n){return W(function(t){for(var e=[],i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}(e),t,i,n)}function C(t,e,i,n){return x(t,e,i,n)}function k(t,e,i,n){return W(N(e),t,i,n)}function _(t,e,i,n){return W(function(t,e){for(var i,n,r,o=[],a=0;a<t.length&&!((e-=2)<0);++a)i=t.charCodeAt(a),n=i>>8,r=i%256,o.push(r),o.push(n);return o}(e,t.length-i),t,i,n)}function S(t,e,i){return 0===e&&i===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,i))}function T(t,e,i){i=Math.min(t.length,i);for(var n=[],r=e;r<i;){var o,a,s,l,c=t[r],h=null,u=c>239?4:c>223?3:c>191?2:1;if(r+u<=i)switch(u){case 1:c<128&&(h=c);break;case 2:128==(192&(o=t[r+1]))&&(l=(31&c)<<6|63&o)>127&&(h=l);break;case 3:o=t[r+1],a=t[r+2],128==(192&o)&&128==(192&a)&&(l=(15&c)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:o=t[r+1],a=t[r+2],s=t[r+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(h=l)}null===h?(h=65533,u=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),r+=u}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var i="",n=0;for(;n<e;)i+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return i}(n)}e.Buffer=l,e.SlowBuffer=function(t){+t!=t&&(t=0);return l.alloc(+t)},e.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),l.poolSize=8192,l._augment=function(t){return t.__proto__=l.prototype,t},l.from=function(t,e,i){return c(null,t,e,i)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(t,e,i){return function(t,e,i,n){return h(e),e<=0?s(t,e):void 0!==i?"string"==typeof n?s(t,e).fill(i,n):s(t,e).fill(i):s(t,e)}(null,t,e,i)},l.allocUnsafe=function(t){return u(null,t)},l.allocUnsafeSlow=function(t){return u(null,t)},l.isBuffer=function(t){return!(null==t||!t._isBuffer)},l.compare=function(t,e){if(!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var i=t.length,n=e.length,r=0,o=Math.min(i,n);r<o;++r)if(t[r]!==e[r]){i=t[r],n=e[r];break}return i<n?-1:n<i?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);var i;if(void 0===e)for(e=0,i=0;i<t.length;++i)e+=t[i].length;var n=l.allocUnsafe(e),r=0;for(i=0;i<t.length;++i){var a=t[i];if(!l.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,r),r+=a.length}return n},l.byteLength=v,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)p(this,e,e+1);return this},l.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)p(this,e,e+3),p(this,e+1,e+2);return this},l.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)p(this,e,e+7),p(this,e+1,e+6),p(this,e+2,e+5),p(this,e+3,e+4);return this},l.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?T(this,0,t):g.apply(this,arguments)},l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){var t="",i=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(t+=" ... ")),"<Buffer "+t+">"},l.prototype.compare=function(t,e,i,n,r){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===i&&(i=t?t.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),e<0||i>t.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&e>=i)return 0;if(n>=r)return-1;if(e>=i)return 1;if(this===t)return 0;for(var o=(r>>>=0)-(n>>>=0),a=(i>>>=0)-(e>>>=0),s=Math.min(o,a),c=this.slice(n,r),h=t.slice(e,i),u=0;u<s;++u)if(c[u]!==h[u]){o=c[u],a=h[u];break}return o<a?-1:a<o?1:0},l.prototype.includes=function(t,e,i){return-1!==this.indexOf(t,e,i)},l.prototype.indexOf=function(t,e,i){return m(this,t,e,i,!0)},l.prototype.lastIndexOf=function(t,e,i){return m(this,t,e,i,!1)},l.prototype.write=function(t,e,i,n){if(void 0===e)n="utf8",i=this.length,e=0;else if(void 0===i&&"string"==typeof e)n=e,i=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var r=this.length-e;if((void 0===i||i>r)&&(i=r),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return b(this,t,e,i);case"utf8":case"utf-8":return w(this,t,e,i);case"ascii":return x(this,t,e,i);case"latin1":case"binary":return C(this,t,e,i);case"base64":return k(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function O(t,e,i){var n="";i=Math.min(t.length,i);for(var r=e;r<i;++r)n+=String.fromCharCode(127&t[r]);return n}function E(t,e,i){var n="";i=Math.min(t.length,i);for(var r=e;r<i;++r)n+=String.fromCharCode(t[r]);return n}function R(t,e,i){var n=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>n)&&(i=n);for(var r="",o=e;o<i;++o)r+=z(t[o]);return r}function A(t,e,i){for(var n=t.slice(e,i),r="",o=0;o<n.length;o+=2)r+=String.fromCharCode(n[o]+256*n[o+1]);return r}function I(t,e,i){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,i,n,r,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||e<o)throw new RangeError('"value" argument is out of bounds');if(i+n>t.length)throw new RangeError("Index out of range")}function D(t,e,i,n){e<0&&(e=65535+e+1);for(var r=0,o=Math.min(t.length-i,2);r<o;++r)t[i+r]=(e&255<<8*(n?r:1-r))>>>8*(n?r:1-r)}function F(t,e,i,n){e<0&&(e=4294967295+e+1);for(var r=0,o=Math.min(t.length-i,4);r<o;++r)t[i+r]=e>>>8*(n?r:3-r)&255}function M(t,e,i,n,r,o){if(i+n>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function j(t,e,i,n,o){return o||M(t,0,i,4),r.write(t,e,i,n,23,4),i+4}function L(t,e,i,n,o){return o||M(t,0,i,8),r.write(t,e,i,n,52,8),i+8}l.prototype.slice=function(t,e){var i,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),l.TYPED_ARRAY_SUPPORT)(i=this.subarray(t,e)).__proto__=l.prototype;else{var r=e-t;i=new l(r,void 0);for(var o=0;o<r;++o)i[o]=this[o+t]}return i},l.prototype.readUIntLE=function(t,e,i){t|=0,e|=0,i||I(t,e,this.length);for(var n=this[t],r=1,o=0;++o<e&&(r*=256);)n+=this[t+o]*r;return n},l.prototype.readUIntBE=function(t,e,i){t|=0,e|=0,i||I(t,e,this.length);for(var n=this[t+--e],r=1;e>0&&(r*=256);)n+=this[t+--e]*r;return n},l.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,i){t|=0,e|=0,i||I(t,e,this.length);for(var n=this[t],r=1,o=0;++o<e&&(r*=256);)n+=this[t+o]*r;return n>=(r*=128)&&(n-=Math.pow(2,8*e)),n},l.prototype.readIntBE=function(t,e,i){t|=0,e|=0,i||I(t,e,this.length);for(var n=e,r=1,o=this[t+--n];n>0&&(r*=256);)o+=this[t+--n]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),r.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),r.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),r.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),r.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,i,n){(t=+t,e|=0,i|=0,n)||P(this,t,e,i,Math.pow(2,8*i)-1,0);var r=1,o=0;for(this[e]=255&t;++o<i&&(r*=256);)this[e+o]=t/r&255;return e+i},l.prototype.writeUIntBE=function(t,e,i,n){(t=+t,e|=0,i|=0,n)||P(this,t,e,i,Math.pow(2,8*i)-1,0);var r=i-1,o=1;for(this[e+r]=255&t;--r>=0&&(o*=256);)this[e+r]=t/o&255;return e+i},l.prototype.writeUInt8=function(t,e,i){return t=+t,e|=0,i||P(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,i){return t=+t,e|=0,i||P(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):D(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,i){return t=+t,e|=0,i||P(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):D(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,i){return t=+t,e|=0,i||P(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):F(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,i){return t=+t,e|=0,i||P(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):F(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,i,n){if(t=+t,e|=0,!n){var r=Math.pow(2,8*i-1);P(this,t,e,i,r-1,-r)}var o=0,a=1,s=0;for(this[e]=255&t;++o<i&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+i},l.prototype.writeIntBE=function(t,e,i,n){if(t=+t,e|=0,!n){var r=Math.pow(2,8*i-1);P(this,t,e,i,r-1,-r)}var o=i-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+i},l.prototype.writeInt8=function(t,e,i){return t=+t,e|=0,i||P(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,i){return t=+t,e|=0,i||P(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):D(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,i){return t=+t,e|=0,i||P(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):D(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,i){return t=+t,e|=0,i||P(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):F(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,i){return t=+t,e|=0,i||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):F(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,i){return j(this,t,e,!0,i)},l.prototype.writeFloatBE=function(t,e,i){return j(this,t,e,!1,i)},l.prototype.writeDoubleLE=function(t,e,i){return L(this,t,e,!0,i)},l.prototype.writeDoubleBE=function(t,e,i){return L(this,t,e,!1,i)},l.prototype.copy=function(t,e,i,n){if(i||(i=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-i&&(n=t.length-e+i);var r,o=n-i;if(this===t&&i<e&&e<n)for(r=o-1;r>=0;--r)t[r+e]=this[r+i];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(r=0;r<o;++r)t[r+e]=this[r+i];else Uint8Array.prototype.set.call(t,this.subarray(i,i+o),e);return o},l.prototype.fill=function(t,e,i,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1===t.length){var r=t.charCodeAt(0);r<256&&(t=r)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;var o;if(e>>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(o=e;o<i;++o)this[o]=t;else{var a=l.isBuffer(t)?t:H(new l(t,n).toString()),s=a.length;for(o=0;o<i-e;++o)this[o+e]=a[o%s]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function z(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,e){var i;e=e||1/0;for(var n=t.length,r=null,o=[],a=0;a<n;++a){if((i=t.charCodeAt(a))>55295&&i<57344){if(!r){if(i>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(e-=3)>-1&&o.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(e-=3)>-1&&o.push(239,191,189);if(r=null,i<128){if((e-=1)<0)break;o.push(i)}else if(i<2048){if((e-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return o}function N(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(B,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,e,i,n){for(var r=0;r<n&&!(r+i>=e.length||r>=t.length);++r)e[r+i]=t[r];return r}}).call(this,i(28))},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){"use strict";e.byteLength=function(t){var e=c(t),i=e[0],n=e[1];return 3*(i+n)/4-n},e.toByteArray=function(t){var e,i,n=c(t),a=n[0],s=n[1],l=new o(function(t,e,i){return 3*(e+i)/4-i}(0,a,s)),h=0,u=s>0?a-4:a;for(i=0;i<u;i+=4)e=r[t.charCodeAt(i)]<<18|r[t.charCodeAt(i+1)]<<12|r[t.charCodeAt(i+2)]<<6|r[t.charCodeAt(i+3)],l[h++]=e>>16&255,l[h++]=e>>8&255,l[h++]=255&e;2===s&&(e=r[t.charCodeAt(i)]<<2|r[t.charCodeAt(i+1)]>>4,l[h++]=255&e);1===s&&(e=r[t.charCodeAt(i)]<<10|r[t.charCodeAt(i+1)]<<4|r[t.charCodeAt(i+2)]>>2,l[h++]=e>>8&255,l[h++]=255&e);return l},e.fromByteArray=function(t){for(var e,i=t.length,r=i%3,o=[],a=0,s=i-r;a<s;a+=16383)o.push(h(t,a,a+16383>s?s:a+16383));1===r?(e=t[i-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===r&&(e=(t[i-2]<<8)+t[i-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=a.length;s<l;++s)n[s]=a[s],r[a.charCodeAt(s)]=s;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return-1===i&&(i=e),[i,i===e?0:4-i%4]}function h(t,e,i){for(var r,o,a=[],s=e;s<i;s+=3)r=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(n[(o=r)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},function(t,e){
10
+ var n=i(29),r=i(30),a=i(31);function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,i){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,i);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return u(this,e)}return c(this,e,t,i)}function c(e,t,i,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,i,n){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===i&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,i):new Uint8Array(t,i,n);l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=f(e,t);return e}(e,t,i,n):"string"==typeof t?function(e,t,i){"string"==typeof i&&""!==i||(i="utf8");if(!l.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=0|m(t,i),r=(e=s(e,n)).write(t,i);r!==n&&(e=e.slice(0,r));return e}(e,t,i):function(e,t){if(l.isBuffer(t)){var i=0|d(t.length);return 0===(e=s(e,i)).length||t.copy(e,0,0,i),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?s(e,0):f(e,t);if("Buffer"===t.type&&a(t.data))return f(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function u(e,t){if(h(t),e=s(e,t<0?0:0|d(t)),!l.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function f(e,t){var i=t.length<0?0:0|d(t.length);e=s(e,i);for(var n=0;n<i;n+=1)e[n]=255&t[n];return e}function d(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function m(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return N(e).length;default:if(n)return H(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,i){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,i);case"utf8":case"utf-8":return T(this,t,i);case"ascii":return O(this,t,i);case"latin1":case"binary":return E(this,t,i);case"base64":return _(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function p(e,t,i,n,r){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:y(e,t,i,n,r);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):y(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}function y(e,t,i,n,r){var a,o=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,i/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(r){var h=-1;for(a=i;a<s;a++)if(c(e,a)===c(t,-1===h?0:a-h)){if(-1===h&&(h=a),a-h+1===l)return h*o}else-1!==h&&(a-=a-h),h=-1}else for(i+l>s&&(i=s-l),a=i;a>=0;a--){for(var u=!0,f=0;f<l;f++)if(c(e,a+f)!==c(t,f)){u=!1;break}if(u)return a}return-1}function b(e,t,i,n){i=Number(i)||0;var r=e.length-i;n?(n=Number(n))>r&&(n=r):n=r;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[i+o]=s}return o}function w(e,t,i,n){return U(H(t,e.length-i),e,i,n)}function x(e,t,i,n){return U(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,n)}function k(e,t,i,n){return x(e,t,i,n)}function C(e,t,i,n){return U(N(t),e,i,n)}function S(e,t,i,n){return U(function(e,t){for(var i,n,r,a=[],o=0;o<e.length&&!((t-=2)<0);++o)i=e.charCodeAt(o),n=i>>8,r=i%256,a.push(r),a.push(n);return a}(t,e.length-i),e,i,n)}function _(e,t,i){return 0===t&&i===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,i))}function T(e,t,i){i=Math.min(e.length,i);for(var n=[],r=t;r<i;){var a,o,s,l,c=e[r],h=null,u=c>239?4:c>223?3:c>191?2:1;if(r+u<=i)switch(u){case 1:c<128&&(h=c);break;case 2:128==(192&(a=e[r+1]))&&(l=(31&c)<<6|63&a)>127&&(h=l);break;case 3:a=e[r+1],o=e[r+2],128==(192&a)&&128==(192&o)&&(l=(15&c)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:a=e[r+1],o=e[r+2],s=e[r+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(h=l)}null===h?(h=65533,u=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),r+=u}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var i="",n=0;for(;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return i}(n)}t.Buffer=l,t.SlowBuffer=function(e){+e!=e&&(e=0);return l.alloc(+e)},t.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=o(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,i){return c(null,e,t,i)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,i){return function(e,t,i,n){return h(t),t<=0?s(e,t):void 0!==i?"string"==typeof n?s(e,t).fill(i,n):s(e,t).fill(i):s(e,t)}(null,e,t,i)},l.allocUnsafe=function(e){return u(null,e)},l.allocUnsafeSlow=function(e){return u(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,n=t.length,r=0,a=Math.min(i,n);r<a;++r)if(e[r]!==t[r]){i=e[r],n=t[r];break}return i<n?-1:n<i?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=l.allocUnsafe(t),r=0;for(i=0;i<e.length;++i){var o=e[i];if(!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,r),r+=o.length}return n},l.byteLength=m,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;t<e;t+=2)v(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?T(this,0,e):g.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",i=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,t,i,n,r){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),t<0||i>e.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&t>=i)return 0;if(n>=r)return-1;if(t>=i)return 1;if(this===e)return 0;for(var a=(r>>>=0)-(n>>>=0),o=(i>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(n,r),h=e.slice(t,i),u=0;u<s;++u)if(c[u]!==h[u]){a=c[u],o=h[u];break}return a<o?-1:o<a?1:0},l.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},l.prototype.indexOf=function(e,t,i){return p(this,e,t,i,!0)},l.prototype.lastIndexOf=function(e,t,i){return p(this,e,t,i,!1)},l.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)n=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var r=this.length-t;if((void 0===i||i>r)&&(i=r),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return b(this,e,t,i);case"utf8":case"utf-8":return w(this,e,t,i);case"ascii":return x(this,e,t,i);case"latin1":case"binary":return k(this,e,t,i);case"base64":return C(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,i);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function O(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(127&e[r]);return n}function E(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(e[r]);return n}function R(e,t,i){var n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);for(var r="",a=t;a<i;++a)r+=B(e[a]);return r}function I(e,t,i){for(var n=e.slice(t,i),r="",a=0;a<n.length;a+=2)r+=String.fromCharCode(n[a]+256*n[a+1]);return r}function A(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,i,n,r,a){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<a)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}function P(e,t,i,n){t<0&&(t=65535+t+1);for(var r=0,a=Math.min(e.length-i,2);r<a;++r)e[i+r]=(t&255<<8*(n?r:1-r))>>>8*(n?r:1-r)}function F(e,t,i,n){t<0&&(t=4294967295+t+1);for(var r=0,a=Math.min(e.length-i,4);r<a;++r)e[i+r]=t>>>8*(n?r:3-r)&255}function M(e,t,i,n,r,a){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function L(e,t,i,n,a){return a||M(e,0,i,4),r.write(e,t,i,n,23,4),i+4}function j(e,t,i,n,a){return a||M(e,0,i,8),r.write(e,t,i,n,52,8),i+8}l.prototype.slice=function(e,t){var i,n=this.length;if((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<e&&(t=e),l.TYPED_ARRAY_SUPPORT)(i=this.subarray(e,t)).__proto__=l.prototype;else{var r=t-e;i=new l(r,void 0);for(var a=0;a<r;++a)i[a]=this[a+e]}return i},l.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||A(e,t,this.length);for(var n=this[e],r=1,a=0;++a<t&&(r*=256);)n+=this[e+a]*r;return n},l.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||A(e,t,this.length);for(var n=this[e+--t],r=1;t>0&&(r*=256);)n+=this[e+--t]*r;return n},l.prototype.readUInt8=function(e,t){return t||A(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||A(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||A(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||A(e,t,this.length);for(var n=this[e],r=1,a=0;++a<t&&(r*=256);)n+=this[e+a]*r;return n>=(r*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||A(e,t,this.length);for(var n=t,r=1,a=this[e+--n];n>0&&(r*=256);)a+=this[e+--n]*r;return a>=(r*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readInt8=function(e,t){return t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||A(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt16BE=function(e,t){t||A(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt32LE=function(e,t){return t||A(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 t||A(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 t||A(e,4,this.length),r.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||A(e,4,this.length),r.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||A(e,8,this.length),r.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||A(e,8,this.length),r.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,i,n){(e=+e,t|=0,i|=0,n)||D(this,e,t,i,Math.pow(2,8*i)-1,0);var r=1,a=0;for(this[t]=255&e;++a<i&&(r*=256);)this[t+a]=e/r&255;return t+i},l.prototype.writeUIntBE=function(e,t,i,n){(e=+e,t|=0,i|=0,n)||D(this,e,t,i,Math.pow(2,8*i)-1,0);var r=i-1,a=1;for(this[t+r]=255&e;--r>=0&&(a*=256);)this[t+r]=e/a&255;return t+i},l.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):F(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t|=0,!n){var r=Math.pow(2,8*i-1);D(this,e,t,i,r-1,-r)}var a=0,o=1,s=0;for(this[t]=255&e;++a<i&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+i},l.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t|=0,!n){var r=Math.pow(2,8*i-1);D(this,e,t,i,r-1,-r)}var a=i-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+i},l.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):F(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,i){return L(this,e,t,!0,i)},l.prototype.writeFloatBE=function(e,t,i){return L(this,e,t,!1,i)},l.prototype.writeDoubleLE=function(e,t,i){return j(this,e,t,!0,i)},l.prototype.writeDoubleBE=function(e,t,i){return j(this,e,t,!1,i)},l.prototype.copy=function(e,t,i,n){if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var r,a=n-i;if(this===e&&i<t&&t<n)for(r=a-1;r>=0;--r)e[r+t]=this[r+i];else if(a<1e3||!l.TYPED_ARRAY_SUPPORT)for(r=0;r<a;++r)e[r+t]=this[r+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+a),t);return a},l.prototype.fill=function(e,t,i,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1===e.length){var r=e.charCodeAt(0);r<256&&(e=r)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var a;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(a=t;a<i;++a)this[a]=e;else{var o=l.isBuffer(e)?e:H(new l(e,n).toString()),s=o.length;for(a=0;a<i-t;++a)this[a+t]=o[a%s]}return this};var z=/[^+\/0-9A-Za-z-_]/g;function B(e){return e<16?"0"+e.toString(16):e.toString(16)}function H(e,t){var i;t=t||1/0;for(var n=e.length,r=null,a=[],o=0;o<n;++o){if((i=e.charCodeAt(o))>55295&&i<57344){if(!r){if(i>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&a.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(t-=3)>-1&&a.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;a.push(i)}else if(i<2048){if((t-=2)<0)break;a.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;a.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return a}function N(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function U(e,t,i,n){for(var r=0;r<n&&!(r+i>=t.length||r>=e.length);++r)t[r+i]=e[r];return r}}).call(this,i(28))},function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t,i){"use strict";t.byteLength=function(e){var t=c(e),i=t[0],n=t[1];return 3*(i+n)/4-n},t.toByteArray=function(e){var t,i,n=c(e),o=n[0],s=n[1],l=new a(function(e,t,i){return 3*(t+i)/4-i}(0,o,s)),h=0,u=s>0?o-4:o;for(i=0;i<u;i+=4)t=r[e.charCodeAt(i)]<<18|r[e.charCodeAt(i+1)]<<12|r[e.charCodeAt(i+2)]<<6|r[e.charCodeAt(i+3)],l[h++]=t>>16&255,l[h++]=t>>8&255,l[h++]=255&t;2===s&&(t=r[e.charCodeAt(i)]<<2|r[e.charCodeAt(i+1)]>>4,l[h++]=255&t);1===s&&(t=r[e.charCodeAt(i)]<<10|r[e.charCodeAt(i+1)]<<4|r[e.charCodeAt(i+2)]>>2,l[h++]=t>>8&255,l[h++]=255&t);return l},t.fromByteArray=function(e){for(var t,i=e.length,r=i%3,a=[],o=0,s=i-r;o<s;o+=16383)a.push(h(e,o,o+16383>s?s:o+16383));1===r?(t=e[i-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===r&&(t=(e[i-2]<<8)+e[i-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return a.join("")};for(var n=[],r=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s<l;++s)n[s]=o[s],r[o.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");return-1===i&&(i=t),[i,i===t?0:4-i%4]}function h(e,t,i){for(var r,a,o=[],s=t;s<i;s+=3)r=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(n[(a=r)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},function(e,t){
11
11
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
12
- e.read=function(t,e,i,n,r){var o,a,s=8*r-n-1,l=(1<<s)-1,c=l>>1,h=-7,u=i?r-1:0,f=i?-1:1,d=t[e+u];for(u+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;h>0;o=256*o+t[e+u],u+=f,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=256*a+t[e+u],u+=f,h-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=c}return(d?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,i,n,r,o){var a,s,l,c=8*o-r-1,h=(1<<c)-1,u=h>>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,v=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+u>=1?f/l:f*Math.pow(2,1-u))*l>=2&&(a++,l/=2),a+u>=h?(s=0,a=h):a+u>=1?(s=(e*l-1)*Math.pow(2,r),a+=u):(s=e*Math.pow(2,u-1)*Math.pow(2,r),a=0));r>=8;t[i+d]=255&s,d+=v,s/=256,r-=8);for(a=a<<r|s,c+=r;c>0;t[i+d]=255&a,d+=v,a/=256,c-=8);t[i+d-v]|=128*g}},function(t,e){var i={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==i.call(t)}},function(t,e){},function(t,e){},function(t,e){},function(t,e,i){},function(t,e,i){"use strict";(function(t){var e=i(13),n=i.n(e);!function(){function e(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function i(t,i){var n=function(t,i){var n=e(t)*e(i);if(0===n)return 0;var r=function(t,e){return t.x*e.x+t.y*e.y}(t,i)/n;return r>1&&(r=1),Math.acos(r)}(t,i);return function(t,e){return t.x*e.y-e.x*t.y}(t,i)>0&&(n*=-1),180*n/Math.PI}var r=function(t){this.handlers=[],this.el=t};function o(t,e){var i=new r(t);return i.add(e),i}r.prototype.add=function(t){this.handlers.push(t)},r.prototype.del=function(t){t||(this.handlers=[]);for(var e=this.handlers.length;e>=0;e--)this.handlers[e]===t&&this.handlers.splice(e,1)},r.prototype.dispatch=function(){for(var t=0,e=this.handlers.length;t<e;t++){var i=this.handlers[t];"function"==typeof i&&i.apply(this.el,arguments)}};var a=function(t,e){this.element="string"==typeof t?document.querySelector(t):t,this.start=this.start.bind(this),this.move=this.move.bind(this),this.end=this.end.bind(this),this.cancel=this.cancel.bind(this),this.element.addEventListener("touchstart",this.start,!1),this.element.addEventListener("touchmove",this.move,!1),this.element.addEventListener("touchend",this.end,!1),this.element.addEventListener("touchcancel",this.cancel,!1),this.preV={x:null,y:null},this.pinchStartLen=null,this.zoom=1,this.isDoubleTap=!1;var i=function(){};this.rotate=o(this.element,e.rotate||i),this.touchStart=o(this.element,e.touchStart||i),this.multipointStart=o(this.element,e.multipointStart||i),this.multipointEnd=o(this.element,e.multipointEnd||i),this.pinch=o(this.element,e.pinch||i),this.swipe=o(this.element,e.swipe||i),this.tap=o(this.element,e.tap||i),this.doubleTap=o(this.element,e.doubleTap||i),this.longTap=o(this.element,e.longTap||i),this.singleTap=o(this.element,e.singleTap||i),this.pressMove=o(this.element,e.pressMove||i),this.twoFingerPressMove=o(this.element,e.twoFingerPressMove||i),this.touchMove=o(this.element,e.touchMove||i),this.touchEnd=o(this.element,e.touchEnd||i),this.touchCancel=o(this.element,e.touchCancel||i),this._cancelAllHandler=this.cancelAll.bind(this),window.addEventListener("scroll",this._cancelAllHandler),this.delta=null,this.last=null,this.now=null,this.tapTimeout=null,this.singleTapTimeout=null,this.longTapTimeout=null,this.swipeTimeout=null,this.x1=this.x2=this.y1=this.y2=null,this.preTapPosition={x:null,y:null}};a.prototype={start:function(t){if(t.touches){this.now=Date.now(),this.x1=t.touches[0].pageX,this.y1=t.touches[0].pageY,this.delta=this.now-(this.last||this.now),this.touchStart.dispatch(t,this.element),null!==this.preTapPosition.x&&(this.isDoubleTap=this.delta>0&&this.delta<=250&&Math.abs(this.preTapPosition.x-this.x1)<30&&Math.abs(this.preTapPosition.y-this.y1)<30,this.isDoubleTap&&clearTimeout(this.singleTapTimeout)),this.preTapPosition.x=this.x1,this.preTapPosition.y=this.y1,this.last=this.now;var i=this.preV;if(t.touches.length>1){this._cancelLongTap(),this._cancelSingleTap();var n={x:t.touches[1].pageX-this.x1,y:t.touches[1].pageY-this.y1};i.x=n.x,i.y=n.y,this.pinchStartLen=e(i),this.multipointStart.dispatch(t,this.element)}this._preventTap=!1,this.longTapTimeout=setTimeout(function(){this._inZoom||(this.longTap.dispatch(t,this.element),this._preventTap=!0)}.bind(this),750)}},move:function(t){if(t.touches){var n=this.preV,r=t.touches.length,o=t.touches[0].pageX,a=t.touches[0].pageY;if(this.isDoubleTap=!1,r>1){var s=t.touches[1].pageX,l=t.touches[1].pageY,c={x:t.touches[1].pageX-o,y:t.touches[1].pageY-a};null!==n.x&&(this.pinchStartLen>0&&(t.zoom=e(c)/this.pinchStartLen,this.pinch.dispatch(t,this.element),this._preventTap=!0,this._inZoom=!0),t.angle=i(c,n),this.rotate.dispatch(t,this.element)),n.x=c.x,n.y=c.y,null!==this.x2&&null!==this.sx2?(t.deltaX=(o-this.x2+s-this.sx2)/2,t.deltaY=(a-this.y2+l-this.sy2)/2):(t.deltaX=0,t.deltaY=0),this.twoFingerPressMove.dispatch(t,this.element),this.sx2=s,this.sy2=l}else{if(null!==this.x2){t.deltaX=o-this.x2,t.deltaY=a-this.y2;var h=Math.abs(this.x1-this.x2),u=Math.abs(this.y1-this.y2);(h>10||u>10)&&(this._preventTap=!0)}else t.deltaX=0,t.deltaY=0;this.pressMove.dispatch(t,this.element)}this.touchMove.dispatch(t,this.element),this._cancelLongTap(),this.x2=o,this.y2=a,r>1&&t.preventDefault()}},end:function(t){if(t.changedTouches){this._cancelLongTap();var e=this;t.touches.length<2&&(this.multipointEnd.dispatch(t,this.element),this.sx2=this.sy2=null),this.x2&&Math.abs(this.x1-this.x2)>30||this.y2&&Math.abs(this.y1-this.y2)>30?(t.direction=this._swipeDirection(this.x1,this.x2,this.y1,this.y2),this.swipeTimeout=setTimeout((function(){e.swipe.dispatch(t,e.element)}),0)):(this.tapTimeout=setTimeout((function(){e._preventTap||e.tap.dispatch(t,e.element),e.isDoubleTap&&(e.doubleTap.dispatch(t,e.element),e.isDoubleTap=!1)}),0),e.isDoubleTap||e._preventTap||(e.singleTapTimeout=setTimeout((function(){e.singleTap.dispatch(t,e.element)}),250))),this.touchEnd.dispatch(t,this.element),this.preV.x=0,this.preV.y=0,this.zoom=1,this.pinchStartLen=null,this.x1=this.x2=this.y1=this.y2=null}},cancelAll:function(){this._preventTap=!0,clearTimeout(this.singleTapTimeout),clearTimeout(this.tapTimeout),clearTimeout(this.longTapTimeout),clearTimeout(this.swipeTimeout)},cancel:function(t){this.cancelAll(),this.touchCancel.dispatch(t,this.element)},_cancelLongTap:function(){clearTimeout(this.longTapTimeout)},_cancelSingleTap:function(){clearTimeout(this.singleTapTimeout)},_swipeDirection:function(t,e,i,n){return Math.abs(t-e)>=Math.abs(i-n)?t-e>0?"Left":"Right":i-n>0?"Up":"Down"},on:function(t,e){this[t]&&this[t].add(e)},off:function(t,e){this[t]&&this[t].del(e)},destroy:function(){return this.singleTapTimeout&&clearTimeout(this.singleTapTimeout),this.tapTimeout&&clearTimeout(this.tapTimeout),this.longTapTimeout&&clearTimeout(this.longTapTimeout),this.swipeTimeout&&clearTimeout(this.swipeTimeout),this.element.removeEventListener("touchstart",this.start),this.element.removeEventListener("touchmove",this.move),this.element.removeEventListener("touchend",this.end),this.element.removeEventListener("touchcancel",this.cancel),this.rotate.del(),this.touchStart.del(),this.multipointStart.del(),this.multipointEnd.del(),this.pinch.del(),this.swipe.del(),this.tap.del(),this.doubleTap.del(),this.longTap.del(),this.singleTap.del(),this.pressMove.del(),this.twoFingerPressMove.del(),this.touchMove.del(),this.touchEnd.del(),this.touchCancel.del(),this.preV=this.pinchStartLen=this.zoom=this.isDoubleTap=this.delta=this.last=this.now=this.tapTimeout=this.singleTapTimeout=this.longTapTimeout=this.swipeTimeout=this.x1=this.x2=this.y1=this.y2=this.preTapPosition=this.rotate=this.touchStart=this.multipointStart=this.multipointEnd=this.pinch=this.swipe=this.tap=this.doubleTap=this.longTap=this.singleTap=this.pressMove=this.touchMove=this.touchEnd=this.touchCancel=this.twoFingerPressMove=null,window.removeEventListener("scroll",this._cancelAllHandler),null}},"object"===("undefined"==typeof exports?"undefined":n()(exports))?t.exports=a:window.AlloyFinger=a}()}).call(this,i(37)(t))},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,i){"use strict";i.r(e),i.d(e,"spreadsheet",(function(){return ss}));var n=i(5),r=i.n(n),o=i(2),a=i.n(o),s=i(0),l=i.n(s),c=i(14),h=i.n(c),u=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";l()(this,t),"string"==typeof e?(this.el=document.createElement(e),this.el.className=i):this.el=e,this.data={}}return a()(t,[{key:"data",value:function(t,e){return void 0!==e?(this.data[t]=e,this):this.data[t]}},{key:"on",value:function(t,e){var i=t.split("."),n=h()(i),r=n[0],o=n.slice(1),a=r;return"mousewheel"===a&&/Firefox/i.test(window.navigator.userAgent)&&(a="DOMMouseScroll"),this.el.addEventListener(a,(function(t){e(t);for(var i=0;i<o.length;i+=1){var n=o[i];if("left"===n&&0!==t.button)return;if("right"===n&&2!==t.button)return;"stop"===n&&t.stopPropagation()}})),this}},{key:"offset",value:function(t){var e=this;if(void 0!==t)return Object.keys(t).forEach((function(i){e.css(i,"".concat(t[i],"px"))})),this;var i=this.el;return{top:i.offsetTop,left:i.offsetLeft,height:i.offsetHeight,width:i.offsetWidth}}},{key:"scroll",value:function(t){var e=this.el;return void 0!==t&&(void 0!==t.left&&(e.scrollLeft=t.left),void 0!==t.top&&(e.scrollTop=t.top)),{left:e.scrollLeft,top:e.scrollTop}}},{key:"box",value:function(){return this.el.getBoundingClientRect()}},{key:"parent",value:function(){return new t(this.el.parentNode)}},{key:"children",value:function(){for(var t=this,e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return 0===arguments.length?this.el.childNodes:(i.forEach((function(e){return t.child(e)})),this)}},{key:"removeChild",value:function(t){this.el.removeChild(t)}},{key:"empty",value:function(){this.el.innerHTML=""}},{key:"child",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e;return"string"==typeof e?n=document.createTextNode(e):e instanceof t&&(n=e.el),i?this.el.prepend(n):this.el.appendChild(n),this}},{key:"contains",value:function(t){return this.el.contains(t)}},{key:"className",value:function(t){return void 0!==t?(this.el.className=t,this):this.el.className}},{key:"addClass",value:function(t){return this.el.classList.add(t),this}},{key:"hasClass",value:function(t){return this.el.classList.contains(t)}},{key:"removeClass",value:function(t){return this.el&&this.el.classList.remove(t),this}},{key:"toggle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"active";return this.toggleClass(t)}},{key:"toggleClass",value:function(t){return this.el.classList.toggle(t)}},{key:"active",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"active";return t?this.addClass(e):this.removeClass(e),this}},{key:"checked",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.active(t,"checked"),this}},{key:"disabled",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t?this.addClass("disabled"):this.removeClass("disabled"),this}},{key:"attr",value:function(t,e){var i=this;if(void 0!==e)this.el.setAttribute(t,e);else{if("string"==typeof t)return this.el.getAttribute(t);Object.keys(t).forEach((function(e){i.el.setAttribute(e,t[e])}))}return this}},{key:"removeAttr",value:function(t){return this.el.removeAttribute(t),this}},{key:"sanitizeHTML",value:function(t){var e=document.createElement("div");return e.textContent=t,e.innerHTML}},{key:"html",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return void 0!==t?(this.el.innerHTML=e?i?this.sanitizeHTML(t).replace(/\n/g,"<br>"):this.sanitizeHTML(t):t,this):this.el.innerHTML}},{key:"val",value:function(t){return void 0!==t?(this.el.value=t,this):this.el.value}},{key:"focus",value:function(){this.el.focus()}},{key:"cssRemoveKeys",value:function(){for(var t=this,e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return i.forEach((function(e){return t.el.style.removeProperty(e)})),this}},{key:"css",value:function(t,e){var i=this;return void 0===e&&"string"!=typeof t?(Object.keys(t).forEach((function(e){i.el.style[e]=t[e]})),this):void 0!==e?(this.el.style[t]=e,this):this.el.style[t]}},{key:"computedStyle",value:function(){return window.getComputedStyle(this.el,null)}},{key:"show",value:function(){return this.css("display","block"),this}},{key:"hide",value:function(){return this.css("display","none"),this}}]),t}(),f=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new u(t,e)},d=i(6),v=i.n(d),g=(i(20),["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]);function p(t){for(var e="",i=t;i>=g.length;)i/=g.length,i-=1,e+=g[parseInt(i,10)%g.length];return e+=g[t%g.length]}function m(t){for(var e=0,i=0;i<t.length-1;i+=1){var n=t.charCodeAt(i)-65,r=t.length-1-i;e+=Math.pow(g.length,r)+g.length*n}return e+=t.charCodeAt(t.length-1)-65}function y(t){for(var e="",i="",n=0;n<t.length;n+=1)t.charAt(n)>="0"&&t.charAt(n)<="9"?i+=t.charAt(n):e+=t.charAt(n);return[m(e),parseInt(i,10)-1]}function b(t,e){return"".concat(p(t)).concat(e+1)}function w(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0};if(0===e&&0===i)return t;var o=y(t),a=r()(o,2),s=a[0],l=a[1];return n(s,l)?b(s+e,l+i):t}var x=function(){function t(e,i,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;l()(this,t),this.sri=e,this.sci=i,this.eri=n,this.eci=r,this.w=o,this.h=a}return a()(t,[{key:"set",value:function(t,e,i,n){this.sri=t,this.sci=e,this.eri=i,this.eci=n}},{key:"setToOther",value:function(t){this.sri=t.sri,this.sci=t.sci,this.eri=t.eri,this.eci=t.eci}},{key:"multiple",value:function(){return this.eri-this.sri>0||this.eci-this.sci>0}},{key:"includes",value:function(){for(var t=0,e=0,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];if(1===n.length){var a=y(n[0]),s=r()(a,2);e=s[0],t=s[1]}else 2===n.length&&(t=n[0],e=n[1]);var l=this.sri,c=this.sci,h=this.eri,u=this.eci;return l<=t&&t<=h&&c<=e&&e<=u}},{key:"each",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},i=this.sri,n=this.sci,r=this.eri,o=this.eci,a=i;a<=r;a+=1)if(e(a))for(var s=n;s<=o;s+=1)t(a,s)}},{key:"emptyFirst",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0},n=this.sri,r=this.sci,o=this.eri,a=this.eci,s=n;s<=o;s+=1)if(e(s)){for(var l=[],c=[],h=r;h<=a;h+=1)i(s,h)?l.push(h):c.push(h);for(var u=0;u<l.length;u++)t(s,l[u]);for(var f=0;f<c.length;f++)t(s,c[f])}}},{key:"contains",value:function(t){return this.sri<=t.sri&&this.sci<=t.sci&&this.eri>=t.eri&&this.eci>=t.eci}},{key:"within",value:function(t){return this.sri>=t.sri&&this.sci>=t.sci&&this.eri<=t.eri&&this.eci<=t.eci}},{key:"disjoint",value:function(t){return this.sri>t.eri||this.sci>t.eci||t.sri>this.eri||t.sci>this.eci}},{key:"intersects",value:function(t){return this.sri<=t.eri&&this.sci<=t.eci&&t.sri<=this.eri&&t.sci<=this.eci}},{key:"union",value:function(e){var i=this.sri,n=this.sci,r=this.eri,o=this.eci;return new t(e.sri<i?e.sri:i,e.sci<n?e.sci:n,e.eri>r?e.eri:r,e.eci>o?e.eci:o)}},{key:"extendRange",value:function(e){var i=this.sri,n=this.sci,r=this.eri,o=this.eci,a=e.eri-e.sri+1,s=e.eci-e.sci+1,l=r-i+1,c=o-n+1;return new t(i,n,i+(l<a?a:l-l%a)-1,n+(c<s?s:c-c%s)-1)}},{key:"difference",value:function(e){var i=[],n=function(e,n,r,o){i.push(new t(e,n,r,o))},r=this.sri,o=this.sci,a=this.eri,s=this.eci,l=e.sri-r,c=e.sci-o,h=a-e.eri,u=s-e.eci;return this.intersects(e)?l>0?(n(r,o,e.sri-1,s),h>0?(n(e.eri+1,o,a,s),c>0?(n(e.sri,o,e.eri,e.sci-1),u>0&&n(e.sri,e.eci+1,e.eri,s)):u>0&&n(e.sri,e.eci+1,e.eri,s)):c>0?(n(e.sri,o,a,e.sci-1),u>0&&n(e.sri,e.eci+1,a,s)):u>0&&n(e.sri,e.eci+1,a,s)):h>0?(n(e.eri+1,o,a,s),c>0?(n(r,o,e.eri,e.sci-1),u>0&&n(r,e.eci+1,e.eri,s)):u>0&&n(r,e.eci+1,e.eri,s)):c>0?(n(r,o,a,e.sci-1),u>0&&n(r,e.eci+1,a,s)):u>0&&n(r,e.eci+1,a,s):n(r,o,a,s),i}},{key:"size",value:function(){return[this.eri-this.sri+1,this.eci-this.sci+1]}},{key:"toString",value:function(){var t=this.sri,e=this.sci,i=this.eri,n=this.eci,r=b(e,t);return this.multiple()&&(r="".concat(r,":").concat(b(n,i))),r}},{key:"clone",value:function(){return new t(this.sri,this.sci,this.eri,this.eci,this.w,this.h)}},{key:"equals",value:function(t){return this.eri===t.eri&&this.eci===t.eci&&this.sri===t.sri&&this.sci===t.sci}}],[{key:"valueOf",value:function(e){var i=e.split(":"),n=y(i[0]),o=r()(n,2),a=o[0],s=o[1],l=s,c=a;if(i.length>1){var h=y(i[1]),u=r()(h,2);c=u[0],l=u[1]}return new t(s,a,l,c)}}]),t}(),C=x,k=function(){function t(){l()(this,t),this.range=new x(0,0,0,0),this.ri=0,this.ci=0}return a()(t,[{key:"multiple",value:function(){return this.range.multiple()}},{key:"setIndexes",value:function(t,e){this.ri=t,this.ci=e}},{key:"size",value:function(){return this.range.size()}}]),t}(),_=function t(){l()(this,t),this.x=0,this.y=0,this.ri=0,this.ci=0,this.riact=0},S=function(){function t(){l()(this,t),this.undoItems=[],this.redoItems=[]}return a()(t,[{key:"add",value:function(t){this.undoItems.push(JSON.stringify(t)),this.redoItems=[]}},{key:"canUndo",value:function(){return this.undoItems.length>0}},{key:"canRedo",value:function(){return this.redoItems.length>0}},{key:"undo",value:function(t,e){var i=this.undoItems,n=this.redoItems;if(this.canUndo()){var r=JSON.parse(i.pop());n.push(JSON.stringify(t(r))),e(r)}}},{key:"redo",value:function(t,e){var i=this.undoItems,n=this.redoItems;if(this.canRedo()){var r=JSON.parse(n.pop());i.push(JSON.stringify(t(r))),e(r)}}}]),t}(),T=function(){function t(){l()(this,t),this.range=null,this.state="clear",this.textdata=null}return a()(t,[{key:"copy",value:function(t,e){this.range=t,this.state="copy";for(var i=t.sri,n=t.sci,r=t.eri,o=t.eci,a="",s=i;s<=r;s+=1){if(e._[s])for(var l=n;l<=o;l+=1){if(e._[s].cells&&e._[s].cells[l]){var c=e._[s].cells[l].text;c&&(c.indexOf("\n")>=0&&(c='"'+c+'"'),a+=c)}a+="\t"}a+="\n"}return this.setData(a),this}},{key:"cut",value:function(t){return this.range=t,this.state="cut",this}},{key:"isCopy",value:function(){return"copy"===this.state}},{key:"isCut",value:function(){return"cut"===this.state}},{key:"isClear",value:function(){return"clear"===this.state}},{key:"clear",value:function(){this.range=null,this.state="clear"}},{key:"setData",value:function(t){this.textdata=t,this.copyTextToClipboard(t)}},{key:"fallbackCopyTextToClipboard",value:function(t){var e=document.createElement("textarea");e.value=t,e.style.top="0",e.style.left="0",e.style.position="fixed",document.body.appendChild(e),e.focus(),e.select();try{document.execCommand("copy")}catch(t){}document.body.removeChild(e)}},{key:"copyTextToClipboard",value:function(t){navigator.clipboard?navigator.clipboard.writeText(t).then((function(){}),(function(t){})):this.fallbackCopyTextToClipboard(t)}}]),t}(),O=function(){function t(e,i,n){l()(this,t),this.ci=e,this.operator=i,this.value=n}return a()(t,[{key:"set",value:function(t,e){this.operator=t,this.value=e}},{key:"includes",value:function(t){var e=this.operator,i=this.value;return"all"===e||"in"===e&&i.includes(t)}},{key:"vlength",value:function(){var t=this.operator,e=this.value;return"in"===t?e.length:0}},{key:"getData",value:function(){return{ci:this.ci,operator:this.operator,value:this.value}}}]),t}(),E=function(){function t(e,i){l()(this,t),this.ci=e,this.order=i}return a()(t,[{key:"asc",value:function(){return"asc"===this.order}},{key:"desc",value:function(){return"desc"===this.order}}]),t}(),R=function(){function t(){l()(this,t),this.ref=null,this.filters=[],this.sort=null}return a()(t,[{key:"setData",value:function(t){var e=t.ref,i=t.filters,n=t.sort;null!=e&&(this.ref=e,this.filters=i.map((function(t){return new O(t.ci,t.operator,t.value)})),n&&(this.sort=new E(n.ci,n.order)))}},{key:"getData",value:function(){if(this.active()){var t=this.ref,e=this.filters,i=this.sort;return{ref:t,filters:e.map((function(t){return t.getData()})),sort:i}}return{}}},{key:"addFilter",value:function(t,e,i){var n=this.getFilter(t);null==n?this.filters.push(new O(t,e,i)):n.set(e,i)}},{key:"setSort",value:function(t,e){this.sort=e?new E(t,e):null}},{key:"includes",value:function(t,e){return!!this.active()&&this.hrange().includes(t,e)}},{key:"getSort",value:function(t){var e=this.sort;return e&&e.ci===t?e:null}},{key:"getFilter",value:function(t){for(var e=this.filters,i=0;i<e.length;i+=1)if(e[i].ci===t)return e[i];return null}},{key:"filteredRows",value:function(t){var e=new Set,i=new Set;if(this.active())for(var n=this.range(),r=n.sri,o=n.eri,a=this.filters,s=r+1;s<=o;s+=1)for(var l=0;l<a.length;l+=1){var c=a[l],h=t(s,c.ci),u=h&&0!=h.text.trim().length?h.text:"";if(!c.includes(u)){e.add(s);break}i.add(s)}return{rset:e,fset:i}}},{key:"items",value:function(t,e){var i={};if(this.active())for(var n=this.range(),r=n.sri,o=n.eri,a=r+1;a<=o;a+=1){var s=e(a,t);if(null===s||/^\s*$/.test(s.text))i[""]=(i[""]||0)+1;else{var l=s.text,c=(i[l]||0)+1;i[l]=c}}return i}},{key:"range",value:function(){return x.valueOf(this.ref)}},{key:"hrange",value:function(){var t=this.range();return t.eri=t.sri,t}},{key:"clear",value:function(){this.ref=null,this.filters=[],this.sort=null}},{key:"active",value:function(){return null!==this.ref}}]),t}(),A=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];l()(this,t),this._=e}return a()(t,[{key:"forEach",value:function(t){this._.forEach(t)}},{key:"deleteWithin",value:function(t){this._=this._.filter((function(e){return!e.within(t)}))}},{key:"getFirstIncludes",value:function(t,e){for(var i=0;i<this._.length;i+=1){var n=this._[i];if(n.includes(t,e))return n}return null}},{key:"filterIntersects",value:function(e){return new t(this._.filter((function(t){return t.intersects(e)})))}},{key:"intersects",value:function(t){for(var e=0;e<this._.length;e+=1){if(this._[e].intersects(t))return!0}return!1}},{key:"equals",value:function(t){for(var e=0;e<this._.length;e+=1){if(this._[e].equals(t))return!0}return!1}},{key:"union",value:function(t){var e=t;return this._.forEach((function(t){t.intersects(e)&&(e=t.union(e))})),e}},{key:"add",value:function(t){this.deleteWithin(t),this._.push(t)}},{key:"shift",value:function(t,e,i,n){this._.forEach((function(r){var o=r.sri,a=r.sci,s=r.eri,l=r.eci,c=r;"row"===t?o>=e?(c.sri+=i,c.eri+=i):o<e&&e<=s&&(c.eri+=i,n(o,a,i,0)):"column"===t&&(a>=e?(c.sci+=i,c.eci+=i):a<e&&e<=l&&(c.eci+=i,n(o,a,0,i)))}))}},{key:"move",value:function(t,e,i){this._.forEach((function(n){var r=n;r.within(t)&&(r.eri+=e,r.sri+=e,r.sci+=i,r.eci+=i)}))}},{key:"setData",value:function(t){return this._=t.map((function(t){return x.valueOf(t)})),this}},{key:"getData",value:function(){return this._.map((function(t){return t.toString()}))}},{key:"getDataForSave",value:function(){return this._.filter((function(t){return t.multiple()}))}}]),t}();var I=function t(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return n.forEach((function(i){Object.keys(i).forEach((function(n){var r=i[n];"string"==typeof r||"number"==typeof r||"boolean"==typeof r?e[n]=r:"function"!=typeof r&&!Array.isArray(r)&&r instanceof Object?(e[n]=e[n]||{},t(e[n],r)):e[n]=r}))})),e};function P(t){for(var e="".concat(t),i=0,n=!1,r=0;r<e.length;r+=1)!0===n&&(i+=1),"."===e.charAt(r)&&(n=!0);return i}function D(t,e,i){if(Number.isNaN(e)||Number.isNaN(i))return e+t+i;var n=P(e),r=P(i),o=Number(e),a=Number(i),s=0;return"-"===t?s=o-a:"+"===t?s=o+a:"*"===t?s=o*a:"/"===t&&(s=o/a),s.toFixed(Math.max(n,r))}var F={cloneDeep:function(t){return JSON.parse(JSON.stringify(t))},merge:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return I.apply(void 0,[{}].concat(e))},equals:function t(e,i){var n=Object.keys(e);if(n.length!==Object.keys(i).length)return!1;for(var r=0;r<n.length;r+=1){var o=n[r],a=e[o],s=i[o];if(void 0===s)return!1;if("string"==typeof a||"number"==typeof a||"boolean"==typeof a){if(a!==s)return!1}else if(Array.isArray(a)){if(a.length!==s.length)return!1;for(var l=0;l<a.length;l+=1)if(!t(a[l],s[l]))return!1}else if("function"!=typeof a&&!Array.isArray(a)&&a instanceof Object&&!t(a,s))return!1}return!0},arrayEquals:function(t,e){if(t.length!==e.length)return!1;for(var i=0;i<t.length;i+=1)if(t[i]!==e[i])return!1;return!0},sum:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t){return t},i=0,n=0;return Object.keys(t).forEach((function(r){i+=e(t[r],r),n+=1})),[i,n]},rangeEach:function(t,e,i){for(var n=t;n<e;n+=1)i(n)},rangeSum:function(t,e,i){for(var n=0,r=t;r<e;r+=1)n+=i(r);return n},rangeReduceIf:function(t,e,i,n,r,o){for(var a=i,s=n,l=t;l<e&&!(a>r);l+=1)a+=s=o(l);return[l,a-s,s]},deleteProperty:function(t,e){var i=t["".concat(e)];return delete t["".concat(e)],i},numberCalc:D},M=function(){function t(e){var i=e.len,n=e.height;l()(this,t),this._={},this.len=i,this.height=n}return a()(t,[{key:"getHeight",value:function(t,e){if(this.isHide(t))return 0;if(e&&e.has(t))return 0;var i=this.get(t);return i&&i.height?i.height:this.height}},{key:"setHeight",value:function(t,e){this.getOrNew(t).height=e}},{key:"unhide",value:function(t){for(var e=t;e>0&&(e-=1,this.isHide(e));)this.setHide(e,!1)}},{key:"isHide",value:function(t){var e=this.get(t);return e&&e.hide}},{key:"setHide",value:function(t,e){var i=this.getOrNew(t);!0===e?i.hide=!0:delete i.hide}},{key:"setStyle",value:function(t,e){this.getOrNew(t).style=e}},{key:"sumHeight",value:function(t,e){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;return F.rangeSum(t,e,(function(t){return n&&n.has(t)?0:i.getHeight(t)}))}},{key:"totalHeight",value:function(){return this.sumHeight(0,this.len)}},{key:"get",value:function(t){return this._[t]}},{key:"getOrNew",value:function(t){return this._[t]=this._[t]||{cells:{}},this._[t]}},{key:"getCell",value:function(t,e){var i=this.get(t);return void 0!==i&&void 0!==i.cells&&void 0!==i.cells[e]?i.cells[e]:null}},{key:"getCellMerge",value:function(t,e){var i=this.getCell(t,e);return i&&i.merge?i.merge:[0,0]}},{key:"getCellOrNew",value:function(t,e){var i=this.getOrNew(t);return i.cells[e]=i.cells[e]||{},i.cells[e]}},{key:"setCell",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"all",r=this.getOrNew(t);"all"===n?r.cells[e]=i:"text"===n?(r.cells[e]=r.cells[e]||{},r.cells[e].text=i.text):"format"===n&&(r.cells[e]=r.cells[e]||{},r.cells[e].style=i.style,i.merge&&(r.cells[e].merge=i.merge))}},{key:"setCellTextBasicAct",value:function(t,e,i,n){t.text=e,n?t.f=n:delete t.f,i?t.ufv=i:delete t.ufv,t.html&&e.startsWith("<font style=")&&e.endsWith("</font>")&&(t.html=e)}},{key:"setCellText",value:function(t,e,i,n,r){var o=this.getCellOrNew(t,e);this.setCellTextBasicAct(o,i,n,r)}},{key:"setCellTextAndGetRet",value:function(t){var e=this.getCellOrNew(t.ri,t.ci);return this.setCellTextBasicAct(e,t.text,t.ufv,t.f),e.rtxt=t.rtxt,e.html=t.html,delete e.bigfontsize,e}},{key:"updateOneCell",value:function(t){return this.setCellTextAndGetRet(t)}},{key:"copyPaste",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},a=t.sri,s=t.sci,l=t.eri,c=t.eci,h=new Array,u=new Array,f=e.sri>=0?e.sri:0,d=e.sci>=0?e.sci:0,v=e.eri,g=e.eci,p=t.size(),m=r()(p,2),y=m[0],b=m[1],x=e.size(),C=r()(x,2),k=C[0],_=C[1],S=!0,T=0;(v<a||g<s)&&(S=!1,T=v<a?k:_);for(var O=a;O<=l;O+=1)for(var E=s;E<=c;E+=1)for(var R=f;R<=v;R+=y)for(var A=d;A<=g;A+=b){var I=R+(O-a),P=A+(E-s);if(I!==O||P!==E){var D=this._[O]&&this._[O].cells&&this._[O].cells[E],M=D?F.cloneDeep(this._[O].cells[E]):{};if(I!==O||P!==E){n&&M&&M.text&&M.text.length>0&&function(){var t=M.text,e=A-d+(R-f)+2;if(S||(e-=T+1),"="===t[0])M.text=t.replace(/\w{1,3}\d/g,(function(t){var i=0,n=0;return a===f?i=e-1:n=e-1,/^\d+$/.test(t)?t:w(t,i,n)}));else if(y<=1&&b>1&&(f>l||v<a)||b<=1&&y>1&&(d>c||g<s)||y<=1&&b<=1){var i=/[\\.\d]+$/.exec(t);if(null!==i){var n=Number(i[0])+e-1;M.text=t.substring(0,i.index)+n}}}();var j={ri:I,ci:P,text:M.f?M.f:M.text},L={ri:I,ci:P,ncell:M};n&&(M.f||M.ufv)||h.push(j),u.push(L)}}}for(var B=0;B<u.length;B++)this.setCell(u[B].ri,u[B].ci,u[B].ncell,i),o(u[B].ri,u[B].ci,u[B].ncell);return h}},{key:"cutPaste",value:function(t,e){var i=this,n={};this.each((function(r){i.eachCells(r,(function(o){var a=parseInt(r,10),s=parseInt(o,10);t.includes(r,o)&&(a=e.sri+(a-t.sri),s=e.sci+(s-t.sci)),n[a]=n[a]||{cells:{}},n[a].cells[s]=i._[r].cells[o],n[a].height=i._[r].height}))})),this._=n}},{key:"paste",value:function(t,e){var i=this,n=new Array;if(!(t.length<=0)){var r=e.sri,o=e.sci;return t.forEach((function(t,e){var a=r+e;t.forEach((function(t,e){var r=o+e;if(r<=1e3){i.setCellText(a,r,t);var s={ri:a,ci:r,text:t};n.push(s)}}))})),n}}},{key:"insert",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n={};this.each((function(r,o){var a=parseInt(r,10);a>=t&&(a+=i,e.eachCells(r,(function(e,n){n.text&&"="===n.text[0]&&(n.text=n.text.replace(/\w{1,3}\d/g,(function(e){return w(e,0,i,(function(e,i){return i>=t}))})))}))),n[a]=o})),this._=n,this.len+=i,t>=1&&this.copyrow(t-1,i)}},{key:"copyrow",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.copyCellStyle,r=this._[t];if(void 0!==r)for(var o=function(i){var o=e.getOrNew(t+i);o.height=r.height,e.eachCells(t,(function(t,e){o.cells[t]={},n(o.cells[t],e)}))},a=1;a<=i;a++)o(a)}},{key:"copyCellStyle",value:function(t,e){t.style=e.style,e.isautoalign&&(t.isautoalign=e.isautoalign)}},{key:"delete",value:function(t,e){var i=this,n=e-t+1,r={};this.each((function(o,a){var s=parseInt(o,10);s<t?r[s]=a:o>e&&(r[s-n]=a,i.eachCells(o,(function(t,i){i.text&&"="===i.text[0]&&(i.text=i.text.replace(/\w{1,3}\d/g,(function(t){return w(t,0,-n,(function(t,i){return i>e}))})))})))})),this._=r,this.len-=n}},{key:"insertColumn",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.copyCellStyle;this.each((function(r,o){var a={};if(e.eachCells(r,(function(e,n){var r=parseInt(e,10);r>=t&&(r+=i,n.text&&"="===n.text[0]&&(n.text=n.text.replace(/\w{1,3}\d/g,(function(e){return w(e,i,0,(function(e){return e>=t}))})))),a[r]=n})),t>=1)for(var s=1;s<=i;s++)void 0!==a[t-1]&&(a[t-1+s]={},n(a[t-1+s],a[t-1]));o.cells=a}))}},{key:"deleteColumn",value:function(t,e){var i=this,n=e-t+1;this.each((function(r,o){var a={};i.eachCells(r,(function(i,r){var o=parseInt(i,10);o<t?a[o]=r:o>e&&(a[o-n]=r,r.text&&"="===r.text[0]&&(r.text=r.text.replace(/\w{1,3}\d/g,(function(t){return w(t,-n,0,(function(t){return t>e}))}))))})),o.cells=a}))}},{key:"deleteCells",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";t.each((function(t,n){e.deleteCell(t,n,i)}))}},{key:"deleteCell",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all",n=this.get(t);if(null!==n){var r=this.getCell(t,e);null!==r&&("all"===i?delete n.cells[e]:"text"===i?(r.text&&delete r.text,r.value&&delete r.value):"format"===i?(void 0!==r.style&&delete r.style,r.merge&&delete r.merge):"merge"===i&&r.merge&&delete r.merge)}}},{key:"maxCell",value:function(){var t=Object.keys(this._),e=t[t.length-1],i=this._[e];if(i){var n=i.cells,r=Object.keys(n),o=r[r.length-1];return[parseInt(e,10),parseInt(o,10)]}return[0,0]}},{key:"each",value:function(t){Object.entries(this._).forEach((function(e){var i=r()(e,2),n=i[0],o=i[1];t(n,o)}))}},{key:"eachCells",value:function(t,e){this._[t]&&this._[t].cells&&Object.entries(this._[t].cells).forEach((function(t){var i=r()(t,2),n=i[0],o=i[1];e(n,o)}))}},{key:"setData",value:function(t){t.len&&(this.len=t.len,delete t.len),void 0!==t.height&&(this.height=t.height,delete t.height),this._=t}},{key:"setRangeData",value:function(t,e){for(var i=e.sri;i<=e.eri;i++)void 0!==t[i]&&(this._[i]=t[i]),null===t[i]&&delete this._[i]}},{key:"getData",value:function(){var t=this.len,e=this.height;return Object.assign({len:t,height:e},this._)}},{key:"getRangeData",value:function(t){for(var e={},i=t.sri;i<=t.eri;i++)void 0!==this._[i]?e[i]=this._[i]:e[i]=null;return e}},{key:"getDataForRowsSet",value:function(t){var e=this,i=this.len,n=this.height,r={};return r.height=n,r.len=i,t.forEach((function(t){void 0!==e._[t]&&(r[t]=e._[t])})),r}},{key:"getHeightForSave",value:function(t){var e=this,i={};return t.forEach((function(t){void 0!==e._[t]&&(i[t]=e.getHeight(t))})),i}}]),t}(),j=function(){function t(e){var i=e.len,n=e.width,r=e.indexWidth,o=e.minWidth;l()(this,t),this._={},this.len=i,this.width=n,this.indexWidth=r,this.minWidth=o}return a()(t,[{key:"setData",value:function(t){t.len&&(this.len=t.len,delete t.len),this._=t}},{key:"getData",value:function(){var t=this.len;return Object.assign({len:t},this._)}},{key:"getDataForSave",value:function(t){var e=this,i={};return t.forEach((function(t){void 0!==e._[t]&&(i[t]=e._[t])})),i}},{key:"getWidth",value:function(t){if(this.isHide(t))return 0;var e=this._[t];return e&&e.width?e.width:this.width}},{key:"getOrNew",value:function(t){return this._[t]=this._[t]||{},this._[t]}},{key:"setWidth",value:function(t,e){this.getOrNew(t).width=e}},{key:"unhide",value:function(t){for(var e=t;e>0&&(e-=1,this.isHide(e));)this.setHide(e,!1)}},{key:"isHide",value:function(t){var e=this._[t];return e&&e.hide}},{key:"setHide",value:function(t,e){var i=this.getOrNew(t);!0===e?i.hide=!0:delete i.hide}},{key:"setStyle",value:function(t,e){this.getOrNew(t).style=e}},{key:"sumWidth",value:function(t,e){var i=this;return F.rangeSum(t,e,(function(t){return i.getWidth(t)}))}},{key:"totalWidth",value:function(){return this.sumWidth(0,this.len)}}]),t}();function L(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return B(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return B(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var z=["zh","en"],H={en:{toolbar:{undo:"Undo",redo:"Redo",print:"Print",paintformat:"Paint format",clearformat:"Clear format",format:"Format",fontName:"Font",fontSize:"Font size",fontBold:"Font bold",fontItalic:"Font italic",underline:"Underline",strike:"Strike",color:"Text color",bgcolor:"Fill color",border:"Borders",merge:"Merge cells",unmerge:"Unmerge cells",align:"Horizontal align",valign:"Vertical align",textwrap:"Text wrapping",freeze:"Freeze cell",autofilter:"Filter",formula:"Functions",more:"More",sort:"Sort",download:"Download",pagination:"Pagination",search:"Search",commentDefault:"Please enter text",commentEdit:"Edit comment",commentRemove:"Remove comment",commentPrevious:"Previous comment",commentNext:"Next comment",insertImage:"Insert image"},menubar:{undo:"Undo",redo:"Redo",print:"Print",paintformat:"Paint format",clearformat:"Clear format",format:"Format",fontName:"Font name:",fontSize:"Font size:",fontBold:"Font bold",fontItalic:"Font italic",underline:"Underline",strike:"Strike",color:"Text color",bgcolor:"Fill color",border:"Borders",merge:"Merge cells",unmerge:"Unmerge cells",align:"Horizontal align",valign:"Vertical align",textwrap:"Text wrapping",freeze:"Freeze cell",autofilter:"Filter",formula:"Functions",more:"More",sort:"Sort",download:"Download",download_HTML:"Download As HTML",download_PDF:"Download As PDF",download_Original:"Download Original",download_XLSX:"Download As XLSX",download_GOOGLE:"Save To Google Drive",download_DROPBOX:"Save To Dropbox",pagination:"Pagination",search:"Search",commentDefault:"Please enter text",insertSheet:"Sheet",insertRow:"Row",insertColumn:"Column",link:"Link",insertComment:"Comment",commentEdit:"Edit comment",commentRemove:"Remove comment",commentPrevious:"Previous comment",commentNext:"Next comment",insertImage:"Image",fromURL:"From URL",fromLocal:"From Local",menuInsert:"Insert",menuComment:"Review",menuText:"Format",menuFont:"Font",menuEdit:"Home",menuFile:"File"},contextmenu:{copy:"Copy",cut:"Cut",paste:"Paste",pasteValue:"Paste values only",pasteFormat:"Paste format only",hide:"Hide",insertRow:"Insert row",insertColumn:"Insert column",deleteSheet:"Delete",deleteRow:"Delete row",deleteColumn:"Delete column",deleteCell:"Delete cell",deleteCellText:"Delete cell text",validation:"Data validations",sort:"Sort",link:"Link",removeLink:"Remove Link",editLink:"Edit Link",openLink:"Open Link",download:"Download",cellprintable:"Enable export",cellnonprintable:"Disable export",celleditable:"Enable editing",cellnoneditable:"Disable editing",insertURL:"Enter the image address",deleteImage:"Delete image",copyImage:"Copy image",pasteImage:"Paste image",merge:"Merge",unmerge:"Unmerge",edit:"Edit",clear:"Clear"},link:{emailAddress:"E-mail Address",emailSubject:"Subject",sheetPage:"Document Place",sheetCell:"Cell Reference",linkTypes:{web:"Web Page",sheet:"This Document",email:"E-mail Address"},webUrl:"Address",linkType:"Link To"},download:{fileName:"File Name",saveType:"Save As",saveTypes:{Original:"Original",XLSX:"XLSX",PDF:"PDF",HTML:"HTML"}},print:{size:"Paper size",orientation:"Page orientation",orientations:["Landscape","Portrait"]},format:{normal:"Normal",text:"Plain Text",number:"Number",percent:"Percent",rmb:"RMB",usd:"USD",eur:"EUR",date:"Date",time:"Time",datetime:"Date time",duration:"Duration"},formula:{sum:"Calculate the sum of a set of values",average:"Calculate the arithmetic mean of all parameters",max:"Calculate the maximum value in a set of numbers",min:"Calculate the smallest value in a set of numbers",_if:"According to the true or false result of the logical judgment of the specified condition, the calculation result triggered by the corresponding condition is returned",and:'Only when the results of the parameters are all logical "true", it returns logical "true", otherwise it returns logical "false"',or:'Only when all parameter values are logically "false", the result is returned as logical "false", otherwise it is returned as logical "true"',concat:"Connect multiple character text or data in cells together"},validation:{required:"it must be required",notMatch:"it not match its validation rule",between:"it is between {} and {}",notBetween:"it is not between {} and {}",notIn:"it is not in list",equal:"it equal to {}",notEqual:"it not equal to {}",lessThan:"it less than {}",lessThanEqual:"it less than or equal to {}",greaterThan:"it greater than {}",greaterThanEqual:"it greater than or equal to {}",downloadImageFail:"download image fail"},error:{pasteForMergedCell:"Unable to do this for merged cells"},calendar:{weeks:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"]},button:{add:"Add",del:"Delete",next:"Next",cancel:"Cancel",remove:"Remove",save:"Save",ok:"OK",previous:"Previous",close:"Close"},sort:{desc:"Sort Z -> A",asc:"Sort A -> Z"},filter:{empty:"empty"},dataValidation:{mode:"Mode",range:"Cell Range",criteria:"Criteria",modeType:{cell:"Cell",column:"Column",row:"Row"},type:{list:"List",number:"Number",date:"Date",phone:"Phone",email:"Email"},operator:{be:"between",nbe:"not between",lt:"less than",lte:"less than or equal to",gt:"greater than",gte:"greater than or equal to",eq:"equal to",neq:"not equal to"}},dataSort:{ci:"Range",criteria:"Order",casesense:"Case Sensitive",sortby:"Sort by",header:"My data has headers",msg:"Please select diffrent columns for sort by fields",msg2:"The select range has merge areas,we do not support sort on merge areas ",order:{asc:"ASC",desc:"DESC"}},dataSearch:{label:"Find what",lkinlb:"Look in",matchwhole:"Match entire contents",lookin:{values:"Values",formulas:"Formulas",comments:"Comments"}},dataComment:{label:"Comment"}},de:{toolbar:{undo:"Rückgängig machen",redo:"Wiederherstellen",paintformat:"Format kopieren/einfügen",clearformat:"Format löschen",format:"Format",font:"Schriftart",fontSize:"Schriftgrad",fontBold:"Fett",fontItalic:"Kursiv",underline:"Betonen",strike:"Streichen",textColor:"Text Farbe",fillColor:"Füllung Farbe",border:"Umrandung",merge:"Zellen verbinden",align:"Waagrechte Ausrichtung",valign:"Vertikale uitlijning",textwrap:"Textumbruch",freeze:"Zelle sperren",formula:"Funktionen",more:"Mehr",commentDefault:"Bitte Text eingeben",commentEdit:"Kommentar bearbeiten",commentRemove:"Kommentar entfernen",commentPrevious:"Vorheriger Kommentar",commentNext:"Nächster Kommentar",insertImage:"Bild einfügen"},menubar:{undo:"Rückgängig machen",redo:"Wiederherstellen",paintformat:"Format kopieren/einfügen",clearformat:"Format löschen",format:"Format",font:"Schriftart",fontSize:"Schriftgrad",fontBold:"Fett",fontItalic:"Kursiv",underline:"Betonen",strike:"Streichen",textColor:"Text Farbe",fillColor:"Füllung Farbe",border:"Umrandung",merge:"Zellen verbinden",align:"Waagrechte Ausrichtung",valign:"Vertikale uitlijning",textwrap:"Textumbruch",freeze:"Zelle sperren",formula:"Funktionen",sort:"Sortieren nach",search:"Suche",more:"Mehr",commentDefault:"Bitte Text eingeben",commentEdit:"Kommentar bearbeiten",commentRemove:"Kommentar entfernen",commentPrevious:"Vorheriger Kommentar",commentNext:"Nächster Kommentar",insertImage:"Bild einfügen",fromURL:"von URL",fromLocal:"von lokalen",menuInsert:"einfügen",menuComment:"Anmerkungen",menuText:"Format",menuFont:"Schriftart",menuEdit:"Herausgeber",menuFile:"Dokumente"},contextmenu:{copy:"Kopieren",cut:"Ausschneiden",paste:"Einfügen",pasteValue:"Nur Werte einfügen",pasteFormat:"Nur Format einfügen",insertRow:"Zeile einfügen",insertColumn:"Spalte einfügen",link:"Link",removeLink:"Link entfernen",editLink:"bearbeiten Link",openLink:"Link öffnen",deleteRow:"Zeile löschen",deleteColumn:"Spalte löschen",deleteCell:"Zelle löschen",deleteCellText:"Zellentext löschen",insertURL:"Bildadresse eingeben",deleteImage:"Bild löschen"},format:{normal:"Regulär",text:"Text",number:"Nummer",percent:"Prozent",rmb:"RMB",usd:"USD",date:"Datum",time:"Termin",datetime:"Datum Termin",duration:"Dauer"},formula:{sum:"Berechnen Sie die Summe einer Reihe von Werten",average:"Berechnen Sie das arithmetische Mittel aller Parameter",max:"Berechnen Sie den Maximalwert in einer Reihe von Zahlen",min:"Berechnen Sie den kleinsten Wert in einer Reihe von Zahlen",concat:"Verbinden Sie Text oder Daten mit mehreren Zeichen in Zellen miteinander",_if:"Entsprechend dem wahren oder falschen Ergebnis der logischen Beurteilung der angegebenen Bedingung wird das durch die entsprechende Bedingung ausgelöste Berechnungsergebnis zurückgegeben",and:'Nur wenn die Ergebnisse der Parameter alle logisch "true" sind, wird logisch "true" zurückgegeben, andernfalls wird logisch "false" zurückgegeben.',or:"Nur wenn alle Parameterwerte logisch „false“ sind, wird das Ergebnis als logisch „false“ zurückgegeben, ansonsten wird es als logisch „true“ zurückgegeben"},dataSort:{ci:"Gebiet",criteria:"Ordnung",casesense:"Groß-/Kleinschreibung",sortby:"Sortiert nach",header:"Meine Daten haben Header",msg:"Bitte wählen Sie verschiedene Spalten für die Sortierung nach Feldern",msg2:"Der Auswahlbereich hat Merge-Bereiche, wir unterstützen keine Sortierung auf Merge-Bereichen",order:{asc:"aufsteigend",desc:"absteigend"}},dataSearch:{label:"Finde was",lkinlb:"Umfang der Suche",matchwhole:"Passen Sie das Ganze",lookin:{values:"Wert",formulas:"Formel",comments:"Kommentar"}},dataComment:{label:"Kommentti"}},nl:{toolbar:{undo:"Ongedaan maken",redo:"Herhalen",print:"Afdrukken",paintformat:"Tekenformaat",clearformat:"Opmaak wissen",format:"Opmaak",fontName:"Lettertypenaam",fontSize:"Lettergrootte",fontBold:"Lettertype vet",fontItalic:"Lettertype cursief",underline:"Onderstreep",strike:"Strike",color:"Tekstkleur",bgcolor:"Vulkleur",border:"Grenzen",merge:"Cellen samenvoegen",unmerge:"Cellen losmaken",align:"Horizontaal uitlijnen",valign:"Verticaal uitlijnen",textwrap:"Tekst omslaan",freeze:"Cel bevriezen",autofilter:"Filteren",formula:"Functies",more:"Meer",sort:"Sorteren",download:"Download",pagination:"Paginering",search:"Zoeken",commentDefault:"Voer tekst in",commentEdit:"Commentaar bewerken",commentRemove:"Commentaar verwijderen",commentPrevious:"Vorige opmerking",commentNext:"Volgende opmerking",insertImage:"Afbeelding invoegen"},menubar:{undo:"Ongedaan maken",redo:"Herhalen",print:"Afdrukken",paintformat:"Tekenformaat",clearformat:"Opmaak wissen",format:"Opmaak",fontName:"Lettertypenaam:",fontSize:"Lettertypegrootte:",fontBold:"Lettertype vet",fontItalic:"Lettertype cursief",underline:"Onderstreep",strike:"Strike",color:"Tekstkleur",bgcolor:"Vulkleur",border:"Grenzen",merge:"Cellen samenvoegen",unmerge:"Cellen losmaken",align:"Horizontaal uitlijnen",valign:"Verticaal uitlijnen",textwrap:"Tekst omslaan",freeze:"Cel bevriezen",autofilter:"Filteren",formula:"Functies",more:"Meer",sort:"Sorteren",download:"Download",download_HTML:"Downloaden als HTML",download_PDF:"Download als PDF",download_Original:"Origineel downloaden",download_XLSX:"Downloaden als XLSX",download_GOOGLE:"Opslaan naar Google Drive",download_DROPBOX:"Opslaan naar Dropbox",pagination:"Paginering",search:"Zoeken",commentDefault:"Voer tekst in",insertSheet:"Blad",insertRow:"Rij",insertColumn:"Kolom",link:"Koppeling",insertComment:"Commentaar",commentEdit:"Commentaar bewerken",commentRemove:"Commentaar verwijderen",commentPrevious:"Vorige opmerking",commentNext:"Volgende opmerking",insertImage:"Afbeelding",fromURL:"Van URL",fromLocal:"Van lokaal",menuInsert:"Invoegen",menuComment:"Herziening",menuText:"Opmaak",menuFont:"Lettertype",menuEdit:"Home",menuFile:"Bestand"},contextmenu:{copy:"Kopiëren",cut:"Snijden",paste:"Plakken",pasteValue:"Alleen waarden plakken",pasteFormat:"Alleen formaat plakken",hide:"Verbergen",insertRow:"Rij invoegen",insertColumn:"Kolom invoegen",deleteSheet:"Verwijderen",deleteRow:"Rij verwijderen",deleteColumn:"Kolom verwijderen",deleteCell:"Cel verwijderen",deleteCellText:"Celtekst verwijderen",validation:"Gegevensvalidaties",sort:"Sorteren",link:"Koppeling",removeLink:"Koppeling verwijderen",editLink:"Koppeling bewerken",openLink:"Koppeling openen",download:"Download",cellprintable:"Exporteren inschakelen",cellnonprintable:"Exporteren uitschakelen",celleditable:"Bewerken inschakelen",cellnoneditable:"Bewerken uitschakelen",insertURL:"Voer het afbeeldingsadres in",deleteImage:"Afbeelding verwijderen",copyImage:"Afbeelding kopiëren",pasteImage:"Afbeelding plakken",merge:"Samenvoegen",unmerge:"Ontsamenvoegen",edit:"Bewerken",clear:"Clear"},link:{emailAddress:"E-mailadres",emailSubject:"Onderwerp",sheetPage:"Documentplaats",sheetCell:"Celverwijzing",linkTypes:{web:"Webpagina",sheet:"Dit document",email:"E-mailadres"},webUrl:"Adres",linkType:"Link naar"},download:{fileName:"Bestandsnaam",saveType:"Opslaan als",saveTypes:{Original:"Origineel",XLSX:"XLSX",PDF:"PDF",HTML:"HTML"}},print:{size:"Papierformaat",orientation:"Pagina-oriëntatie",orientations:['Landschap", "Portret']},format:{normal:"Normaal",text:"Gewone tekst",number:"Aantal",percent:"Percentage",rmb:"RMB",usd:"USD",eur:"EUR",date:"Datum",time:"Tijd",datetime:"Datum tijd",duration:"Duur"},formula:{sum:"Bereken de som van een reeks waarden",average:"Bereken het rekenkundig gemiddelde van alle parameters",max:"Bereken de maximale waarde in een reeks getallen",min:"Bereken de kleinste waarde in een reeks getallen",_if:"Volgens het ware of valse resultaat van de logische beoordeling van de gespecificeerde voorwaarde, wordt het berekeningsresultaat veroorzaakt door de overeenkomstige voorwaarde geretourneerd",and:'Alleen wanneer de resultaten van de parameters logisch "true" zijn, geeft het logisch "true" terug, anders geeft het logisch "false" terug.',or:'Alleen wanneer alle parameterwaarden logisch "false" zijn, wordt het resultaat als logisch "false" geretourneerd, anders wordt het als logisch "true" geretourneerd.',concat:"Meerdere tekentekst of gegevens in cellen met elkaar verbinden"},validation:{required:"het moet verplicht zijn",notMatch:"het komt niet overeen met de validatieregel",between:"Het is tussen {} en {}",notBetween:"Het is niet tussen {} en {}",notIn:"het staat niet in de lijst",equal:"het is gelijk aan {}",notEqual:"het is niet gelijk aan {}",lessThan:"minder dan {}",lessThanEqual:"minder dan of gelijk aan {}",greaterThan:"Het is groter dan {}",greaterThanEqual:"het groter dan of gelijk aan {}",downloadImageFail:"download afbeelding mislukt"},error:{pasteForMergedCell:"Kan dit niet doen voor samengevoegde cellen"},calendar:{weeks:["Zon","Mo","Tue","Wed","Thu","Fr","Sat"],months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"]},button:{add:"Toevoegen",del:"Verwijderen",next:"Volgende",cancel:"Annuleren",remove:"Verwijderen",save:"Opslaan",ok:"OK",previous:"Vorige",close:"Sluiten"},sort:{desc:"Sorteren Z -> A",asc:"Sorteren A -> Z"},filter:{empty:"leeg"},dataValidation:{mode:"Mode",range:"Celbereik",criteria:"Criteria",modeType:{cell:"Cel",column:"Kolom",row:"Rij"},type:{list:"Lijst",number:"Aantal",date:"Datum",phone:"Telefoon",email:"E-mail"},operator:{be:"tussen",nbe:"niet tussen",lt:"minder dan",lte:"kleiner dan of gelijk aan",gt:"groter dan",gte:"groter dan of gelijk aan",eq:"gelijk aan",neq:"niet gelijk aan"}},dataSort:{ci:"Bereik",criteria:"Orde",casesense:"Hoofdlettergevoelig",sortby:"Sorteren op",header:"Mijn gegevens hebben koppen",msg:"Selecteer verschillende kolommen om op velden te sorteren",msg2:"Het geselecteerde bereik heeft samenvoegen gebieden, we ondersteunen niet sorteren op samenvoegen gebieden",order:{asc:"ASC",desc:"DESC"}},dataSearch:{label:"Zoek wat",lkinlb:"Kijk binnen",matchwhole:"Volledige inhoud overeenkomen",lookin:{values:"Waarden",formulas:"Formules",comments:"Opmerkingen"}},dataComment:{label:"Commentaar"}},zh:{toolbar:{undo:"撤销",redo:"恢复",print:"打印",paintformat:"格式刷",clearformat:"清除格式",format:"数据格式",fontName:"字体",fontSize:"字号",fontBold:"加粗",fontItalic:"倾斜",underline:"下划线",strike:"删除线",color:"字体颜色",bgcolor:"填充颜色",border:"边框",merge:"合并单元格",align:"水平对齐",valign:"垂直对齐",textwrap:"自动换行",freeze:"冻结",download:"下载",autofilter:"自动筛选",formula:"函数",more:"更多",commentDefault:"请输入文字",commentEdit:"修改批注",commentRemove:"删除批注",commentPrevious:"上一个批注",commentNext:"下一个批注",insertImage:"插入图片"},menubar:{undo:"撤销",redo:"恢复",print:"打印",paintformat:"格式刷",clearformat:"清除格式",format:"数据格式",fontName:"字体",fontSize:"字号",fontBold:"加粗",fontItalic:"倾斜",underline:"下划线",strike:"删除线",color:"字体颜色",bgcolor:"填充颜色",border:"边框",merge:"合并单元格",align:"水平对齐",valign:"垂直对齐",textwrap:"自动换行",freeze:"冻结",sort:"排序",download:"下载",download_HTML:"下载为HTML",download_PDF:"下载为PDF",download_Original:"原格式下载",download_XLSX:"下载为XLSX",download_GOOGLE:"保存到谷歌drive",download_DROPBOX:"保存到Dropbox",search:"搜索",autofilter:"自动筛选",formula:"函数",more:"更多",commentDefault:"请输入文字",commentEdit:"修改批注",commentRemove:"删除批注",commentPrevious:"上一个批注",commentNext:"下一个批注",insertImage:"插入图片",fromURL:"来自URL",fromLocal:"来自本地",menuInsert:"插入",menuComment:"批注",menuText:"格式化",menuFont:"字体",menuEdit:"编辑",menuFile:"文件"},contextmenu:{copy:"复制",cut:"剪切",paste:"粘贴",pasteValue:"粘贴数据",pasteFormat:"粘贴格式",hide:"隐藏",download:"下载",insertRow:"插入行",insertColumn:"插入列",link:"链接",removeLink:"删除链接",editLink:"编辑链接",openLink:"打开链接",deleteSheet:"删除",deleteRow:"删除行",deleteColumn:"删除列",deleteCell:"删除",deleteCellText:"删除数据",validation:"数据验证",cellprintable:"可打印",cellnonprintable:"不可打印",celleditable:"可编辑",cellnoneditable:"不可编辑",insertURL:"输入图片地址",deleteImage:"删除图片"},download:{fileName:"文件名称",saveType:"文件另存为",saveTypes:{Original:"原格式",XLSX:"XLSX",PDF:"PDF",HTML:"HTML"}},link:{emailAddress:"电子邮箱地址",emailSubject:"主题",sheetPage:"文档位置",sheetCell:"单元格引用",linkTypes:{web:"网页",sheet:"文档",email:"电子邮箱"},webUrl:"地址",linkType:"链接到"},print:{size:"纸张大小",orientation:"方向",orientations:["横向","纵向"]},format:{normal:"正常",text:"文本",number:"数值",percent:"百分比",rmb:"人民币",usd:"美元",eur:"欧元",date:"短日期",time:"时间",datetime:"长日期",duration:"持续时间"},formula:{sum:"计算出一组数值的和",average:"计算出所有参数的算术平均值",max:"计算出一组数中的最大值",min:"计算出一组数中的最小值",concat:"将多个字符文本或单元格中的数据连接在一起",_if:"根据对指定条件的逻辑判断的真假结果,返回相对应条件触发的计算结果",and:"仅当有参数的结果均为逻辑 “真(TRUE)” 时返回逻辑 “真(TRUE)”,反之返回逻辑 “假(FALSE)",or:"仅当所有参数值均为逻辑 “假(FALSE)” 时返回结果逻辑 “假(FALSE)”,否则都返回逻辑 “真(TRUE)"},validation:{required:"此值必填",notMatch:"此值不匹配验证规则",between:"此值应在 {} 和 {} 之间",notBetween:"此值不应在 {} 和 {} 之间",notIn:"此值不在列表中",equal:"此值应该等于 {}",notEqual:"此值不应该等于 {}",lessThan:"此值应该小于 {}",lessThanEqual:"此值应该小于等于 {}",greaterThan:"此值应该大于 {}",greaterThanEqual:"此值应该大于等于 {}",downloadImageFail:"下载图片失败"},error:{pasteForMergedCell:"无法对合并的单元格执行此操作"},calendar:{weeks:["日","一","二","三","四","五","六"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},button:{next:"下一步",cancel:"取消",remove:"删除",save:"保存",ok:"确认",previous:"上一步",close:"关闭"},sort:{desc:"降序",asc:"升序"},filter:{empty:"空白"},dataValidation:{mode:"模式",range:"单元区间",criteria:"条件",modeType:{cell:"单元格",column:"列模式",row:"行模式"},type:{list:"列表",number:"数字",date:"日期",phone:"手机号",email:"电子邮件"},operator:{be:"在区间",nbe:"不在区间",lt:"小于",lte:"小于等于",gt:"大于",gte:"大于等于",eq:"等于",neq:"不等于"}},dataSort:{ci:"区域",criteria:"顺序",casesense:"区分大小写",sortby:"排序按照",header:"我的数据有标题",msg:"请选择不同的列作为排序参照",msg2:"当前选择的区域有合并区域,不支持对合并区域进行排序",order:{asc:"升序",desc:"降序"}},dataSearch:{label:"关键词",lkinlb:"查找范围",matchwhole:"匹配整个",lookin:{values:"值",formulas:"公式",comments:"注释"}},dataComment:{label:"批注"}},ru:{toolbar:{undo:"открыть",redo:"повторить",print:"печать",paintformat:"нарисовать формат",clearformat:"Очистить формат",format:"Общие положения",fontName:"название шрифта",fontSize:"размер шрифта",fontBold:"жирный шрифт",fontItalic:"курсивный шрифт",underline:"подчёркивать",strike:"забастовка",color:"цвет текста",bgcolor:"цвет заполнения",border:"граница",merge:"Объединить ячейки",unmerge:"отменить Объединение ячеек",align:"Выравнивание по горизонтали",valign:"Выравнивание по вертикали",textwrap:"перенос текста",freeze:"замораживать ячейки",autofilter:"фильтр",formula:"функция",more:"больше",sort:"классификация",download:"загрузка",pagination:"номер страницы",search:"поиск",commentDefault:"Введите текст",commentEdit:"редактировать комментарий",commentRemove:"Удалить комментарий",commentPrevious:"предыдущий комментарий",commentNext:"следующий комментарий",insertImage:"Вставить изображение"},menubar:{undo:"открыть",redo:"повторить",print:"печать",paintformat:"нарисовать формат",clearformat:"Очистить формат",format:"Общие положения",fontName:"имя шрифта:",fontSize:"размер шрифта:",fontBold:"жирный шрифт",fontItalic:"курсивный шрифт",underline:"подчёркивать",strike:"забастовка",color:"цвет текста",bgcolor:"цвет заполнения",border:"граница",merge:"Объединить ячейки",unmerge:"отменить Объединение ячеек",align:"Выравнивание по горизонтали",valign:"Выравнивание по вертикали",textwrap:"перенос текста",freeze:"замораживать ячейки",autofilter:"фильтр",formula:"функция",more:"больше",sort:"классификация",download:"загрузка",download_HTML:"Загрузка в HTML",download_PDF:"Загрузка в PDF",download_Original:"Загрузить оригинал",download_XLSX:"загрузка XLISX",pagination:"номер страницы",search:"поиск",commentDefault:"Введите текст",insertSheet:"простыня",insertRow:"строка",insertColumn:"столбец",link:"ссылка",insertComment:"рассуждение",commentEdit:"редактировать комментарий",commentRemove:"Удалить комментарий",commentPrevious:"предыдущий комментарий",commentNext:"следующий комментарий",insertImage:"образ",fromURL:"URL",fromLocal:"из",menuInsert:"Вставить",menuComment:"оглядываться",menuText:"Общие положения",menuFont:"шрифт",menuEdit:"жилище",menuFile:"Документация"},contextmenu:{copy:"копировать",cut:"резать",paste:"Вставить",pasteValue:"только вставить значение",pasteFormat:"только вставить формат",hide:"Скрыть",insertRow:"Вставить строки",insertColumn:"Вставить столбцы",deleteSheet:"Исключить",deleteRow:"Удалить строки",deleteColumn:"Удалить столбец",deleteCell:"Удалить ячейку",deleteCellText:"Удалить текст ячейки",validation:"проверка данных",sort:"классификация",link:"ссылка",removeLink:"Удалить ссылку",editLink:"Изменить ссылку",openLink:"Открыть ссылку",download:"загрузка",cellprintable:"Включить экспорт",cellnonprintable:"Отключить экспорт",celleditable:"Включить редактор",cellnoneditable:"Отключить правку",insertURL:"Введите адрес изображения",deleteImage:"Удалить изображение",copyImage:"Копировать изображение",pasteImage:"Вставить изображение",merge:"объединить",unmerge:"отменить объединение",edit:"редактор",clear:"Очистить"},link:{emailAddress:"адрес электронной почты",emailSubject:"тема",sheetPage:"расположение документа",sheetCell:"ссылка на ячейку",linkTypes:{web:"страница",sheet:"Настоящий документ",email:"адрес электронной почты"},webUrl:"адрес",linkType:"ссылка на"},download:{fileName:"имя файла",saveType:"Сохранить как",saveTypes:{Original:"начальный",XLSX:"XLISX",PDF:"формат PDF",HTML:"HTML"}},print:{size:"размер бумаги",orientation:"направление страницы",orientations:["продольный, поперечный"]},format:{normal:"типичный",text:"чистый текст",number:"цифра",percent:"процент",rmb:"юань",usd:"доллар",eur:"евро",date:"дата",time:"время",datetime:"дата",duration:"период"},formula:{sum:"вычислить сумму значений группы",average:"вычислить среднее арифметическое по всем параметрам",max:"вычислить максимальное значение в группе чисел",min:"вычислить минимальное значение в группе чисел",_if:"возвращает результат вычисления, срабатывающий при выполнении соответствующих условий",and:'возвращает логическое "true" только в том случае, если результат логически "true", иначе возвращается логическое "false"',or:'только когда все значения параметра логически равны "false", результат возвращается к логическому "false", иначе возвращается к логическому "true"',concat:"соединять текст или данные в ячейке"},validation:{required:"Это должно быть необходимо",notMatch:"не совпадает с правилами проверки",between:"между {и {и}",notBetween:"не между {и {и}",notIn:"Его нет в списке",equal:"равно {равно}",notEqual:"не равно {равно}",lessThan:"меньше чем {}",lessThanEqual:"меньше или равно {}",greaterThan:"Это больше",greaterThanEqual:"больше или равно {}",downloadImageFail:"Ошибка загрузки образа"},error:{pasteForMergedCell:"Не удаётся выполнить эту операцию в сводной ячейке"},calendar:{weeks:["Воскресенье","понедельник","вторник","среда","четверг","Пятница","суббота"],months:["январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь"]},button:{add:"Добавить",del:"Исключить",next:"След.",cancel:"отмена",remove:"удаление",save:"спасти",ok:"OK",previous:"предыдущий",close:"Гуань"},sort:{desc:"сортировка Z - > A",asc:"сортировка A - > Z"},filter:{empty:"пустой"},dataValidation:{mode:"режим",range:"диапазон ячеек",criteria:"стандарт",modeType:{cell:"одиночная камера",column:"столбец",row:"строка"},type:{list:"список",number:"цифра",date:"дата",phone:"телефон",email:"электронная почта"},operator:{be:"между",nbe:"не между",lt:"меньше",lte:"меньше или равно",gt:"больше чем",gte:"больше или равно",eq:"равно",neq:"не равно"}},dataSort:{ci:"Сфера применения",criteria:"порядок",casesense:"различать размер",sortby:"сортировка",header:"мои данные имеют заголовки",msg:'Выберите другую колонку для поля "база сортировки"',msg2:"Выберите диапазон, в котором будут объединены области, которые мы не поддерживаем.",order:{asc:"ASC Corporation",desc:"описание"}},dataSearch:{label:"искать что",lkinlb:"посетить",matchwhole:"согласовать всё содержимое",lookin:{values:"ценность",formulas:"формула",comments:"Замечания"}},dataComment:{label:"рассуждение"}},es:{toolbar:{undo:"Abrir",redo:"Rehacer",print:"Imprimir",paintformat:"Formato de dibujo",clearformat:"Formato claro",format:"Disposiciones generales",fontName:"Nombre de la fuente",fontSize:"Tamaño de la fuente",fontBold:"Negrita de tipo de letra",fontItalic:"Cursiva",underline:"Enfatizar",strike:"Huelga",color:"Color del texto",bgcolor:"Color de relleno",border:"Límite",merge:"Fusionar celdas",unmerge:"Unmerge Cells",align:"Alineación horizontal",valign:"Alineación vertical",textwrap:"Salto de línea de texto",freeze:"Congelar celdas",autofilter:"Filtro",formula:"Función",more:"Más",sort:"Clasificación",download:"Descargar",pagination:"Número de página",search:"Buscar",commentDefault:"Por favor, introduzca texto",commentEdit:"Editar Notas",commentRemove:"Eliminar comentarios",commentPrevious:"Comentario anterior",commentNext:"Siguiente comentario",insertImage:"Insertar imagen"},menubar:{undo:"Abrir",redo:"Rehacer",print:"Imprimir",paintformat:"Formato de dibujo",clearformat:"Formato claro",format:"Disposiciones generales",fontName:"Nombre de la Fuente:",fontSize:"Tamaño de la Fuente:",fontBold:"Negrita de tipo de letra",fontItalic:"Cursiva",underline:"Enfatizar",strike:"Huelga",color:"Color del texto",bgcolor:"Color de relleno",border:"Límite",merge:"Fusionar celdas",unmerge:"Unmerge Cells",align:"Alineación horizontal",valign:"Alineación vertical",textwrap:"Salto de línea de texto",freeze:"Congelar celdas",autofilter:"Filtro",formula:"Función",more:"Más",sort:"Clasificación",download:"Descargar",download_HTML:"Descargar como HTML",download_PDF:"Descargar como PDF",download_Original:"Descargar el original",download_XLSX:"Descargar como xlsx",download_GOOGLE:"Guardar en Google Drive",download_DROPBOX:"Guardar en Dropbox",pagination:"Número de página",search:"Buscar",commentDefault:"Por favor, introduzca texto",insertSheet:"Sábanas",insertRow:"Una línea",insertColumn:"Columna",link:"Enlace",insertComment:"Comentario",commentEdit:"Editar Notas",commentRemove:"Eliminar comentarios",commentPrevious:"Comentario anterior",commentNext:"Siguiente comentario",insertImage:"Imagen",fromURL:"De URL",fromLocal:"Local",menuInsert:"Insertar",menuComment:"Examen",menuText:"Disposiciones generales",menuFont:"Tipo de letra",menuEdit:"Hogar",menuFile:"Documentación"},contextmenu:{copy:"Copiar",cut:"Cortar",paste:"Pegar",pasteValue:"Pegar sólo valores",pasteFormat:"Pegar sólo formato",hide:"Ocultar",insertRow:"Insertar fila",insertColumn:"Insertar columna",deleteSheet:"Tachar",deleteRow:"Eliminar fila",deleteColumn:"Eliminar columnas",deleteCell:"Eliminar celdas",deleteCellText:"Borrar texto de celda",validation:"Validación de datos",sort:"Clasificación",link:"Enlace",removeLink:"Eliminar enlace",editLink:"Editar enlace",openLink:"Abrir enlace",download:"Descargar",cellprintable:"Activar exportación",cellnonprintable:"Desactivar exportación",celleditable:"Habilitar edición",cellnoneditable:"Desactivar edición",insertURL:"Introduzca la dirección de la imagen",deleteImage:"Borrar imagen",copyImage:"Copiar imagen",pasteImage:"Pegar imagen",merge:"Fusión",unmerge:"Cancelar fusión",edit:"Editar",clear:"Claro"},link:{emailAddress:"Dirección de correo electrónico",emailSubject:"Tema",sheetPage:"Ubicación del documento",sheetCell:"Referencia de celda",linkTypes:{web:"Página web",sheet:"Este documento",email:"Dirección de correo electrónico"},webUrl:"Dirección",linkType:"Enlace a"},download:{fileName:"Nombre del archivo",saveType:"Guardar como",saveTypes:{Original:"Original",XLSX:"Xlsx",PDF:"PDF",HTML:"Html"}},print:{size:"Tamaño del papel",orientation:"Orientación de la página",orientations:['Transversal "," longitudinal']},format:{normal:"Típico",text:"Texto plano",number:"Número",percent:"Porcentaje",rmb:"RMB Yuan",usd:"Dólar estadounidense",eur:"Euro",date:"Fecha",time:"Tiempo",datetime:"Fecha y hora",duration:"Período"},formula:{sum:"Calcular la suma de un conjunto de valores",average:"Calcular la media aritmética de todos los parámetros",max:"Calcular el valor máximo de un conjunto de números",min:"Calcular el valor mínimo de un conjunto de números",_if:"Devuelve el resultado del cálculo desencadenado por la condición correspondiente de acuerdo con el juicio lógico de la condición especificada.",and:'Devuelve la lógica "true" sólo cuando el resultado de todos los parámetros es "true" lógico, de lo contrario devuelve la lógica "False".',or:'El resultado sólo se devuelve como "falso" lógico cuando todos los valores de los parámetros son lógicamente "falso", de lo contrario se devuelve como "verdadero" lógico.',concat:"Unir texto o datos de múltiples caracteres en una celda"},validation:{required:"Debe ser necesario",notMatch:"No coincide con las reglas de validación",between:"Está entre {} y {}",notBetween:"No está entre {} y {}",notIn:"No está en la lista",equal:"Igual a {}",notEqual:"No es igual a {}",lessThan:"Menos de {}",lessThanEqual:"Es menor o igual a {}",greaterThan:"Es mayor que {}",greaterThanEqual:"Es mayor o igual a {}",downloadImageFail:"Falló la descarga de la imagen"},error:{pasteForMergedCell:"No se puede hacer esto en celdas fusionadas"},calendar:{weeks:["Domingo","lunes","martes","miércoles","jueves","viernes","sábado"],months:["Enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},button:{add:"Añadir",del:"Tachar",next:"Siguiente",cancel:"Cancelar",remove:"Eliminación",save:"Salvación",ok:"Muy bien.",previous:"Anterior",close:"Cerrar"},sort:{desc:"Ordenar z - > a",asc:"Ordenar a - > Z"},filter:{empty:"Vacío"},dataValidation:{mode:"Patrón",range:"Rango de celdas",criteria:"Normas",modeType:{cell:"Celda individual",column:"Columna",row:"Una línea"},type:{list:"Lista",number:"Número",date:"Fecha",phone:"Teléfono",email:"Correo electrónico"},operator:{be:"Entre",nbe:"No entre los dos",lt:"Menos",lte:"Inferior o igual a",gt:"Mayor que",gte:"Mayor o igual a",eq:"Igual a",neq:"No es igual a"}},dataSort:{ci:"Ámbito de aplicación",criteria:"Orden",casesense:"Sensible a mayúsculas",sortby:"Ordenar por",header:"Mis datos tienen un título",msg:"Seleccione una column a diferente para el campo ordenar por",msg2:"Los rangos de selección tienen regiones fusionadas, no soportamos ordenar en regiones fusionadas",order:{asc:"ASC",desc:"Descripción"}},dataSearch:{label:"Encontrar qué",lkinlb:"Visita",matchwhole:"Coincide con todo el contenido",lookin:{values:"Valores",formulas:"Fórmula",comments:"Comentario"}},dataComment:{label:"Comentario"}},pt:{toolbar:{undo:"Desfazer",redo:"Refazer",print:"Imprimir",paintformat:"Formato da pintura",clearformat:"Limpar o formato",format:"Formato",fontName:"Nome do Tipo de Letra",fontSize:"Tamanho do tipo de letra",fontBold:"Tipo de letra negrito",fontItalic:"Tipo de letra itálico",underline:"Sublinhado",strike:"Strike",color:"Cor do texto",bgcolor:"Cor do preenchimento",border:"Bordas",merge:"Juntar as células",unmerge:"Desmesclar as células",align:"Alinhamento horizontal",valign:"Alinhamento vertical",textwrap:"Envolvimento do texto",freeze:"Célula congelada",autofilter:"Filtro",formula:"Funções",more:"Mais",sort:"Ordenar",download:"Transferir",pagination:"Paginação",search:"Procurar",commentDefault:"Indique por favor o texto",commentEdit:"Editar comentário",commentRemove:"Remover comentário",commentPrevious:"Comentário anterior",commentNext:"Próximo comentário",insertImage:"Inserir imagem"},menubar:{undo:"Desfazer",redo:"Refazer",print:"Imprimir",paintformat:"Formato da pintura",clearformat:"Limpar o formato",format:"Formato",fontName:"Nome do tipo de letra:",fontSize:"Tamanho do tipo de letra:",fontBold:"Tipo de letra negrito",fontItalic:"Tipo de letra itálico",underline:"Sublinhado",strike:"Strike",color:"Cor do texto",bgcolor:"Cor do preenchimento",border:"Bordas",merge:"Juntar as células",unmerge:"Desmesclar as células",align:"Alinhamento horizontal",valign:"Alinhamento vertical",textwrap:"Envolvimento do texto",freeze:"Célula congelada",autofilter:"Filtro",formula:"Funções",more:"Mais",sort:"Ordenar",download:"Transferir",download_HTML:"Transferir Como HTML",download_PDF:"Transferir Como PDF",download_Original:"Obter Original",download_XLSX:"Obter Como XLSX",download_GOOGLE:"Gravar para Google Drive",download_DROPBOX:"Gravar para Dropbox",pagination:"Paginação",search:"Procurar",commentDefault:"Indique por favor o texto",insertSheet:"Folha",insertRow:"Linha",insertColumn:"Coluna",link:"Ligação",insertComment:"Comentário",commentEdit:"Editar comentário",commentRemove:"Remover comentário",commentPrevious:"Comentário anterior",commentNext:"Próximo comentário",insertImage:"Imagem",fromURL:"Do URL",fromLocal:"Do Local",menuInsert:"Inserir",menuComment:"Revisão",menuText:"Formato",menuFont:"Tipo de Letra",menuEdit:"Casa",menuFile:"Ficheiro"},contextmenu:{copy:"Copiar",cut:"Cortar",paste:"Colar",pasteValue:"Colar apenas valores",pasteFormat:"Colar apenas o formato",hide:"Esconder",insertRow:"Inserir linha",insertColumn:"Inserir coluna",deleteSheet:"Apagar",deleteRow:"Apagar a linha",deleteColumn:"Apagar a coluna",deleteCell:"Apagar a célula",deleteCellText:"Apagar o texto da célula",validation:"Validações dos dados",sort:"Ordenar",link:"Ligação",removeLink:"Remover a Ligação",editLink:"Editar a Ligação",openLink:"Abrir Ligação",download:"Transferir",cellprintable:"Activar a exportação",cellnonprintable:"Desactivar a exportação",celleditable:"Activar a edição",cellnoneditable:"Desactivar a edição",insertURL:"Indique o endereço da imagem",deleteImage:"Apagar a imagem",copyImage:"Copiar a imagem",pasteImage:"Colar a imagem",merge:"Juntar",unmerge:"Desmesclar",edit:"Editar",clear:"Limpar"},link:{emailAddress:"Endereço de E- mail",emailSubject:"Assunto",sheetPage:"Local do Documento",sheetCell:"Referência da Célula",linkTypes:{web:"Página Web",sheet:"Este Documento",email:"Endereço de E- mail"},webUrl:"Endereço",linkType:"Ligar para"},download:{fileName:"Nome do Ficheiro",saveType:"Gravar Como",saveTypes:{Original:"Original",XLSX:"XLSX",PDF:"PDF",HTML:"HTML"}},print:{size:"Tamanho do papel",orientation:"Orientação da página",orientations:['Paisagem", "Retrato']},format:{normal:"Normal",text:"Texto Simples",number:"Número",percent:"Percentagem",rmb:"RMB",usd:"USD",eur:"EUR",date:"Data",time:"Tempo",datetime:"Data e hora",duration:"Duração"},formula:{sum:"Calcular a soma de um conjunto de valores",average:"Calcular a média aritmética de todos os parâmetros",max:"Calcular o valor máximo em um conjunto de números",min:"Calcular o menor valor em um conjunto de números",_if:"De acordo com o resultado verdadeiro ou falso do julgamento lógico da condição especificada, o resultado do cálculo desencadeado pela condição correspondente é retornado",and:'Somente quando os resultados dos parâmetros são todos lógicos "true", retorna lógico "true", caso contrário retorna lógico "false"',or:'Somente quando todos os valores dos parâmetros são logicamente "false", o resultado é retornado como lógico "false", caso contrário é retornado como lógico "true"',concat:"Conecte texto de vários caracteres ou dados em células juntos"},validation:{required:"deve ser exigido",notMatch:"não corresponde à sua regra de validação",between:"é entre {} e {}",notBetween:"não é entre {} e {}",notIn:"não está na lista",equal:"é igual a {}",notEqual:"não é igual a {}",lessThan:"menos que {}",lessThanEqual:"menor ou igual a {}",greaterThan:"maior que {}",greaterThanEqual:"maior ou igual a {}",downloadImageFail:"falha na transferência da imagem"},error:{pasteForMergedCell:"Não é possível fazer isto para células fundidas"},calendar:{weeks:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"]},button:{add:"Adicionar",del:"Apagar",next:"Próximo",cancel:"Cancelar",remove:"Remover",save:"Gravar",ok:"OK",previous:"Anterior",close:"Fechar"},sort:{desc:"Ordenar Z -> A",asc:"Ordenar A -> Z"},filter:{empty:"vazio"},dataValidation:{mode:"Modo",range:"Intervalo de Células",criteria:"Critérios",modeType:{cell:"Célula",column:"Coluna",row:"Linha"},type:{list:"Lista",number:"Número",date:"Data",phone:"Telefone",email:"E- mail"},operator:{be:"entre",nbe:"não entre",lt:"menos de",lte:"inferior ou igual a",gt:"maior que",gte:"maior ou igual a",eq:"igual a",neq:"não igual a"}},dataSort:{ci:"Intervalo",criteria:"Ordem",casesense:"Sensível à maiúscula",sortby:"Ordenar por",header:"Os meus dados têm cabeçalhos",msg:"Seleccione por favor colunas diferentes para ordenar por campos",msg2:"O intervalo de seleção tem áreas de mesclagem, não suportamos classificação em áreas de mesclagem",order:{asc:"ASC",desc:"DESC"}},dataSearch:{label:"Encontrar o quê",lkinlb:"Olhe para dentro",matchwhole:"Corresponder ao conteúdo inteiro",lookin:{values:"Valores",formulas:"Fórmulas",comments:"Observações"}},dataComment:{label:"Comentário"}}};function N(t,e){if(e){var i,n=L(z);try{for(n.s();!(i=n.n()).done;){var r=i.value;if(!e[r])break;for(var o=e[r],a=t.match(/(?:\\.|[^.])+/g),s=0;s<a.length;s+=1){var l=o[a[s]];if(!l)break;if(s===a.length-1)return l;o=l}}}catch(t){n.e(t)}finally{n.f()}}}function W(t){var e=N(t,H);return!e&&window&&window.x_spreadsheet&&window.x_spreadsheet.$messages&&(e=N(t,window.x_spreadsheet.$messages)),e||""}function U(t){return function(){return W(t)}}function X(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];i?z=[t]:z.unshift(t),e&&(H[t]=e)}function Y(t){H[t]||(t="en"),z[0]=t}var V={phone:/^[1-9]\d{10}$/,email:/^(\w)+(\.\w+)*@(\w)+((\.\w+)+)$/};function G(t,e){var i="";if(!t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];i=W.apply(void 0,["validation.".concat(e)].concat(r))}return[t,i]}var q=function(){function t(e,i,n,r){l()(this,t),this.required=i,this.value=n,this.type=e,this.operator=r,this.message=""}return a()(t,[{key:"parseValue",value:function(t){var e=this.type;return"date"===e?new Date(t):"number"===e?Number(t):t}},{key:"equals",value:function(t){var e=this.type===t.type&&this.required===t.required&&this.operator===t.operator;return e&&(e=Array.isArray(this.value)?F.arrayEquals(this.value,t.value):this.value===t.value),e}},{key:"values",value:function(){return this.value.split(",")}},{key:"validate",value:function(t){var e=this.required,i=this.operator,n=this.value,o=this.type;if(e&&/^\s*$/.test(t))return G(!1,"required");if(/^\s*$/.test(t))return[!0];if(V[o]&&!V[o].test(t))return G(!1,"notMatch");if("list"===o)return G(this.values().includes(t),"notIn");if(i){var a=this.parseValue(t);if("be"===i){var s=r()(n,2),l=s[0],c=s[1];return G(a>=this.parseValue(l)&&a<=this.parseValue(c),"between",l,c)}if("nbe"===i){var h=r()(n,2),u=h[0],f=h[1];return G(a<this.parseValue(u)||a>this.parseValue(f),"notBetween",u,f)}if("eq"===i)return G(a===this.parseValue(n),"equal",n);if("neq"===i)return G(a!==this.parseValue(n),"notEqual",n);if("lt"===i)return G(a<this.parseValue(n),"lessThan",n);if("lte"===i)return G(a<=this.parseValue(n),"lessThanEqual",n);if("gt"===i)return G(a>this.parseValue(n),"greaterThan",n);if("gte"===i)return G(a>=this.parseValue(n),"greaterThanEqual",n)}return[!0]}}]),t}(),K=function(){function t(e,i,n){l()(this,t),this.refs=i,this.mode=e,this.validator=n}return a()(t,[{key:"includes",value:function(t,e){for(var i=this.refs,n=0;n<i.length;n+=1){if(x.valueOf(i[n]).includes(t,e))return!0}return!1}},{key:"addRef",value:function(t){this.remove(x.valueOf(t)),this.refs.push(t)}},{key:"remove",value:function(t){var e=[];this.refs.forEach((function(i){var n=x.valueOf(i);n.intersects(t)?n.difference(t).forEach((function(t){return e.push(t.toString())})):e.push(i)})),this.refs=e}},{key:"getData",value:function(){var t=this.refs,e=this.mode,i=this.validator;return{refs:t,mode:e,type:i.type,required:i.required,operator:i.operator,value:i.value}}}],[{key:"valueOf",value:function(e){var i=e.refs,n=e.mode,r=e.type,o=e.required,a=e.operator,s=e.value;return new t(n,i,new q(r,o,s,a))}}]),t}(),Z=function(){function t(){l()(this,t),this._=[],this.errors=new Map}return a()(t,[{key:"getError",value:function(t,e){return this.errors.get("".concat(t,"_").concat(e))}},{key:"validate",value:function(t,e,i){var n=this.get(t,e),o="".concat(t,"_").concat(e),a=this.errors;if(null!==n){var s=n.validator.validate(i),l=r()(s,2),c=l[0],h=l[1];c?a.delete(o):a.set(o,h)}else a.delete(o);return!0}},{key:"add",value:function(t,e,i){var n=i.type,r=i.required,o=i.value,a=i.operator,s=new q(n,r,o,a),l=this.getByValidator(s);null!==l?l.addRef(e):this._.push(new K(t,[e],s))}},{key:"getByValidator",value:function(t){for(var e=0;e<this._.length;e+=1){var i=this._[e];if(i.validator.equals(t))return i}return null}},{key:"get",value:function(t,e){for(var i=0;i<this._.length;i+=1){var n=this._[i];if(n.includes(t,e))return n}return null}},{key:"remove",value:function(t){var e="".concat(t.sri,"_").concat(t.sci);this.errors.has(e)&&this.errors.delete(e),this.each((function(e){e.remove(t)}))}},{key:"each",value:function(t){this._.forEach((function(e){return t(e)}))}},{key:"getData",value:function(){return this._.filter((function(t){return t.refs.length>0})).map((function(t){return t.getData()}))}},{key:"setData",value:function(t){this._=t.map((function(t){return K.valueOf(t)}))}}]),t}(),J=function t(){l()(this,t),this.keywords="",this.current=1,this.result=[]},Q=i(3),tt=i.n(Q),et=i(4),it=i.n(et),nt=i(1),rt=i.n(nt),ot="x-spreadsheet";window.devicePixelRatio;function at(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var st=function(t){tt()(i,t);var e=at(i);function i(t){var n;return l()(this,i),(n=e.call(this,"div","".concat(ot,"-icon"))).iconNameEl=f("div","".concat(ot,"-icon-img ").concat(t)),n.child(n.iconNameEl),n}return a()(i,[{key:"setName",value:function(t){this.iconNameEl.className("".concat(ot,"-icon-img ").concat(t))}}]),i}(u);function lt(t,e,i){var n=f("div","".concat(ot,"-toast")),r=f("div","".concat(ot,"-dimmer active"));n.children(f("div","".concat(ot,"-toast-header")).children(new st("close").on("click.stop",(function(){return document.body.removeChild(n.el),document.body.removeChild(r.el),void(i&&i())})),t),f("div","".concat(ot,"-toast-content")).html(e)),document.body.appendChild(n.el),document.body.appendChild(r.el);var o=n.box(),a=o.width,s=o.height,l=document.documentElement,c=l.clientHeight,h=l.clientWidth;n.offset({left:(h-a)/2,top:(c-s)/3})}var ct={mode:"edit",updateMode:"client",updateUrl:"",folderName:"",fileName:"",view:{height:function(){return document.documentElement.clientHeight},width:function(){return document.documentElement.clientWidth}},showToolbar:!0,showPartToolbar:!1,showContextmenu:!0,showFileName:!0,row:{len:100,height:25},col:{len:26,width:100,indexWidth:60,minWidth:60},style:{align:"left",valign:"middle",textwrap:!1,strike:!1,underline:!1,color:"#0a0a0a",font:{name:"Arial",size:10,bold:!1,italic:!1},format:"normal"}};function ht(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=this.merges,o=e.clone(),a=t.size(),s=r()(a,2),l=s[0],c=s[1],h=e.size(),u=r()(h,2),f=u[0],d=u[1];return l>f&&(o.eri=e.sri+l-1),c>d&&(o.eci=e.sci+c-1),this.getRangeLocked(o)?(i("Protected worksheet,the target area contains locked cells"),!1):n.intersects(o)?(i(W("error.pasteForMergedCell")),!1):t.equals(o)?(i("The selection area is same "),!1):!t.intersects(o)||!(f>l&&Math.abs(e.sri-t.sri)%l!=0||d>c&&Math.abs(e.sci-t.sci)%c!=0)||(i("Invalid selection area"),!1)}function ut(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=this.rows,a=this.merges,s=this.name,l=o.copyPaste(t,e,i,n,(function(t,e,i){if(i&&i.merge){var n=r()(i.merge,2),o=n[0],s=n[1];if(o<=0&&s<=0)return;a.add(new x(t,e,t+o,e+s))}}));n?this.updateBatchCellsOpr(s,l,t,e,i):this.copyPasteRangeOpr(s,t,e,i)}function ft(t,e){var i=this.clipboard,n=this.rows,r=this.merges,o=this.name;n.cutPaste(t,e),r.move(t,e.sri-t.sri,e.sci-t.sci),i.clear(),this.cutPasteRangeOpr(o,t,e)}function dt(t,e,i){var n=this.styles,r=this.rows.getCellOrNew(t,e),o={};void 0!==r.style&&(o=F.cloneDeep(n[r.style])),o=F.merge(o,{border:i}),r.style=this.addStyle(o)}function vt(t){var e=this,i=t.mode,n=t.style,o=t.color,a=this.styles,s=this.selector,l=this.rows,c=s.range,h=c.sri,u=c.sci,f=c.eri,d=c.eci,v=!this.isSignleSelected();if(v||"inside"!==i&&"horizontal"!==i&&"vertical"!==i)if("outside"!==i||v){if("none"===i)s.range.each((function(t,i){var n=l.getCell(t,i);if(n&&void 0!==n.style){var r=F.cloneDeep(a[n.style]);delete r.border,n.style=e.addStyle(r)}}));else if("all"===i||"inside"===i||"outside"===i||"horizontal"===i||"vertical"===i)!function(){for(var t=[],a=h;a<=f;a+=1)for(var s=u;s<=d;s+=1){for(var c=[],g=0;g<t.length;g+=1){var p=r()(t[g],4),m=p[0],y=p[1],b=p[2],w=p[3];if(a===m+b+1&&c.push(g),m<=a&&a<=m+b&&s===y){s+=w+1;break}}if(c.forEach((function(e){return t.splice(e,1)})),s>d)break;var x=l.getCell(a,s),C=0,k=0;if(x&&x.merge){var _=r()(x.merge,2);C=_[0],k=_[1],t.push([a,s,C,k])}var S=C>0&&a+C===f,T=k>0&&s+k===d,O={};"all"===i?O={bottom:[n,o],top:[n,o],left:[n,o],right:[n,o]}:"inside"===i?(!T&&s<d&&(O.right=[n,o]),!S&&a<f&&(O.bottom=[n,o])):"horizontal"===i?!S&&a<f&&(O.bottom=[n,o]):"vertical"===i?!T&&s<d&&(O.right=[n,o]):"outside"===i&&v&&(h===a&&(O.top=[n,o]),(S||f===a)&&(O.bottom=[n,o]),u===s&&(O.left=[n,o]),(T||d===s)&&(O.right=[n,o])),Object.keys(O).length>0&&dt.call(e,a,s,O),s+=k}}();else if("top"===i||"bottom"===i)for(var g=u;g<=d;g+=1)"top"===i&&(dt.call(this,h,g,{top:[n,o]}),g+=l.getCellMerge(h,g)[1]),"bottom"===i&&(dt.call(this,f,g,{bottom:[n,o]}),g+=l.getCellMerge(f,g)[1]);else if("left"===i||"right"===i)for(var p=h;p<=f;p+=1)"left"===i&&(dt.call(this,p,u,{left:[n,o]}),p+=l.getCellMerge(p,u)[0]),"right"===i&&(dt.call(this,p,d,{right:[n,o]}),p+=l.getCellMerge(p,d)[0])}else dt.call(this,h,u,{top:[n,o],bottom:[n,o],left:[n,o],right:[n,o]})}function gt(t,e){var i=this.rows,n=this.scroll,r=this.freezeTotalHeight(),o=this.settings.row.height,a=this.exceptRowSet;0===n.riact&&this.freeze[0]>0&&(n.riact=this.freeze[0]);var s=o+r,l=t>s?n.riact:0;0===l&&(s=o);for(var c=0;l<i.len&&!(s>t);l+=1)a.has(l)||(s+=c=i.getHeight(l));return{ri:l-1,top:s-=c,height:c}}function pt(t,e){var i=this.cols,n=this.displayRight2Left,o=this.freezeTotalWidth(),a=i.indexWidth;if(n){var s=this.viewWidth();o+i.indexWidth<s-t&&(a-=e);var l=F.rangeReduceIf(0,i.len,a,i.indexWidth,s-t,(function(t){return i.getWidth(t)})),c=r()(l,3),h=c[0],u=c[1],f=c[2];return u<=0?{ci:-1,left:s,width:i.indexWidth}:{ci:h-1,left:s-u,width:f}}o+i.indexWidth<t&&(a-=e);var d=F.rangeReduceIf(0,i.len,a,i.indexWidth,t,(function(t){return i.getWidth(t)})),v=r()(d,3),g=v[0],p=v[1],m=v[2];return p<=0?{ci:-1,left:0,width:i.indexWidth}:{ci:g-1,left:p,width:m}}var mt=function(){function t(e,i){l()(this,t),this.settings=F.merge(ct,i||{}),this.name=e||"sheet",this.freeze=[0,0],this.styles=[],this.merges=new A,this.rows=new M(this.settings.row),this.cols=new j(this.settings.col),this.validations=new Z,this.hyperlinks=[],this.comments=[],this.viewRangeCache={},this.highlighttxts=[],this.highlightrg=[],this.highlighshapes=[],this.highlighimgs=[],this.highlightIR=null,this.highlightall=!1,this.showhighlight=!1,this.highlightstyle=null,this.selector=new k,this.scroll=new _,this.history=new S,this.updateRows=new Set,this.updateCols=new Set,this.updateRowsHeight=new Set,this.clipboard=new T,this.autoFilter=new R,this.TableAutoFilters=[],this.menubarStatus=function(){},this.change=function(){},this.updateCellsData=function(){},this.updateCellServer=function(){},this.updateServerError=function(){},this.updateCellError=function(){},this.loadImages=function(){},this.loadShapes=function(){},this.fillImageSrc=function(){},this.fillImageOnebyOne=function(){},this.loadConditionImage=function(){},this.reloadImagesShapes=function(){},this.scrollImagesShapes=function(){},this.exceptRowSet=new Set,this.sortedRowMap=new Map,this.unsortedRowMap=new Map,this.isupdating=!1,this.search=new J,this.showGrid=!0,this.zoomlevel=1,this.isImageOk=!1}return a()(t,[{key:"addValidation",value:function(t,e,i){var n=this;this.changeData((function(){n.validations.add(t,e,i)}))}},{key:"removeValidation",value:function(){var t=this,e=this.selector.range;this.changeData((function(){t.validations.remove(e)}))}},{key:"getHighlightCellTxt",value:function(t,e){var i=this;return this.showhighlight&&!this.highlightall?this.highlighttxts.reduce((function(n,r){return r.row===t&&r.col===e&&(r.color=i.highlightstyle.color,n.push(r)),n}),[]):[]}},{key:"getSelectedValidator",value:function(){var t=this.selector,e=t.ri,i=t.ci,n=this.validations.get(e,i);return n?n.validator:null}},{key:"getSelectedValidation",value:function(){var t=this.selector,e=t.ri,i=t.ci,n=t.range,r=this.validations.get(e,i),o={ref:n.toString()};return null!==r&&(o.mode=r.mode,o.validator=r.validator),o}},{key:"getSelectedSort",value:function(){var t=this.selector,e=t.ci,i=t.range,n={ref:i.toString(),ci:[0,1,2]},r=this.merges;n.sort=[];for(var o=[],a=i.sri,s=i.eri,l=i.sci,c=i.eci,h=0;h<r._.length;h+=1){var u=r._[h];if(u.sri>=a&&u.eri<=s&&u.sci>=l&&u.eci<=c)return lt("error","".concat(W("dataSort.msg2"))),null}for(var f=a+1;f<=s;f+=1){var d=this.getCell(f,e);null===d||/^\s*$/.test(d.text)||o.push(d.text)}n.m=o;for(var v=new Map,g=new Map,m=0,y=l;y<=c;y++,m++){var b=this.getCell(a,y),w="";w=null===b||/^\s*$/.test(b.text)?"(Column "+p(y)+")":b.text,v.set(m,w),g.set(m,"(Column "+p(y)+")")}return n.mcols=v,n.mcolsheader=g,n}},{key:"canUndo",value:function(){return this.history.canUndo()}},{key:"canRedo",value:function(){return this.history.canRedo()}},{key:"undo",value:function(){var t=this;this.history.undo((function(e){return t.getRangeData(e.range)}),(function(e){t.setRangeData(e)}))}},{key:"redo",value:function(){var t=this;this.history.redo((function(e){return t.getRangeData(e.range)}),(function(e){t.setRangeData(e)}))}},{key:"copy",value:function(){this.clipboard.copy(this.selector.range,this.rows)}},{key:"cut",value:function(){this.clipboard.cut(this.selector.range)}},{key:"paste",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=this.clipboard,r=this.selector;return!n.isClear()&&(!!ht.call(this,n.range,r.range,i)&&(this.changeData((function(){var i=r.range.extendRange(n.range);r.range.setToOther(i),n.isCopy()?ut.call(t,n.range,i,e):n.isCut()&&ft.call(t,n.range,i)})),!0))}},{key:"pasteFromText",value:function(t){var e=this,i=this.name,n=t.split("\r\n").map((function(t){return t.replace(/"/g,"").split("\t")}));if(n.length>0&&""==n[n.length-1]&&(n.length-=1),n.length>=1){var r=this.rows,o=this.selector;this.changeData((function(){var t=r.paste(n,o.range);e.updateBatchCellsOpr(i,t)}))}}},{key:"autofill",value:function(t,e){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=this.selector.range;return-1==r.sci&&(r.sci=0),-1==r.sri&&(r.sri=0),-1==t.sci&&(t.sci=0),-1==t.sri&&(t.sri=0),!!ht.call(this,r,t,n)&&(this.changeData((function(){ut.call(i,r,t,e,!0)}),!0,t),!0)}},{key:"clearClipboard",value:function(){this.clipboard.clear()}},{key:"calSelectedRangeByEnd",value:function(t,e){var i=this.selector,n=this.rows,r=this.cols,o=this.merges,a=i.range,s=a.sri,l=a.sci,c=a.eri,h=a.eci,u=i.ri,f=i.ci,d=t,v=e;return t<0&&(d=n.len-1),e<0&&(v=r.len-1),d>u?(s=u,c=d):(s=d,c=u),v>f?(l=f,h=v):(l=v,h=f),i.range=o.union(new x(s,l,c,h)),i.range=o.union(i.range),i.range}},{key:"calSelectedRangeByStart",value:function(t,e){var i=this.selector,n=this.rows,r=this.cols,o=this.merges.getFirstIncludes(t,e);return null===o&&(o=new x(t,e,t,e),-1===t&&(o.sri=0,o.eri=n.len-1),-1===e&&(o.sci=0,o.eci=r.len-1)),i.range=o,o}},{key:"setSelectedCellAttr",value:function(t,e){var i=this;this.changeData((function(){var n=i.selector,o=i.styles,a=i.rows,s=i.name;if("merge"===t)e?i.merge():i.unmerge();else if("border"===t)vt.call(i,e);else if("formula"===t){var l=n.ri,c=n.ci,h=n.range;if(n.multiple()){var u=n.size(),f=r()(u,2),d=f[0],v=f[1],g=h.sri,p=h.sci,m=h.eri,y=h.eci;if(d>1)for(var w=p;w<=y;w+=1){a.getCellOrNew(m+1,w).text="=".concat(e,"(").concat(b(w,g),":").concat(b(w,m),")")}else if(v>1){a.getCellOrNew(l,y+1).text="=".concat(e,"(").concat(b(p,l),":").concat(b(y,l),")")}}else{a.getCellOrNew(l,c).text="=".concat(e,"()")}}else n.range.each((function(n,r){var l=a.getCellOrNew(n,r),c={};if(void 0!==l.style&&(c=F.cloneDeep(o[l.style])),"format"===t)c.format=e,"normal"===e?(delete c.number,delete c.custom):"text"===e?(c.number=49,delete c.custom):"number"===e?(c.custom="#,##0.00_",delete c.number):"percent"===e?(c.number=10,delete c.custom):"rmb"===e?(c.custom="[$¥-804]#,##0.00",delete c.number):"usd"===e?(c.custom="$#,##0.00",delete c.number):"eur"===e?(c.custom="[$€-408]#,##0.00",delete c.number):"date"===e?(c.custom="mm/dd/yyyy",delete c.number):"time"===e?(c.number=21,delete c.custom):"datetime"===e?(c.custom="mm/dd/yyyy hh:mm:ss",delete c.number):"duration"===e&&(c.custom="[h]:mm:ss",delete c.number),l.style=i.addStyle(c),i.updateCellStyleOpr(s,n,r,c);else if("font-bold"===t||"font-italic"===t||"font-name"===t||"font-size"===t){var h={};h[t.split("-")[1]]=e,c.font=Object.assign(c.font||{},h),l.style=i.addStyle(c)}else"strike"===t||"textwrap"===t||"underline"===t||"align"===t||"valign"===t||"color"===t||"bgcolor"===t||"pbgcolor"===t||"pattern"===t?(c[t]=e,l.style=i.addStyle(c),"align"===t&&delete l.isautoalign):l[t]=e}))}))}},{key:"setHyperlinkStyle",value:function(t,e,i){var n=this.rows,r=this.styles,o=n.getCellOrNew(t,e),a={};void 0!==o.style&&(a=F.cloneDeep(r[o.style])),a.underline=i,a.color=i?"#0000ff":"Black",o.style=this.addStyle(a)}},{key:"setSelectedCellText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"input",i=this.autoFilter,n=this.selector,r=this.rows,o=n.ri,a=n.ci,s=o;this.unsortedRowMap.has(o)&&(s=this.unsortedRowMap.get(o));var l=r.getCell(s,a),c=l?l.text:"";if(this.setCellText(s,a,t,e),i.active()){var h=i.getFilter(a);if(h){var u=h.value.findIndex((function(t){return t===c}));u>=0&&h.value.splice(u,1,t)}}}},{key:"getSelectedCell",value:function(){var t=this.selector,e=t.ri,i=t.ci,n=e;return this.unsortedRowMap.has(e)&&(n=this.unsortedRowMap.get(e)),this.rows.getCell(n,i)}},{key:"canSelected",value:function(t,e){if(!this.sprotected)return!0;var i=t;this.unsortedRowMap.has(t)&&(i=this.unsortedRowMap.get(t));var n=this.getCellStyle(i,e);return null==n?this.canselectlocked:!(!n.unlocked||!this.canselectunlocked)||!(n.unlocked||!this.canselectlocked)}},{key:"isfirstRowCellsContainsFormula",value:function(t){for(var e=t.sci;e<=t.eci;e+=1){var i=this.getCell(t.sri,e);if(null!=i&&void 0!==i.f)return!0}return!1}},{key:"getLocked",value:function(){var t=this.selector,e=t.ri,i=t.ci;return this.getCellLocked(e,i)}},{key:"getCellLocked",value:function(t,e){if(!this.sprotected)return!1;var i=t;this.unsortedRowMap.has(t)&&(i=this.unsortedRowMap.get(t));var n=this.getCellStyle(i,e);return!(null!=n&&n.unlocked)}},{key:"getRangeLocked",value:function(t){for(var e=t.sri;e<=t.eri;e+=1)for(var i=t.sci;i<=t.eci;i+=1)if(this.getCellLocked(e,i))return!0;return!1}},{key:"xyInSelectedRect",value:function(t,e){var i=this.getSelectedRect(),n=i.left,r=i.top,o=i.width,a=i.height,s=this.settings.row.height,l=t-this.cols.indexWidth,c=e-s;return l>n&&l<n+o&&c>r&&c<r+a}},{key:"getSelectedRectBySearch",value:function(){return this.getRect(this.selector.range)}},{key:"getSelectedRect",value:function(){var t=this.selector.range.clone();if(this.freezeIsActive()){if(t.sri>=this.freeze[0]&&t.eri<this.scroll.riact)return{left:-99999,top:-99999};t.sri>=this.freeze[0]&&t.sri<this.scroll.riact&&(t.sri=this.scroll.riact)}else{if(t.eri<this.scroll.riact)return{left:-99999,top:-99999};t.sri<this.scroll.riact&&(t.sri=this.scroll.riact)}return this.getRect(t)}},{key:"getRectForTextbox",value:function(t){var e=this.scroll,i=(this.rows,this.cols),n=(this.exceptRowSet,this.displayRight2Left),o=this.freeze,a=this.zoomlevel,s=new x(t.row,t.col,t.row,t.col),l=s.sri,c=s.sci,h=(s.eri,s.eci);if(l<0&&c<0)return{left:0,l:0,top:0,t:0,scroll:e};var u=r()(o,2)[1],f=n?t.left+i.indexWidth:t.left,d=t.top,v=t.height,g=t.width,p=n?u>0&&h>=u||0===u?f-e.x:f:f-e.x,m=this.freezeTotalHeight(),y=this.freezeTotalWidth(),b=t.top-e.y;return y>0&&y>f&&!n&&(p=f),m>0&&m>d&&(b=d),{l:f*a,t:d*a,left:p*a,top:b*a,height:v*a,width:g*a,scroll:e}}},{key:"getClipboardRect",value:function(){var t=this.clipboard;return t.isClear()?{left:-100,top:-100}:this.getRect(t.range)}},{key:"getRect",value:function(t){var e=this.scroll,i=this.rows,n=this.cols,o=this.exceptRowSet,a=this.displayRight2Left,s=this.freeze,l=this.zoomlevel,c=t.sri,h=t.sci,u=t.eri,f=t.eci;if(c<0&&h<0)return{left:0,l:0,top:0,t:0,scroll:e};var d=r()(s,2)[1],v=a?this.viewWidth()-n.indexWidth-n.sumWidth(0,f+1):n.sumWidth(0,h),g=i.sumHeight(0,c,o),p=i.sumHeight(c,u+1,o)*l,m=n.sumWidth(h,f+1)*l,y=a?d>0&&f>=d||0===d?v+e.x:v:v-e.x,b=this.freezeTotalHeight(),w=this.freezeTotalWidth(),x=i.sumHeight(e.riact,c,o)+b;return w>0&&w>v&&!a&&(y=v),b>0&&b>g&&(x=g),{l:v*l,t:g*l,left:y*l,top:x*l,height:p,width:m,scroll:e}}},{key:"getCellRectByXY",value:function(t,e){var i=this.scroll,n=this.merges,r=this.rows,o=this.cols,a=this.zoomlevel,s=gt.call(this,e,i.y),l=s.ri,c=s.top,h=s.height,u=pt.call(this,t,i.x),f=u.ci,d=u.left,v=u.width;if(-1===f&&(v=o.totalWidth()),-1===l&&(h=r.totalHeight()),l>=0||f>=0){var g=n.getFirstIncludes(l,f);if(g){l=g.sri,f=g.sci;var p=this.cellRectWithOutTransfer(l,f);d=p.left,c=p.top,v=p.width,h=p.height}}return{ri:l,ci:f,left:d*a,top:c*a,width:v*a,height:h*a}}},{key:"isSignleSelected",value:function(){var t=this.selector.range,e=t.sri,i=t.sci,n=t.eri,o=t.eci,a=this.getCell(e,i);if(a&&a.merge){var s=r()(a.merge,2),l=s[0],c=s[1];if(e+l===n&&i+c===o)return!0}return!this.selector.multiple()}},{key:"canUnmerge",value:function(){var t=this.selector.range,e=t.sri,i=t.sci,n=t.eri,o=t.eci,a=this.getCell(e,i);if(a&&a.merge){var s=r()(a.merge,2),l=s[0],c=s[1];if(e+l===n&&i+c===o)return!0}return!1}},{key:"merge",value:function(){var t=this.selector,e=this.rows;if(!this.isSignleSelected()){var i=t.size(),n=r()(i,2),o=n[0],a=n[1];if(o>1||a>1){var s=t.range,l=s.sri,c=s.sci,h=e.getCellOrNew(l,c);h.merge=[o-1,a-1],this.merges.add(t.range),this.rows.deleteCells(t.range),this.rows.setCell(l,c,h)}}}},{key:"unmerge",value:function(){var t=this.selector;if(this.isSignleSelected()){var e=t.range,i=e.sri,n=e.sci;this.rows.deleteCell(i,n,"merge"),this.merges.deleteWithin(t.range)}}},{key:"canAutofilter",value:function(){return!this.autoFilter.active()}},{key:"autofilter",value:function(){var t=this,e=this.autoFilter,i=this.selector,n=this.TableAutoFilters;if(!e.active())for(var r=0,o=n.length;r<o;r++){var a=n[r],s=x.valueOf(a.ref);if(!(s.eci<i.range.sci||i.range.eci<s.sci))return void lt("Warning","there is already table autofilter in the selected range")}this.changeData((function(){e.active()?(e.clear(),t.exceptRowSet=new Set,t.sortedRowMap=new Map,t.unsortedRowMap=new Map):e.ref=i.range.toString()}))}},{key:"autoSort",value:function(){var t=this.autoFilter,e=this.selector;this.changeData((function(){t.filters=[],t.ref=e.range.toString()}))}},{key:"sortByRowIdArray",value:function(t,e){for(var i=this.rows,n=t.sri,r=t.eri,o=t.sci,a=t.eci,s=[],l=0,c=e.length;l<c;l++){for(var h=i._[e[l]].cells,u=[],f=o;f<=a;f++)void 0!==h[f]&&u.push({id:f,v:F.cloneDeep(h[f])});s.push(u)}for(var d=0,v=n;v<=r;v++)if(e[d++]!==v){for(var g=i._[v].cells,p=o;p<=a;p++)delete g[p];for(var m=s[d-1],y=0,b=m.length;y<b;y++){var w=m[y];g[w.id]=w.v}}}},{key:"doSort",value:function(t,e,i){var n=this.name,r=this.selector.range,o=(r.sri,r.eri,r.sci,r.eci,{name:n,src:r,ci:t,order:e,isheader:i,op:"sort"});this.updateCellServer(o)}},{key:"setAutoFilter",value:function(t,e,i,n){var r=this.currentAutoFilter;void 0===r&&(r=this.autoFilter),r.addFilter(t,i,n),r.setSort(t,e),this.resetAutoFilter()}},{key:"resetAutoFilter",value:function(){var t=this,e=this.currentAutoFilter,i=this.rows,n=e;if(void 0===n&&(n=this.autoFilter),n.active()){var r=n.sort,o=n.filteredRows((function(t,e){return i.getCell(t,e)})),a=o.rset,s=o.fset,l=Array.from(s),c=Array.from(s);r&&l.sort((function(t,e){if("desc"===r.order){var n=t;t=e,e=n}var o=i.getCell(t,r.ci),a=i.getCell(e,r.ci);if(null!=o&&""===o.text&&(o=null),null!=a&&""===a.text&&(a=null),null==o&&null==a)return t-e;if(null==o)return"asc"===r.order?1:-1;if(null==a)return"asc"===r.order?-1:1;o=o.text,a=a.text;var s=isNaN(Number(o)),l=isNaN(Number(a));return s&&l?o.localeCompare(a):s&&!l?1:!s&&l?-1:Number(o)-Number(a)})),this.exceptRowSet=a,this.sortedRowMap=new Map,this.unsortedRowMap=new Map,l.forEach((function(e,i){t.sortedRowMap.set(c[i],e),t.unsortedRowMap.set(e,c[i])}))}}},{key:"deleteExceptRowHideForAutoFilter",value:function(){var t=this.exceptRowSet,e=this.rows;t.forEach((function(t){e.get(t)&&(e.get(t).hide=void 0)}))}},{key:"updateMyConditionImages",value:function(t){var e=this.conditionimg,i=(this.rows,this.styles,this);t&&t.forEach((function(t){if(e){var n=e.find((function(e){return e.row===t.row&&e.col===t.col}));n?n.image.src="data:image/png;base64,"+t.data:i.insertConditionImage(t)}}))}},{key:"createConditionImage",value:function(t,e){var i=this.displayRight2Left,n=new Image;n.src="data:image/png;base64,"+t.data;var r=this.cols.sumWidth(0,t.col),o=this.rows.sumHeight(0,t.row);if(0===t.type){n.style.zIndex=e+1;var a=this.getCellStyle(t.row,t.col);null!=a&&"bottom"===a.valign&&(o+=this.rows.getHeight(t.row)-16)}else n.style.zIndex=e,n.style.opacity=.88;if((this.rows.isHide(t.row)||this.cols.isHide(t.col)||this.exceptRowSet.has(t.row))&&(n.style.display="none"),i){var s=this.viewWidth();n.style.left=s-r+"px"}else n.style.left=r+"px";if(n.style.top=o+"px",n.style.position="absolute",void 0===t.ol){var l=parseInt(n.style.left),c=parseInt(n.style.top);t.ol=l,t.ot=c}return n}},{key:"updateConditionImageVisible",value:function(){var t=this.exceptRowSet,e=this.rows,i=this.cols;this.conditionimg&&this.conditionimg.forEach((function(n){e.isHide(n.row)||i.isHide(n.col)||t.has(n.row)?n.image.style.display="none":n.image.style.display="block"}))}},{key:"updateConditionImageDirection",value:function(){var t=this.displayRight2Left,e=this.cols,i=this.zoomlevel,n=this.viewWidth()-e.indexWidth;this.conditionimg&&this.conditionimg.forEach((function(r){r.image&&(r.image.style.left=t?(n-r.ol-e.getWidth(r.col))*i+"px":r.ol*i+"px")}))}},{key:"updateConditionImageZoom",value:function(){this.exceptRowSet,this.rows,this.cols;var t=this.zoomlevel;this.conditionimg&&this.conditionimg.forEach((function(e){if(e.ow||(e.ow=e.image.width,e.oh=e.image.height),e.image.style.left=e.ol*t+"px",e.image.style.top=e.ot*t+"px",e.ow){e.image.height;e.image.width=e.ow*t,1===e.type&&(e.image.height=e.oh*t)}}))}},{key:"updateConditionImagePositionForCol",value:function(t,e,i){var n=this.displayRight2Left,r=this.cols,o=this.zoomlevel;if(this.conditionimg){var a=this.viewWidth()-r.indexWidth;this.conditionimg.forEach((function(s){if(s.col>t)s.ol+=e,s.image.style.left=n?(a-s.ol-r.getWidth(s.col))*o+"px":s.ol*o+"px";else if(s.col===t){if(1===s.type){var l=s.image.height;s.image.width=i*o,s.ow=i,s.image.height=l}n&&(s.image.style.left=(a-s.ol-r.getWidth(s.col))*o+"px")}}))}}},{key:"updateConditionImagePositionForRow",value:function(t,e,i){var n=this.zoomlevel;this.conditionimg&&this.conditionimg.forEach((function(r){if(r.row>t)r.ot+=e,r.image.style.top=r.ot*n+"px";else if(r.row===t&&1===r.type){var o=r.image.width;r.image.height=i*n,r.oh=i,r.image.width=o}}))}},{key:"updateConditionImageForColInsert",value:function(t,e){var i=this.conditionimg,n=this.cols,r=this.displayRight2Left,o=this.zoomlevel;if(i){var a=this.viewWidth()-n.indexWidth,s=n.sumWidth(t,e+1),l=e-t+1;i.forEach((function(e){e.col>=t&&(e.ol+=s,e.image.style.left=r?(a-e.ol-n.getWidth(e.col))*o+"px":e.ol*o+"px",l&&(e.col+=l))}))}}},{key:"updateConditionImageForRowInsert",value:function(t,e){var i=this.conditionimg,n=this.rows,r=this.zoomlevel;if(i){var o=n.sumHeight(t,e+1),a=e-t+1;i.forEach((function(e){e.row>=t&&(e.ot+=o,e.image.style.top=e.ot*r+"px",a&&(e.row+=a))}))}}},{key:"updateConditionImageForRowDelete",value:function(t,e,i){var n=this.conditionimg,r=(this.rows,this.zoomlevel);if(n)for(var o=e-t+1,a=n.length-1;a>=0;a--){var s=n[a];s.row>=t&&s.row<=e?(s.image.remove(),n.splice(a,1)):s.row>e&&(s.ot+=i,s.image.style.top=s.ot*r+"px",o&&(s.row-=o))}}},{key:"updateConditionImageForColDelete",value:function(t,e,i){var n=this.conditionimg,r=this.cols,o=this.displayRight2Left,a=this.zoomlevel;if(n)for(var s=this.viewWidth()-r.indexWidth,l=n.length-1;l>=0;l--){var c=n[l];if(c.col>=t&&c.col<=e)c.image.remove(),n.splice(l,1);else if(c.col>e){c.ol+=i,c.image.style.left=o?(s-c.ol-r.getWidth(c.col))*a+"px":c.ol*a+"px";var h=e-t+1;h&&(c.col-=h)}}}},{key:"deleteCell",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",i=this.selector,n=this.name;this.changeData((function(){t.rows.deleteCells(i.range,e),"all"!==e&&"format"!==e||t.merges.deleteWithin(i.range),t.delCellOpr(n,i.range,e)}))}},{key:"insert",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.changeData((function(){var n=e.selector.range,r=n.sri,o=n.sci,a=e.rows,s=e.merges,l=e.cols,c=e.name,h=r;if("row"===t){a.insert(r,i),e.updateConditionImageForRowInsert(r,r+i-1);var u=a.getHeight(r-1);e.insertRowOpr(c,r,i,u)}else if("column"===t){a.insertColumn(o,i),h=o,l.len+=i;for(var f=l.getWidth(o-1),d=l.len,v=0;v<i;v++)l._[d-1-v]={};for(var g=d-1;g>=o;g--)l._[g].width=g>=i?l._[g-i].width:l.width;e.insertColumnOpr(c,o,i,f),e.updateConditionImageForColInsert(o,o+i-1)}s.shift(t,h,i,(function(t,e,i,n){var r=a.getCell(t,e);r.merge[0]+=i,r.merge[1]+=n}))}),!1)}},{key:"delete",value:function(t){var e=this,i=this.selector.range,n=i.sri,r=i.sci,o=i.eri,a=i.eci;n<0&&(n=0),o<n||(r<0&&(r=0),a<r||this.changeData((function(){var i=e.rows,n=e.merges,r=e.selector,o=e.cols,a=e.name,s=r.range,l=r.range,c=l.sri,h=l.sci,u=l.eri,f=l.eci,d=c,v=0;if("row"===t){if(c<0&&(c=0),u<c)return;if(confirm("sure to delete rows from "+(c+1)+" to "+(u+1))){v=u-c+1;var g=-i.sumHeight(c,u+1);i.delete(c,u),e.deleteRowOpr(a,c,u),e.updateConditionImageForRowDelete(c,u,g)}}else if("column"===t){if(h<0&&(h=0),f<h)return;if(confirm("sure to delete columns from "+(h+1)+" to "+(f+1))){var p=-o.sumWidth(h,f+1);i.deleteColumn(h,f),d=s.sci,v=f-h+1,o.len-=v;for(var m=h;m<o.len-v;m++)o._[m].width=o._[m+v].width;for(var y=o.len;y<o.len+v;y++)delete o._[y];e.deleteColumnOpr(a,h,f),e.updateConditionImageForColDelete(h,f,p)}}n.shift(t,d,-v,(function(t,e,n,r){var o=i.getCell(t,e);o.merge[0]+=n,o.merge[1]+=r,0===o.merge[0]&&0===o.merge[1]&&delete o.merge}))}),!1))}},{key:"deletelocalonly",value:function(t,e,i){var n=this;this.changeData((function(){var r=n.rows,o=n.merges;n.cols;"row"===t?r.delete(e,e+i-1):"column"===t&&r.deleteColumn(e,e+i-1),o.shift(t,e,-i,(function(t,e,i,n){var o=r.getCell(t,e);o.merge[0]+=i,o.merge[1]+=n,0===o.merge[0]&&0===o.merge[1]&&delete o.merge}))}),!1)}},{key:"updateRevertOpr",value:function(t){"insertrow"===t.op?this.deletelocalonly("row",t.ri,t.n):"insertcol"===t.op&&this.deletelocalonly("column",t.ci,t.n)}},{key:"scrollx",value:function(t,e){var i=this.scroll,n=this.freeze,o=this.cols;this.displayRight2Left&&(t=-t);var a=r()(n,2)[1],s=F.rangeReduceIf(a,o.len,0,0,t,(function(t){return o.getWidth(t)})),l=r()(s,3),c=l[0],h=l[1],u=l[2],f=h;t>0&&(f+=u),i.x!==f&&(i.ci=t>0?c:0,i.x=f,e())}},{key:"scrolly",value:function(t,e){var i=this.scroll,n=this.freeze,o=this.rows,a=this.exceptRowSet,s=r()(n,1)[0],l=F.rangeReduceIf(s,o.len,0,0,t,(function(t){return o.getHeight(t,a)})),c=r()(l,3),h=c[0],u=c[1],f=c[2],d=u;if(t>0&&(d+=f),i.y!==d){for(i.ri=t>0?h:0,i.y=d,0===i.ri&&this.freeze[0]>0&&(i.ri=this.freeze[0],i.y=0),i.yact=i.y,i.riact=i.ri;this.isInvisibleRow(i.riact);)i.yact+=o.getHeight(i.riact,a),i.riact++;e()}}},{key:"isInvisibleRow",value:function(t){var e=this.exceptRowSet;return this.rows.isHide(t)||e.has(t)}},{key:"cellRect",value:function(t,e){var i=this.rows,n=this.cols,o=this.exceptRowSet,a=this.displayRight2Left,s=this.scroll,l=i.sumHeight(0,t,o),c=i.getCell(t,e),h=n.getWidth(e),u=i.getHeight(t);if(null!==c&&c.merge){var f=r()(c.merge,2),d=f[0],v=f[1];if(d>0)for(var g=1;g<=d;g+=1)u+=i.getHeight(t+g);if(v>0)for(var p=1;p<=v;p+=1)h+=n.getWidth(e+p)}var m=a?this.viewWidth()-n.sumWidth(0,e)-h+2*s.x:n.sumWidth(0,e);if(a){var y=r()(this.freeze,2),b=(y[0],y[1]);b>0&&e<b&&(m-=2*s.x)}return{left:m,top:l,width:h,height:u,cell:c}}},{key:"cellRectWithOutTransfer",value:function(t,e){var i=this.cellRect(t,e),n=this.displayRight2Left,o=this.cols,a=this.scroll,s=this.zoomlevel,l=o.indexWidth,c=this.settings.row.height;i.top+=c;var h=r()(this.freeze,2),u=(h[0],h[1]);return n?(i.left-=l,i.left+=i.width,e>u&&(i.left-=a.x)):(i.left+=l,e>u&&(i.left-=a.x)),t>u&&(i.top-=a.y),i.left*=s,i.top*=s,i.width*=s,i.height*=s,i}},{key:"getCell",value:function(t,e){return this.rows.getCell(t,e)}},{key:"getCellTextOrDefault",value:function(t,e){var i=this.getCell(t,e);return i&&i.text?i.text:""}},{key:"isEmpty",value:function(t,e){var i=this.getCell(t,e);return!i||!i.text||0===i.text.trim().length}},{key:"getCellStyle",value:function(t,e){var i=this.getCell(t,e);return i&&void 0!==i.style?this.styles[i.style]:null}},{key:"getCellStyleOrDefault",value:function(t,e){var i=this.styles,n=this.rows,r=this.displayRight2Left,o=n.getCell(t,e),a=o&&void 0!==o.style?i[o.style]:{},s=F.merge(this.defaultStyle(),a);if(void 0!==a.bgcolor&&(s.hasbgcolor=!0),o&&void 0!==o.merge){if(0!=o.merge[1]){var l=n.getCell(t,e+o.merge[1]),c=l&&void 0!==l.style?i[l.style]:{};c.border&&void 0!==c.border.right&&(void 0===a.border&&(a.border={}),a.border.right=c.border.right)}if(0!=o.merge[0]){var h=n.getCell(t+o.merge[0],e),u=h&&void 0!==h.style?i[h.style]:{};u.border&&void 0!==u.border.bottom&&(void 0===a.border&&(a.border={}),a.border.bottom=u.border.bottom)}}if(void 0!==s.border&&r){var f=s.border.right;s.border.right=s.border.left,s.border.left=f}return s}},{key:"getSelectedCellStyle",value:function(){var t=this.selector,e=t.ri,i=t.ci;return this.getCellStyleOrDefault(e,i)}},{key:"setCellText",value:function(t,e,i,n){var r=this.rows,o=this.history,a=this.validations,s=this.settings,l=this.name;"finished"===n?("server"!==s.updateMode&&(r.setCellText(t,e,""),o.add(this.getData()),r.setCellText(t,e,i)),"server"===s.updateMode&&this.updateCellTextOpr(l,t,e,i)):r.setCellText(t,e,i),a.validate(t,e,i)}},{key:"updateTextbox",value:function(t,e){this.settings;var i=this.name;t.ischange&&(t.ischange=!1,this.updateTextboxOpr(i,t,e))}},{key:"isNumber",value:function(t){return!isNaN(parseFloat(t))&&isFinite(t)}},{key:"isDate",value:function(t){return isNaN(t)&&!isNaN(Date.parse(t))}},{key:"setCellAutoAlignment",value:function(t,e,i){var n=this.styles,r=this.rows.getCellOrNew(t,e),o={};void 0!==r.style&&(o=F.cloneDeep(n[r.style])),(r.isautoalign||void 0===o.align)&&(o.align=i,r.style=this.addStyle(o),r.isautoalign=!0)}},{key:"cutPasteRangeOpr",value:function(t,e,i){var n={name:t,src:e,dest:i,op:"cutpaste"};this.updateCellServer(n)}},{key:"copyPasteRangeOpr",value:function(t,e,i,n){var r={name:t,src:e,dest:i,op:"copypaste",what:n};this.updateCellServer(r)}},{key:"autofillRangeOpr",value:function(t,e,i,n){var r={name:t,src:e,dest:i,op:"autofill",what:n};this.updateCellServer(r)}},{key:"updateBatchCellsOpr",value:function(t,e,i,n,r){var o={name:t,cells:e,src:i,dest:n,what:r,op:"batchupdate"};this.updateCellServer(o)}},{key:"updateCellStyleOpr",value:function(t,e,i,n){var r={name:t,ri:e,ci:i,number:n.number,custom:n.custom,op:"updatestyle"};this.updateCellServer(r)}},{key:"updateCellTextOpr",value:function(t,e,i,n){var r=n.startsWith("<font style=")||n.startsWith("<Font Style=")?"updatehtml":"update",o={name:t,ri:e,ci:i,text:n,op:r};this.updateCellServer(o)}},{key:"updateTextboxOpr",value:function(t,e,i){var n={name:t,id:e.strid,text:i,w:e.width,h:e.height,op:"updateTextBox"};this.updateCellServer(n)}},{key:"delCellOpr",value:function(t,e,i){var n={name:t,range:e,what:i,op:"delcells"};this.updateCellServer(n)}},{key:"addSheetOpr",value:function(t){var e={name:t,op:"add"};this.updateCellServer(e)}},{key:"delSheetOpr",value:function(t){var e={name:t,op:"del"};this.updateCellServer(e)}},{key:"renameSheetOpr",value:function(t,e){var i={oldname:t,name:e,op:"rename"};this.updateCellServer(i)}},{key:"insertRowOpr",value:function(t,e,i,n){var r={name:t,ri:e,n:i,h:n,op:"insertrow"};this.updateCellServer(r)}},{key:"insertColumnOpr",value:function(t,e,i,n){var r={name:t,ci:e,n:i,w:n,op:"insertcol"};this.updateCellServer(r)}},{key:"deleteRowOpr",value:function(t,e,i){var n={name:t,sri:e,eri:i,op:"delrow"};this.updateCellServer(n)}},{key:"deleteColumnOpr",value:function(t,e,i){var n={name:t,sci:e,eci:i,op:"delcol"};this.updateCellServer(n)}},{key:"setAutoAlignForCell",value:function(t){t.ufv||this.isNumber(t.text)||this.isDate(t.text)?this.setCellAutoAlignment(t.ri,t.ci,"right"):this.setCellAutoAlignment(t.ri,t.ci,"left")}},{key:"updateMyCells",value:function(t){var e=this,i=this.styles,n=this.rows,r=this.search,o=this;t.forEach((function(t,r,a){var s=n.updateOneCell(t);if(t.bgcolor){var l={};void 0!==s.style&&(l=F.cloneDeep(i[s.style])),l.bgcolor=t.bgcolor,s.style=o.addStyle(l)}e.setAutoAlignForCell(t)})),"comments"!==r.lookin&&(r.result=null)}},{key:"updateShapes",value:function(t,e){var i=this.shapes;null!=i&&null!=t&&t.forEach((function(t,n,r){for(var o=0,a=i.length;o<a;o++)if(i[o].id===t.id){var s={};s.id="s_"+t.id+"_"+i[o].tick,s.name=t.id+"."+t.tick,s.it=i[o],e.push(s),$("#"+s.id).addClass("resize-image").removeAttr("src");break}}))}},{key:"updateShapeSrcToRefresh",value:function(t,e,i,n){if(n.length>0){var r=this;$.get(e+"?uid="+t+"&id="+i,(function(t){r.fillImageOnebyOne(t,n)}))}}},{key:"validateFormula",value:function(t){for(var e=0,i=0;i<t.length;i++)"("===t[i]?e++:")"===t[i]&&e--;return 0===e}},{key:"freezeIsActive",value:function(){var t=r()(this.freeze,2),e=t[0],i=t[1];return e>0||i>0}},{key:"resetScroll",value:function(){var t=this.scroll;t.riact=0,t.ri=0,t.y=0,t.yact=0,t.x=0,t.ci=0}},{key:"setFreeze",value:function(t,e){var i=this;0===t&&this.resetScroll(),this.changeData((function(){i.freeze=[t,e]}))}},{key:"freezeTotalWidth",value:function(){return this.cols.sumWidth(0,this.freeze[1])}},{key:"freezeTotalHeight",value:function(){return this.rows.sumHeight(0,this.freeze[0],this.exceptRowSet)}},{key:"setRowHeight",value:function(t,e){var i=this;this.changeData((function(){i.rows.setHeight(t,e)}))}},{key:"setColWidth",value:function(t,e){var i=this;this.changeData((function(){i.cols.setWidth(t,e)}))}},{key:"viewHeight",value:function(){var t=this.settings,e=t.view,i=t.showToolbar,n=t.showFileName,r=e.height();return r-=26,r-=41,i&&(r-=41,this.menubarStatus()&&(r-=n?80:40)),r}},{key:"viewWidth",value:function(){return this.settings.view.width()}},{key:"freezeViewRange",value:function(){var t=r()(this.freeze,2),e=t[0],i=t[1];return new x(0,0,e-1,i-1,this.freezeTotalWidth(),this.freezeTotalHeight())}},{key:"contentRange",value:function(){var t=this.rows,e=this.cols,i=t.maxCell(),n=r()(i,2),o=n[0],a=n[1],s=t.sumHeight(0,o+1),l=e.sumWidth(0,a+1);return new x(0,0,o,a,l,s)}},{key:"exceptRowTotalHeight",value:function(t,e){var i=this.exceptRowSet,n=this.rows,r=Array.from(i),o=0;return r.forEach((function(i){if(i<t||i>e){var r=n.getHeight(i);o+=r}})),o}},{key:"viewRange",value:function(){var t=this.scroll,e=this.rows,i=this.cols,n=this.freeze,o=this.exceptRowSet,a=t.ri,s=t.ci;a<=0&&(a=r()(n,1)[0]);s<=0&&(s=r()(n,2)[1]);for(var l=[this.freezeTotalWidth(),0],c=l[0],h=l[1],u=[e.len,i.len],f=u[0],d=u[1],v=a;v<e.len&&(o.has(v)||(h+=e.getHeight(v),f=v),!(h>this.viewHeight()/this.zoomlevel));v+=1);for(var g=s;g<i.len&&(d=g,!((c+=i.getWidth(g))>this.viewWidth()/this.zoomlevel));g+=1);var p=new x(a,s,f,d,c,h);return this.viewRangeCache=p,p}},{key:"eachMergesInView",value:function(t,e){this.merges.filterIntersects(t).forEach((function(t){return e(t)}))}},{key:"hideRowsOrCols",value:function(){var t=this.rows,e=this.cols,i=this.selector,n=i.size(),o=r()(n,2),a=o[0],s=o[1],l=i.range,c=l.sri,h=l.sci,u=l.eri,f=l.eci;if(a===t.len)for(var d=h;d<=f;d+=1)e.setHide(d,!0);else if(s===e.len)for(var v=c;v<=u;v+=1)t.setHide(v,!0)}},{key:"unhideRowsOrCols",value:function(t,e){this["".concat(t,"s")].unhide(e)}},{key:"rowEach",value:function(t,e,i){for(var n=0,r=this.rows,o=this.exceptRowSet,a=(v()(o),0),s=t+a;s<=e;s+=1)if(o.has(s))a+=1;else{var l=r.getHeight(s);if(l>0){if(i(s,n,l),n+=l,this.zoomlevel<1&&n>this.viewHeight()/this.zoomlevel)break;if(this.zoomlevel>=1&&n>this.viewHeight())break}}}},{key:"colEach",value:function(t,e,i){for(var n=0,r=this.cols,o=t;o<=e;o+=1){var a=r.getWidth(o);if(a>0){if(i(o,n,a),n+=a,this.zoomlevel<1&&n>this.viewWidth()/this.zoomlevel)break;if(this.zoomlevel>=1&&n>this.viewWidth())break}}}},{key:"generatePicItems",value:function(t,e,i){var n=new Array;null!=t&&t.forEach((function(t){if(null==t.src){var e={};e.id="p_"+t.id+"_"+t.tick,void 0===t.refid?e.name=t.id+"."+t.tick:e.name=t.refid+"."+t.tick,e.it=t,n.push(e)}})),null!=e&&e.forEach((function(t){if(null==t.src){var e={};e.id="s_"+t.id+"_"+t.tick,void 0===t.refid?e.name=t.id+"."+t.tick:e.name=t.refid+"."+t.tick,e.it=t,n.push(e)}})),this.loadCount=n.length,this.fillImageOnebyOne(i,n)}},{key:"defaultStyle",value:function(){return this.settings.style}},{key:"addStyle",value:function(t){for(var e=this.styles,i=0;i<e.length;i+=1){var n=e[i];if(F.equals(n,t))return i}return e.push(t),e.length-1}},{key:"changeData",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,n=void 0!==i?i:this.selector.range;if(this.history.add(this.getRangeData(n)),t(),this.change(this.getData()),e)for(var r=n.sri,o=(n.sci,n.eri),a=(n.eci,r);a<=o;a++)this.updateRows.add(a)}},{key:"setRangeData",value:function(t){this.rows.setRangeData(t.rows,t.range),this.merges.setData(t.merges)}},{key:"setData",value:function(t){var e=this;return Object.keys(t).forEach((function(i){if("merges"===i||"rows"===i||"cols"===i||"validations"===i)e[i].setData(t[i]);else if("freeze"===i){var n=y(t[i]),o=r()(n,2),a=o[0],s=o[1];e.freeze=[s,a]}else if("autofilter"===i)e.autoFilter.setData(t[i]);else if("lautofilters"===i){var l=t[i],c=e;l.forEach((function(t){var e=new R;e.setData(t),c.TableAutoFilters.push(e)}))}else void 0!==t[i]&&(e[i]=t[i])})),this}},{key:"getData",value:function(){var t=this.name,e=this.freeze,i=this.styles,n=this.merges,r=this.rows,o=this.cols,a=this.validations,s=this.autoFilter,l=this.TableAutoFilters,c={name:t,freeze:b(e[1],e[0]),styles:i,merges:n.getData(),rows:r.getData(),cols:o.getData(),validations:a.getData(),autofilter:s.getData(),TableAutoFilters:[]};return l.forEach((function(t){c.TableAutoFilters.push(t.getData())})),c}},{key:"getRangeData",value:function(t){var e=this.merges,i=this.rows;this.styles;return{rows:i.getRangeData(t),merges:e.getData(),range:t}}},{key:"getDataForSave",value:function(){var t=this.name,e=this.freeze,i=this.styles,n=this.merges,r=this.rows,o=this.cols,a=this.validations,s=this.autoFilter,l=this.settings,c=this.updateRows,h=this.updateRowsHeight,u=this.updateCols,f=this.canselectlocked,d=this.sprotected,v=this.canselectunlocked,g=this.showGrid,p=this.comments,m=this.images,y=this.shapes;return{name:t,freeze:b(e[1],e[0]),styles:i,comments:p,canselectlocked:f,sprotected:d,canselectunlocked:v,showGrid:g,merges:n.getDataForSave(),settings:l,cols:o.getDataForSave(u),rows:r.getDataForRowsSet(c),rowh:r.getHeightForSave(h),validations:a.getData(),autofilter:s.getData(),images:null!=m?m.filter((function(t){return t.changed})).map((function(t){var e={};return e.left=t.left,e.top=t.top,e.originAngle=t.originAngle,e.angle=t.angle,e.zorder=t.zorder,e.width=t.originWidth*t.scaleX,e.height=t.originHeight*t.scaleY,e.op=t.op,e.id=t.id,t.hyperlink&&(e.hyperlink=t.hyperlink),e})):[],shapes:null!=y?y.filter((function(t){return t.changed})).map((function(t){var e={};return e.left=t.left,e.top=t.top,e.originAngle=t.originAngle,e.angle=t.angle,e.zorder=t.zorder,e.width=t.originWidth*t.scaleX,e.height=t.originHeight*t.scaleY,e.op=t.op,e.id=t.id,t.hyperlink&&(e.hyperlink=t.hyperlink),e})):[]}}}]),t}(),yt=i(12),bt=i.n(yt),wt=i(7),xt=i.n(wt),Ct=i(11),kt=i.n(Ct),_t=i(13),St=i.n(_t);function Tt(t,e,i){t.addEventListener(e,i)}function Ot(t,e,i){t.removeEventListener(e,i)}function Et(t){t.xclickoutside&&(Ot(window.document.body,"click",t.xclickoutside),delete t.xclickoutside)}function Rt(t,e){t.xclickoutside=function(i){2===i.detail||t.contains(i.target)||(e?e(t):(t.hide(),Et(t)))},Tt(window.document.body,"click",t.xclickoutside)}function At(t,e,i){Tt(t,"mousemove",e),t.xEvtUp=function(n){Ot(t,"mousemove",e),Ot(t,"mouseup",t.xEvtUp),i(n)},Tt(t,"mouseup",t.xEvtUp)}var It=null;function Pt(){clearInterval(It),It=null}function Dt(t,e){(function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];It||(It=setInterval((function(){t.apply(void 0,i)}),400))})((function(){t.selectMoveDown(),t.canvas.publishEvent("object:scroll",t.data)}))}function Ft(t,e){var i="object"===("undefined"==typeof window?"undefined":St()(window))?window.navigator.userAgent:"";if(/Android/i.test(i)){var n=window.innerHeight;window.addEventListener("resize",(function(i){var r=window.innerHeight;n>r?"true"===document.activeElement.contentEditable&&e(i):t(i)}))}else/iPhone|iPod|iPad/i.test(i)&&(window.addEventListener("focusin",(function(t){e(t)})),window.addEventListener("focusout",(function(e){t(e)})))}var Mt=function(){function t(){var e=this,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;l()(this,t),this.moving=!1,this.sheet=r,this.vertical=i,this.el=f("div","".concat(ot,"-resizer ").concat(i?"vertical":"horizontal")).children(this.unhideHoverEl=f("div","".concat(ot,"-resizer-hover")).on("dblclick.stop",(function(t){return e.mousedblclickHandler(t)})).css("position","absolute").hide(),this.hoverEl=f("div","".concat(ot,"-resizer-hover")).on("mousedown.stop",(function(t){return e.mousedownHandler(t)})),this.lineEl=f("div","".concat(ot,"-resizer-line")).hide()).hide(),this.cRect=null,this.IsRight2Left=!1,this.finishedFn=null,this.minDistance=n,this.maxRowHeight=408,this.maxColWidth=254,this.unhideFn=function(){}}return a()(t,[{key:"showUnhide",value:function(t){this.unhideIndex=t,this.unhideHoverEl.show()}},{key:"hideUnhide",value:function(){this.unhideHoverEl.hide()}},{key:"show",value:function(t,e,i){var n=this.moving,r=this.vertical,o=this.hoverEl,a=this.lineEl,s=this.el,l=this.unhideHoverEl;if(!n){this.IsRight2Left=i,this.cRect=t;var c=t.left,h=t.top,u=t.width,f=t.height,d=i?c-u:c+u-5;s.offset({left:r?d:c,top:r?h:h+f-5}).show(),o.offset({width:r?5:u,height:r?f:5}),a.offset({width:r?0:e.width,height:r?e.height:0}),l.offset({left:r?5-u:c,top:r?h:5-f,width:r?5:u,height:r?f:5})}}},{key:"hide",value:function(){this.el.offset({left:0,top:0}).hide(),this.hideUnhide()}},{key:"mousedblclickHandler",value:function(){this.unhideIndex&&this.unhideFn(this.unhideIndex)}},{key:"mousedownHandler",value:function(t){var e=this,i=t,n=this.el,r=this.lineEl,o=this.cRect,a=this.vertical,s=this.minDistance,l=this.IsRight2Left,c=this.maxRowHeight,h=this.maxColWidth,u=a?o.width:o.height;u=Math.round(u),r.show(),At(window,(function(t){e.moving=!0,null!==i&&1===t.buttons&&(a?(l?u-=t.movementX:u+=t.movementX,u>s&&u<h&&(l?n.css("left","".concat(o.left-u,"px")):n.css("left","".concat(o.left+u,"px")))):(u+=t.movementY)>s&&u<c&&n.css("top","".concat(o.top+u,"px")),i=t)}),(function(){i=null,r.hide(),e.moving=!1,e.hide(),e.finishedFn&&(u<s&&(u=s),a?u>h&&(u=h):u>c&&(u=c),e.finishedFn(o,u))}))}}]),t}(),jt=function(){function t(e){var i=this;l()(this,t),this.vertical=e,this.moveFn=null,this.el=f("div","".concat(ot,"-scrollbar ").concat(e?"vertical":"horizontal")).child(this.contentEl=f("div","")).on("mousemove.stop",(function(){})).on("scroll.stop",(function(t){var e=t.target,n=e.scrollTop,r=e.scrollLeft;i.moveFn&&i.moveFn(i.vertical?n:r,t)}))}return a()(t,[{key:"move",value:function(t){return this.el.scroll(t),this}},{key:"scroll",value:function(){return this.el.scroll()}},{key:"set",value:function(t,e){var i=t-1;if(e>i){var n=this.vertical?"height":"width";this.el.css(n,"".concat(i-50,"px")).show(),this.contentEl.css(this.vertical?"width":"height","1px").css(n,"".concat(e,"px"))}else this.el.hide();return this}}]),t}(),Lt=10,Bt=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];l()(this,t),this.isreadonly=e,this.useHideInput=i,this.inputChange=function(){},this.cornerEl=f("div","".concat(ot,"-selector-corner")),this.areaEl=f("div","".concat(ot,"-selector-area")).child(this.cornerEl).hide(),window.mobileAndTabletCheck()&&this.cornerEl.child(f("div","".concat(ot,"-selector-corner-shape"))),this.clipboardEl=f("div","".concat(ot,"-selector-clipboard")).hide(),this.autofillEl=f("div","".concat(ot,"-selector-autofill")).hide(),this.el=f("div","".concat(ot,"-selector")).css("z-index","".concat(Lt)).children(this.areaEl,this.clipboardEl,this.autofillEl).hide(),this.isreadonly&&this.cornerEl.hide(),Lt+=1}return a()(t,[{key:"setOffset",value:function(t){return this.el.offset(t).show(),this}},{key:"hide",value:function(){return this.el.hide(),this}},{key:"setAreaOffset",value:function(t){var e=t.left,i=t.top,n=t.width,r=t.height,o={width:this.isreadonly?n-2:n+.8,height:this.isreadonly?r-2:r+.8,left:e-.8,top:i-.8};this.areaEl.offset(o).show()}},{key:"setClipboardOffset",value:function(t){var e=t.left,i=t.top,n=t.width,r=t.height;this.clipboardEl.offset({left:e,top:i,width:n-2.4,height:r-2.4})}},{key:"showAutofill",value:function(t){var e=t.left,i=t.top,n=t.width,r=t.height;this.autofillEl.offset({width:n-3,height:r-3,left:e,top:i}).show()}},{key:"hideAutofill",value:function(){this.autofillEl.hide()}},{key:"showClipboard",value:function(){this.clipboardEl.show()}},{key:"hideClipboard",value:function(){this.clipboardEl.hide()}}]),t}();function zt(t){var e=this.data,i=t.left,n=t.top,r=t.width,o=t.height,a=t.scroll,s=t.l,l=t.t,c=e.freezeTotalWidth(),h=e.freezeTotalHeight(),u=e.displayRight2Left?0===c?i:i-(e.viewWidth()-e.cols.indexWidth-c):i-c,f=r;void 0!==a&&(e.displayRight2Left?0===c||(u+r<0?u=19999:u<0&&(f-=a.x)):c>s&&(u-=a.x));var d=n-h;return void 0!==a&&h>l&&(d-=a.y),{left:u,top:d,width:f,height:o}}function Ht(t){var e=this.data,i=t.left,n=t.width,r=t.height,o=t.l,a=t.t,s=t.scroll,l=e.freezeTotalWidth(),c=e.displayRight2Left?0===l?i:i-(e.viewWidth()-e.cols.indexWidth-l):i-l,h=n;return void 0!==s&&(e.displayRight2Left?0===l||(c+n<0?c=19999:c<0&&(h-=s.x)):l>o&&(c-=s.x)),{left:c,top:a,width:h,height:r}}function Nt(t){var e=this.data,i=t.top,n=t.width,r=t.height,o=t.l,a=t.t,s=t.scroll,l=t.left,c=e.freezeTotalHeight(),h=i-c;return c>a&&(h-=s.y),e.displayRight2Left?{left:l,top:h,width:n,height:r}:{left:o,top:h,width:n,height:r}}function Wt(t){this.br.setAreaOffset(zt.call(this,t))}function Ut(t){this.tl.setAreaOffset(t)}function Xt(t){this.t.setAreaOffset(Ht.call(this,t))}function Yt(t){this.l.setAreaOffset(Nt.call(this,t))}function Vt(t){this.l.setClipboardOffset(Nt.call(this,t))}function Gt(t){this.br.setClipboardOffset(zt.call(this,t))}function qt(t){this.tl.setClipboardOffset(t)}function Kt(t){this.t.setClipboardOffset(Ht.call(this,t))}function Zt(t){Wt.call(this,t),Ut.call(this,t),Xt.call(this,t),Yt.call(this,t)}function Jt(t){Gt.call(this,t),qt.call(this,t),Kt.call(this,t),Vt.call(this,t)}var $t=function(){function t(e){var i=this;l()(this,t),this.inputChange=function(){},this.data=e;var n="edit"!==e.settings.mode;this.br=new Bt(n,!0),this.t=new Bt(n),this.l=new Bt(n),this.tl=new Bt(n),this.br.inputChange=function(t){i.inputChange(t)},this.br.el.show(),this.offset=null,this.areaOffset=null,this.indexes=null,this.range=null,this.arange=null,this.el=f("div","".concat(ot,"-selectors")).children(this.tl.el,this.t.el,this.l.el,this.br.el).hide(),this.lastri=-1,this.lastci=-1,Lt+=1,this.mobilestartOffset=null,this.mobilestartRange=null,this.objId=null}return a()(t,[{key:"getObj",value:function(){if(null===this.objId)return null;var t=this.objId.split("_");return"s"===t[0]?this.data.shapes.filter((function(e){return Number(e.id)===Number(t[1])}))[0]:this.data.images.filter((function(e){return Number(e.id)===Number(t[1])}))[0]}},{key:"setObjId",value:function(t){this.objId=t}},{key:"setMobilestartOffsetAndRange",value:function(){this.mobilestartOffset=this.data.getSelectedRect(),this.mobilestartRange=this.range}},{key:"resetData",value:function(t){this.data=t,this.range=t.selector.range,this.resetAreaOffset()}},{key:"hide",value:function(){this.el.hide()}},{key:"resetOffset",value:function(){var t=this.data,e=this.tl,i=this.t,n=this.l,r=this.br,o=t.freezeTotalHeight(),a=t.freezeTotalWidth();if(o>0||a>0)if(this.data.displayRight2Left){var s=t.viewWidth()-t.cols.indexWidth;e.setOffset({width:s-a,height:o}),i.setOffset({left:s-a,height:o}),n.setOffset({width:s-a,top:o}),r.setOffset({left:s-a,top:o})}else e.setOffset({width:a,height:o}),i.setOffset({left:a,height:o}),n.setOffset({width:a,top:o}),r.setOffset({left:a,top:o});else e.hide(),i.hide(),n.hide(),r.setOffset({left:0,top:0})}},{key:"resetAreaOffset",value:function(){var t=this.data.getSelectedRect(),e=this.data.getClipboardRect();Zt.call(this,t),Jt.call(this,e),this.resetOffset()}},{key:"resetBRTAreaOffset",value:function(){var t=this.data.getSelectedRect(),e=this.data.getClipboardRect();this.data.displayRight2Left?0===this.data.freeze[1]?Wt.call(this,t):(Yt.call(this,t),Ut.call(this,t),Vt.call(this,e),qt.call(this,e)):(Wt.call(this,t),Xt.call(this,t),Gt.call(this,e),Kt.call(this,e)),this.resetOffset()}},{key:"resetBRLAreaOffset",value:function(){var t=this.data.getSelectedRect(),e=this.data.getClipboardRect();Wt.call(this,t),Yt.call(this,t),Gt.call(this,e),Vt.call(this,e),this.resetOffset()}},{key:"set",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.data,r=n.calSelectedRangeByStart(t,e),o=r.sri,a=r.sci;if(i){var s=t,l=e;t<0&&(s=0),e<0&&(l=0),n.selector.setIndexes(s,l),this.indexes=[s,l]}this.moveIndexes=[o,a],this.range=r,this.resetAreaOffset(),this.el.show()}},{key:"setEnd",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.data,r=this.lastri,o=this.lastci;if(i){if(t===r&&e===o)return;this.lastri=t,this.lastci=e}this.moveIndexes=[t,e],this.range=n.calSelectedRangeByEnd(t,e),Zt.call(this,this.data.getSelectedRect())}},{key:"setEndMobile",value:function(t,e){Zt.call(this,{width:this.mobilestartOffset.width+t,height:this.mobilestartOffset.height+e,left:this.mobilestartOffset.left,top:this.mobilestartOffset.top})}},{key:"getMobileMultipleSelect",value:function(t,e){var i=this.mobilestartRange,n=i.sri,r=i.sci,o=i.eri,a=i.eci,s=0,l=0,c=o,h=a;if(e>0){for(var u=o+1;u<=this.data.rows.len-1;u++)if((s+=this.data.rows.getHeight(u))>e){c=u-1;break}}else{e=-e;for(u=o;u>=n;u--)if((s+=this.data.rows.getHeight(u))>e){c=u-1;break}c===n-1&&(c=n)}if(t>0){for(var f=a+1;f<=this.data.cols.len-1;f++)if((l+=this.data.cols.getWidth(f))>t){h=f-1;break}}else{t=-t;for(f=a;f>=r;f--)if((l+=this.data.cols.getWidth(f))>t){h=f-1;break}h===r-1&&(h=r)}return[c,h]}},{key:"setMobileMultipleSelect",value:function(t,e){var i=this.getMobileMultipleSelect(t,e),n=r()(i,2),o=n[0],a=n[1];this.setEnd(o,a,!1)}},{key:"setMobile",value:function(t,e,i,n){var r=this.range,o=r.eri,a=r.eci;this.set(t,e),this.lastri=this.lastci=0,this.setEnd(o,a);var s=this.data.getSelectedRect();i=i>s.width+s.left?s.width+s.left:i,n=n>s.height+s.top?s.height+s.top:n,Zt.call(this,{width:s.width+(s.left-i),height:s.height+(s.top-n),left:i,top:n}),this.el.show()}},{key:"reset",value:function(){var t=this.data.selector.range,e=t.eri,i=t.eci;this.setEnd(e,i)}},{key:"showAutofill",value:function(t,e){if(-1!==t||-1!==e){var i=this.range,n=i.sri,r=i.sci,o=i.eri,a=i.eci,s=t,l=e,c=n-t,h=o-t,u=a-e;if(r-e>0)this.arange=new x(n,l,o,r-1);else if(c>0)this.arange=new x(s,r,n-1,a);else if(u<0)this.arange=new x(n,a+1,o,l);else{if(!(h<0))return void(this.arange=null);this.arange=new x(o+1,r,s,a)}if(null!==this.arange){var f=this.data.getRect(this.arange);f.width+=2,f.height+=2;var d=this.br,v=this.l,g=this.t,p=this.tl;d.showAutofill(zt.call(this,f)),v.showAutofill(Nt.call(this,f)),g.showAutofill(Ht.call(this,f)),p.showAutofill(f)}}}},{key:"hideAutofill",value:function(){var t=this;["br","l","t","tl"].forEach((function(e){t[e].hideAutofill()}))}},{key:"showClipboard",value:function(){var t=this,e=this.data.getClipboardRect();Jt.call(this,e),["br","l","t","tl"].forEach((function(e){t[e].showClipboard()}))}},{key:"hideClipboard",value:function(){var t=this;["br","l","t","tl"].forEach((function(e){t[e].hideClipboard()}))}}]),t}();function Qt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var te=function(t){tt()(i,t);var e=Qt(i);function i(t){var n;return l()(this,i),(n=e.call(this,"dialog")).show(),n.setContent(t),n}return a()(i,[{key:"hide",value:function(){this.removeAttr("open")}},{key:"show",value:function(){this.attr("open","")}},{key:"setContent",value:function(t){var e=f("p");e.child(t),this.child(e)}}],[{key:"findDialog",value:function(t){for(var e=[],i=0;i<t.children().length;i++)"dialog"===t.children()[i].localName&&e.push(i);return e}}]),i}(u);function ee(t){t.preventDefault(),t.stopPropagation();var e=this.filterItems;e.length<=0||(this.itemIndex>=0&&(e[this.itemIndex].toggle(),e[this.itemIndex].el.hideHelp()),this.itemIndex-=1,this.itemIndex<0&&(this.itemIndex=e.length-1),e[this.itemIndex].toggle(),e[this.itemIndex].el.showHelp())}function ie(t){t.stopPropagation();var e=this.filterItems;e.length<=0||(this.itemIndex>=0&&(e[this.itemIndex].toggle(),e[this.itemIndex].el.hideHelp()),this.itemIndex+=1,this.itemIndex>e.length-1&&(this.itemIndex=0),e[this.itemIndex].toggle(),e[this.itemIndex].el.showHelp())}function ne(t){t.preventDefault();var e=this.filterItems;e.length<=0||(t.stopPropagation(),this.itemIndex<0&&(this.itemIndex=0),e[this.itemIndex].el.click(),this.hide())}function re(t,e){e.focusing=!0;var i=t.keyCode;switch(t.ctrlKey&&t.stopPropagation(),i){case 37:t.stopPropagation();break;case 38:ee.call(this,t);break;case 39:t.stopPropagation();break;case 40:ie.call(this,t);break;case 13:case 9:ne.call(this,t);break;default:t.stopPropagation()}}var oe=function(){function t(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"200px";l()(this,t),this.filterItems=[],this.items=e,this.el=f("div","".concat(ot,"-suggest")).css("width",n).hide(),this.itemClick=i,this.itemIndex=-1}return a()(t,[{key:"setOffset",value:function(t){this.el.cssRemoveKeys("top","bottom").offset(t)}},{key:"hide",value:function(){var t=this.el;this.filterItems=[],this.itemIndex=-1,t.hide();for(var e=te.findDialog(t.parent()),i=0;i<e.length;i++)t.parent().removeChild(t.parent().children()[e[i]]);Et(this.el.parent())}},{key:"setItems",value:function(t){this.items=t}},{key:"search",value:function(t){var e,i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=this.items;if(/^\s*$/.test(t)||(r=r.filter((function(e){return(e.key||e).startsWith(t.toUpperCase())}))),r=r.map((function(t){var e=t.title;e?"function"==typeof e&&(e=e()):e=t;var r=f("div","".concat(ot,"-item")).child("f"===n?t.key:e).on("click.stop",(function(){i.itemClick(t),i.hide()}));return t.label&&r.child(f("div","label").html(t.label)),"f"===n&&(r.el.help=new te(t.title())),r.el.showHelp=function(){var t=i.el.el.offsetTop+i.filterItems[i.itemIndex].el.offsetTop,e=i.el.el.offsetLeft+i.filterItems[i.itemIndex].el.clientWidth+20,n={top:"".concat(t,"px"),left:"".concat(e,"px"),"line-height":"16px",padding:"5px 2px"},r=i.filterItems[i.itemIndex].el.help;r.css(n),i.el.parent().child(r),Rt(r,(function(t){for(var e=te.findDialog(i.el.parent()),n=0;n<e.length;n++)i.el.parent().removeChild(i.el.parent().children()[e[n]]);Et(t)}))},r.el.hideHelp=function(){i.el.parent().contains(i.filterItems[i.itemIndex].el.help.el)&&i.el.parent().removeChild(i.filterItems[i.itemIndex].el.help.el),Et(i.filterItems[i.itemIndex].el.help)},r})),this.filterItems=r,!(r.length<=0)){var o=this.el;if((e=o.html("")).children.apply(e,v()(r)).show(),"f"===n){for(var a=te.findDialog(o.parent()),s=0;s<a.length;s++)o.parent().removeChild(o.parent().children()[a[s]]);this.itemIndex=0,this.filterItems[this.itemIndex].el.hideHelp(),this.filterItems[this.itemIndex].toggle(),this.filterItems[this.itemIndex].el.showHelp(),Rt(o.parent(),(function(){i.hide(),i.filterItems.forEach((function(t){return t.hideHelp()}))}))}}}},{key:"bindInputEvents",value:function(t,e){var i=this;t.on("keydown",(function(t){return re.call(i,t,e)}))}}]),t}();function ae(t,e){t.setMonth(t.getMonth()+e)}function se(t,e){var i=new Date(t);return i.setDate(e-t.getDay()+1),i}var le=function(){function t(e){var i,n=this;l()(this,t),this.value=e,this.cvalue=new Date(e),this.headerLeftEl=f("div","calendar-header-left"),this.bodyEl=f("tbody",""),this.buildAll(),this.el=f("div","x-spreadsheet-calendar").children(f("div","calendar-header").children(this.headerLeftEl,f("div","calendar-header-right").children(f("a","calendar-prev").on("click.stop",(function(){return n.prev()})).child(new st("chevron-left")),f("a","calendar-next").on("click.stop",(function(){return n.next()})).child(new st("chevron-right")))),f("table","calendar-body").children(f("thead","").child((i=f("tr","")).children.apply(i,v()(W("calendar.weeks").map((function(t){return f("th","cell").child(t)}))))),this.bodyEl)),this.selectChange=function(){}}return a()(t,[{key:"setValue",value:function(t){this.value=t,this.cvalue=new Date(t),this.buildAll()}},{key:"prev",value:function(){ae(this.value,-1),this.buildAll()}},{key:"next",value:function(){ae(this.value,1),this.buildAll()}},{key:"buildAll",value:function(){this.buildHeaderLeft(),this.buildBody()}},{key:"buildHeaderLeft",value:function(){var t=this.value;this.headerLeftEl.html("".concat(W("calendar.months")[t.getMonth()]," ").concat(t.getFullYear()))}},{key:"buildBody",value:function(){var t,e=this,i=this.value,n=this.cvalue,r=this.bodyEl,o=function(t,e,i){for(var n=new Date(t,e,1,23,59,59),r=[[],[],[],[],[],[]],o=0;o<6;o+=1)for(var a=0;a<7;a+=1){var s=se(n,7*o+a),l=s.getMonth()!==e,c=s.getMonth()===i.getMonth()&&s.getDate()===i.getDate();r[o][a]={d:s,disabled:l,active:c}}return r}(i.getFullYear(),i.getMonth(),n).map((function(t){var i,n=t.map((function(t){var i="cell";return t.disabled&&(i+=" disabled"),t.active&&(i+=" active"),f("td","").child(f("div",i).on("click.stop",(function(){e.selectChange(t.d)})).child(t.d.getDate().toString()))}));return(i=f("tr","")).children.apply(i,v()(n))}));(t=r.html("")).children.apply(t,v()(o))}}]),t}(),ce=function(){function t(){l()(this,t),this.calendar=new le(new Date),this.el=f("div","".concat(ot,"-datepicker")).child(this.calendar.el).hide()}return a()(t,[{key:"setValue",value:function(t){var e=this.calendar;return"string"==typeof t?/^\d{4}-\d{1,2}-\d{1,2}$/.test(t)&&e.setValue(new Date(t.replace(new RegExp("-","g"),"/"))):t instanceof Date&&e.setValue(t),this}},{key:"change",value:function(t){var e=this;this.calendar.selectChange=function(i){t(i),e.hide()}}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){this.el.hide()}}]),t}(),he=[{key:"SUM",title:U("formula.sum"),render:function(t){return t.reduce((function(t,e){return D("+",t,e)}),0)},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"AVERAGE",title:U("formula.average"),render:function(t){return t.reduce((function(t,e){return Number(t)+Number(e)}),0)/t.length},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"MAX",title:U("formula.max"),render:function(t){return Math.max.apply(Math,v()(t.map((function(t){return Number(t)}))))},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"MIN",title:U("formula.min"),render:function(t){return Math.min.apply(Math,v()(t.map((function(t){return Number(t)}))))},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"IF",title:U("formula._if"),render:function(t){var e=r()(t,3),i=e[0],n=e[1],o=e[2];return i?n:o},tipInfo:{repeat:!1,args:[{name:"logical_test",required:!0},{name:"value_if_true",required:!1},{name:"value_if_false",required:!1}]}},{key:"AND",title:U("formula.and"),render:function(t){return t.every((function(t){return t}))},tipInfo:{repeat:!0,args:[{name:"logical",required:!1}]}},{key:"OR",title:U("formula.or"),render:function(t){return t.some((function(t){return t}))},tipInfo:{repeat:!0,args:[{name:"logical",required:!1}]}},{key:"CONCAT",title:U("formula.concat"),render:function(t){return t.join("")},tipInfo:{repeat:!0,args:[{name:"text",required:!1}]}}],ue=he,fe={};function de(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return ve(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return ve(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function ve(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}he.forEach((function(t){fe[t.key]=t}));var ge=function(){function t(){l()(this,t),this.el=f("div").hide(),this.el.css({position:"absolute",padding:"5px",color:"#000","border-radius":"1px","font-size":"12px","z-index":"201","line-height":"10px","min-width":"20px",background:"#fff",border:"1px solid",top:"30px",left:"0px","white-space":"nowrap"})}return a()(t,[{key:"tipContent",value:function(t,e){if(void 0===t)return"";var i=t.tipInfo.args.slice(),n="";t.tipInfo.repeat&&(n=i[i.length-1].name,i.pop());var r=[];if(""!==n){for(var o=1;i.length!==e+2;){var a=n+o;o++,i.push({name:a,required:!1})}i.push({name:"...",required:!0})}for(var s=0;s<i.length;s++){var l=i[s].required||0===s?i[s].name:"[".concat(i[s].name,"]");r.push(l)}return r[e]="<strong>".concat(r[e],"</strong>"),"".concat(t.key.toUpperCase(),"(").concat(r.join(", "),")")}},{key:"hide",value:function(){this.el.hide()}},{key:"show",value:function(t){if(-1!==t.startsWith("=")){var e,i="",n=[],r=[],o=de(t.substring(1));try{for(o.s();!(e=o.n()).done;){var a=e.value;switch(a){case"(":n.unshift(i),r.unshift(0),i="";break;case")":n.shift(),r.shift();break;case",":r[0]++,i="";break;case"=":break;default:i+=a}}}catch(t){o.e(t)}finally{o.f()}var s=he.find((function(t){return void 0!==n[0]&&t.key===n[0].toUpperCase()})),l=this.tipContent(s,r[0]);this.el.html(l),""!==l&&this.el.show(),""===l?this.el.hide():this.el.show(),Rt(this.el)}}}]),t}(),pe=[{key:"Arial",title:"Arial"},{key:"Arial Black",title:"Arial Black"},{key:"Comic Sans",title:"Comic Sans"},{key:"Comic Sans MS",title:"Comic Sans MS"},{key:"Courier New",title:"Courier New"},{key:"Georgia",title:"Georgia"},{key:"Impact",title:"Impact"},{key:"Lucida Console",title:"Lucida Console"},{key:"Lucida Sans",title:"Lucida Sans"},{key:"Palatino",title:"Palatino"},{key:"Tahoma",title:"Tahoma"},{key:"Times New Roman",title:"Times New Roman"},{key:"Trebuchet",title:"Trebuchet"},{key:"Verdana",title:"Verdana"},{key:"Lato",title:"Lato"},{key:"Helvetica",title:"Helvetica"},{key:"Source Sans Pro",title:"Source Sans Pro"}],me=[{pt:7.5,px:10},{pt:8,px:11},{pt:9,px:12},{pt:10,px:13},{pt:10.5,px:14},{pt:11,px:15},{pt:12,px:16},{pt:14,px:18.7},{pt:15,px:20},{pt:16,px:21.3},{pt:18,px:24},{pt:22,px:29.3},{pt:24,px:32},{pt:26,px:34.7},{pt:36,px:48},{pt:42,px:56}];function ye(t){for(var e=0;e<me.length;e+=1){var i=me[e];if(i.pt===t)return i.px}return t}var be=function(t){for(var e=[],i=[],n=[],o=0,a="",s=1,l="",c=0;c<t.length;c+=1){var h=t.charAt(c);if(" "!==h){if(h>="a"&&h<="z")n.push(h.toUpperCase());else if(h>="0"&&h<="9"||h>="A"&&h<="Z"||"."===h)n.push(h);else if('"'===h){for(c+=1;'"'!==t.charAt(c);)n.push(t.charAt(c)),c+=1;i.push('"'.concat(n.join(""))),n=[]}else if("-"===h&&/[+\-*/,(]/.test(l))n.push(h);else{if("("!==h&&n.length>0&&i.push(n.join("")),")"===h){var u=e.pop();if(2===o)try{for(var f=y(i.pop()),d=r()(f,2),v=d[0],g=d[1],p=y(i.pop()),m=r()(p,2),w=m[0],x=m[1],C=0,k=w;k<=v;k+=1)for(var _=x;_<=g;_+=1)i.push(b(k,_)),C+=1;i.push([u,C])}catch(t){}else if(1===o||3===o)3===o&&i.push(a),i.push([u,s]),s=1;else for(;"("!==u&&(i.push(u),!(e.length<=0));)u=e.pop();o=0}else if("="===h||">"===h||"<"===h){var S=t.charAt(c+1);a=h,"="!==S&&"-"!==S||(a+=S,c+=1),o=3}else if(":"===h)o=2;else if(","===h)3===o&&i.push(a),o=1,s+=1;else if("("===h&&n.length>0)e.push(n.join(""));else{if(e.length>0&&("+"===h||"-"===h)){var T=e[e.length-1];if("("!==T&&i.push(e.pop()),"*"===T||"/"===T)for(;e.length>0&&"("!==(T=e[e.length-1]);)i.push(e.pop())}e.push(h)}n=[]}l=h}}for(n.length>0&&i.push(n.join(""));e.length>0;)i.push(e.pop());return i},we=function(t,e){var i=r()(t,1)[0],n=t;if('"'===i)return t.substring(1);var o=1;if("-"===i&&(n=t.substring(1),o=-1),n[0]>="0"&&n[0]<="9")return o*Number(n);var a=y(n),s=r()(a,2);return o*e(s[0],s[1])},xe=function(t,e,i,n){for(var o=[],a=0;a<t.length;a+=1){var s=t[a],l=s[0];if("+"===s){var c=o.pop();o.push(D("+",o.pop(),c))}else if("-"===s)if(1===o.length){var h=o.pop();o.push(D("*",h,-1))}else{var u=o.pop();o.push(D("-",o.pop(),u))}else if("*"===s)o.push(D("*",o.pop(),o.pop()));else if("/"===s){var f=o.pop();o.push(D("/",o.pop(),f))}else if("="===l||">"===l||"<"===l){var d=o.pop();Number.isNaN(d)||(d=Number(d));var v=o.pop();Number.isNaN(v)||(v=Number(v));var g=!1;"="===l?g=v===d:">"===s?g=v>d:">="===s?g=v>=d:"<"===s?g=v<d:"<="===s&&(g=v<=d),o.push(g)}else if(Array.isArray(s)){for(var p=r()(s,2),m=p[0],y=p[1],b=[],w=0;w<y;w+=1)b.push(o.pop());o.push(e[m].render(b.reverse()))}else{if(n.includes(s))return 0;(l>="a"&&l<="z"||l>="A"&&l<="Z")&&n.push(s),o.push(we(s,i)),n.pop()}}return o[0]},Ce=function t(e,i,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if("="===e[0]){var o=be(e.substring(1));return o.length<=0?e:xe(o,i,(function(e,o){return t(n(e,o),i,n,r)}),r)}return e},ke=function(t){return t},_e=function(t){if(/^(-?\d*.?\d*)$/.test(t)){var e=Number(t).toFixed(2).toString().split("\\."),i=h()(e),n=i[0],r=i.slice(1);return[n.toLocaleString()].concat(v()(r))}return t},Se=[{key:"normal",title:U("format.normal"),type:"string",render:ke},{key:"text",title:U("format.text"),type:"string",render:ke},{key:"number",title:U("format.number"),type:"number",label:"1,000.12",render:_e},{key:"percent",title:U("format.percent"),type:"number",label:"10.12%",render:function(t){return"".concat(t,"%")}},{key:"rmb",title:U("format.rmb"),type:"number",label:"¥10.00",render:function(t){return"¥".concat(_e(t))}},{key:"usd",title:U("format.usd"),type:"number",label:"$10.00",render:function(t){return"$".concat(_e(t))}},{key:"eur",title:U("format.eur"),type:"number",label:"€10.00",render:function(t){return"€".concat(_e(t))}},{key:"date",title:U("format.date"),type:"date",label:"26/09/2008",render:ke},{key:"time",title:U("format.time"),type:"date",label:"15:59:00",render:ke},{key:"datetime",title:U("format.datetime"),type:"date",label:"26/09/2008 15:59:00",render:ke},{key:"duration",title:U("format.duration"),type:"date",label:"24:01:00",render:ke}],Te={};function Oe(){return window.devicePixelRatio||1}function Ee(){return Oe()-.5}function Re(t){return parseInt(t*Oe(),10)}function Ae(t){var e=Math.ceil(t/Oe());return Re(e)===t?e:e-1}function Ie(t){var e=Re(t);return e>0?e-.5:.5}Se.forEach((function(t){Te[t.key]=t}));var Pe=function(){function t(e,i,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;l()(this,t),this.x=e,this.y=i,this.width=n,this.height=r,this.padding=o,this.bgcolor="#ffffff",this.borderTop=null,this.borderRight=null,this.borderBottom=null,this.borderLeft=null,this.pbgcolor=null,this.pattern=null}return a()(t,[{key:"setBorders",value:function(t){var e=t.top,i=t.bottom,n=t.left,r=t.right;e&&(this.borderTop=e),r&&(this.borderRight=r),i&&(this.borderBottom=i),n&&(this.borderLeft=n)}},{key:"setPading",value:function(t,e){this.lpading=t,this.rpading=e}},{key:"setPattern",value:function(t){t&&(this.pattern=t)}},{key:"resize",value:function(t,e){this.width=t,this.height=e}},{key:"innerWidth",value:function(){return this.lpading||this.rpading?this.width-(this.lpading+this.rpading)-2:this.width-2*this.padding-2}},{key:"innerHeight",value:function(){return this.height-2*this.padding-2}},{key:"textx",value:function(t){var e=this.width,i=this.padding,n=this.lpading,r=this.rpading,o=this.x;return"left"===t?o+=n||i:"center"===t?o+=e/2:"right"===t&&(o+=e-(r||i)),o}},{key:"texty",value:function(t,e){var i=this.height,n=this.padding,r=this.y;return"top"===t?r+=n:"middle"===t?r+=i/2-e/2:"bottom"===t&&(r+=i-n-e),r}},{key:"topxys",value:function(){var t=this.x,e=this.y;return[[t,e],[t+this.width,e]]}},{key:"rightxys",value:function(){var t=this.x,e=this.y,i=this.width;return[[t+i,e],[t+i,e+this.height]]}},{key:"bottomxys",value:function(){var t=this.x,e=this.y,i=this.width,n=this.height;return[[t,e+n],[t+i,e+n]]}},{key:"leftxys",value:function(){var t=this.x,e=this.y;return[[t,e],[t,e+this.height]]}}]),t}();function De(t,e,i,n,r,o,a){var s={x:0,y:0};"underline"===t?s.y="bottom"===r?0:"top"===r?-(o+2):-o/2:"strike"===t&&("bottom"===r?s.y=o/2:"top"===r&&(s.y=-(o/2+2))),"center"===n?s.x=a/2:"right"===n&&(s.x=a),this.line([e-s.x,i-s.y],[e-s.x+a,i-s.y])}function Fe(t,e,i,n,r,o){for(var a=i;a<r;a+=o)t.moveTo(e,a),t.lineTo(n,a)}function Me(t,e,i,n,r,o){for(var a=e;a<n;a+=o)t.moveTo(a,i),t.lineTo(a,r)}function je(t,e,i,n,r,o){for(var a=e,s=a+o;s<=n;s+=o)t.moveTo(s,r),t.lineTo(a,i),a+=o}function Le(t,e,i,n,r,o){for(var a=e,s=a+o;s<=n;s+=o)t.moveTo(a,r),t.lineTo(s,i),a+=o}function Be(t,e,i,n,r,o){for(var a=i;a<r;a+=o)t.moveTo(e,a),t.lineTo(n,a)}var ze=function(){function t(e,i,n){l()(this,t),this.width=i,this.height=n,this.ctx=e,this.ctx.scale(Oe(),Oe())}return a()(t,[{key:"setel",value:function(t){var e=this.width,i=this.height;this.el=t,this.ctx=t.getContext("2d"),this.resize(e,i),this.ctx.scale(Oe(),Oe())}},{key:"resize",value:function(t,e){this.width=t,this.height=e,this.el.style.width="".concat(t,"px"),this.el.style.height="".concat(e,"px"),this.el.width=Re(t),this.el.height=Re(e)}},{key:"clear",value:function(){var t=this.width,e=this.height;return this.ctx.clearRect(0,0,Re(t),Re(e)),this}},{key:"attr",value:function(t){return Object.assign(this.ctx,t),this}},{key:"save",value:function(){return this.ctx.save(),this.ctx.beginPath(),this}},{key:"restore",value:function(){return this.ctx.restore(),this}},{key:"beginPath",value:function(){return this.ctx.beginPath(),this}},{key:"translate",value:function(t,e){return this.ctx.translate(Re(t),Re(e)),this}},{key:"scale",value:function(t,e){return this.ctx.scale(t,e),this}},{key:"scaledpr",value:function(t){this.scale(t,t)}},{key:"clearRect",value:function(t,e,i,n){return this.ctx.clearRect(t,e,i,n),this}},{key:"fillRectWithColor",value:function(t,e,i,n,r){var o=this.ctx;this.save(),void 0!==t&&(o.fillStyle=t),this.fillRect(e,i,n,r),this.restore()}},{key:"fillRect",value:function(t,e,i,n){return this.ctx.fillRect(Re(t)-.5,Re(e)-.5,Re(i),Re(n)),this}},{key:"fillText",value:function(t,e,i){return this.ctx.fillText(t,Re(e),Re(i)),this}},{key:"richtext",value:function(t,e,i,n){var r=this,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=arguments.length>5?arguments[5]:void 0,s=this.ctx,l=t.bigfontsize,c=t.rtxt,h=e.exttxtwidth?e.exttxtwidth+e.innerWidth():e.innerWidth();if(!(h<=0)){var u=e.textx(i);s.save(),s.beginPath();var f=this;this.attr({textAlign:"center"===i?"right":i,textBaseline:"bottom"});var d=[],v=[],g=c.length;if(o)for(var p=function(t){var e=c[t],i=[],n=0,r=0,o=0;e.forEach((function(t){f.attr({font:"".concat(t.font.italic?"italic":""," ").concat(t.font.bold?"bold":""," ").concat(Re(t.font.size),"pt ").concat(t.font.name)});var e=s.measureText(t.txt).width;if(r=n,(n+=e)>Re(h)){for(var a={w:r,len:0,start:0},l=0;l<t.txt.length;)if(a.w+=s.measureText(t.txt[l]).width+1,a.w>=Re(h)){if(a.len===a.start&&0===i.length&&(a.len+=1,l++),a.len>a.start){var c={};c.font=t.font,c.txt=t.txt.substring(a.start,a.len),i.push(c),t.font.size>o&&(o=t.font.size)}d.push(i),v.push(o),a={w:0,len:l,start:l},n=0,i=[],o=0}else a.len+=1,l++;if(a.len>a.start){var u={};u.font=t.font,u.txt=t.txt.substring(a.start,a.len),i.push(u),t.font.size>o&&(o=t.font.size),n=a.w}}else i.push(t),t.font.size>o&&(o=t.font.size)})),d.push(i),v.push(o)},m=0;m<g;m++)p(m);else d=c,v=l;for(var y=v.length,b=0,w=0;w<y;w++)b+=v[w]+8;var x=[],C=[];if("center"===i||"right"===i)for(var k=0;k<y;k++){var _=d[k],S=0;_.forEach((function(t){f.attr({font:"".concat(t.font.italic?"italic":""," ").concat(t.font.bold?"bold":""," ").concat(Re(t.font.size),"pt ").concat(t.font.name),fillStyle:t.font.color,strokeStyle:t.font.color}),S+=Ae(s.measureText(t.txt).width)})),C.push(S)}if(0==a.length&&a.push(null),a.forEach((function(t){for(var o=e.texty(n,b),a=0,l=!1,c=!1,h=function(e){var n=d[e],h=0,g=u,p=g,m=g,y=v[e]+8,b=C.length>0?C[e]:0;"center"===i?p=g-b/2:"right"===i&&(p=g-b);var w=p;o+=y,n.forEach((function(e){f.attr({font:"".concat(e.font.italic?"italic":""," ").concat(e.font.bold?"bold":""," ").concat(Re(e.font.size),"pt ").concat(e.font.name),fillStyle:e.font.color,strokeStyle:e.font.color});var n=Ae(s.measureText(e.txt).width);if(m=w+n,null!==t){if(a<=t.start&&t.start<a+e.txt.length){l=!0;var u=e.txt.substr(0,t.start-a),d=Ae(s.measureText(u).width);p=w+d}if(a<t.end&&t.end<=a+e.txt.length){var v=e.txt.substr(0,t.end-a),C=Ae(s.measureText(v).width);m=w+C,l=!1,x.push({x:p,y:o-y,w:m-p,h:y})}}h+=n;var k=0;"center"===i?k=b/2-h:"right"===i&&(k=b-h),c||r.fillText(e.txt,g-k,o),"center"===i&&(k+=n/2),!c&&e.font.strike&&De.call(r,"strike",g-k,o,i,"bottom",e.font.size,n),!c&&e.font.underline&&De.call(r,"underline",g-k,o,i,"bottom",e.font.size,n),"left"===i&&(g+=n),w+=n,a+=e.txt.length})),null!==t&&l&&x.push({x:p,y:o-y,w:m-p,h:y}),a++},g=0;g<y;g++)h(g);c||(c=!0)})),s.restore(),null!=a[0]){s.save(),this.attr({fillStyle:a[0].color});for(var T=0,O=x.length;T<O;T++){var E=x[T];this.fillRect(E.x,E.y,E.w,E.h)}s.restore()}return this}}},{key:"text",value:function(t,e){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4?arguments[4]:void 0,a=this.ctx,s=n.align,l=n.valign,c=n.font,h=n.color,u=n.strike,f=n.underline,d=e.textx(s);a.save(),a.beginPath(),this.attr({textAlign:s,textBaseline:l,font:"".concat(c.italic?"italic":""," ").concat(c.bold?"bold":""," ").concat(Re(c.size),"px ").concat(c.name),fillStyle:h,strokeStyle:h});var v="".concat(t).split("\n"),g=e.exttxtwidth?e.exttxtwidth+e.innerWidth():e.innerWidth(),p=[];v.forEach((function(t){var e=a.measureText(t).width;if(r&&e>Re(g)){for(var i={w:0,len:0,start:0},n=0;n<t.length;n+=1)i.w>=Re(g)&&(p.push(t.substring(i.start,i.len)),i={w:0,len:0,start:n}),i.len+=1,i.w+=a.measureText(t[n]).width+1;i.len>0&&p.push(t.substring(i.start,i.len))}else p.push(t)}));var m=(p.length-1)*(c.size+2),y=!1,b=[];if(0==o.length&&o.push(null),o.forEach((function(t){var n=e.texty(l,m),r=0,o=!1;p.forEach((function(e){var h=a.measureText(e).width,v=d,g=d+Ae(h);if(null!==t){if(r<=t.start&&t.start<r+e.length){o=!0;var p=e.substr(0,t.start-r),m=Ae(a.measureText(p).width);v+=m,Ae(h)-m}if(r<t.end&&t.end<r+e.length){var w=e.substr(0,t.end-r),x=Ae(a.measureText(w).width);g=d+x}if(r>t.end&&(o=!1),o){var C={x:0,y:0};C.y="bottom"===l?c.size+2:"top"===l?2:(c.size+2)/2,"center"===s?C.x=Ae(h/2):"right"===s&&(C.x=Ae(h)),b.push({x:v-C.x,y:n-C.y,w:g-v,h:c.size+2})}}y||(i.fillText(e,d,n),u&&De.call(i,"strike",d,n,s,l,c.size,Ae(h)),f&&De.call(i,"underline",d,n,s,l,c.size,Ae(h))),n+=c.size+2,r+=e.length+1})),y||(y=!0)})),a.restore(),null!==o[0]){a.save(),this.attr({fillStyle:o[0].color});for(var w=0,x=b.length;w<x;w++){var C=b[w];this.fillRect(C.x,C.y,C.w,C.h)}a.restore()}return this}},{key:"border",value:function(t,e){var i=this.ctx;return i.lineWidth=Ee,i.strokeStyle=e,"medium"===t?i.lineWidth=Re(2)-.5:"thick"===t?i.lineWidth=Re(3):"dashed"===t?i.setLineDash([Re(3),Re(2)]):"dotted"===t?i.setLineDash([Re(1),Re(1)]):"double"===t&&i.setLineDash([Re(2),0]),this}},{key:"line",value:function(){var t=this.ctx;if(arguments.length>1){t.beginPath();var e=arguments.length<=0?void 0:arguments[0],i=r()(e,2),n=i[0],o=i[1];t.moveTo(Ie(n),Ie(o));for(var a=1;a<arguments.length;a+=1){var s=a<0||arguments.length<=a?void 0:arguments[a],l=r()(s,2),c=l[0],h=l[1];t.lineTo(Ie(c),Ie(h))}t.stroke()}return this}},{key:"strokeBorders",value:function(t){var e=this.ctx;e.save();var i=t.borderTop,n=t.borderRight,r=t.borderBottom,o=t.borderLeft;i&&(this.border.apply(this,v()(i)),this.line.apply(this,v()(t.topxys()))),n&&(this.border.apply(this,v()(n)),this.line.apply(this,v()(t.rightxys()))),r&&(this.border.apply(this,v()(r)),this.line.apply(this,v()(t.bottomxys()))),o&&(this.border.apply(this,v()(o)),this.line.apply(this,v()(t.leftxys()))),e.restore()}},{key:"strokePattern",value:function(t){var e=this.ctx;e.save();var i=t.x,n=t.y,r=t.width,o=t.height,a=t.pattern;if(a){e.beginPath();var s=Ie(i),l=s+Re(r),c=Ie(n),h=c+Re(o);switch(a){case"None":case"Solid":break;case"HorizontalStripe":e.lineWidth=2,e.setLineDash([]),Fe(e,s,c,l,h,4);break;case"ThinHorizontalStripe":e.lineWidth=1,e.setLineDash([]),Fe(e,s,c,l,h,4);break;case"Gray75":e.lineWidth=2,e.setLineDash([2]),Be(e,s,c,l,h,3);break;case"VerticalStripe":e.lineWidth=2,e.setLineDash([]),Me(e,s,c,l,h,4);break;case"ThinVerticalStripe":e.lineWidth=1,e.setLineDash([]),Me(e,s,c,l,h,4);break;case"Gray50":e.lineWidth=2,e.setLineDash([2]),Be(e,s,c,l,h,3.5);break;case"ReverseDiagonalStripe":e.lineWidth=2,e.setLineDash([]),je(e,s,c,l,h,4);break;case"ThinReverseDiagonalStripe":e.lineWidth=1,e.setLineDash([]),je(e,s,c,l,h,4);break;case"Gray25":e.lineWidth=2,e.setLineDash([2]),Be(e,s,c,l,h,4);break;case"DiagonalStripe":e.lineWidth=2,e.setLineDash([]),Le(e,s,c,l,h,4);break;case"ThinDiagonalStripe":e.lineWidth=1,e.setLineDash([]),Le(e,s,c,l,h,4);break;case"Gray12":e.lineWidth=2,e.setLineDash([2]),Be(e,s,c,l,h,4.5);break;case"DiagonalCrosshatch":e.lineWidth=1.5,e.setLineDash([]),je(e,s,c,l,h,4),Le(e,s,c,l,h,4);break;case"ThinHorizontalCrosshatch":e.lineWidth=1,e.setLineDash([]),Fe(e,s,c,l,h,4),Me(e,s,c,l,h,4);break;case"Gray6":e.lineWidth=2,e.setLineDash([2]),Be(e,s,c,l,h,5);break;case"ThickDiagonalCrosshatch":e.lineWidth=2,e.setLineDash([]),je(e,s,c,l,h,4),Le(e,s,c,l,h,4);break;case"ThinDiagonalCrosshatch":e.lineWidth=1,e.setLineDash([]),je(e,s,c,l,h,4),Le(e,s,c,l,h,4)}e.closePath(),e.stroke()}e.restore()}},{key:"dropdown",value:function(t){var e=this.ctx,i=t.x,n=t.y,r=i+t.width-15,o=n+t.height-15;e.save(),e.beginPath(),e.moveTo(Re(r),Re(o)),e.lineTo(Re(r+8),Re(o)),e.lineTo(Re(r+4),Re(o+6)),e.closePath(),e.fillStyle="rgba(0, 0, 0, .45)",e.fill(),e.restore()}},{key:"error",value:function(t,e){var i=this.ctx,n=t.x,r=t.y,o=t.width,a=n+o-1;i.save(),i.beginPath(),e?(i.moveTo(Re(a-o+8),Re(r-1)),i.lineTo(Re(a-o),Re(r-1)),i.lineTo(Re(a-o),Re(r+8))):(i.moveTo(Re(a-8),Re(r-1)),i.lineTo(Re(a),Re(r-1)),i.lineTo(Re(a),Re(r+8))),i.closePath(),i.fillStyle="rgba(255, 0, 0, .65)",i.fill(),i.restore()}},{key:"frozen",value:function(t){var e=this.ctx,i=t.x,n=t.y,r=i+t.width-1;e.save(),e.beginPath(),e.moveTo(Re(r-8),Re(n-1)),e.lineTo(Re(r),Re(n-1)),e.lineTo(Re(r),Re(n+8)),e.closePath(),e.fillStyle="rgba(0, 255, 0, .85)",e.fill(),e.restore()}},{key:"line2",value:function(){var t=this.ctx;if(arguments.length>1){t.beginPath();var e=arguments.length<=0?void 0:arguments[0],i=r()(e,2),n=i[0],o=i[1];t.moveTo(n,o);for(var a=1;a<arguments.length;a+=1){var s=a<0||arguments.length<=a?void 0:arguments[a],l=r()(s,2),c=l[0],h=l[1];t.lineTo(c,h)}t.stroke()}return this}},{key:"rect3",value:function(t){var e=this.ctx,i=t.x,n=t.y,r=t.width,o=t.height;e.save(),e.beginPath(),e.rect(Re(i)-.5,Re(n)-.5,Re(r),Re(o)),e.closePath(),e.strokeStyle="black",e.stroke(),e.restore()}},{key:"rect2",value:function(t,e){var i=this.ctx,n=t.x,r=t.y,o=t.width,a=t.height,s=t.bgcolor,l=t.pbgcolor,c=t.exttxtwidthR,h=t.exttxtwidthL;if(i.save(),i.beginPath(),i.fillStyle=void 0!==s?s:void 0!==l?l:"#ffffff",i.rect(n+1,r+1,o-2,a-2),i.clip(),i.fill(),void 0!==c||void 0!==h){var u=void 0===c?0:c,f=void 0===h?0:h;i.restore(),i.save(),i.rect(n+1-f,r+1,o+u+f-2,a-2),i.clip(),e(),i.restore()}else e(),i.restore()}},{key:"rect",value:function(t,e){var i=this.ctx,n=t.x,r=t.y,o=t.width,a=t.height,s=t.bgcolor,l=t.pbgcolor,c=t.exttxtwidthR,h=t.exttxtwidthL;if(i.save(),i.beginPath(),i.fillStyle=void 0!==s?s:void 0!==l?l:"#ffffff",i.rect(Ie(n+1),Ie(r+1),Re(o-2),Re(a-2)),i.clip(),i.fill(),void 0!==c||void 0!==h){var u=void 0===c?0:c,f=void 0===h?0:h;i.restore(),i.save(),i.rect(Ie(n+1-f),Ie(r+1),Re(o+u+f-2),Re(a-2)),i.clip(),e(),i.restore()}else e(),i.restore()}}]),t}();function He(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return Ne(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Ne(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function Ne(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var We={fillStyle:"#f4f5f8"},Ue={fillStyle:"#fff",lineWidth:Ee,strokeStyle:"#e6e6e6"};function Xe(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=t.cellRect(e,i),o=r.left,a=r.top,s=r.width,l=r.height;return new Pe(o,a+n,s,l,3)}function Ye(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=t.cellRect(e.sri,e.sci),r=n.left,o=n.top,a=t.cols.sumWidth(e.sci,e.eci+1),s=t.rows.sumHeight(e.sri,e.eri+1);return new Pe(r,o+i,a,s,3)}function Ve(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=Ye(t,e,i);return n.width+=3,n.height+=3,n}function Ge(t,e,i,n,r,o,a){var s=t.cols,l=t.viewRangeCache;if(!a.textwrap&&o.text&&o.text.length>0){var c=0,h=0;if(void 0===a.align||"center"===a.align||"left"===a.align)for(var u=r+1;u<=l.eci;u++){var f=t.getCell(i,u);if(null!==f&&void 0!==f.text&&f.text.length>0)break;c+=s.getWidth(u)}if(a.align&&("center"===a.align||"right"===a.align))for(var d=r-1;d>=l.sci;d--){var v=t.getCell(i,d);if(null!==v&&void 0!==v.text&&v.text.length>0)break;h+=s.getWidth(d)}c>0&&(e.exttxtwidthR=c),h>0&&(e.exttxtwidthL=h)}}function qe(t){if(void 0!==t.rtxt&&void 0===t.bigfontsize){for(var e=[],i=[],n=[],r=0,o=t.rtxt.length,a=0;a<o;a++){var s=t.rtxt[a].txt.split("\n"),l=s.length,c=t.rtxt[a].font.size;if(1===l)n.push(t.rtxt[a]),c>r&&(r=c);else{if(0!==s[0].length){var h={};h.font=t.rtxt[a].font,h.txt=s[0],n.push(h),c>r&&(r=c)}i.push(r),e.push(n),n=[],r=0;for(var u=1;u<l-1;u++){var f={};f.font=t.rtxt[a].font,f.txt=s[u],n.push(f),e.push(n),i.push(c),n=[],r=0}if(0!==s[l-1].length){var d={};d.font=t.rtxt[a].font,d.txt=s[l-1],n.push(d),r=c}}}n.length>0&&(i.push(r),e.push(n)),t.rtxt=e,t.bigfontsize=i}}function Ke(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=e.sortedRowMap,s=e.rows,l=e.cols;e.viewRangeCache;if(!s.isHide(i)&&!l.isHide(n)){var c=i;a.has(i)&&(c=a.get(i));var h=e.getCell(c,n);if(null!==h&&(!h.merge||o)){qe(h);var u=!1;"editable"in h&&!1===h.editable&&(u=!0);var f=e.getCellStyleOrDefault(c,n),d=Xe(e,i,n,r);d.bgcolor=f.bgcolor,d.pbgcolor=f.pbgcolor;var v=d,g=!1,p=!1;f.hasbgcolor&&!o&&((e.bgcolor||void 0===f.border||void 0===f.border.right)&&(v.width+=3,g=!0),(e.bgcolor||void 0===f.border||void 0===f.border.bottom)&&(v.height+=3,p=!0)),Ge(e,d,c,0,n,h,f);var m=e.getHighlightCellTxt(i,n);t.rect(v,(function(){var i="";i=e.settings.evalPaused||"server"===e.settings.updateMode?h.text||"":Ce(h.text||"",fe,(function(t,i){return e.getCellTextOrDefault(i,t)})),f.format&&"server"!==e.settings.updateMode&&(i=Te[f.format].render(i));var r=Object.assign({},f.font);r.size=ye(r.size),void 0===h.rtxt?""!==i&&t.text(i,d,{align:f.align,valign:f.valign,font:r,color:f.color,strike:f.strike,underline:f.underline},f.textwrap,m):t.richtext(h,d,f.align,f.valign,f.textwrap,m),e.validations.getError(c,n)&&t.error(d),u&&t.frozen(d),void 0!==f.pattern&&(d.setPattern(f.pattern),t.strokePattern(d))})),void 0!==f.border&&(g&&(d.width-=3),p&&(d.height-=3),d.setBorders(f.border),t.strokeBorders(d))}}}function Ze(t){var e=this.data,i=this.draw;if(t){var n=e.autoFilter,r=e.TableAutoFilters;Je(e,t,i,n),r.forEach((function(n){Je(e,t,i,n)}))}}function Je(t,e,i,n){if(n.active()){var r=n.hrange();e.intersects(r)&&r.each((function(e,n){var r=Xe(t,e,n);i.dropdown(r)}))}}function $e(t,e,i,n,r){var o=this.draw,a=this.data;o.save(),a.displayRight2Left?o.translate(-e,i).translate(n,r):o.translate(e,i).translate(n,r),a.comments.forEach((function(e){if(t.sri<=e.row&&t.eri>=e.row&&t.sci<=e.col&&t.eci>=e.col){var i=Xe(a,e.row,e.col);o.error(i,a.displayRight2Left)}})),o.restore()}function Qe(t,e,i,n,r){var o=this.draw,a=this.data;o.save(),a.displayRight2Left?o.translate(-e,i).translate(n,r):o.translate(e,i).translate(n,r);var s=a.exceptRowSet;o.save(),o.translate(0,-0),t.emptyFirst((function(t,e){Ke(o,a,t,e)}),(function(t){return function(t){return!s.has(t)}(t)}),(function(t,e){return a.isEmpty(t,e)})),o.restore();var l=new Set;o.save(),o.translate(0,-0),a.eachMergesInView(t,(function(t){var e=t.sri,i=t.sci,n=t.eri;if(s.has(e)){if(!l.has(e)){l.add(e);var r=a.rows.sumHeight(e,n+1);o.translate(0,-r)}}else Ke(o,a,e,i,0,!0)})),o.restore(),Ze.call(this,t),o.restore()}function ti(t,e,i,n){var r=this.draw;r.save(),r.attr({fillStyle:"rgba(75, 137, 255, 0.08)"}).fillRect(t,e,i,n),r.restore()}function ei(t,e,i,n,r,o){var a=this,s=this.draw,l=this.data,c=e.h,h=e.w,u=o+n,f=r+i,d=l.displayRight2Left?l.viewWidth():0,v=l.displayRight2Left?d-i:0;if(s.save(),s.attr(We),"all"!==t&&"left"!==t||s.fillRect(v,u,i,c),"all"===t||"top"===t)if(l.displayRight2Left){var g=e.lineStartx?e.lineStartx:0;s.fillRect(g,0,h,n)}else s.fillRect(f,0,h,n);var m=l.selector.range,y=m.sri,b=m.sci,w=m.eri,x=m.eci;if(s.attr({textAlign:"center",textBaseline:"middle",font:"500 ".concat(Re(12),"px Source Sans Pro"),fillStyle:"#585757",lineWidth:Ee(),strokeStyle:"#e6e6e6"}),"all"===t||"left"===t){var C=v;l.rowEach(e.sri,e.eri,(function(t,e,n){var r=u+e,o=t;s.line([C,r],[C+i,r]),y<=o&&o<w+1&&ti.call(a,C,r,i,n),s.fillText(o+1,C+i/2,r+n/2),t>0&&l.rows.isHide(t-1)&&(s.save(),s.attr({strokeStyle:"#c6c6c6"}),s.line([C+5,r+5],[C+i-5,r+5]),s.restore())})),s.line([C,c+u],[C+i,c+u]),s.line([C+i,u],[C+i,c+u])}"all"!==t&&"top"!==t||(l.colEach(e.sci,e.eci,(function(t,e,i){var r=l.displayRight2Left?d-(f+e+i):f+e,o=t;s.line([r,0],[r,n]),b<=o&&o<x+1&&ti.call(a,r,0,i,n),s.fillText(p(o),r+i/2,n/2),t>0&&l.cols.isHide(t-1)&&(s.save(),s.attr({strokeStyle:"#c6c6c6"}),s.line([r+5,5],[r+5,n-5]),s.restore())})),s.line([h+f,0],[h+f,n]),s.line([0,n],[h+f,n])),s.restore()}function ii(t,e){var i=this.draw;i.save(),i.attr({fillStyle:"#f4f5f8"}).fillRect(0,0,t,e),i.restore()}function ni(t,e,i,n,o){var a=t.sri,s=t.sci,l=t.eri,c=t.eci,h=t.w,u=t.h,f=t.clearStartx,d=void 0===f?0:f,v=t.lineStartx,g=void 0===v?0:v,p=this.draw,m=this.data,y=(m.settings,m.displayRight2Left),b=m.scroll;if(p.save(),y?p.attr(Ue).translate(-(e+n),i+o):p.attr(Ue).translate(e+n,i+o),p.clearRect(d,0,h,u),m.bgcolor&&p.fillRectWithColor(m.bgcolor,d,0,h,u),m.showGrid&&!m.bgcolor){if(y){h+=e+n;var w=r()(m.freeze,2),x=(w[0],w[1]);x>0&&s>=x&&(h+=b.x),0===x&&0==g&&(h=m.viewWidth()),m.rowEach(a,l,(function(t,e,i){t!==a&&p.line([g,e],[g+h,e]),t===l&&p.line([g,e+i],[g+h,e+i])}))}else m.rowEach(a,l,(function(t,e,i){t!==a&&p.line([0,e],[h,e]),t===l&&p.line([0,e+i],[h,e+i])}));if(y){var C=m.viewWidth();m.colEach(s,c,(function(t,e,i){p.line([C-e-i,0],[C-e-i,u]),t===s&&p.line([C-e,0],[C-e,u])}))}else m.colEach(s,c,(function(t,e,i){t!==s&&p.line([e,0],[e,u]),t===c&&p.line([e+i,0],[e+i,u])}));p.restore()}else p.restore()}function ri(t,e,i,n){var r=this.draw,o=this.data,a=o.viewWidth(),s=(a-t)/this.zoomlevel,l=(o.viewHeight()-e)/this.zoomlevel;o.displayRight2Left?r.save().translate(-t,e).attr({strokeStyle:"rgba(75, 137, 255, .6)"}):r.save().translate(t,e).attr({strokeStyle:"rgba(75, 137, 255, .6)"}),o.displayRight2Left?(r.line([0,n],[a,n]),r.line([a-i,0],[a-i,l])):(r.line([0,n],[s,n]),r.line([i,0],[i,l])),r.restore()}var oi=function(){function t(e,i){l()(this,t),this.el=e,this.draw=new ze(e.getContext("2d"),i.viewWidth(),i.viewHeight()),this.draw.setel(e),this.data=i,this.zoomlevel=1}return a()(t,[{key:"resetData",value:function(t){this.data=t,this.render()}},{key:"clearSelectRender",value:function(){var t=this.data,e=this.draw,i=this.zoomlevel,n=t.selector,r=n.ri,o=n.ci,a=r;t.sortedRowMap.has(r)&&(a=sortedRowMap.get(r));var s=t.getCell(a,o);if(null!==s){var l=t.getCellStyleOrDefault(a,o),c=Xe(t,r,o,0);Ge(t,c,a,0,o,s,l);var h=t.cols.indexWidth,u=t.settings.row.height,f=t.freezeTotalWidth(),d=t.scroll,v=d.x,g=d.y;e.save(),e.scaledpr(i),t.displayRight2Left?e.attr(Ue).translate(-(h+f),u+0):e.attr(Ue).translate(h+f,u+0);var p=void 0===c.exttxtwidthR?0:c.exttxtwidthR,m=void 0===c.exttxtwidthL?0:c.exttxtwidthL;e.fillRect(c.x+1-m-v,c.y+1-g,c.width+p+m-2,c.height-2),e.restore()}}},{key:"render",value:function(){var t=this.data,e=this.zoomlevel;if(!t.isupdating){var i=t.rows,n=t.cols;if(0!==Object.keys(i._).length){var o=n.indexWidth,a=t.settings.row.height;this.draw.resize(t.viewWidth(),t.viewHeight()),this.draw.scaledpr(e),this.clear();var s=t.viewRange(),l=t.freezeTotalWidth(),c=t.freezeTotalHeight(),h=t.scroll,u=h.x,f=h.y;ni.call(this,s,o,a,l,c),Qe.call(this,s,o,a,-u,-f),$e.call(this,s,o,a,-u,-f),ei.call(this,"all",s,o,a,l,c),ii.call(this,o,a);var d=r()(t.freeze,2),v=d[0],g=d[1];if(v>0||g>0){if(v>0){var p=s.clone();p.sri=0,p.eri=v-1,p.h=c,ni.call(this,p,o,a,l,0),Qe.call(this,p,o,a,-u,0),$e.call(this,p,o,a,-u,0),ei.call(this,"top",p,o,a,l,0),this.highlightRanges(p,o,a,u,0)}if(g>0){var m=s.clone();m.sci=0,m.eci=g-1,m.w=l,m.clearStartx=t.displayRight2Left?this.draw.ctx.canvas.width-l:0,m.lineStartx=t.displayRight2Left?t.viewWidth()-l:0,ni.call(this,m,o,a,0,c),ei.call(this,"left",m,o,a,0,c),Qe.call(this,m,o,a,0,-f),$e.call(this,m,o,a,0,-f),this.highlightRanges(m,o,a,0,f)}var y=t.freezeViewRange();y.clearStartx=t.displayRight2Left?this.draw.ctx.canvas.width-l:0,y.lineStartx=t.displayRight2Left?t.viewWidth()-l:0,ni.call(this,y,o,a,0,0),ei.call(this,"all",y,o,a,0,0),Qe.call(this,y,o,a,0,0),$e.call(this,y,o,a,0,0),ri.call(this,o,a,l,c),this.highlightRanges(y,o,a,0,0)}this.highlightRanges(s,o,a,u,f)}}}},{key:"highlightRanges",value:function(t,e,i,n,r){var o=this.draw,a=this.data;if(a.showhighlight){if(o.save(),a.displayRight2Left?o.translate(-e,i).translate(-n,-r):o.translate(e,i).translate(-n,-r),a.highlightall){var s=Ve(a,t);s.bgcolor=a.highlightstyle.color,o.rect(s,(function(){}))}else if(a.highlightIR){var l,c=He(t.difference(a.highlightIR));try{for(c.s();!(l=c.n()).done;){var h=Ve(a,l.value);h.bgcolor=a.highlightstyle.color,o.rect(h,(function(){}))}}catch(t){c.e(t)}finally{c.f()}}else{var u,f=He(a.highlightrg);try{for(f.s();!(u=f.n()).done;){var d=u.value;if(t.intersects(d)){var v=d.clone();v.sri<t.sri&&(v.sri=t.sri),v.eri>t.eri&&(v.eri=t.eri),v.sci<t.sci&&(v.sci=t.sci),v.eci>t.eci&&(v.eci=t.eci);var g=Ve(a,v);g.bgcolor=a.highlightstyle.color,o.rect(g,(function(){}))}}}catch(t){f.e(t)}finally{f.f()}}o.restore()}}},{key:"clear",value:function(){this.draw.clear()}}]),t}();function ai(){var t=this.inputText;if(!/^\s*$/.test(t)){var e=this.textlineEl,i=this.textEl,n=this.areaOffset,r=t.split("\n"),o=Math.max.apply(Math,v()(r.map((function(t){return t.length})))),a=e.offset().width/t.length,s=(o+1)*a+5,l=this.viewFn().width-n.left-a,c=r.length;if(s>n.width){var h=s;s>l&&(h=l,c+=parseInt(s/l,10),c+=s%l>0?1:0),i.css("width","".concat(h,"px"))}c*=this.rowHeight,(c-=7)>n.height&&i.css("height","".concat(c,"px"))}}function si(t){var e=t.target;if(window.getSelection){var i=window.getSelection(),n=i.getRangeAt(0),r=document.createElement("br");n.deleteContents(),n.insertNode(r),n.collapse(!1),i.removeAllRanges(),i.addRange(n),this.inputText=e.innerText,this.inputHtml=e.innerHTML,ai.call(this)}}function li(t){var e=t.keyCode,i=t.altKey;13!==e&&9!==e&&t.stopPropagation(),13===e&&i&&(si.call(this,t),t.stopPropagation()),13!==e||i||t.preventDefault()}function ci(t){var e=t.target.innerText,i=t.target.innerHTML,n=this.suggest,r=this.textlineEl,o=this.validator,a=this.cell;if(this.textbox)return this.textbox.ischange=!0,void(this.inputHtml=i);if(null!==a)if("editable"in a&&!0===a.editable||void 0===a.editable){if(this.inputText=e,this.inputHtml=i,o)"list"===o.type?n.search(e):n.hide();else{var s=e.lastIndexOf("=");-1!==s?(n.search(e.substring(s+1),"f"),"("===t.data&&n.hide(),this.formalaTip.show(e)):(n.hide(),this.formalaTip.hide())}r.html(i),ai.call(this),this.change("input",e)}else t.target.innerText="";else{if(this.inputText=e,this.inputHtml=i,o)"list"===o.type?n.search(e):n.hide();else{var l=e.lastIndexOf("=");-1!==l?(n.search(e.substring(l+1),"f"),"("===t.data&&n.hide(),this.formalaTip.show(e)):(n.hide(),this.formalaTip.hide())}r.html(e),ai.call(this),this.change("input",e)}}function hi(t,e){var i=this.textEl.el;setTimeout((function(){if(e){var t=window.getSelection(),n=document.createRange();t.removeAllRanges(),n.selectNodeContents(i),n.collapse(!1),t.addRange(n),i.focus()}}),1)}function ui(t,e,i,n){var r=this.textEl,o=this.textlineEl;mobileAndTabletCheck()||r.el.blur();var a=!1;t.length>0?(a=!0,r.html(t)):r.html(e,!0,!0),a?o.html(t):o.html(e,!0,!0),hi.call(this,i,n)}function fi(t,e){var i=this.inputText,n=this.validator,r=0;if(n&&"list"===n.type)this.inputText=t,r=this.inputText.length;else{var o=i.lastIndexOf("="),a=i.substring(0,o+1),s=i.substring(o+1);s=-1!==s.indexOf(")")?s.substring(s.indexOf(")")):"",this.inputText="".concat(a+t.key,"("),r=this.inputText.length,this.inputText+="".concat(s),this.formalaTip.show(this.inputText)}ui.call(this,this.inputText,r,e)}function di(){this.suggest.setItems(this.formulas)}var vi=function(){function t(e,i,n,r){var o=this;l()(this,t),this.viewFn=i,this.rowHeight=n,this.formulas=e,this.formalaTip=new ge,this.suggest=new oe(e,(function(t){fi.call(o,t,!0)})),this.datepicker=new ce,this.datepicker.change((function(t){o.setText(function(t){var e=t.getMonth()+1,i=t.getDate();return e<10&&(e="0".concat(e)),i<10&&(i="0".concat(i)),"".concat(t.getFullYear(),"-").concat(e,"-").concat(i)}(t)),o.clear()})),this.areaEl=f("div","".concat(ot,"-editor-area")).children(this.textEl=f("div","htmlline").on("input",(function(t){return ci.call(o,t)})).on("paste.stop",(function(){})).on("keydown",(function(t){return li.call(o,t)})),this.textlineEl=f("div","textline"),this.suggest.el,this.datepicker.el,this.formalaTip.el).on("mousemove.stop",(function(){})).on("mousedown.stop",(function(){})),this.el=f("div","".concat(ot,"-editor")).child(this.areaEl).hide(),this.suggest.bindInputEvents(this.textEl,r),this.areaOffset=null,this.freeze={w:0,h:0},this.cell=null,this.inputText="",this.inputHtml="",this.ishtml=!1,this.textbox=null,this.change=function(){},this.textboxChange=function(){}}return a()(t,[{key:"setFreezeLengths",value:function(t,e){this.freeze.w=t,this.freeze.h=e}},{key:"insertTextNewLine",value:function(t){si.call(this,t)}},{key:"clear",value:function(){this.textbox?(""!==this.inputHtml&&this.textboxChange(this.textbox,this.inputHtml),this.textbox.setVisible(!0)):""!==this.inputText&&this.change("finished",this.ishtml?this.inputHtml:this.inputText),this.cell=null,this.textbox=null,this.areaOffset=null,this.inputText="",this.inputHtml="",this.ishtml=!1,this.el.hide(),this.textEl.html(""),this.textEl.cssRemoveKeys("width","height","padding-left","padding-right","text-align","border"),this.textlineEl.html(""),di.call(this),this.datepicker.hide()}},{key:"setOffset",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",i=this.textEl,n=this.areaEl,r=this.suggest,o=this.freeze,a=this.el;if(t){this.areaOffset=t;var s=t.left,l=t.top,c=t.width,h=t.height,u=t.l,f=t.t,d={left:0,top:0};o.w>u&&o.h>f||(o.w<u&&o.h<f?(d.left=o.w,d.top=o.h):o.w>u?d.top=o.h:o.h>f&&(d.left=o.w)),a.offset(d),n.offset({left:s-d.left-.8,top:l-d.top-.8}),i.offset({width:c-.2,height:h-.2});var v={left:0};v[e]=h,r.setOffset(v),r.hide()}}},{key:"setForTextBox",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.el,n=this.textEl;n.attr("contenteditable","true"),i.show(),this.textbox=t,this.textbox.setVisible(!1),this.ishtml=!0,this.inputText=t.text,this.inputHtml=t.html,ui.call(this,t.html,t.text,t.text.length,e),n.css("width","".concat(t.width-9,"px")),n.css("height","".concat(t.height,"px")),n.css("padding-left","".concat(t.lp,"pt")),n.css("padding-right","".concat(t.rp,"pt")),n.css("text-align",t.align),n.css("border","black 1px solid")}},{key:"setCell",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.el,r=this.datepicker,o=this.suggest,a=this.textEl;a.attr("contenteditable","true"),n.show(),this.cell=t;var s=t&&t.text||"",l=t&&t.html||"";if(t&&(t.f?s=t.f:t.ufv&&(s=t.ufv)),this.ishtml=t&&t.html,this.setTextAndHtml(l,s,i),this.validator=e,e){var c=e.type;"date"===c&&(r.show(),/^\s*$/.test(s)||r.setValue(s)),"list"===c&&(o.setItems(e.values()),o.search(""))}}},{key:"setTextAndHtml",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.inputText=e,this.inputHtml=t,ui.call(this,t,e,e.length,i),ai.call(this)}},{key:"setText",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.inputText=t,ui.call(this,"",t,t.length,e),ai.call(this)}}]),t}();function gi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var pi=function(t){tt()(i,t);var e=gi(i);function i(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return l()(this,i),(n=e.call(this,"div","".concat(ot,"-button ").concat(r))).child(W("button.".concat(t))),n}return i}(u),mi=[["A3",11.69,16.54],["A4",8.27,11.69],["A5",5.83,8.27],["B4",9.84,13.9],["B5",6.93,9.84]],yi=["landscape","portrait"];function bi(t){return parseInt(96*t,10)}function wi(t){"cancel"===t?this.el.hide():this.toPrint()}function xi(t){var e=this.paper,i=t.target.value,n=mi[i];e.w=bi(n[1]),e.h=bi(n[2]),this.preview()}function Ci(t){var e=this.paper,i=t.target.value,n=yi[i];e.orientation=n,this.preview()}var ki=function(){function t(e,i){var n,r;l()(this,t),this.paper={w:bi(mi[0][1]),h:bi(mi[0][2]),padding:50,orientation:yi[0],get width(){return"landscape"===this.orientation?this.h:this.w},get height(){return"landscape"===this.orientation?this.w:this.h}},this.data=e,this.imageCanvas=i,this.el=f("div","".concat(ot,"-print")).children(f("div","".concat(ot,"-print-bar")).children(f("div","-title").child("Print settings"),f("div","-right").children(f("div","".concat(ot,"-buttons")).children(new pi("cancel").on("click",wi.bind(this,"cancel")),new pi("next","primary").on("click",wi.bind(this,"next"))))),f("div","".concat(ot,"-print-content")).children(this.contentEl=f("div","-content"),f("div","-sider").child(f("form","").children(f("fieldset","").children(f("label","").child("".concat(W("print.size"))),(n=f("select","")).children.apply(n,v()(mi.map((function(t,e){return f("option","").attr("value",e).child("".concat(t[0]," ( ").concat(t[1],"''x").concat(t[2],"'' )"))})))).on("change",xi.bind(this))),f("fieldset","").children(f("label","").child("".concat(W("print.orientation"))),(r=f("select","")).children.apply(r,v()(yi.map((function(t,e){return f("option","").attr("value",e).child("".concat(W("print.orientations")[e]))})))).on("change",Ci.bind(this))))))).hide()}return a()(t,[{key:"resetData",value:function(t){this.data=t}},{key:"preview",value:function(){var t=this,e=this.data,i=this.paper,n=i.width,r=i.height,o=i.padding,a=n-2*o,s=r-2*o,l=e.contentRange(),c=parseInt(l.h/s,10)+1,h=a/l.w,u=o,d=o;h>1&&(u+=(a-l.w)/2);var v=0,g=0;this.contentEl.html(""),this.canvases=[];for(var p={sri:0,sci:0,eri:0,eci:0},m=function(i){var o=0,a=0,c=f("div","".concat(ot,"-canvas-card")),m=f("canvas","".concat(ot,"-canvas"));t.canvases.push(m.el);var y=new ze(m.el,n,r);for(y.save(),y.translate(u,d),h<1&&y.scale(h,h);v<=l.eri;v+=1){var b=e.rows.getHeight(v);if(!((o+=b)<s)){a=-(o-b);break}for(var w=0;w<=l.eci;w+=1)Ke(y,e,v,w,g),p.eci=w}p.eri=v,y.restore(),y.save(),y.translate(u,d),h<1&&y.scale(h,h);var x=g;e.eachMergesInView(p,(function(t){var i=t.sri,n=t.sci;Ke(y,e,i,n,x)})),y.restore(),p.sri=p.eri,p.sci=p.eci,g+=a;var C=t.imageCanvas.el.getContext("2d");C.width=n,C.height=r,C.translate(u,d),h<1&&C.scale(h,h),m.el.getContext("2d").drawImage(t.imageCanvas.el,u-t.imageCanvas.tOffset.left,t.imageCanvas.tOffset.top),t.contentEl.child(f("div","".concat(ot,"-canvas-card-wraper")).child(c.child(m)))},y=0;y<c;y+=1)m()}},{key:"toPrint",value:function(){this.el.hide();var t=this.paper,e=f("iframe","").hide().el;window.document.body.appendChild(e);var i=e.contentWindow,n=i.document,r=document.createElement("style");r.innerHTML="\n @page { size: ".concat(t.width,"px ").concat(t.height,"px; };\n canvas {\n page-break-before: auto;\n page-break-after: always;\n image-rendering: pixelated;\n };\n "),n.head.appendChild(r),this.canvases.forEach((function(t){var e=t.cloneNode(!1);e.getContext("2d").drawImage(t,0,0),n.body.appendChild(e)})),i.print()}}]),t}(),_i=[{key:"copy",title:U("contextmenu.copy"),label:"Ctrl+C"},{key:"cut",title:U("contextmenu.cut"),label:"Ctrl+X"},{key:"paste",title:U("contextmenu.paste"),label:"Ctrl+V"},{key:"paste-value",title:U("contextmenu.pasteValue"),label:"Ctrl+Shift+V"},{key:"paste-format",title:U("contextmenu.pasteFormat"),label:"Ctrl+Alt+V"},{key:"divider"},{key:"insert-row",title:U("contextmenu.insertRow")},{key:"insert-column",title:U("contextmenu.insertColumn")},{key:"divider"},{key:"delete-row",title:U("contextmenu.deleteRow")},{key:"delete-column",title:U("contextmenu.deleteColumn")},{key:"delete-cell-text",title:U("contextmenu.deleteCellText")},{key:"hide",title:U("contextmenu.hide")},{key:"divider"},{key:"link",title:U("contextmenu.link")},{key:"openLink",title:U("contextmenu.openLink")},{key:"removeLink",title:U("contextmenu.removeLink")},{key:"divider"},{key:"validation",title:U("contextmenu.validation")},{key:"cell-editable",title:U("contextmenu.celleditable")},{key:"cell-non-editable",title:U("contextmenu.cellnoneditable")}];function Si(t,e){var i=this,n=null;return(n="divider"===t.key?f("div","".concat(ot,"-item divider")):f("div","".concat(ot,"-item")).on("click",(function(){t.callback?t.callback(e,e.selector.getObj()):i.itemClick(t.key),i.hide()})).children(t.text?t.text:t.title(),f("div","label").child(t.label||"").attr("k",t.key))).key=t.key,n}function Ti(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_i,i=arguments.length>1?arguments[1]:void 0;return e.map((function(e){return Si.call(t,e,i)}))}function Oi(t,e){return t.find((function(t){return t.key===e}))}var Ei=function(){function t(e,i){var n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3?arguments[3]:void 0;if(l()(this,t),window.mobileAndTabletCheck()){var a={key:"merge",title:U("contextmenu.merge"),label:""},s={key:"unmerge",title:U("contextmenu.unmerge"),label:""},c={key:"edit",title:U("contextmenu.edit"),label:""};_i.forEach((function(t){t.label=void 0,"delete-cell-text"===t.key&&(t.title=U("contextmenu.clear"))})),_i.push(a),_i.push(s),_i.unshift(c)}this.customMenuItemsForImage=[{key:"delete-image",title:U("contextmenu.deleteImage"),label:"Del"}],this.customsetting=o&&!o.usedefault,this.customItems=this.customsetting?o.customItems:[],this.menuItems=this.customsetting?Ti.call(this,o.customItems,i):Ti.call(this),this.el=(n=f("div","".concat(ot,"-contextmenu"))).children.apply(n,v()(this.menuItems)).hide(),this.viewFn=e,this.itemClick=function(){},this.showMenuBefore=function(){},this.isHide=r,this.setMode("range"),this.sheet=i}return a()(t,[{key:"getImageContextMenuItems",value:function(){return this.customMenuItemsForImage}},{key:"addImageContextMenuItems",value:function(t){var e=this.customMenuItemsForImage;t.forEach((function(t){var i=e.findIndex((function(e){return e.key===t.key}));i>=0&&e.splice(i,1)})),e.push.apply(e,t)}},{key:"delImageContextMenuItems",value:function(t){var e=this.customMenuItemsForImage;t.forEach((function(t){var i=e.findIndex((function(e){return e.key===t}));i>=0&&e.splice(i,1)}))}},{key:"updateImageContextMenuItems",value:function(t){this.addImageContextMenuItems([t])}},{key:"getCutomContextMenuItems",value:function(){if(this.customsetting)return this.customItems}},{key:"addCutomContextMenuItems",value:function(t){var e=this.customItems,i=this.customsetting,n=this.sheet,r=this.menuItems;if(i){var o=Ti.call(this,t,n);t.forEach((function(t,i){"divider"!==t.key&&Oi(e,t.key)||(e.push(t),r.push(o[i]))})),this.rebuildMenuItems(r)}}},{key:"insertCutomContextMenuItem",value:function(t,e){var i=this.customItems,n=this.customsetting,r=this.sheet,o=this.menuItems;if(n&&("divider"===t.key||!Oi(i,t.key))){var a=Si.call(this,t,r);i.splice(e,0,t),o.splice(e,0,a),this.rebuildMenuItems(o)}}},{key:"updateCutomContextMenuItem",value:function(t,e){var i=this.customItems,n=this.customsetting,r=this.sheet,o=this.menuItems;if(n){var a=i.findIndex((function(e){return e.key==t}));if(-1!==a){e.text&&(i[a].text=e.text),e.callback&&(i[a].callback=e.callback);var s=Si.call(this,i[a],r);o[a]=s,this.rebuildMenuItems(o)}}}},{key:"rebuildMenuItems",value:function(t){var e,i=this.sheet;(i.el.removeChild(this.el.el),t.length>0)?this.el=(e=f("div","".concat(ot,"-contextmenu"))).children.apply(e,v()(t)).hide():this.el=f("div","".concat(ot,"-contextmenu")).hide();i.el.child(this.el)}},{key:"delCutomContextMenuItems",value:function(t){var e=this.customItems,i=this.menuItems,n=this.customsetting;this.sheet;n&&(t.forEach((function(t){var n=e.findIndex((function(e){return e.key===t}));n>=0&&(e.splice(n,1),i.splice(n,1))})),this.rebuildMenuItems(i))}},{key:"setMode",value:function(t){if(!this.customsetting){var e=this.menuItems[12];"row-col"===t?e.show():e.hide()}}},{key:"hide",value:function(){var t=this.el;t.hide(),Et(t)}},{key:"setPosition",value:function(t,e){if(!this.isHide){var i=this.el,n=this.sheet;this.showImageDeleteItem(i,n),this.showMenuBefore(this.menuItems);var r=i.show().offset(),o=r.width,a=r.height,s=this.viewFn(),l=t;s.width-t<=o&&(l-=o),i.css("left","".concat(l,"px"));var c=e;a+e>s.height&&(c-=a+e-s.height),i.css("top","".concat(c,"px")).css("max-height","".concat(s.height,"px")).css("bottom","auto"),Rt(i)}}},{key:"showImageDeleteItem",value:function(t,e){var i=this,n=this.customMenuItemsForImage;n.forEach((function(e){t.children().forEach((function(i){i.children[0]&&i.children[0].getAttribute("k")===e.key&&t.removeChild(i)}))})),this.el.children()[0].className.includes("divider")&&this.el.removeChild(this.el.children()[0]);var r=e.canvas.fabric.getActiveObject();null!=r&&("OleObject"===r.imgType?this.addImageContextMenuItems([{key:"ole",title:U("contextmenu.download"),callback:function(){e.getOle(r.strid)}}]):this.delImageContextMenuItems(["ole"]),Ti.call(this,n,e).forEach((function(t){return i.el.child(t,!0)})),e.selector.hide(),e.selector.setObjId(r.id))}}]),t}(),Ri=i(9),Ai=i.n(Ri);var Ii=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;l()(this,t),this.tip=W("toolbar.".concat(e.replace(/-[a-z]/g,(function(t){return t[1].toUpperCase()})))),this.activeTip=null===i?null:W("toolbar.".concat(i.replace(/-[a-z]/g,(function(t){return t[1].toUpperCase()})))),n&&(this.tip+=" (".concat(n,")")),this.tag=e,this.shortcut=n,this.value=r,this.el=this.element(),this.change=function(){}}return a()(t,[{key:"element",value:function(){var t=this.tip,e=this.activeTip;return f("div","".concat(ot,"-toolbar-btn")).on("mouseenter",(function(i){""!==t&&function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.classList.contains("active")||null!==i){var n=e.getBoundingClientRect(),r=n.left,o=n.top,a=n.width,s=n.height,l=e.classList.contains("active")?i:t,c=f("div","".concat(ot,"-tooltip")).html(l).show();document.body.appendChild(c.el);var h=c.box();c.css("left","".concat(r+a/2-h.width/2,"px")).css("top","".concat(o+s+2,"px")),Tt(e,"mouseleave",(function(){document.body.contains(c.el)&&document.body.removeChild(c.el)})),Tt(e,"click",(function(){document.body.contains(c.el)&&document.body.removeChild(c.el)}))}}(t,i.target,e)})).attr("data-tooltip",t)}},{key:"setState",value:function(){}}]),t}();function Pi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Di=function(t){tt()(i,t);var e=Pi(i);function i(){return l()(this,i),e.apply(this,arguments)}return a()(i,[{key:"dropdown",value:function(){}},{key:"getValue",value:function(t){return t}},{key:"element",value:function(){var t=this,e=this.tag;return this.dd=this.dropdown(),this.dd.change=function(i){return t.change(e,t.getValue(i))},Ai()(rt()(i.prototype),"element",this).call(this).child(this.dd)}},{key:"setState",value:function(t){t&&(this.value=t,this.dd.setTitle(t))}}]),i}(Ii);function Fi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Mi=function(t){tt()(i,t);var e=Fi(i);function i(t,n,r,o){var a,s;l()(this,i),(s=e.call(this,"div","".concat(ot,"-dropdown ").concat(o))).title=t,s.change=function(){},s.headerClick=function(){},"string"==typeof t?s.title=f("div","".concat(ot,"-dropdown-title")).child(t):r&&s.title.addClass("arrow-left"),s.contentEl=f("div","".concat(ot,"-dropdown-content")).css("width",n).hide();for(var c=arguments.length,h=new Array(c>4?c-4:0),u=4;u<c;u++)h[u-4]=arguments[u];return s.contentEl.tags=h.map((function(t){return t.tag})),(a=s).setContentChildren.apply(a,h),s.headerEl=f("div","".concat(ot,"-dropdown-header")),s.headerEl.on("click",(function(){if("block"!==s.contentEl.css("display")){if(s.show(),mobileAndTabletCheck()&&window.document.body.offsetWidth!==window.document.body.scrollWidth){if(s.menuDiv){for(var t=s.menuDiv.el,e=s.menuDiv.el.offsetParent;t.offsetParent&&"BODY"!==t.offsetParent.nodeName;)t=t.offsetParent;s.contentEl.el.clientWidth-t.offsetLeft>100&&(s.el.classList.replace("bottom-left","bottom-center"),s.contentEl.el.style.top+=e.offsetTop)}s.el.classList.contains("bottom-left")&&s.el.classList.replace("bottom-left","bottom-right"),s.el.classList.contains("top-left")&&s.el.classList.replace("top-left","top-right")}}else s.hide()})).children(s.title,r?f("div","".concat(ot,"-icon arrow-right")).child(f("div","".concat(ot,"-icon-img arrow-down"))):""),s.children(s.headerEl,s.contentEl),s}return a()(i,[{key:"setContentChildren",value:function(){var t;(this.contentEl.html(""),arguments.length>0)&&(t=this.contentEl).children.apply(t,arguments)}},{key:"showExplain",value:function(t){var e=this;if(this.contentEl.children().length===t.length)for(var i=function(i){Tt(e.contentEl.children()[i],"mouseover",(function(){var n=new te(t[i].title()),r=te.findDialog(e.contentEl),o={top:"".concat(e.contentEl.children()[i].offsetTop,"px")};if(0!==r.length)for(var a=0;a<r.length;a++)e.contentEl.removeChild(e.contentEl.children()[r[a]]);n.css(o),e.contentEl.child(n)})),Tt(e.contentEl.children()[i],"mouseout",(function(){var t=te.findDialog(e.contentEl);if(0!==t.length)for(var i=0;i<t.length;i++)e.contentEl.removeChild(e.contentEl.children()[t[i]])}))},n=0;n<t.length;n++)i(n)}},{key:"setTitle",value:function(t){this.title.html(t),this.hide()}},{key:"show",value:function(){var t=this;this.contentEl.show(),this.parent().active(),Rt(this.parent(),(function(){t.hide()}))}},{key:"hide",value:function(){this.parent().active(!1),this.contentEl.hide(),Et(this.parent())}}]),i}(u);function ji(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Li=function(t){tt()(i,t);var e=ji(i);function i(t,n){var r;l()(this,i);var o=new st("align-".concat(n)),a=t.map((function(t){return(e="align-".concat(t),f("div","".concat(ot,"-item")).child(new st(e))).on("click",(function(){r.setTitle(t),r.change(t)}));var e}));return r=e.call.apply(e,[this,o,"auto",!0,"bottom-left"].concat(v()(a)))}return a()(i,[{key:"setTitle",value:function(t){this.title.setName("align-".concat(t)),this.hide()}}]),i}(Mi);function Bi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var zi=function(t){tt()(i,t);var e=Bi(i);function i(t){return l()(this,i),e.call(this,"align",null,"",t)}return a()(i,[{key:"dropdown",value:function(){var t=this.value;return new Li(["left","center","right"],t)}}]),i}(Di);function Hi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Ni=function(t){tt()(i,t);var e=Hi(i);function i(t){return l()(this,i),e.call(this,"valign",null,"",t)}return a()(i,[{key:"dropdown",value:function(){var t=this.value;return new Li(["top","middle","bottom"],t)}}]),i}(Di);function Wi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Ui=function(t){tt()(i,t);var e=Wi(i);function i(){return l()(this,i),e.apply(this,arguments)}return a()(i,[{key:"element",value:function(){var t=this,e=this.tag;return Ai()(rt()(i.prototype),"element",this).call(this).child(new st(e)).on("click",(function(){return t.click()}))}},{key:"click",value:function(){this.change(this.tag,this.toggle())}},{key:"setState",value:function(t){this.el.active(t)}},{key:"toggle",value:function(){return this.el.toggle()}},{key:"active",value:function(){return this.el.hasClass("active")}}]),i}(Ii);function Xi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Yi=function(t){tt()(i,t);var e=Xi(i);function i(){return l()(this,i),e.call(this,"autofilter")}return a()(i,[{key:"setState",value:function(){}}]),i}(Ui);function Vi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Gi=function(t){tt()(i,t);var e=Vi(i);function i(){return l()(this,i),e.call(this,"font-bold",null,"Ctrl+B")}return i}(Ui);function qi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Ki=function(t){tt()(i,t);var e=qi(i);function i(){return l()(this,i),e.call(this,"font-italic",null,"Ctrl+I")}return i}(Ui);function Zi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Ji=function(t){tt()(i,t);var e=Zi(i);function i(){return l()(this,i),e.call(this,"strike")}return i}(Ui);function $i(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Qi=function(t){tt()(i,t);var e=$i(i);function i(){return l()(this,i),e.call(this,"underline",null,"Ctrl+U")}return i}(Ui),tn=["#ffffff","#000100","#e7e5e6","#445569","#5b9cd6","#ed7d31","#a5a5a5","#ffc001","#4371c6","#71ae47"],en=[["#f2f2f2","#7f7f7f","#d0cecf","#d5dce4","#deeaf6","#fce5d5","#ededed","#fff2cd","#d9e2f3","#e3efd9"],["#d8d8d8","#595959","#afabac","#adb8ca","#bdd7ee","#f7ccac","#dbdbdb","#ffe59a","#b3c6e7","#c5e0b3"],["#bfbfbf","#3f3f3f","#756f6f","#8596b0","#9cc2e6","#f4b184","#c9c9c9","#fed964","#8eaada","#a7d08c"],["#a5a5a5","#262626","#3a3839","#333f4f","#2e75b5","#c45a10","#7b7b7b","#bf8e01","#2f5596","#538136"],["#7f7f7f","#0c0c0c","#171516","#222a35","#1f4e7a","#843c0a","#525252","#7e6000","#203864","#365624"]],nn=["#c00000","#fe0000","#fdc101","#ffff01","#93d051","#00b04e","#01b0f1","#0170c1","#012060","#7030a0"];function rn(t){var e=this;return f("td","").child(f("div","".concat(ot,"-color-palette-cell")).on("click.stop",(function(){return e.change(t)})).css("background-color",t))}var on=function t(){var e,i,n,r=this;l()(this,t),this.el=f("div","".concat(ot,"-color-palette")),this.change=function(){};var o=f("table","").children((e=f("tbody","")).children.apply(e,[(i=f("tr","".concat(ot,"-theme-color-placeholders"))).children.apply(i,v()(tn.map((function(t){return rn.call(r,t)}))))].concat(v()(en.map((function(t){var e;return(e=f("tr","".concat(ot,"-theme-colors"))).children.apply(e,v()(t.map((function(t){return rn.call(r,t)}))))}))),[(n=f("tr","".concat(ot,"-standard-colors"))).children.apply(n,v()(nn.map((function(t){return rn.call(r,t)}))))])));this.el.child(o)};function an(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var sn=function(t){tt()(i,t);var e=an(i);function i(t,n){var r;l()(this,i);var o=new st(t).css("height","16px").css("border-bottom","3px solid ".concat(n)),a=new on;return a.change=function(t){r.setTitle(t),r.change(t)},r=e.call(this,o,"max-content",!1,"bottom-left",a.el)}return a()(i,[{key:"setTitle",value:function(t){this.title.css("border-color",t),this.hide()}}]),i}(Mi);function ln(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var cn=[["thin",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="1" style="user-select: none;"><line x1="0" y1="0.5" x2="50" y2="0.5" stroke-width="1" stroke="black" style="user-select: none;"></line></svg>'],["medium",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="2" style="user-select: none;"><line x1="0" y1="1.0" x2="50" y2="1.0" stroke-width="2" stroke="black" style="user-select: none;"></line></svg>'],["thick",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="3" style="user-select: none;"><line x1="0" y1="1.5" x2="50" y2="1.5" stroke-width="3" stroke="black" style="user-select: none;"></line></svg>'],["dashed",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="1" style="user-select: none;"><line x1="0" y1="0.5" x2="50" y2="0.5" stroke-width="1" stroke="black" stroke-dasharray="2" style="user-select: none;"></line></svg>'],["dotted",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="1" style="user-select: none;"><line x1="0" y1="0.5" x2="50" y2="0.5" stroke-width="1" stroke="black" stroke-dasharray="1" style="user-select: none;"></line></svg>']],hn=function(t){tt()(i,t);var e=ln(i);function i(t){var n;l()(this,i);var r=new st("line-type"),o=0,a=cn.map((function(e,i){return f("div","".concat(ot,"-item state ").concat(t===e[0]?"checked":"")).on("click",(function(){a[o].toggle("checked"),a[i].toggle("checked"),o=i,n.hide(),n.change(e)})).child(f("div","".concat(ot,"-line-type")).html(e[1]))}));return n=e.call.apply(e,[this,r,"max-content",!1,"bottom-left"].concat(v()(a)))}return i}(Mi);function un(){var t;return f("table","").child((t=f("tbody","")).children.apply(t,arguments))}function fn(t){var e=this;return f("td","").child(f("div","".concat(ot,"-border-palette-cell")).child(new st("border-".concat(t))).on("click",(function(){e.mode=t;var i=e.mode,n=e.style,r=e.color;e.change({mode:i,style:n,color:r})})))}var dn=function t(){var e,i,n=this;l()(this,t),this.color="#000",this.style="thin",this.mode="all",this.change=function(){},this.ddColor=new sn("line-color",this.color),this.ddColor.change=function(t){n.color=t},this.ddType=new hn(this.style),this.ddType.change=function(t){var e=r()(t,1)[0];n.style=e},this.el=f("div","".concat(ot,"-border-palette"));var o=un(f("tr","").children(f("td","".concat(ot,"-border-palette-left")).child(un((e=f("tr","")).children.apply(e,v()(["all","inside","horizontal","vertical","outside"].map((function(t){return fn.call(n,t)})))),(i=f("tr","")).children.apply(i,v()(["left","top","right","bottom","none"].map((function(t){return fn.call(n,t)})))))),f("td","".concat(ot,"-border-palette-right")).children(f("div","".concat(ot,"-toolbar-btn")).child(this.ddColor.el),f("div","".concat(ot,"-toolbar-btn")).child(this.ddType.el))));this.el.child(o)};function vn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var gn=function(t){tt()(i,t);var e=vn(i);function i(){var t;l()(this,i);var n=new st("border-all"),r=new dn;return r.change=function(e){t.change(e),t.hide()},t=e.call(this,n,"max-content",!1,"bottom-left",r.el)}return i}(Mi);function pn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var mn=function(t){tt()(i,t);var e=pn(i);function i(){return l()(this,i),e.call(this,"border")}return a()(i,[{key:"dropdown",value:function(){return new gn}}]),i}(Di);function yn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var bn=function(t){tt()(i,t);var e=yn(i);function i(){return l()(this,i),e.apply(this,arguments)}return a()(i,[{key:"element",value:function(){var t=this;return this.icon=new st(this.tag),Ai()(rt()(i.prototype),"element",this).call(this).child(this.icon).on("click",(function(){return t.change(t.tag)}))}},{key:"setState",value:function(t){this.el.disabled(t)}},{key:"setIcon",value:function(t){this.icon.setName(t)}}]),i}(Ii);function wn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var xn=function(t){tt()(i,t);var e=wn(i);function i(){return l()(this,i),e.call(this,"clearformat")}return i}(bn);function Cn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var kn=function(t){tt()(i,t);var e=Cn(i);function i(){return l()(this,i),e.call(this,"paintformat")}return a()(i,[{key:"setState",value:function(){}}]),i}(Ui);function _n(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Sn=function(t){tt()(i,t);var e=_n(i);function i(t){return l()(this,i),e.call(this,"color",null,void 0,t)}return a()(i,[{key:"dropdown",value:function(){var t=this.tag,e=this.value;return new sn(t,e)}}]),i}(Di);function Tn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var On=function(t){tt()(i,t);var e=Tn(i);function i(t){return l()(this,i),e.call(this,"bgcolor",null,void 0,t)}return a()(i,[{key:"dropdown",value:function(){var t=this.tag,e=this.value;return new sn(t,e)}}]),i}(Di);function En(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Rn=function(t){tt()(i,t);var e=En(i);function i(){var t;l()(this,i);var n=me.map((function(e){return f("div","".concat(ot,"-item")).on("click",(function(){t.setTitle("".concat(e.pt)),t.change(e)})).child("".concat(e.pt))}));return t=e.call.apply(e,[this,"10","60px",!0,"bottom-left"].concat(v()(n)))}return i}(Mi);function An(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var In=function(t){tt()(i,t);var e=An(i);function i(){return l()(this,i),e.call(this,"font-size")}return a()(i,[{key:"getValue",value:function(t){return t.pt}},{key:"dropdown",value:function(){return new Rn}}]),i}(Di);function Pn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Dn=function(t){tt()(i,t);var e=Pn(i);function i(){var t;l()(this,i);var n=[{text:"50%",number:.5},{text:"75%",number:.75},{text:"100%",number:1},{text:"125%",number:1.25},{text:"150%",number:1.5},{text:"175%",number:1.75},{text:"200%",number:2}].map((function(e){return f("div","".concat(ot,"-item")).on("click",(function(){t.setTitle("".concat(e.text)),t.change(e)})).child("".concat(e.text))}));return t=e.call.apply(e,[this,"10","60px",!0,"bottom-left"].concat(v()(n)))}return i}(Mi);function Fn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Mn=function(t){tt()(i,t);var e=Fn(i);function i(){return l()(this,i),e.call(this,"zoom-size")}return a()(i,[{key:"getValue",value:function(t){return t}},{key:"setState",value:function(t){"string"!=typeof t&&(t=100*t+"%"),Ai()(rt()(i.prototype),"setState",this).call(this,t)}},{key:"dropdown",value:function(){return new Dn}}]),i}(Di);function jn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Ln=function(t){tt()(i,t);var e=jn(i);function i(){var t;l()(this,i);var n=pe.map((function(e){return f("div","".concat(ot,"-item")).on("click",(function(){t.setTitle(e.title),t.change(e)})).child(e.title)}));return t=e.call.apply(e,[this,pe[0].title,"max-content",!0,"bottom-left"].concat(v()(n)))}return i}(Mi);function Bn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var zn=function(t){tt()(i,t);var e=Bn(i);function i(){return l()(this,i),e.call(this,"font-name")}return a()(i,[{key:"getValue",value:function(t){return t.key}},{key:"dropdown",value:function(){return new Ln}}]),i}(Di);function Hn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Nn=function(t){tt()(i,t);var e=Hn(i);function i(){var t;l()(this,i);var n=Se.slice(0);return n.splice(2,0,{key:"divider"}),n.splice(8,0,{key:"divider"}),n=n.map((function(e){var i=f("div","".concat(ot,"-item"));return"divider"===e.key?i.addClass("divider"):(i.child(e.title()).on("click",(function(){t.setTitle(e.title()),t.change(e)})),e.label&&i.child(f("div","label").html(e.label))),i})),t=e.call.apply(e,[this,"Normal","220px",!0,"bottom-left"].concat(v()(n)))}return a()(i,[{key:"setTitle",value:function(t){for(var e=0;e<Se.length;e+=1)Se[e].key===t&&this.title.html(Se[e].title());this.hide()}}]),i}(Mi);function Wn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Un=function(t){tt()(i,t);var e=Wn(i);function i(){return l()(this,i),e.call(this,"format")}return a()(i,[{key:"getValue",value:function(t){return t.key}},{key:"dropdown",value:function(){return new Nn}}]),i}(Di),Xn=i(8),Yn=i.n(Xn);function Vn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Gn=function(t){tt()(i,t);var e=Vn(i);function i(){var t,n;l()(this,i);var r=he.map((function(t){return f("div","".concat(ot,"-item")).on("click",(function(){n.hide(),n.change(t)})).child(t.key)}));return n=e.call.apply(e,[this,new st("formula"),"max-content",!0,"bottom-left"].concat(v()(r))),Ai()((t=Yn()(n),rt()(i.prototype)),"showExplain",t).call(t,he),n}return i}(Mi);function qn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Kn=function(t){tt()(i,t);var e=qn(i);function i(){return l()(this,i),e.call(this,"formula")}return a()(i,[{key:"getValue",value:function(t){return t.key}},{key:"dropdown",value:function(){return new Gn}}]),i}(Di);function Zn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Jn=function(t){tt()(i,t);var e=Zn(i);function i(){return l()(this,i),e.call(this,"freeze")}return i}(Ui);function $n(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Qn=function(t){tt()(i,t);var e=$n(i);function i(){return l()(this,i),e.call(this,"merge","unmerge")}return a()(i,[{key:"setState",value:function(t,e){this.el.active(t).disabled(e)}}]),i}(Ui);function tr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var er=function(t){tt()(i,t);var e=tr(i);function i(){return l()(this,i),e.call(this,"print","Ctrl+P")}return i}(bn);function ir(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var nr=function(t){tt()(i,t);var e=ir(i);function i(){return l()(this,i),e.call(this,"textwrap")}return i}(Ui);function rr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var or=function(t){tt()(i,t);var e=rr(i);function i(){var t;l()(this,i);var n=new st("ellipsis"),r=f("div","".concat(ot,"-toolbar-more"));return(t=e.call(this,n,"max-content",!1,"bottom-right",r)).moreBtns=r,screen.width<500?t.contentEl.css("max-width","200px"):t.contentEl.css("max-width","420px"),t}return i}(Mi),ar=function(t){tt()(i,t);var e=rr(i);function i(){var t;return l()(this,i),(t=e.call(this,"more")).el.hide(),t}return a()(i,[{key:"dropdown",value:function(){return new or}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){this.el.hide()}}]),i}(Di);function sr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var lr=function(t){tt()(i,t);var e=sr(i);function i(){return l()(this,i),e.call(this,"sort")}return i}(bn);function cr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var hr=function(t){tt()(i,t);var e=cr(i);function i(){return l()(this,i),e.call(this,"search")}return i}(bn);function ur(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var fr=function(t){tt()(i,t);var e=ur(i);function i(){return l()(this,i),e.call(this,"commentEdit")}return i}(bn);function dr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var vr=function(t){tt()(i,t);var e=dr(i);function i(){return l()(this,i),e.call(this,"commentRemove")}return i}(bn);function gr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var pr=function(t){tt()(i,t);var e=gr(i);function i(){return l()(this,i),e.call(this,"commentPrevious")}return i}(bn);function mr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var yr=function(t){tt()(i,t);var e=mr(i);function i(){return l()(this,i),e.call(this,"commentNext")}return i}(bn);function br(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var wr=function(t){tt()(i,t);var e=br(i);function i(){var t;l()(this,i);var n=new st("".concat(ot,"-icon-img insert-image")),r=f("div","".concat(ot,"-item")),o=f("input");o.attr({type:"file",name:"photo",id:"upload-image",style:"display:none;",accept:"image/*"}),r.tag="fromLocal";var a=f("label");a.attr("for","upload-image"),a.child(new st("".concat(ot,"-icon-img insert-image-local"))),a.child(" "+W("menubar.".concat(r.tag))),r.child(o),r.child(a),r.on("click",(function(){t.change("local")}));var s,c=(s="".concat(ot,"-icon-img insert-image-url"),f("div","".concat(ot,"-item")).child(new st(s)));return c.tag="fromURL",c.child(" "+W("menubar.".concat(c.tag))),c.on("click",(function(){t.change("url")})),t=e.call.apply(e,[this,n,"auto",!0,"bottom-left"].concat([r,c]))}return i}(Mi);function xr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Cr=function(t){tt()(i,t);var e=xr(i);function i(t){return l()(this,i),e.call(this,"insert-image",null,"",t)}return a()(i,[{key:"dropdown",value:function(){return new wr}}]),i}(Di);function kr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var _r=function(t){tt()(i,t);var e=kr(i);function i(){var t;return l()(this,i),(t=e.call(this,"menu-display-hide","")).state="up",t}return a()(i,[{key:"setUp",value:function(){this.setIcon("menu-display-hide"),this.state="up"}},{key:"setDown",value:function(){this.setIcon("menu-display-show"),this.state="down"}}]),i}(bn);function Sr(){return f("div","".concat(ot,"-toolbar-divider"))}function Tr(){var t=this;this.btns2=[],this.items.forEach((function(e){if(Array.isArray(e))e.forEach((function(e){var i=e.el,n=i.box(),r=i.computedStyle(),o=r.marginLeft,a=r.marginRight;t.btns2.push([i,n.width+parseInt(o,10)+parseInt(a,10)])}));else{var i=e.box(),n=e.computedStyle(),r=n.marginLeft,o=n.marginRight;t.btns2.push([e,i.width+parseInt(r,10)+parseInt(o,10)])}}))}function Or(){var t,e,i=this.el,n=this.btns,o=this.moreEl,a=this.btns2,s=o.dd,l=s.moreBtns,c=s.contentEl,h=i.box(),u=100,f=12,d=[],v=[];a.forEach((function(t,e){var i=r()(t,2),n=i[0],o=i[1];u+=o,e===a.length-1||u<h.width?d.push(n):(f+=o,v.push(n))})),(t=n.html("")).children.apply(t,d),(e=l.html("")).children.apply(e,v),c.css("width","".concat(f,"px")),v.length>0?o.show():o.hide()}var Er=function(){function t(e,i,n,r){var o=this;l()(this,t),this.data=e,this.change=function(){},this.widthFn=i,this.isHide=n;var a=e.defaultStyle();this.items=[[new er,this.paintformatEl=new kn,this.clearformatEl=new xn],Sr(),[this.formatEl=new Un],Sr(),[this.fontEl=new zn,this.fontSizeEl=new In],Sr(),[this.zoomSizeEl=new Mn,this.boldEl=new Gi,this.italicEl=new Ki,this.underlineEl=new Qi,this.strikeEl=new Ji,this.textColorEl=new Sn(a.color)],Sr(),[this.fillColorEl=new On(a.bgcolor),this.borderEl=new mn,this.mergeEl=new Qn],Sr(),[this.alignEl=new zi(a.align),this.valignEl=new Ni(a.valign),this.textwrapEl=new nr],Sr(),[this.freezeEl=new Jn,this.autofilterEl=new Yi,this.formulaEl=new Kn,this.sortEl=new lr,this.insertImageEL=new Cr,this.searchEl=new hr],Sr(),[this.commentEditEl=new fr,this.commentRemoveEl=new vr,this.commentPreviousEl=new pr,this.commentNextEl=new yr],Sr(),[this.moreEl=new ar]],screen.width<500&&this.items[0].splice(0,1),n&&r&&(this.items=[[new er,this.moreEl=new ar,this.sortEl=new lr,this.searchEl=new hr]]),this.el=f("div","".concat(ot,"-toolbar")),this.btns=f("div","".concat(ot,"-toolbar-btns")),this.items.forEach((function(t){Array.isArray(t)?t.forEach((function(t){o.btns.child(t.el),t.change=function(){o.change.apply(o,arguments)}})):o.btns.child(t.el)}));var s=this.menuDisplay=new _r;s.change=function(){o.change.apply(o,arguments)},this.el.children(this.btns.el,s.el),n&&!r?this.el.hide():(this.reset(),setTimeout((function(){Tr.call(o),Or.call(o)}),0),Tt(window,"resize",(function(){Or.call(o)})))}return a()(t,[{key:"paintformatActive",value:function(){return this.paintformatEl.active()}},{key:"paintformatToggle",value:function(){this.paintformatEl.toggle()}},{key:"trigger",value:function(t){this["".concat(t,"El")].click()}},{key:"resetData",value:function(t){this.data=t,this.reset()}},{key:"reset",value:function(){if(!this.isHide){var t=this.data,e=t.getSelectedCellStyle();this.mergeEl.setState(t.canUnmerge(),!1),this.autofilterEl.setState(!t.canAutofilter());var i=e.font,n=e.format;this.formatEl.setState(n),this.fontEl.setState(i.name),this.fontSizeEl.setState(i.size),this.zoomSizeEl.setState(t.zoomlevel),this.boldEl.setState(i.bold),this.italicEl.setState(i.italic),this.underlineEl.setState(e.underline),this.strikeEl.setState(e.strike),this.textColorEl.setState(e.color),this.fillColorEl.setState(e.bgcolor),this.alignEl.setState(e.align),this.valignEl.setState(e.valign),this.textwrapEl.setState(e.textwrap),this.freezeEl.setState(t.freezeIsActive())}}}]),t}(),Rr=function(){function t(e,i){var n,r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"600px",a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];l()(this,t),this.moving=!1,this.drag=s,this.title=e;var c=parseInt(o);screen.width<500&&c>300&&(o="300px"),this.el=f("div","".concat(ot,"-modal")).css("width",o).css("position","absolute").children(f("div","".concat(ot,"-modal-header")).children(new st("close").on("click.stop",(function(){return r.hide()})),this.title),(n=f("div","".concat(ot,"-modal-content"))).children.apply(n,v()(i))).hide(),this.showDimmer=a,this.drag&&this.el.on("mousedown.stop",(function(t){return r.mousedownHandler(t)}))}return a()(t,[{key:"show",value:function(){var t=this;if(!this.moving){this.showDimmer&&(this.dimmer=f("div","".concat(ot,"-dimmer active")),document.body.appendChild(this.dimmer.el));var e=this.el.show().box(),i=e.width,n=e.height,r=document.documentElement,o=r.clientHeight,a=r.clientWidth;this.el.offset({left:(a-i)/2,top:(o-n)/3}),window.xkeydownEsc=function(e){27===e.keyCode&&t.hide()},Tt(window,"keydown",window.xkeydownEsc)}}},{key:"hide",value:function(){this.el.hide(),this.showDimmer&&document.body.removeChild(this.dimmer.el),Ot(window,"keydown",window.xkeydownEsc),delete window.xkeydownEsc}},{key:"mousedownHandler",value:function(t){var e=this,i=t;At(window,(function(t){if(e.moving=!0,null!==i){var n=e.el.offset(void 0);e.el.offset({left:n.left+t.movementX,top:n.top+t.movementY}),i=t}}),(function(){i=null,e.moving=!1}))}}]),t}(),Ar=function(){function t(e,i){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200;l()(this,t),this.vchange=function(){},this.el=f("div","".concat(ot,"-form-input")),this.input=f("input","").css("width",e).on("input",(function(t){return n.vchange(t)})).attr("placeholder",i).attr("maxlength",r),this.el.child(this.input)}return a()(t,[{key:"focus",value:function(){var t=this;setTimeout((function(){t.input.el.focus()}),10)}},{key:"hint",value:function(t){this.input.attr("placeholder",t)}},{key:"setReadonly",value:function(t){t?this.input.attr("readonly",""):this.input.removeAttr("readonly")}},{key:"val",value:function(t){return this.input.val(t)}}]),t}();function Ir(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return Pr(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Pr(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function Pr(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var Dr=function(){function t(e,i,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(t){return t},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){};l()(this,t),this.key=e,this.getTitle=o,this.change=a,this.width=n,this.vchange=function(){},this.items=[],this.itemsmap=new Map,this.el=f("div","".concat(ot,"-form-select")),this.suggest=new oe(i.map((function(t){return{key:t,title:r.getTitle(t)}})),(function(t){r.itemClick(t.key),a(t.key),r.vchange(t.key)}),n,this.el),this.el.children(this.itemEl=f("div","input-text").html(this.getTitle(e)),this.suggest.el).on("click",(function(){return r.show()}))}return a()(t,[{key:"show",value:function(){this.suggest.search("")}},{key:"itemClick",value:function(t){this.key=t,this.itemsmap.size>0?this.itemEl.html(this.itemsmap.get(t)):this.itemEl.html(this.getTitle(t))}},{key:"setItemsMap",value:function(t){var e=this;this.itemsmap=t;var i,n=[],o=Ir(t);try{for(o.s();!(i=o.n()).done;){var a=r()(i.value,2),s=a[0],l=a[1];n.push({key:s,title:l})}}catch(t){o.e(t)}finally{o.f()}this.suggest=new oe(n,(function(t){e.itemClick(t.key),e.change(t.key),e.vchange(t.key)}),this.width,this.el),t.size>6&&this.suggest.el.css("height","200px"),this.el.empty(),this.el.children(this.itemEl=f("div","input-text").html(n[0].title),this.suggest.el)}},{key:"val",value:function(t){return void 0!==t?(this.key=t,this.itemsmap.size>0?this.itemEl.html(this.itemsmap.get(t)):this.itemEl.html(this.getTitle(t)),this):this.key}}]),t}(),Fr={number:/(^\d+$)|(^\d+(\.\d{0,4})?$)/,date:/^\d{4}-\d{1,2}-\d{1,2}$/},Mr=function(){function t(e,i,n,r){var o=this;l()(this,t),this.label="",this.rule=i,n&&(this.label=f("label","label").css("width","".concat(r,"px")).html(n)),this.tip=f("div","tip").child("tip").hide(),this.input=e,this.input.vchange=function(){return o.validate()},this.el=f("div","".concat(ot,"-form-field")).children(this.label,e.el,this.tip)}return a()(t,[{key:"isShow",value:function(){return"none"!==this.el.css("display")}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){return this.el.hide(),this}},{key:"val",value:function(t){return this.input.val(t)}},{key:"hint",value:function(t){this.input.hint(t)}},{key:"validate",value:function(){var t=this.input,e=this.rule,i=this.tip,n=this.el,r=t.val();if(e.required&&/^\s*$/.test(r))return i.html(W("validation.required")),n.addClass("error"),!1;if((e.type||e.pattern)&&!(e.pattern||Fr[e.type]).test(r))return i.html(W("validation.notMatch")),n.addClass("error"),!1;return n.removeClass("error"),!0}},{key:"validateFail",value:function(t){var e=this.el,i=this.tip;e.addClass("error"),i.html(t),i.show()}},{key:"validateClear",value:function(){var t=this.el,e=this.tip;t.removeClass("error"),e.html(""),e.hide()}}]),t}();function jr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Lr=function(t){tt()(i,t);var e=jr(i);function i(){var t;l()(this,i);var n=new Mr(new Dr("cell",["cell"],"100%",(function(t){return W("dataValidation.modeType.".concat(t))})),{required:!0},"".concat(W("dataValidation.range"),":"),100),r=new Mr(new Ar("120px","E3 or E3:F12"),{required:!0,pattern:/^([A-Z]{1,2}[1-9]\d*)(:[A-Z]{1,2}[1-9]\d*)?$/}),o=new Mr(new Dr("list",["list","number","date","phone","email"],"100%",(function(t){return W("dataValidation.type.".concat(t))}),(function(e){return t.criteriaSelected(e)})),{required:!0},"".concat(W("dataValidation.criteria"),":"),100),a=new Mr(new Dr("be",["be","nbe","eq","neq","lt","lte","gt","gte"],"160px",(function(t){return W("dataValidation.operator.".concat(t))}),(function(e){return t.criteriaOperatorSelected(e)})),{required:!0}).hide(),s=new Mr(new Ar("70px","10"),{required:!0}).hide(),c=new Mr(new Ar("70px","100"),{required:!0,type:"number"}).hide(),h=new Mr(new Ar("120px","a,b,c"),{required:!0}),u=new Mr(new Ar("70px","10"),{required:!0,type:"number"}).hide();return(t=e.call(this,W("contextmenu.validation"),[f("div","".concat(ot,"-form-fields")).children(n.el,r.el),f("div","".concat(ot,"-form-fields")).children(o.el,a.el,s.el,c.el,u.el,h.el),f("div","".concat(ot,"-buttons")).children(new pi("cancel").on("click",(function(){return t.btnClick("cancel")})),new pi("remove").on("click",(function(){return t.btnClick("remove")})),new pi("save","primary").on("click",(function(){return t.btnClick("save")})))])).mf=n,t.rf=r,t.cf=o,t.of=a,t.minvf=s,t.maxvf=c,t.vf=u,t.svf=h,t.change=function(){},t}return a()(i,[{key:"showVf",value:function(t){var e="date"===t?"2018-11-12":"10",i=this.vf;i.input.hint(e),i.show()}},{key:"criteriaSelected",value:function(t){var e=this.of,i=this.minvf,n=this.maxvf,r=this.vf,o=this.svf;"date"===t||"number"===t?(e.show(),i.rule.type=t,n.rule.type=t,"date"===t?(i.hint("2018-11-12"),n.hint("2019-11-12")):(i.hint("10"),n.hint("100")),i.show(),n.show(),r.hide(),o.hide()):("list"===t?o.show():o.hide(),r.hide(),e.hide(),i.hide(),n.hide())}},{key:"criteriaOperatorSelected",value:function(t){if(t){var e=this.minvf,i=this.maxvf,n=this.vf;if("be"===t||"nbe"===t)e.show(),i.show(),n.hide();else{var r=this.cf.val();n.rule.type=r,"date"===r?n.hint("2018-11-12"):n.hint("10"),n.show(),e.hide(),i.hide()}}}},{key:"btnClick",value:function(t){if("cancel"===t)this.hide();else if("remove"===t)this.change("remove"),this.hide();else if("save"===t){for(var e=["mf","rf","cf","of","svf","vf","minvf","maxvf"],i=0;i<e.length;i+=1){var n=this[e[i]];if(n.isShow()&&!n.validate())return}var r=this.mf.val(),o=this.rf.val(),a=this.cf.val(),s="phone"===a||"email"===a?"":this.of.val(),l=this.svf.val();"number"!==a&&"date"!==a||(l="be"===s||"nbe"===s?[this.minvf.val(),this.maxvf.val()]:this.vf.val()),this.change("save",r,o,{type:a,operator:s,required:!1,value:l}),this.hide()}}},{key:"setValue",value:function(t){if(t){var e=this.mf,i=this.rf,n=this.cf,r=this.of,o=this.svf,a=this.vf,s=this.minvf,l=this.maxvf,c=t.mode,h=t.ref,u=t.validator||{type:"list"},f=u.type,d=u.operator,v=u.value;e.val(c||"cell"),i.val(h),n.val(f),r.val(d),Array.isArray(v)?(s.val(v[0]),l.val(v[1])):(o.val(v||""),a.val(v||"")),this.criteriaSelected(f),this.criteriaOperatorSelected(d)}this.show()}}]),i}(Rr),Br=function(){function t(e,i){l()(this,t),this.el=f("input","".concat(ot,"-form-checkbox")).css("width",e).attr("type","Checkbox")}return a()(t,[{key:"hint",value:function(t){this.el.attr("placeholder",t)}},{key:"val",value:function(t){if(void 0===t)return this.el.el.checked;this.el.el.checked=t}}]),t}();function zr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Hr=function(t){tt()(i,t);var e=zr(i);function i(){var t;l()(this,i);var n=new Mr(new Ar("60px",""),{required:!0,pattern:/^([A-Z]{1,2}[1-9]\d*)(:[A-Z]{1,2}[1-9]\d*)?$/},"".concat(W("dataSort.ci"),":"),60),r=new Mr(new Dr(0,[],"180px",(function(){}),(function(){})),{required:!0},"".concat(W("dataSort.sortby"),":"),60),o=new Mr(new Dr("desc",["asc","desc"],"100%",(function(t){return W("dataSort.order.".concat(t))}),(function(){})),{required:!0},"".concat(W("dataSort.criteria"),":"),60),a=new Mr(new Dr(0,[],"180px",(function(){}),(function(){})),{required:!0},"".concat(W("dataSort.sortby"),":"),60),s=new Mr(new Dr("desc",["asc","desc"],"100%",(function(t){return W("dataSort.order.".concat(t))}),(function(){})),{required:!0},"".concat(W("dataSort.criteria"),":"),60),c=new Mr(new Dr(0,[],"180px",(function(){}),(function(){})),{required:!0},"".concat(W("dataSort.sortby"),":"),60),h=new Mr(new Dr("desc",["asc","desc"],"100%",(function(t){return W("dataSort.order.".concat(t))}),(function(){})),{required:!0},"".concat(W("dataSort.criteria"),":"),60);n.input.setReadonly(!0);var u=new Br("60px","");u.el.on("click",(function(){return t.myHeaderClick()})),u.val(!0);var d=new pi("del","formbt").on("click",(function(){return t.btnClick("del",1)})),v=f("div","".concat(ot,"-form-fields")).children(a.el,s.el,f("div","".concat(ot,"-buttons")).children(new pi("add","formbt").on("click",(function(){return t.btnClick("add",2)})),d)),g=f("div","".concat(ot,"-form-fields")).children(c.el,h.el,new pi("del","formbt").on("click",(function(){return t.btnClick("del",2)})));return(t=e.call(this,W("contextmenu.sort"),[f("div","".concat(ot,"-form-fields")).children(n.el,new Mr(u,{required:!1},"".concat(W("dataSort.header"),":"),120).el),f("div","".concat(ot,"-form-fields")).children(r.el,o.el,new pi("add","formbt").on("click",(function(){return t.btnClick("add",1)}))),v,g,f("div","".concat(ot,"-buttons")).children(new pi("ok","primary").on("click",(function(){return t.btnClick("ok")})),new pi("cancel").on("click",(function(){return t.btnClick("cancel")})))])).cf=n,t.of1=o,t.sortby1=r,t.of2=s,t.sortby2=a,t.of3=h,t.sortby3=c,t.ci1=null,t.ci2=null,t.ci3=null,t.values=[],t.mcols=null,t.mcolsheader=null,t.cicount=1,t.div2=v,t.div3=g,t.but2=d,t.sc=1,t.myheader=u,v.hide(),g.hide(),t.change=function(){},t}return a()(i,[{key:"btnClick",value:function(t,e){if("ok"===t){if(!this.cf.validate())return;var i=[],n=[];if(i.push(this.of1.val()),n.push(this.sortby1.val()),this.sc>=2&&(i.push(this.of2.val()),n.push(this.sortby2.val())),this.sc>=3&&(i.push(this.of3.val()),n.push(this.sortby3.val())),new Set(n).size<n.length)return void lt("error","".concat(W("dataSort.msg")));this.change("ok",n,i,this.myheader.val()),this.hide()}else"add"===t?1===e?(this.div2.css("display",""),this.sc=2):2===e&&(this.div3.css("display",""),this.but2.hide(),this.sc=3):"del"===t?1===e?(this.div2.hide(),this.sc=1):2===e&&(this.div3.hide(),this.but2.css("display",""),this.sc=2):"cancel"===t&&this.hide()}},{key:"myHeaderClick",value:function(){var t=this.mcols,e=this.mcolsheader,i=this.myheader,n=this.sortby1,r=this.sortby2,o=this.sortby3,a=i.val()?t:e;n.input.setItemsMap(a),n.val(0),r.input.setItemsMap(a),r.val(1),o.input.setItemsMap(a),o.val(2)}},{key:"setValue",value:function(t){if(null!=t){if(t){var e=this.cf,i=this.of1,n=this.sortby1,r=this.of2,o=this.sortby2,a=this.of3,s=this.sortby3,l=t.ref,c=t.sort,h=t.ci,u=t.m,f=t.mcols,d=t.mcolsheader,v=(c[0]||{order:"asc"}).order1,g=(c[1]||{order:"asc"}).order2,p=(c[2]||{order:"asc"}).order3;e.val(l),i.val(v),r.val(g),a.val(p),this.mcols=f,this.mcolsheader=d,this.myheader.val(1);for(var m=[],y=0;y<f.length;y++)m.push(y);n.input.setItemsMap(f),n.val(0),o.input.setItemsMap(f),o.val(1),s.input.setItemsMap(f),s.val(2),this.ci=h,this.values=u}this.show()}}}]),i}(Rr);function Nr(t){return f("div","".concat(ot,"-item ").concat(t))}function Wr(t){var e=this;return Nr("state").child(W("sort.".concat(t))).on("click.stop",(function(){return e.itemClick(t)}))}function Ur(t){var e=this,i=this.filterbEl,n=this.filterValues;i.html(""),Object.keys(t).forEach((function(r,o){var a=t[r],s=n.includes(r)?"checked":"";i.child(f("div","".concat(ot,"-item state ").concat(s)).on("click.stop",(function(){return e.filterClick(o,r)})).children(""===r?W("filter.empty"):r,f("div","label").html("(".concat(a,")"))))}))}function Xr(){var t=this.filterhEl,e=this.filterValues,i=this.values;t.html("".concat(e.length," / ").concat(i.length)),t.checked(e.length===i.length)}var Yr=function(){function t(){var e=this;l()(this,t),this.filterbEl=f("div","".concat(ot,"-body")),this.filterhEl=f("div","".concat(ot,"-header state")).on("click.stop",(function(){return e.filterClick(0,"all")})),this.el=f("div","".concat(ot,"-sort-filter")).children(this.sortAscEl=Wr.call(this,"asc"),this.sortDescEl=Wr.call(this,"desc"),Nr("divider"),f("div","".concat(ot,"-filter")).children(this.filterhEl,this.filterbEl),f("div","".concat(ot,"-buttons")).children(new pi("cancel").on("click",(function(){return e.btnClick("cancel")})),new pi("ok","primary").on("click",(function(){return e.btnClick("ok")})))).hide(),this.ci=null,this.sortDesc=null,this.values=null,this.filterValues=[]}return a()(t,[{key:"btnClick",value:function(t){if("ok"===t){var e=this.ci,i=this.sort,n=this.filterValues;this.ok&&this.ok(e,i,"in",n)}this.hide()}},{key:"itemClick",value:function(t){this.sort=t;var e=this.sortAscEl,i=this.sortDescEl;e.checked("asc"===t),i.checked("desc"===t)}},{key:"filterClick",value:function(t,e){var i=this.filterbEl,n=this.filterValues,r=this.values,o=i.children();"all"===e?o.length===n.length?(this.filterValues=[],o.forEach((function(t){return f(t).checked(!1)}))):(this.filterValues=Array.from(r),o.forEach((function(t){return f(t).checked(!0)}))):f(o[t]).toggle("checked")?n.push(e):n.splice(n.findIndex((function(t){return t===e})),1);Xr.call(this)}},{key:"set",value:function(t,e,i,n){this.ci=t;var r=this.sortAscEl,o=this.sortDescEl;null!==n?(this.sort=n.order,r.checked(n.asc()),o.checked(n.desc())):(this.sortDesc=null,r.checked(!1),o.checked(!1)),this.values=Object.keys(e),this.filterValues=i?Array.from(i.value):Object.keys(e),Ur.call(this,e,i),Xr.call(this)}},{key:"setOffset",value:function(t){var e=this;this.el.offset(t).show();var i=1;Rt(this.el,(function(){i<=0&&(e.hide(),i=5),i-=1}))}},{key:"setOffsetAdjustView",value:function(t,e,i){var n=this;this.el.show();var r=this.el.offset(),o=r.width,a=r.height;t.top+a>i&&(t.top=i-a),t.left+o>e&&(t.left=e-o),this.el.offset(t);var s=1;Rt(this.el,(function(){s<=0&&(n.hide(),s=5),s-=1}))}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){this.el.hide(),Et(this.el)}}]),t}(),Vr=function(){function t(){l()(this,t),xt()(this,"onEdit",!1),this.el=f("div","".concat(ot,"-comment-tip")).hide()}return a()(t,[{key:"hide",value:function(){this.el.hide()}},{key:"setPosition",value:function(t,e,i){if(!0!==this.onEdit){var n=this.el,r=i?e.left-e.width-1:e.left+e.width,o=e.top-10;n.css("left","".concat(r,"px")),n.css("top","".concat(o,"px")),n.html(t).show(),i&&n.css("left","".concat(r-n.el.offsetWidth,"px"))}}}]),t}();function Gr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var qr=function(t){tt()(i,t);var e=Gr(i);function i(){var t;l()(this,i);var n=new Mr(new Ar("80px",""),{required:!0},"".concat(W("dataSearch.label"),":"),100),r=new Mr(new Br("80px",""),{required:!1},"".concat(W("dataSort.casesense"),":"),100),o=new Mr(new Br("30px",""),{required:!1},"".concat(W("dataSearch.matchwhole"),":"),150),a=new Mr(new Dr("values",["values","formulas","comments"],"120px",(function(t){return W("dataSearch.lookin.".concat(t))}),(function(){})),{required:!0},"".concat(W("dataSearch.lkinlb"),":"),100);return(t=e.call(this,W("toolbar.search"),[f("div","".concat(ot,"-form-fields")).children(r.el,o.el),f("div","".concat(ot,"-form-fields")).child(n.el),f("div","".concat(ot,"-form-fields")).child(a.el),f("div","".concat(ot,"-buttons")).children(new pi("previous").on("click",(function(){return t.btnClick("previous")})),new pi("next").on("click",(function(){return t.btnClick("next")})),new pi("close","primary").on("click",(function(){return t.btnClick("close")})))],"500px",!1,!0)).formField=n,t.casesense=r,t.lookin=a,t.matchwhole=o,t.change=function(){},t}return a()(i,[{key:"btnClick",value:function(t){if("close"!==t){if(!this.formField.validate())return;var e=this.casesense.val(),i=this.lookin.val(),n=this.matchwhole.val(),r=this.formField.val().trim();switch(t){case"previous":this.change("previous",r,e,i,n);break;case"next":this.change("next",r,e,i,n)}}else this.hide()}},{key:"show",value:function(){Ai()(rt()(i.prototype),"show",this).call(this),this.formField.input.focus()}}]),i}(Rr),Kr=function(){function t(e,i){var n=this;l()(this,t),this.data=e,this.mode=i,this.ishtml=!1,this.inputChange=function(){},this.enter=function(){},this.tab=function(){},this.focuson=function(){},this.el=f("div","".concat(ot,"-formula-bar")),this.barLabel=f("div","".concat(ot,"-bar-label")),this.formulaInput=f("div","".concat(ot,"-formula-input")).on("input",(function(t){n.inputChange(n.ishtml?t.target.innerHTML:t.target.innerText)})).on("focus",(function(t){n.focuson()})).on("keydown",(function(t){var e=t.keyCode||t.which;13===e?(t.altKey||n.formulaInput.el.blur(),n.enter(t,n.ishtml)):9===e&&(n.formulaInput.el.blur(),n.tab(t))})),"read"===this.mode?this.formulaInput.attr("disabled","disabled"):this.formulaInput.attr("contenteditable","true"),this.el.children(this.barLabel,this.formulaInput),this.reset()}return a()(t,[{key:"resetData",value:function(t){this.data=t,this.reset()}},{key:"reset",value:function(){var t=this.data,e=t.selector,i=p(e.ci)+""+(e.ri+1),n=t.getSelectedCell(),r="",o=!1;n&&(n.html?(r=n.html,this.ishtml=!0):(this.ishtml=!1,n.f?r=n.f:n.ufv?r=n.ufv:n.text&&(r=n.text,o=!0))),this.barLabel.html(i),this.formulaInput.html(r,!this.ishtml,o)}}]),t}();function Zr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Jr=function(t){tt()(i,t);var e=Zr(i);function i(){var t;return l()(this,i),t=e.call(this),xt()(Yn()(t),"col",void 0),xt()(Yn()(t),"row",void 0),t.el.attr("contentEditable","true"),t.el.attr("placeholder","".concat(W("toolbar.commentDefault"))),t.el.attr("id","commentEdit"),t}return a()(i,[{key:"saveAndHide",value:function(t){var e=this;if(void 0!==this.col&&void 0!==this.row){if(""!==this.el.html()){for(var i=-1,n=0;n<t.data.comments.length;n++)if(t.data.comments[n].col===this.col&&t.data.comments[n].row===this.row){i=n;break}-1===i?t.data.comments.push({col:this.col,row:this.row,author:"Aspose",note:this.el.html()}):t.data.comments[i].note=this.el.html()}t.data.comments=t.data.comments.filter((function(t){return!e.checkEmptyContent(t.note)})),this.hide(),t.commentTip.onEdit=!1,this.col=void 0,this.row=void 0}}},{key:"checkEmptyContent",value:function(t){var e=document.createElement("div");return e.innerHTML=t,""===e.innerText}},{key:"setPosition",value:function(t,e,n){Ai()(rt()(i.prototype),"setPosition",this).call(this,t,e,n),this.el.focus()}}]),i}(Vr),$r=i(10),Qr=function(){function t(){l()(this,t),xt()(this,"name",void 0)}return a()(t,[{key:"execute",value:function(t){}}]),t}();function to(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}function eo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function io(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?eo(Object(i),!0).forEach((function(e){xt()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):eo(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function no(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}function ro(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function oo(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ro(Object(i),!0).forEach((function(e){xt()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ro(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function ao(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var so=[function(t){tt()(i,t);var e=to(i);function i(){var t;l()(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t=e.call.apply(e,[this].concat(r)),xt()(Yn()(t),"name","delete"),t}return a()(i,[{key:"execute",value:function(t){var e=t.canvas,i=t.data,n=e.fabric,r=n.getActiveObject(),o=e.findObjByData(r.id,i);if(o)if(o.op="del",i.canvasFreeze){var a=i.canvasFreeze;[a.br,a.bl,a.tr,a.tl].forEach((function(t){t.remove(e.findObjInCanvas(t,r.id)),e.saveCanvasData(i,t),t.renderAll()}))}else n.remove(r),n.renderAll(),e.saveCanvasData(i,n)}}]),i}(Qr),function(t){tt()(r,t);var e,i,n=no(r);function r(){var t;l()(this,r);for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];return t=n.call.apply(n,[this].concat(i)),xt()(Yn()(t),"name","paste"),xt()(Yn()(t),"canvas",void 0),xt()(Yn()(t),"sheet",void 0),xt()(Yn()(t),"inFreeze",void 0),t}return a()(r,[{key:"execute",value:(i=bt()(kt.a.mark((function t(e){var i,n,r,o,a;return kt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.canvas.clipboard,this.canvas=null!==(i=this.canvas)&&void 0!==i?i:e.canvas.fabric,this.sheet=null!==(n=this.sheet)&&void 0!==n?n:e,this.inFreeze=null!==(r=this.inFreeze)&&void 0!==r?r:e.canvas.inFreeze,a=this,o){t.next=7;break}return t.abrupt("return");case 7:return t.next=9,o.clonedObj.clone(function(){var t=bt()(kt.a.mark((function t(i){var n;return kt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n=fabric.util.object.clone(i),a.setImagePosition(n),e.canvas.setLoading(e,{left:n.left,top:n.top}),t.next=6,a.addImageToData(n);case 6:a.setImageEventAndLayout(n),a.addImageToCanvas(n)?a.reactiveObj(n):a.rollback(a.sheet,n),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(0),console.error(t.t0),lt(t.t0);case 14:return t.prev=14,e.canvas.removeLoading(e),t.finish(14);case 17:case"end":return t.stop()}}),t,null,[[0,10,14,17]])})));return function(e){return t.apply(this,arguments)}}(),["id","tick","imgType","zorder","strid"]);case 9:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"rollback",value:function(t,e){var i=t.data,n=t.canvas;n.fabric.remove(n.fabric.getObjects()[n.fabric.getObjects().findIndex((function(t){return t.id===e.id}))]),n.saveCanvasData(t.data,n.fabric),n.inFreeze&&(n.inFreeze.removeImage(e.id),n.removeImageInData(i,e.id))}},{key:"setImagePosition",value:function(t){var e=this.sheet.data,i=this.sheet.getTableOffset(),n=0,r=0;if(!t)throw"no cloneObj";if(!this.canvas)throw"no canvas";if(!this.sheet)throw"no sheet data";if(this.canvas.getActiveObject()){var o=this.canvas.getActiveObject();n=o.left+20,r=o.top+20}else{var a=e.getSelectedRect();if(!a)throw"get selected rect value is null";n=a.left+i.left,r=a.top+i.top}t.set({left:n,top:r,evented:!0}),this.sheet.canvas.edgeCollision(t)}},{key:"addImageToCanvas",value:function(t){var e=this,i=this.canvas,n=this.sheet.data;if(n.name!==this.sheet.canvas.clipboard.sheetName)return!1;if(n.canvasFreeze){var r=n.canvasFreeze;[r.br,r.bl,r.tr,r.tl].forEach((function(i){var n=fabric.util.object.clone(t),r=e.inFreeze.getOffsetWhenIndividualCanvasMovement(i.canvasName);n.set({top:n.top+r.y,left:n.left+r.x}),i.add(n),n.setCoords()}))}else t.setCoords(),i.add(t);return!0}},{key:"addImageToData",value:(e=bt()(kt.a.mark((function t(e){var i,n,r,o,a,s,l,c,h,u;return kt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=this.sheet,n=this.sheet.canvas.data,r=i.canvas.clipboard.newData,o=io({},r),a=this.sheet.getTableOffset(),s={ri:n.selector.ri,ci:n.selector.ci,name:n.name,srcid:o.id,srcname:i.canvas.clipboard.sheetName,isshape:"Picture"!==o.type},(l=new FormData).set("p",JSON.stringify(s)),l.set("uid",i.uniqueid),t.next=11,fetch(i.imageCopyUrl,{method:"POST",body:l});case 11:if((c=t.sent).ok){t.next=14;break}throw"upload copy image fail";case 14:return t.next=16,c.json();case 16:if(h=t.sent,h=JSON.parse(h)){t.next=20;break}throw"upload copy image return null ";case 20:if(!h.Error){t.next=22;break}throw h.Error;case 22:delete h.width,delete h.height,n.images||(n.images=[]),Object.assign(o,h),o.left=e-a.left,o.top=e-a.top,n.images.push(o),u=h.type,delete h.type,Object.assign(e,h),e.id=i.canvas.picId(h.id,h.tick),e.imgType=u,e.strid=h.strid,e.zorder=i.data.topOrder++,e.changed=!0;case 37:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"setImageEventAndLayout",value:function(t){"Chart"===t.imgType&&t.setControlsVisibility({mtr:!1}),this.sheet.canvas.setSelectionLayout(t),this.sheet.canvas.eventsOn(t,this.sheet.canvas.imgEvents)}},{key:"reactiveObj",value:function(t){var e=this.canvas,i=this.sheet,n=i.data;if(n.canvasFreeze){var r=n.canvasFreeze,o=r.br,a=r.bl,s=r.tr,l=r.tl;[o,a,s,l].forEach((function(e){e.discardActiveObject(),e.setActiveObject(e.getObjects().find((function(e){return e.id===t.id}))),e.requestRenderAll(),i.canvas.saveCanvasData(n,e),i.canvas.saveOriginalAngleInfoOfImage(l)}))}else e.discardActiveObject(),e.setActiveObject(t),e.requestRenderAll(),i.canvas.saveCanvasData(n,e),i.canvas.saveOriginalAngleInfoOfImage(e)}}]),r}(Qr),function(t){tt()(i,t);var e=ao(i);function i(){var t;l()(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t=e.call.apply(e,[this].concat(r)),xt()(Yn()(t),"name","copy"),t}return a()(i,[{key:"execute",value:function(t){var e=t.canvas.fabric;if(e.getActiveObject()){var i=e;t.data.canvasFreeze&&(i=t.data.canvasFreeze.tl),i.getActiveObject().clone((function(e){t.canvas.clipboard={clonedObj:e,newData:oo({},t.canvas.findObjByData(e.id,t.data)),sheetName:t.data.name}}),["id","tick","imgType","zorder","strid"])}}}]),i}(Qr)],lo=function(){function t(e){var i=this;l()(this,t),xt()(this,"freezeXY",void 0),xt()(this,"imageCanvas",void 0),xt()(this,"freezeEvents",{"object:rotating":function(t){return function(e){i.imageCanvas.pubSub.publish("object:rotating",e,t)}},"object:moving":function(t){return function(e){i.imageCanvas.pubSub.publish("object:moving",e,t)}},"object:scaling":function(t){return function(e){i.imageCanvas.pubSub.publish("object:scaling",e,t)}},"selection:created":function(t){return function(e){i.imageCanvas.pubSub.publish("selection:created",e,t)}},"selection:cleared":function(t){return function(e){i.imageCanvas.pubSub.publish("selection:cleared",e,t)}},"selection:updated":function(t){return function(e){i.imageCanvas.pubSub.publish("selection:updated",e,t)}}}),this.imageCanvas=e;var n=e.sheet.getTableOffset(),r=e.sheet.data,o=e.sheet;if(!r.displayRight2Left){var a=r.freezeTotalWidth()+n.left/o.table.zoomlevel,s=r.freezeTotalHeight()+n.top/o.table.zoomlevel;if(this.freezeXY={},this.freezeXY.x=a,this.freezeXY.y=s,JSON.stringify(r.freeze)!==JSON.stringify([0,0])&&!r.canvasFreeze){e.pubSub=e.initPubSub();var c=e.fabric;c.off("object:moving",e.canvasEvents["object:moving"]),c.set("canvasName","br");var h=this.createCanvas(o.overlayerEl,"bl",a,c.height,JSON.stringify(c.toDatalessJSON(["id","tick","imgType","zorder","strid"]))),u=this.createCanvas(o.overlayerEl,"tr",c.width,s,JSON.stringify(c.toDatalessJSON(["id","tick","imgType","zorder","strid"]))),f=this.createCanvas(o.overlayerEl,"tl",a,s,JSON.stringify(c.toDatalessJSON(["id","tick","imgType","zorder","strid"])));this.setEventAndClipPath(c,u,h,f);for(var d=0;d<document.getElementsByClassName("canvas-container").length;d++)document.getElementsByClassName("canvas-container")[d].setAttribute("style","position:absolute");r.originFreezeSize={tl:{width:f.width,height:f.height},bl:{width:h.width,height:h.height},tr:{width:u.width,height:u.height},br:{width:c.width,height:c.height}},r.canvasFreeze={tl:f,bl:h,tr:u,br:c},this.setZoom(this.imageCanvas.sheet.table.zoomlevel)}}}return a()(t,[{key:"getFreezeCanvasClipPath",value:function(t,e,i){var n=this.freezeXY,r=this.imageCanvas.sheet,o=this.imageCanvas.tOffset;o.left/=r.data.zoomlevel,o.top/=r.data.zoomlevel;var a=new $r.fabric.Rect({width:n.x,height:e.height-n.y,top:n.y,left:o.left}),s=new $r.fabric.Rect({width:n.x,height:n.y,left:o.left,top:o.top}),l=new $r.fabric.Rect({width:t.width-n.x,height:n.y,left:n.x,top:o.top}),c=new $r.fabric.Rect({width:i.width-n.x,height:i.height-n.y,left:n.x,top:n.y});return function(t){var e;switch(t){case"tr":e=l;break;case"bl":e=a;break;case"tl":e=s;break;default:e=c}return e}}},{key:"getOffsetsBetweenCanvases",value:function(t,e){var i=this.imageCanvas.data,n=i.scroll,r=i.displayRight2Left?n.x:-n.x,o=-n.y,a={offsetX:0,offsetY:0};switch(t+e){case"tlbl":case"trbr":a={offsetX:0,offsetY:-o};break;case"bltl":case"brtr":a={offsetX:0,offsetY:o};break;case"tltr":case"blbr":a={offsetX:-r,offsetY:0};break;case"brbl":case"trtl":a={offsetX:r,offsetY:0};break;case"trbl":a={offsetX:r,offsetY:-o};break;case"tlbr":a={offsetX:-r,offsetY:-o};break;case"bltr":a={offsetX:-r,offsetY:o};break;case"brtl":a={offsetX:r,offsetY:o}}return a}},{key:"setIndividualCanvasesToMoveInSync",value:function(t,e,i,n){var r=this.imageCanvas.findObjInCanvas(t,e.target.id);if(r){var o=this.getOffsetsBetweenCanvases(n,t.canvasName);r.set({left:e.target.left-o.offsetX,top:e.target.top-o.offsetY}),r.set(i),this.imageCanvas.edgeCollision(r,t.canvasName),r.dirty=!0,t.renderAll()}}},{key:"setEventAndClipPath",value:function(t,e,i,n){var r=this;[t,e,i,n].forEach((function(t){var e=Object.keys(r.freezeEvents).map((function(e){return[e,r.freezeEvents[e](t.canvasName)]}));e=Object.fromEntries(e),r.imageCanvas.eventsOn(t,e)}));var o=this.getFreezeCanvasClipPath(e,i,t);this.freezeClipPath=o,[t,e,i,n].forEach((function(t){t.clipPath=o(t.canvasName),r.subscribeObjectEvent(t),r.subscribeSelectionEvent(t),r.subscribeCustomEvent(t,o)}))}},{key:"updateCanvasAllObjectAndRenderAll",value:function(t,e){t.getObjects().forEach(e),t.renderAll()}},{key:"subscribeObjectEvent",value:function(t){var e=this;this.imageCanvas.pubSub.subscribe("object:rotating",(function(i,n){var r={angle:i.target.angle};e.setIndividualCanvasesToMoveInSync(t,i,r,n)})),this.imageCanvas.pubSub.subscribe("object:moving",(function(i,n){var r=n===t.canvasName?{left:i.target.left,top:i.target.top}:{};e.setIndividualCanvasesToMoveInSync(t,i,r,n)})),this.imageCanvas.pubSub.subscribe("object:scaling",(function(i,n){var r={scaleX:i.target.scaleX,scaleY:i.target.scaleY};e.setIndividualCanvasesToMoveInSync(t,i,r,n)}))}},{key:"getOffsetWhenIndividualCanvasMovement",value:function(t){var e,i=this.imageCanvas.data,n=i.scroll,r=i.displayRight2Left?n.x:-n.x,o=-n.y;switch(t){case"tr":e={x:r,y:0};break;case"bl":e={x:0,y:o};break;case"br":e={x:r,y:o};break;default:e={x:0,y:0}}return e}},{key:"subscribeCustomEvent",value:function(t,e){var i=this;this.imageCanvas.pubSub.subscribe("reset",(function(){var e=i.getOffsetWhenIndividualCanvasMovement(t.canvasName);i.updateCanvasAllObjectAndRenderAll(t,(function(t){t.set({left:t.left-e.x,top:t.top-e.y}),t.setCoords(),t.dirty=!0}))})),this.imageCanvas.pubSub.subscribe("object:scroll",(function(e){var n=i.imageCanvas.data.canvasData,r=i.getOffsetWhenIndividualCanvasMovement(t.canvasName);if(n){var o=JSON.parse(n);t.getObjects().forEach((function(t){var e=o.objects.find((function(e){return e.id===t.id}));t.set({left:e.left+r.x,top:e.top+r.y}),t.setCoords()})),t.renderAll()}}))}},{key:"clearFreeze",value:function(t){if(t.canvasFreeze){this.imageCanvas.eventsOff(this.imageCanvas.fabric,this.freezeEvents);var e=t.canvasFreeze.tr,i=t.canvasFreeze.tl,n=t.canvasFreeze.bl;e.dispose(),i.dispose(),n.dispose(),document.getElementById("tr").remove(),document.getElementById("tl").remove(),document.getElementById("bl").remove();var r={width:this.imageCanvas.fabric.width,height:this.imageCanvas.fabric.height,top:this.imageCanvas.tOffset.top/this.imageCanvas.sheet.table.zoomlevel,left:this.imageCanvas.tOffset.left/this.imageCanvas.sheet.table.zoomlevel};this.imageCanvas.fabric.clipPath=new $r.fabric.Rect(r),this.imageCanvas.eventsOn(this.imageCanvas.fabric,this.imageCanvas.canvasEvents),this.imageCanvas.pubSub=this.imageCanvas.initPubSub(),this.imageCanvas.pubSub.subscribe("object:scroll",this.imageCanvas.customEvents["object:scroll"]),this.imageCanvas.fabric.renderAll(),t.canvasFreeze=void 0}}},{key:"setZoom",value:function(t){var e=this.imageCanvas,i=e.data,n=(e.fabric,e.tOffset,i.originFreezeSize);this.foreachFreezeCanvas((function(e){e.setZoom(t),e.renderAll()})),this.foreachFreezeCanvas((function(e){e.setWidth(n[e.canvasName].width*t),e.setHeight(n[e.canvasName].height*t)}),"br")}},{key:"resize",value:function(){var t=this.imageCanvas,e=t.data,i=(t.fabric,e.canvasFreeze),n=(i.tl,i.bl),r=i.tr,o=i.br,a=this.getFreezeCanvasClipPath(r,n,o);this.foreachFreezeCanvas((function(t){t.clipPath=a(t.canvasName),t.renderAll()}))}},{key:"subscribeSelectionEvent",value:function(t){var e=this;this.imageCanvas.pubSub.subscribe("selection:created",(function(i,n){if(n!==t.canvasName){e.imageCanvas.checkHyperlink(e.imageCanvas.data.canvasFreeze.br)&&!i.e.ctrlKey&&e.imageCanvas.openLink(e.imageCanvas.data);var r=e.imageCanvas.findObjInCanvas(t,i.target.id);t._setActiveObject(r),t.renderAll()}})),this.imageCanvas.pubSub.subscribe("selection:cleared",(function(e,i){i!==t.canvasName&&(t._discardActiveObject(),t.renderAll())})),this.imageCanvas.pubSub.subscribe("selection:updated",(function(i,n){var r;if(n!==t.canvasName){var o=e.imageCanvas.findObjInCanvas(t,i.target.id);(null===(r=t.getActiveObject())||void 0===r?void 0:r.id)!==o.id&&(t._setActiveObject(o),t.renderAll())}}))}},{key:"setObjectOrderAndChangedInAllCanvas",value:function(t,e){var i=this;++t.topOrder,Object.keys(t.canvasFreeze).forEach((function(n){var r=i.imageCanvas.findObjInCanvas(t.canvasFreeze[n],e.id);r&&(r.changed=!0,i.imageCanvas.sendImageToFont(t.canvasFreeze[n],r),e.zorder=r.zorder=t.topOrder,"TextBox"===e.imgType&&n!==e.canvas.canvasName&&(r.width=e.width,r.height=e.height,r.scaleX=1,r.scaleY=1),t.canvasFreeze[n].renderAll())}))}},{key:"setOrderAndSaveData",value:function(t){var e=this.imageCanvas.data;this.setObjectOrderAndChangedInAllCanvas(e,t),this.imageCanvas.saveOriginalAngleInfoOfImage(e.canvasFreeze.br),this.imageCanvas.saveCanvasData(e,e.canvasFreeze.br)}},{key:"loadFreezeImage",value:function(){var t=this.imageCanvas.data;if(t.canvasFreeze){var e=t.canvasFreeze,i=e.tl,n=e.bl,r=e.tr;this.imageCanvas.rerenderCanvasBySavedJson(n,{x:0,y:0},n.clipPath),this.imageCanvas.rerenderCanvasBySavedJson(r,{x:0,y:0},r.clipPath),this.imageCanvas.rerenderCanvasBySavedJson(i,{x:0,y:0},i.clipPath)}}},{key:"createCanvas",value:function(t,e,i,n,r){var o=document.createElement("canvas");o.width=i,o.height=n,o.setAttribute("id",e),t.children(o),window.mobileAndTabletCheck()&&($r.fabric.Object.prototype.selectable=!1);var a=new $r.fabric.Canvas(e);return a.selection=!1,a.set("canvasName",e),this.imageCanvas.eventsOn(a,this.imageCanvas.canvasEvents),a}},{key:"removeImage",value:function(t){this.foreachFreezeCanvas((function(e){e.remove(e.getObjects()[e.getObjects().findIndex((function(e){return e.id===t}))])}),"br")}},{key:"setDirty",value:function(t){this.foreachFreezeCanvas((function(e){e.getObjects().find((function(e){return e.id===t})).dirty=!0,e.requestRenderAll()}))}},{key:"setVisible",value:function(t,e){this.foreachFreezeCanvas((function(i){i.getObjects().find((function(e){return e.id===t})).visible=e}))}},{key:"setFilter",value:function(t,e){this.foreachFreezeCanvas((function(i){var n=i.getObjects().find((function(e){return e.id===t}));n.filters[0]=e,n.applyFilters()}))}},{key:"setCustomHighlight",value:function(t,e,i){this.foreachFreezeCanvas((function(n){var r=n.getObjects().find((function(e){return e.id===t}));i(e,r)}))}},{key:"setOrder",value:function(){this.foreachFreezeCanvas((function(t){null!=t&&t.getObjects().find((function(t){return!t.zorder}))||t.getObjects().sort((function(t,e){return t.zorder<e.zorder?-1:1})).forEach((function(e){t.bringToFront(e)}))}))}},{key:"saveCanvasData",value:function(){var t=this,e=this.imageCanvas.data;this.foreachFreezeCanvas((function(i){t.imageCanvas.saveCanvasData(e,i)}))}},{key:"setCursor",value:function(t){this.foreachFreezeCanvas((function(e){e.defaultCursor=t}))}},{key:"renderAll",value:function(){this.foreachFreezeCanvas((function(t){t.renderAll()}))}},{key:"foreachFreezeCanvas",value:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this.imageCanvas.data;if(r.canvasFreeze){var o=r.canvasFreeze,a=o.tl,s=o.bl,l=o.tr,c=o.br;[a,s,l,c].forEach((function(e){i.includes(e.canvasName)||t(e)}))}}}]),t}();function co(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var ho=function(){function t(){l()(this,t),this.subscribers=[]}return a()(t,[{key:"subscribe",value:function(t,e){var i=this.subscribers[t];i?i.push(e):this.subscribers[t]=[e]}},{key:"publish",value:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this.subscribers[t]||[];r.forEach((function(t){return t.apply(void 0,i)}))}}]),t}(),uo=function(t,e){return"p_".concat(t,"_").concat(e)},fo=function(t,e){return"s_".concat(t,"_").concat(e)},vo=function(t){var e;this.visible=t,this.fabobj.visible=t;var i=this.getIdtick();null===(e=this.inFreeze)||void 0===e||e.setVisible(i,t),this.setDirty()},go=function(){var t;this.fabobj.set("dirty",!0),this.fabobj.canvas.requestRenderAll();var e=this.getIdtick();null===(t=this.inFreeze)||void 0===t||t.setDirty(e)},po=function(t){var e;this.fabobj.filters[0]=t,this.fabobj.applyFilters();var i=this.getIdtick();null===(e=this.inFreeze)||void 0===e||e.setFilter(i,t)},mo=function(t,e){var i;e(t,this.fabobj);var n=this.getIdtick();null===(i=this.inFreeze)||void 0===i||i.setCustomHighlight(n,t,e)},yo=function(){return"Picture"===this.type?uo(this.id,this.tick):fo(this.id,this.tick)},bo=function(t,e){var i=this.width,n=this.height,r=this.shape;t.save(),t.translate(-i/2,-n/2);var o=new Pe(0,0,i,n,10);o.setPading(r.lp,r.rp);var a=new ze(t,i,n),s=1/Oe();a.scale(s,s),a.scale(s,s),a.rect3(o),a.richtext(r,o,r.align,r.valign,r.wrap,r.getHighlight()),t.restore()},wo=function(t){var e=this.getScaledWidth(),i=this.getScaledHeight();this.scaleX=1,this.scaleY=1,this.width=e,this.height=i,this.shape.originWidth=e,this.shape.originHeight=i},xo=function(t){tt()(i,t);var e=co(i);function i(){var t;return l()(this,i),t=e.call(this,"canvas"),xt()(Yn()(t),"imgEvents",{mouseup:function(e){var i=Yn()(t).sheet,n=i.data,r=e.target;if(!window.mobileAndTabletCheck()){var o=r.canvas;o||(o=t.fabric),n.canvasFreeze?t.inFreeze.setOrderAndSaveData(r):(r.changed=!0,t.sendImageToFont(o,r),r.zorder=++n.topOrder,t.findObjInCanvas(o,r.id).zorder=r.zorder,t.saveOriginalAngleInfoOfImage(o),t.saveCanvasData(n,o)),i.selector.setObjId(r.id)}},mousedown:function(e){window.mobileAndTabletCheck()||(t.sheet.selector.hide(),t.sheet.editor.clear(),null==e||e.e.stopPropagation())},mousedblclick:function(e){if(!window.mobileAndTabletCheck()){var i=e.target,n=Yn()(t).sheet;if("OleObject"===i.imgType)n.getOle(i.strid);else if("TextBox"===i.imgType){var r=t.findShape(i.id,n.data);n.setEditForTextBox(r),t.fabric.discardActiveObject().requestRenderAll()}}},mousemove:function(e){t.findObjByData(e.target.id,t.sheet.data).hyperlink?t.fabric.hoverCursor="pointer":t.fabric.hoverCursor="move"}}),xt()(Yn()(t),"pausePanning",!1),xt()(Yn()(t),"canvasEvents",{"mouse:move:before":function(){t.sheet.data.canvasFreeze&&t.sheet.data.canvasFreeze.tl.getObjects().length!==t.sheet.data.canvasFreeze.br.getObjects().length&&t.inFreeze.loadFreezeImage()},"object:moving":function(e){t.edgeCollision(e.target,"canvas")},"selection:created":function(e){t.checkHyperlink(t.fabric)&&!e.e.ctrlKey&&t.openLink(t.data)}}),xt()(Yn()(t),"customEvents",{"object:scroll":function(){var e=t.data,i=e.scroll,n=e.displayRight2Left,r=e.canvasData,o=n?i.x:-i.x,a=-i.y;if(r){var s=JSON.parse(r);t.fabric.getObjects().forEach((function(t){var e=s.objects.find((function(e){return e.id===t.id}));t.set({left:e.left+o,top:e.top+a}),t.setCoords()})),t.fabric.renderAll()}}}),xt()(Yn()(t),"tOffset",void 0),xt()(Yn()(t),"data",void 0),xt()(Yn()(t),"fabric",void 0),xt()(Yn()(t),"freeze",void 0),xt()(Yn()(t),"freezeXY",{x:0,y:0}),xt()(Yn()(t),"pubSub",void 0),xt()(Yn()(t),"sheet",void 0),xt()(Yn()(t),"basicZorder",void 0),xt()(Yn()(t),"canvasId","canvas_".concat((new Date).getTime())),xt()(Yn()(t),"imageOperationList",{}),t.attr("id",t.canvasId),t.pubSub=t.initPubSub(),so.forEach((function(e){var i=new e;t.imageOperationList[i.name]=i})),Tt(window,"resize",(function(e){window.mobileAndTabletCheck()||t.resize(e)})),t}return a()(i,[{key:"publishEvent",value:function(t,e){this.pubSub.publish(t,e)}},{key:"initPubSub",value:function(){return new ho}},{key:"setCursor",value:function(t){this.sheet.data.canvasFreeze?this.inFreeze.setCursor(t):this.fabric.defaultCursor=t}},{key:"doNewSheetPage",value:function(t){this.fabric.clear(),this.inFreeze&&this.inFreeze.clearFreeze(t)}},{key:"doSwitchSheetPage",value:function(t){var e=this;this.sheet.selector.el.show();setTimeout((function t(){var i,n,r,o;e.sheet.canvas.fabric.getObjects().length===(null!==(i=null===(n=e.sheet.data.images)||void 0===n?void 0:n.length)&&void 0!==i?i:0)+(null!==(r=null===(o=e.sheet.data.shapes)||void 0===o?void 0:o.length)&&void 0!==r?r:0)?e.doEndSwitchSheetPage():setTimeout(t,200)}),200);this.inFreeze&&this.inFreeze.clearFreeze(t)}},{key:"doEndSwitchSheetPage",value:function(){var t;this.setOrder(this.fabric),null===(t=this.sheet.canvas.inFreeze)||void 0===t||t.setOrder()}},{key:"initFreeze",value:function(){this.inFreeze=new lo(this)}},{key:"rerenderCanvasBySavedJson",value:function(t,e,i){var n=this;if(this.data.canvasData&&this.fabric){this.initFreeze();var r=JSON.parse(this.data.canvasData);delete r.clipPath,this.loadFromCanvasData(JSON.stringify(r),(function(r,o){o.set({left:r.left+e.x,top:r.top+e.y}),"Chart"===o.imgType&&o.setControlsVisibility({mtr:!1}),n.setSelectionLayout(o),n.eventsOn(o,n.imgEvents);var a,s,l=n.findObjByData(r.id,n.data);l&&(s=l,"TextBox"===(a=o).imgType&&(a.shape=s,a.drawObject=bo,a.on("modified",wo)),t.clipPath=i)}),t)}}},{key:"findObjInCanvas",value:function(t,e){return t.getObjects().find((function(t){return t.id===e}))}},{key:"recordCanvasData",value:function(t,e){var i,n,r=t.aCoords,o=this.tOffset,a=this.findObjByData(t.id,e);if(a){var s=r.tl.x+(r.tr.x-r.tl.x)/2-o.left,l=r.tl.y+(r.bl.y-r.tl.y)/2-o.top;a.centerX||(a.centerX=s),a.centerY||(a.centerY=l),a.currentCenterX=s,a.currentCenterY=l;var c=e.getCellRectByXY(r.tl.x,r.tl.y);a.width=a.originWidth*t.scaleX,a.height=a.originHeight*t.scaleY,a.scaleX=t.scaleX,a.scaleY=t.scaleY,a.top=t.top-o.top/e.zoomlevel+e.scroll.y,a.left=t.left-o.left/e.zoomlevel+e.scroll.x,a.row=null==c?void 0:c.ri,a.col=null==c?void 0:c.ci,a.changed=null!==(i=t.changed)&&void 0!==i&&i,a.zorder=null!==(n=t.zorder)&&void 0!==n?n:e.topOrder}}},{key:"edgeCollision",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"canvas",i=this.data,n=this.tOffset,r=n.top/i.zoomlevel,o=n.left/i.zoomlevel;0!==i.scroll.y&&["br","bl"].includes(e)&&(r-=i.scroll.y),0!==i.scroll.x&&["br","tr"].includes(e)&&(o-=i.scroll.x),t.setCoords();var a=t.getBoundingRect().top/i.zoomlevel,s=t.getBoundingRect().left/i.zoomlevel;(a<r||s<o)&&(t.top=Math.max(t.top,t.top-a+r),t.left=Math.max(t.left,t.left-s+o))}},{key:"init",value:function(t){var e=this;this.tOffset=t.getTableOffset();var i=this.tOffset;this.attr("width",i.width+i.left),this.attr("height",i.height+i.top),this.sheet=t,window.mobileAndTabletCheck()&&($r.fabric.Object.prototype.selectable=!1),this.fabric=new $r.fabric.Canvas(this.canvasId),this.clipPath({width:this.fabric.width,height:this.fabric.height,top:this.tOffset.top/t.data.zoomlevel,left:this.tOffset.left/t.data.zoomlevel});var n=0,r=setInterval((function(){(t.data.isImageOk||50===n)&&(e.onSheetImageLoaded(),clearInterval(r)),n++}),200);this.eventsOn(this.fabric,this.canvasEvents),this.fabric.selection=!1,window.mobileAndTabletCheck()&&this.fabric.removeListeners(),this.pubSub.subscribe("object:scroll",this.customEvents["object:scroll"])}},{key:"onSheetImageLoaded",value:function(){var t;this.setOrder(this.sheet.canvas.fabric),null===(t=this.sheet.canvas.inFreeze)||void 0===t||t.setOrder()}},{key:"resetFreeze",value:function(t){var e=r()(t.freeze,2),i=e[0],n=e[1];0===i&&0===n?this.inFreeze&&this.inFreeze.clearFreeze(t):this.initFreeze()}},{key:"reset",value:function(t){this.data=t,this.fabric.clear(),this.initFreeze(),this.freezeXY=this.inFreeze.freezeXY,this.inFreeze.loadFreezeImage(),this.fabric.renderAll()}},{key:"doResetPosition",value:function(t){0===t&&this.pubSub.publish("reset")}},{key:"saveOriginalAngleInfoOfImage",value:function(t){var e=this,i={};t.getObjects().forEach((function(t){i[t.id]=t.angle,e.rotateObject(t,0)})),t.renderAll(),t.getObjects().forEach((function(t){e.recordCanvasData(t,e.sheet.data),e.setDataAngle(t,i[t.id],e.sheet.data),e.rotateObject(t,i[t.id])})),t.renderAll()}},{key:"setDataAngle",value:function(t,e,i){var n=this.findObjByData(t.id,i);n&&(n.angle=e)}},{key:"clipPath",value:function(t){this.fabric.clipPath=new $r.fabric.Rect(t)}},{key:"eventsOn",value:function(t,e){for(var i in e)t.on(i,e[i])}},{key:"eventsOff",value:function(t,e){for(var i in e)t.off(i,e[i])}},{key:"saveCanvasData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.fabric,i=this.sheet;if(e){var n=e.toDatalessJSON(["id","tick","imgType","zorder","strid"]);n.objects.forEach((function(t){t.left+=i.data.scroll.x,t.top+=i.data.scroll.y})),t.canvasData=JSON.stringify(n)}}},{key:"loadFromCanvasData",value:function(t,e){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.fabric;t?n.loadFromJSON(t,(function(){i.setOrder(n),n.renderAll()}),e):n.clear()}},{key:"findObjByData",value:function(t,e){var i=this.findImage(t,e);return null!=i?i:this.findShape(t,e)}},{key:"setZoom",value:function(t){var e=this.sheet.data;this.tOffset=this.sheet.getTableOffset(),this.sheet.verticalScrollbar.move({top:0}),this.sheet.horizontalScrollbar.move({left:0}),e.canvasFreeze?this.inFreeze.setZoom(t):(this.fabric.clipPath=new $r.fabric.Rect({width:this.fabric.width/e.zoomlevel,height:this.fabric.height/e.zoomlevel,left:this.tOffset.left/e.zoomlevel,top:this.tOffset.top/e.zoomlevel}),this.fabric.setZoom(t),this.fabric.renderAll())}},{key:"findImage",value:function(t,e){var i;return null===(i=e.images)||void 0===i?void 0:i.find((function(e){return t===uo(e.id,e.tick)}))}},{key:"findShape",value:function(t,e){var i;return null===(i=e.shapes)||void 0===i?void 0:i.find((function(e){return t===fo(e.id,e.tick)}))}},{key:"resize",value:function(t){var e=this.sheet,i=this.fabric,n=this.tOffset;i&&(i.setWidth(t.target.outerWidth+n.left),i.setHeight(t.target.outerHeight+n.top),i.clipPath=new $r.fabric.Rect({width:i.getWidth(),height:i.getHeight(),top:this.tOffset.top/e.data.zoomlevel,left:this.tOffset.left/e.data.zoomlevel}),i.renderAll(),e.data.canvasFreeze&&this.inFreeze.resize())}},{key:"setSelectionLayout",value:function(t){t.set({borderColor:"gray",cornerColor:"gray",cornerSize:12,transparentCorners:!0})}},{key:"setTextBox",value:function(t,e,i){var n,r=t.canvas,o=new $r.fabric.Rect;i.width?i.fromOutside&&(delete i.width,delete i.height):(o.width=i.width,o.height=i.height),r.setSelectionLayout(o),r.eventsOn(o,r.imgEvents),r.eventsOn(r,this.canvasEvents),r.fabric.add(o),r.rotateObject(o,i.rotate),e.fabobj=o,o.shape=e,e.inFreeze=this.inFreeze,e.setVisible=vo,e.setDirty=go,e.setFilter=po,e.setCustomHighlight=mo,e.getIdtick=yo,i.id||(i.id=e.getIdtick()),o.set(i),t.visibleFilter&&e.setVisible(t.visibleFilter(t,e)),qe(e),o.drawObject=bo,o.on("modified",wo),e.updateTextBox=function(t,e){this.html=t,this.rtxt=e,delete this.bigfontsize,qe(this),this.setDirty()},e.getHighlight=function(){return this.showhighlight?v()(this.highlighttxts):[]},e.addHighlight=function(t,e){var i={start:t,end:e};this.highlighttxts.find((function(i){if(i.start===t&&i.end===e)return i}))||(i.color=this.hstyle.color,this.highlighttxts.push(i),this.setDirty())},e.removeHighlight=function(t,e){if(this.highlighttxts){var i=this.highlighttxts.findIndex((function(i){return i.start===t&&i.end===e}));-1!==i&&(this.highlighttxts.splice(i,1),this.setDirty())}},e.setHighlight=function(t,e){this.showhighlight=t,this.highlighttxts||(this.highlighttxts=[]),e&&(this.hstyle=e),this.setDirty()},r.fabric.renderAll(),r.saveCanvasData(t.data),null===(n=this.inFreeze)||void 0===n||n.loadFreezeImage()}},{key:"setImage",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"content/img/updating.gif",r=t.canvas,o=this;$r.fabric.Image.fromURL(n,(function(n){var a;if(e&&(e.fabobj=n,e.inFreeze=o.inFreeze,e.setVisible=vo,e.setDirty=go,e.setFilter=po,e.setCustomHighlight=mo,e.getIdtick=yo),i.id||(i.id=e.getIdtick()),i.id.includes("loading"))return n.set(i),r.fabric.add(n),e&&t.visibleFilter&&e.setVisible(t.visibleFilter(t,e)),r.fabric.requestRenderAll(),void(null===(a=o.inFreeze)||void 0===a||a.loadFreezeImage());try{var s,l=r.findObjByData(i.id,t.data);if(!l)return;var c=r.findObjInCanvas(r.fabric,i.id);c&&r.fabric.remove(c),i.width?(i.fromOutside&&(delete i.width,delete i.height),n.set(i)):(n.scaleToWidth(i.scaleToWidth),n.scaleToHeight(i.scaleToHeight),n.set(i),l.fromOutside=!0,l.scaleX=n.scaleX,l.scaleY=n.scaleY),"Chart"===i.imgType&&n.setControlsVisibility({mtr:!1}),r.setSelectionLayout(n),r.eventsOn(n,r.imgEvents),r.eventsOn(r,o.canvasEvents),r.fabric.add(n),e&&t.visibleFilter&&e.setVisible(t.visibleFilter(t,e)),r.rotateObject(n,i.rotate),r.fabric.renderAll(),r.saveCanvasData(t.data),null===(s=o.inFreeze)||void 0===s||s.loadFreezeImage()}catch(t){console.error(t),lt(t)}finally{r.removeLoading(t)}}))}},{key:"setLoading",value:function(t,e){var i=this.tOffset,n=t.data,r=n.displayRight2Left,o=n.cols,a=r?t.data.viewWidth()-o.indexWidth:0,s=r?a-e.left:e.left;e.top+=i.top,e.left=s+i.left,e.id="loading"+(new Date).getTime(),e.selectable=!1,this.setImage(t,null,e),this.loadingStack||(this.loadingStack=[]),this.loadingStack.push(e.id)}},{key:"removeLoading",value:function(t){var e=t.canvas;if(this.loadingStack){var i=this.loadingStack.shift();e.fabric.remove(e.fabric.getObjects()[e.fabric.getObjects().findIndex((function(t){return t.id===i}))]),e.saveCanvasData(t.data,e.fabric),e.inFreeze&&(e.inFreeze.removeImage(i),e.inFreeze.saveCanvasData(),e.inFreeze.renderAll(),e.fabric.renderAll())}}},{key:"rotateObject",value:function(t,e){t&&(t._setOriginToCenter(),t.set("angle",e).setCoords(),t._resetOrigin())}},{key:"doInsertURLImage",value:function(t,e){this.doInsertImage(t,e,!0)}},{key:"doInsertImage",value:function(t,e){var i,n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=e.data.getSelectedRect(),a=this.tOffset,s=e.data,l=s.displayRight2Left,c=s.cols,h=l?e.data.viewWidth()-c.indexWidth:0,u=l?h-o.left/e.table.zoomlevel-t.width:o.left/e.table.zoomlevel,f=t.url,d={angle:0,col:this.data.selector.ci,height:t.height,id:t.id,left:o.left/e.table.zoomlevel,originAngle:0,originHeight:t.height,originLeft:o.left,originTop:o.top,originWidth:t.width,row:this.data.selector.ri,scaleX:1,scaleY:1,src:f,strid:t.strid,tick:t.tick,top:o.top/e.table.zoomlevel,type:t.type,width:t.width,zorder:null!==(i=e.data.topOrder)&&void 0!==i?i:0};this.findObjByData(d.id,e.data)||(e.data.images||(e.data.images=[]),e.data.images.push(d)),r?this.setImage(e,d,{id:uo(d.id,d.tick),tick:d.tick,scaleToWidth:t.width,scaleToHeight:t.height,top:d.top+a.top/e.table.zoomlevel,left:u+a.left/e.table.zoomlevel,originAngle:0,rotate:0,fromOutside:!0,imgType:d.type,strid:d.strid,"z-index":this.basicZorder+d.zorder,zorder:d.zorder},d.src):this.setImage(e,d,{id:uo(d.id,d.tick),tick:d.tick,scaleToWidth:d.width,scaleToHeight:d.height,top:d.top+a.top/e.table.zoomlevel,left:u+a.left/e.table.zoomlevel,originAngle:0,rotate:0,fromOutside:!0,imgType:d.type,strid:d.strid,"z-index":this.basicZorder+d.zorder,zorder:d.zorder},d.src),this.fabric.renderAll(),this.saveCanvasData(e.data),null===(n=this.inFreeze)||void 0===n||n.loadFreezeImage()}},{key:"isImageOnSelected",value:function(){return!!this.fabric.getActiveObject()}},{key:"setHyperlink",value:function(t){var e=this.getActiveObjInData(this.data);e&&(e.hyperlink=t)}},{key:"getActiveObjInData",value:function(t){var e=this.fabric.getActiveObject();if(e)return this.findObjByData(e.id,t)}},{key:"link",value:function(t){var e,i=this.getActiveObjInData(t);i&&this.sheet.modalLink.setValue(xs.datas.map((function(t){return t.name})),null!==(e=i.hyperlink)&&void 0!==e?e:{})}},{key:"removeLink",value:function(t){var e=this.getActiveObjInData(t);e&&(e.hyperlink=null)}},{key:"openLink",value:function(t){var e=this.getActiveObjInData(t);e&&(this.fabric._discardActiveObject(),this.fabric.renderAll(),this.sheet.hyperlink.access(e.hyperlink))}},{key:"sendImageToFont",value:function(t,e){t&&e&&t.bringToFront(e)}},{key:"doOperation",value:function(t){Object.keys(this.imageOperationList).includes(t)&&!window.mobileAndTabletCheck()&&this.imageOperationList[t].execute(this.sheet)}},{key:"removeImageInData",value:function(t,e){if(!e.includes("_")&&e.split("_").length-1!=2)throw new Error("not correct id");var i=e.split("_"),n=r()(i,3),o=n[0],a=n[1],s=n[2],l="s"===o?t.shapes:t.images;null==l||l.splice(l.findIndex((function(t){return t.id===a&&t.tick===s})),1)}},{key:"checkHyperlink",value:function(t){var e=t.getActiveObject();if(e)return!!this.findObjByData(e.id,this.data).hyperlink}},{key:"validType",value:function(t,e,i){var n=t.getActiveObject();if(n)return this.findObjByData(n.id,this.data)[e]===i}},{key:"setOrder",value:function(t){null==t||t.getObjects().sort((function(t,e){return t.zorder<e.zorder?-1:1})).forEach((function(e){t.bringToFront(e)}))}}]),i}(u);function Co(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var ko=function(t){tt()(i,t);var e=Co(i);function i(){var t;l()(this,i);var n=new Mr(new Ar("100%",W("contextmenu.insertURL")),{required:!0},"",100);return(t=e.call(this,">",[f("div","".concat(ot,"-form-fields")).children(n.el),f("div","".concat(ot,"-buttons")).children(new pi("ok","primary").on("click",(function(){return t.btnClick("ok")})))])).url=n,t.values=[],t.change=function(){},t}return a()(i,[{key:"btnClick",value:function(t){"ok"===t?this.url.validate()&&this.checkIsImage(this.url.val(),this.validateImage,5e3):this.hide()}},{key:"validateImage",value:function(t,e){"success"===e?(this.change("ok",t),this.hide()):this.url.validateFail(W("validation.downloadImageFail"))}},{key:"show",value:function(){Ai()(rt()(i.prototype),"show",this).call(this),this.url.input.focus()}},{key:"hide",value:function(){this.url.val(""),this.url.validateClear(),Ai()(rt()(i.prototype),"hide",this).call(this)}},{key:"checkIsImage",value:function(t,e,i){var n,r=!1,o=this,a=new Image;a.onerror=a.onabort=function(){r||(clearTimeout(n),e.call(o,t,"error"))},a.onload=function(){r||(clearTimeout(n),e.call(o,t,"success"))},a.src=t,n=setTimeout((function(){r=!0,a.src="//!!!!/test.jpg",e.call(o,t,"timeout")}),i)}}]),i}(Rr);function _o(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}function So(t){t.dd&&(t.dd.title.removeClass("arrow-left"),2===t.dd.headerEl.children().length&&t.dd.headerEl.removeChild(t.dd.headerEl.children()[1]))}function To(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=" "+W("menubar.".concat(t.tag.replace(/-[a-z]/g,(function(t){return t[1].toUpperCase()}))));t.dd?t.dd.headerEl.child(i,e):t.el.child(i)}function Oo(t){var e=f("div","".concat(ot,"-item")).child(t.el);return t.dd&&(t.dd.contentEl.addClass("".concat(ot,"-menubar-dropdown-content")),e=f("div","".concat(ot,"-menubar-btn")).child(t.dd.el)),e}function Eo(t,e){t.el.addEventListener("click",(function(i){e.dd?e.dd.menuDiv=t:(e.click?e.click():e.change(e.tag),i.stopPropagation())}),!0),t.el.addEventListener("mouseenter",(function(t){t.stopPropagation()}),!0)}var Ro=function(t){tt()(i,t);var e=_o(i);function i(t,n){var r;l()(this,i);for(var o,a=[],s=["format","font-name","font-size"],c=0;c<n.length;c++){(o=n[c]).tip="",o.el.attr("style","margin:0"),o.el.attr("class",""),So(n[c]);var h=s.includes(n[c].tag);To(n[c],h);var u=Oo(n[c]);Eo(u,n[c]),a.push(u)}return(r=e.call.apply(e,[this,t,"max-content",!1,"bottom-left"].concat(a))).headerEl.on("mouseenter",(function(t){if(!window.mobileAndTabletCheck()){var e=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});t.target.dispatchEvent(e)}})),r}return i}(Mi);function Ao(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Io=function(t){tt()(i,t);var e=Ao(i);function i(t,n){return l()(this,i),e.call(this,t,null,"",n)}return a()(i,[{key:"dropdown",value:function(){return new Ro(this.tag,this.value)}}]),i}(Di);function Po(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Do=function(t){tt()(i,t);var e=Po(i);function i(t){var n;l()(this,i);var r="download";return null!=t&&t&&(r+="_".concat(t)),n=e.call(this,r),"GOOGLE"===t||"DROPBOX"===t?n.setIcon("savetocloud"):n.setIcon("download"),n}return i}(bn);function Fo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Mo=function(t){tt()(i,t);var e=Fo(i);function i(){return l()(this,i),e.call(this,"link")}return i}(bn);function jo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Lo=function(t){tt()(i,t);var e=jo(i);function i(){return l()(this,i),e.call(this,"insertColumn")}return i}(bn);function Bo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var zo=function(t){tt()(i,t);var e=Bo(i);function i(){return l()(this,i),e.call(this,"insertRow")}return i}(bn);function Ho(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var No=function(t){tt()(i,t);var e=Ho(i);function i(){return l()(this,i),e.call(this,"insertSheet")}return i}(bn);var Wo=function(){function t(e,i,n,r,o){var a=this;l()(this,t),this.data=e;var s=e.defaultStyle();this.change=function(){},this.widthFn=i,this.isHide=n,this.dropdowns=[];var c=W("menubar.menuEdit"),h=W("menubar.menuComment"),u=W("menubar.menuInsert"),d=W("menubar.menuText"),v=W("menubar.menuFile");this.items={},this.items[v]=[new er,new Do("Original"),new Do("XLSX"),new Do("PDF"),new Do("HTML")],"ru"!==o&&"zh"!==o&&(this.items[v].push(new Do("GOOGLE")),this.items[v].push(new Do("DROPBOX"))),this.items[c]=[this.borderEl=new mn,this.mergeEl=new Qn,this.freezeEl=new Jn,this.autofilterEl=new Yi,this.sortEl=new lr,this.searchEl=new hr,this.paintformatEl=new kn,this.clearformatEl=new xn,this.fillColorEl=new On(s.bgcolor)],this.items[u]=[this.insertColumn=new Lo,this.insertRow=new zo,this.insertSheet=new No,this.insertImageEL=new Cr,this.formulaEl=new Kn,this.insertLink=new Mo,this.insetCommentEl=new fr],this.insetCommentEl.tag="insertComment",this.items[d]=[this.fontEl=new zn,this.fontSizeEl=new In,this.boldEl=new Gi,this.italicEl=new Ki,this.underlineEl=new Qi,this.strikeEl=new Ji,this.alignEl=new zi(s.align),this.valignEl=new Ni(s.valign),this.textwrapEl=new nr,this.textColorEl=new Sn(s.color)],this.items[h]=[this.commentEditEl=new fr,this.commentRemoveEl=new vr,this.commentPreviousEl=new pr,this.commentNextEl=new yr];for(var g=0;g<this.insertImageEL.dd.contentEl.children().length;g++)this.insertImageEL.dd.contentEl.children()[g].style="width:max-content";this.el=f("div","".concat(ot,"-toolbar ").concat(ot,"-menubar")),n?this.el.hide():(this.el.css("text-transform","capitalize"),Object.keys(this.items).forEach((function(t){var e=new Io(t,a.items[t]);a.dropdowns.push(e),a.el.child(e.el),a.items[t].map((function(t){t.change=function(){a.change.apply(a,arguments)}}))})))}return a()(t,[{key:"hideDropdown",value:function(){this.dropdowns.forEach((function(t){return t.dd.hide()}))}}]),t}(),Uo=function(){function t(){l()(this,t),xt()(this,"setActiveSheetBySheetName",(function(){})),xt()(this,"setActiveCell",(function(){})),xt()(this,"linkPositions",[])}return a()(t,[{key:"checkAndAccess",value:function(t,e,i){var n=this.find(t,e,i);return n?this.access(n):null}},{key:"loadLinkPosition",value:function(t){var e=this,i=t.data;this.linkPositions=[];t.getTableOffset();i.hyperlinks.forEach((function(t){var n={},r=C.valueOf(t.area),o=i.scroll.ci,a=i.scroll.ri;o=o>0&&r.sci<o?0:o,a=a>0&&r.sri<a?0:a,n.x=[i.cols.sumWidth(o,r.sci+1)-i.cols.getWidth(r.sci),i.cols.sumWidth(o,r.eci+1)],n.y=[i.rows.sumHeight(a,r.sri+1)-i.rows.getHeight(r.eri),i.rows.sumHeight(a,r.eri+1)],i.canvasFreeze&&(i.scroll.ri>0||i.scroll.ci>0)||e.linkPositions.push(n)}))}},{key:"find",value:function(t,e,i){var n=t.hyperlinks;if(0!==n.length)return n.find((function(t){return t.area?C.valueOf(t.area).includes(e,i):null}))}},{key:"findByArea",value:function(t,e){var i=t.hyperlinks;if(0!==i.length)return i.find((function(t){return t.area?C.valueOf(t.area).contains(C.valueOf(e)):null}))}},{key:"check",value:function(t,e,i){return!!this.find(t,e,i)}},{key:"remove",value:function(t,e){var i=e.hyperlinks.findIndex((function(e){return e.area===t.area}));e.hyperlinks.splice(i,1)}},{key:"removeByRange",value:function(t,e){var i=this.findByRange(t,e.data);this.remove(i,e.data),this.setHyperlinkStyleByArea(i.area,e,!1)}},{key:"findByRange",value:function(t,e){var i=this.getSelectArea(t);return this.findByArea(e,i)}},{key:"getSelectArea",value:function(t){var e=b(t.sci,t.sri),i=b(t.eci,t.eri);return"".concat(e,":").concat(i)}},{key:"setHyperlinkStyleByArea",value:function(t,e,i){for(var n=C.valueOf(t),r=n.sri;r<=n.eri;r++)for(var o=n.sci;o<=n.eci;o++)e.data.setHyperlinkStyle(r,o,i);e.table.render()}},{key:"accessByRange",value:function(t,e){var i=this.getSelectArea(t),n=this.findByArea(e,i);this.access(n)}},{key:"access",value:function(t){if("number"==typeof t.type&&t.address){switch(t.type){case 0:case 2:window.open(t.address,"_blank");break;case 1:break;case 3:if(!t.address.includes("!"))break;var e=t.address.split("!"),i=r()(e,2),n=i[0],o=i[1];n.startsWith("'")&&n.endsWith("'")&&(n=n.substr(1,n.length-2)),this.setActiveSheetBySheetName(n);var a=y(o),s=r()(a,2),l=s[0],c=s[1],h=this;setTimeout((function(){h.setActiveCell(c,l)}),1e3)}return null}}}]),t}();function Xo(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return Yo(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Yo(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function Yo(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var Vo=function(){function t(e){l()(this,t),this.sheet=e}return a()(t,[{key:"setCustomHighlightImgFunc",value:function(t){this.highlightImgFunc=t}},{key:"showHighlights",value:function(t){var e=this.sheet.data;e.showhighlight=!0,e.highlightstyle=t,this.AutoShowOrHide()}},{key:"AutoShowOrHide",value:function(){var t=this.sheet,e=t.data,i=t.canvas;if(e.highlightall){var n=i.fabric;this.highlightAllImg(e.showhighlight,n)}else this.showHighlightImageShapesAuto(e.showhighlight)}},{key:"hideHighlights",value:function(){var t=this.sheet,e=t.data,i=t.table;e.showhighlight=!1,this.AutoShowOrHide(),i.render()}},{key:"getHighlightTexts",value:function(){return this.sheet.data.highlighttxts}},{key:"addHighlightText",value:function(t,e,i,n){var r=this.sheet.data,o={row:t,col:e,start:i,end:n};r.highlighttxts.find((function(r){if(r.row===t&&r.col===e&&r.start===i&&r.end===n)return r}))||r.highlighttxts.push(o)}},{key:"removeHighlightText",value:function(t,e,i,n){for(var r=this.sheet.data,o=0;o<r.highlighttxts.length;o++){var a=Number.isInteger(i)?i:r.highlighttxts[o].start,s=Number.isInteger(n)?n:r.highlighttxts[o].end;r.highlighttxts[o].row===t&&r.highlighttxts[o].col===e&&r.highlighttxts[o].start===a&&r.highlighttxts[o].end===s&&r.highlighttxts.splice(o,1)}}},{key:"getHighlightRanges",value:function(){return this.sheet.data.highlightrg}},{key:"addHighlightRange",value:function(t,e,i,n){for(var r=this.sheet.data,o=new C(t,e,i,n),a=0;a<r.highlightrg.length;a++)if(r.highlightrg[a].contains(o))return;r.highlightrg.push(o)}},{key:"removeHighlightRange",value:function(t,e,i,n){for(var r=this.sheet.data,o=new C(t,e,i,n),a=0;a<r.highlightrg.length;a++)r.highlightrg[a].equals(o)&&r.highlightrg.splice(a,1)}},{key:"setHighlightInverseRange",value:function(t,e,i,n){this.sheet.data.highlightIR=new C(t,e,i,n)}},{key:"getHighlightInverseRange",value:function(){return this.sheet.data.highlightIR}},{key:"removeHighlightInverseRange",value:function(){delete this.sheet.data.highlightIR}},{key:"getCanvasImgByid",value:function(t,e){return t.getObjects().find((function(t){return t.id===e}))}},{key:"highlightAllImg",value:function(t,e){var i=this.sheet,n=i.data,r=(i.canvas,n.shapes),o=n.images;if(r){var a,s=Xo(r);try{for(s.s();!(a=s.n()).done;){var l=a.value;this.highlightImg(t,l,n.highlightstyle)}}catch(t){s.e(t)}finally{s.f()}}if(o){var c,h=Xo(o);try{for(h.s();!(c=h.n()).done;){var u=c.value;this.highlightImg(t,u,n.highlightstyle)}}catch(t){h.e(t)}finally{h.f()}}e.requestRenderAll()}},{key:"showHighlightImageShapesAuto",value:function(t){var e,i=this,n=this.sheet,r=n.data,o=n.canvas.fabric,a=Xo(r.highlighshapes);try{var s=function(){var n=e.value,o=r.shapes.find((function(t){return t.id===n}));o&&i.highlightImg(t,o,r.highlightstyle)};for(a.s();!(e=a.n()).done;)s()}catch(t){a.e(t)}finally{a.f()}var l,c=Xo(r.highlighimgs);try{var h=function(){var e=l.value,n=r.images.find((function(t){return t.id===e}));n&&i.highlightImg(t,n,r.highlightstyle)};for(c.s();!(l=c.n()).done;)h()}catch(t){c.e(t)}finally{c.f()}o.requestRenderAll()}},{key:"highlightImg",value:function(t,e,i){var n=this.sheet;n.data,n.canvas;if(e)if("TextBox"!==e.type)if(this.highlightImgFunc)e.setCustomHighlight(t,this.highlightImgFunc);else{var r=!!t&&new fabric.Image.filters.Invert;e.setFilter(r)}else e.setHighlight(t,i)}},{key:"getHighlightShaps",value:function(){return this.sheet.data.highlighshapes}},{key:"addHighlightShape",value:function(t){var e=this.sheet,i=e.data,n=e.canvas;if(-1===i.highlighshapes.indexOf(t)){var r=i.shapes.find((function(e){return e.id===t}));if(r){var o=n.fabric;i.highlighshapes.push(t),this.highlightImg(i.showhighlight,r,i.highlightstyle),i.showhighlight&&o.requestRenderAll()}}}},{key:"removeHighlightShape",value:function(t){var e=this.sheet,i=e.data,n=e.canvas.fabric,r=i.highlighshapes.indexOf(t);if(r>-1){i.highlighshapes.splice(r,1);var o=i.shapes.find((function(e){return e.id===t}));o&&(this.highlightImg(!1,o),n.requestRenderAll())}}},{key:"getHighlightImages",value:function(){return this.sheet.data.highlighimgs}},{key:"addHighlightImage",value:function(t){var e=this.sheet,i=e.data,n=e.canvas;if(-1===i.highlighimgs.indexOf(t)){var r=i.images.find((function(e){return e.id===t}));if(r){var o=n.fabric;i.highlighimgs.push(t),i.showhighlight&&(this.highlightImg(!0,r),o.requestRenderAll())}}}},{key:"removeHighlightImage",value:function(t){var e=this.sheet,i=e.data,n=e.canvas.fabric,r=i.highlighimgs.indexOf(t);if(r>-1){i.highlighimgs.splice(r,1);var o=i.images.find((function(e){return e.id===t}));o&&(this.highlightImg(!1,o),n.requestRenderAll())}}},{key:"setHighlightAll",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.sheet,n=i.data,r=i.canvas,o=i.table;if(n.showhighlight){var a=r.fabric;n.highlightall=t,this.highlightAllImg(t,a),t||this.showHighlightImageShapesAuto(!0)}e&&o.render()}}]),t}();function Go(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var qo=function(t){tt()(i,t);var e=Go(i);function i(){var t;l()(this,i);var n=new Mr(new Ar("400px",""),{required:!0},"".concat(W("download.fileName"),":"),100),r=new Mr(new Dr("Original",["Original","XLSX","PDF","HTML"],"100%",(function(t){return W("download.saveTypes.".concat(t))}),(function(e){var i=t.fileNameField.val();t.fileNameField.val(t.setSuffix(i,e)),t.fileNameField.validate()})),{required:!0},"".concat(W("download.saveType"),":"),100);return t=e.call(this,W("contextmenu.download"),[f("div","".concat(ot,"-form-fields")).children(n.el),f("div","".concat(ot,"-form-fields")).children(r.el),f("div","".concat(ot,"-buttons")).children(new pi("ok","primary").on("click",(function(){return t.btnClick("ok")})),new pi("cancel").on("click",(function(){return t.btnClick("cancel")})))]),xt()(Yn()(t),"defaultSuffix","xlsx"),t.fileNameField=n,t.saveTypeField=r,t.ci=null,t.values=[],t.change=function(){},t}return a()(i,[{key:"setSuffix",value:function(t,e){var i;return"Original"===e&&(e=this.originalType),t=(t=""===(null!==(i=t)&&void 0!==i?i:"")?this.originalFileName:t).includes(".")?t:t+"."+this.defaultSuffix,"".concat(t.substr(0,t.lastIndexOf(".")),".").concat(e.toLowerCase())}},{key:"btnClick",value:function(t){if("ok"===t){if(!this.fileNameField.validate())return;var e=this.saveTypeField.val(),i=this.fileNameField.val();i=this.setSuffix(i,e),this.change("ok",i,e)}this.hide()}},{key:"setValue",value:function(t){this.originalFileName=""===(null!=t?t:"")?"worksheet.xlsx":t,this.originalType=t.split(".").length>=2?t.substr(t.lastIndexOf(".")+1):this.defaultSuffix,this.fileNameField.val(this.originalFileName),this.show()}}]),i}(Rr);function Ko(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Zo=function(t){tt()(i,t);var e=Ko(i);function i(){var t;l()(this,i);var n=new Mr(new Ar("100%",""),{required:!0},"".concat(W("link.emailAddress"),":"),100),r=new Mr(new Ar("100%",""),{required:!0},"".concat(W("link.emailSubject"),":"),100),o=f("div","".concat(ot,"-form-fields")).children(f("div","".concat(ot,"-form-fields")).children(n.el),f("div","".concat(ot,"-form-fields")).children(r.el));o.hide();var a=new Mr(new Ar("100%",""),{required:!0},"".concat(W("link.sheetCell"),":"),100),s=new Mr(new Dr("",[""],"max-content",(function(t){return t}),(function(t){})),{required:!0},"".concat(W("link.sheetPage"),":"),100);s.input.el.css("width","max-content");var c=f("div","".concat(ot,"-form-fields")).children(f("div","".concat(ot,"-form-fields")).children(a.el),f("div","".concat(ot,"-form-fields")).children(s.el));c.hide();var h=new Mr(new Ar("100%",""),{required:!0},"".concat(W("link.webUrl"),":"),100),u=f("div","".concat(ot,"-form-fields")).children(h.el);u.hide();var d=new Mr(new Dr("web",["web","sheet","email"],"max-content",(function(t){return W("link.linkTypes.".concat(t))}),(function(e){switch(u.hide(),c.hide(),o.hide(),e){case"web":u.show(),t.active="web";break;case"sheet":c.show(),t.active="sheet";break;case"email":o.show(),t.active="email"}})),{required:!0},"".concat(W("link.linkType"),":"),100);return t=e.call(this,W("contextmenu.link"),[f("div","".concat(ot,"-form-fields")).children(d.el),f("div","".concat(ot,"-form-fields")).children(o.el,u.el,c.el),f("br"),f("br"),f("div","".concat(ot,"-buttons")).children(new pi("ok","primary").on("click",(function(){return t.btnClick("ok")})),new pi("cancel").on("click",(function(){return t.btnClick("cancel")})))]),xt()(Yn()(t),"active",void 0),t.ci=null,t.values=[],t.sheetPageField=s,t.sheetField=c,t.webField=u,t.emailField=o,t.sheetCellField=a,t.webUrlField=h,t.emailAddressField=n,t.emailSubjectField=r,t.linkTypeField=d,t.change=function(){},t.el.on("click",(function(t){t.preventDefault()})),t}return a()(i,[{key:"btnClick",value:function(t){var e=this.link,i=this.type;if("ok"===t){switch(this.active){case"web":if(!this.webUrlField.validate())return;if(!this.isValidHttpUrl(this.webUrlField.val()))return void this.webUrlField.validateFail("Missing address network protocols such as http:// or https://");e.type=0,e.address=this.webUrlField.val();break;case"sheet":if(!this.sheetCellField.validate())return;e.type=3,e.address="".concat(this.sheetPageField.val(),"!").concat(this.sheetCellField.val());break;case"email":e.type=2,e.address="mailto:".concat(this.emailAddressField.val(),"?subject=").concat(this.emailSubjectField.val())}this.change("ok",e,i)}this.hide()}},{key:"clear",value:function(){this.sheetField.hide(),this.sheetPageField.val(this.sheets[0]),this.sheetCellField.val("A1"),this.webField.hide(),this.webUrlField.val(""),this.webUrlField.validateClear(),this.emailField.hide(),this.emailSubjectField.val(""),this.emailAddressField.val("")}},{key:"isValidHttpUrl",value:function(t){var e;try{e=new URL(t)}catch(t){return!1}return"http:"===e.protocol||"https:"===e.protocol}},{key:"setValue",value:function(t,e,i){var n;if(this.type=i,this.sheets=t,this.link=e,this.clear(),this.sheetPageField.input.suggest.setItems(t.map((function(t){return{key:t,title:t}}))),""!==(null!==(n=null==e?void 0:e.type)&&void 0!==n?n:""))switch(e.type){case 1:case 0:this.webUrlField.input.val(e.address),this.linkTypeField.val("web"),this.webField.show(),this.active="web";break;case 2:var r=/mailto:([^\?]*)\?subject\=(.*)/.exec(e.address);this.emailSubjectField.val(r[2]),this.emailAddressField.val(r[1]),this.linkTypeField.val("email"),this.emailField.show(),this.active="email";break;case 3:var o=e.address.split("!");if(2!==o.length)break;this.sheetPageField.val(o[0]),this.sheetCellField.val(o[1]),this.linkTypeField.val("sheet"),this.sheetField.show(),this.active="sheet"}else this.linkTypeField.val("web"),this.webField.show(),this.active="web";this.show()}}]),i}(Rr),Jo=function(){function t(e){l()(this,t),this.el=f("div","".concat(ot,e?"-banner-icon-s":"-banner-icon"))}return a()(t,[{key:"setHomeIcon",value:function(t,e){this.el.css({"background-image":"url(".concat(t,")"),"background-size":"contain","background-position":"center"});var i=f("a");i.attr("href",e),i.css({display:"block",height:"100%",width:"100%","text-decoration":"none"}),this.el.child(i)}}]),t}(),$o=function(){function t(e){var i=this;l()(this,t),this.el=f("div","".concat(ot,"-banner-filename")),this.filename=f("div","".concat(ot,"-banner-filename-name")),this.filename.on("blur",(function(t){t.target.innerHTML=t.target.innerHTML.replace(/<[^>]+>/gi,"");var n=t.target.innerText;n=n.replace(/\r?\n|\r/g,""),e.filename=n+i.suffixStr,setTimeout((function(){e.selector.el.show()}),100)})),this.filename.on("focus",(function(t){window.mobileEditOnCell=!1,e.editor.el.hide()})),this.filename.on("keyup",(function(t){13===t.keyCode&&i.filename.el.blur()})),this.filename.attr("contenteditable",!0),this.filename.attr("spellcheck",!1),this.suffix=f("div"),this.el.children(this.filename,this.suffix)}return a()(t,[{key:"setValue",value:function(t){if(t.includes(".")){var e=t.substring(0,t.lastIndexOf(".")),i=this.suffixStr=t.substring(t.lastIndexOf("."));this.filename.html(e),this.suffix.html(i)}}}]),t}(),Qo=function(){function t(e,i,n,r,o,a,s){var c=this;l()(this,t),this.data=e;e.defaultStyle();this.change=function(){},this.widthFn=i,this.isHide=n,this.icon=new Jo(!o),this.filenamebar=new $o(a),this.menubar=new Wo(e,i,n,r,s),this.el=f("div");var h=f("div","".concat(ot,"-banner"));n&&!r?(this.el.hide(),this.notShow=!0):(h.children(this.icon.el,f("div","".concat(ot,o?"-banner-info":"-banner-info-s")).children(this.filenamebar.el,this.menubar.el)),this.el.child(h)),o||this.filenamebar.el.hide(),this.menubar.change=function(){c.change.apply(c,arguments)}}return a()(t,[{key:"show",value:function(){this.notShow||this.el.show()}},{key:"hide",value:function(){this.el.hide()}},{key:"hideDropdown",value:function(){this.menubar.hideDropdown()}},{key:"setFileName",value:function(t){this.filenamebar.setValue(t)}}]),t}();function ta(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ea(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ta(Object(i),!0).forEach((function(e){xt()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ta(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function ia(t,e){var i,n=this;return function(){for(var r=n,o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];var l=a;i||(i=setTimeout((function(){i=null,t.apply(r,l)}),e))}}function na(){var t=this.data,e=this.verticalScrollbar,i=this.horizontalScrollbar,n=t.getSelectedRect(),r=n.l,o=n.t,a=n.left,s=n.top,l=n.width,c=n.height,h=this.getTableOffset();if(Math.abs(a)+l>h.width)i.move({left:r+l-h.width});else{var u=t.freezeTotalWidth();a<u&&i.move({left:r-1-u})}if(Math.abs(s)+c>h.height)e.move({top:o+c-h.height-1});else{var f=t.freezeTotalHeight();s<f&&e.move({top:o-1-f})}}function ra(){var t=this.data,e=this.verticalScrollbar,i=this.horizontalScrollbar,n=t.getSelectedRectBySearch(),r=n.l,o=n.t;i.move({left:r-1}),e.move({top:o-1})}function oa(t,e,i){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(-1!==e||-1!==i){var o=this.table,a=this.selector,s=this.toolbar,l=this.formulaBar,c=this.data,h=this.contextMenu;if(h.setMode(-1===e||-1===i?"row-col":"range"),c.canSelected(e,i)){var u=c.getCell(e,i);t?(a.setEnd(e,i,r),this.trigger("cells-selected",u,a.range)):(a.set(e,i,n),this.trigger("cell-selected",u,e,i)),this.focusing=!0,a.setObjId(null),s.reset(),l.reset(),o.render()}}}function aa(t,e){var i=this.selector,n=this.data,o=n.rows,a=n.cols,s=r()(i.indexes,2),l=s[0],c=s[1],h=i.range,u=h.eri,f=h.eci;if(t){var d=r()(i.moveIndexes,2);l=d[0],c=d[1]}"left"===e?c>0&&(c-=1):"right"===e?(f!==c&&(c=f),c<a.len-1&&(c+=1)):"up"===e?l>0&&(l-=1):"down"===e?(u!==l&&(l=u),l<o.len-1&&(l+=1)):"row-first"===e?c=0:"row-last"===e?c=a.len-1:"col-first"===e?l=0:"col-last"===e&&(l=o.len-1),t&&(i.moveIndexes=[l,c]),oa.call(this,t,l,c),na.call(this)}function sa(t){if(0===t.buttons&&t.target.className!=="".concat(ot,"-resizer-hover")){var e=t.offsetX,i=t.offsetY,n=this.rowResizer,r=this.colResizer,o=this.tableEl,a=this.data,s=a.rows,l=a.cols,c=a.displayRight2Left,h=a.settings.row.height;if(e>l.indexWidth&&i>h)return n.hide(),void r.hide();var u=o.box(),f=a.getCellRectByXY(t.offsetX/a.zoomlevel,t.offsetY/a.zoomlevel);f.ri>=0&&-1===f.ci?(f.width=l.indexWidth*a.zoomlevel,n.show(f,{width:u.width}),s.isHide(f.ri-1)?n.showUnhide(f.ri):n.hideUnhide()):n.hide(),-1===f.ri&&f.ci>=0?(f.height=h*a.zoomlevel,f.top=0,r.show(f,{height:u.height},c),l.isHide(f.ci-1)?r.showUnhide(f.ci):r.hideUnhide()):r.hide()}}function la(t){var e=this.verticalScrollbar,i=this.horizontalScrollbar,n=this.data,r=e.scroll().top,o=i.scroll().left,a=n.rows,s=n.cols,l=t.deltaY,c=t.deltaX,h=function(t,e){var i=t,n=0;do{n=e(i),i+=1}while(n<=0);return n},u=function(t){if(t>0){var i=n.scroll.ri+1;if(i<a.len){var o=h(i,(function(t){return a.getHeight(t)}));e.move({top:r+o-1})}}else{var s=n.scroll.ri-1;if(s>=0){var l=h(s,(function(t){return a.getHeight(t)}));e.move({top:0===s?0:r-l})}}},f=Math.abs(l),d=Math.abs(c),v=Math.max(f,d);/Firefox/i.test(window.navigator.userAgent)&&ia(u(t.detail),50),v===d&&ia(function(t){if(t>0){var e=n.scroll.ci+1;if(e<s.len){var r=h(e,(function(t){return s.getWidth(t)}));i.move({left:o+r-1})}}else{var a=n.scroll.ci-1;if(a>=0){var l=h(a,(function(t){return s.getWidth(t)}));i.move({left:0===a?0:o-l})}}}(c),50),v===f&&ia(u(l),50)}function ca(){var t=this.data,e=this.verticalScrollbar,i=(1!==t.zoomlevel?this.originTableOffset:this.getTableOffset()).height,n=t.exceptRowTotalHeight(0,-1);e.set(i,(t.rows.totalHeight()-n)*t.zoomlevel)}function ha(){var t=this.data,e=this.horizontalScrollbar,i=(1!==t.zoomlevel?this.originTableOffset:this.getTableOffset()).width;t&&e.set(i,t.cols.totalWidth()*t.zoomlevel),t.displayRight2Left?e.el.attr("dir","rtl"):e.el.removeAttr("dir")}function ua(){var t=this.selector,e=this.data,i=this.editor,n=this.canvas,o=r()(e.freeze,2),a=o[0],s=o[1];if(a>0||s>0){var l=e.freezeTotalWidth(),c=e.freezeTotalHeight();i.setFreezeLengths(l,c)}else i.setFreezeLengths(0,0);n.resetFreeze(e),t.resetAreaOffset()}function fa(){var t=this.tableEl,e=this.overlayerEl,i=this.overlayerCEl,n=this.table,r=this.toolbar,o=this.formulaBar,a=this.selector,s=this.hyperlink,l=this.el;this.originTableOffset||(this.originTableOffset=this.getTableOffset()),1!==this.data.zoomlevel&&(a.br.useHideInput=!1);var c=this.getTableOffset(),h=this.getRect();t.attr(h),e.offset(h);var u=this.data.zoomlevel;i.offset(ea(ea({},c),{},{width:c.width/u,height:c.height/u})),l.css("width","".concat(h.width,"px")),ca.call(this),ha.call(this),ua.call(this),n.render(),r.reset(),o.reset(),a.reset(),s.loadLinkPosition(this),1!==this.data.zoomlevel&&(a.br.useHideInput=!0)}function da(){var t=this.data,e=this.selector;t.clearClipboard(),e.hideClipboard()}function va(){var t=this.data,e=this.selector,i=this.canvas;t.copy(),e.showClipboard(),i.clipboard=null}function ga(){var t=this.data,e=this.selector;t.cut(),e.showClipboard()}function pa(t,e){var i=this.data;if("read"!==i.settings.mode&&!i.getLocked())if(i.paste(t,(function(t){return lt("Tip",t)})))fa.call(this);else if(e&&null==i.clipboard.range){var n=e.clipboardData.getData("text/plain");n.length>0&&(this.data.pasteFromText(n),fa.call(this))}}function ma(){this.data.hideRowsOrCols(),fa.call(this)}function ya(t,e){this.data.unhideRowsOrCols(t,e),fa.call(this)}function ba(){this.data.autofilter(),fa.call(this)}function wa(){var t=document.createElement("div");t.id="aspose_mask_bg",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.width="100%",t.style.height="100%",t.style.backgroundColor="#777",t.style.opacity=.6,t.style.zIndex=10001,document.body.appendChild(t);var e=document.createElement("div");e.style.position="absolute",e.style.top="33%",e.style.left="40%",e.style.backgroundColor="white",e.style.border="#336699 1px solid",e.style.textAlign="center",e.style.fontSize="medium",e.style.padding="1.5em 4em 1.5em 4em",e.innerText="updating , please wait...",t.appendChild(e)}function xa(){var t=document.getElementById("aspose_mask_bg");null!=t&&t.parentNode.removeChild(t)}function Ca(t,e){return ka.apply(this,arguments)}function ka(){return(ka=bt()(kt.a.mark((function t(e,i){var n,r,o,a,s,l;return kt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.data,r={sheetname:n.name,actrow:n.selector.ri,actcol:n.selector.ci,datas:xs.getUpdateDatas()},o={p:JSON.stringify(r),uid:this.uniqueid,file:e,outputType:i},a=this.fileDownloadUrl,s=new FormData,Object.keys(o).forEach((function(t){return s.set(t,o[t])})),wa(),t.next=9,fetch(a,{method:"POST",body:s});case 9:if((l=t.sent).ok){t.next=15;break}xa(),alert("Download failed, please try again"),t.next=22;break;case 15:return t.t0=Wa,t.next=18,l.json();case 18:t.t1=t.sent,t.t2=e,(0,t.t0)(t.t1,t.t2),xa();case 22:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function _a(){var t=this.toolbar;t.paintformatActive()&&(pa.call(this,"format"),da.call(this),t.paintformatToggle())}function Sa(){var t=this.editor,e=this.contextMenu,i=this.commentTip,n=this.commentEditable;t.clear(),e.hide(),i.hide(),n.saveAndHide(this)}function Ta(t){var e=this,i=this.selector,n=this.data,o=this.table,a=this.sortFilter,s=this.hyperlink,l=t.offsetX,c=t.offsetY,h=t.target.className==="".concat(ot,"-selector-corner"),u=o.zoomlevel,f=n.getCellRectByXY(l/u,c/u),d=f.left,v=f.top,g=f.width,p=f.height,m=n.viewHeight(),y=n.viewWidth(),b=f.ri,w=f.ci;if(!(b<-1||w<-1)){var x=n.autoFilter,C=n.TableAutoFilters;if(x.includes(b,w)&&d+g-20*u<l&&v+p-20*u<c){var k=x.items(w,(function(t,e){return n.rows.getCell(t,e)}));return a.set(w,k,x.getFilter(w),x.getSort(w)),a.setOffsetAdjustView({left:d,top:v+p+2},y,m),void(n.currentAutoFilter=x)}for(var _=0,S=C.length;_<S;_++){var T=C[_];if(T.includes(b,w)&&d+g-20*u<l&&v+p-20*u<c){var O=T.items(w,(function(t,e){return n.rows.getCell(t,e)}));return a.set(w,O,T.getFilter(w),T.getSort(w)),a.setOffsetAdjustView({left:d,top:v+p+2},y,m),void(n.currentAutoFilter=T)}}if(!t.shiftKey){if(h){if(window.mobileAndTabletCheck())return;i.showAutofill(b,w)}else if(oa.call(this,!1,b,w),!t.ctrlKey&&2!==t.button){var E,R=null!==(E=s.checkAndAccess(n,b,w))&&void 0!==E?E:[w,b],A=r()(R,2);w=A[0],b=A[1]}window.mobileAndTabletCheck()||At(window,(function(t){var r=n.getCellRectByXY(t.offsetX/u,t.offsetY/u);if(b=r.ri,w=r.ci,h){if(window.mobileAndTabletCheck())return;i.showAutofill(b,w)}else 1!==t.buttons||t.shiftKey||oa.call(e,!0,b,w,!0,!0)}),(function(){n.getLocked()||(h&&i.arange&&"read"!==n.settings.mode&&n.autofill(i.arange,"all",(function(t){return lt("Tip",t)}))&&o.render(),i.hideAutofill(),_a.call(e))}))}h||1!==t.buttons||t.shiftKey&&oa.call(this,!0,b,w)}}function Oa(){var t=this.data.getSelectedRect();Ea.call(this,t)}function Ea(t){var e=this.editor,i=this.getTableOffset(),n="top";t.top>i.height/2&&(n="bottom"),e.setOffset(t,n)}function Ra(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.table,i=this.editor,n=this.data;"read"!==n.settings.mode&&(n.getLocked()||(Oa.call(this),e.clearSelectRender(),i.setCell(n.getSelectedCell(),n.getSelectedValidator(),t),da.call(this)))}function Aa(t){this.table;var e=this.editor,i=this.data;if("read"!==i.settings.mode&&!i.getLocked()){var n=i.getRectForTextbox(t);Ea.call(this,n),e.setForTextBox(t),da.call(this)}}function Ia(){var t=this.formulaBar,e=this.data;t.resetData(e)}function Pa(t){var e=this,i=this.data,n=this.table,r=this.selector,o=this.hyperlink;i.scrolly(t,(function(){1!==e.data.zoomlevel&&(r.br.useHideInput=!1),r.resetBRLAreaOffset(),Oa.call(e),n.render(),o.loadLinkPosition(e),i.scrollImagesShapes(),1!==e.data.zoomlevel&&(r.br.useHideInput=!0)}))}function Da(t){var e=this,i=this.data,n=this.table,r=this.selector,o=this.hyperlink;i.scrollx(t,(function(){1!==e.data.zoomlevel&&(r.br.useHideInput=!1),r.resetBRTAreaOffset(),Oa.call(e),n.render(),o.loadLinkPosition(e),i.scrollImagesShapes(),1!==e.data.zoomlevel&&(r.br.useHideInput=!0)}))}function Fa(t,e){var i=t.ri,n=this.table,r=this.selector,o=this.data,a=this.hyperlink,s=o.rows.getHeight(i);o.rows.setHeight(i,e),o.updateRowsHeight.add(i),o.updateConditionImagePositionForRow(i,e-s,e),n.render(),1!==this.data.zoomlevel&&(r.br.useHideInput=!1),r.resetAreaOffset(),a.loadLinkPosition(this),ca.call(this),Oa.call(this),1!==this.data.zoomlevel&&(r.br.useHideInput=!0)}function Ma(t,e){var i=t.ci,n=this.table,r=this.selector,o=this.data,a=this.hyperlink,s=o.cols.getWidth(i);o.cols.setWidth(i,e),o.updateCols.add(i),o.updateConditionImagePositionForCol(i,e-s,e),n.render(),1!==this.data.zoomlevel&&(r.br.useHideInput=!1),r.resetAreaOffset(),a.loadLinkPosition(this),ha.call(this),Oa.call(this),1!==this.data.zoomlevel&&(r.br.useHideInput=!0)}function ja(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"finished",i=this.data,n=this.table;if("read"!==i.settings.mode&&!i.getLocked()){i.setSelectedCellText(t,e);var r=i.selector,o=r.ri,a=r.ci;if("finished"===e){if("server"===i.settings.updateMode)return;n.render()}else this.trigger("cell-edited",t,o,a)}}function La(t){var e=this.data;"insert-row"===t?e.insert("row"):"delete-row"===t?e.delete("row"):"insert-column"===t?e.insert("column"):"delete-column"===t?e.delete("column"):"delete-cell"===t?e.deleteCell():"delete-cell-format"===t?e.deleteCell("format"):"delete-cell-text"===t?e.deleteCell("text"):"cell-printable"===t?e.setSelectedCellAttr("printable",!0):"cell-non-printable"===t?e.setSelectedCellAttr("printable",!1):"cell-editable"===t?e.setSelectedCellAttr("editable",!0):"cell-non-editable"===t&&e.setSelectedCellAttr("editable",!1),da.call(this),fa.call(this)}function Ba(t){for(var e=t,i=0,n=0;null!==e;)i+=e.offsetTop,n+=e.offsetLeft,e=e.offsetParent;return{top:i,left:n}}function za(t,e,i){var n=this.data,r=this.modalSort,o=this.modalDownload,a=this.modalLink,s=this.modalSearch,l=this.commentEditable,c=this.modalInsertURLImage,h=(this.overlayerCEl,this.canvas,this.filename),u=this.toolbar;function f(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Device",i=this.filename;"Original"!==t&&(i="".concat(i.substr(0,i.lastIndexOf(".")),".").concat(t.toLowerCase())),"function"!=typeof this.fileDownloadCallFunc?Ca.call(this,i,t):this.fileDownloadCallFunc(i,t,e)}if(window.mobileAndTabletCheck()&&u.moreEl.el.hasClass("active")&&u.moreEl.dd.hide(),"undo"===t)this.undo();else if("redo"===t)this.redo();else if("print"===t)this.print.preview(),this.print.toPrint();else if("paintformat"===t)!0===e?va.call(this):da.call(this);else if("clearformat"===t)La.call(this,"delete-cell-format");else if("chart"===t);else if("autofilter"===t)ba.call(this);else if("freeze"===t)if(e){var d=n.selector,v=d.ri,g=d.ci;this.freeze(v,g)}else this.freeze(0,0);else if("sort"===t)r.setValue(n.getSelectedSort());else if("download"===t)o.setValue(h);else if("download_HTML"===t)f.call(this,"HTML");else if("download_Original"===t)f.call(this,"Original");else if("download_XLSX"===t)f.call(this,"XLSX");else if("download_PDF"===t)f.call(this,"PDF");else if("download_GOOGLE"===t)f.call(this,"Original","GoogleDrive");else if("download_DROPBOX"===t)f.call(this,"Original","Dropbox");else if("search"===t)s.show();else if("menu-display-hide"===t)"up"===this.toolbar.menuDisplay.state?(this.toolbar.menuDisplay.setDown(),this.menubar.hide(),this.table.render()):(this.toolbar.menuDisplay.setUp(),this.menubar.show(),this.table.render());else if("insertComment"===t&&"commentEdit"===e||"insertComment"===t||"commentEdit"===t){var p=n.selector,m=p.ri,y=p.ci,b="";if(void 0!==n.comments)for(var w=0;w<n.comments.length;w++){var x=n.comments[w];x.row===m&&x.col===y&&(b=x.note)}var C=n.cellRectWithOutTransfer(m,y);l.col=y,l.row=m,l.setPosition(b,C,n.displayRight2Left),this.commentTip.onEdit=!0,"comments"===n.search.lookin&&(n.search.result=null)}else if("insertComment"===t&&"commentRemove"===e||"commentRemove"===t){var k=n.selector,_=k.ri,S=k.ci;if(void 0!==n.comments)for(var T=0;T<n.comments.length;T++)n.comments[T].col===S&&n.comments[T].row===_&&n.comments.splice(T,1);"comments"===n.search.lookin&&(n.search.result=null),this.table.render()}else if("insertComment"===t&&"commentPrevious"===e||"commentPrevious"===t)Ha(this,n,"previous");else if("insertComment"===t&&"commentNext"===e||"commentNext"===t)Ha(this,n,"next");else if("insert-image"===t)"url"===e&&c.show();else if("zoom-size"===t)this.setzoom(e.number);else if("insertSheet"===t)this.addSheet();else if("insertRow"===t)La.call(this,"insert-row");else if("insertColumn"===t)La.call(this,"insert-column");else if("link"===t){if(this.canvas.isImageOnSelected())return void this.canvas.link(this.data);var O=this.selector.range,E=this.hyperlink.getSelectArea(O),R=this.hyperlink.findByArea(this.data,E),A="edit";if(!R){(R={}).area=E;var I=this.data.getCell(O.sri,O.sci);R.text=I?I.text:"",A="add"}a.setValue(xs.datas.map((function(t){return t.name})),R,A)}else n.setSelectedCellAttr(t,e),"formula"!==t||n.selector.multiple()||Ra.call(this),fa.call(this);i&&i()}function Ha(t,e,i){var n=t.selector,r=t.commentEditable,o=e.selector,a=o.ri,s=o.ci,l=a,c=s,h="";if(void 0!==e.comments){e.comments.sort((function(t,e){return t.row>e.row||t.row===e.row&&t.col>e.col?1:-1}));for(var u=0;u<e.comments.length;u++){var f=e.comments[u];if("previous"===i)(f.row<a||f.row===a&&f.col<s)&&(l=f.row,c=f.col,h=f.note);else if("next"===i&&(f.row>a||f.row===a&&f.col>s)){l=f.row,c=f.col,h=f.note;break}}}if(n.set(l,c),""!==h){var d=e.cellRectWithOutTransfer(l,c);r.col=c,r.row=l,r.onEdit=!1,r.setPosition(h,d)}}function Na(t,e,i,n){this.data.setAutoFilter(t,e,i,n),fa.call(this),this.data.updateConditionImageVisible()}function Wa(t,e){var i=new XMLHttpRequest;i.open("get",t,!0),i.responseType="blob",i.onload=function(){if(200===this.status){var t=this.response;Ua.call(this,t,e)}else alert("Download failed, please try again")},i.send()}function Ua(t,e){var i=document.createElement("a"),n=t;"string"==typeof t?i.target="_blank":n=window.URL.createObjectURL(t),i.href=n,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),"string"!=typeof t&&window.URL.revokeObjectURL(n)}function Xa(t){var e=Ba(t.target);return[t.changedTouches[0].pageX-e.left,t.changedTouches[0].pageY-e.top]}function Ya(){var t=this,e=this.selector,i=this.overlayerEl,n=this.rowResizer,o=this.colResizer,a=this.verticalScrollbar,s=this.horizontalScrollbar,l=this.editor,c=this.contextMenu,h=this.commentTip,u=this.commentEditable,d=this.toolbar,v=this.menubar,g=this.formulaBar,p=this.modalValidation,m=this.modalSort,y=this.modalDownload,b=this.modalLink,w=(this.hyperlink,this.modalInsertURLImage),x=this.modalSearch,k=this.sortFilter,_=this.canvas,S=this.el;function T(t,e){Sa.call(t),Ta.call(t,e)}if(window.mobileAndTabletCheck()||i.on("mousemove",(function(e){sa.call(t,e)})).on("mousedown",(function(e){Sa.call(t),2===e.buttons?(t.data.xyInSelectedRect(e.offsetX,e.offsetY)||Ta.call(t,e),c.setPosition(e.offsetX,e.offsetY),e.stopPropagation()):2===e.detail?Ra.call(t):Ta.call(t,e)})).on("mousewheel.stop",(function(e){la.call(t,e)})).on("mouseout",(function(t){var e=t.offsetX;t.offsetY<=0&&o.hide(),e<=0&&n.hide()})),u.el.on("input",(function(e){if(1===t.commentEditable.el.el.childNodes.length&&"#text"===t.commentEditable.el.el.childNodes[0].nodeName){var i=f("font");i.attr("style","FONT-FAMILY: 宋体;FONT-SIZE: 9pt;COLOR: #000000;TEXT-ALIGN: left;"),i.child(document.createTextNode(t.commentEditable.el.el.textContent)),t.commentEditable.el.el.replaceChild(i.el,t.commentEditable.el.el.firstChild),e.target.focus();var n=window.getSelection();n.selectAllChildren(e.target),n.collapseToEnd()}})),e.inputChange=function(e){ja.call(t,e,"input"),Ra.call(t),Ia.call(t)},g.inputChange=function(e){ja.call(t,e,"input"),Ra.call(t,!1)},g.enter=function(e,i){if(e.altKey){l.insertTextNewLine(e);var n=i?e.target.innerHTML:e.target.innerText;ja.call(t,n,"input"),Ra.call(t,!1)}else l.clear(),aa.call(t,!1,e.shiftKey?"up":"down"),t.focusing=!0;e.preventDefault()},g.tab=function(e){l.clear(),aa.call(t,!1,e.shiftKey?"left":"right"),t.focusing=!0,e.preventDefault()},g.focuson=function(){t.focusing=!1},Tt(S.el,"mousemove",(function(e){h.hide();var i=e.offsetX,n=e.offsetY,r=t.data,o=t.table,a=t.hyperlink,s=t.canvas,l=r.comments,c=o.zoomlevel,u=r.getCellRectByXY(i/c,n/c);if(0!==r.hyperlinks.length){var f=a.getSelectArea({sci:u.ci,eci:u.ci,sri:u.ri,eri:u.ri});a.findByArea(r,f)?s.setCursor("pointer"):s.setCursor("")}u.ri>=0&&u.ci>=0&&l.forEach((function(t){u.ri===t.row&&u.ci===t.col&&h.setPosition(t.note,u,r.displayRight2Left)}))})),window.mobileAndTabletCheck()){var O,E=this,R=!1,A=!1,I=function(){return R&&A},P=this.getTableOffset(),D="",F=[0,0],M=[0,0],j=[0,0],L=[0,0],B=!1;E.table.zoomlevel;new AlloyFinger(this.el.el,{tap:function(t){},touchStart:function(t){if(!(t.target.parentElement&&"true"===t.target.parentElement.contentEditable||"true"===t.target.contentEditable)){!function(t,e){t.target.className.includes("item")||e.contextMenu.hide()}(t,E);var e=function(t,e){var i,n=t.target.className.includes("".concat(ot,"-selector-corner")),r=t.target.className.includes("tl")?"tl":"br",o=[],a=[],s=!1;return n&&(i=Ba(t.target.offsetParent.offsetParent),o[0]=t.changedTouches[0].pageX,o[1]=t.changedTouches[0].pageY,a[0]=e.data.scroll.x,a[1]=e.data.scroll.y,s=!0),[r,i,o,a,s]}(t,E),i=r()(e,5);D=i[0],O=i[1],F=i[2],j=i[3],(R=i[4])&&(B=!1,console.info("#####touchStart ..that.data.scroll.y...... "+E.data.scroll.y+",startscroll[0]:"+j[0]),j[0]=E.data.scroll.x,j[1]=E.data.scroll.y,E.selector.setMobilestartOffsetAndRange())}},touchEnd:function(t){if(!(t.target.parentElement&&"true"===t.target.parentElement.contentEditable||"true"===t.target.contentEditable)&&I()){var i=M[0]-F[0]+E.data.scroll.x-j[0],n=M[1]-F[1]+E.data.scroll.y-j[1];e.setMobileMultipleSelect(i,n),function(t,e,i,n){if(e&&i){var r=t.br.areaEl.el.getBoundingClientRect(),o=r.right>window.screen.width?window.screen.width:r.right,a=r.top-i.top+n.top;a=a>window.screen.height?window.screen.height:a,c.setPosition(o,a)}}(e,!0,O,P);var o=(Pt(),[!1,!1,!1]),a=r()(o,3);R=a[0],A=a[1],B=a[2],E.table.render()}},doubleTap:function(t){if(!(t.target.parentElement&&"true"===t.target.parentElement.contentEditable||"true"===t.target.contentEditable)&&"CANVAS"===t.target.nodeName){var e=Xa(t),i=r()(e,2);t.offsetX=i[0],t.offsetY=i[1],window.mobileEditOnCell=!0,T(E,t),Ra.call(E)}},longTap:function(t){if(!(t.target.parentElement&&"true"===t.target.parentElement.contentEditable||"true"===t.target.contentEditable)){var e=Xa(t),i=r()(e,2),n=i[0],o=i[1];c.setPosition(n,o)}},singleTap:function(t){if(!(t.target.parentElement&&"true"===t.target.parentElement.contentEditable||"true"===t.target.contentEditable||"CANVAS"!==t.target.nodeName||function(t){return t.target.className.includes("item")}(t))){var i=Xa(t),n=r()(i,2);t.offsetX=n[0],t.offsetY=n[1],window.mobileEditOnCell=!0,T(E,t),e.br.useHideInput=!1,window.keyboardShow?(e.br.useHideInput=!0,Ra.call(E)):function(t,e){var i=Xa(t),n=r()(i,2),o=n[0],a=n[1];if(t.target.className.includes("".concat(ot,"-selector-corner"))){var s=Ba(t.target);o=s.left,a=s.top}var l=o<=e.left&&a>=e.top,h=o>=e.left&&a<=e.top;if(l||h){var u=l?e.left:o,f=h?e.top:a;c.setPosition(u,f)}}(t,P)}},rotate:function(t){},pinch:function(t){if(!(t.target.parentElement&&"true"===t.target.parentElement.contentEditable||"true"===t.target.contentEditable)){E.editor.el.hide();var e=t.zoom;e>2&&(e=2),e<.5&&(e=.5),E.setzoom(e)}},pressMove:function(t){if(!(t.target.parentElement&&"true"===t.target.parentElement.contentEditable||"true"===t.target.contentEditable)){var e=E.selector;E.data;if(A=!0,I()){switch(function(t,e,i,n,r){t[0]=n.changedTouches[0].pageX,t[1]=n.changedTouches[0].pageY,e[0]=i.data.scroll.x,e[1]=i.data.scroll.y}(M,L,E,t),D){case"tl":break;case"br":var i=M[0]-F[0],n=M[1]-F[1];e.setEndMobile(i,n);var o=e.getMobileMultipleSelect(i,n),a=r()(o,2),s=a[0],l=a[1];s>=E.data.viewRange().eri-4&&!B&&(B=!0,e.setEnd(s,l),function(t,e){""!==t?Dt(e):Pt()}("down",E))}}else Math.abs(t.deltaX)>Math.abs(t.deltaY)?Math.abs(t.deltaX)>18&&(E.scrollH(t.deltaX),E.table.render()):Math.abs(t.deltaY)>18&&(E.scrollV(t.deltaY),E.table.render())}},swipe:function(t){}})}d.change=function(e,i){return za.call(t,e,i)},v.change=function(e,i){return za.call(t,e,i,(function(){return v.hideDropdown()}))},k.ok=function(e,i,n,r){return Na.call(t,e,i,n,r)},n.finishedFn=function(e,i){Fa.call(t,e,i)},o.finishedFn=function(e,i){Ma.call(t,e,i)},n.unhideFn=function(e){ya.call(t,"row",e)},o.unhideFn=function(e){ya.call(t,"col",e)},a.moveFn=function(e,i){Pa.call(t,e,i)},s.moveFn=function(e,i){Da.call(t,e,i)},l.change=function(e,i){ja.call(t,i,e),Ia.call(t)},l.textboxChange=function(e,i){var n=t.data;t.table;n.updateTextbox(e,i)},p.change=function(e){if("save"===e){for(var i,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(i=t.data).addValidation.apply(i,r)}else t.data.removeValidation()},m.change=function(e,i,n,r){"ok"===e&&t.data.doSort(i,n,r)},y.change=function(e,i,n){"ok"===e&&Ca.call(t,i,n)},b.change=function(e,i,n){"ok"===e&&(t.canvas.isImageOnSelected()?t.canvas.setHyperlink(i):"add"===n&&(t.data.hyperlinks=t.data.hyperlinks.filter((function(t){return!C.valueOf(i.area).contains(C.valueOf(t.area))})),t.data.hyperlinks.push(i),t.hyperlink.setHyperlinkStyleByArea(i.area,t,!0),t.hyperlink.loadLinkPosition(t)))},w.change=function(e,i){var n=t.canvas,r=t;if("ok"===e){var o=r.data.getSelectedRect();n.setLoading(r,{top:o.top,left:o.left});var a={ri:t.data.selector.ri,ci:t.data.selector.ci,name:t.data.name},s={p:JSON.stringify(a),uid:r.uniqueid,imageurl:i};$.ajax({url:r.imageUploadByUrlUrl,type:"post",data:s,success:function(t,e,i){(t=JSON.parse(t)).Error?lt("error",t.Error):n.doInsertURLImage(t,r)}})}},$("#upload-image").on("change",(function(e){var i=t.canvas,n=t,r=new FormData;r.append("uid",n.uniqueid);var o={ri:t.data.selector.ri,ci:t.data.selector.ci,name:t.data.name};r.append("p",JSON.stringify(o)),r.append("image",e.target.files[0]);var a=n.data.getSelectedRect();i.setLoading(n,{top:a.top,left:a.left}),$.ajax({url:n.imageUploadByLocalUrl,type:"post",processData:!1,contentType:!1,data:r,success:function(t,r,o){(t=JSON.parse(t)).Error?lt("error",t.Error):i.doInsertImage(t,n),e.target.value=null}})})),x.change=function(i,n,r,o,a){if("close"!==i){r||(n=n.toUpperCase());var s=t.data,l=s.search,c=s.rows,h=s.comments,f=l.keywords,d=[];if(null!=l.result&&f===n&&l.iscasesense===r&&l.lookin===o&&l.matchwhole===a)d=l.result;else{var v=c.len>0?c._:{},g=null;if("comments"===o){for(var p=document.createElement("c"),m=0,y=h.length;m<y;m++)if(p.innerHTML=h[m].note,g=r?p.innerText:p.innerText.toUpperCase(),!a&&-1!==g.indexOf(n)||a&&g===n){var b={ri:h[m].row,ci:h[m].col};b.cmt=h[m],d.push(b)}}else for(var w in v){var x=v[w].cells;for(var C in x)if("values"===o?g=r?x[C].text:x[C].text.toUpperCase():"formulas"===o&&(g=void 0!==x[C].f?r?x[C].f:x[C].f.toUpperCase():null),null!=g&&(a&&g===n||!a&&-1!==g.indexOf(n))){var k={ri:w,ci:C};d.push(k)}}l.keywords=n,l.lookin=o,l.matchwhole=a,l.iscasesense=r,l.result=d}if(0===d.length)return void alert("We couldn't find what you were looking for.");var _=-1,S=Number(e.indexes[0]),T=Number(e.indexes[1]),O=d.length-1;if(1===d.length)_=0;else if("next"===i){for(var E=0,R=d.length;E<R;E++){if(Number(d[E].ri)===S&&Number(d[E].ci)>T){_=E;break}if(Number(d[E].ri)>S){_=E;break}}-1===_&&(_=0)}else{for(var A=O;A>=0;A--){if(Number(d[A].ri)===S&&Number(d[A].ci)<T){_=A;break}if(Number(d[A].ri)<S){_=A;break}}-1===_&&(_=O)}l.current=_;var I=d[_];if(e.set(I.ri,I.ci),d[_].cmt){var P=I.cmt.note;if(""!==P){var D=s.cellRectWithOutTransfer(I.ri,I.ci);u.col=I.ci,u.row=I.ri,u.onEdit=!1,u.setPosition(P,D)}}ra.call(t)}},c.showMenuBefore=function(e){var i=r()(t.selector.indexes,2),n=i[0],o=i[1],a=!1;if(e.forEach((function(t){return t.show()})),t.canvas.isImageOnSelected()){if(e.forEach((function(t){-1===["copy","cut","paste","link"].indexOf(t.key)&&t.hide()})),t.canvas.checkHyperlink(t.canvas.fabric))return;t.canvas.validType(t.canvas.fabric,"type","Chart")&&(a=!0)}if(!t.hyperlink.check(t.data,n,o)){var s=null;if(e.forEach((function(t){a&&"link"===t.key&&(s.hide(),t.hide()),"openLink"===t.key&&t.hide(),"removeLink"===t.key&&t.hide(),s=t})),window.mobileAndTabletCheck()){var l=["edit","cut","copy","paste","merge","unmerge","clear"].map((function(t){return W("contextmenu.".concat(t))}));e.forEach((function(e){l.includes(e.el.innerText)||e.hide(),e.el.className.includes("divider")&&e.hide(),t.data.merges.equals(t.selector.range)&&e.el.innerText===W("contextmenu.merge")&&e.hide(),t.data.merges.equals(t.selector.range)||e.el.innerText!==W("contextmenu.unmerge")||e.hide()}))}}},c.itemClick=function(e){if("validation"===e)p.setValue(t.data.getSelectedValidation());else if("sort"===e)m.setValue(t.data.getSelectedSort());else if("download"===e)y.setValue(t.filename);else if("link"===e){if(t.canvas.isImageOnSelected())return void t.canvas.link(t.data);var i=t.selector.range,n=t.hyperlink.getSelectArea(i),r=t.hyperlink.findByArea(t.data,n),o="edit";if(!r){(r={}).area=n;var a=t.data.getCell(i.sri,i.sci);r.text=a?a.text:"",o="add"}b.setValue(xs.datas.map((function(t){return t.name})),r,o)}else"removeLink"===e?t.canvas.isImageOnSelected()?t.canvas.removeLink(t.data):t.hyperlink.removeByRange(t.selector.range,t):"openLink"===e?t.canvas.isImageOnSelected()?t.canvas.openLink(t.data):t.hyperlink.accessByRange(t.selector.range,t.data):"copy"===e?(va.call(t),t.canvas.doOperation("copy")):"cut"===e?(ga.call(t),t.canvas.doOperation("copy"),t.canvas.doOperation("delete")):"paste"===e?_.clipboard?t.canvas.doOperation("paste"):pa.call(t,"all"):"paste-value"===e?pa.call(t,"text"):"paste-format"===e?pa.call(t,"format"):"hide"===e?ma.call(t):"delete-image"===e?t.canvas.doOperation("delete"):"merge"===e?(t.data.setSelectedCellAttr(e,!0),t.table.render()):"unmerge"===e?(t.data.setSelectedCellAttr("merge",!1),t.table.render()):"edit"===e?Ra.call(t):La.call(t,e)},Tt(window,"resize",(function(){window.mobileAndTabletCheck()||t.reload()})),Tt(window,"click",(function(t){})),Tt(window,"paste",(function(e){t.focusing&&"commentEdit"!==e.target.parentElement.id&&(e.target.parentElement.parentElement&&"commentEdit"===e.target.parentElement.parentElement.id||(pa.call(t,"all",e),e.preventDefault()))})),Tt(window,"keydown",(function(e){if(t.focusing&&"commentEdit"!==e.target.id){var i=e.keyCode||e.which,n=e.key,r=e.ctrlKey,o=e.shiftKey,a=e.metaKey;if(r||a)switch(i){case 90:t.undo(),e.preventDefault();break;case 89:t.redo(),e.preventDefault();break;case 67:va.call(t),_.doOperation("copy"),e.preventDefault();break;case 88:ga.call(t),e.preventDefault();break;case 85:d.trigger("underline"),e.preventDefault();break;case 86:_.clipboard?_.doOperation("paste"):pa.call(t,"all"),e.preventDefault();break;case 37:aa.call(t,o,"row-first"),e.preventDefault();break;case 38:aa.call(t,o,"col-first"),e.preventDefault();break;case 39:aa.call(t,o,"row-last"),e.preventDefault();break;case 40:aa.call(t,o,"col-last"),e.preventDefault();break;case 32:oa.call(t,!1,-1,t.data.selector.ci,!1),e.preventDefault();break;case 66:d.trigger("bold");break;case 73:d.trigger("italic")}else{switch(i){case 32:o&&oa.call(t,!1,t.data.selector.ri,-1,!1);break;case 27:c.hide(),h.hide(),da.call(t);break;case 37:aa.call(t,o,"left"),e.preventDefault();break;case 38:aa.call(t,o,"up"),e.preventDefault();break;case 39:aa.call(t,o,"right"),e.preventDefault();break;case 40:aa.call(t,o,"down"),e.preventDefault();break;case 9:l.clear(),aa.call(t,!1,o?"left":"right"),e.preventDefault();break;case 13:l.clear(),aa.call(t,!1,o?"up":"down"),e.preventDefault();break;case 8:La.call(t,"delete-cell-text"),e.preventDefault()}"Delete"===n?(La.call(t,"delete-cell-text"),_.doOperation("delete"),e.preventDefault()):i>=65&&i<=90||i>=48&&i<=57||i>=96&&i<=105||"="===e.key?(ja.call(t,e.key,"input"),Ra.call(t),Ia.call(t)):113===i&&Ra.call(t)}}}))}var Va=function(){function t(e,i){var n=this;l()(this,t),this.eventMap=new Map;var r=i.settings,o=r.view,a=r.showToolbar,s=r.showFileName,c=r.showContextmenu,h=r.mode,u=r.showPartToolbar,d=r.contextMenuItems,v=r.local;this.el=f("div","".concat(ot,"-sheet")),this.menubar=new Qo(i,o.width,!a,u,s,this,v),this.toolbar=new Er(i,o.width,!a,u),this.formulaBar=new Kr(i,h),this.canvas=new xo,this.print=new ki(i,this.canvas),this.hyperlink=new Uo,e.children(this.menubar.el,this.toolbar.el,this.formulaBar.el,this.el,this.print.el),this.data=i,this.tableEl=f("canvas","".concat(ot,"-table"));var g=i.settings.row.height;this.rowResizer=new Mt(!1,g,this),this.colResizer=new Mt(!0,i.cols.minWidth,this),this.verticalScrollbar=new jt(!0),this.horizontalScrollbar=new jt(!1),this.editor=new vi(ue,(function(){return n.getTableOffset()}),g,this),this.modalValidation=new Lr,this.modalSort=new Hr,this.modalDownload=new qo,this.modalLink=new Zo,this.modalSearch=new qr,this.modalInsertURLImage=new ko,this.contextMenu=new Ei((function(){return n.getRect()}),this,!c,d),this.commentTip=new Vr,this.commentEditable=new Jr,this.selector=new $t(i),this.highlight=new Vo(this),this.overlayerCEl=f("div","".concat(ot,"-overlayer-content")).children(this.editor.el,this.selector.el),this.overlayerEl=f("div","".concat(ot,"-overlayer")).children(this.overlayerCEl,this.canvas),this.sortFilter=new Yr,this.el.children(this.tableEl,this.overlayerEl.el,this.rowResizer.el,this.colResizer.el,this.verticalScrollbar.el,this.horizontalScrollbar.el,this.contextMenu.el,this.commentTip.el,this.commentEditable.el,this.modalValidation.el,this.modalSort.el,this.modalDownload.el,this.modalLink.el,this.modalSearch.el,this.modalInsertURLImage.el,this.sortFilter.el),this.table=new oi(this.tableEl.el,i),Ya.call(this),fa.call(this),oa.call(this,!1,0,0),this.canvas.init(this),this.imageUploadByLocalUrl=null,this.imageUploadByUrlUrl=null,this.reloadUrl=null,this.fileDownloadUrl=null,this.oleDownloadUrl=null,this.uniqueid="",this.filename=""}var e;return a()(t,[{key:"setReloadUrl",value:function(t){this.reloadUrl=t}},{key:"getReloadUrl",value:function(){return this.reloadUrl+"?filename="+this.filename+"&uid="+this.uniqueid}},{key:"on",value:function(t,e){return this.eventMap.set(t,e),this}},{key:"preMousedown",value:function(){Sa.call(this)}},{key:"trigger",value:function(t){var e=this.eventMap;if(e.has(t)){for(var i,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(i=e.get(t)).call.apply(i,[this].concat(r))}}},{key:"resetData",value:function(t){this.editor.clear(),this.data=t,ca.call(this),ha.call(this);var e=this.getTableOffset();this.overlayerCEl.offset(e),t.displayRight2Left?this.overlayerCEl.el.setAttribute("dir","rtl"):this.overlayerCEl.el.removeAttribute("dir"),this.data.topOrder=0,this.toolbar.resetData(t),this.formulaBar.resetData(t),this.print.resetData(t),this.selector.resetData(t),this.table.resetData(t),this.canvas.reset(t),this.data.updateConditionImageDirection(),this.data.reloadImagesShapes(),this.hyperlink.loadLinkPosition(this);var i=this.highlight;setTimeout((function(){i.AutoShowOrHide()}),2e3)}},{key:"loadData",value:function(t){return this.data.setData(t),fa.call(this),this}},{key:"scrollV",value:function(t){var e=this.verticalScrollbar.scroll().top;this.verticalScrollbar.move({top:e-t})}},{key:"scrollToRow",value:function(t){var e=this.verticalScrollbar.scroll().top,i=this.data.viewRange().sri,n=t>i?-this.data.rows.sumHeight(i,t):this.data.rows.sumHeight(t,i);this.verticalScrollbar.move({top:e-n})}},{key:"scrollH",value:function(t){var e=this.horizontalScrollbar.scroll().left;this.horizontalScrollbar.move({left:e-t})}},{key:"selectMoveDown",value:function(){aa.call(this,!0,"down")}},{key:"freeze",value:function(t,e){var i=this.data;return this.canvas.doResetPosition(t,e),i.setFreeze(t,e),fa.call(this),this}},{key:"setActiveCell",value:function(t,e){return oa.call(this,!1,t,e),this.focusing=!0,this}},{key:"setEditForTextBox",value:function(t){return Aa.call(this,t),this}},{key:"undo",value:function(){this.data.undo(),fa.call(this)}},{key:"redo",value:function(){this.data.redo(),fa.call(this)}},{key:"reload",value:function(){return fa.call(this),this}},{key:"setzoom",value:function(t){var e=this.data,i=this.table,n=this.canvas,r=this.selector;i.zoomlevel=t,e.zoomlevel=t;this.getTableOffset();1!==this.data.zoomlevel&&(r.br.useHideInput=!1),this.data.zoomlevel<1&&!window.mobileAndTabletCheck()&&(this.overlayerCEl.el.style.width="".concat(this.overlayerCEl.el.clientWidth/t,"px"),this.overlayerCEl.el.style.height="".concat(this.overlayerCEl.el.clientHeight/t,"px")),n.setZoom(t),fa.call(this),1!==this.data.zoomlevel&&(r.br.useHideInput=!0),e.updateConditionImageZoom()}},{key:"showHighlights",value:function(t){this.highlight.showHighlights(t)}},{key:"hideHighlights",value:function(){this.highlight.hideHighlights()}},{key:"getHighlightTexts",value:function(){return this.highlight.getHighlightTexts()}},{key:"addHighlightText",value:function(t,e,i,n){this.highlight.addHighlightText(t,e,i,n)}},{key:"removeHighlightText",value:function(t,e,i,n){this.highlight.removeHighlightText(t,e,i,n)}},{key:"getHighlightRanges",value:function(){return this.highlight.getHighlightRanges()}},{key:"addHighlightRange",value:function(t,e,i,n){this.highlight.addHighlightRange(t,e,i,n)}},{key:"removeHighlightRange",value:function(t,e,i,n){this.highlight.removeHighlightRange(t,e,i,n)}},{key:"setHighlightInverseRange",value:function(t,e,i,n){this.highlight.setHighlightInverseRange(t,e,i,n)}},{key:"getHighlightInverseRange",value:function(){return this.highlight.getHighlightInverseRange()}},{key:"removeHighlightInverseRange",value:function(){this.highlight.removeHighlightInverseRange()}},{key:"getHighlightShaps",value:function(){return this.highlight.getHighlightShaps()}},{key:"addHighlightShape",value:function(t){this.highlight.addHighlightShape(t)}},{key:"removeHighlightShape",value:function(t){this.highlight.removeHighlightShape(t)}},{key:"addHighlightTextBox",value:function(t,e,i){var n=this.data,r=(this.table,this.highlight,n.shapes.find((function(e){return e.id===t})));r?"TextBox"===r.type?(this.addHighlightShape(t),r.addHighlight(e,i)):console.error("shape is not textbox"):console.error("shape does not exist")}},{key:"removeHighlightTextBox",value:function(t,e,i){var n=this.data,r=(this.table,n.shapes.find((function(e){return e.id===t})));r?"TextBox"===r.type?-1!==n.highlighshapes.indexOf(t)&&r.removeHighlight(e,i):console.error("shape is not textbox"):console.error("shape does not exist")}},{key:"getHighlightImages",value:function(){return this.highlight.getHighlightImages()}},{key:"addHighlightImage",value:function(t){this.highlight.addHighlightImage(t)}},{key:"removeHighlightImage",value:function(t){this.highlight.removeHighlightImage(t)}},{key:"setHighlightAll",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.highlight;i.setHighlightAll(t,e)}},{key:"setCustomHighlightImgFunc",value:function(t){this.highlight.setCustomHighlightImgFunc(t)}},{key:"getImageContextMenuItems",value:function(){return this.contextMenu.getImageContextMenuItems()}},{key:"addImageContextMenuItems",value:function(t){this.contextMenu.addImageContextMenuItems(t)}},{key:"delImageContextMenuItems",value:function(t){this.contextMenu.delImageContextMenuItems(t)}},{key:"getCustomContextMenuItems",value:function(){return this.contextMenu.getCutomContextMenuItems()}},{key:"addCustomContextMenuItems",value:function(t){this.contextMenu.addCutomContextMenuItems(t)}},{key:"insertCustomContextMenuItem",value:function(t,e){this.contextMenu.insertCutomContextMenuItem(t,e)}},{key:"updateCustomContextMenuItem",value:function(t,e){this.contextMenu.updateCutomContextMenuItem(t,e)}},{key:"delCustomContextMenuItems",value:function(t){this.contextMenu.delCutomContextMenuItems(t)}},{key:"getOle",value:(e=bt()(kt.a.mark((function t(e){var i;return kt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=this.oleDownloadUrl+"?id="+e+"&uid="+this.uniqueid+"&sheet="+this.data.name,Ua.call(this,i);case 2:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"getRect",value:function(){var t=this.data;return{width:t.viewWidth(),height:t.viewHeight()}}},{key:"getTableOffset",value:function(){var t=this.data,e=t.rows,i=t.cols,n=t.displayRight2Left,r=this.table.zoomlevel,o=this.data.settings.row.height,a=this.getRect(),s=a.width,l=a.height;return{width:(s-i.indexWidth)*r,height:(l-e.height)*r,left:n?0:i.indexWidth*r,top:o*r}}}]),t}();function Ga(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var qa=function(t){tt()(i,t);var e=Ga(i);function i(t){var n;l()(this,i);var r=new st("ellipsis");return(n=e.call(this,r,"auto",!1,"top-left")).contentClick=t,n}return a()(i,[{key:"reset",value:function(t){var e=this,i=t.map((function(t,i){return f("div","".concat(ot,"-item")).css("width","150px").css("font-weight","normal").on("click",(function(){e.contentClick(i),e.hide()})).child(t)}));this.setContentChildren.apply(this,v()(i))}},{key:"setTitle",value:function(){}}]),i}(Mi),Ka=function(t){tt()(i,t);var e=Ga(i);function i(t){var n;l()(this,i);var r=new st("pagination");return(n=e.call(this,r,"100px",!1,"top-left")).contentEl.css("max-height","298px"),n.contentEl.css("overflow-y","auto"),n.contentClick=t,n}return a()(i,[{key:"reset",value:function(t){var e=this,i=t.map((function(t,i){return f("div","".concat(ot,"-item")).css("width","auto").css("font-weight","normal").on("click",(function(){e.contentClick(i),e.hide()})).child(t)}));this.setContentChildren.apply(this,v()(i))}}]),i}(Mi),Za=[{key:"delete",title:U("contextmenu.deleteSheet")}];function Ja(t){var e=this;return f("div","".concat(ot,"-item")).child(t.title()).on("click",(function(){e.itemClick(t.key),e.hide()}))}function $a(){var t=this;return Za.map((function(e){return Ja.call(t,e)}))}var Qa=function(){function t(){var e;l()(this,t),this.el=(e=f("div","".concat(ot,"-contextmenu")).css("width","160px")).children.apply(e,v()($a.call(this))).hide(),this.itemClick=function(){}}return a()(t,[{key:"hide",value:function(){var t=this.el;t.hide(),Et(t)}},{key:"setOffset",value:function(t){var e=this.el;e.offset(t),e.show(),Rt(e)}}]),t}(),ts=function(){function t(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},s=arguments.length>5?arguments[5]:void 0;l()(this,t),this.settings=s,this.addFunc=i,this.swapFunc=n,this.updateFunc=o,this.scrollFunc=a,this.dataNames=[],this.activeEl=null,this.deleteEl=null,this.items=[],this.moreEl=new qa((function(t){e.clickSwap2(e.items[t])})),this.paginationEl=new Ka((function(t){e.scrollFunc(t)})),this.contextMenu=new Qa,this.contextMenu.itemClick=r,this.el=f("div","".concat(ot,"-bottombar")).children(this.contextMenu.el,this.menuEl=this.setMenuEl())}return a()(t,[{key:"setMenuEl",value:function(){var t=this;return"edit"===this.settings.mode?f("ul","".concat(ot,"-menu")).child(f("li","").children(new st("add").on("click",(function(){t.dataNames.length<10?t.addFunc():lt("Warning","It is less than or equal to 10")})),f("span","").child(this.moreEl))):f("ul","".concat(ot,"-menu")).child(f("li","").children(f("span","").child(this.moreEl)))}},{key:"addItem",value:function(t,e,i,n){this.dataNames.push(t);var r=f("li",e?"active":"").child(t);void 0!==i&&(r.el.style.color=n,r.el.style.backgroundColor=i),this.setItemEvent(r),e&&this.clickSwap(r),this.items.push(r),this.menuEl.child(r),this.moreEl.reset(this.dataNames)}},{key:"addPagination",value:function(t){for(var e=[],i=1;i<=t;i++){var n=i+"";e.push(n)}this.paginationEl.reset(e)}},{key:"setItemEvent",value:function(t){var e=this;"edit"===this.settings.mode?t.on("click",(function(){e.clickSwap2(t)})).on("contextmenu",(function(i){var n=i.target,r=n.offsetLeft,o=n.offsetHeight;e.contextMenu.setOffset({left:r,bottom:o+1}),e.deleteEl=t})).on("dblclick",(function(){if(!(t.el.children.length>0)){var i=t.html(),n=new Ar("auto","",31);n.val(i),n.input.on("blur",(function(t){var r=t.target.value,o=e.dataNames.findIndex((function(t){return t===i}));e.renameItem(o,r,n)})),t.html("").child(n.el),n.focus()}})):t.on("click",(function(){e.clickSwap2(t)}))}},{key:"renameItem",value:function(t,e,i){if(this.dataNames[t]!==e&&0!==e.length)if(e.length>31)lt("Error","The max length of the sheet name is 31",(function(){i.focus()}));else if(this.dataNames.indexOf(e)>=0)lt("Error","Same worksheet name already exist",(function(){i.focus()}));else{for(var n=0;n<e.length;n++)switch(e[n]){case":":case"\\":case"/":case"?":case"*":case"[":case"]":return void lt("Error","Worksheet name could not contain any following characters : : \\ / ? * [ or ]",(function(){i.focus()}))}this.dataNames.splice(t,1,e),this.moreEl.reset(this.dataNames),this.items[t].html("").child(e),this.updateFunc(t,e)}else this.items[t].html("").child(e)}},{key:"clear",value:function(){var t=this;this.items.forEach((function(e){t.menuEl.removeChild(e.el)})),this.items=[],this.dataNames=[],this.moreEl.reset(this.dataNames)}},{key:"hide",value:function(){var t=this.el;t.hide(),Et(t)}},{key:"deleteItem",value:function(){var t=this.activeEl,e=this.deleteEl;if(this.items.length>1){var i=this.items.findIndex((function(t){return t===e}));if(this.items.splice(i,1),this.dataNames.splice(i,1),this.menuEl.removeChild(e.el),this.moreEl.reset(this.dataNames),t===e){var n=r()(this.items,1)[0];return this.activeEl=n,this.activeEl.toggle(),[i,0]}return[i,-1]}return[-1]}},{key:"clickSwap2",value:function(t){var e=this.items.findIndex((function(e){return e===t}));this.clickSwap(t),this.activeEl.toggle(),this.swapFunc(e)}},{key:"clickSwap",value:function(t){null!==this.activeEl&&this.activeEl.toggle(),this.activeEl=t}},{key:"setDirection",value:function(t){t?this.el.attr("dir","rtl"):this.el.removeAttr("dir")}}]),t}();i(35),i(36);function es(t){var e=[],i=0;this.run=function(t){var n=this;this.startHandler(t,(function(){i--,t.timestm,t.isfinish,e.length>0&&n.run(e.shift())}))},this.startHandler=function(n,r){var o=this;n.isfinish?e.length>0&&this.run(e.shift()):0!==i?setTimeout((function(){return o.startHandler(n,r)}),300):(i++,n.timestm,n.isfinish,t(n,r))},this.append=function(t){e.push(t),e.length,t.timestm,1===e.length&&this.run(t)},this.isFinish=function(){return 0===e.length&&0===i}}var is=function t(e,i,n,r){l()(this,t),this.item=e,this.url=i,this.callback=n,this.callbackerror=r,this.isfinish=!1,this.timestm="["+(new Date).getTime()+"] "};function ns(t,e){var i=$.ajax({url:t.url,type:"post",dataType:"json",data:t.item});t.timestm,t.isfinish,i.done((function(i){t.timestm,t.callback&&(t.callback(i),t.isfinish=!0),e()})),i.fail((function(i,n,r){t.timestm,t.callbackerror&&(t.callbackerror(i,n,r),t.isfinish=!0),e()}))}function rs(t){t.scaleX=1,t.scaleY=1,t.originAngle=t.angle;var e=t.originAngle;e<0&&(e+=360),e>90&&e<180?e=180-e:e>=180&&e<270?e-=180:e>=270&&(e=360-e),e>=45&&(e=90-e);Math.sin(.017453293*e),Math.cos(.017453293*e);t.originWidth=t.width,t.originHeight=t.height,t.originLeft=t.left,t.originTop=t.top}function os(t,e,i,n,r){var o,a,s;return{tick:t.tick,width:t.width,height:t.height,top:t.top+n.top/r,left:i+n.left/r,"z-index":e+t.zorder,originAngle:t.originAngle,rotate:t.angle,imgType:t.type,strid:t.strid,text:t.text,html:t.html,hyperlink:t.hyperlink,zorder:t.zorder,fromOutside:null!==(o=t.fromOutside)&&void 0!==o&&o,scaleX:null!==(a=t.scaleX)&&void 0!==a?a:1,scaleY:null!==(s=t.scaleY)&&void 0!==s?s:1}}var as=function(){function t(e){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};l()(this,t);var r=e;this.options=n,n.local&&Y(n.local),this.sheetIndex=0,this.datas=[],this.uniqueid="",this.filename="",this.imageDiv=null,this.imageUrl=null,this.basicZorder=0,this.istestforimage=!1,this.buffer=new es(ns),"string"==typeof e&&(r=document.querySelector(e)),window.mobileAndTabletCheck=function(){var t,e=!1;return t=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0),e},window.mobileEditOnCell=!1,Ft((function(t){var e=i.sheet;e.data,e.selector,e.canvas,e.editor,e.verticalScrollbar;window.keyboardShow=!1,i.sheet.preMousedown(),i.reRender(),window.mobileEditOnCell=!1}),(function(t){window.keyboardShow=!0;var e=i.sheet,n=e.data;e.selector,e.editor,e.verticalScrollbar;window.mobileEditOnCell&&i.sheet.scrollToRow(n.selector.ri)})),this.bottombar=new ts((function(){if(i.uniqueid.endsWith(".csv"))lt("Warning","CSV file does not support more than one worksheet");else if(i.uniqueid.endsWith(".tsv"))lt("Warning","TSV file does not support more than one worksheet");else{i.sheet.canvas.doNewSheetPage(i.sheet.data);var t=i.addSheet();t.showGrid=!0,i.sheet.resetData(t)}}),(function(t){var e=i.datas[t];e.scroll={ci:0,ri:0,riact:0,x:0,y:0,yact:0},i.sheet.canvas.doSwitchSheetPage(i.sheet.data),i.sheet.resetData(e),i.bottombar.setDirection(e.displayRight2Left),i.resetPagination(e),i.sheet.verticalScrollbar.move({top:0}),i.setZoomLevel(e.zoomlevel)}),(function(){i.deleteSheet()}),(function(t,e){i.renameSheet(t,e)}),(function(t){var e=t*i.data.settings.row.len,n=i.data.rows.sumHeight(0,e);i.sheet.verticalScrollbar.move({top:n-1})}),this.options),this.isloading=!0,this.data=this.addSheet(),this.isloading=!1,this.resetPagination(this.data);var o=f("div","".concat(ot)).on("contextmenu",(function(t){return t.preventDefault()}));r.appendChild(o.el),this.sheet=new Va(o,this.data),this.sheet.hyperlink.setActiveSheetBySheetName=function(t){i.setActiveSheetByName(t)},this.sheet.hyperlink.setActiveCell=function(t,e){i.setActiveCell(t,e)},this.sheet.addSheet=this.bottombar.addFunc,o.child(this.bottombar.el)}return a()(t,[{key:"setUniqueId",value:function(t){this.uniqueid=t,this.sheet.uniqueid=t}},{key:"setFileDownloadInfo",value:function(t){this.sheet.fileDownloadUrl=t}},{key:"setOleDownloadInfo",value:function(t){this.sheet.oleDownloadUrl=t}},{key:"setFileName",value:function(t){this.filename=t,this.sheet.filename=t,this.sheet.menubar.setFileName(t)}},{key:"setZoomLevel",value:function(t){this.sheet.setzoom(t)}},{key:"setReloadUrl",value:function(t){this.sheet.setReloadUrl(t)}},{key:"setVisibleFilter",value:function(t){this.sheet.visibleFilter=t}},{key:"setFileDownloadCallFunction",value:function(t){this.sheet.fileDownloadCallFunc=t}},{key:"setImageInfo",value:function(t,e,i,n,r,o,a){return this.imageDiv=t,this.imageUrl=e,this.sheet.imageUploadByLocalUrl=i,this.sheet.imageUploadByUrlUrl=n,this.sheet.imageCopyUrl=r,this.basicZorder=o,this.updating=a,this}},{key:"setImageForTest",value:function(t,e,i){return this.imageDiv=t,this.imageUrl=e,this.basicZorder=i,this.istestforimage=!0,this}},{key:"setDisplayRight2Left",value:function(t){var e=this.sheet,i=this.bottombar,n=e.data;if(n.displayRight2Left!==t){n.displayRight2Left=t;var r=e.getTableOffset();e.overlayerCEl.offset(r),e.resetData(n),i.setDirection(t)}}},{key:"getUpdateDatas",value:function(){for(var t=[],e=0,i=this.datas.length;e<i;e++){var n=this.datas[e].getDataForSave();null!=n&&t.push(n)}return t}},{key:"addSheet",value:function(t){var e=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=t||"sheet".concat(this.sheetIndex),a=new mt(o,this.options);return a.rows.setCellText(0,0,""),a.change=function(){for(var t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];(t=e.sheet).trigger.apply(t,["change"].concat(n))},a.updateCellsData=function(t){var i=e.sheet.data,n=i.updateCellError,r=i.updateMyCells,o=e.uniqueid,a=e.imageUrl;if(t.Error)t.cell&&(r.call(e.sheet.data,[t.cell]),e.reRender()),t.cells&&(r.call(e.sheet.data,t.cells),e.reRender()),t.p&&(e.sheet.data.updateRevertOpr(t.p),e.reRender()),n(t.Error);else if("update"===t.op)t.data.forEach((function(t,i,n){for(var r=0,s=new Array;r<e.datas.length;r++)if(e.datas[r].name===t.name){e.datas[r].updateMyCells(t.cells),e.datas[r].updateShapes(t.shapes,s),e.datas[r].updateMyConditionImages(t.conditionimg);break}e.sheet.data.updateShapeSrcToRefresh(o,a,t.pickey,s)})),e.reRender();else if("sort"===t.op)t.rowids&&t.rowids.length>0&&(e.sheet.data.sortByRowIdArray(t.r,t.rowids),e.reRender());else if("updateTextBox"===t.op){for(var s=0;s<e.sheet.data.shapes.length;s++)if(e.sheet.data.shapes[s].strid===t.id){e.sheet.data.shapes[s].updateTextBox(t.html,t.rtxt);break}e.reRender()}},a.updateServerError=function(){for(var t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];(t=e.sheet).trigger.apply(t,["updateServerError"].concat(n))},a.updateCellError=function(){for(var t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];(t=e.sheet).trigger.apply(t,["updateCellError"].concat(n))},a.updateCellServer=function(t){var i=e.sheet.data,n=i.settings,r=i.updateServerError,o=i.updateCellsData,a=e.uniqueid,s=e.buffer;if("server"===n.updateMode){var l={p:JSON.stringify(t),uid:a,folderName:n.folderName,fileName:n.fileName};s.append(new is(l,n.updateUrl,(function(t){o(t)}),(function(t,e,i){r(t,e,i)})))}},a.menubarStatus=function(){return!e.sheet||"up"===e.sheet.toolbar.menuDisplay.state},a.loadImages=function(){var t=e.sheet.data,i=t.images,n=t.displayRight2Left,r=t.cols,o=n?e.sheet.data.viewWidth()-r.indexWidth:0,a=(e.uniqueid,e.imageDiv,e.imageUrl,e.basicZorder),s=e.sheet,l=e.updating;s.canvas.basicZorder=null!=a?a:s.canvas.basicZorder;var c=s.getTableOffset();null!=i&&i.forEach((function(t){if("del"!==t.op){var e=n?o-t.left-t.width:t.left;s.data.topOrder=s.data.topOrder<t.zorder?t.zorder:s.data.topOrder;var i=os(t,a,e,c,s.table.zoomlevel);t.src?s.canvas.setImage(s,t,i,t.src):s.canvas.setImage(s,t,i,l)}}))},a.loadShapes=function(){var t=e.sheet.data,i=t.shapes,n=t.displayRight2Left,r=t.cols,o=n?e.sheet.data.viewWidth()-r.indexWidth:0,a=(e.uniqueid,e.imageDiv,e.imageUrl,e.basicZorder),s=e.sheet,l=e.updating;s.canvas.basicZorder=null!=a?a:s.canvas.basicZorder;var c=s.getTableOffset();null!=i&&i.forEach((function(t){if("del"!==t.op){var e=n?o-t.left-t.width:t.left;s.data.topOrder=s.data.topOrder<t.zorder?t.zorder:s.data.topOrder;var i=os(t,a,e,c,s.table.zoomlevel);"TextBox"===t.type?s.canvas.setTextBox(s,t,i):t.src?s.canvas.setImage(s,t,i,t.src):s.canvas.setImage(s,t,i,l)}}))},a.fillImageSrc=function(){var t=e.sheet.data,i=t.images,n=t.shapes,r=t.sheetid,o=t.isImageOk,a=e.uniqueid,s=(e.imageDiv,e.imageUrl);e.basicZorder;if(!o&&void 0!==r&&(null!=n&&n.length>0||null!=i&&i.length>0)){var l=e,c=e.istestforimage?s+"/"+a+"."+r+"_batch.zip":s+"?uid="+a+"&id="+r+"_batch.zip";e.istestforimage?l.sheet.data.generatePicItems(i,n,c):$.get(c,(function(t){l.sheet.data.generatePicItems(i,n,t)}))}},a.fillImageOnebyOne=function(t,i){var n=new XMLHttpRequest,r=e.sheet,o=setInterval((function(){r.data.loadCount<=0&&(r.data.isImageOk=!0,clearInterval(o))}),200);n.onreadystatechange=function(){if(4==n.readyState){var t=n.response,e=new Uint8Array(t);JSZip.loadAsync(e).then((function(t){i.forEach((function(e,i,n){t.file(e.name).async("blob").then((function(t){var i=URL.createObjectURL(t),n=r.canvas.fabric.getObjects().find((function(t){return t.id===e.id}));n&&"TextBox"!==n.imgType&&(n.setSrc(i,(function(t){var e;r.canvas.fabric.requestRenderAll(),r.canvas.saveCanvasData(r.data),null===(e=r.canvas.inFreeze)||void 0===e||e.loadFreezeImage()})),e.it.src=i),r.data.loadCount--}))}))}))}},n.open("GET",t,!0),n.responseType="arraybuffer",n.send()},a.loadConditionImage=function(){var t=e.sheet.data.conditionimg,i=e.imageDiv,n=e.basicZorder;t&&t.forEach((function(t){if(t.data){var e=a.createConditionImage(t,n);t.data=void 0,t.image=e,i.append(e)}else i.append(t.image)}))},a.insertConditionImage=function(t){var i=e.sheet.data.conditionimg,n=e.imageDiv,r=e.basicZorder;if(i)if(t.data){var o=a.createConditionImage(t,r);t.data=void 0,t.image=o,n.append(o),i.push(t)}else n.append(t.image)},a.reloadImagesShapes=function(){var t=e.imageDiv;null!=t&&(t.empty(),t.css("left",0),t.css("top",0),a.loadImages(),a.loadShapes(),a.loadConditionImage(),a.fillImageSrc())},a.scrollImagesShapes=function(){var t=e.imageDiv,i=e.sheet.canvas,n=e.sheet.data,r=n.scroll,o=n.displayRight2Left,a=n.zoomlevel;i.publishEvent("object:scroll",e.sheet.data),i.initFreeze(),null!=t&&(t.css("left",o?r.x*a:-r.x*a),t.css("top",-r.y*a))},this.datas.push(a),this.bottombar.addItem(o,i,n,r),this.sheetIndex+=1,this.isloading||this.sheet.data.addSheetOpr(o),a}},{key:"resetPagination",value:function(t){var e=t.rows.len,i=t.settings.row.len,n=e%i==0?e/i:Math.ceil(e/i);this.bottombar.addPagination(n)}},{key:"deleteSheet",value:function(){var t=this.bottombar.deleteItem(),e=r()(t,2),i=e[0],n=e[1];if(i>=0){var o=this.datas[i].name;this.sheet.data.delSheetOpr(o),this.datas.splice(i,1),n>=0&&this.sheet.resetData(this.datas[n])}}},{key:"renameSheet",value:function(t,e){var i=this.datas[t].name;this.datas[t].name=e,this.sheet.data.renameSheetOpr(i,e)}},{key:"loadData",value:function(t){this.isloading=!0;var e=Array.isArray(t)?t:[t];if(this.bottombar.clear(),this.datas=[],e.length>0)for(var i=0;i<e.length;i+=1){var n,o,a=e[i],s=this.addSheet(a.name,0===i,a.tabcolor,a.fontcolor);if(void 0!==a.merges)for(var l=0,c=a.merges.length;l<c;l++){var h=a.merges[l].split(":"),u=y(h[0]),f=r()(u,2),d=f[0],v=f[1],g=y(h[1]),p=r()(g,2),m=p[0],b=p[1];a.rows[v]&&a.rows[v].cells[d]&&(a.rows[v].cells[d].merge=[b-v,m-d])}null===(n=a.images)||void 0===n||n.forEach((function(t){rs(t)})),null===(o=a.shapes)||void 0===o||o.forEach((function(t){rs(t)})),s.setData(a)}return this.isloading=!1,this}},{key:"getData",value:function(){return this.datas.map((function(t){return t.getData()}))}},{key:"cellText",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.datas[n].setCellText(t,e,i,"finished"),this}},{key:"setActiveCell",value:function(t,e){return this.sheet.setActiveCell(t,e),this}},{key:"setActiveSheet",value:function(t){return this.bottombar.clickSwap2(this.bottombar.items[t]),this}},{key:"getActiveSheet",value:function(){return this.bottombar.dataNames.indexOf(this.sheet.data.name)}},{key:"getActiveSheetName",value:function(){return this.sheet.data.name}},{key:"setActiveSheetByName",value:function(t){for(var e=0;e<this.bottombar.dataNames.length;e++)if(this.bottombar.dataNames[e]===t){this.bottombar.clickSwap2(this.bottombar.items[e]);break}return this}},{key:"cell",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.datas[i].getCell(t,e)}},{key:"cellStyle",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.datas[i].getCellStyle(t,e)}},{key:"reRender",value:function(){return this.sheet.table.render(),this.sheet.canvas.fabric.requestRenderAll(),this}},{key:"showHighlights",value:function(t){this.sheet.showHighlights(t)}},{key:"hideHighlights",value:function(){this.sheet.hideHighlights()}},{key:"on",value:function(t,e){return this.sheet.on(t,e),this}},{key:"validate",value:function(){return this.data.validations.errors.size<=0}},{key:"change",value:function(t){return this.sheet.on("change",t),this}},{key:"updateServerError",value:function(t){return this.sheet.on("updateServerError",t),this}},{key:"updateCellError",value:function(t){return this.sheet.on("updateCellError",t),this}}],[{key:"locale",value:function(t,e){X(t,e)}}]),t}(),ss=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new as(t,e)};window&&(window.x_spreadsheet=ss,window.x_spreadsheet.locale=function(t,e){return X(t,e)});e.default=as}]);
12
+ t.read=function(e,t,i,n,r){var a,o,s=8*r-n-1,l=(1<<s)-1,c=l>>1,h=-7,u=i?r-1:0,f=i?-1:1,d=e[t+u];for(u+=f,a=d&(1<<-h)-1,d>>=-h,h+=s;h>0;a=256*a+e[t+u],u+=f,h-=8);for(o=a&(1<<-h)-1,a>>=-h,h+=n;h>0;o=256*o+e[t+u],u+=f,h-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,i,n,r,a){var o,s,l,c=8*a-r-1,h=(1<<c)-1,u=h>>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,m=n?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,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+u>=1?f/l:f*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=h?(s=0,o=h):o+u>=1?(s=(t*l-1)*Math.pow(2,r),o+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,r),o=0));r>=8;e[i+d]=255&s,d+=m,s/=256,r-=8);for(o=o<<r|s,c+=r;c>0;e[i+d]=255&o,d+=m,o/=256,c-=8);e[i+d-m]|=128*g}},function(e,t){var i={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},function(e,t){},function(e,t){},function(e,t){},function(e,t,i){},function(e,t,i){"use strict";(function(e){var t=i(13),n=i.n(t);!function(){function t(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function i(e,i){var n=function(e,i){var n=t(e)*t(i);if(0===n)return 0;var r=function(e,t){return e.x*t.x+e.y*t.y}(e,i)/n;return r>1&&(r=1),Math.acos(r)}(e,i);return function(e,t){return e.x*t.y-t.x*e.y}(e,i)>0&&(n*=-1),180*n/Math.PI}var r=function(e){this.handlers=[],this.el=e};function a(e,t){var i=new r(e);return i.add(t),i}r.prototype.add=function(e){this.handlers.push(e)},r.prototype.del=function(e){e||(this.handlers=[]);for(var t=this.handlers.length;t>=0;t--)this.handlers[t]===e&&this.handlers.splice(t,1)},r.prototype.dispatch=function(){for(var e=0,t=this.handlers.length;e<t;e++){var i=this.handlers[e];"function"==typeof i&&i.apply(this.el,arguments)}};var o=function(e,t){this.element="string"==typeof e?document.querySelector(e):e,this.start=this.start.bind(this),this.move=this.move.bind(this),this.end=this.end.bind(this),this.cancel=this.cancel.bind(this),this.element.addEventListener("touchstart",this.start,!1),this.element.addEventListener("touchmove",this.move,!1),this.element.addEventListener("touchend",this.end,!1),this.element.addEventListener("touchcancel",this.cancel,!1),this.preV={x:null,y:null},this.pinchStartLen=null,this.zoom=1,this.isDoubleTap=!1;var i=function(){};this.rotate=a(this.element,t.rotate||i),this.touchStart=a(this.element,t.touchStart||i),this.multipointStart=a(this.element,t.multipointStart||i),this.multipointEnd=a(this.element,t.multipointEnd||i),this.pinch=a(this.element,t.pinch||i),this.swipe=a(this.element,t.swipe||i),this.tap=a(this.element,t.tap||i),this.doubleTap=a(this.element,t.doubleTap||i),this.longTap=a(this.element,t.longTap||i),this.singleTap=a(this.element,t.singleTap||i),this.pressMove=a(this.element,t.pressMove||i),this.twoFingerPressMove=a(this.element,t.twoFingerPressMove||i),this.touchMove=a(this.element,t.touchMove||i),this.touchEnd=a(this.element,t.touchEnd||i),this.touchCancel=a(this.element,t.touchCancel||i),this._cancelAllHandler=this.cancelAll.bind(this),window.addEventListener("scroll",this._cancelAllHandler),this.delta=null,this.last=null,this.now=null,this.tapTimeout=null,this.singleTapTimeout=null,this.longTapTimeout=null,this.swipeTimeout=null,this.x1=this.x2=this.y1=this.y2=null,this.preTapPosition={x:null,y:null}};o.prototype={start:function(e){if(e.touches){this.now=Date.now(),this.x1=e.touches[0].pageX,this.y1=e.touches[0].pageY,this.delta=this.now-(this.last||this.now),this.touchStart.dispatch(e,this.element),null!==this.preTapPosition.x&&(this.isDoubleTap=this.delta>0&&this.delta<=250&&Math.abs(this.preTapPosition.x-this.x1)<30&&Math.abs(this.preTapPosition.y-this.y1)<30,this.isDoubleTap&&clearTimeout(this.singleTapTimeout)),this.preTapPosition.x=this.x1,this.preTapPosition.y=this.y1,this.last=this.now;var i=this.preV;if(e.touches.length>1){this._cancelLongTap(),this._cancelSingleTap();var n={x:e.touches[1].pageX-this.x1,y:e.touches[1].pageY-this.y1};i.x=n.x,i.y=n.y,this.pinchStartLen=t(i),this.multipointStart.dispatch(e,this.element)}this._preventTap=!1,this.longTapTimeout=setTimeout(function(){this._inZoom||(this.longTap.dispatch(e,this.element),this._preventTap=!0)}.bind(this),750)}},move:function(e){if(e.touches){var n=this.preV,r=e.touches.length,a=e.touches[0].pageX,o=e.touches[0].pageY;if(this.isDoubleTap=!1,r>1){var s=e.touches[1].pageX,l=e.touches[1].pageY,c={x:e.touches[1].pageX-a,y:e.touches[1].pageY-o};null!==n.x&&(this.pinchStartLen>0&&(e.zoom=t(c)/this.pinchStartLen,this.pinch.dispatch(e,this.element),this._preventTap=!0,this._inZoom=!0),e.angle=i(c,n),this.rotate.dispatch(e,this.element)),n.x=c.x,n.y=c.y,null!==this.x2&&null!==this.sx2?(e.deltaX=(a-this.x2+s-this.sx2)/2,e.deltaY=(o-this.y2+l-this.sy2)/2):(e.deltaX=0,e.deltaY=0),this.twoFingerPressMove.dispatch(e,this.element),this.sx2=s,this.sy2=l}else{if(null!==this.x2){e.deltaX=a-this.x2,e.deltaY=o-this.y2;var h=Math.abs(this.x1-this.x2),u=Math.abs(this.y1-this.y2);(h>10||u>10)&&(this._preventTap=!0)}else e.deltaX=0,e.deltaY=0;this.pressMove.dispatch(e,this.element)}this.touchMove.dispatch(e,this.element),this._cancelLongTap(),this.x2=a,this.y2=o,r>1&&e.preventDefault()}},end:function(e){if(e.changedTouches){this._cancelLongTap();var t=this;e.touches.length<2&&(this.multipointEnd.dispatch(e,this.element),this.sx2=this.sy2=null),this.x2&&Math.abs(this.x1-this.x2)>30||this.y2&&Math.abs(this.y1-this.y2)>30?(e.direction=this._swipeDirection(this.x1,this.x2,this.y1,this.y2),this.swipeTimeout=setTimeout((function(){t.swipe.dispatch(e,t.element)}),0)):(this.tapTimeout=setTimeout((function(){t._preventTap||t.tap.dispatch(e,t.element),t.isDoubleTap&&(t.doubleTap.dispatch(e,t.element),t.isDoubleTap=!1)}),0),t.isDoubleTap||t._preventTap||(t.singleTapTimeout=setTimeout((function(){t.singleTap.dispatch(e,t.element)}),250))),this.touchEnd.dispatch(e,this.element),this.preV.x=0,this.preV.y=0,this.zoom=1,this.pinchStartLen=null,this.x1=this.x2=this.y1=this.y2=null}},cancelAll:function(){this._preventTap=!0,clearTimeout(this.singleTapTimeout),clearTimeout(this.tapTimeout),clearTimeout(this.longTapTimeout),clearTimeout(this.swipeTimeout)},cancel:function(e){this.cancelAll(),this.touchCancel.dispatch(e,this.element)},_cancelLongTap:function(){clearTimeout(this.longTapTimeout)},_cancelSingleTap:function(){clearTimeout(this.singleTapTimeout)},_swipeDirection:function(e,t,i,n){return Math.abs(e-t)>=Math.abs(i-n)?e-t>0?"Left":"Right":i-n>0?"Up":"Down"},on:function(e,t){this[e]&&this[e].add(t)},off:function(e,t){this[e]&&this[e].del(t)},destroy:function(){return this.singleTapTimeout&&clearTimeout(this.singleTapTimeout),this.tapTimeout&&clearTimeout(this.tapTimeout),this.longTapTimeout&&clearTimeout(this.longTapTimeout),this.swipeTimeout&&clearTimeout(this.swipeTimeout),this.element.removeEventListener("touchstart",this.start),this.element.removeEventListener("touchmove",this.move),this.element.removeEventListener("touchend",this.end),this.element.removeEventListener("touchcancel",this.cancel),this.rotate.del(),this.touchStart.del(),this.multipointStart.del(),this.multipointEnd.del(),this.pinch.del(),this.swipe.del(),this.tap.del(),this.doubleTap.del(),this.longTap.del(),this.singleTap.del(),this.pressMove.del(),this.twoFingerPressMove.del(),this.touchMove.del(),this.touchEnd.del(),this.touchCancel.del(),this.preV=this.pinchStartLen=this.zoom=this.isDoubleTap=this.delta=this.last=this.now=this.tapTimeout=this.singleTapTimeout=this.longTapTimeout=this.swipeTimeout=this.x1=this.x2=this.y1=this.y2=this.preTapPosition=this.rotate=this.touchStart=this.multipointStart=this.multipointEnd=this.pinch=this.swipe=this.tap=this.doubleTap=this.longTap=this.singleTap=this.pressMove=this.touchMove=this.touchEnd=this.touchCancel=this.twoFingerPressMove=null,window.removeEventListener("scroll",this._cancelAllHandler),null}},"object"===("undefined"==typeof exports?"undefined":n()(exports))?e.exports=o:window.AlloyFinger=o}()}).call(this,i(37)(e))},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,i){"use strict";i.r(t),i.d(t,"spreadsheet",(function(){return ss}));var n=i(5),r=i.n(n),a=i(2),o=i.n(a),s=i(0),l=i.n(s),c=i(14),h=i.n(c),u=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";l()(this,e),"string"==typeof t?(this.el=document.createElement(t),this.el.className=i):this.el=t,this.data={}}return o()(e,[{key:"data",value:function(e,t){return void 0!==t?(this.data[e]=t,this):this.data[e]}},{key:"on",value:function(e,t){var i=e.split("."),n=h()(i),r=n[0],a=n.slice(1),o=r;return"mousewheel"===o&&/Firefox/i.test(window.navigator.userAgent)&&(o="DOMMouseScroll"),this.el.addEventListener(o,(function(e){t(e);for(var i=0;i<a.length;i+=1){var n=a[i];if("left"===n&&0!==e.button)return;if("right"===n&&2!==e.button)return;"stop"===n&&e.stopPropagation()}})),this}},{key:"offset",value:function(e){var t=this;if(void 0!==e)return Object.keys(e).forEach((function(i){t.css(i,"".concat(e[i],"px"))})),this;var i=this.el;return{top:i.offsetTop,left:i.offsetLeft,height:i.offsetHeight,width:i.offsetWidth}}},{key:"scroll",value:function(e){var t=this.el;return void 0!==e&&(void 0!==e.left&&(t.scrollLeft=e.left),void 0!==e.top&&(t.scrollTop=e.top)),{left:t.scrollLeft,top:t.scrollTop}}},{key:"box",value:function(){return this.el.getBoundingClientRect()}},{key:"parent",value:function(){return new e(this.el.parentNode)}},{key:"children",value:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return 0===arguments.length?this.el.childNodes:(i.forEach((function(t){return e.child(t)})),this)}},{key:"removeChild",value:function(e){this.el.removeChild(e)}},{key:"empty",value:function(){this.el.innerHTML=""}},{key:"child",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t;return"string"==typeof t?n=document.createTextNode(t):t instanceof e&&(n=t.el),i?this.el.prepend(n):this.el.appendChild(n),this}},{key:"contains",value:function(e){return this.el.contains(e)}},{key:"className",value:function(e){return void 0!==e?(this.el.className=e,this):this.el.className}},{key:"addClass",value:function(e){return this.el.classList.add(e),this}},{key:"hasClass",value:function(e){return this.el.classList.contains(e)}},{key:"removeClass",value:function(e){return this.el&&this.el.classList.remove(e),this}},{key:"toggle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"active";return this.toggleClass(e)}},{key:"toggleClass",value:function(e){return this.el.classList.toggle(e)}},{key:"active",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"active";return e?this.addClass(t):this.removeClass(t),this}},{key:"checked",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.active(e,"checked"),this}},{key:"disabled",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return e?this.addClass("disabled"):this.removeClass("disabled"),this}},{key:"attr",value:function(e,t){var i=this;if(void 0!==t)this.el.setAttribute(e,t);else{if("string"==typeof e)return this.el.getAttribute(e);Object.keys(e).forEach((function(t){i.el.setAttribute(t,e[t])}))}return this}},{key:"removeAttr",value:function(e){return this.el.removeAttribute(e),this}},{key:"sanitizeHTML",value:function(e){var t=document.createElement("div");return t.textContent=e,t.innerHTML}},{key:"html",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return void 0!==e?(this.el.innerHTML=t?i?this.sanitizeHTML(e).replace(/\n/g,"<br>"):this.sanitizeHTML(e):e,this):this.el.innerHTML}},{key:"val",value:function(e){return void 0!==e?(this.el.value=e,this):this.el.value}},{key:"focus",value:function(){this.el.focus()}},{key:"cssRemoveKeys",value:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.forEach((function(t){return e.el.style.removeProperty(t)})),this}},{key:"css",value:function(e,t){var i=this;return void 0===t&&"string"!=typeof e?(Object.keys(e).forEach((function(t){i.el.style[t]=e[t]})),this):void 0!==t?(this.el.style[e]=t,this):this.el.style[e]}},{key:"computedStyle",value:function(){return window.getComputedStyle(this.el,null)}},{key:"show",value:function(){return this.css("display","block"),this}},{key:"hide",value:function(){return this.css("display","none"),this}}]),e}(),f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new u(e,t)},d=i(6),m=i.n(d),g=(i(20),["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]);function v(e){for(var t="",i=e;i>=g.length;)i/=g.length,i-=1,t+=g[parseInt(i,10)%g.length];return t+=g[e%g.length]}function p(e){for(var t=0,i=0;i<e.length-1;i+=1){var n=e.charCodeAt(i)-65,r=e.length-1-i;t+=Math.pow(g.length,r)+g.length*n}return t+=e.charCodeAt(e.length-1)-65}function y(e){for(var t="",i="",n=0;n<e.length;n+=1)e.charAt(n)>="0"&&e.charAt(n)<="9"?i+=e.charAt(n):t+=e.charAt(n);return[p(t),parseInt(i,10)-1]}function b(e,t){return"".concat(v(e)).concat(t+1)}function w(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0};if(0===t&&0===i)return e;var a=y(e),o=r()(a,2),s=o[0],l=o[1];return n(s,l)?b(s+t,l+i):e}var x=function(){function e(t,i,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;l()(this,e),this.sri=t,this.sci=i,this.eri=n,this.eci=r,this.w=a,this.h=o}return o()(e,[{key:"set",value:function(e,t,i,n){this.sri=e,this.sci=t,this.eri=i,this.eci=n}},{key:"setToOther",value:function(e){this.sri=e.sri,this.sci=e.sci,this.eri=e.eri,this.eci=e.eci}},{key:"multiple",value:function(){return this.eri-this.sri>0||this.eci-this.sci>0}},{key:"includes",value:function(){for(var e=0,t=0,i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];if(1===n.length){var o=y(n[0]),s=r()(o,2);t=s[0],e=s[1]}else 2===n.length&&(e=n[0],t=n[1]);var l=this.sri,c=this.sci,h=this.eri,u=this.eci;return l<=e&&e<=h&&c<=t&&t<=u}},{key:"each",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},i=this.sri,n=this.sci,r=this.eri,a=this.eci,o=i;o<=r;o+=1)if(t(o))for(var s=n;s<=a;s+=1)e(o,s)}},{key:"emptyFirst",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0},n=this.sri,r=this.sci,a=this.eri,o=this.eci,s=n;s<=a;s+=1)if(t(s)){for(var l=[],c=[],h=r;h<=o;h+=1)i(s,h)?l.push(h):c.push(h);for(var u=0;u<l.length;u++)e(s,l[u]);for(var f=0;f<c.length;f++)e(s,c[f])}}},{key:"contains",value:function(e){return this.sri<=e.sri&&this.sci<=e.sci&&this.eri>=e.eri&&this.eci>=e.eci}},{key:"within",value:function(e){return this.sri>=e.sri&&this.sci>=e.sci&&this.eri<=e.eri&&this.eci<=e.eci}},{key:"disjoint",value:function(e){return this.sri>e.eri||this.sci>e.eci||e.sri>this.eri||e.sci>this.eci}},{key:"intersects",value:function(e){return this.sri<=e.eri&&this.sci<=e.eci&&e.sri<=this.eri&&e.sci<=this.eci}},{key:"union",value:function(t){var i=this.sri,n=this.sci,r=this.eri,a=this.eci;return new e(t.sri<i?t.sri:i,t.sci<n?t.sci:n,t.eri>r?t.eri:r,t.eci>a?t.eci:a)}},{key:"extendRange",value:function(t){var i=this.sri,n=this.sci,r=this.eri,a=this.eci,o=t.eri-t.sri+1,s=t.eci-t.sci+1,l=r-i+1,c=a-n+1;return new e(i,n,i+(l<o?o:l-l%o)-1,n+(c<s?s:c-c%s)-1)}},{key:"difference",value:function(t){var i=[],n=function(t,n,r,a){i.push(new e(t,n,r,a))},r=this.sri,a=this.sci,o=this.eri,s=this.eci,l=t.sri-r,c=t.sci-a,h=o-t.eri,u=s-t.eci;return this.intersects(t)?l>0?(n(r,a,t.sri-1,s),h>0?(n(t.eri+1,a,o,s),c>0?(n(t.sri,a,t.eri,t.sci-1),u>0&&n(t.sri,t.eci+1,t.eri,s)):u>0&&n(t.sri,t.eci+1,t.eri,s)):c>0?(n(t.sri,a,o,t.sci-1),u>0&&n(t.sri,t.eci+1,o,s)):u>0&&n(t.sri,t.eci+1,o,s)):h>0?(n(t.eri+1,a,o,s),c>0?(n(r,a,t.eri,t.sci-1),u>0&&n(r,t.eci+1,t.eri,s)):u>0&&n(r,t.eci+1,t.eri,s)):c>0?(n(r,a,o,t.sci-1),u>0&&n(r,t.eci+1,o,s)):u>0&&n(r,t.eci+1,o,s):n(r,a,o,s),i}},{key:"size",value:function(){return[this.eri-this.sri+1,this.eci-this.sci+1]}},{key:"toString",value:function(){var e=this.sri,t=this.sci,i=this.eri,n=this.eci,r=b(t,e);return this.multiple()&&(r="".concat(r,":").concat(b(n,i))),r}},{key:"clone",value:function(){return new e(this.sri,this.sci,this.eri,this.eci,this.w,this.h)}},{key:"equals",value:function(e){return this.eri===e.eri&&this.eci===e.eci&&this.sri===e.sri&&this.sci===e.sci}}],[{key:"valueOf",value:function(t){var i=t.split(":"),n=y(i[0]),a=r()(n,2),o=a[0],s=a[1],l=s,c=o;if(i.length>1){var h=y(i[1]),u=r()(h,2);c=u[0],l=u[1]}return new e(s,o,l,c)}}]),e}(),k=x,C=function(){function e(){l()(this,e),this.range=new x(0,0,0,0),this.ri=0,this.ci=0}return o()(e,[{key:"multiple",value:function(){return this.range.multiple()}},{key:"setIndexes",value:function(e,t){this.ri=e,this.ci=t}},{key:"size",value:function(){return this.range.size()}}]),e}(),S=function e(){l()(this,e),this.x=0,this.y=0,this.ri=0,this.ci=0,this.riact=0},_=function(){function e(){l()(this,e),this.undoItems=[],this.redoItems=[]}return o()(e,[{key:"add",value:function(e){this.undoItems.push(JSON.stringify(e)),this.redoItems=[]}},{key:"canUndo",value:function(){return this.undoItems.length>0}},{key:"canRedo",value:function(){return this.redoItems.length>0}},{key:"undo",value:function(e,t){var i=this.undoItems,n=this.redoItems;if(this.canUndo()){var r=JSON.parse(i.pop());n.push(JSON.stringify(e(r))),t(r)}}},{key:"redo",value:function(e,t){var i=this.undoItems,n=this.redoItems;if(this.canRedo()){var r=JSON.parse(n.pop());i.push(JSON.stringify(e(r))),t(r)}}}]),e}(),T=function(){function e(){l()(this,e),this.range=null,this.state="clear",this.textdata=null}return o()(e,[{key:"copy",value:function(e,t){this.range=e,this.state="copy";for(var i=e.sri,n=e.sci,r=e.eri,a=e.eci,o="",s=i;s<=r;s+=1){if(t._[s])for(var l=n;l<=a;l+=1){if(t._[s].cells&&t._[s].cells[l]){var c=t._[s].cells[l].text;c&&(c.indexOf("\n")>=0&&(c='"'+c+'"'),o+=c)}o+="\t"}o+="\n"}return this.setData(o),this}},{key:"cut",value:function(e){return this.range=e,this.state="cut",this}},{key:"isCopy",value:function(){return"copy"===this.state}},{key:"isCut",value:function(){return"cut"===this.state}},{key:"isClear",value:function(){return"clear"===this.state}},{key:"clear",value:function(){this.range=null,this.state="clear"}},{key:"setData",value:function(e){this.textdata=e,this.copyTextToClipboard(e)}},{key:"fallbackCopyTextToClipboard",value:function(e){var t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}catch(e){}document.body.removeChild(t)}},{key:"copyTextToClipboard",value:function(e){navigator.clipboard?navigator.clipboard.writeText(e).then((function(){}),(function(e){})):this.fallbackCopyTextToClipboard(e)}}]),e}(),O=function(){function e(t,i,n){l()(this,e),this.ci=t,this.operator=i,this.value=n}return o()(e,[{key:"set",value:function(e,t){this.operator=e,this.value=t}},{key:"includes",value:function(e){var t=this.operator,i=this.value;return"all"===t||"in"===t&&i.includes(e)}},{key:"vlength",value:function(){var e=this.operator,t=this.value;return"in"===e?t.length:0}},{key:"getData",value:function(){return{ci:this.ci,operator:this.operator,value:this.value}}}]),e}(),E=function(){function e(t,i){l()(this,e),this.ci=t,this.order=i}return o()(e,[{key:"asc",value:function(){return"asc"===this.order}},{key:"desc",value:function(){return"desc"===this.order}}]),e}(),R=function(){function e(){l()(this,e),this.ref=null,this.filters=[],this.sort=null}return o()(e,[{key:"setData",value:function(e){var t=e.ref,i=e.filters,n=e.sort;null!=t&&(this.ref=t,this.filters=i.map((function(e){return new O(e.ci,e.operator,e.value)})),n&&(this.sort=new E(n.ci,n.order)))}},{key:"getData",value:function(){if(this.active()){var e=this.ref,t=this.filters,i=this.sort;return{ref:e,filters:t.map((function(e){return e.getData()})),sort:i}}return{}}},{key:"addFilter",value:function(e,t,i){var n=this.getFilter(e);null==n?this.filters.push(new O(e,t,i)):n.set(t,i)}},{key:"setSort",value:function(e,t){this.sort=t?new E(e,t):null}},{key:"includes",value:function(e,t){return!!this.active()&&this.hrange().includes(e,t)}},{key:"getSort",value:function(e){var t=this.sort;return t&&t.ci===e?t:null}},{key:"getFilter",value:function(e){for(var t=this.filters,i=0;i<t.length;i+=1)if(t[i].ci===e)return t[i];return null}},{key:"filteredRows",value:function(e){var t=new Set,i=new Set;if(this.active())for(var n=this.range(),r=n.sri,a=n.eri,o=this.filters,s=r+1;s<=a;s+=1)for(var l=0;l<o.length;l+=1){var c=o[l],h=e(s,c.ci),u=h&&0!=h.text.trim().length?h.text:"";if(!c.includes(u)){t.add(s);break}i.add(s)}return{rset:t,fset:i}}},{key:"items",value:function(e,t){var i={};if(this.active())for(var n=this.range(),r=n.sri,a=n.eri,o=r+1;o<=a;o+=1){var s=t(o,e);if(null===s||/^\s*$/.test(s.text))i[""]=(i[""]||0)+1;else{var l=s.text,c=(i[l]||0)+1;i[l]=c}}return i}},{key:"range",value:function(){return x.valueOf(this.ref)}},{key:"hrange",value:function(){var e=this.range();return e.eri=e.sri,e}},{key:"clear",value:function(){this.ref=null,this.filters=[],this.sort=null}},{key:"active",value:function(){return null!==this.ref}}]),e}(),I=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];l()(this,e),this._=t}return o()(e,[{key:"forEach",value:function(e){this._.forEach(e)}},{key:"deleteWithin",value:function(e){this._=this._.filter((function(t){return!t.within(e)}))}},{key:"getFirstIncludes",value:function(e,t){for(var i=0;i<this._.length;i+=1){var n=this._[i];if(n.includes(e,t))return n}return null}},{key:"filterIntersects",value:function(t){return new e(this._.filter((function(e){return e.intersects(t)})))}},{key:"intersects",value:function(e){for(var t=0;t<this._.length;t+=1){if(this._[t].intersects(e))return!0}return!1}},{key:"equals",value:function(e){for(var t=0;t<this._.length;t+=1){if(this._[t].equals(e))return!0}return!1}},{key:"union",value:function(e){var t=e;return this._.forEach((function(e){e.intersects(t)&&(t=e.union(t))})),t}},{key:"add",value:function(e){this.deleteWithin(e),this._.push(e)}},{key:"shift",value:function(e,t,i,n){this._.forEach((function(r){var a=r.sri,o=r.sci,s=r.eri,l=r.eci,c=r;"row"===e?a>=t?(c.sri+=i,c.eri+=i):a<t&&t<=s&&(c.eri+=i,n(a,o,i,0)):"column"===e&&(o>=t?(c.sci+=i,c.eci+=i):o<t&&t<=l&&(c.eci+=i,n(a,o,0,i)))}))}},{key:"move",value:function(e,t,i){this._.forEach((function(n){var r=n;r.within(e)&&(r.eri+=t,r.sri+=t,r.sci+=i,r.eci+=i)}))}},{key:"setData",value:function(e){return this._=e.map((function(e){return x.valueOf(e)})),this}},{key:"getData",value:function(){return this._.map((function(e){return e.toString()}))}},{key:"getDataForSave",value:function(){return this._.filter((function(e){return e.multiple()}))}}]),e}();var A=function e(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return n.forEach((function(i){Object.keys(i).forEach((function(n){var r=i[n];"string"==typeof r||"number"==typeof r||"boolean"==typeof r?t[n]=r:"function"!=typeof r&&!Array.isArray(r)&&r instanceof Object?(t[n]=t[n]||{},e(t[n],r)):t[n]=r}))})),t};function D(e){for(var t="".concat(e),i=0,n=!1,r=0;r<t.length;r+=1)!0===n&&(i+=1),"."===t.charAt(r)&&(n=!0);return i}function P(e,t,i){if(Number.isNaN(t)||Number.isNaN(i))return t+e+i;var n=D(t),r=D(i),a=Number(t),o=Number(i),s=0;return"-"===e?s=a-o:"+"===e?s=a+o:"*"===e?s=a*o:"/"===e&&(s=a/o),s.toFixed(Math.max(n,r))}var F={cloneDeep:function(e){return JSON.parse(JSON.stringify(e))},merge:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return A.apply(void 0,[{}].concat(t))},equals:function e(t,i){var n=Object.keys(t);if(n.length!==Object.keys(i).length)return!1;for(var r=0;r<n.length;r+=1){var a=n[r],o=t[a],s=i[a];if(void 0===s)return!1;if("string"==typeof o||"number"==typeof o||"boolean"==typeof o){if(o!==s)return!1}else if(Array.isArray(o)){if(o.length!==s.length)return!1;for(var l=0;l<o.length;l+=1)if(!e(o[l],s[l]))return!1}else if("function"!=typeof o&&!Array.isArray(o)&&o instanceof Object&&!e(o,s))return!1}return!0},arrayEquals:function(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i+=1)if(e[i]!==t[i])return!1;return!0},sum:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e},i=0,n=0;return Object.keys(e).forEach((function(r){i+=t(e[r],r),n+=1})),[i,n]},rangeEach:function(e,t,i){for(var n=e;n<t;n+=1)i(n)},rangeSum:function(e,t,i){for(var n=0,r=e;r<t;r+=1)n+=i(r);return n},rangeReduceIf:function(e,t,i,n,r,a){for(var o=i,s=n,l=e;l<t&&!(o>r);l+=1)o+=s=a(l);return[l,o-s,s]},deleteProperty:function(e,t){var i=e["".concat(t)];return delete e["".concat(t)],i},numberCalc:P},M=function(){function e(t){var i=t.len,n=t.height;l()(this,e),this._={},this.len=i,this.height=n}return o()(e,[{key:"getHeight",value:function(e,t){if(this.isHide(e))return 0;if(t&&t.has(e))return 0;var i=this.get(e);return i&&i.height?i.height:this.height}},{key:"setHeight",value:function(e,t){this.getOrNew(e).height=t}},{key:"unhide",value:function(e){for(var t=e;t>0&&(t-=1,this.isHide(t));)this.setHide(t,!1)}},{key:"isHide",value:function(e){var t=this.get(e);return t&&t.hide}},{key:"setHide",value:function(e,t){var i=this.getOrNew(e);!0===t?i.hide=!0:delete i.hide}},{key:"setStyle",value:function(e,t){this.getOrNew(e).style=t}},{key:"sumHeight",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;return F.rangeSum(e,t,(function(e){return n&&n.has(e)?0:i.getHeight(e)}))}},{key:"totalHeight",value:function(){return this.sumHeight(0,this.len)}},{key:"get",value:function(e){return this._[e]}},{key:"getOrNew",value:function(e){return this._[e]=this._[e]||{cells:{}},this._[e]}},{key:"getCell",value:function(e,t){var i=this.get(e);return void 0!==i&&void 0!==i.cells&&void 0!==i.cells[t]?i.cells[t]:null}},{key:"getCellMerge",value:function(e,t){var i=this.getCell(e,t);return i&&i.merge?i.merge:[0,0]}},{key:"getCellOrNew",value:function(e,t){var i=this.getOrNew(e);return i.cells[t]=i.cells[t]||{},i.cells[t]}},{key:"setCell",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"all",r=this.getOrNew(e);"all"===n?r.cells[t]=i:"text"===n?(r.cells[t]=r.cells[t]||{},r.cells[t].text=i.text):"format"===n&&(r.cells[t]=r.cells[t]||{},r.cells[t].style=i.style,i.merge&&(r.cells[t].merge=i.merge))}},{key:"setCellTextBasicAct",value:function(e,t,i,n){e.text=t,n?e.f=n:delete e.f,i?e.ufv=i:delete e.ufv,e.html&&t.startsWith("<font style=")&&t.endsWith("</font>")&&(e.html=t)}},{key:"setCellText",value:function(e,t,i,n,r){var a=this.getCellOrNew(e,t);this.setCellTextBasicAct(a,i,n,r)}},{key:"setCellTextAndGetRet",value:function(e){var t=this.getCellOrNew(e.ri,e.ci);return this.setCellTextBasicAct(t,e.text,e.ufv,e.f),t.rtxt=e.rtxt,t.html=e.html,delete t.bigfontsize,t}},{key:"updateOneCell",value:function(e){return this.setCellTextAndGetRet(e)}},{key:"copyPaste",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},o=e.sri,s=e.sci,l=e.eri,c=e.eci,h=new Array,u=new Array,f=t.sri>=0?t.sri:0,d=t.sci>=0?t.sci:0,m=t.eri,g=t.eci,v=e.size(),p=r()(v,2),y=p[0],b=p[1],x=t.size(),k=r()(x,2),C=k[0],S=k[1],_=!0,T=0;(m<o||g<s)&&(_=!1,T=m<o?C:S);for(var O=o;O<=l;O+=1)for(var E=s;E<=c;E+=1)for(var R=f;R<=m;R+=y)for(var I=d;I<=g;I+=b){var A=R+(O-o),D=I+(E-s);if(A!==O||D!==E){var P=this._[O]&&this._[O].cells&&this._[O].cells[E],M=P?F.cloneDeep(this._[O].cells[E]):{};if(A!==O||D!==E){n&&M&&M.text&&M.text.length>0&&function(){var e=M.text,t=I-d+(R-f)+2;if(_||(t-=T+1),"="===e[0])M.text=e.replace(/\w{1,3}\d/g,(function(e){var i=0,n=0;return o===f?i=t-1:n=t-1,/^\d+$/.test(e)?e:w(e,i,n)}));else if(y<=1&&b>1&&(f>l||m<o)||b<=1&&y>1&&(d>c||g<s)||y<=1&&b<=1){var i=/[\\.\d]+$/.exec(e);if(null!==i){var n=Number(i[0])+t-1;M.text=e.substring(0,i.index)+n}}}();var L={ri:A,ci:D,text:M.f?M.f:M.text},j={ri:A,ci:D,ncell:M};n&&(M.f||M.ufv)||h.push(L),u.push(j)}}}for(var z=0;z<u.length;z++)this.setCell(u[z].ri,u[z].ci,u[z].ncell,i),a(u[z].ri,u[z].ci,u[z].ncell);return h}},{key:"cutPaste",value:function(e,t){var i=this,n={};this.each((function(r){i.eachCells(r,(function(a){var o=parseInt(r,10),s=parseInt(a,10);e.includes(r,a)&&(o=t.sri+(o-e.sri),s=t.sci+(s-e.sci)),n[o]=n[o]||{cells:{}},n[o].cells[s]=i._[r].cells[a],n[o].height=i._[r].height}))})),this._=n}},{key:"paste",value:function(e,t){var i=this,n=new Array;if(!(e.length<=0)){var r=t.sri,a=t.sci;return e.forEach((function(e,t){var o=r+t;e.forEach((function(e,t){var r=a+t;if(r<=1e3){i.setCellText(o,r,e);var s={ri:o,ci:r,text:e};n.push(s)}}))})),n}}},{key:"insert",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n={};this.each((function(r,a){var o=parseInt(r,10);o>=e&&(o+=i,t.eachCells(r,(function(t,n){n.text&&"="===n.text[0]&&(n.text=n.text.replace(/\w{1,3}\d/g,(function(t){return w(t,0,i,(function(t,i){return i>=e}))})))}))),n[o]=a})),this._=n,this.len+=i,e>=1&&this.copyrow(e-1,i)}},{key:"copyrow",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.copyCellStyle,r=this._[e];if(void 0!==r)for(var a=function(i){var a=t.getOrNew(e+i);a.height=r.height,t.eachCells(e,(function(e,t){a.cells[e]={},n(a.cells[e],t)}))},o=1;o<=i;o++)a(o)}},{key:"copyCellStyle",value:function(e,t){e.style=t.style,t.isautoalign&&(e.isautoalign=t.isautoalign)}},{key:"delete",value:function(e,t){var i=this,n=t-e+1,r={};this.each((function(a,o){var s=parseInt(a,10);s<e?r[s]=o:a>t&&(r[s-n]=o,i.eachCells(a,(function(e,i){i.text&&"="===i.text[0]&&(i.text=i.text.replace(/\w{1,3}\d/g,(function(e){return w(e,0,-n,(function(e,i){return i>t}))})))})))})),this._=r,this.len-=n}},{key:"insertColumn",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.copyCellStyle;this.each((function(r,a){var o={};if(t.eachCells(r,(function(t,n){var r=parseInt(t,10);r>=e&&(r+=i,n.text&&"="===n.text[0]&&(n.text=n.text.replace(/\w{1,3}\d/g,(function(t){return w(t,i,0,(function(t){return t>=e}))})))),o[r]=n})),e>=1)for(var s=1;s<=i;s++)void 0!==o[e-1]&&(o[e-1+s]={},n(o[e-1+s],o[e-1]));a.cells=o}))}},{key:"deleteColumn",value:function(e,t){var i=this,n=t-e+1;this.each((function(r,a){var o={};i.eachCells(r,(function(i,r){var a=parseInt(i,10);a<e?o[a]=r:a>t&&(o[a-n]=r,r.text&&"="===r.text[0]&&(r.text=r.text.replace(/\w{1,3}\d/g,(function(e){return w(e,-n,0,(function(e){return e>t}))}))))})),a.cells=o}))}},{key:"deleteCells",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";e.each((function(e,n){t.deleteCell(e,n,i)}))}},{key:"deleteCell",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all",n=this.get(e);if(null!==n){var r=this.getCell(e,t);null!==r&&("all"===i?delete n.cells[t]:"text"===i?(r.text&&delete r.text,r.value&&delete r.value):"format"===i?(void 0!==r.style&&delete r.style,r.merge&&delete r.merge):"merge"===i&&r.merge&&delete r.merge)}}},{key:"maxCell",value:function(){var e=Object.keys(this._),t=e[e.length-1],i=this._[t];if(i){var n=i.cells,r=Object.keys(n),a=r[r.length-1];return[parseInt(t,10),parseInt(a,10)]}return[0,0]}},{key:"each",value:function(e){Object.entries(this._).forEach((function(t){var i=r()(t,2),n=i[0],a=i[1];e(n,a)}))}},{key:"eachCells",value:function(e,t){this._[e]&&this._[e].cells&&Object.entries(this._[e].cells).forEach((function(e){var i=r()(e,2),n=i[0],a=i[1];t(n,a)}))}},{key:"setData",value:function(e){e.len&&(this.len=e.len,delete e.len),void 0!==e.height&&(this.height=e.height,delete e.height),this._=e}},{key:"setRangeData",value:function(e,t){for(var i=t.sri;i<=t.eri;i++)void 0!==e[i]&&(this._[i]=e[i]),null===e[i]&&delete this._[i]}},{key:"getData",value:function(){var e=this.len,t=this.height;return Object.assign({len:e,height:t},this._)}},{key:"getRangeData",value:function(e){for(var t={},i=e.sri;i<=e.eri;i++)void 0!==this._[i]?t[i]=this._[i]:t[i]=null;return t}},{key:"getDataForRowsSet",value:function(e){var t=this,i=this.len,n=this.height,r={};return r.height=n,r.len=i,e.forEach((function(e){void 0!==t._[e]&&(r[e]=t._[e])})),r}},{key:"getHeightForSave",value:function(e){var t=this,i={};return e.forEach((function(e){void 0!==t._[e]&&(i[e]=t.getHeight(e))})),i}}]),e}(),L=function(){function e(t){var i=t.len,n=t.width,r=t.indexWidth,a=t.minWidth;l()(this,e),this._={},this.len=i,this.width=n,this.indexWidth=r,this.minWidth=a}return o()(e,[{key:"setData",value:function(e){e.len&&(this.len=e.len,delete e.len),this._=e}},{key:"getData",value:function(){var e=this.len;return Object.assign({len:e},this._)}},{key:"getDataForSave",value:function(e){var t=this,i={};return e.forEach((function(e){void 0!==t._[e]&&(i[e]=t._[e])})),i}},{key:"getWidth",value:function(e){if(this.isHide(e))return 0;var t=this._[e];return t&&t.width?t.width:this.width}},{key:"getOrNew",value:function(e){return this._[e]=this._[e]||{},this._[e]}},{key:"setWidth",value:function(e,t){this.getOrNew(e).width=t}},{key:"unhide",value:function(e){for(var t=e;t>0&&(t-=1,this.isHide(t));)this.setHide(t,!1)}},{key:"isHide",value:function(e){var t=this._[e];return t&&t.hide}},{key:"setHide",value:function(e,t){var i=this.getOrNew(e);!0===t?i.hide=!0:delete i.hide}},{key:"setStyle",value:function(e,t){this.getOrNew(e).style=t}},{key:"sumWidth",value:function(e,t){var i=this;return F.rangeSum(e,t,(function(e){return i.getWidth(e)}))}},{key:"totalWidth",value:function(){return this.sumWidth(0,this.len)}}]),e}();function j(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return z(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return z(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var B=["zh","en"],H={en:{toolbar:{undo:"Undo",redo:"Redo",print:"Print",paintformat:"Paint format",clearformat:"Clear format",format:"Format",fontName:"Font",fontSize:"Font size",fontBold:"Font bold",fontItalic:"Font italic",underline:"Underline",strike:"Strike",color:"Text color",bgcolor:"Fill color",border:"Borders",merge:"Merge cells",unmerge:"Unmerge cells",align:"Horizontal align",valign:"Vertical align",textwrap:"Text wrapping",freeze:"Freeze cell",autofilter:"Filter",formula:"Functions",more:"More",sort:"Sort",download:"Download",pagination:"Pagination",search:"Search",commentDefault:"Please enter text",commentEdit:"Edit comment",commentRemove:"Remove comment",commentPrevious:"Previous comment",commentNext:"Next comment",insertImage:"Insert image"},menubar:{undo:"Undo",redo:"Redo",print:"Print",paintformat:"Paint format",clearformat:"Clear format",format:"Format",fontName:"Font name:",fontSize:"Font size:",fontBold:"Font bold",fontItalic:"Font italic",underline:"Underline",strike:"Strike",color:"Text color",bgcolor:"Fill color",border:"Borders",merge:"Merge cells",unmerge:"Unmerge cells",align:"Horizontal align",valign:"Vertical align",textwrap:"Text wrapping",freeze:"Freeze cell",autofilter:"Filter",formula:"Functions",more:"More",sort:"Sort",download:"Download",download_HTML:"Download As HTML",download_PDF:"Download As PDF",download_Original:"Download Original",download_XLSX:"Download As XLSX",download_GOOGLE:"Save To Google Drive",download_DROPBOX:"Save To Dropbox",pagination:"Pagination",search:"Search",commentDefault:"Please enter text",insertSheet:"Sheet",insertRow:"Row",insertColumn:"Column",link:"Link",insertComment:"Comment",commentEdit:"Edit comment",commentRemove:"Remove comment",commentPrevious:"Previous comment",commentNext:"Next comment",insertImage:"Image",fromURL:"From URL",fromLocal:"From Local",menuInsert:"Insert",menuComment:"Review",menuText:"Format",menuFont:"Font",menuEdit:"Home",menuFile:"File"},contextmenu:{copy:"Copy",cut:"Cut",paste:"Paste",pasteValue:"Paste values only",pasteFormat:"Paste format only",hide:"Hide",insertRow:"Insert row",insertColumn:"Insert column",deleteSheet:"Delete",deleteRow:"Delete row",deleteColumn:"Delete column",deleteCell:"Delete cell",deleteCellText:"Delete cell text",validation:"Data validations",sort:"Sort",link:"Link",removeLink:"Remove Link",editLink:"Edit Link",openLink:"Open Link",download:"Download",cellprintable:"Enable export",cellnonprintable:"Disable export",celleditable:"Enable editing",cellnoneditable:"Disable editing",insertURL:"Enter the image address",deleteImage:"Delete image",copyImage:"Copy image",pasteImage:"Paste image",merge:"Merge",unmerge:"Unmerge",edit:"Edit",clear:"Clear"},link:{emailAddress:"E-mail Address",emailSubject:"Subject",sheetPage:"Document Place",sheetCell:"Cell Reference",linkTypes:{web:"Web Page",sheet:"This Document",email:"E-mail Address"},webUrl:"Address",linkType:"Link To"},download:{fileName:"File Name",saveType:"Save As",saveTypes:{Original:"Original",XLSX:"XLSX",PDF:"PDF",HTML:"HTML"}},print:{size:"Paper size",orientation:"Page orientation",orientations:["Landscape","Portrait"]},format:{normal:"Normal",text:"Plain Text",number:"Number",percent:"Percent",rmb:"RMB",usd:"USD",eur:"EUR",date:"Date",time:"Time",datetime:"Date time",duration:"Duration"},formula:{sum:"Calculate the sum of a set of values",average:"Calculate the arithmetic mean of all parameters",max:"Calculate the maximum value in a set of numbers",min:"Calculate the smallest value in a set of numbers",_if:"According to the true or false result of the logical judgment of the specified condition, the calculation result triggered by the corresponding condition is returned",and:'Only when the results of the parameters are all logical "true", it returns logical "true", otherwise it returns logical "false"',or:'Only when all parameter values are logically "false", the result is returned as logical "false", otherwise it is returned as logical "true"',concat:"Connect multiple character text or data in cells together",count:"counts the number of cells that contain numbers, and counts numbers within the list of arguments",sumif:"Adds the cells specified by a given criteria",sumifs:"Adds the cells in a range that meet multiple criteria",vlookup:"Looks in the first column of an array and moves across the row to return the value of a cell",hlookup:"Searches for a value in the top row of a table or an array of values, and then returns a value in the same column from a row you specify in the table or array.",lookup:"Looks up values in a vector or array",match:"Looks up values in a reference or array",rank:"Returns the rank of a number in a list of numbers",frequency:"Returns a frequency distribution as a vertical array",text:"Formats a number and converts it to text",left:"Returns the leftmost characters from a text value",right:"Returns the rightmost characters from a text value",round:"Rounds a number to a specified number of digits",index:"Uses an index to choose a value from a reference or array",countif:"Counts the number of cells within a range that meet the given criteria",countifs:"Counts the number of cells within a range that meet multiple criteria",mid:"Returns a specific number of characters from a text string starting at the position you specify",len:"Returns the number of characters in a text string",power:"Returns the result of a number raised to a power",ceiling:"Rounds a number to the nearest integer or to the nearest multiple of significance",floor:"Rounds a number down, toward zero",substitute:"Substitutes new text for old text in a text string",replace:"Replaces characters within text",search:"Finds one text value within another (not case-sensitive)",find:"Finds one text value within another (case-sensitive)",isnumber:"Returns TRUE if the value is a number",istext:"Returns TRUE if the value is text",isblank:"Returns TRUE if the value is blank",upper:"Converts text to uppercase",lower:"Converts text to lowercase",product:"Multiplies its arguments",sumproduct:"Returns the sum of the products of corresponding array components",subtotal:"Returns a subtotal in a list or database",counta:"Counts how many values are in the list of arguments",averageif:"Returns the average (arithmetic mean) of all the cells in a range that meet a given criteria",averageifs:"Returns the average (arithmetic mean) of all cells that meet multiple criteria.",trim:"Removes spaces from text",sign:"Returns the sign of a number",yield:"Returns the yield on a security that pays periodic interest",abs:"Returns the absolute value of a number",sin:"Returns the sine of the given angle",cos:"Returns the cosine of a number",tan:"Returns the tangent of a number"},validation:{required:"it must be required",notMatch:"it not match its validation rule",between:"it is between {} and {}",notBetween:"it is not between {} and {}",notIn:"it is not in list",equal:"it equal to {}",notEqual:"it not equal to {}",lessThan:"it less than {}",lessThanEqual:"it less than or equal to {}",greaterThan:"it greater than {}",greaterThanEqual:"it greater than or equal to {}",downloadImageFail:"download image fail"},error:{pasteForMergedCell:"Unable to do this for merged cells"},calendar:{weeks:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"]},button:{add:"Add",del:"Delete",next:"Next",cancel:"Cancel",remove:"Remove",save:"Save",ok:"OK",previous:"Previous",close:"Close"},sort:{desc:"Sort Z -> A",asc:"Sort A -> Z"},filter:{empty:"empty"},dataValidation:{mode:"Mode",range:"Cell Range",criteria:"Criteria",modeType:{cell:"Cell",column:"Column",row:"Row"},type:{list:"List",number:"Number",date:"Date",phone:"Phone",email:"Email"},operator:{be:"between",nbe:"not between",lt:"less than",lte:"less than or equal to",gt:"greater than",gte:"greater than or equal to",eq:"equal to",neq:"not equal to"}},dataSort:{ci:"Range",criteria:"Order",casesense:"Case Sensitive",sortby:"Sort by",header:"My data has headers",msg:"Please select diffrent columns for sort by fields",msg2:"The select range has merge areas,we do not support sort on merge areas ",order:{asc:"ASC",desc:"DESC"}},dataSearch:{label:"Find what",lkinlb:"Look in",matchwhole:"Match entire contents",lookin:{values:"Values",formulas:"Formulas",comments:"Comments"}},dataComment:{label:"Comment"}},de:{toolbar:{undo:"Rückgängig machen",redo:"Wiederholen",print:"Drucken",paintformat:"Format Maler",clearformat:"übersichtliches Format",format:"Datei Format",fontName:"Schriftartenname",fontSize:"Schriftgröße",fontBold:"fette Schriftart",fontItalic:"Schriftart kursiv",underline:"unterstreichen",strike:"durchgestrichen",color:"Textfarbe",bgcolor:"Füllfarbe",border:"rahmen",merge:"Zellen verbinden",unmerge:"Zellen trennen",align:"Horizontale Ausrichtung",valign:"Vertikale Ausrichtung",textwrap:"Zeilenumbruch",freeze:"feste Ränge",autofilter:"Filter",formula:"Formel",more:"Mehr",sort:"Einstufung",download:"herunterladen",pagination:"Paging",search:"suchen",commentDefault:"Bitte Text eingeben",commentEdit:"Kommentare bearbeiten",commentRemove:"Kommentar löschen",commentPrevious:"Vorheriger Kommentar",commentNext:"nächster Kommentar",insertImage:"Bild einfügen"},menubar:{undo:"rückgängig machen",redo:"wiederholen",print:"Drucken",paintformat:"Format Maler",clearformat:"übersichtliches Format",format:"Datei Format",fontName:"Schriftartenname:",fontSize:"Schriftgröße:",fontBold:"fette Schriftart",fontItalic:"Schriftart kursiv",underline:"unterstreichen",strike:"durchgestrichen",color:"Textfarbe",bgcolor:"Füllfarbe",border:"rahmen",merge:"Zellen verbinden",unmerge:"Zellen trennen",align:"Horizontale Ausrichtung",valign:"Vertikale Ausrichtung",textwrap:"Zeilenumbruch",freeze:"feste Ränge",autofilter:"Filter",formula:"Formel",more:"Mehr",sort:"Einstufung",download:"herunterladen",download_HTML:"Als HTML herunterladen",download_PDF:"Als PDF herunterladen",download_Original:"Original herunterladen",download_XLSX:"Als XLSX herunterladen",download_GOOGLE:"Auf Google Drive speichern",download_DROPBOX:"In Dropbox speichern",pagination:"Paging",search:"suchen",commentDefault:"Bitte Text eingeben",insertSheet:"Arbeitsblatt einfügen",insertRow:"Zeile einfügen",insertColumn:"Spalte einfügen",link:"Verknüpfung",insertComment:"einen Kommentar hinzufügen",commentEdit:"Kommentare bearbeiten",commentRemove:"Kommentar löschen",commentPrevious:"Vorheriger Kommentar",commentNext:"nächster Kommentar",insertImage:"Bild einfügen",fromURL:"von URL",fromLocal:"von lokal",menuInsert:"ergänzen",menuComment:"Überprüfen",menuText:"Format",menuFont:"Schriftart",menuEdit:"Titelseite",menuFile:"dokumentieren"},contextmenu:{copy:"Kopieren",cut:"schneiden",paste:"Paste",pasteValue:"Fügen Sie nur den Wert ein",pasteFormat:"Nur Formatierung einfügen",hide:"verstecken",insertRow:"Zeile einfügen",insertColumn:"Spalte einfügen",deleteSheet:"Blatt löschen",deleteRow:"Zeile löschen",deleteColumn:"Spalte löschen",deleteCell:"Zelle löschen",deleteCellText:"Zelltext löschen",validation:"Datenüberprüfung",sort:"Einstufung",link:"Verknüpfung",removeLink:"Link löschen",editLink:"Link bearbeiten",openLink:"Verbindung öffnen",download:"herunterladen",cellprintable:"Export aktivieren",cellnonprintable:"Export deaktivieren",celleditable:"Bearbeitung aktivieren",cellnoneditable:"Bearbeitung deaktivieren",insertURL:"Bildadresse eingeben",deleteImage:"Foto löschen",copyImage:"Bild kopieren",pasteImage:"Bild einfügen",merge:"verschmelzen",unmerge:"aufheben",edit:"bearbeiten",clear:"zu löschen"},link:{emailAddress:"Email",emailSubject:"Thema",sheetPage:"Speicherort",sheetCell:"Zellbezug",linkTypes:{web:"Website",sheet:"Diese Datei",email:"Email"},webUrl:"URL",linkType:"Linktyp"},download:{fileName:"Dateinamen",saveType:"Speichern als",saveTypes:{Original:"Originalformat",XLSX:"XLSX-Format",PDF:"PDF-Format",HTML:"HTML-Format"}},print:{size:"Papier größe",orientation:"Seitenausrichtung",orientations:["Horizontal, Vertikal"]},format:{normal:"normal",text:"Klartext",number:"Nummer",percent:"Prozentsatz",rmb:"Renminbi",usd:"Dollar",eur:"EUR",date:"Datum",time:"Zeit",datetime:"Terminzeit",duration:"Zeitraum"},formula:{sum:"Berechnet die Summe einer Reihe von Werten",average:"Berechnet das arithmetische Mittel aller Parameter",max:"Berechnet den Maximalwert in einer Reihe von Ziffern",min:"Berechnet den kleinsten Wert in einer Reihe von Ziffern",_if:"Je nachdem, ob das Ergebnis der logischen Beurteilung der angegebenen Bedingung wahr oder falsch ist, geben Sie das Berechnungsergebnis zurück, das durch die entsprechende Bedingung ausgelöst wurde",and:"Es gibt nur logisch „wahr“ zurück, wenn die Ergebnisse der Parameter beide logisch „wahr“ sind, andernfalls gibt es logisch „falsch“ zurück.",or:"Das Ergebnis wird nur dann als logisch „falsch“ zurückgegeben, wenn alle Parameterwerte logisch „falsch“ sind, ansonsten wird logisch „wahr“ zurückgegeben.",concat:"Mehreren Zeichentext oder Daten in Zellen miteinander verbinden",count:"zählt die Anzahl der Zellen, die Zahlen enthalten, und zählt Zahlen in der Liste der Argumente",sumif:"Fügt die durch ein bestimmtes Kriterium spezifizierten Zellen hinzu",sumifs:"Fügt die Zellen in einem Bereich hinzu, die mehrere Kriterien erfüllen",vlookup:"Sucht in der ersten Spalte eines Arrays und bewegt sich über die Zeile, um den Wert einer Zelle zurückzugeben",hlookup:"Sucht nach einem Wert in der obersten Zeile einer Tabelle oder einem Array von Werten und gibt dann einen Wert in derselben Spalte aus einer Zeile zurück, die Sie in der Tabelle oder dem Array angeben.",lookup:"Schlägt Werte in einem Vektor oder Array nach",match:"Schlägt Werte in einer Referenz oder einem Array nach",rank:"Gibt den Rang einer Zahl in einer Liste von Zahlen zurück",frequency:"Gibt eine Häufigkeitsverteilung als vertikales Array zurück",text:"Formatiert eine Zahl und wandelt sie in Text um",left:"Gibt die Zeichen ganz links von einem Textwert zurück",right:"Gibt die Zeichen ganz rechts von einem Textwert zurück",round:"Rundet eine Zahl auf eine bestimmte Anzahl von Stellen",index:"Verwendet einen Index, um einen Wert aus einer Referenz oder einem Array auszuwählen",countif:"Zählt die Anzahl der Zellen innerhalb eines Bereichs, die die angegebenen Kriterien erfüllen",countifs:"Zählt die Anzahl der Zellen innerhalb eines Bereichs, die mehrere Kriterien erfüllen",mid:"Gibt eine bestimmte Anzahl von Zeichen aus einer Textzeichenfolge zurück, beginnend an der von Ihnen angegebenen Position",len:"Gibt die Anzahl der Zeichen in einer Textzeichenfolge zurück",power:"Gibt das Ergebnis einer potenzierten Zahl zurück",ceiling:"Rundet eine Zahl auf die nächste ganze Zahl oder auf das nächste Vielfache der Wertigkeit",floor:"Rundet eine Zahl ab, gegen Null",substitute:"Ersetzt alten Text in einer Textzeichenfolge durch neuen Text",replace:"Ersetzt Zeichen im Text",search:"Sucht einen Textwert innerhalb eines anderen (Groß- und Kleinschreibung wird nicht beachtet)",find:"Sucht einen Textwert in einem anderen (Groß-/Kleinschreibung beachten)",isnumber:"Gibt TRUE zurück, wenn der Wert eine Zahl ist",istext:"Gibt TRUE zurück, wenn der Wert Text ist",isblank:"Gibt TRUE zurück, wenn der Wert leer ist",upper:"Konvertiert Text in Großbuchstaben",lower:"Konvertiert Text in Kleinbuchstaben",product:"Multipliziert seine Argumente",sumproduct:"Gibt die Summe der Produkte der entsprechenden Array-Komponenten zurück",subtotal:"Gibt eine Zwischensumme in einer Liste oder Datenbank zurück",counta:"Zählt, wie viele Werte in der Liste der Argumente sind",averageif:"Gibt den Durchschnitt (arithmetisches Mittel) aller Zellen in einem Bereich zurück, die ein bestimmtes Kriterium erfüllen",averageifs:"Gibt den Durchschnitt (arithmetisches Mittel) aller Zellen zurück, die mehrere Kriterien erfüllen.",trim:"Entfernt Leerzeichen aus Text",sign:"Gibt das Vorzeichen einer Zahl zurück",yield:"Gibt die Rendite eines Wertpapiers zurück, das periodisch Zinsen zahlt",abs:"Gibt den Absolutwert einer Zahl zurück",sin:"Gibt den Sinus des angegebenen Winkels zurück",cos:"Gibt den Kosinus einer Zahl zurück",tan:"Gibt den Tangens einer Zahl zurück"},validation:{required:"es muss erforderlich sein",notMatch:"es entspricht nicht seinen Validierungsregeln",between:"Es liegt zwischen {} und {}",notBetween:"es liegt nicht zwischen {} und {}",notIn:"es ist nicht in der liste",equal:"es ist gleich {}",notEqual:"es ist nicht gleich {}",lessThan:"es ist kleiner als {}",lessThanEqual:"es ist kleiner oder gleich {}",greaterThan:"es ist größer als {}",greaterThanEqual:"es ist größer oder gleich {}",downloadImageFail:"Bild konnte nicht heruntergeladen werden"},error:{pasteForMergedCell:"Dieser Vorgang kann nicht für verbundene Zellen ausgeführt werden"},calendar:{weeks:["Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag"],months:["Januar, Februar, März, April, Mai, Juni, Juli, August, September, Oktober, November, Dezember"]},button:{add:"ergänzen",del:"löschen",next:"Nächste",cancel:"Stornieren",remove:"entfernen",save:"speichern",ok:"bestätigen",previous:"Vorherige",close:"Schließung"},sort:{desc:"Z->A sortieren",asc:"A->Z sortieren"},filter:{empty:"leer"},dataValidation:{mode:"Modell",range:"Zellbereich",criteria:"Standard",modeType:{cell:"Einzelzelle",column:"Spalte",row:"Linie"},type:{list:"Liste",number:"Ziffer",date:"Datum",phone:"Telefon",email:"Email"},operator:{be:"zwischen",nbe:"nicht zwischen",lt:"weniger als",lte:"Gleich oder kleiner als",gt:"mehr als die",gte:"größer als oder gleich wie",eq:"gleich",neq:"Nicht gleichzusetzen mit"}},dataSort:{ci:"Umfang",criteria:"Befehl",casesense:"Groß- und Kleinschreibung beachten",sortby:"Sortieren nach",header:"Titel",msg:"Bitte wählen Sie eine andere Spalte sortiert nach Feld",msg2:"Der Auswahlbereich hat einen zusammengeführten Bereich, wir unterstützen das Sortieren des zusammengeführten Bereichs nicht",order:{asc:"Positive Folge",desc:"umgekehrte Reihenfolge"}},dataSearch:{label:"Inhalt finden",lkinlb:"Suchbereich",matchwhole:"entspricht dem gesamten Inhalt",lookin:{values:"Text",formulas:"Formel",comments:"Anmerkung"}},dataComment:{label:"Anmerkung"}},nl:{toolbar:{undo:"herroepen",redo:"opnieuw doen",print:"Afdrukken",paintformat:"Formaat schilder",clearformat:"duidelijk formaat",format:"Data formaat",fontName:"lettertype naam",fontSize:"lettertypegrootte",fontBold:"Lettertype vetgedrukt",fontItalic:"lettertype cursief",underline:"onderstrepen",strike:"doorhalen",color:"tekst kleur",bgcolor:"opvulkleur",border:"kader",merge:"Cellen samenvoegen",unmerge:"cellen samenvoegen",align:"Horizontale uitlijning",valign:"verticale uitlijning",textwrap:"woordomslag",freeze:"vaste rangen",autofilter:"filter",formula:"formule",more:"Meer",sort:"Classificatie",download:"downloaden",pagination:"paging",search:"zoekopdracht",commentDefault:"voer a.u.b. tekst in",commentEdit:"opmerkingen bewerken",commentRemove:"opmerking verwijderen",commentPrevious:"Vorige opmerking",commentNext:"volgende opmerking",insertImage:"plaatje invoegen"},menubar:{undo:"ongedaan maken",redo:"opnieuw doen",print:"Afdrukken",paintformat:"Formaat schilder",clearformat:"duidelijk formaat",format:"Data formaat",fontName:"Lettertype naam:",fontSize:"lettertypegrootte:",fontBold:"Lettertype vetgedrukt",fontItalic:"lettertype cursief",underline:"onderstrepen",strike:"doorhalen",color:"tekst kleur",bgcolor:"opvulkleur",border:"kader",merge:"Cellen samenvoegen",unmerge:"cellen samenvoegen",align:"Horizontale uitlijning",valign:"verticale uitlijning",textwrap:"woordomslag",freeze:"vaste rangen",autofilter:"filter",formula:"formule",more:"Meer",sort:"Classificatie",download:"downloaden",download_HTML:"Downloaden als HTML",download_PDF:"Downloaden als PDF",download_Original:"origineel downloaden",download_XLSX:"Downloaden als XLSX",download_GOOGLE:"Opslaan in Google Drive",download_DROPBOX:"Sla op in Dropbox",pagination:"paging",search:"zoekopdracht",commentDefault:"voer a.u.b. tekst in",insertSheet:"werkblad invoegen",insertRow:"rij invoegen",insertColumn:"kolom invoegen",link:"koppeling",insertComment:"Voeg commentaar toe",commentEdit:"opmerkingen bewerken",commentRemove:"opmerking verwijderen",commentPrevious:"Vorige opmerking",commentNext:"volgende opmerking",insertImage:"plaatje invoegen",fromURL:"van URL",fromLocal:"van lokaal",menuInsert:"Optellen bij",menuComment:"Rekening",menuText:"Formaat",menuFont:"lettertype",menuEdit:"voorpagina",menuFile:"document"},contextmenu:{copy:"kopiëren",cut:"snijden",paste:"Plakken",pasteValue:"Plak alleen de waarde",pasteFormat:"Alleen opmaak plakken",hide:"verbergen",insertRow:"rij invoegen",insertColumn:"kolom invoegen",deleteSheet:"blad verwijderen",deleteRow:"Verwijder rij",deleteColumn:"kolom verwijderen",deleteCell:"cel verwijderen",deleteCellText:"celtekst verwijderen",validation:"gegevens verificatie",sort:"Classificatie",link:"koppeling",removeLink:"koppeling verwijderen",editLink:"koppeling bewerken",openLink:"open link",download:"downloaden",cellprintable:"export inschakelen",cellnonprintable:"export uitschakelen",celleditable:"bewerking inschakelen",cellnoneditable:"bewerking uitschakelen",insertURL:"Voer het afbeeldingsadres in",deleteImage:"foto verwijderen",copyImage:"foto kopiëren",pasteImage:"foto plakken",merge:"samenvoegen",unmerge:"ongedaan maken",edit:"bewerking",clear:"wissen"},link:{emailAddress:"E-mailen",emailSubject:"thema",sheetPage:"bestandslocatie",sheetCell:"celverwijzing",linkTypes:{web:"webpagina",sheet:"dit bestand",email:"E-mailen"},webUrl:"url",linkType:"koppelingstype"},download:{fileName:"bestandsnaam",saveType:"Opslaan als",saveTypes:{Original:"origineel formaat",XLSX:"XLSX-formaat",PDF:"PDF-formaat",HTML:"HTML-indeling"}},print:{size:"papiergrootte",orientation:"paginaoriëntatie",orientations:["horizontaal verticaal"]},format:{normal:"normaal",text:"platte tekst",number:"nummer",percent:"percentage",rmb:"RMB",usd:"Dollar",eur:"EUR",date:"datum",time:"tijd",datetime:"datum Tijd",duration:"periode"},formula:{sum:"Berekent de som van een reeks waarden",average:"Berekent het rekenkundig gemiddelde van alle parameters",max:"Berekent de maximale waarde in een reeks cijfers",min:"Berekent de kleinste waarde in een reeks cijfers",_if:"Volgens het logische oordeel is het resultaat van de opgegeven voorwaarde waar of onwaar, retourneert u het berekeningsresultaat dat wordt geactiveerd door de overeenkomstige voorwaarde",and:'Het retourneert alleen logisch "true" als de resultaten van de parameters beide logisch "true" zijn, anders retourneert het logisch "false"',or:'Het resultaat wordt alleen als logisch "false" geretourneerd als alle parameterwaarden logisch "false" zijn, anders wordt het logisch "true" geretourneerd',concat:"Forbind tekst eller data med flere tegn i celler sammen",count:"tæller antallet af celler, der indeholder tal, og tæller tal inden for listen over argumenter",sumif:"Tilføjer de celler, der er specificeret af et givet kriterium",sumifs:"Tilføjer cellerne i et område, der opfylder flere kriterier",vlookup:"Ser i den første kolonne i en matrix og bevæger sig hen over rækken for at returnere værdien af en celle",hlookup:"Søger efter en værdi i den øverste række af en tabel eller en matrix af værdier og returnerer derefter en værdi i den samme kolonne fra en række, du angiver i tabellen eller matrixen.",lookup:"Søger værdier i en vektor eller et array",match:"Søger værdier i en reference eller et array",rank:"Gengiver rangeringen af et tal i en liste over tal",frequency:"Returnerer en frekvensfordeling som en vertikal matrix",text:"Formater et tal og konverterer det til tekst",left:"Returnerer tegnene længst til venstre fra en tekstværdi",right:"Returnerer tegnene længst til højre fra en tekstværdi",round:"Runder et tal til et bestemt antal cifre",index:"Bruger et indeks til at vælge en værdi fra en reference eller et array",countif:"Tæller antallet af celler inden for et område, der opfylder de givne kriterier",countifs:"Tæller antallet af celler inden for et område, der opfylder flere kriterier",mid:"Returnerer et bestemt antal tegn fra en tekststreng, der starter på den position, du angiver",len:"Returnerer antallet af tegn i en tekststreng",power:"Returnerer resultatet af et tal hævet til en potens",ceiling:"Runder et tal til det nærmeste heltal eller til det nærmeste multiplum af betydning",floor:"Runder et tal nedad mod nul",substitute:"Erstatter ny tekst med gammel tekst i en tekststreng",replace:"Erstatter tegn i tekst",search:"Finder en tekstværdi i en anden (ikke skelner mellem store og små bogstaver)",find:"Finder en tekstværdi i en anden (forskel på store og små bogstaver)",isnumber:"Returnerer SAND, hvis værdien er et tal",istext:"Returnerer TRUE, hvis værdien er tekst",isblank:"Returnerer SAND, hvis værdien er tom",upper:"Konverterer tekst til store bogstaver",lower:"Konverterer tekst til små bogstaver",product:"Multiplicerer sine argumenter",sumproduct:"Returnerer summen af produkterne af tilsvarende array-komponenter",subtotal:"Returnerer en subtotal i en liste eller database",counta:"Tæller, hvor mange værdier der er på listen over argumenter",averageif:"Returnerer gennemsnittet (aritmetisk middelværdi) af alle celler i et område, der opfylder et givet kriterium",averageifs:"Returnerer gennemsnittet (aritmetisk middelværdi) af alle celler, der opfylder flere kriterier.",trim:"Fjerner mellemrum fra tekst",sign:"Returnerer tegnet på et tal",yield:"Gengiver afkastet på et værdipapir, der betaler periodisk rente",abs:"Returnerer den absolutte værdi af et tal",sin:"Returnerer sinus for den givne vinkel",cos:"Returnerer cosinus af et tal",tan:"Returnerer tangens af et tal"},validation:{required:"het moet verplicht zijn",notMatch:"het komt niet overeen met de validatieregels",between:"Het is tussen {} en {}",notBetween:"het is niet tussen {} en {}",notIn:"het staat niet in de lijst",equal:"het is gelijk aan {}",notEqual:"het is niet gelijk aan {}",lessThan:"het is minder dan {}",lessThanEqual:"het is kleiner dan of gelijk aan {}",greaterThan:"het is groter dan {}",greaterThanEqual:"het is groter dan of gelijk aan {}",downloadImageFail:"Kan de afbeelding niet downloaden"},error:{pasteForMergedCell:"Kan deze bewerking niet uitvoeren op samengevoegde cellen"},calendar:{weeks:["Zondag maandag dinsdag woensdag donderdag vrijdag zaterdag"],months:["Januari, februari, maart, april, mei, juni, juli, augustus, september, oktober, november, december"]},button:{add:"Optellen bij",del:"verwijderen",next:"Volgende",cancel:"Annuleren",remove:"verwijderen",save:"redden ",ok:"bevestigen",previous:"Vorig",close:"sluiting"},sort:{desc:"Sorteer Z->A",asc:"Sorteer A->Z"},filter:{empty:"leeg"},dataValidation:{mode:"model",range:"cel bereik",criteria:"standaard",modeType:{cell:"eencellig",column:"kolom",row:"lijn"},type:{list:"lijst",number:"cijfer",date:"datum",phone:"Telefoon",email:"e-mailen"},operator:{be:"tussen",nbe:"niet tussen",lt:"minder dan",lte:"minder dan of gelijk aan",gt:"meer dan de",gte:"groter dan of gelijk aan",eq:"gelijkwaardig",neq:"niet gelijk aan"}},dataSort:{ci:"domein",criteria:"volgorde",casesense:"hoofdlettergevoelig",sortby:"sorteer op",header:"titel",msg:"Kies een andere kolom gesorteerd op veld",msg2:"Het selectiegebied heeft een samengevoegd gebied, we ondersteunen het sorteren van het samengevoegde gebied niet",order:{asc:"Positieve volgorde",desc:"omgekeerde volgorde"}},dataSearch:{label:"inhoud vinden",lkinlb:"zoek bereik",matchwhole:"komt overeen met de volledige inhoud",lookin:{values:"tekst",formulas:"formule",comments:"annotatie"}},dataComment:{label:"annotatie"}},zh:{toolbar:{undo:"撤消",redo:"重做",print:"打印",paintformat:"格式刷",clearformat:"清除格式",format:"数据格式",fontName:"字体名称",fontSize:"字体大小",fontBold:"字体粗体",fontItalic:"字体斜体",underline:"下划线",strike:"删除线",color:"文字颜色",bgcolor:"填充颜色",border:"边框",merge:"合并单元格",unmerge:"取消合并单元格",align:"水平对齐",valign:"垂直对齐",textwrap:"文字换行",freeze:"固定行列",autofilter:"过滤器",formula:"公式",more:"更多",sort:"分类",download:"下载",pagination:"分页",search:"搜索",commentDefault:"请输入文字",commentEdit:"编辑批注",commentRemove:"删除批注",commentPrevious:"上一条批注",commentNext:"下一条批注",insertImage:"插入图片"},menubar:{undo:"撤消",redo:"重做",print:"打印",paintformat:"格式刷",clearformat:"清除格式",format:"数据格式",fontName:"字体名称:",fontSize:"字体大小:",fontBold:"字体粗体",fontItalic:"字体斜体",underline:"下划线",strike:"删除线",color:"文字颜色",bgcolor:"填充颜色",border:"边框",merge:"合并单元格",unmerge:"取消合并单元格",align:"水平对齐",valign:"垂直对齐",textwrap:"文字换行",freeze:"固定行列",autofilter:"过滤器",formula:"公式",more:"更多",sort:"分类",download:"下载",download_HTML:"下载为HTML",download_PDF:"下载为PDF",download_Original:"下载原件",download_XLSX:"下载为XLSX",download_GOOGLE:"保存至GoogleDrive",download_DROPBOX:"保存至Dropbox",pagination:"分页",search:"搜索",commentDefault:"请输入文字",insertSheet:"插入工作表",insertRow:"插入行",insertColumn:"插入列",link:"连接",insertComment:"添加批注",commentEdit:"编辑批注",commentRemove:"删除批注",commentPrevious:"上一条批注",commentNext:"下一条批注",insertImage:"插入图片",fromURL:"来自URL",fromLocal:"来自本地",menuInsert:"添加",menuComment:"查看",menuText:"格式",menuFont:"字体",menuEdit:"首页",menuFile:"文件"},contextmenu:{copy:"复制",cut:"剪切",paste:"粘贴",pasteValue:"仅粘贴值",pasteFormat:"仅粘贴格式",hide:"隐藏",insertRow:"插入行",insertColumn:"插入列",deleteSheet:"删去工作表",deleteRow:"删除行",deleteColumn:"删除列",deleteCell:"删除储存格",deleteCellText:"删除储存格文字",validation:"数据验证",sort:"分类",link:"连接",removeLink:"删除连接",editLink:"编辑连接",openLink:"打开连接",download:"下载",cellprintable:"启用导出",cellnonprintable:"禁用导出",celleditable:"启用编辑",cellnoneditable:"禁用编辑",insertURL:"输入图像地址",deleteImage:"删除图片",copyImage:"复制图片",pasteImage:"粘贴图片",merge:"合并",unmerge:"取消合并",edit:"编辑",clear:"清除"},link:{emailAddress:"电子邮箱",emailSubject:"主题",sheetPage:"档案位置",sheetCell:"储存格引用",linkTypes:{web:"网页",sheet:"本档案",email:"电子邮箱"},webUrl:"网址",linkType:"连接类型"},download:{fileName:"文档名称",saveType:"另存为",saveTypes:{Original:"原格式",XLSX:"XLSX格式",PDF:"PDF格式",HTML:"HTML格式"}},print:{size:"纸张大小",orientation:"页面方向",orientations:["横向,纵向"]},format:{normal:"普通",text:"纯文字",number:"数字",percent:"百分比",rmb:"人民币",usd:"美元",eur:"欧元",date:"日期",time:"时间",datetime:"日期时间",duration:"期间"},formula:{sum:"计算一组值的总和",average:"计算所有参数的算术平均值",max:"计算一组数位中的最大值",min:"计算一组数位中的最小值",_if:"根据指定条件的逻辑判断结果的真或假,返回相应条件触发的计算结果",and:"只有当参数的结果都是逻辑“true”时,它才会返回逻辑“true”,否则返回逻辑“false”",or:"只有当所有参数值在逻辑上都为“false”时,结果才返回为逻辑“false”,否则返回为逻辑上的“true”",concat:"将单元格中的多个字符文本或数据连接在一起",count:"计算包含数字的单元格数量,并计算参数列表中的数字",sumif:"添加给定条件指定的单元格",sumifs:"添加满足多个条件的范围内的单元格",vlookup:"查看数组的第一列并跨行移动以返回单元格的值",hlookup:"在表的第一行或值数组中搜索一个值,然后从您在表或数组中指定的行的同一列中返回一个值",lookup:"在向量或数组中查找值",match:"在引用或数组中查找值",rank:"返回一个数字在数字列表中的排名",frequency:"以垂直数组形式返回频率分布",text:"格式化数字并将其转换为文本",left:"返回文本值最左边的字符",right:"返回文本值中最右边的字符",round:"将数字四舍五入到指定位数",index:"使用索引从引用或数组中选择一个值",countif:"计算范围内满足给定条件的单元格数",countifs:"计算范围内满足多个条件的单元格数",mid:"从指定位置开始的文本字符串中返回特定数量的字符",len:"返回文本字符串中的字符数",power:"返回一个数的幂的结果",ceiling:"将数字四舍五入到最接近的整数或最接近的有效倍数",floor:"将数字向下舍入为零",substitute:"用新文本替换文本字符串中的旧文本",replace:"替换文本中的字符",search:"在另一个文本值中查找一个文本值(不区分大小写)",find:"在一个文本值中查找另一个文本值(区分大小写)",isnumber:"如果值为数字则返回 TRUE",istext:"如果值为文本则返回 TRUE",isblank:"如果值为空则返回 TRUE",upper:"将文本转换为大写",lower:"将文本转换为小写",product:"乘以它的论点",sumproduct:"返回对应数组元素的乘积之和",subtotal:"返回列表或数据库中的小计",counta:"计算参数列表中有多少个值",averageif:"返回范围内满足给定条件的所有单元格的平均值(算术平均值)",averageifs:"返回满足多个条件的所有单元格的平均值(算术平均值)。",trim:"从文本中删除空格",sign:"返回数字的符号",yield:"返回支付定期利息的证券的收益率",abs:"返回数字的绝对值",sin:"返回给定角度的正弦值",cos:"返回数字的余弦值",tan:"返回数字的正切"},validation:{required:"它必须是必需的",notMatch:"它与其验证规则不匹配",between:"它介于{}和{}之间",notBetween:"它不在{}和{}之间",notIn:"它不在清单中",equal:"它等于{}",notEqual:"它不等于{}",lessThan:"它小于{}",lessThanEqual:"它小于或等于{}",greaterThan:"它大于{}",greaterThanEqual:"它大于或等于{}",downloadImageFail:"下载图像失败"},error:{pasteForMergedCell:"无法对合并的储存格执行此操作"},calendar:{weeks:["周日、周一、周二、周三、周四、周五、周六"],months:["一月、二月、三月、四月、五月、六月、七月、八月、九月、十月、十一月、十二月"]},button:{add:"添加",del:"删除",next:"下一个",cancel:"取消",remove:"去除",save:"保存",ok:"确认",previous:"前一个",close:"关闭"},sort:{desc:"排序Z->A",asc:"排序A->Z"},filter:{empty:"空的"},dataValidation:{mode:"模式",range:"储存格范围",criteria:"标准",modeType:{cell:"单间牢房",column:"柱",row:"一行"},type:{list:"清单",number:"数位",date:"日期",phone:"电话",email:"电子邮件"},operator:{be:"之间",nbe:"不介于",lt:"少于",lte:"小于或等于",gt:"大于",gte:"大于或等于",eq:"等于",neq:"不等于"}},dataSort:{ci:"范围",criteria:"顺序",casesense:"区分大小写",sortby:"排序依据",header:"标题",msg:"请选择按字段排序的不同列",msg2:"选择区域有合并区域,我们不支持对合并区域进行排序",order:{asc:"正序",desc:"逆序"}},dataSearch:{label:"查找内容",lkinlb:"查找范围",matchwhole:"匹配整个内容",lookin:{values:"文本",formulas:"公式",comments:"批注"}},dataComment:{label:"批注"}},ru:{toolbar:{undo:"отозвать",redo:"переделывать",print:"Распечатать",paintformat:"Формат Painter",clearformat:"чистый формат",format:"Формат данных",fontName:"имя шрифта",fontSize:"размер шрифта",fontBold:"шрифт полужирный",fontItalic:"курсив",underline:"подчеркнуть",strike:"зачеркнутый",color:"цвет текста",bgcolor:"Цвет заливки",border:"рамка",merge:"Объединить ячейки",unmerge:"разъединить ячейки",align:"Горизонтальное выравнивание",valign:"вертикальное выравнивание",textwrap:"перенос слова",freeze:"фиксированные ранги",autofilter:"фильтр",formula:"формула",more:"Более",sort:"Классификация",download:"скачать",pagination:"пейджинг",search:"поиск",commentDefault:"пожалуйста, введите текст",commentEdit:"редактировать комментарии",commentRemove:"удалить комментарий",commentPrevious:"Предыдущий комментарий",commentNext:"следующий комментарий",insertImage:"вставить картинку"},menubar:{undo:"отменить",redo:"переделывать",print:"Распечатать",paintformat:"Формат Painter",clearformat:"чистый формат",format:"Формат данных",fontName:"Название шрифта:",fontSize:"размер шрифта:",fontBold:"шрифт полужирный",fontItalic:"курсив",underline:"подчеркнуть",strike:"зачеркнутый",color:"цвет текста",bgcolor:"Цвет заливки",border:"рамка",merge:"Объединить ячейки",unmerge:"разъединить ячейки",align:"Горизонтальное выравнивание",valign:"вертикальное выравнивание",textwrap:"перенос слова",freeze:"фиксированные ранги",autofilter:"фильтр",formula:"формула",more:"Более",sort:"Классификация",download:"скачать",download_HTML:"Скачать как HTML",download_PDF:"Скачать в формате PDF",download_Original:"скачать оригинал",download_XLSX:"Скачать как XLSX",download_GOOGLE:"Сохранить на Google Диск",download_DROPBOX:"Сохранить в Dropbox",pagination:"пейджинг",search:"поиск",commentDefault:"пожалуйста, введите текст",insertSheet:"вставить рабочий лист",insertRow:"вставить строку",insertColumn:"вставить столбец",link:"связь",insertComment:"добавить комментарий",commentEdit:"редактировать комментарии",commentRemove:"удалить комментарий",commentPrevious:"Предыдущий комментарий",commentNext:"следующий комментарий",insertImage:"вставить картинку",fromURL:"из URL",fromLocal:"от местного",menuInsert:"добавить в",menuComment:"Проверять",menuText:"Формат",menuFont:"шрифт",menuEdit:"титульная страница",menuFile:"документ"},contextmenu:{copy:"копировать",cut:"вырезать",paste:"вставить",pasteValue:"Вставьте только значение",pasteFormat:"Вставить только форматирование",hide:"скрывать",insertRow:"вставить строку",insertColumn:"вставить столбец",deleteSheet:"удалить лист",deleteRow:"удалить строку",deleteColumn:"удалить столбец",deleteCell:"удалить ячейку",deleteCellText:"удалить текст ячейки",validation:"проверка данных",sort:"Классификация",link:"связь",removeLink:"удалить ссылку",editLink:"изменить ссылку",openLink:"открыть ссылку",download:"скачать",cellprintable:"включить экспорт",cellnonprintable:"отключить экспорт",celleditable:"разрешить редактирование",cellnoneditable:"отключить редактирование",insertURL:"Введите адрес изображения",deleteImage:"удалить картинку",copyImage:"копировать картинку",pasteImage:"вставить картинку",merge:"сливаться",unmerge:"разъединять",edit:"редактировать",clear:"очистить"},link:{emailAddress:"Электронная почта",emailSubject:"тема",sheetPage:"местоположение файла",sheetCell:"ссылка на ячейку",linkTypes:{web:"веб-страница",sheet:"этот файл",email:"Электронная почта"},webUrl:"URL",linkType:"тип ссылки"},download:{fileName:"имя файла",saveType:"Сохранить как",saveTypes:{Original:"исходный формат",XLSX:"XLSX-формат",PDF:"PDF-формат",HTML:"HTML-формат"}},print:{size:"размер бумаги",orientation:"ориентация страницы",orientations:["горизонтальная вертикальная"]},format:{normal:"обычный",text:"простой текст",number:"число",percent:"процент",rmb:"юаней",usd:"доллар",eur:"евро",date:"дата",time:"время",datetime:"дата время",duration:"период"},formula:{sum:"Вычисляет сумму набора значений",average:"Вычисляет среднее арифметическое всех параметров",max:"Вычисляет максимальное значение в наборе цифр",min:"Вычисляет наименьшее значение в наборе цифр",_if:"Согласно логическому заключению, результат указанного условия является истинным или ложным, вернуть результат вычисления, вызванный соответствующим условием.",and:"Он возвращает логическое «истина» только в том случае, если результаты обоих параметров являются логическими «истинами», в противном случае он возвращает логическое «ложь».",or:"Результат возвращается как логическое «ложь», только если все значения параметров являются логически «ложными», в противном случае возвращается логическое «истина».",concat:"Conecte vários caracteres de texto ou dados em células juntos",count:"conta o número de células que contêm números e conta os números dentro da lista de argumentos",sumif:"Adiciona as células especificadas por um determinado critério",sumifs:"Adiciona as células em um intervalo que atendem a vários critérios",vlookup:"Olha na primeira coluna de uma matriz e move-se pela linha para retornar o valor de uma célula",hlookup:"Procura um valor na linha superior de uma tabela ou uma matriz de valores e, em seguida, retorna um valor na mesma coluna de uma linha especificada na tabela ou matriz.",lookup:"Procura valores em um vetor ou array",match:"Procura valores em uma referência ou array",rank:"Retorna a classificação de um número em uma lista de números",frequency:"Retorna uma distribuição de frequência como uma matriz vertical",text:"Formata um número e o converte em texto",left:"Retorna os caracteres mais à esquerda de um valor de texto",right:"Retorna os caracteres mais à direita de um valor de texto",round:"Arredonda um número para um número especificado de dígitos",index:"Usa um índice para escolher um valor de uma referência ou array",countif:"Conta o número de células dentro de um intervalo que atendem aos critérios fornecidos",countifs:"Conta o número de células dentro de um intervalo que atendem a vários critérios",mid:"Retorna um número específico de caracteres de uma string de texto começando na posição que você especificar",len:"Retorna o número de caracteres em uma string de texto",power:"Retorna o resultado de um número elevado a uma potência",ceiling:"Arredonda um número para o inteiro mais próximo ou para o múltiplo de significância mais próximo",floor:"Arredonda um número para baixo, para zero",substitute:"Substitui o novo texto pelo texto antigo em uma string de texto",replace:"Substitui caracteres no texto",search:"Encontra um valor de texto dentro de outro (sem distinção entre maiúsculas e minúsculas)",find:"Encontra um valor de texto dentro de outro (diferencia maiúsculas de minúsculas)",isnumber:"Retorna TRUE se o valor for um número",istext:"Retorna TRUE se o valor for texto",isblank:"Retorna TRUE se o valor estiver em branco",upper:"Converte o texto em letras maiúsculas",lower:"Converte o texto em minúsculas",product:"Multiplica seus argumentos",sumproduct:"Retorna a soma dos produtos dos componentes do array correspondente",subtotal:"Retorna um subtotal em uma lista ou banco de dados",counta:"Conta quantos valores estão na lista de argumentos",averageif:"Retorna a média (média aritmética) de todas as células em um intervalo que atendem a um determinado critério",averageifs:"Retorna a média (média aritmética) de todas as células que atendem a vários critérios.",trim:"Remove espaços do texto",sign:"Retorna o sinal de um número",yield:"Retorna o rendimento de um título que paga juros periódicos",abs:"Retorna o valor absoluto de um número",sin:"Retorna o seno do ângulo dado",cos:"Retorna o cosseno de um número",tan:"Retorna a tangente de um número"},validation:{required:"это должно быть необходимо",notMatch:"это не соответствует его правилам проверки",between:"Это между {} и {}",notBetween:"это не между {} и {}",notIn:"его нет в списке",equal:"он равен {}",notEqual:"это не равно {}",lessThan:"это меньше, чем {}",lessThanEqual:"меньше или равно {}",greaterThan:"это больше, чем {}",greaterThanEqual:"это больше или равно {}",downloadImageFail:"Не удалось загрузить изображение"},error:{pasteForMergedCell:"Невозможно выполнить эту операцию с объединенными ячейками"},calendar:{weeks:["Воскресенье понедельник вторник среда четверг пятница суббота"],months:["Январь, февраль, март, апрель, май, июнь, июль, август, сентябрь, октябрь, ноябрь, декабрь"]},button:{add:"добавить в",del:"удалить",next:"Следующий",cancel:"Отмена",remove:"удалять",save:"сохранять",ok:"подтверждать",previous:"Предыдущий",close:"закрытие"},sort:{desc:"Сортировать Я->А",asc:"Сортировать А->Я"},filter:{empty:"пустой"},dataValidation:{mode:"модель",range:"диапазон ячеек",criteria:"стандартный",modeType:{cell:"одна ячейка",column:"столбец",row:"линия"},type:{list:"список",number:"цифра",date:"дата",phone:"телефон",email:"электронная почта"},operator:{be:"между",nbe:"не между",lt:"меньше, чем",lte:"меньше или равно",gt:"больше, чем",gte:"больше или равно",eq:"равный",neq:"не равно"}},dataSort:{ci:"объем",criteria:"заказ",casesense:"с учетом регистра",sortby:"Сортировать по",header:"заголовок",msg:"Пожалуйста, выберите другой столбец, отсортированный по полю",msg2:"Область выбора имеет объединенную область, мы не поддерживаем сортировку объединенной области",order:{asc:"Положительная последовательность",desc:"обратный порядок"}},dataSearch:{label:"найти контент",lkinlb:"диапазон поиска",matchwhole:"соответствует всему содержимому",lookin:{values:"текст",formulas:"формула",comments:"аннотация"}},dataComment:{label:"аннотация"}},es:{toolbar:{undo:"revocar",redo:"rehacer",print:"Imprimir",paintformat:"Copiar formato",clearformat:"formato claro",format:"Formato de datos",fontName:"nombre de la fuente",fontSize:"tamaño de fuente",fontBold:"negrita",fontItalic:"letra cursiva",underline:"subrayar",strike:"tachado",color:"color de texto",bgcolor:"color de relleno",border:"marco",merge:"Combinar células",unmerge:"separar celdas",align:"Alineación horizontal",valign:"alineamiento vertical",textwrap:"ajuste de línea",freeze:"rangos fijos",autofilter:"filtrar",formula:"fórmula",more:"Más",sort:"Clasificación",download:"descargar",pagination:"paginación",search:"buscar",commentDefault:"por favor ingrese texto",commentEdit:"editar comentarios",commentRemove:"Eliminar comentario",commentPrevious:"comentario anterior",commentNext:"siguiente comentario",insertImage:"Insertar imagen"},menubar:{undo:"deshacer",redo:"rehacer",print:"Imprimir",paintformat:"Copiar formato",clearformat:"formato claro",format:"Formato de datos",fontName:"Nombre de la fuente:",fontSize:"tamaño de fuente:",fontBold:"negrita",fontItalic:"letra cursiva",underline:"subrayar",strike:"tachado",color:"color de texto",bgcolor:"color de relleno",border:"marco",merge:"Combinar células",unmerge:"separar celdas",align:"Alineación horizontal",valign:"alineamiento vertical",textwrap:"ajuste de línea",freeze:"rangos fijos",autofilter:"filtrar",formula:"fórmula",more:"Más",sort:"Clasificación",download:"Descargar",download_HTML:"Descargar como HTML",download_PDF:"Descargar como PDF",download_Original:"Descargar originales",download_XLSX:"Descargar como XLSX",download_GOOGLE:"Guardar en Google Drive",download_DROPBOX:"Guardar en dropbox",pagination:"paginación",search:"buscar",commentDefault:"por favor ingrese texto",insertSheet:"insertar hoja de trabajo",insertRow:"insertar fila",insertColumn:"insertar columna",link:"enlace",insertComment:"agregar comentario",commentEdit:"editar comentarios",commentRemove:"Eliminar comentario",commentPrevious:"comentario anterior",commentNext:"siguiente comentario",insertImage:"Insertar imagen",fromURL:"de URL",fromLocal:"del local",menuInsert:"añadir",menuComment:"Controlar",menuText:"Formato",menuFont:"fuente",menuEdit:"página delantera",menuFile:"documento"},contextmenu:{copy:"Copiar",cut:"cortar",paste:"pegar",pasteValue:"Pegar solo el valor",pasteFormat:"Pegar solo formato",hide:"esconder",insertRow:"insertar fila",insertColumn:"insertar columna",deleteSheet:"borrar hoja",deleteRow:"borrar fila",deleteColumn:"eliminar columna",deleteCell:"borrar celda",deleteCellText:"eliminar texto de celda",validation:"verificación de datos",sort:"Clasificación",link:"enlace",removeLink:"eliminar enlace",editLink:"editar enlace",openLink:"enlace abierto",download:"descargar",cellprintable:"habilitar exportar",cellnonprintable:"deshabilitar la exportación",celleditable:"permitir la edición",cellnoneditable:"deshabilitar la edición",insertURL:"Ingrese la dirección de la imagen",deleteImage:"borrar imagen",copyImage:"copiar foto",pasteImage:"pegar foto",merge:"unir",unmerge:"desunir",edit:"editar",clear:"limpiar"},link:{emailAddress:"Correo electrónico",emailSubject:"tema",sheetPage:"ubicación del archivo",sheetCell:"referencia de celda",linkTypes:{web:"Página web",sheet:"Este archivo",email:"Correo electrónico"},webUrl:"URL",linkType:"Tipo de enlace"},download:{fileName:"Nombre del archivo",saveType:"Guardar como",saveTypes:{Original:"formato original",XLSX:"formato XLSX",PDF:"formato PDF",HTML:"formato HTML"}},print:{size:"Tamaño de papel",orientation:"orientación de la página",orientations:["horizontal Vertical"]},format:{normal:"común",text:"Texto sin formato",number:"número",percent:"porcentaje",rmb:"RMB",usd:"Dólar",eur:"EUR",date:"fecha",time:"tiempo",datetime:"fecha y hora",duration:"período"},formula:{sum:"Calcula la suma de un conjunto de valores",average:"Calcula la media aritmética de todos los parámetros",max:"Calcula el valor máximo en un conjunto de dígitos",min:"Calcula el valor más pequeño en un conjunto de dígitos",_if:"Según el resultado del juicio lógico de la condición especificada es verdadero o falso, devuelva el resultado del cálculo desencadenado por la condición correspondiente",and:'Devuelve "verdadero" lógico solo si los resultados de los parámetros son ambos "verdaderos" lógicos; de lo contrario, devuelve "falso" lógico',or:'El resultado se devuelve como lógico "falso" solo si todos los valores de los parámetros son lógicamente "falsos", de lo contrario, devuelve lógicamente "verdadero".',concat:"Conectar texto de varios caracteres o datos en celdas juntos",count:"cuenta el número de celdas que contienen números y cuenta los números dentro de la lista de argumentos",sumif:"Agrega las celdas especificadas por un criterio dado",sumifs:"Agrega las celdas en un rango que cumple con múltiples criterios",vlookup:"Busca en la primera columna de una matriz y se mueve por la fila para devolver el valor de una celda",hlookup:"Busca un valor en la fila superior de una tabla o una matriz de valores, y luego devuelve un valor en la misma columna de una fila que especifique en la tabla o matriz.",lookup:"Busca valores en un vector o matriz",match:"Busca valores en una referencia o matriz",rank:"Devuelve el rango de un número en una lista de números",frequency:"Devuelve una distribución de frecuencias como una matriz vertical",text:"Dar formato a un número y convertirlo en texto",left:"Devuelve los caracteres más a la izquierda de un valor de texto",right:"Devuelve los caracteres más a la derecha de un valor de texto",round:"Redondea un número a un número específico de dígitos",index:"Usa un índice para elegir un valor de una referencia o matriz",countif:"Cuenta el número de celdas dentro de un rango que cumple con los criterios dados",countifs:"Cuenta el número de celdas dentro de un rango que cumplen múltiples criterios",mid:"Devuelve un número específico de caracteres de una cadena de texto que comienza en la posición que especifique",len:"Devuelve el número de caracteres en una cadena de texto",power:"Devuelve el resultado de un número elevado a una potencia",ceiling:"Redondea un número al entero más cercano o al múltiplo significativo más cercano",floor:"Redondea un número hacia abajo, hacia cero",substitute:"Sustituye texto nuevo por texto antiguo en una cadena de texto",replace:"Reemplaza caracteres dentro del texto",search:"Encuentra un valor de texto dentro de otro (no distingue entre mayúsculas y minúsculas)",find:"Encuentra un valor de texto dentro de otro (distingue entre mayúsculas y minúsculas)",isnumber:"Devuelve VERDADERO si el valor es un número",istext:"Devuelve VERDADERO si el valor es texto",isblank:"Devuelve VERDADERO si el valor está en blanco",upper:"Convierte texto a mayúsculas",lower:"Convierte texto a minúsculas",product:"Multiplica sus argumentos",sumproduct:"Devuelve la suma de los productos de los componentes de matriz correspondientes",subtotal:"Devuelve un subtotal en una lista o base de datos",counta:"Cuenta cuántos valores hay en la lista de argumentos",averageif:"Devuelve el promedio (media aritmética) de todas las celdas en un rango que cumplen con un criterio dado",averageifs:"Devuelve el promedio (media aritmética) de todas las celdas que cumplen varios criterios.",trim:"Quita espacios del texto",sign:"Devuelve el signo de un número",yield:"Devuelve el rendimiento de un valor que paga intereses periódicos",abs:"Devuelve el valor absoluto de un número",sin:"Devuelve el seno del ángulo dado",cos:"Devuelve el coseno de un número",tan:"Devuelve la tangente de un número"},validation:{required:"debe ser requerido",notMatch:"no coincide con sus reglas de validación",between:"Está entre {} y {}",notBetween:"no está entre {} y {}",notIn:"no esta en la lista",equal:"es igual a {}",notEqual:"no es igual a {}",lessThan:"es menos que {}",lessThanEqual:"es menor o igual que {}",greaterThan:"es mayor que {}",greaterThanEqual:"es mayor o igual que {}",downloadImageFail:"Error al descargar la imagen"},error:{pasteForMergedCell:"No se puede realizar esta operación en celdas combinadas"},calendar:{weeks:["Domingo Lunes Martes Miércoles Jueves Viernes Sábado"],months:["Enero, febrero, marzo, abril, mayo, junio, julio, agosto, septiembre, octubre, noviembre, diciembre"]},button:{add:"añadir",del:"borrar",next:"Próximo",cancel:"Cancelar",remove:"eliminar",save:"ahorrar",ok:"confirmar",previous:"Anterior",close:"cierre"},sort:{desc:"Ordenar Z->A",asc:"Ordenar A->Z"},filter:{empty:"vacío"},dataValidation:{mode:"modelo",range:"rango de celdas",criteria:"estándar",modeType:{cell:"unicelular",column:"columna",row:"línea"},type:{list:"lista",number:"dígito",date:"fecha",phone:"Teléfono",email:"correo electrónico"},operator:{be:"entre",nbe:"no entre",lt:"menos que",lte:"Menos que o igual a",gt:"más que el",gte:"Mayor qué o igual a",eq:"igual",neq:"no igual a"}},dataSort:{ci:"alcance",criteria:"orden",casesense:"distingue mayúsculas y minúsculas",sortby:"Ordenar por",header:"título",msg:"Elija una columna diferente ordenada por campo",msg2:"El área de selección tiene un área fusionada, no admitimos ordenar el área fusionada",order:{asc:"secuencia positiva",desc:"orden inverso"}},dataSearch:{label:"encontrar contenido",lkinlb:"rango de búsqueda",matchwhole:"coincide con todo el contenido",lookin:{values:"texto",formulas:"fórmula",comments:"anotación"}},dataComment:{label:"anotación"}},pt:{toolbar:{undo:"revogar",redo:"refazer",print:"Imprimir",paintformat:"Pincel de Formatação",clearformat:"formato claro",format:"Formato de dados",fontName:"nome da fonte",fontSize:"tamanho da fonte",fontBold:"Negrito",fontItalic:"fonte em itálico",underline:"sublinhado",strike:"tachado",color:"cor do texto",bgcolor:"cor de preenchimento",border:"quadro",merge:"Mesclar Células",unmerge:"unmerge células",align:"Alinhamento horizontal",valign:"Alinhamento vertical",textwrap:"quebra de linha",freeze:"fileiras fixas",autofilter:"filtro",formula:"Fórmula",more:"Mais",sort:"Classificação",download:"download",pagination:"paginação",search:"procurar",commentDefault:"por favor digite o texto",commentEdit:"editar comentários",commentRemove:"excluir comentário",commentPrevious:"comentário anterior",commentNext:"próximo comentário",insertImage:"inserir imagem"},menubar:{undo:"desfazer",redo:"refazer",print:"Imprimir",paintformat:"Pincel de Formatação",clearformat:"formato claro",format:"Formato de dados",fontName:"Nome da fonte:",fontSize:"tamanho da fonte:",fontBold:"Negrito",fontItalic:"fonte em itálico",underline:"sublinhado",strike:"tachado",color:"cor do texto",bgcolor:"cor de preenchimento",border:"quadro",merge:"Mesclar Células",unmerge:"unmerge células",align:"Alinhamento horizontal",valign:"Alinhamento vertical",textwrap:"quebra de linha",freeze:"fileiras fixas",autofilter:"filtro",formula:"Fórmula",more:"Mais",sort:"Classificação",download:"download",download_HTML:"Baixar como HTML",download_PDF:"Baixar como PDF",download_Original:"baixar original",download_XLSX:"Baixar como XLSX",download_GOOGLE:"Salvar no Google Drive",download_DROPBOX:"Salvar no Dropbox",pagination:"paginação",search:"procurar",commentDefault:"por favor digite o texto",insertSheet:"inserir planilha",insertRow:"inserir linha",insertColumn:"inserir coluna",link:"link",insertComment:"adicionar comentário",commentEdit:"editar comentários",commentRemove:"excluir comentário",commentPrevious:"comentário anterior",commentNext:"próximo comentário",insertImage:"inserir imagem",fromURL:"da URL",fromLocal:"do local",menuInsert:"adicionar à",menuComment:"Verificar",menuText:"Formatar",menuFont:"Fonte",menuEdit:"primeira página",menuFile:"documento"},contextmenu:{copy:"cópia de",cut:"cortar",paste:"colar",pasteValue:"Cole apenas o valor",pasteFormat:"Colar apenas a formatação",hide:"esconder",insertRow:"inserir linha",insertColumn:"inserir coluna",deleteSheet:"excluir folha",deleteRow:"excluir linha",deleteColumn:"excluir coluna",deleteCell:"excluir célula",deleteCellText:"excluir texto da célula",validation:"verificação de dados",sort:"Classificação",link:"link",removeLink:"excluir link",editLink:"editar link",openLink:"link aberto",download:"download",cellprintable:"habilitar exportação",cellnonprintable:"desabilitar exportação",celleditable:"habilitar a edição",cellnoneditable:"desabilitar a edição",insertURL:"Insira o endereço da imagem",deleteImage:"deletar foto",copyImage:"copiar foto",pasteImage:"colar foto",merge:"fundir",unmerge:"desagregar",edit:"editar",clear:"limpar"},link:{emailAddress:"E-mail",emailSubject:"tema",sheetPage:"localização de arquivo",sheetCell:"referência de célula",linkTypes:{web:"página da Internet",sheet:"este ficheiro",email:"E-mail"},webUrl:"url",linkType:"tipo de link"},download:{fileName:"nome do arquivo",saveType:"Salvar como",saveTypes:{Original:"formato original",XLSX:"Formato XLSX",PDF:"formato PDF",HTML:"formato HTML"}},print:{size:"Tamanho do papel",orientation:"orientação da página",orientations:["horizontal vertical"]},format:{normal:"ordinário",text:"texto simples",number:"número",percent:"percentagem",rmb:"RMB",usd:"Dólar",eur:"EUR",date:"data",time:"tempo",datetime:"data hora",duration:"período"},formula:{sum:"Calcula a soma de um conjunto de valores",average:"Calcula a média aritmética de todos os parâmetros",max:"Calcula o valor máximo em um conjunto de dígitos",min:"Calcula o menor valor em um conjunto de dígitos",_if:"De acordo com o resultado do julgamento lógico da condição especificada é verdadeiro ou falso, retorne o resultado do cálculo acionado pela condição correspondente",and:'Ele retorna "verdadeiro" lógico somente se os resultados dos parâmetros forem "verdadeiros" lógicos, caso contrário, ele retorna "falso" lógico',or:'O resultado é retornado como lógico "falso" somente se todos os valores dos parâmetros forem logicamente "falsos", caso contrário, ele retorna logicamente "verdadeiro"',concat:"Conecte vários caracteres de texto ou dados em células juntos",count:"conta o número de células que contêm números e conta os números dentro da lista de argumentos",sumif:"Adiciona as células especificadas por um determinado critério",sumifs:"Adiciona as células em um intervalo que atendem a vários critérios",vlookup:"Olha na primeira coluna de uma matriz e move-se pela linha para retornar o valor de uma célula",hlookup:"Procura um valor na linha superior de uma tabela ou uma matriz de valores e, em seguida, retorna um valor na mesma coluna de uma linha especificada na tabela ou matriz.",lookup:"Procura valores em um vetor ou array",match:"Procura valores em uma referência ou array",rank:"Retorna a classificação de um número em uma lista de números",frequency:"Retorna uma distribuição de frequência como uma matriz vertical",text:"Formata um número e o converte em texto",left:"Retorna os caracteres mais à esquerda de um valor de texto",right:"Retorna os caracteres mais à direita de um valor de texto",round:"Arredonda um número para um número especificado de dígitos",index:"Usa um índice para escolher um valor de uma referência ou array",countif:"Conta o número de células dentro de um intervalo que atendem aos critérios fornecidos",countifs:"Conta o número de células dentro de um intervalo que atendem a vários critérios",mid:"Retorna um número específico de caracteres de uma string de texto começando na posição que você especificar",len:"Retorna o número de caracteres em uma string de texto",power:"Retorna o resultado de um número elevado a uma potência",ceiling:"Arredonda um número para o inteiro mais próximo ou para o múltiplo de significância mais próximo",floor:"Arredonda um número para baixo, para zero",substitute:"Substitui o novo texto pelo texto antigo em uma string de texto",replace:"Substitui caracteres no texto",search:"Encontra um valor de texto dentro de outro (sem distinção entre maiúsculas e minúsculas)",find:"Encontra um valor de texto dentro de outro (diferencia maiúsculas de minúsculas)",isnumber:"Retorna TRUE se o valor for um número",istext:"Retorna TRUE se o valor for texto",isblank:"Retorna TRUE se o valor estiver em branco",upper:"Converte o texto em letras maiúsculas",lower:"Converte o texto em minúsculas",product:"Multiplica seus argumentos",sumproduct:"Retorna a soma dos produtos dos componentes do array correspondente",subtotal:"Retorna um subtotal em uma lista ou banco de dados",counta:"Conta quantos valores estão na lista de argumentos",averageif:"Retorna a média (média aritmética) de todas as células em um intervalo que atendem a um determinado critério",averageifs:"Retorna a média (média aritmética) de todas as células que atendem a vários critérios.",trim:"Remove espaços do texto",sign:"Retorna o sinal de um número",yield:"Retorna o rendimento de um título que paga juros periódicos",abs:"Retorna o valor absoluto de um número",sin:"Retorna o seno do ângulo dado",cos:"Retorna o cosseno de um número",tan:"Retorna a tangente de um número"},validation:{required:"deve ser exigido",notMatch:"não corresponde às suas regras de validação",between:"Está entre {} e {}",notBetween:"não está entre {} e {}",notIn:"não está na lista",equal:"é igual a {}",notEqual:"não é igual a {}",lessThan:"é menor que {}",lessThanEqual:"é menor ou igual a {}",greaterThan:"é maior que {}",greaterThanEqual:"é maior ou igual a {}",downloadImageFail:"Falha ao baixar a imagem"},error:{pasteForMergedCell:"Não é possível executar esta operação em células mescladas"},calendar:{weeks:["Domingo segunda terça quarta quinta sexta sábado"],months:["janeiro, fevereiro, março, abril, maio, junho, julho, agosto, setembro, outubro, novembro, dezembro"]},button:{add:"adicionar à",del:"excluir",next:"Próximo",cancel:"Cancelar",remove:"remover",save:"salvar",ok:"confirme",previous:"Anterior",close:"fecho"},sort:{desc:"Ordenar Z->A",asc:"Ordenar A->Z"},filter:{empty:"vazio"},dataValidation:{mode:"modelo",range:"intervalo de células",criteria:"padrão",modeType:{cell:"célula única",column:"coluna",row:"linha"},type:{list:"lista",number:"dígito",date:"data",phone:"Telefone",email:"e-mail"},operator:{be:"entre",nbe:"não entre",lt:"menor que",lte:"menos que ou igual a",gt:"mais do que o",gte:"Melhor que ou igual a",eq:"igual",neq:"não igual a"}},dataSort:{ci:"escopo",criteria:"ordem",casesense:"maiúsculas e minúsculas",sortby:"ordenar por",header:"título",msg:"Escolha uma coluna diferente classificada por campo",msg2:"A área de seleção tem uma área mesclada, não oferecemos suporte para classificação da área mesclada",order:{asc:"sequência positiva",desc:"ordem reversa"}},dataSearch:{label:"encontrar conteúdo",lkinlb:"intervalo de pesquisa",matchwhole:"corresponde a todo o conteúdo",lookin:{values:"texto",formulas:"Fórmula",comments:"anotação"}},dataComment:{label:"anotação"}},id:{toolbar:{undo:"menarik kembali",redo:"mengulangi",print:"Mencetak",paintformat:"Pelukis Format",clearformat:"format yang jelas",format:"Format data",fontName:"nama font",fontSize:"ukuran huruf",fontBold:"huruf tebal",fontItalic:"huruf miring",underline:"menggarisbawahi",strike:"dicoret",color:"warna teks",bgcolor:"mengisi warna",border:"bingkai",merge:"Menggabungkan Sel",unmerge:"memisahkan sel",align:"Penjajaran horizontal",valign:"penjajaran vertikal",textwrap:"bungkus kata",freeze:"peringkat tetap",autofilter:"Saring",formula:"rumus",more:"Lagi",sort:"Klasifikasi",download:"unduh",pagination:"paging",search:"mencari",commentDefault:"harap masukkan teks",commentEdit:"mengedit komentar",commentRemove:"hapus komentar",commentPrevious:"Komentar sebelumnya",commentNext:"komentar berikutnya",insertImage:"menyisipkan gambar"},menubar:{undo:"membuka",redo:"mengulangi",print:"Mencetak",paintformat:"Pelukis Format",clearformat:"format yang jelas",format:"Format data",fontName:"Nama font:",fontSize:"ukuran huruf:",fontBold:"huruf tebal",fontItalic:"huruf miring",underline:"menggarisbawahi",strike:"dicoret",color:"warna teks",bgcolor:"mengisi warna",border:"bingkai",merge:"Menggabungkan Sel",unmerge:"memisahkan sel",align:"Penjajaran horizontal",valign:"penjajaran vertikal",textwrap:"bungkus kata",freeze:"peringkat tetap",autofilter:"Saring",formula:"rumus",more:"Lagi",sort:"Klasifikasi",download:"unduh",download_HTML:"Unduh sebagai HTML",download_PDF:"Unduh sebagai PDF",download_Original:"unduh asli",download_XLSX:"Unduh sebagai XLSX",download_GOOGLE:"Simpan ke Google Drive",download_DROPBOX:"Simpan ke Dropbox",pagination:"paging",search:"mencari",commentDefault:"harap masukkan teks",insertSheet:"menyisipkan lembar kerja",insertRow:"sisipkan baris",insertColumn:"sisipkan kolom",link:"tautan",insertComment:"Tambahkan komentar",commentEdit:"mengedit komentar",commentRemove:"hapus komentar",commentPrevious:"Komentar sebelumnya",commentNext:"komentar berikutnya",insertImage:"menyisipkan gambar",fromURL:"dari URL",fromLocal:"dari lokal",menuInsert:"Tambahkan",menuComment:"Memeriksa",menuText:"Format",menuFont:"font",menuEdit:"halaman Depan",menuFile:"dokumen"},contextmenu:{copy:"menyalin",cut:"untuk memotong",paste:"tempel",pasteValue:"Tempelkan hanya nilainya",pasteFormat:"Hanya tempel pemformatan",hide:"bersembunyi",insertRow:"sisipkan baris",insertColumn:"sisipkan kolom",deleteSheet:"hapus lembar",deleteRow:"hapus baris",deleteColumn:"hapus kolom",deleteCell:"hapus sel",deleteCellText:"menghapus teks sel",validation:"verifikasi data",sort:"Klasifikasi",link:"tautan",removeLink:"hapus tautan",editLink:"tautan edit",openLink:"Buka tautan",download:"unduh",cellprintable:"mengaktifkan ekspor",cellnonprintable:"nonaktifkan ekspor",celleditable:"aktifkan pengeditan",cellnoneditable:"nonaktifkan pengeditan",insertURL:"Masukkan alamat gambar",deleteImage:"hapus gambar",copyImage:"menyalin gambar",pasteImage:"tempel gambar",merge:"menggabungkan",unmerge:"pisahkan",edit:"sunting",clear:"untuk membersihkan"},link:{emailAddress:"Surel",emailSubject:"tema",sheetPage:"lokasi file",sheetCell:"referensi sel",linkTypes:{web:"halaman web",sheet:"file ini",email:"Surel"},webUrl:"url",linkType:"jenis tautan"},download:{fileName:"nama file",saveType:"Simpan sebagai",saveTypes:{Original:"format asli",XLSX:"berformat XLSX",PDF:"format PDF",HTML:"format HTML"}},print:{size:"ukuran kertas",orientation:"orientasi halaman",orientations:["horisontal vertikal"]},format:{normal:"biasa",text:"teks biasa",number:"nomor",percent:"persentase",rmb:"RMB",usd:"Dolar",eur:"EUR",date:"tanggal",time:"waktu",datetime:"tanggal Waktu",duration:"periode"},formula:{sum:"Menghitung jumlah dari sekumpulan nilai",average:"Menghitung rata-rata aritmatika dari semua parameter",max:"Menghitung nilai maksimum dalam satu set digit",min:"Menghitung nilai terkecil dalam satu set digit",_if:"Menurut hasil penilaian logis dari kondisi yang ditentukan benar atau salah, kembalikan hasil perhitungan yang dipicu oleh kondisi yang sesuai",and:'Ini mengembalikan logika "benar" hanya jika hasil dari parameter keduanya logis "benar", jika tidak maka mengembalikan logika "salah"',or:'Hasilnya dikembalikan sebagai logis "salah" hanya jika semua nilai parameter secara logis "salah", jika tidak, hasilnya secara logis "benar"',concat:"Hubungkan beberapa karakter teks atau data dalam sel bersama-sama",count:"menghitung jumlah sel yang berisi angka, dan menghitung angka dalam daftar argumen",sumif:"Menambahkan sel yang ditentukan oleh kriteria tertentu",sumifs:"Menambahkan sel dalam rentang yang memenuhi beberapa kriteria",vlookup:"Tampak di kolom pertama larik dan bergerak melintasi baris untuk mengembalikan nilai sel",hlookup:"Mencari nilai di baris atas tabel atau larik nilai, lalu mengembalikan nilai di kolom yang sama dari baris yang Anda tentukan di tabel atau larik.",lookup:"Mencari nilai dalam vektor atau larik",match:"Mencari nilai dalam referensi atau larik",rank:"Mengembalikan peringkat nomor dalam daftar nomor",frequency:"Mengembalikan distribusi frekuensi sebagai larik vertikal",text:"Memformat angka dan mengubahnya menjadi teks",left:"Mengembalikan karakter paling kiri dari nilai teks",right:"Mengembalikan karakter paling kanan dari nilai teks",round:"Membulatkan angka ke jumlah digit yang ditentukan",index:"Menggunakan indeks untuk memilih nilai dari referensi atau larik",countif:"Menghitung jumlah sel dalam rentang yang memenuhi kriteria yang diberikan",countifs:"Menghitung jumlah sel dalam rentang yang memenuhi beberapa kriteria",mid:"Mengembalikan sejumlah karakter tertentu dari string teks mulai dari posisi yang Anda tentukan",len:"Mengembalikan jumlah karakter dalam string teks",power:"Mengembalikan hasil angka yang dipangkatkan",ceiling:"Membulatkan angka ke bilangan bulat terdekat atau ke kelipatan signifikansi terdekat",floor:"Membulatkan angka ke bawah, menuju nol",substitute:"Mengganti teks baru dengan teks lama dalam string teks",replace:"Mengganti karakter dalam teks",search:"Menemukan satu nilai teks di dalam yang lain (tidak peka huruf besar/kecil)",find:"Menemukan satu nilai teks di dalam yang lain (peka huruf besar kecil)",isnumber:"Mengembalikan BENAR jika nilainya berupa angka",istext:"Mengembalikan BENAR jika nilainya adalah teks",isblank:"Mengembalikan BENAR jika nilainya kosong",upper:"Mengubah teks menjadi huruf besar",lower:"Mengubah teks menjadi huruf kecil",product:"Kalikan argumennya",sumproduct:"Mengembalikan jumlah produk dari komponen array yang sesuai",subtotal:"Mengembalikan subtotal dalam daftar atau basis data",counta:"Menghitung berapa banyak nilai dalam daftar argumen",averageif:"Mengembalikan rata-rata (rata-rata aritmatika) dari semua sel dalam rentang yang memenuhi kriteria tertentu",averageifs:"Mengembalikan rata-rata (rata-rata aritmatika) dari semua sel yang memenuhi beberapa kriteria.",trim:"Menghapus spasi dari teks",sign:"Mengembalikan tanda angka",yield:"Mengembalikan hasil pada sekuritas yang membayar bunga berkala",abs:"Mengembalikan nilai absolut dari angka",sin:"Mengembalikan sinus dari sudut yang diberikan",cos:"Mengembalikan cosinus angka",tan:"Mengembalikan garis singgung sebuah angka"},validation:{required:"itu harus diperlukan",notMatch:"itu tidak cocok dengan aturan validasinya",between:"Itu antara {} dan {}",notBetween:"itu bukan antara {} dan {}",notIn:"itu tidak ada dalam daftar",equal:"itu sama dengan {}",notEqual:"tidak sama dengan {}",lessThan:"kurang dari {}",lessThanEqual:"kurang dari atau sama dengan {}",greaterThan:"ini lebih besar dari {}",greaterThanEqual:"lebih besar atau sama dengan {}",downloadImageFail:"Gagal mengunduh gambar"},error:{pasteForMergedCell:"Tidak dapat melakukan operasi ini pada sel yang digabungkan"},calendar:{weeks:["Minggu Senin Selasa Rabu Kamis Jumat Sabtu"],months:["Januari, Februari, Maret, April, Mei, Juni, Juli, Agustus, September, Oktober, November, Desember"]},button:{add:"Tambahkan",del:"menghapus",next:"Berikutnya",cancel:"Membatalkan",remove:"menghapus",save:"menyimpan",ok:"mengonfirmasi",previous:"Sebelumnya",close:"penutup"},sort:{desc:"Urutkan Z->A",asc:"Urutkan A->Z"},filter:{empty:"kosong"},dataValidation:{mode:"model",range:"jangkauan sel",criteria:"standar",modeType:{cell:"sel tunggal",column:"kolom",row:"garis"},type:{list:"daftar",number:"angka",date:"tanggal",phone:"Telepon",email:"surel"},operator:{be:"di antara",nbe:"tidak diantara",lt:"kurang dari",lte:"kurang dari atau sama dengan",gt:"lebih dari",gte:"lebih dari atau sama dengan",eq:"setara",neq:"tidak sama dengan"}},dataSort:{ci:"cakupan",criteria:"memesan",casesense:"hal - hal sensitif",sortby:"Sortir dengan",header:"judul",msg:"Harap pilih kolom lain yang diurutkan berdasarkan kolom",msg2:"Area pemilihan memiliki area gabungan, kami tidak mendukung penyortiran area gabungan",order:{asc:"Urutan positif",desc:"urutan terbalik"}},dataSearch:{label:"menemukan konten",lkinlb:"rentang pencarian",matchwhole:"cocok dengan seluruh konten",lookin:{values:"teks",formulas:"rumus",comments:"anotasi"}},dataComment:{label:"anotasi"}},fr:{toolbar:{undo:"révoquer",redo:"refaire",print:"Imprimer",paintformat:"Peintre de format",clearformat:"mise en forme claire",format:"Format de données",fontName:"nom de la police",fontSize:"taille de police",fontBold:"Caractères gras",fontItalic:"police en italique",underline:"souligner",strike:"barré",color:"couleur du texte",bgcolor:"la couleur de remplissage",border:"cadre",merge:"Fusionner des cellules",unmerge:"dissocier des cellules",align:"Alignement horizontal",valign:"alignement vertical",textwrap:"retour à la ligne",freeze:"rangs fixes",autofilter:"filtre",formula:"formule",more:"Plus",sort:"Classification",download:"télécharger",pagination:"pagination",search:"recherche",commentDefault:"veuillez entrer du texte",commentEdit:"modifier les commentaires",commentRemove:"supprimer le commentaire",commentPrevious:"Commentaire précédent",commentNext:"commentaire suivant",insertImage:"insérer une image"},menubar:{undo:"annuler",redo:"refaire",print:"Imprimer",paintformat:"Peintre de format",clearformat:"mise en forme claire",format:"Format de données",fontName:"Nom de la police :",fontSize:"taille de police:",fontBold:"Caractères gras",fontItalic:"police en italique",underline:"souligner",strike:"barré",color:"couleur du texte",bgcolor:"la couleur de remplissage",border:"cadre",merge:"Fusionner des cellules",unmerge:"dissocier des cellules",align:"Alignement horizontal",valign:"alignement vertical",textwrap:"retour à la ligne",freeze:"rangs fixes",autofilter:"filtre",formula:"formule",more:"Plus",sort:"Classification",download:"télécharger",download_HTML:"Télécharger au format HTML",download_PDF:"Télécharger au format PDF",download_Original:"télécharger l'original",download_XLSX:"Télécharger au format XLSX",download_GOOGLE:"Enregistrer sur Google Drive",download_DROPBOX:"Enregistrer dans Dropbox",pagination:"pagination",search:"recherche",commentDefault:"veuillez entrer du texte",insertSheet:"insérer une feuille de calcul",insertRow:"insérer une ligne",insertColumn:"insérer une colonne",link:"lien",insertComment:"ajouter un commentaire",commentEdit:"modifier les commentaires",commentRemove:"supprimer le commentaire",commentPrevious:"Commentaire précédent",commentNext:"commentaire suivant",insertImage:"insérer une image",fromURL:"à partir de l'URL",fromLocal:"du local",menuInsert:"Ajouter à",menuComment:"Vérifier",menuText:"Format",menuFont:"Police de caractère",menuEdit:"page de garde",menuFile:"document"},contextmenu:{copy:"copie",cut:"couper",paste:"pâte",pasteValue:"Coller uniquement la valeur",pasteFormat:"Coller la mise en forme uniquement",hide:"cacher",insertRow:"insérer une ligne",insertColumn:"insérer une colonne",deleteSheet:"supprimer une feuille",deleteRow:"Supprimer la ligne",deleteColumn:"supprimer la colonne",deleteCell:"supprimer la cellule",deleteCellText:"supprimer le texte de la cellule",validation:"verification des données",sort:"Classification",link:"lien",removeLink:"supprimer le lien",editLink:"modifier le lien",openLink:"ouvrir le lien",download:"télécharger",cellprintable:"activer l'exportation",cellnonprintable:"désactiver l'exportation",celleditable:"activer la modification",cellnoneditable:"désactiver l'édition",insertURL:"Entrez l'adresse de l'image",deleteImage:"supprimer l'image",copyImage:"copier l'image",pasteImage:"coller une image",merge:"fusionner",unmerge:"dissocier",edit:"modifier",clear:"nettoyer"},link:{emailAddress:"E-mail",emailSubject:"thème",sheetPage:"emplacement du fichier",sheetCell:"référence de cellule",linkTypes:{web:"page web",sheet:"ce fichier",email:"E-mail"},webUrl:"URL",linkType:"type de lien"},download:{fileName:"nom de fichier",saveType:"Enregistrer sous",saveTypes:{Original:"format d'origine",XLSX:"Format XLSX",PDF:"Format PDF",HTML:"Format HTML"}},print:{size:"taille de papier",orientation:"orientation des pages",orientations:["horizontal Vertical"]},format:{normal:"ordinaire",text:"texte brut",number:"nombre",percent:"pourcentage",rmb:"RMB",usd:"Dollar",eur:"EUR",date:"date",time:"temps",datetime:"date et heure",duration:"période"},formula:{sum:"Calcule la somme d'un ensemble de valeurs",average:"Calcule la moyenne arithmétique de tous les paramètres",max:"Calcule la valeur maximale dans un ensemble de chiffres",min:"Calcule la plus petite valeur dans un ensemble de chiffres",_if:"Selon le résultat du jugement logique de la condition spécifiée est vrai ou faux, renvoie le résultat du calcul déclenché par la condition correspondante",and:'Il renvoie "vrai" logique uniquement si les résultats des paramètres sont tous les deux "vrais" logiques, sinon il renvoie "faux" logique',or:'Le résultat est renvoyé comme "faux" logique uniquement si toutes les valeurs des paramètres sont logiquement "faux", sinon il renvoie logiquement "vrai"',concat:"Connecter plusieurs caractères texte ou données dans des cellules ensemble",count:"compte le nombre de cellules contenant des nombres et compte les nombres dans la liste des arguments",sumif:"Ajoute les cellules spécifiées par un critère donné",sumifs:"Ajoute les cellules d'une plage qui répondent à plusieurs critères",vlookup:"Regarde dans la première colonne d'un tableau et se déplace sur la ligne pour renvoyer la valeur d'une cellule",hlookup:"Recherche une valeur dans la ligne supérieure d'un tableau ou d'un tableau de valeurs, puis renvoie une valeur dans la même colonne à partir d'une ligne que vous spécifiez dans le tableau ou le tableau.",lookup:"Recherche des valeurs dans un vecteur ou un tableau",match:"Recherche des valeurs dans une référence ou un tableau",rank:"Renvoie le rang d'un nombre dans une liste de nombres",frequency:"Renvoie une distribution de fréquence sous la forme d'un tableau vertical",text:"Formate un nombre et le convertit en texte",left:"Renvoie les caractères les plus à gauche d'une valeur de texte",right:"Renvoie les caractères les plus à droite d'une valeur de texte",round:"Arrondit un nombre à un nombre de chiffres spécifié",index:"Utilise un index pour choisir une valeur dans une référence ou un tableau",countif:"Compte le nombre de cellules dans une plage qui répondent aux critères donnés",countifs:"Compte le nombre de cellules dans une plage qui répondent à plusieurs critères",mid:"Renvoie un nombre spécifique de caractères d'une chaîne de texte à partir de la position que vous spécifiez",len:"Renvoie le nombre de caractères d'une chaîne de texte",power:"Renvoie le résultat d'un nombre élevé à une puissance",ceiling:"Arrondit un nombre à l'entier le plus proche ou au multiple de signification le plus proche",floor:"Arrondit un nombre vers le bas, vers zéro",substitute:"Remplace le nouveau texte par l'ancien texte dans une chaîne de texte",replace:"Remplace les caractères dans le texte",search:"Trouve une valeur de texte dans une autre (non sensible à la casse)",find:"Trouve une valeur de texte dans une autre (sensible à la casse)",isnumber:"Renvoie TRUE si la valeur est un nombre",istext:"Renvoie TRUE si la valeur est du texte",isblank:"Renvoie TRUE si la valeur est vide",upper:"Convertit le texte en majuscule",lower:"Convertit le texte en minuscules",product:"Multiplie ses arguments",sumproduct:"Renvoie la somme des produits des composants du tableau correspondants",subtotal:"Renvoie un sous-total dans une liste ou une base de données",counta:"Compte le nombre de valeurs dans la liste des arguments",averageif:"Renvoie la moyenne (moyenne arithmétique) de toutes les cellules d'une plage qui répondent à un critère donné",averageifs:"Renvoie la moyenne (moyenne arithmétique) de toutes les cellules répondant à plusieurs critères.",trim:"Supprime les espaces du texte",sign:"Renvoie le signe d'un nombre",yield:"Rend le rendement d'un titre qui paie des intérêts périodiques",abs:"Renvoie la valeur absolue d'un nombre",sin:"Renvoie le sinus de l'angle donné",cos:"Renvoie le cosinus d'un nombre",tan:"Renvoie la tangente d'un nombre"},validation:{required:"ça doit être obligatoire",notMatch:"il ne correspond pas à ses règles de validation",between:"c'est entre {} et {}",notBetween:"ce n'est pas entre {} et {}",notIn:"il n'est pas dans la liste",equal:"il est égal à {}",notEqual:"il n'est pas égal à {}",lessThan:"c'est moins de {}",lessThanEqual:"il est inférieur ou égal à {}",greaterThan:"il est supérieur à {}",greaterThanEqual:"il est supérieur ou égal à {}",downloadImageFail:"Échec du téléchargement de l'image"},error:{pasteForMergedCell:"Impossible d'effectuer cette opération sur des cellules fusionnées"},calendar:{weeks:["Dimanche Lundi Mardi Mercredi Jeudi Vendredi Samedi"],months:["janvier, février, mars, avril, mai, juin, juillet, août, septembre, octobre, novembre, décembre"]},button:{add:"Ajouter à",del:"supprimer",next:"Suivant",cancel:"Annuler",remove:"retirer",save:"sauvegarder",ok:"confirmer",previous:"Précédent",close:"fermeture"},sort:{desc:"Trier Z->A",asc:"Trier A->Z"},filter:{empty:"vide"},dataValidation:{mode:"modèle",range:"plage de cellules",criteria:"standard",modeType:{cell:"unicellulaire",column:"colonne",row:"doubler"},type:{list:"liste",number:"chiffre",date:"date",phone:"Téléphone",email:"e-mail"},operator:{be:"entre",nbe:"pas entre",lt:"moins que",lte:"inférieur ou égal à",gt:"plus que le",gte:"Plus grand ou égal à",eq:"égal",neq:"pas égal à"}},dataSort:{ci:"portée",criteria:"commande",casesense:"sensible aux majuscules et minuscules",sortby:"Trier par",header:"titre",msg:"Veuillez choisir une autre colonne triée par champ",msg2:"La zone de sélection a une zone fusionnée, nous ne prenons pas en charge le tri de la zone fusionnée",order:{asc:"Séquence positive",desc:"ordre inverse"}},dataSearch:{label:"trouver du contenu",lkinlb:"plage de recherche",matchwhole:"correspond à tout le contenu",lookin:{values:"texte",formulas:"formule",comments:"annotation"}},dataComment:{label:"annotation"}},vi:{toolbar:{undo:"thu hồi",redo:"làm lại",print:"In",paintformat:"Trình vẽ định dạng",clearformat:"định dạng rõ ràng",format:"Định dạng dữ liệu",fontName:"tên phông chữ",fontSize:"cỡ chữ",fontBold:"phông chữ đậm",fontItalic:"phông chữ nghiêng",underline:"gạch dưới",strike:"gạch ngang",color:"văn bản màu",bgcolor:"tô màu",border:"khung",merge:"Hợp nhất các ô",unmerge:"hủy hợp nhất các ô",align:"Căn ngang",valign:"căn lề dọc",textwrap:"gói từ",freeze:"cấp bậc cố định",autofilter:"lọc",formula:"công thức",more:"Hơn",sort:"phân loại",download:"Tải xuống",pagination:"phân trang",search:"tìm kiếm",commentDefault:"vui lòng nhập văn bản",commentEdit:"chỉnh sửa nhận xét",commentRemove:"Xóa nhận xét",commentPrevious:"Nhận xét trước",commentNext:"bình luận tiếp theo",insertImage:"chèn ảnh"},menubar:{undo:"Hoàn tác",redo:"làm lại",print:"In",paintformat:"Trình vẽ định dạng",clearformat:"định dạng rõ ràng",format:"Định dạng dữ liệu",fontName:"Tên phông chữ:",fontSize:"cỡ chữ:",fontBold:"phông chữ đậm",fontItalic:"phông chữ nghiêng",underline:"gạch dưới",strike:"gạch ngang",color:"văn bản màu",bgcolor:"tô màu",border:"khung",merge:"Hợp nhất các ô",unmerge:"hủy hợp nhất các ô",align:"Căn ngang",valign:"căn lề dọc",textwrap:"gói từ",freeze:"cấp bậc cố định",autofilter:"lọc",formula:"công thức",more:"Hơn",sort:"phân loại",download:"Tải xuống",download_HTML:"Tải xuống dưới dạng HTML",download_PDF:"Tải xuống dưới dạng PDF",download_Original:"tải xuống bản gốc",download_XLSX:"Tải xuống dưới dạng XLSX",download_GOOGLE:"Lưu vào Google Drive",download_DROPBOX:"Lưu vào hộp chứa",pagination:"phân trang",search:"tìm kiếm",commentDefault:"vui lòng nhập văn bản",insertSheet:"chèn bảng tính",insertRow:"Chèn hàng",insertColumn:"chèn cột",link:"liên kết",insertComment:"thêm bình luận",commentEdit:"chỉnh sửa bình luận",commentRemove:"Xóa nhận xét",commentPrevious:"Nhận xét trước",commentNext:"bình luận tiếp theo",insertImage:"chèn ảnh",fromURL:"từ URL",fromLocal:"từ địa phương",menuInsert:"Thêm vào",menuComment:"Kiểm tra",menuText:"Định dạng",menuFont:"nét chữ",menuEdit:"trang đầu",menuFile:"tài liệu"},contextmenu:{copy:"sao chép",cut:"cắt",paste:"dán",pasteValue:"Chỉ dán giá trị",pasteFormat:"Chỉ dán định dạng",hide:"trốn",insertRow:"Chèn hàng",insertColumn:"chèn cột",deleteSheet:"xóa tờ",deleteRow:"xóa hàng",deleteColumn:"xóa cột",deleteCell:"xóa ô",deleteCellText:"xóa văn bản ô",validation:"xác minh dữ liệu",sort:"phân loại",link:"liên kết",removeLink:"xóa liên kết",editLink:"chỉnh sửa liên kết",openLink:"mở liên kết",download:"Tải xuống",cellprintable:"bật xuất",cellnonprintable:"tắt xuất",celleditable:"cho phép chỉnh sửa",cellnoneditable:"tắt chỉnh sửa",insertURL:"Nhập địa chỉ hình ảnh",deleteImage:"xóa ảnh",copyImage:"sao chép hình ảnh",pasteImage:"dán hình",merge:"hợp nhất",unmerge:"hủy hợp nhất",edit:"biên tập",clear:"xóa"},link:{emailAddress:"E-mail",emailSubject:"chủ đề",sheetPage:"vị trí tập tin",sheetCell:"tham chiếu ô",linkTypes:{web:"trang web",sheet:"tập tin này",email:"E-mail"},webUrl:"url",linkType:"Loại liên kết"},download:{fileName:"tên tập tin",saveType:"Lưu thành",saveTypes:{Original:"định dạng ban đầu",XLSX:"định dạng XLSX",PDF:"định dạng PDF",HTML:"định dạng HTML"}},print:{size:"khổ giấy",orientation:"Định hướng trang",orientations:["ngang Dọc"]},format:{normal:"bình thường",text:"văn bản thô",number:"con số",percent:"phần trăm",rmb:"nhân dân tệ",usd:"đô la",eur:"EUR",date:"ngày",time:"thời gian",datetime:"ngày giờ",duration:"Giai đoạn"},formula:{sum:"Tính tổng của một tập hợp các giá trị",average:"Tính giá trị trung bình cộng của tất cả các tham số",max:"Tính giá trị lớn nhất trong một tập hợp các chữ số",min:"Tính giá trị nhỏ nhất trong một tập hợp các chữ số",_if:"Theo kết quả phán đoán logic của điều kiện đã chỉ định là đúng hay sai, trả về kết quả tính toán được kích hoạt bởi điều kiện tương ứng",and:'Nó chỉ trả về logic "true" nếu kết quả của các tham số đều logic "true", nếu không, nó trả về logic "false"',or:'Kết quả chỉ được trả về dưới dạng logic "false" nếu tất cả các giá trị tham số là "false" về mặt logic, nếu không, nó trả về dạng logic "true"',concat:"Kết nối nhiều ký tự văn bản hoặc dữ liệu trong các ô với nhau",count:"đếm số ô chứa số và đếm số trong danh sách đối số",sumif:"Thêm các ô được chỉ định bởi một tiêu chí nhất định",sumifs:"Thêm các ô trong một phạm vi đáp ứng nhiều tiêu chí",vlookup:"Tìm trong cột đầu tiên của một mảng và di chuyển qua hàng để trả về giá trị của một ô",hlookup:"Tìm kiếm một giá trị ở hàng trên cùng của một bảng hoặc một mảng các giá trị, sau đó trả về một giá trị trong cùng một cột từ một hàng mà bạn chỉ định trong bảng hoặc mảng.",lookup:"Tra cứu các giá trị trong một vectơ hoặc mảng",match:"Tra cứu các giá trị trong một tham chiếu hoặc mảng",rank:"Trả về thứ hạng của một số trong danh sách các số",frequency:"Trả về phân bố tần suất dưới dạng mảng dọc",text:"Định dạng một số và chuyển đổi nó thành văn bản",left:"Trả về các ký tự ngoài cùng bên trái từ một giá trị văn bản",right:"Trả về các ký tự ngoài cùng bên phải từ một giá trị văn bản",round:"Làm tròn một số thành một số chữ số đã chỉ định",index:"Sử dụng chỉ mục để chọn giá trị từ tham chiếu hoặc mảng",countif:"Đếm số lượng ô trong một phạm vi đáp ứng tiêu chí đã cho",countifs:"Đếm số lượng ô trong một phạm vi đáp ứng nhiều tiêu chí",mid:"Trả về một số ký tự cụ thể từ một chuỗi văn bản bắt đầu từ vị trí bạn chỉ định",len:"Trả về số ký tự trong chuỗi văn bản",power:"Trả về kết quả của một số được nâng lên lũy thừa",ceiling:"Làm tròn một số thành số nguyên gần nhất hoặc bội số gần nhất",floor:"Làm tròn một số xuống, về 0",substitute:"Thay thế văn bản mới cho văn bản cũ trong một chuỗi văn bản",replace:"Thay thế ký tự trong văn bản",search:"Tìm một giá trị văn bản trong một giá trị văn bản khác (không phân biệt chữ hoa chữ thường)",find:"Tìm một giá trị văn bản trong một giá trị văn bản khác (phân biệt chữ hoa chữ thường)",isnumber:"Trả về TRUE nếu giá trị là số",istext:"Trả về TRUE nếu giá trị là văn bản",isblank:"Trả về TRUE nếu giá trị trống",upper:"Chuyển văn bản thành chữ hoa",lower:"Chuyển văn bản thành chữ thường",product:"Nhân lên các đối số của nó",sumproduct:"Trả về tổng tích của các thành phần mảng tương ứng",subtotal:"Trả về tổng phụ trong danh sách hoặc cơ sở dữ liệu",counta:"Đếm xem có bao nhiêu giá trị trong danh sách đối số",averageif:"Trả về giá trị trung bình (trung bình cộng) của tất cả các ô trong một phạm vi đáp ứng một tiêu chí nhất định",averageifs:"Trả về giá trị trung bình (trung bình cộng) của tất cả các ô đáp ứng nhiều tiêu chí.",trim:"Xóa khoảng trắng khỏi văn bản",sign:"Trả về dấu của một số",yield:"Trả về lợi tức của chứng khoán trả lãi định kỳ",abs:"Trả về giá trị tuyệt đối của một số",sin:"Trả về sin của góc đã cho",cos:"Trả về cosin của một số",tan:"Trả về tang của một số"},validation:{required:"nó phải được yêu cầu",notMatch:"nó không phù hợp với quy tắc xác thực của nó",between:"Nó nằm giữa {} và {}",notBetween:"nó không nằm giữa {} và {}",notIn:"nó không có trong danh sách",equal:"nó bằng {}",notEqual:"nó không bằng {}",lessThan:"nó nhỏ hơn {}",lessThanEqual:"nó nhỏ hơn hoặc bằng {}",greaterThan:"nó lớn hơn {}",greaterThanEqual:"nó lớn hơn hoặc bằng {}",downloadImageFail:"Không thể tải xuống hình ảnh"},error:{pasteForMergedCell:"Không thể thực hiện thao tác này trên các ô đã hợp nhất"},calendar:{weeks:["Chủ nhật thứ hai thứ ba thứ tư thứ năm thứ sáu Thứ Bảy"],months:["Tháng 1, tháng 2, tháng 3, tháng 4, tháng 5, tháng 6, tháng 7, tháng 8, tháng 9, tháng 10, tháng 11, tháng 12"]},button:{add:"Thêm vào",del:"xóa bỏ",next:"Kế tiếp",cancel:"Hủy bỏ",remove:"di dời",save:"cứu",ok:"xác nhận",previous:"Trước",close:"Khép kín"},sort:{desc:"Sắp xếp Z->A",asc:"Sắp xếp A->Z"},filter:{empty:"trống"},dataValidation:{mode:"người mẫu",range:"phạm vi ô",criteria:"tiêu chuẩn",modeType:{cell:"đơn bào",column:"cột",row:"đường kẻ"},type:{list:"danh sách",number:"chữ số",date:"ngày",phone:"Điện thoại",email:"e-mail"},operator:{be:"giữa",nbe:"không phải ở giữa",lt:"ít hơn",lte:"ít hơn hoặc bằng",gt:"nhiều hơn",gte:"lớn hơn hoặc bằng",eq:"bình đẳng",neq:"không bằng"}},dataSort:{ci:"phạm vi",criteria:"đặt hàng",casesense:"trường hợp nhạy cảm",sortby:"sắp xếp theo",header:"tiêu đề",msg:"Vui lòng chọn một cột khác được sắp xếp theo trường",msg2:"Khu vực lựa chọn có khu vực đã hợp nhất, chúng tôi không hỗ trợ sắp xếp khu vực đã hợp nhất",order:{asc:"trình tự tích cực",desc:"thứ tự đảo ngược"}},dataSearch:{label:"tìm nội dung",lkinlb:"phạm vi tìm kiếm",matchwhole:"phù hợp với toàn bộ nội dung",lookin:{values:"chữ",formulas:"công thức",comments:"chú thích"}},dataComment:{label:"chú thích"}},ko:{toolbar:{undo:"취소",redo:"다시 하다",print:"인쇄",paintformat:"포맷 페인터",clearformat:"명확한 형식",format:"데이터 형식",fontName:"글꼴 이름",fontSize:"글꼴 크기",fontBold:"글꼴 굵게",fontItalic:"글꼴 이탤릭체",underline:"밑줄",strike:"취소선",color:"텍스트 색상",bgcolor:"채우기 색상",border:"액자",merge:"셀 병합",unmerge:"셀 병합 해제",align:"수평 정렬",valign:"수직 정렬",textwrap:"줄 바꿈",freeze:"고정 순위",autofilter:"필터",formula:"공식",more:"더",sort:"분류",download:"다운로드",pagination:"페이징",search:"찾다",commentDefault:"텍스트를 입력하십시오",commentEdit:"댓글 수정",commentRemove:"댓글 삭제",commentPrevious:"이전 댓글",commentNext:"다음 댓글",insertImage:"그림 삽입"},menubar:{undo:"실행 취소",redo:"다시 하다",print:"인쇄",paintformat:"포맷 페인터",clearformat:"명확한 형식",format:"데이터 형식",fontName:"글꼴 이름:",fontSize:"글꼴 크기:",fontBold:"글꼴 굵게",fontItalic:"글꼴 이탤릭체",underline:"밑줄",strike:"취소선",color:"텍스트 색상",bgcolor:"채우기 색상",border:"액자",merge:"셀 병합",unmerge:"셀 병합 해제",align:"수평 정렬",valign:"수직 정렬",textwrap:"줄 바꿈",freeze:"고정 순위",autofilter:"필터",formula:"공식",more:"더",sort:"분류",download:"다운로드",download_HTML:"HTML로 다운로드",download_PDF:"PDF로 다운로드",download_Original:"원본 다운로드",download_XLSX:"XLSX로 다운로드",download_GOOGLE:"Google 드라이브에 저장",download_DROPBOX:"드롭박스에 저장",pagination:"페이징",search:"찾다",commentDefault:"텍스트를 입력하십시오",insertSheet:"워크시트 삽입",insertRow:"행 삽입",insertColumn:"열 삽입",link:"링크",insertComment:"댓글 추가",commentEdit:"댓글 수정",commentRemove:"댓글 삭제",commentPrevious:"이전 댓글",commentNext:"다음 댓글",insertImage:"그림 삽입",fromURL:"URL에서",fromLocal:"현지에서",menuInsert:"에 추가",menuComment:"확인하다",menuText:"체재",menuFont:"폰트",menuEdit:"첫 장",menuFile:"문서"},contextmenu:{copy:"복사",cut:"자르다",paste:"반죽",pasteValue:"값만 붙여넣기",pasteFormat:"서식만 붙여넣기",hide:"숨다",insertRow:"행 삽입",insertColumn:"열 삽입",deleteSheet:"시트 삭제",deleteRow:"행 삭제",deleteColumn:"열 삭제",deleteCell:"셀 삭제",deleteCellText:"셀 텍스트 삭제",validation:"데이터 검증",sort:"분류",link:"링크",removeLink:"링크 삭제",editLink:"링크 편집",openLink:"링크 열기",download:"다운로드",cellprintable:"내보내기 활성화",cellnonprintable:"내보내기 비활성화",celleditable:"편집 가능",cellnoneditable:"편집 비활성화",insertURL:"이미지 주소 입력",deleteImage:"사진 삭제",copyImage:"사진 복사",pasteImage:"그림 붙여넣기",merge:"병합",unmerge:"병합 해제",edit:"편집하다",clear:"지우다"},link:{emailAddress:"이메일",emailSubject:"주제",sheetPage:"파일 위치",sheetCell:"셀 참조",linkTypes:{web:"웹 페이지",sheet:"이 파일",email:"이메일"},webUrl:"URL",linkType:"링크 유형"},download:{fileName:"파일 이름",saveType:"다른 이름으로 저장",saveTypes:{Original:"원래 형식",XLSX:"XLSX 형식",PDF:"PDF 형식",HTML:"HTML 형식"}},print:{size:"용지 크기",orientation:"페이지 방향",orientations:["수평 수직"]},format:{normal:"평범한",text:"일반 텍스트",number:"숫자",percent:"백분율",rmb:"인민폐",usd:"달러",eur:"유로",date:"날짜",time:"시간",datetime:"날짜 시간",duration:"기간"},formula:{sum:"값 집합의 합계를 계산합니다.",average:"모든 매개변수의 산술 평균을 계산합니다.",max:"일련의 자릿수에서 최대값을 계산합니다.",min:"숫자 집합에서 가장 작은 값을 계산합니다.",_if:"지정된 조건의 논리적 판단 결과가 참 또는 거짓에 따라 해당 조건에 의해 트리거된 계산 결과를 반환합니다.",and:'매개변수의 결과가 둘 다 논리적 "true"인 경우에만 논리적 "true"를 반환하고, 그렇지 않으면 논리적 "false"를 반환합니다.',or:'결과는 모든 매개변수 값이 논리적으로 "false"인 경우에만 논리적 "false"로 반환되고, 그렇지 않으면 논리적으로 "true"로 반환됩니다.',concat:"셀의 여러 문자 텍스트 또는 데이터 연결",count:"숫자를 포함하는 셀의 수를 계산하고 인수 목록 내의 숫자를 계산",sumif:"지정된 기준으로 지정된 셀을 추가합니다.",sumifs:"여러 기준을 충족하는 범위의 셀을 추가합니다.",vlookup:"배열의 첫 번째 열을 보고 행을 가로질러 이동하여 셀 값을 반환합니다.",hlookup:"테이블의 맨 위 행 또는 값 배열에서 값을 검색한 다음 테이블 또는 배열에서 지정한 행에서 동일한 열의 값을 반환합니다.",lookup:"벡터 또는 배열에서 값 조회",match:"참조 또는 배열에서 값 조회",rank:"숫자 목록에서 숫자의 순위를 반환합니다",frequency:"도수 분포를 수직 배열로 반환",text:"숫자를 형식화하고 텍스트로 변환",left:"텍스트 값에서 가장 왼쪽에 있는 문자를 반환합니다.",right:"텍스트 값에서 가장 오른쪽 문자를 반환",round:"숫자를 지정된 자릿수로 반올림",index:"인덱스를 사용하여 참조 또는 배열에서 값을 선택합니다.",countif:"주어진 기준을 충족하는 범위 내의 셀 수를 계산합니다.",countifs:"여러 기준을 충족하는 범위 내의 셀 수를 계산합니다.",mid:"지정한 위치에서 시작하는 텍스트 문자열에서 특정 수의 문자를 반환합니다.",len:"텍스트 문자열의 문자 수를 반환합니다.",power:"숫자의 거듭제곱 결과를 반환합니다.",ceiling:"숫자를 가장 가까운 정수 또는 가장 가까운 유효 배수로 반올림",floor:"숫자를 0에 가깝게 반올림",substitute:"텍스트 문자열의 기존 텍스트를 새 텍스트로 대체",replace:"텍스트 내 문자 교체",search:"다른 텍스트 값 내에서 하나의 텍스트 값 찾기(대소문자 구분 안 함)",find:"다른 텍스트 값 내에서 하나의 텍스트 값 찾기(대소문자 구분)",isnumber:"값이 숫자이면 TRUE를 반환",istext:"값이 텍스트이면 TRUE를 반환",isblank:"값이 비어 있으면 TRUE를 반환",upper:"텍스트를 대문자로 변환",lower:"텍스트를 소문자로 변환",product:"인수를 곱합니다",sumproduct:"해당 배열 구성요소의 곱의 합을 반환합니다.",subtotal:"목록 또는 데이터베이스에서 소계를 반환합니다.",counta:"인수 목록에 얼마나 많은 값이 있는지 계산",averageif:"지정된 기준을 충족하는 범위 내 모든 셀의 평균(산술 평균)을 반환합니다.",averageifs:"여러 기준을 충족하는 모든 셀의 평균(산술 평균)을 반환합니다.",trim:"텍스트에서 공백 제거",sign:"숫자의 부호를 반환합니다",yield:"주기적으로 이자를 지급하는 유가 증권의 수익률을 반환합니다",abs:"숫자의 절대값을 반환합니다.",sin:"주어진 각도의 사인을 반환합니다",cos:"숫자의 코사인을 반환합니다",tan:"숫자의 탄젠트를 반환합니다"},validation:{required:"반드시 필요하다",notMatch:"유효성 검사 규칙과 일치하지 않습니다.",between:"{}와 {} 사이입니다.",notBetween:"{}와 {} 사이가 아닙니다.",notIn:"목록에 없습니다",equal:"{}와 같습니다.",notEqual:"{}와 같지 않습니다.",lessThan:"{}보다 작습니다.",lessThanEqual:"{}보다 작거나 같습니다.",greaterThan:"{}보다 큽니다.",greaterThanEqual:"{}보다 크거나 같습니다.",downloadImageFail:"이미지를 다운로드하지 못했습니다."},error:{pasteForMergedCell:"병합된 셀에서 이 작업을 수행할 수 없습니다."},calendar:{weeks:["일요일 월요일 화요일 수요일 목요일 금요일 토요일"],months:["1월, 2월, 3월, 4월, 5월, 6월, 7월, 8월, 9월, 10월, 11월, 12월"]},button:{add:"에 추가",del:"삭제",next:"다음",cancel:"취소",remove:"제거하다",save:"구하다",ok:"확인하다",previous:"이전의",close:"폐쇄"},sort:{desc:"정렬 Z->A",asc:"정렬 A->Z"},filter:{empty:"비어 있는"},dataValidation:{mode:"모델",range:"셀 범위",criteria:"기준",modeType:{cell:"단세포",column:"열",row:"선"},type:{list:"목록",number:"숫자",date:"날짜",phone:"전화",email:"이메일"},operator:{be:"~ 사이",nbe:"사이가 아니다",lt:"미만",lte:"이하",gt:"보다 더",gte:"보다 크거나 같음",eq:"동일한",neq:"같지 않다"}},dataSort:{ci:"범위",criteria:"주문하다",casesense:"대소문자 구분",sortby:"정렬 기준",header:"제목",msg:"필드별로 정렬된 다른 열을 선택하세요.",msg2:"선택 영역에 병합된 영역이 있습니다. 병합된 영역 정렬을 지원하지 않습니다.",order:{asc:"양성 서열",desc:"역순으로"}},dataSearch:{label:"콘텐츠 찾기",lkinlb:"검색 범위",matchwhole:"전체 내용과 일치",lookin:{values:"텍스트",formulas:"공식",comments:"주석"}},dataComment:{label:"주석"}},it:{toolbar:{undo:"revocare",redo:"rifare",print:"Stampa",paintformat:"Formato pittore",clearformat:"formato chiaro",format:"Formato dei dati",fontName:"nome del carattere",fontSize:"dimensione del font",fontBold:"carattere grassetto",fontItalic:"carattere corsivo",underline:"sottolineare",strike:"barrato",color:"colore del testo",bgcolor:"colore di riempimento",border:"telaio",merge:"Unire le celle",unmerge:"separare le celle",align:"Allineamento orizzontale",valign:"allineamento verticale",textwrap:"a capo automatico",freeze:"ranghi fissi",autofilter:"filtro",formula:"formula",more:"Di più",sort:"Classificazione",download:"scaricamento",pagination:"paginazione",search:"ricerca",commentDefault:"si prega di inserire il testo",commentEdit:"modificare i commenti",commentRemove:"eliminare il commento",commentPrevious:"Commento precedente",commentNext:"prossimo commento",insertImage:"inserire immagine"},menubar:{undo:"disfare",redo:"rifare",print:"Stampa",paintformat:"Formato pittore",clearformat:"formato chiaro",format:"Formato dei dati",fontName:"Nome carattere:",fontSize:"dimensione del font:",fontBold:"carattere grassetto",fontItalic:"carattere corsivo",underline:"sottolineare",strike:"barrato",color:"colore del testo",bgcolor:"colore di riempimento",border:"telaio",merge:"Unire le celle",unmerge:"separare le celle",align:"Allineamento orizzontale",valign:"allineamento verticale",textwrap:"a capo automatico",freeze:"ranghi fissi",autofilter:"filtro",formula:"formula",more:"Di più",sort:"Classificazione",download:"scaricamento",download_HTML:"Scarica come HTML",download_PDF:"Scarica come PDF",download_Original:"scarica originale",download_XLSX:"Scarica come XLSX",download_GOOGLE:"Salva su Google Drive",download_DROPBOX:"Salva su Dropbox",pagination:"paginazione",search:"ricerca",commentDefault:"si prega di inserire il testo",insertSheet:"inserire foglio di lavoro",insertRow:"inserire riga",insertColumn:"inserire colonna",link:"collegamento",insertComment:"Aggiungi un commento",commentEdit:"modificare i commenti",commentRemove:"eliminare il commento",commentPrevious:"Commento precedente",commentNext:"prossimo commento",insertImage:"inserire immagine",fromURL:"dall'URL",fromLocal:"dal locale",menuInsert:"aggiungere a",menuComment:"Controllo",menuText:"Formato",menuFont:"font",menuEdit:"prima pagina",menuFile:"documento"},contextmenu:{copy:"copia",cut:"tagliare",paste:"impasto",pasteValue:"Incolla solo il valore",pasteFormat:"Incolla solo la formattazione",hide:"nascondere",insertRow:"inserire riga",insertColumn:"inserire colonna",deleteSheet:"eliminare foglio",deleteRow:"elimina riga",deleteColumn:"elimina colonna",deleteCell:"eliminare cella",deleteCellText:"eliminare il testo della cella",validation:"verifica dei dati",sort:"Classificazione",link:"collegamento",removeLink:"eliminare il collegamento",editLink:"modifica collegamento",openLink:"link aperto",download:"scaricamento",cellprintable:"abilitare l'esportazione",cellnonprintable:"disabilitare l'esportazione",celleditable:"permettere la modifica",cellnoneditable:"disabilitare la modifica",insertURL:"Inserisci l'indirizzo dell'immagine",deleteImage:"eliminare l'immagine",copyImage:"copia immagine",pasteImage:"incollare l'immagine",merge:"unire",unmerge:"separare",edit:"modificare",clear:"cancellare"},link:{emailAddress:"E-mail",emailSubject:"tema",sheetPage:"posizione del file",sheetCell:"riferimento di cella",linkTypes:{web:"pagina web",sheet:"questa vita",email:"E-mail"},webUrl:"URL",linkType:"tipo di collegamento"},download:{fileName:"nome del file",saveType:"Salva come",saveTypes:{Original:"formato originale",XLSX:"Formato XLSX",PDF:"Formato PDF",HTML:"Formato HTML"}},print:{size:"Misura del foglio",orientation:"orientamento della pagina",orientations:["orizzontale verticale"]},format:{normal:"ordinario",text:"testo semplice",number:"numero",percent:"percentuale",rmb:"RMB",usd:"Dollaro",eur:"euro",date:"data",time:"tempo",datetime:"appuntamento",duration:"periodo"},formula:{sum:"Calcola la somma di un insieme di valori",average:"Calcola la media aritmetica di tutti i parametri",max:"Calcola il valore massimo in un insieme di cifre",min:"Calcola il valore più piccolo in un set di cifre",_if:"A seconda che il risultato del giudizio logico della condizione specificata sia vero o falso, restituisce il risultato del calcolo attivato dalla condizione corrispondente",and:'Restituisce "vero" logico solo se i risultati dei parametri sono entrambi "veri" logici, altrimenti restituisce "falso" logico',or:'Il risultato viene restituito come logico "falso" solo se tutti i valori dei parametri sono logicamente "falsi", altrimenti restituisce logicamente "vero"',concat:"Collega insieme più caratteri di testo o dati nelle celle",count:"conta il numero di celle che contengono numeri e conta i numeri all'interno dell'elenco di argomenti",sumif:"Aggiunge le celle specificate da un determinato criterio",sumifs:"Aggiunge le celle in un intervallo che soddisfano più criteri",vlookup:"Cerca nella prima colonna di un array e si sposta lungo la riga per restituire il valore di una cella",hlookup:"Cerca un valore nella prima riga di una tabella o di un array di valori, quindi restituisce un valore nella stessa colonna da una riga specificata nella tabella o nell'array.",lookup:"Cerca i valori in un vettore o in un array",match:"Cerca i valori in un riferimento o in un array",rank:"Restituisce il rango di un numero in un elenco di numeri",frequency:"Restituisce una distribuzione di frequenza come matrice verticale",text:"Formatta un numero e lo converte in testo",left:"Restituisce i caratteri più a sinistra da un valore di testo",right:"Restituisce i caratteri più a destra da un valore di testo",round:"Arrotonda un numero a un numero di cifre specificato",index:"Utilizza un indice per scegliere un valore da un riferimento o un array",countif:"Conta il numero di celle all'interno di un intervallo che soddisfano i criteri specificati",countifs:"Conta il numero di celle all'interno di un intervallo che soddisfano più criteri",mid:"Restituisce un numero specifico di caratteri da una stringa di testo a partire dalla posizione specificata",len:"Restituisce il numero di caratteri in una stringa di testo",power:"Restituisce il risultato di un numero elevato a potenza",ceiling:"Arrotonda un numero all'intero più vicino o al multiplo significativo più vicino",floor:"Arrotonda un numero per difetto, verso lo zero",substitute:"Sostituisce il nuovo testo con il vecchio testo in una stringa di testo",replace:"Sostituisce i caratteri all'interno del testo",search:"Trova un valore di testo all'interno di un altro (senza distinzione tra maiuscole e minuscole)",find:"Trova un valore di testo all'interno di un altro (con distinzione tra maiuscole e minuscole)",isnumber:"Restituisce TRUE se il valore è un numero",istext:"Restituisce TRUE se il valore è testo",isblank:"Restituisce TRUE se il valore è vuoto",upper:"Converte il testo in maiuscolo",lower:"Converte il testo in minuscolo",product:"Moltiplica i suoi argomenti",sumproduct:"Restituisce la somma dei prodotti dei corrispondenti componenti dell'array",subtotal:"Restituisce un totale parziale in un elenco o database",counta:"Conta quanti valori ci sono nell'elenco degli argomenti",averageif:"Restituisce la media (media aritmetica) di tutte le celle in un intervallo che soddisfano un dato criterio",averageifs:"Restituisce la media (media aritmetica) di tutte le celle che soddisfano più criteri.",trim:"Rimuove gli spazi dal testo",sign:"Restituisce il segno di un numero",yield:"Restituisce il rendimento di un titolo che paga interessi periodici",abs:"Restituisce il valore assoluto di un numero",sin:"Restituisce il seno dell'angolo dato",cos:"Restituisce il coseno di un numero",tan:"Restituisce la tangente di un numero"},validation:{required:"deve essere richiesto",notMatch:"non corrisponde alle sue regole di convalida",between:"È compreso tra {} e {}",notBetween:"non è tra {} e {}",notIn:"non è nella lista",equal:"è uguale a {}",notEqual:"non è uguale a {}",lessThan:"è minore di {}",lessThanEqual:"è minore o uguale a {}",greaterThan:"è maggiore di {}",greaterThanEqual:"è maggiore o uguale a {}",downloadImageFail:"Impossibile scaricare l'immagine"},error:{pasteForMergedCell:"Impossibile eseguire questa operazione sulle celle unite"},calendar:{weeks:["Domenica lunedì martedì mercoledì giovedì venerdì sabato"],months:["Gennaio, Febbraio, Marzo, Aprile, Maggio, Giugno, Luglio, Agosto, Settembre, Ottobre, Novembre, Dicembre"]},button:{add:"aggiungere a",del:"eliminare",next:"Prossimo",cancel:"Annulla",remove:"rimuovere",save:"salva",ok:"Confermare",previous:"Precedente",close:"chiusura"},sort:{desc:"Ordina Z->A",asc:"Ordina A->Z"},filter:{empty:"vuoto"},dataValidation:{mode:"modello",range:"intervallo di celle",criteria:"standard",modeType:{cell:"singola cella",column:"colonna",row:"linea"},type:{list:"elenco",number:"cifra",date:"data",phone:"Telefono",email:"e-mail"},operator:{be:"fra",nbe:"non in mezzo",lt:"meno di",lte:"minore o uguale a",gt:"più del",gte:"maggiore o uguale a",eq:"pari",neq:"non uguale a"}},dataSort:{ci:"scopo",criteria:"ordine",casesense:"maiuscole e minuscole",sortby:"ordina per",header:"titolo",msg:"Scegli una colonna diversa ordinata per campo",msg2:"L'area di selezione ha un'area unita, non supportiamo l'ordinamento dell'area unita",order:{asc:"Sequenza positiva",desc:"ordine inverso"}},dataSearch:{label:"trovare contenuti",lkinlb:"intervallo di ricerca",matchwhole:"corrisponde all'intero contenuto",lookin:{values:"testo",formulas:"formula",comments:"annotazione"}},dataComment:{label:"annotazione"}},ar:{toolbar:{undo:"سحب او إبطال",redo:"إعادة",print:"مطبعة",paintformat:"شكل الرسام",clearformat:"شكل واضح",format:"تنسيق البيانات",fontName:"اسم الخط",fontSize:"حجم الخط",fontBold:"خط عريض",fontItalic:"مائل الخط",underline:"تسطير",strike:"يتوسطه خط",color:"لون الخط",bgcolor:"لون التعبئة",border:"إطار",merge:"دمج الخلايا",unmerge:"فك دمج الخلايا",align:"محاذاة أفقية",valign:"انحياز عمودي",textwrap:"التفاف النص",freeze:"رتب ثابتة",autofilter:"منقي",formula:"معادلة",more:"أكثر",sort:"تصنيف",download:"تحميل",pagination:"الترحيل",search:"يبحث",commentDefault:"الرجاء إدخال النص",commentEdit:"تحرير التعليقات",commentRemove:"حذف تعليق",commentPrevious:"التعليق السابق",commentNext:"التعليق التالي",insertImage:"إدراج الصورة"},menubar:{undo:"الغاء التحميل",redo:"إعادة",print:"مطبعة",paintformat:"شكل الرسام",clearformat:"شكل واضح",format:"تنسيق البيانات",fontName:"اسم الخط:",fontSize:"حجم الخط:",fontBold:"خط عريض",fontItalic:"مائل الخط",underline:"تسطير",strike:"يتوسطه خط",color:"لون الخط",bgcolor:"لون التعبئة",border:"إطار",merge:"دمج الخلايا",unmerge:"فك دمج الخلايا",align:"محاذاة أفقية",valign:"انحياز عمودي",textwrap:"التفاف النص",freeze:"رتب ثابتة",autofilter:"منقي",formula:"معادلة",more:"أكثر",sort:"تصنيف",download:"تحميل",download_HTML:"تنزيل بتنسيق HTML",download_PDF:"تنزيل كملف PDF",download_Original:"تحميل الاصلي",download_XLSX:"تنزيل بتنسيق XLSX",download_GOOGLE:"حفظ في Google Drive",download_DROPBOX:"حفظ إلى المنسدل",pagination:"الترحيل",search:"يبحث",commentDefault:"الرجاء إدخال النص",insertSheet:"أدخل ورقة العمل",insertRow:"الصف إدراج",insertColumn:"إدراج العمود",link:"وصلة",insertComment:"أضف تعليق",commentEdit:"تحرير التعليقات",commentRemove:"حذف تعليق",commentPrevious:"التعليق السابق",commentNext:"التعليق التالي",insertImage:"إدراج الصورة",fromURL:"من URL",fromLocal:"من المحلية",menuInsert:"اضف إليه",menuComment:"يفحص",menuText:"شكل",menuFont:"الخط",menuEdit:"الصفحة الأمامية",menuFile:"وثيقة"},contextmenu:{copy:"ينسخ",cut:"لقطع",paste:"معجون",pasteValue:"الصق القيمة فقط",pasteFormat:"لصق التنسيق فقط",hide:"يخفي",insertRow:"الصف إدراج",insertColumn:"إدراج العمود",deleteSheet:"حذف الورقة",deleteRow:"احذف صف",deleteColumn:"حذف العمود",deleteCell:"حذف الخلية",deleteCellText:"حذف نص الخلية",validation:"التحقق من البيانات",sort:"تصنيف",link:"وصلة",removeLink:"حذف الارتباط",editLink:"تعديل الارتباط",openLink:"افتح الرابط",download:"تحميل",cellprintable:"تمكين التصدير",cellnonprintable:"تعطيل التصدير",celleditable:"تفعيل التحرير",cellnoneditable:"تعطيل التحرير",insertURL:"أدخل عنوان الصورة",deleteImage:"حذف الصورة",copyImage:"نسخ الصورة",pasteImage:"لصق الصورة",merge:"دمج",unmerge:"تفكك",edit:"يحرر",clear:"لتوضيح"},link:{emailAddress:"بريد إلكتروني",emailSubject:"سمة",sheetPage:"مكان الملف",sheetCell:"مرجع الخلية",linkTypes:{web:"صفحة على الإنترنت",sheet:"هذا الملف",email:"بريد إلكتروني"},webUrl:"عنوان url",linkType:"نوع الارتباط"},download:{fileName:"اسم الملف",saveType:"حفظ باسم",saveTypes:{Original:"التنسيق الأصلي",XLSX:"تنسيق XLSX",PDF:"تنسيق PDF",HTML:"تنسيق HTML"}},print:{size:"حجم الورق",orientation:"اتجاه الصفحة",orientations:["افقي عمودي"]},format:{normal:"عادي",text:"نص عادي",number:"رقم",percent:"نسبة مئوية",rmb:"يوان",usd:"دولار",eur:"يورو",date:"تاريخ",time:"وقت",datetime:"وقت التاريخ",duration:"فترة"},formula:{sum:"تحسب مجموع مجموعة من القيم",average:"يحسب المتوسط ​​الحسابي لجميع المعلمات",max:"تحسب القيمة القصوى في مجموعة من الأرقام",min:"تحسب أصغر قيمة في مجموعة من الأرقام",_if:"وفقًا لنتيجة الحكم المنطقي للشرط المحدد هي صواب أو خطأ ، قم بإرجاع نتيجة الحساب التي تم تشغيلها بواسطة الشرط المقابل",and:'تقوم بإرجاع "صواب" منطقيًا فقط إذا كانت نتائج المعلمات "صواب" منطقية ، وإلا فإنها ترجع "خطأ" منطقيًا',or:'يتم إرجاع النتيجة على أنها "خطأ" منطقية فقط إذا كانت جميع قيم المعلمات "خطأ" منطقيًا ، وإلا فإنها ترجع "صواب" منطقيًا',concat:"ربط نصوص أو بيانات متعددة الأحرف في الخلايا معًا",count:"تحسب عدد الخلايا التي تحتوي على أرقام ,وتحسب الأرقام في قائمة الوسائط",sumif:"إضافة الخلايا المحددة بمعايير معينة",sumifs:"إضافة الخلايا في نطاق يلبي معايير متعددة",vlookup:"البحث في العمود الأول من المصفوفة ويتحرك عبر الصف لإرجاع قيمة الخلية",hlookup:"البحث عن قيمة في الصف العلوي من جدول أو مصفوفة من القيم ,ثم إرجاع قيمة في نفس العمود من صف تحدده في الجدول أو المصفوفة.",lookup:"البحث عن القيم في متجه أو مصفوفة",match:"البحث عن القيم في مرجع أو مصفوفة",rank:"إرجاع رتبة رقم في قائمة الأرقام",frequency:"ترجع توزيع التردد كصفيف عمودي",text:"تنسيق رقم وتحويله إلى نص",left:"إرجاع الأحرف الموجودة في أقصى اليسار من قيمة نصية",right:"إرجاع الأحرف الموجودة في أقصى اليمين من قيمة نصية",round:"لتقريب رقم إلى عدد محدد من الأرقام",index:"يستخدم فهرسًا لاختيار قيمة من مرجع أو مصفوفة",countif:"تحسب عدد الخلايا داخل النطاق الذي يفي بالمعايير المحددة",countifs:"تحسب عدد الخلايا الموجودة في النطاق التي تفي بمعايير متعددة",mid:"ترجع عددًا محددًا من الأحرف من سلسلة نصية تبدأ من الموضع الذي تحدده",len:"إرجاع عدد الأحرف في سلسلة نصية",power:"إرجاع نتيجة رقم مرفوع إلى أس",ceiling:"تقريب رقم إلى أقرب عدد صحيح أو إلى أقرب مضاعف ذي أهمية",floor:"تقريب رقم لأسفل باتجاه الصفر",substitute:"استبدال نص جديد بالنص القديم في سلسلة نصية",replace:"يستبدل الأحرف داخل النص",search:"البحث عن قيمة نصية داخل قيمة أخرى (ليست حساسة لحالة الأحرف)",find:"البحث عن قيمة نصية داخل أخرى (حساسة لحالة الأحرف)",isnumber:"ترجع TRUE إذا كانت القيمة رقمًا",istext:"ترجع TRUE إذا كانت القيمة نصًا",isblank:"ترجع TRUE إذا كانت القيمة فارغة",upper:"تحويل النص إلى أحرف كبيرة",lower:"تحويل النص إلى أحرف صغيرة",product:"تضاعف حججها",sumproduct:"إرجاع مجموع حاصل ضرب مكونات المصفوفة المقابلة",subtotal:"إرجاع إجمالي فرعي في قائمة أو قاعدة بيانات",counta:"تحسب عدد القيم الموجودة في قائمة الوسائط",averageif:"إرجاع المتوسط (الوسط الحسابي) لجميع الخلايا في النطاق الذي يفي بمعايير معينة",averageifs:"إرجاع المتوسط (الوسط الحسابي) لجميع الخلايا التي تفي بمعايير متعددة.",trim:"يزيل المسافات من النص",sign:"إرجاع علامة الرقم",yield:"إرجاع العائد على ورقة مالية ذات فائدة دورية",abs:"إعادة القيمة المطلقة لرقم",sin:"إرجاع جيب الزاوية لزاوية معينة",cos:"إرجاع جيب التمام لرقم",tan:"إرجاع ظل الرقم"},validation:{required:"يجب أن يكون مطلوبًا",notMatch:"لا يتطابق مع قواعد التحقق من الصحة الخاصة به",between:"ما بين {} و {}",notBetween:"إنه ليس بين {} و {}",notIn:"ليس في القائمة",equal:"انها تساوي {}",notEqual:"لا تساوي {}",lessThan:"إنه أقل من {}",lessThanEqual:"إنه أصغر من أو يساوي {}",greaterThan:"أكبر من {}",greaterThanEqual:"أكبر من أو يساوي {}",downloadImageFail:"فشل تحميل الصورة"},error:{pasteForMergedCell:"لا يمكن إجراء هذه العملية على الخلايا المدمجة"},calendar:{weeks:["الاحد الاثنين الثلاثاء الاربعاء الخميس الجمعة السبت"],months:["يناير ، فبراير ، مارس ، أبريل ، مايو ، يونيو ، يوليو ، أغسطس ، سبتمبر ، أكتوبر ، نوفمبر ، ديسمبر"]},button:{add:"اضف إليه",del:"يمسح",next:"التالي",cancel:"يلغي",remove:"يزيل",save:"يحفظ",ok:"يتأكد",previous:"سابق",close:"إنهاء"},sort:{desc:"فرز Z-> A",asc:"فرز A-> Z"},filter:{empty:"فارغ"},dataValidation:{mode:"نموذج",range:"نطاق الخلايا",criteria:"معيار",modeType:{cell:"خلية واحدة",column:"عمود",row:"خط"},type:{list:"قائمة",number:"رقم",date:"تاريخ",phone:"هاتف",email:"بريد إلكتروني"},operator:{be:"بين",nbe:"ليس بينهما",lt:"أقل من",lte:"اقل او يساوي",gt:"أكثر من",gte:"أكبر من أو يساوي",eq:"متساوي",neq:"لا يساوي"}},dataSort:{ci:"نِطَاق",criteria:"طلب",casesense:"حساسية الموضوع",sortby:"ترتيب حسب",header:"عنوان",msg:"الرجاء اختيار عمود مختلف مرتبة حسب المجال",msg2:"منطقة التحديد بها منطقة مدمجة ، لا ندعم فرز المنطقة المدمجة",order:{asc:"تسلسل إيجابي",desc:"ترتيب عكسي"}},dataSearch:{label:"العثور على المحتوى",lkinlb:"نطاق البحث",matchwhole:"يطابق المحتوى بأكمله",lookin:{values:"نص",formulas:"معادلة",comments:"حاشية. ملاحظة"}},dataComment:{label:"حاشية. ملاحظة"}},ja:{toolbar:{undo:"取り消す",redo:"やり直す",print:"印刷する",paintformat:"フォーマットペインター",clearformat:"クリアフォーマット",format:"データ形式",fontName:"フォント名",fontSize:"フォントサイズ",fontBold:"太字",fontItalic:"フォント斜体",underline:"下線",strike:"取り消し線",color:"テキストの色",bgcolor:"塗りつぶしの色",border:"フレーム",merge:"セルを結合します",unmerge:"セルの結合を解除する",align:"水平方向の配置",valign:"垂直方向の配置",textwrap:"ワードラップ",freeze:"固定ランク",autofilter:"フィルター",formula:"方式",more:"もっと",sort:"分類",download:"ダウンロード",pagination:"ページング",search:"検索",commentDefault:"テキストを入力してください",commentEdit:"コメントを編集",commentRemove:"コメントを削除",commentPrevious:"前のコメント",commentNext:"次のコメント",insertImage:"画像を挿入"},menubar:{undo:"元に戻す",redo:"やり直す",print:"印刷する",paintformat:"フォーマットペインター",clearformat:"クリアフォーマット",format:"データ形式",fontName:"フォント名:",fontSize:"フォントサイズ:",fontBold:"太字",fontItalic:"フォント斜体",underline:"下線",strike:"取り消し線",color:"テキストの色",bgcolor:"塗りつぶしの色",border:"フレーム",merge:"セルを結合します",unmerge:"セルの結合を解除する",align:"水平方向の配置",valign:"垂直方向の配置",textwrap:"ワードラップ",freeze:"固定ランク",autofilter:"フィルター",formula:"方式",more:"もっと",sort:"分類",download:"ダウンロード",download_HTML:"HTMLとしてダウンロード",download_PDF:"PDFとしてダウンロード",download_Original:"オリジナルをダウンロード",download_XLSX:"XLSXとしてダウンロード",download_GOOGLE:"Google ドライブに保存",download_DROPBOX:"ドロップボックスに保存",pagination:"ページング",search:"検索",commentDefault:"テキストを入力してください",insertSheet:"ワークシートを挿入",insertRow:"行を挿入",insertColumn:"列を挿入",link:"リンク",insertComment:"コメントを追加",commentEdit:"コメントを編集",commentRemove:"コメントを削除",commentPrevious:"前のコメント",commentNext:"次のコメント",insertImage:"画像を挿入",fromURL:"URLから",fromLocal:"ローカルから",menuInsert:"追加",menuComment:"チェック",menuText:"フォーマット",menuFont:"フォント",menuEdit:"表紙",menuFile:"書類"},contextmenu:{copy:"コピー",cut:"切る",paste:"ペースト",pasteValue:"値のみを貼り付けます",pasteFormat:"書式のみ貼り付け",hide:"隠れる",insertRow:"行を挿入",insertColumn:"列を挿入",deleteSheet:"シートを削除",deleteRow:"行を削除",deleteColumn:"列を削除",deleteCell:"セルを削除",deleteCellText:"セルのテキストを削除",validation:"データ検証",sort:"分類",link:"リンク",removeLink:"リンクを削除",editLink:"リンクを編集",openLink:"リンクを開く",download:"ダウンロード",cellprintable:"エクスポートを有効にする",cellnonprintable:"エクスポートを無効にする",celleditable:"編集を有効に",cellnoneditable:"編集を無効にする",insertURL:"画像アドレスを入力",deleteImage:"画像を削除",copyImage:"コピー画像",pasteImage:"絵を貼り付ける",merge:"マージ",unmerge:"マージを解除する",edit:"編集",clear:"クリアする"},link:{emailAddress:"Eメール",emailSubject:"テーマ",sheetPage:"ファイルの場所",sheetCell:"セル参照",linkTypes:{web:"ウェブページ",sheet:"このファイル",email:"Eメール"},webUrl:"URL",linkType:"リンクタイプ"},download:{fileName:"ファイル名",saveType:"名前を付けて保存",saveTypes:{Original:"オリジナルフォーマット",XLSX:"XLSX形式",PDF:"PDF形式",HTML:"HTML形式"}},print:{size:"用紙サイズ",orientation:"ページの向き",orientations:["水平垂直"]},format:{normal:"普通",text:"プレーンテキスト",number:"番号",percent:"パーセンテージ",rmb:"人民元",usd:"ドル",eur:"ユーロ",date:"日にち",time:"時間",datetime:"日付時刻",duration:"期間"},formula:{sum:"一連の値の合計を計算します",average:"すべてのパラメータの算術平均を計算します",max:"一連の桁の最大値を計算します",min:"一連の数字の最小値を計算します",_if:"指定した条件の論理判定結果が真か偽かに従って、該当する条件でトリガーされた計算結果を返す",and:"パラメータの結果が両方とも論理「真」の場合にのみ論理「真」を返し、それ以外の場合は論理「偽」を返します。",or:"結果は、すべてのパラメーター値が論理的に「false」である場合にのみ論理的な「false」として返され、それ以外の場合は論理的に「true」が返されます。",concat:"セル内の複数の文字テキストまたはデータを結合する",count:"数値を含むセルの数をカウントし、引数のリスト内の数値をカウントします",sumif:"特定の条件で指定されたセルを追加します",sumifs:"複数の基準を満たす範囲内のセルを追加します",vlookup:"配列の最初の列を調べ、行全体を移動してセルの値を返します",hlookup:"テーブルまたは値の配列の一番上の行の値を検索し、テーブルまたは配列で指定した行から同じ列の値を返します。",lookup:"ベクトルまたは配列内の値を検索します",match:"参照または配列内の値を検索します",rank:"数値のリスト内の数値のランクを返します",frequency:"度数分布を垂直配列として返します",text:"数値をフォーマットしてテキストに変換",left:"テキスト値から左端の文字を返します",right:"テキスト値から右端の文字を返します",round:"数値を指定された桁数に丸める",index:"インデックスを使用して、参照または配列から値を選択します",countif:"指定された基準を満たす範囲内のセルの数をカウントします",countifs:"複数の基準を満たす範囲内のセルの数をカウントします",mid:"指定した位置から始まるテキスト文字列から特定の文字数を返します",len:"テキスト文字列の文字数を返す",power:"累乗した数値の結果を返します",ceiling:"数値を最も近い整数または最も近い有効倍数に丸めます",floor:"数値をゼロに向かって切り捨てます",substitute:"テキスト文字列内の古いテキストを新しいテキストに置き換えます",replace:"テキスト内の文字を置き換えます",search:"別のテキスト値を検索します (大文字と小文字を区別しません)",find:"別のテキスト値を検索します (大文字と小文字を区別します)",isnumber:"値が数値の場合に TRUE を返します",istext:"値がテキストの場合、TRUE を返します",isblank:"値が空白の場合は TRUE を返します",upper:"テキストを大文字に変換します",lower:"テキストを小文字に変換します",product:"その引数を乗算します",sumproduct:"対応する配列コンポーネントの積の合計を返します",subtotal:"リストまたはデータベースの小計を返します",counta:"引数のリストにある値の数を数えます",averageif:"指定された基準を満たす範囲内のすべてのセルの平均 (算術平均) を返します",averageifs:"複数の基準を満たすすべてのセルの平均 (算術平均) を返します。",trim:"テキストからスペースを削除します",sign:"数値の符号を返します",yield:"定期的に利息を支払う証券の利回りを返します",abs:"数値の絶対値を返します",sin:"指定された角度の正弦を返します",cos:"数値のコサインを返します",tan:"数値のタンジェントを返します"},validation:{required:"必須でなければなりません",notMatch:"検証ルールと一致しません",between:"{} と {} の間にあります",notBetween:"{} と {} の間にありません",notIn:"それはリストにありません",equal:"{} に等しい",notEqual:"{} と等しくありません",lessThan:"{} 未満です",lessThanEqual:"{}以下です",greaterThan:"{} より大きい",greaterThanEqual:"{}以上です",downloadImageFail:"画像のダウンロードに失敗しました"},error:{pasteForMergedCell:"結合されたセルに対してこの操作を実行できません"},calendar:{weeks:["日曜日月曜日火曜日水曜日の木曜日金曜日土曜日"],months:["1月、2月、3月、4月、5月、6月、7月、8月、9月、10月、11月、12月"]},button:{add:"追加",del:"消去",next:"次",cancel:"キャンセル",remove:"削除",save:"保存",ok:"確認",previous:"前",close:"閉鎖"},sort:{desc:"Z->A で並べ替え",asc:"A->Z で並べ替え"},filter:{empty:"空"},dataValidation:{mode:"モデル",range:"セル範囲",criteria:"標準",modeType:{cell:"単細胞",column:"桁",row:"ライン"},type:{list:"リスト",number:"桁",date:"日にち",phone:"電話",email:"Eメール"},operator:{be:"間",nbe:"間にない",lt:"未満",lte:"以下",gt:"以上",gte:"以上",eq:"同等",neq:"等しくない"}},dataSort:{ci:"範囲",criteria:"注文",casesense:"大文字と小文字を区別",sortby:"並び替え",header:"タイトル",msg:"フィールドでソートされた別の列を選択してください",msg2:"選択領域には結合領域があります。結合領域の並べ替えはサポートされていません",order:{asc:"ポジティブシーケンス",desc:"逆順"}},dataSearch:{label:"コンテンツを見つける",lkinlb:"検索範囲",matchwhole:"コンテンツ全体に一致",lookin:{values:"文章",formulas:"方式",comments:"注釈"}},dataComment:{label:"注釈"}},tr:{toolbar:{undo:"geri çekmek",redo:"yeniden yapmak",print:"Yazdır",paintformat:"Biçim boyacısı",clearformat:"formatı temizle",format:"Veri formatı",fontName:"Yazı tipi adı",fontSize:"yazı Boyutu",fontBold:"Yazı tipi kalın",fontItalic:"italik yazı tipi",underline:"altını çizmek",strike:"üstü çizili",color:"metin rengi",bgcolor:"dolgu rengi",border:"çerçeve",merge:"Hücreleri Birleştir",unmerge:"hücreleri ayır",align:"Yatay hizalama",valign:"dikey hizalama",textwrap:"kelime sarma",freeze:"sabit rütbeler",autofilter:"filtre",formula:"formül",more:"Daha",sort:"sınıflandırma",download:"indirmek",pagination:"çağrı",search:"aramak",commentDefault:"lütfen metni girin",commentEdit:"yorumları düzenle",commentRemove:"yorumu sil",commentPrevious:"Önceki yorum",commentNext:"sonraki yorum",insertImage:"resim ekle"},menubar:{undo:"geri alma",redo:"yeniden yapmak",print:"Yazdır",paintformat:"Biçim boyacısı",clearformat:"formatı temizle",format:"Veri formatı",fontName:"Yazı tipi adı:",fontSize:"yazı Boyutu:",fontBold:"Yazı tipi kalın",fontItalic:"italik yazı tipi",underline:"altını çizmek",strike:"üstü çizili",color:"metin rengi",bgcolor:"dolgu rengi",border:"çerçeve",merge:"Hücreleri Birleştir",unmerge:"hücreleri ayır",align:"Yatay hizalama",valign:"dikey hizalama",textwrap:"kelime sarma",freeze:"sabit rütbeler",autofilter:"filtre",formula:"formül",more:"Daha",sort:"sınıflandırma",download:"indirmek",download_HTML:"HTML olarak indir",download_PDF:"PDF olarak indir",download_Original:"orijinali indir",download_XLSX:"XLSX olarak indir",download_GOOGLE:"Google Drive'a kaydet",download_DROPBOX:"Dropbox'a kaydet",pagination:"çağrı",search:"aramak",commentDefault:"lütfen metni girin",insertSheet:"çalışma sayfası ekle",insertRow:"satır ekle",insertColumn:"sütun ekle",link:"bağlantı",insertComment:"yorum ekle",commentEdit:"yorumları düzenle",commentRemove:"yorumu sil",commentPrevious:"Önceki yorum",commentNext:"sonraki yorum",insertImage:"resim ekle",fromURL:"URL'den",fromLocal:"yerelden",menuInsert:"a ekle",menuComment:"Kontrol etmek",menuText:"Biçim",menuFont:"yazı tipi",menuEdit:"ön Sayfa",menuFile:"belge"},contextmenu:{copy:"kopyalamak",cut:"kesmek",paste:"yapıştırmak",pasteValue:"Yalnızca değeri yapıştırın",pasteFormat:"Yalnızca biçimlendirmeyi yapıştır",hide:"saklamak",insertRow:"satır ekle",insertColumn:"sütun ekle",deleteSheet:"sayfayı sil",deleteRow:"sırayı sil",deleteColumn:"sütunu sil",deleteCell:"hücreyi sil",deleteCellText:"hücre metnini sil",validation:"Veri doğrulama",sort:"sınıflandırma",link:"bağlantı",removeLink:"bağlantıyı sil",editLink:"bağlantıyı düzenle",openLink:"linki aç",download:"indirmek",cellprintable:"dışa aktarmayı etkinleştir",cellnonprintable:"dışa aktarmayı devre dışı bırak",celleditable:"düzenlemeyi etkinleştir",cellnoneditable:"düzenlemeyi devre dışı bırak",insertURL:"Resim adresini girin",deleteImage:"resmi sil",copyImage:"resmi kopyala",pasteImage:"resim yapıştır",merge:"birleştirmek",unmerge:"çözmek",edit:"düzenlemek",clear:"temizlemek için"},link:{emailAddress:"e-posta",emailSubject:"tema",sheetPage:"dosya konumu",sheetCell:"hücre referansı",linkTypes:{web:"web sayfası",sheet:"bu dosya",email:"e-posta"},webUrl:"url",linkType:"bağlantı türü"},download:{fileName:"dosya adı",saveType:"Farklı kaydet",saveTypes:{Original:"orijinal biçim",XLSX:"XLSX formatı",PDF:"PDF biçimi",HTML:"HTML biçimi"}},print:{size:"kağıt boyutu",orientation:"Sayfa yönlendirmesi",orientations:["yatay dikey"]},format:{normal:"sıradan",text:"düz metin",number:"sayı",percent:"yüzde",rmb:"Yuan",usd:"Dolar",eur:"EUR",date:"tarih",time:"zaman",datetime:"tarih saat",duration:"dönem"},formula:{sum:"Bir dizi değerin toplamını hesaplar",average:"Tüm parametrelerin aritmetik ortalamasını hesaplar",max:"Bir dizi basamaktaki maksimum değeri hesaplar",min:"Bir dizi basamaktaki en küçük değeri hesaplar",_if:"Belirtilen koşulun mantıksal yargı sonucuna göre doğru veya yanlış, karşılık gelen koşul tarafından tetiklenen hesaplama sonucunu döndür",and:'Yalnızca parametrelerin sonuçlarının her ikisi de mantıksal "true" ise mantıksal "true" değerini döndürür, aksi takdirde mantıksal "false" değerini döndürür.',or:'Sonuç, yalnızca tüm parametre değerleri mantıksal olarak "yanlış" ise mantıksal olarak "yanlış" olarak döndürülür, aksi takdirde mantıksal olarak "doğru" olarak döner.',concat:"Hücrelerdeki birden çok karakterli metni veya verileri birbirine bağlayın",count:"sayı içeren hücrelerin sayısını sayar ve bağımsız değişkenler listesindeki sayıları sayar",sumif:"Belirli bir kritere göre belirtilen hücreleri ekler",sumifs:"Birden çok kriteri karşılayan bir aralıktaki hücreleri ekler",vlookup:"Bir dizinin ilk sütununa bakar ve bir hücrenin değerini döndürmek için satır boyunca hareket eder",hlookup:"Bir tablonun veya bir değerler dizisinin üst satırında bir değer arar ve ardından tablo veya dizide belirttiğiniz bir satırdan aynı sütunda bir değer döndürür.",lookup:"Bir vektör veya dizideki değerleri arar",match:"Bir başvuru veya dizideki değerleri arar",rank:"Bir sayı listesindeki bir sayının sırasını döndürür",frequency:"Dikey bir dizi olarak bir frekans dağılımı döndürür",text:"Bir sayıyı biçimlendirir ve metne dönüştürür",left:"Bir metin değerinden en soldaki karakterleri döndürür",right:"Bir metin değerinden en sağdaki karakterleri döndürür",round:"Bir sayıyı belirtilen basamak sayısına yuvarlar",index:"Bir başvurudan veya diziden bir değer seçmek için bir dizin kullanır",countif:"Belirtilen ölçütleri karşılayan bir aralıktaki hücre sayısını sayar",countifs:"Bir aralıktaki birden çok kriteri karşılayan hücre sayısını sayar",mid:"Belirttiğiniz konumdan başlayarak bir metin dizisinden belirli sayıda karakter döndürür",len:"Bir metin dizisindeki karakter sayısını döndürür",power:"Bir kuvvete yükseltilmiş bir sayının sonucunu döndürür",ceiling:"Bir sayıyı en yakın tamsayıya veya en yakın anlamlılık katına yuvarlar",floor:"Bir sayıyı sıfıra doğru aşağı yuvarlar",substitute:"Bir metin dizisindeki eski metnin yerine yeni metni koyar",replace:"Metin içindeki karakterleri değiştirir",search:"Bir metin değerini diğerinin içinde bulur (büyük/küçük harfe duyarlı değildir)",find:"Bir metin değerini diğerinin içinde bulur (büyük/küçük harfe duyarlı)",isnumber:"Değer bir sayı ise DOĞRU döndürür",istext:"Değer metin ise DOĞRU döndürür",isblank:"Değer boşsa DOĞRU döndürür",upper:"Metni büyük harfe dönüştürür",lower:"Metni küçük harfe dönüştürür",product:"Argümanlarını çoğaltır",sumproduct:"Karşılık gelen dizi bileşenlerinin çarpımlarının toplamını döndürür",subtotal:"Listede veya veritabanında bir ara toplam döndürür",counta:"Argüman listesinde kaç tane değer olduğunu sayar",averageif:"Belirli bir kriteri karşılayan bir aralıktaki tüm hücrelerin ortalamasını (aritmetik ortalama) verir",averageifs:"Birden çok kriteri karşılayan tüm hücrelerin ortalamasını (aritmetik ortalama) döndürür.",trim:"Metindeki boşlukları kaldırır",sign:"Bir sayının işaretini döndürür",yield:"Periyodik faiz ödeyen bir menkul kıymetin getirisini verir",abs:"Bir sayının mutlak değerini döndürür",sin:"Verilen açının sinüsünü verir",cos:"Bir sayının kosinüsünü döndürür",tan:"Bir sayının teğetini döndürür"},validation:{required:"gerekli olmalı",notMatch:"doğrulama kurallarına uymuyor",between:"{} ile {} arasındadır",notBetween:"{} ile {} arasında değil",notIn:"listede yok",equal:"{} eşittir",notEqual:"{}'e eşit değil",lessThan:"{} değerinden küçük",lessThanEqual:"{}'den küçük veya eşittir",greaterThan:"{} değerinden büyük",greaterThanEqual:"{}'den büyük veya eşittir",downloadImageFail:"Resim indirilemedi"},error:{pasteForMergedCell:"Birleştirilmiş hücrelerde bu işlem gerçekleştirilemez"},calendar:{weeks:["Pazar Pazartesi Salı Çarşamba Perşembe Cuma Cumartesi"],months:["Ocak, Şubat, Mart, Nisan, Mayıs, Haziran, Temmuz, Ağustos, Eylül, Ekim, Kasım, Aralık"]},button:{add:"a ekle",del:"silmek",next:"Sonraki",cancel:"İptal etmek",remove:"kaldırmak",save:"kaydetmek",ok:"onaylamak",previous:"Öncesi",close:"kapanış"},sort:{desc:"Sırala Z->A",asc:"A->Z Sırala"},filter:{empty:"boş"},dataValidation:{mode:"modeli",range:"hücre aralığı",criteria:"standart",modeType:{cell:"tek hücre",column:"kolon",row:"astar"},type:{list:"liste",number:"hane",date:"tarih",phone:"Telefon",email:"e-posta"},operator:{be:"arasında",nbe:"arasında değil",lt:"daha az",lte:"küçük veya eşit",gt:"daha fazla",gte:"büyük veya eşittir",eq:"eşit",neq:"eşit değil"}},dataSort:{ci:"kapsam",criteria:"emir",casesense:"harfe duyarlı",sortby:"göre sırala",header:"başlık",msg:"Lütfen alana göre sıralanmış farklı bir sütun seçin",msg2:"Seçim alanında birleştirilmiş alan var, birleştirilmiş alanın sıralanmasını desteklemiyoruz",order:{asc:"Pozitif dizi",desc:"Ters sipariş"}},dataSearch:{label:"içerik bul",lkinlb:"arama aralığı",matchwhole:"tüm içerikle eşleşir",lookin:{values:"metin",formulas:"formül",comments:"dipnot"}},dataComment:{label:"dipnot"}},th:{toolbar:{undo:"ถอน",redo:"ทำซ้ำ",print:"พิมพ์",paintformat:"ฟอร์แมตจิตรกร",clearformat:"รูปแบบที่ชัดเจน",format:"รูปแบบข้อมูล",fontName:"ชื่อแบบอักษร",fontSize:"ขนาดตัวอักษร",fontBold:"แบบอักษรตัวหนา",fontItalic:"ตัวอักษรตัวเอียง",underline:"ขีดเส้นใต้",strike:"ขีดทับ",color:"สีข้อความ",bgcolor:"เติมสี",border:"กรอบ",merge:"ผสานเซลล์",unmerge:"ยกเลิกการผสานเซลล์",align:"การจัดตำแหน่งแนวนอน",valign:"การจัดตำแหน่งแนวตั้ง",textwrap:"ตัดคำ",freeze:"อันดับคงที่",autofilter:"กรอง",formula:"สูตร",more:"มากกว่า",sort:"การจัดหมวดหมู่",download:"ดาวน์โหลด",pagination:"เพจ",search:"ค้นหา",commentDefault:"กรุณาใส่ข้อความ",commentEdit:"แก้ไขความคิดเห็น",commentRemove:"ลบความคิดเห็น",commentPrevious:"ความคิดเห็นที่แล้ว",commentNext:"ความคิดเห็นถัดไป",insertImage:"แทรกรูปภาพ"},menubar:{undo:"เลิกทำ",redo:"ทำซ้ำ",print:"พิมพ์",paintformat:"ฟอร์แมตจิตรกร",clearformat:"รูปแบบที่ชัดเจน",format:"รูปแบบข้อมูล",fontName:"ชื่อแบบอักษร:",fontSize:"ขนาดตัวอักษร:",fontBold:"แบบอักษรตัวหนา",fontItalic:"ตัวอักษรตัวเอียง",underline:"ขีดเส้นใต้",strike:"ขีดทับ",color:"สีข้อความ",bgcolor:"เติมสี",border:"กรอบ",merge:"ผสานเซลล์",unmerge:"ยกเลิกการผสานเซลล์",align:"การจัดตำแหน่งแนวนอน",valign:"การจัดตำแหน่งแนวตั้ง",textwrap:"ตัดคำ",freeze:"อันดับคงที่",autofilter:"กรอง",formula:"สูตร",more:"มากกว่า",sort:"การจัดหมวดหมู่",download:"ดาวน์โหลด",download_HTML:"ดาวน์โหลดเป็น HTML",download_PDF:"ดาวน์โหลดเป็น PDF",download_Original:"ดาวน์โหลดต้นฉบับ",download_XLSX:"ดาวน์โหลดเป็น XLSX",download_GOOGLE:"บันทึกไปยัง Google ไดรฟ์",download_DROPBOX:"บันทึกไปยัง Dropbox",pagination:"เพจ",search:"ค้นหา",commentDefault:"กรุณาใส่ข้อความ",insertSheet:"ใส่แผ่นงาน",insertRow:"แทรกแถว",insertColumn:"แทรกคอลัมน์",link:"ลิงค์",insertComment:"เพิ่มความเห็น",commentEdit:"แก้ไขความคิดเห็น",commentRemove:"ลบความคิดเห็น",commentPrevious:"ความคิดเห็นที่แล้ว",commentNext:"ความคิดเห็นถัดไป",insertImage:"แทรกรูปภาพ",fromURL:"จาก URL",fromLocal:"จากท้องถิ่น",menuInsert:"เพิ่ม",menuComment:"ตรวจสอบ",menuText:"รูปแบบ",menuFont:"แบบอักษร",menuEdit:"หน้าแรก",menuFile:"เอกสาร"},contextmenu:{copy:"สำเนา",cut:"ที่จะตัด",paste:"แปะ",pasteValue:"วางเฉพาะค่า",pasteFormat:"วางรูปแบบเท่านั้น",hide:"ซ่อน",insertRow:"แทรกแถว",insertColumn:"แทรกคอลัมน์",deleteSheet:"ลบแผ่นงาน",deleteRow:"ลบแถว",deleteColumn:"ลบคอลัมน์",deleteCell:"ลบเซลล์",deleteCellText:"ลบข้อความในเซลล์",validation:"การตรวจสอบข้อมูล",sort:"การจัดหมวดหมู่",link:"ลิงค์",removeLink:"ลบลิงค์",editLink:"แก้ไขลิงค์",openLink:"เปิดลิ้งค์",download:"ดาวน์โหลด",cellprintable:"เปิดใช้งานการส่งออก",cellnonprintable:"ปิดใช้งานการส่งออก",celleditable:"เปิดใช้งานการแก้ไข",cellnoneditable:"ปิดใช้งานการแก้ไข",insertURL:"ป้อนที่อยู่รูปภาพ",deleteImage:"ลบรูปภาพ",copyImage:"คัดลอกรูปภาพ",pasteImage:"วางรูปภาพ",merge:"ผสาน",unmerge:"ยกเลิกการผสาน",edit:"แก้ไข",clear:"เพื่อล้าง"},link:{emailAddress:"อีเมล",emailSubject:"ธีม",sheetPage:"ตำแหน่งไฟล์",sheetCell:"การอ้างอิงเซลล์",linkTypes:{web:"หน้าเว็บ",sheet:"ไฟล์นี้",email:"อีเมล"},webUrl:"URL",linkType:"ประเภทลิงค์"},download:{fileName:"ชื่อไฟล์",saveType:"บันทึกเป็น",saveTypes:{Original:"รูปแบบเดิม",XLSX:"รูปแบบ XLSX",PDF:"รูปแบบ PDF",HTML:"รูปแบบ HTML"}},print:{size:"ขนาดกระดาษ",orientation:"การวางแนวหน้า",orientations:["แนวนอนแนวตั้ง"]},format:{normal:"สามัญ",text:"ข้อความธรรมดา",number:"ตัวเลข",percent:"เปอร์เซ็นต์",rmb:"หยวน",usd:"ดอลลาร์",eur:"ยูโร",date:"วันที่",time:"เวลา",datetime:"วันเวลา",duration:"ระยะเวลา"},formula:{sum:"คำนวณผลรวมของชุดค่าต่างๆ",average:"คำนวณค่าเฉลี่ยเลขคณิตของพารามิเตอร์ทั้งหมด",max:"คำนวณค่าสูงสุดในชุดของหลัก",min:"คำนวณค่าที่น้อยที่สุดในชุดของหลัก",_if:"ตามผลการตัดสินเชิงตรรกะของเงื่อนไขที่ระบุเป็นจริงหรือเท็จ ให้ส่งคืนผลการคำนวณที่ทริกเกอร์ตามเงื่อนไขที่สอดคล้องกัน",and:'จะส่งกลับตรรกะ "จริง" ก็ต่อเมื่อผลลัพธ์ของพารามิเตอร์มีทั้งตรรกะ "จริง" มิฉะนั้นจะส่งกลับตรรกะ "เท็จ"',or:'ผลลัพธ์จะถูกส่งกลับเป็นตรรกะ "เท็จ" เฉพาะในกรณีที่ค่าพารามิเตอร์ทั้งหมดเป็น "เท็จ" ทางตรรกะ มิฉะนั้นจะส่งกลับทางตรรกะ "จริง"',concat:"เชื่อมต่อข้อความหรือข้อมูลหลายตัวในเซลล์เข้าด้วยกัน",count:"นับจำนวนเซลล์ที่มีตัวเลข และนับจำนวนภายในรายการอาร์กิวเมนต์",sumif:"เพิ่มเซลล์ที่ระบุโดยเกณฑ์ที่กำหนด",sumifs:"เพิ่มเซลล์ในช่วงที่ตรงตามเกณฑ์หลายข้อ",vlookup:"ดูในคอลัมน์แรกของอาร์เรย์และเลื่อนข้ามแถวเพื่อส่งกลับค่าของเซลล์",hlookup:"ค้นหาค่าในแถวบนสุดของตารางหรืออาร์เรย์ของค่า แล้วส่งกลับค่าในคอลัมน์เดียวกันจากแถวที่คุณระบุในตารางหรืออาร์เรย์",lookup:"ค้นหาค่าในเวกเตอร์หรืออาร์เรย์",match:"ค้นหาค่าในการอ้างอิงหรืออาร์เรย์",rank:"ส่งกลับอันดับของตัวเลขในรายการตัวเลข",frequency:"ส่งกลับการแจกแจงความถี่เป็นอาร์เรย์แนวตั้ง",text:"จัดรูปแบบตัวเลขและแปลงเป็นข้อความ",left:"ส่งกลับอักขระซ้ายสุดจากค่าข้อความ",right:"ส่งกลับอักขระที่อยู่ขวาสุดจากค่าข้อความ",round:"ปัดเศษตัวเลขเป็นจำนวนหลักที่ระบุ",index:"ใช้ดัชนีเพื่อเลือกค่าจากการอ้างอิงหรืออาร์เรย์",countif:"นับจำนวนเซลล์ภายในช่วงที่ตรงตามเกณฑ์ที่กำหนด",countifs:"นับจำนวนเซลล์ภายในช่วงที่ตรงตามเกณฑ์หลายข้อ",mid:"ส่งคืนอักขระจำนวนหนึ่งจากสตริงข้อความที่เริ่มต้นที่ตำแหน่งที่คุณระบุ",len:"ส่งกลับจำนวนอักขระในสตริงข้อความ",power:"ส่งคืนผลลัพธ์ของตัวเลขที่ยกกำลัง",ceiling:"ปัดเศษตัวเลขให้เป็นจำนวนเต็มที่ใกล้เคียงที่สุดหรือเป็นผลคูณของนัยสำคัญที่ใกล้ที่สุด",floor:"ปัดตัวเลขลง เข้าหาศูนย์",substitute:"แทนที่ข้อความใหม่สำหรับข้อความเก่าในสตริงข้อความ",replace:"แทนที่อักขระภายในข้อความ",search:"ค้นหาค่าข้อความหนึ่งค่าภายในค่าอื่น (ไม่คำนึงถึงตัวพิมพ์เล็กและใหญ่)",find:"ค้นหาค่าข้อความหนึ่งค่าภายในค่าอื่น (คำนึงถึงตัวพิมพ์เล็กและใหญ่)",isnumber:"ส่งกลับค่า TRUE หากค่าเป็นตัวเลข",istext:"คืนค่า TRUE หากค่าเป็นข้อความ",isblank:"คืนค่า TRUE หากค่าเป็นค่าว่าง",upper:"แปลงข้อความเป็นตัวพิมพ์ใหญ่",lower:"แปลงข้อความเป็นตัวพิมพ์เล็ก",product:"ทวีคูณอาร์กิวเมนต์",sumproduct:"ส่งคืนผลรวมของผลคูณของส่วนประกอบอาร์เรย์ที่สอดคล้องกัน",subtotal:"ส่งคืนผลรวมย่อยในรายการหรือฐานข้อมูล",counta:"นับจำนวนค่าที่อยู่ในรายการอาร์กิวเมนต์",averageif:"ส่งกลับค่าเฉลี่ย (ค่าเฉลี่ยเลขคณิต) ของเซลล์ทั้งหมดในช่วงที่ตรงกับเกณฑ์ที่กำหนด",averageifs:"ส่งกลับค่าเฉลี่ย (ค่าเฉลี่ยเลขคณิต) ของเซลล์ทั้งหมดที่ตรงกับหลายเกณฑ์",trim:"ลบช่องว่างออกจากข้อความ",sign:"ส่งคืนเครื่องหมายของตัวเลข",yield:"ส่งคืนผลตอบแทนของหลักทรัพย์ที่จ่ายดอกเบี้ยเป็นงวด",abs:"คืนค่าสัมบูรณ์ของตัวเลข",sin:"คืนค่าไซน์ของมุมที่กำหนด",cos:"คืนค่าโคไซน์ของตัวเลข",tan:"ส่งคืนแทนเจนต์ของตัวเลข"},validation:{required:"จะต้องมี",notMatch:"ไม่ตรงกับกฎการตรวจสอบ",between:"อยู่ระหว่าง {} ถึง {}",notBetween:"ไม่อยู่ระหว่าง {} ถึง {}",notIn:"มันไม่ได้อยู่ในรายการ",equal:"มันเท่ากับ {}",notEqual:"มันไม่เท่ากับ {}",lessThan:"มีค่าน้อยกว่า {}",lessThanEqual:"มันน้อยกว่าหรือเท่ากับ {}",greaterThan:"มันมากกว่า {}",greaterThanEqual:"มันมากกว่าหรือเท่ากับ {}",downloadImageFail:"ดาวน์โหลดภาพไม่สำเร็จ"},error:{pasteForMergedCell:"ไม่สามารถดำเนินการนี้กับเซลล์ที่ผสาน"},calendar:{weeks:["อาทิตย์, จันทร์, อังคาร, พุธ, พฤหัสบดี, ศุกร์, เสาร์"],months:["มกราคม กุมภาพันธ์ มีนาคม เมษายน พฤษภาคม มิถุนายน กรกฎาคม สิงหาคม กันยายน ตุลาคม พฤศจิกายน ธันวาคม"]},button:{add:"เพิ่ม",del:"ลบ",next:"ต่อไป",cancel:"ยกเลิก",remove:"ลบ",save:"บันทึก",ok:"ยืนยัน",previous:"ก่อนหน้า",close:"ปิด"},sort:{desc:"เรียง Z->A",asc:"เรียง A->Z"},filter:{empty:"ว่างเปล่า"},dataValidation:{mode:"แบบอย่าง",range:"ช่วงเซลล์",criteria:"มาตรฐาน",modeType:{cell:"เซลล์เดียว",column:"คอลัมน์",row:"เส้น"},type:{list:"รายการ",number:"หลัก",date:"วันที่",phone:"โทรศัพท์",email:"อีเมล"},operator:{be:"ระหว่าง",nbe:"ไม่ใช่ระหว่าง",lt:"น้อยกว่า",lte:"น้อยกว่าหรือเท่ากับ",gt:"มากกว่า",gte:"มากกว่าหรือเท่ากับ",eq:"เท่ากัน",neq:"ไม่เท่ากับ"}},dataSort:{ci:"ขอบเขต",criteria:"คำสั่ง",casesense:"กรณีที่สำคัญ",sortby:"จัดเรียงตาม",header:"ชื่อ",msg:"โปรดเลือกคอลัมน์อื่นที่จัดเรียงตามฟิลด์",msg2:"พื้นที่การเลือกมีพื้นที่ที่ผสาน เราไม่สนับสนุนการเรียงลำดับพื้นที่ที่ผสาน",order:{asc:"ลำดับที่เป็นบวก",desc:"ลำดับย้อนกลับ"}},dataSearch:{label:"ค้นหาเนื้อหา",lkinlb:"ช่วงการค้นหา",matchwhole:"ตรงกับเนื้อหาทั้งหมด",lookin:{values:"ข้อความ",formulas:"สูตร",comments:"คำอธิบายประกอบ"}},dataComment:{label:"คำอธิบายประกอบ"}},cht:{toolbar:{undo:"撤銷",redo:"重做",print:"打印",paintformat:"格式刷",clearformat:"清除格式",format:"數據格式",fontName:"字體名稱",fontSize:"字體大小",fontBold:"字體粗體",fontItalic:"字體斜體",underline:"下劃綫",strike:"刪除綫",color:"文字顏色",bgcolor:"填充顏色",border:"邊框",merge:"合併單元格",unmerge:"取消合併單元格",align:"水平對齊",valign:"垂直對齊",textwrap:"文字換行",freeze:"固定行列",autofilter:"過濾器",formula:"公式",more:"更多",sort:"分類",download:"下載",pagination:"分頁",search:"搜索",commentDefault:"請輸入文字",commentEdit:"編輯批注",commentRemove:"删除批注",commentPrevious:"上一條批注",commentNext:"下一條批注",insertImage:"插入圖片"},menubar:{undo:"撤消",redo:"重做",print:"打印",paintformat:"格式刷",clearformat:"清除格式",format:"數據格式",fontName:"字體名稱:",fontSize:"字體大小:",fontBold:"字體粗體",fontItalic:"字體斜體",underline:"下劃綫",strike:"刪除綫",color:"文字顏色",bgcolor:"填充顏色",border:"邊框",merge:"合併單元格",unmerge:"取消合併單元格",align:"水平對齊",valign:"垂直對齊",textwrap:"文字換行",freeze:"固定行列",autofilter:"過濾器",formula:"公式",more:"更多",sort:"分類",download:"下載",download_HTML:"下載為HTML",download_PDF:"下載為PDF",download_Original:"下載原件",download_XLSX:"下載為XLSX",download_GOOGLE:"保存至GoogleDrive",download_DROPBOX:"保存至Dropbox",pagination:"分頁",search:"搜索",commentDefault:"請輸入文字",insertSheet:"插入工作表",insertRow:"插入行",insertColumn:"插入列",link:"連結",insertComment:"添加批注",commentEdit:"編輯批注",commentRemove:"删除批注",commentPrevious:"上一條批注",commentNext:"下一條批注",insertImage:"插入圖片",fromURL:"來自URL",fromLocal:"來自本地",menuInsert:"添加",menuComment:"查看",menuText:"格式",menuFont:"字體",menuEdit:"首頁",menuFile:"文件"},contextmenu:{copy:"複製",cut:"剪切",paste:"粘貼",pasteValue:"僅粘貼值",pasteFormat:"僅粘貼格式",hide:"隱藏",insertRow:"插入行",insertColumn:"插入列",deleteSheet:"删去工作表",deleteRow:"删除行",deleteColumn:"删除列",deleteCell:"删除儲存格",deleteCellText:"删除儲存格文字",validation:"數據驗證",sort:"分類",link:"連結",removeLink:"删除連結",editLink:"編輯連結",openLink:"打開連結",download:"下載",cellprintable:"啟用匯出",cellnonprintable:"禁用匯出",celleditable:"啟用編輯",cellnoneditable:"禁用編輯",insertURL:"輸入影像地址",deleteImage:"删除圖片",copyImage:"複製圖片",pasteImage:"粘貼圖片",merge:"合併",unmerge:"取消合併",edit:"編輯",clear:"清除"},link:{emailAddress:"電子郵箱",emailSubject:"主題",sheetPage:"檔案位置",sheetCell:"儲存格引用",linkTypes:{web:"網頁",sheet:"本檔案",email:"電子郵箱"},webUrl:"網址",linkType:"連結類型"},download:{fileName:"文檔名稱",saveType:"另存為",saveTypes:{Original:"原格式",XLSX:"XLSX格式",PDF:"PDF格式",HTML:"HTML格式"}},print:{size:"紙張大小",orientation:"頁面方向",orientations:["橫向,縱向"]},format:{normal:"普通",text:"純文字",number:"數字",percent:"百分比",rmb:"人民幣",usd:"美元",eur:"歐元",date:"日期",time:"時間",datetime:"日期時間",duration:"期間"},formula:{sum:"計算一組值的總和",average:"計算所有參數的算術平均值",max:"計算一組數位中的最大值",min:"計算一組數位中的最小值",_if:"根據指定條件的邏輯判斷結果的真或假,返回相應條件觸發的計算結果",and:"只有當參數的結果都是邏輯“true”時,它才會返回邏輯“true”,否則返回邏輯“false”",or:"只有當所有參數值在邏輯上都為“false”時,結果才返回為邏輯“false”,否則返回為邏輯上的“true”",concat:"將單元格中的多個字符文本或數據連接在一起",count:"計算包含數字的單元格數量,併計算參數列表中的數字",sumif:"添加給定條件指定的單元格",sumifs:"添加滿足多個條件的範圍內的單元格",vlookup:"查看數組的第一列並跨行移動以返回單元格的值",hlookup:"在表的第一行或值數組中搜索一個值,然後從您在表或數組中指定的行的同一列中返回一個值",lookup:"在向量或數組中查找值",match:"在引用或數組中查找值",rank:"返回一個數字在數字列表中的排名",frequency:"以垂直數組形式返回頻率分佈",text:"格式化數字並將其轉換為文本",left:"返回文本值最左邊的字符",right:"返回文本值中最右邊的字符",round:"將數字四捨五入到指定位數",index:"使用索引從引用或數組中選擇一個值",countif:"計算範圍內滿足給定條件的單元格數",countifs:"計算範圍內滿足多個條件的單元格數",mid:"從指定位置開始的文本字符串中返回特定數量的字符",len:"返回文本字符串中的字符數",power:"返回一個數的冪的結果",ceiling:"將數字四捨五入到最接近的整數或最接近的有效倍數",floor:"將數字向下舍入為零",substitute:"用新文本替換文本字符串中的舊文本",replace:"替換文本中的字符",search:"在另一個文本值中查找一個文本值(不區分大小寫)",find:"在一個文本值中查找另一個文本值(區分大小寫)",isnumber:"如果值為數字則返回 TRUE",istext:"如果值為文本則返回 TRUE",isblank:"如果值為空則返回 TRUE",upper:"將文本轉換為大寫",lower:"將文本轉換為小寫",product:"乘以它的論點",sumproduct:"返回對應數組元素的乘積之和",subtotal:"返回列表或數據庫中的小計",counta:"計算參數列表中有多少個值",averageif:"返回範圍內滿足給定條件的所有單元格的平均值(算術平均值)",averageifs:"返回滿足多個條件的所有單元格的平均值(算術平均值)。",trim:"從文本中刪除空格",sign:"返回數字的符號",yield:"返回支付定期利息的證券的收益率",abs:"返回數字的絕對值",sin:"返回給定角度的正弦值",cos:"返回數字的餘弦值",tan:"返回數字的正切"},validation:{required:"它必須是必需的",notMatch:"它與其驗證規則不匹配",between:"它介於{}和{}之間",notBetween:"它不在{}和{}之間",notIn:"它不在清單中",equal:"它等於{}",notEqual:"它不等於{}",lessThan:"它小於{}",lessThanEqual:"它小於或等於{}",greaterThan:"它大於{}",greaterThanEqual:"它大於或等於{}",downloadImageFail:"下載影像失敗"},error:{pasteForMergedCell:"無法對合併的儲存格執行此操作"},calendar:{weeks:["周日、週一、週二、週三、週四、週五、週六"],months:["一月、二月、三月、四月、五月、六月、七月、八月、九月、十月、十一月、十二月"]},button:{add:"添加",del:"删除",next:"下一個",cancel:"取消",remove:"去除",save:"保存",ok:"確認",previous:"前一個",close:"關閉"},sort:{desc:"排序Z->A",asc:"排序A->Z"},filter:{empty:"空的"},dataValidation:{mode:"模式",range:"儲存格範圍",criteria:"標準",modeType:{cell:"單間牢房",column:"柱",row:"一行"},type:{list:"清單",number:"數位",date:"日期",phone:"電話",email:"電子郵件"},operator:{be:"之間",nbe:"不介於",lt:"少於",lte:"小於或等於",gt:"大於",gte:"大於或等於",eq:"等於",neq:"不等於"}},dataSort:{ci:"範圍",criteria:"順序",casesense:"區分大小寫",sortby:"排序依據",header:"標題",msg:"請選擇按欄位排序的不同列",msg2:"選擇區域有合併區域,我們不支持對合併區域進行排序",order:{asc:"正序",desc:"逆序"}},dataSearch:{label:"查找內容",lkinlb:"查找範圍",matchwhole:"匹配整個內容",lookin:{values:"文本",formulas:"公式",comments:"批注"}},dataComment:{label:"批注"}}};function N(e,t){if(t){var i,n=j(B);try{for(n.s();!(i=n.n()).done;){var r=i.value;if(!t[r])break;for(var a=t[r],o=e.match(/(?:\\.|[^.])+/g),s=0;s<o.length;s+=1){var l=a[o[s]];if(!l)break;if(s===o.length-1)return l;a=l}}}catch(e){n.e(e)}finally{n.f()}}}function U(e){var t=N(e,H);return!t&&window&&window.x_spreadsheet&&window.x_spreadsheet.$messages&&(t=N(e,window.x_spreadsheet.$messages)),t||""}function X(e){return function(){return U(e)}}function W(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];i?B=[e]:B.unshift(e),t&&(H[e]=t)}function q(e){H[e]||(e="en"),B[0]=e}var Y={phone:/^[1-9]\d{10}$/,email:/^(\w)+(\.\w+)*@(\w)+((\.\w+)+)$/};function V(e,t){var i="";if(!e){for(var n=arguments.length,r=new Array(n>2?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];i=U.apply(void 0,["validation.".concat(t)].concat(r))}return[e,i]}var G=function(){function e(t,i,n,r){l()(this,e),this.required=i,this.value=n,this.type=t,this.operator=r,this.message=""}return o()(e,[{key:"parseValue",value:function(e){var t=this.type;return"date"===t?new Date(e):"number"===t?Number(e):e}},{key:"equals",value:function(e){var t=this.type===e.type&&this.required===e.required&&this.operator===e.operator;return t&&(t=Array.isArray(this.value)?F.arrayEquals(this.value,e.value):this.value===e.value),t}},{key:"values",value:function(){return this.value.split(",")}},{key:"validate",value:function(e){var t=this.required,i=this.operator,n=this.value,a=this.type;if(t&&/^\s*$/.test(e))return V(!1,"required");if(/^\s*$/.test(e))return[!0];if(Y[a]&&!Y[a].test(e))return V(!1,"notMatch");if("list"===a)return V(this.values().includes(e),"notIn");if(i){var o=this.parseValue(e);if("be"===i){var s=r()(n,2),l=s[0],c=s[1];return V(o>=this.parseValue(l)&&o<=this.parseValue(c),"between",l,c)}if("nbe"===i){var h=r()(n,2),u=h[0],f=h[1];return V(o<this.parseValue(u)||o>this.parseValue(f),"notBetween",u,f)}if("eq"===i)return V(o===this.parseValue(n),"equal",n);if("neq"===i)return V(o!==this.parseValue(n),"notEqual",n);if("lt"===i)return V(o<this.parseValue(n),"lessThan",n);if("lte"===i)return V(o<=this.parseValue(n),"lessThanEqual",n);if("gt"===i)return V(o>this.parseValue(n),"greaterThan",n);if("gte"===i)return V(o>=this.parseValue(n),"greaterThanEqual",n)}return[!0]}}]),e}(),Z=function(){function e(t,i,n){l()(this,e),this.refs=i,this.mode=t,this.validator=n}return o()(e,[{key:"includes",value:function(e,t){for(var i=this.refs,n=0;n<i.length;n+=1){if(x.valueOf(i[n]).includes(e,t))return!0}return!1}},{key:"addRef",value:function(e){this.remove(x.valueOf(e)),this.refs.push(e)}},{key:"remove",value:function(e){var t=[];this.refs.forEach((function(i){var n=x.valueOf(i);n.intersects(e)?n.difference(e).forEach((function(e){return t.push(e.toString())})):t.push(i)})),this.refs=t}},{key:"getData",value:function(){var e=this.refs,t=this.mode,i=this.validator;return{refs:e,mode:t,type:i.type,required:i.required,operator:i.operator,value:i.value}}}],[{key:"valueOf",value:function(t){var i=t.refs,n=t.mode,r=t.type,a=t.required,o=t.operator,s=t.value;return new e(n,i,new G(r,a,s,o))}}]),e}(),K=function(){function e(){l()(this,e),this._=[],this.errors=new Map}return o()(e,[{key:"getError",value:function(e,t){return this.errors.get("".concat(e,"_").concat(t))}},{key:"validate",value:function(e,t,i){var n=this.get(e,t),a="".concat(e,"_").concat(t),o=this.errors;if(null!==n){var s=n.validator.validate(i),l=r()(s,2),c=l[0],h=l[1];c?o.delete(a):o.set(a,h)}else o.delete(a);return!0}},{key:"add",value:function(e,t,i){var n=i.type,r=i.required,a=i.value,o=i.operator,s=new G(n,r,a,o),l=this.getByValidator(s);null!==l?l.addRef(t):this._.push(new Z(e,[t],s))}},{key:"getByValidator",value:function(e){for(var t=0;t<this._.length;t+=1){var i=this._[t];if(i.validator.equals(e))return i}return null}},{key:"get",value:function(e,t){for(var i=0;i<this._.length;i+=1){var n=this._[i];if(n.includes(e,t))return n}return null}},{key:"remove",value:function(e){var t="".concat(e.sri,"_").concat(e.sci);this.errors.has(t)&&this.errors.delete(t),this.each((function(t){t.remove(e)}))}},{key:"each",value:function(e){this._.forEach((function(t){return e(t)}))}},{key:"getData",value:function(){return this._.filter((function(e){return e.refs.length>0})).map((function(e){return e.getData()}))}},{key:"setData",value:function(e){this._=e.map((function(e){return Z.valueOf(e)}))}}]),e}(),J=function e(){l()(this,e),this.keywords="",this.current=1,this.result=[]},Q=i(3),ee=i.n(Q),te=i(4),ie=i.n(te),ne=i(1),re=i.n(ne),ae="x-spreadsheet";window.devicePixelRatio;function oe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var se=function(e){ee()(i,e);var t=oe(i);function i(e){var n;return l()(this,i),(n=t.call(this,"div","".concat(ae,"-icon"))).iconNameEl=f("div","".concat(ae,"-icon-img ").concat(e)),n.child(n.iconNameEl),n}return o()(i,[{key:"setName",value:function(e){this.iconNameEl.className("".concat(ae,"-icon-img ").concat(e))}}]),i}(u);function le(e,t,i){var n=f("div","".concat(ae,"-toast")),r=f("div","".concat(ae,"-dimmer active"));n.children(f("div","".concat(ae,"-toast-header")).children(new se("close").on("click.stop",(function(){return document.body.removeChild(n.el),document.body.removeChild(r.el),void(i&&i())})),e),f("div","".concat(ae,"-toast-content")).html(t)),document.body.appendChild(n.el),document.body.appendChild(r.el);var a=n.box(),o=a.width,s=a.height,l=document.documentElement,c=l.clientHeight,h=l.clientWidth;n.offset({left:(h-o)/2,top:(c-s)/3})}var ce={mode:"edit",updateMode:"client",updateUrl:"",folderName:"",fileName:"",view:{height:function(){return document.documentElement.clientHeight},width:function(){return document.documentElement.clientWidth}},showToolbar:!0,showPartToolbar:!1,showContextmenu:!0,showFileName:!0,row:{len:100,height:25},col:{len:26,width:100,indexWidth:60,minWidth:60},style:{align:"left",valign:"middle",textwrap:!1,strike:!1,underline:!1,color:"#0a0a0a",font:{name:"Arial",size:10,bold:!1,italic:!1},format:"normal"}};function he(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=this.merges,a=t.clone(),o=e.size(),s=r()(o,2),l=s[0],c=s[1],h=t.size(),u=r()(h,2),f=u[0],d=u[1];return l>f&&(a.eri=t.sri+l-1),c>d&&(a.eci=t.sci+c-1),this.getRangeLocked(a)?(i("Protected worksheet,the target area contains locked cells"),!1):n.intersects(a)?(i(U("error.pasteForMergedCell")),!1):e.equals(a)?(i("The selection area is same "),!1):!e.intersects(a)||!(f>l&&Math.abs(t.sri-e.sri)%l!=0||d>c&&Math.abs(t.sci-e.sci)%c!=0)||(i("Invalid selection area"),!1)}function ue(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=this.rows,o=this.merges,s=this.name,l=a.copyPaste(e,t,i,n,(function(e,t,i){if(i&&i.merge){var n=r()(i.merge,2),a=n[0],s=n[1];if(a<=0&&s<=0)return;o.add(new x(e,t,e+a,t+s))}}));n?this.updateBatchCellsOpr(s,l,e,t,i):this.copyPasteRangeOpr(s,e,t,i)}function fe(e,t){var i=this.clipboard,n=this.rows,r=this.merges,a=this.name;n.cutPaste(e,t),r.move(e,t.sri-e.sri,t.sci-e.sci),i.clear(),this.cutPasteRangeOpr(a,e,t)}function de(e,t,i){var n=this.styles,r=this.rows.getCellOrNew(e,t),a={};void 0!==r.style&&(a=F.cloneDeep(n[r.style])),a=F.merge(a,{border:i}),r.style=this.addStyle(a)}function me(e){var t=this,i=e.mode,n=e.style,a=e.color,o=this.styles,s=this.selector,l=this.rows,c=s.range,h=c.sri,u=c.sci,f=c.eri,d=c.eci,m=!this.isSignleSelected();if(m||"inside"!==i&&"horizontal"!==i&&"vertical"!==i)if("outside"!==i||m){if("none"===i)s.range.each((function(e,i){var n=l.getCell(e,i);if(n&&void 0!==n.style){var r=F.cloneDeep(o[n.style]);delete r.border,n.style=t.addStyle(r)}}));else if("all"===i||"inside"===i||"outside"===i||"horizontal"===i||"vertical"===i)!function(){for(var e=[],o=h;o<=f;o+=1)for(var s=u;s<=d;s+=1){for(var c=[],g=0;g<e.length;g+=1){var v=r()(e[g],4),p=v[0],y=v[1],b=v[2],w=v[3];if(o===p+b+1&&c.push(g),p<=o&&o<=p+b&&s===y){s+=w+1;break}}if(c.forEach((function(t){return e.splice(t,1)})),s>d)break;var x=l.getCell(o,s),k=0,C=0;if(x&&x.merge){var S=r()(x.merge,2);k=S[0],C=S[1],e.push([o,s,k,C])}var _=k>0&&o+k===f,T=C>0&&s+C===d,O={};"all"===i?O={bottom:[n,a],top:[n,a],left:[n,a],right:[n,a]}:"inside"===i?(!T&&s<d&&(O.right=[n,a]),!_&&o<f&&(O.bottom=[n,a])):"horizontal"===i?!_&&o<f&&(O.bottom=[n,a]):"vertical"===i?!T&&s<d&&(O.right=[n,a]):"outside"===i&&m&&(h===o&&(O.top=[n,a]),(_||f===o)&&(O.bottom=[n,a]),u===s&&(O.left=[n,a]),(T||d===s)&&(O.right=[n,a])),Object.keys(O).length>0&&de.call(t,o,s,O),s+=C}}();else if("top"===i||"bottom"===i)for(var g=u;g<=d;g+=1)"top"===i&&(de.call(this,h,g,{top:[n,a]}),g+=l.getCellMerge(h,g)[1]),"bottom"===i&&(de.call(this,f,g,{bottom:[n,a]}),g+=l.getCellMerge(f,g)[1]);else if("left"===i||"right"===i)for(var v=h;v<=f;v+=1)"left"===i&&(de.call(this,v,u,{left:[n,a]}),v+=l.getCellMerge(v,u)[0]),"right"===i&&(de.call(this,v,d,{right:[n,a]}),v+=l.getCellMerge(v,d)[0])}else de.call(this,h,u,{top:[n,a],bottom:[n,a],left:[n,a],right:[n,a]})}function ge(e,t){var i=this.rows,n=this.scroll,r=this.freezeTotalHeight(),a=this.settings.row.height,o=this.exceptRowSet;0===n.riact&&this.freeze[0]>0&&(n.riact=this.freeze[0]);var s=a+r,l=e>s?n.riact:0;0===l&&(s=a);for(var c=0;l<i.len&&!(s>e);l+=1)o.has(l)||(s+=c=i.getHeight(l));return{ri:l-1,top:s-=c,height:c}}function ve(e,t){var i=this.cols,n=this.displayRight2Left,a=this.freezeTotalWidth(),o=i.indexWidth;if(n){var s=this.viewWidth();a+i.indexWidth<s-e&&(o-=t);var l=F.rangeReduceIf(0,i.len,o,i.indexWidth,s-e,(function(e){return i.getWidth(e)})),c=r()(l,3),h=c[0],u=c[1],f=c[2];return u<=0?{ci:-1,left:s,width:i.indexWidth}:{ci:h-1,left:s-u,width:f}}a+i.indexWidth<e&&(o-=t);var d=F.rangeReduceIf(0,i.len,o,i.indexWidth,e,(function(e){return i.getWidth(e)})),m=r()(d,3),g=m[0],v=m[1],p=m[2];return v<=0?{ci:-1,left:0,width:i.indexWidth}:{ci:g-1,left:v,width:p}}var pe=function(){function e(t,i){l()(this,e),this.settings=F.merge(ce,i||{}),this.name=t||"sheet",this.freeze=[0,0],this.styles=[],this.merges=new I,this.rows=new M(this.settings.row),this.cols=new L(this.settings.col),this.validations=new K,this.hyperlinks=[],this.comments=[],this.viewRangeCache={},this.highlighttxts=[],this.highlightrg=[],this.highlighshapes=[],this.highlighimgs=[],this.highlightIR=null,this.highlightall=!1,this.showhighlight=!1,this.highlightstyle=null,this.selector=new C,this.scroll=new S,this.history=new _,this.updateRows=new Set,this.updateCols=new Set,this.updateRowsHeight=new Set,this.clipboard=new T,this.autoFilter=new R,this.TableAutoFilters=[],this.menubarStatus=function(){},this.change=function(){},this.updateCellsData=function(){},this.updateCellServer=function(){},this.updateServerError=function(){},this.updateCellError=function(){},this.loadImages=function(){},this.loadShapes=function(){},this.fillImageSrc=function(){},this.fillImageOnebyOne=function(){},this.loadConditionImage=function(){},this.reloadImagesShapes=function(){},this.scrollImagesShapes=function(){},this.exceptRowSet=new Set,this.sortedRowMap=new Map,this.unsortedRowMap=new Map,this.isupdating=!1,this.search=new J,this.showGrid=!0,this.zoomlevel=1,this.isImageOk=!1}return o()(e,[{key:"addValidation",value:function(e,t,i){var n=this;this.changeData((function(){n.validations.add(e,t,i)}))}},{key:"removeValidation",value:function(){var e=this,t=this.selector.range;this.changeData((function(){e.validations.remove(t)}))}},{key:"getHighlightCellTxt",value:function(e,t){var i=this;return this.showhighlight&&!this.highlightall?this.highlighttxts.reduce((function(n,r){return r.row===e&&r.col===t&&(r.color=i.highlightstyle.color,n.push(r)),n}),[]):[]}},{key:"getSelectedValidator",value:function(){var e=this.selector,t=e.ri,i=e.ci,n=this.validations.get(t,i);return n?n.validator:null}},{key:"getSelectedValidation",value:function(){var e=this.selector,t=e.ri,i=e.ci,n=e.range,r=this.validations.get(t,i),a={ref:n.toString()};return null!==r&&(a.mode=r.mode,a.validator=r.validator),a}},{key:"getSelectedSort",value:function(){var e=this.selector,t=e.ci,i=e.range,n={ref:i.toString(),ci:[0,1,2]},r=this.merges;n.sort=[];for(var a=[],o=i.sri,s=i.eri,l=i.sci,c=i.eci,h=0;h<r._.length;h+=1){var u=r._[h];if(u.sri>=o&&u.eri<=s&&u.sci>=l&&u.eci<=c)return le("error","".concat(U("dataSort.msg2"))),null}for(var f=o+1;f<=s;f+=1){var d=this.getCell(f,t);null===d||/^\s*$/.test(d.text)||a.push(d.text)}n.m=a;for(var m=new Map,g=new Map,p=0,y=l;y<=c;y++,p++){var b=this.getCell(o,y),w="";w=null===b||/^\s*$/.test(b.text)?"(Column "+v(y)+")":b.text,m.set(p,w),g.set(p,"(Column "+v(y)+")")}return n.mcols=m,n.mcolsheader=g,n}},{key:"canUndo",value:function(){return this.history.canUndo()}},{key:"canRedo",value:function(){return this.history.canRedo()}},{key:"undo",value:function(){var e=this;this.history.undo((function(t){return e.getRangeData(t.range)}),(function(t){e.setRangeData(t)}))}},{key:"redo",value:function(){var e=this;this.history.redo((function(t){return e.getRangeData(t.range)}),(function(t){e.setRangeData(t)}))}},{key:"copy",value:function(){this.clipboard.copy(this.selector.range,this.rows)}},{key:"cut",value:function(){this.clipboard.cut(this.selector.range)}},{key:"paste",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=this.clipboard,r=this.selector;return!n.isClear()&&(!!he.call(this,n.range,r.range,i)&&(this.changeData((function(){var i=r.range.extendRange(n.range);r.range.setToOther(i),n.isCopy()?ue.call(e,n.range,i,t):n.isCut()&&fe.call(e,n.range,i)})),!0))}},{key:"pasteFromText",value:function(e){var t=this,i=this.name,n=e.split("\r\n").map((function(e){return e.replace(/"/g,"").split("\t")}));if(n.length>0&&""==n[n.length-1]&&(n.length-=1),n.length>=1){var r=this.rows,a=this.selector;this.changeData((function(){var e=r.paste(n,a.range);t.updateBatchCellsOpr(i,e)}))}}},{key:"autofill",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=this.selector.range;return-1==r.sci&&(r.sci=0),-1==r.sri&&(r.sri=0),-1==e.sci&&(e.sci=0),-1==e.sri&&(e.sri=0),!!he.call(this,r,e,n)&&(this.changeData((function(){ue.call(i,r,e,t,!0)}),!0,e),!0)}},{key:"clearClipboard",value:function(){this.clipboard.clear()}},{key:"calSelectedRangeByEnd",value:function(e,t){var i=this.selector,n=this.rows,r=this.cols,a=this.merges,o=i.range,s=o.sri,l=o.sci,c=o.eri,h=o.eci,u=i.ri,f=i.ci,d=e,m=t;return e<0&&(d=n.len-1),t<0&&(m=r.len-1),d>u?(s=u,c=d):(s=d,c=u),m>f?(l=f,h=m):(l=m,h=f),i.range=a.union(new x(s,l,c,h)),i.range=a.union(i.range),i.range}},{key:"calSelectedRangeByStart",value:function(e,t){var i=this.selector,n=this.rows,r=this.cols,a=this.merges.getFirstIncludes(e,t);return null===a&&(a=new x(e,t,e,t),-1===e&&(a.sri=0,a.eri=n.len-1),-1===t&&(a.sci=0,a.eci=r.len-1)),i.range=a,a}},{key:"setSelectedCellAttr",value:function(e,t){var i=this;this.changeData((function(){var n=i.selector,a=i.styles,o=i.rows,s=i.name;if("merge"===e)t?i.merge():i.unmerge();else if("border"===e)me.call(i,t);else if("formula"===e){var l=n.ri,c=n.ci,h=n.range;if(n.multiple()){var u=n.size(),f=r()(u,2),d=f[0],m=f[1],g=h.sri,v=h.sci,p=h.eri,y=h.eci;if(d>1)for(var w=v;w<=y;w+=1){o.getCellOrNew(p+1,w).text="=".concat(t,"(").concat(b(w,g),":").concat(b(w,p),")")}else if(m>1){o.getCellOrNew(l,y+1).text="=".concat(t,"(").concat(b(v,l),":").concat(b(y,l),")")}}else{o.getCellOrNew(l,c).text="=".concat(t,"()")}}else n.range.each((function(n,r){var l=o.getCellOrNew(n,r),c={};if(void 0!==l.style&&(c=F.cloneDeep(a[l.style])),"format"===e)c.format=t,"normal"===t?(delete c.number,delete c.custom):"text"===t?(c.number=49,delete c.custom):"number"===t?(c.custom="#,##0.00_",delete c.number):"percent"===t?(c.number=10,delete c.custom):"rmb"===t?(c.custom="[$¥-804]#,##0.00",delete c.number):"usd"===t?(c.custom="$#,##0.00",delete c.number):"eur"===t?(c.custom="[$€-408]#,##0.00",delete c.number):"date"===t?(c.custom="mm/dd/yyyy",delete c.number):"time"===t?(c.number=21,delete c.custom):"datetime"===t?(c.custom="mm/dd/yyyy hh:mm:ss",delete c.number):"duration"===t&&(c.custom="[h]:mm:ss",delete c.number),l.style=i.addStyle(c),i.updateCellStyleOpr(s,n,r,c);else if("font-bold"===e||"font-italic"===e||"font-name"===e||"font-size"===e){var h={};h[e.split("-")[1]]=t,c.font=Object.assign(c.font||{},h),l.style=i.addStyle(c)}else"strike"===e||"textwrap"===e||"underline"===e||"align"===e||"valign"===e||"color"===e||"bgcolor"===e||"pbgcolor"===e||"pattern"===e?(c[e]=t,l.style=i.addStyle(c),"align"===e&&delete l.isautoalign):l[e]=t}))}))}},{key:"setHyperlinkStyle",value:function(e,t,i){var n=this.rows,r=this.styles,a=n.getCellOrNew(e,t),o={};void 0!==a.style&&(o=F.cloneDeep(r[a.style])),o.underline=i,o.color=i?"#0000ff":"Black",a.style=this.addStyle(o)}},{key:"setSelectedCellText",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"input",i=this.autoFilter,n=this.selector,r=this.rows,a=n.ri,o=n.ci,s=a;this.unsortedRowMap.has(a)&&(s=this.unsortedRowMap.get(a));var l=r.getCell(s,o),c=l?l.text:"";if(this.setCellText(s,o,e,t),i.active()){var h=i.getFilter(o);if(h){var u=h.value.findIndex((function(e){return e===c}));u>=0&&h.value.splice(u,1,e)}}}},{key:"getSelectedCell",value:function(){var e=this.selector,t=e.ri,i=e.ci,n=t;return this.unsortedRowMap.has(t)&&(n=this.unsortedRowMap.get(t)),this.rows.getCell(n,i)}},{key:"canSelected",value:function(e,t){if(!this.sprotected)return!0;var i=e;this.unsortedRowMap.has(e)&&(i=this.unsortedRowMap.get(e));var n=this.getCellStyle(i,t);return null==n?this.canselectlocked:!(!n.unlocked||!this.canselectunlocked)||!(n.unlocked||!this.canselectlocked)}},{key:"isfirstRowCellsContainsFormula",value:function(e){for(var t=e.sci;t<=e.eci;t+=1){var i=this.getCell(e.sri,t);if(null!=i&&void 0!==i.f)return!0}return!1}},{key:"getLocked",value:function(){var e=this.selector,t=e.ri,i=e.ci;return this.getCellLocked(t,i)}},{key:"getCellLocked",value:function(e,t){if(!this.sprotected)return!1;var i=e;this.unsortedRowMap.has(e)&&(i=this.unsortedRowMap.get(e));var n=this.getCellStyle(i,t);return!(null!=n&&n.unlocked)}},{key:"getRangeLocked",value:function(e){for(var t=e.sri;t<=e.eri;t+=1)for(var i=e.sci;i<=e.eci;i+=1)if(this.getCellLocked(t,i))return!0;return!1}},{key:"xyInSelectedRect",value:function(e,t){var i=this.getSelectedRect(),n=i.left,r=i.top,a=i.width,o=i.height,s=this.settings.row.height,l=e-this.cols.indexWidth,c=t-s;return l>n&&l<n+a&&c>r&&c<r+o}},{key:"getSelectedRectBySearch",value:function(){return this.getRect(this.selector.range)}},{key:"getSelectedRect",value:function(){var e=this.selector.range.clone();if(this.freezeIsActive()){if(e.sri>=this.freeze[0]&&e.eri<this.scroll.riact)return{left:-99999,top:-99999};e.sri>=this.freeze[0]&&e.sri<this.scroll.riact&&(e.sri=this.scroll.riact)}else{if(e.eri<this.scroll.riact)return{left:-99999,top:-99999};e.sri<this.scroll.riact&&(e.sri=this.scroll.riact)}return this.getRect(e)}},{key:"getRectForTextbox",value:function(e){var t=this.scroll,i=(this.rows,this.cols),n=(this.exceptRowSet,this.displayRight2Left),a=this.freeze,o=this.zoomlevel,s=new x(e.row,e.col,e.row,e.col),l=s.sri,c=s.sci,h=(s.eri,s.eci);if(l<0&&c<0)return{left:0,l:0,top:0,t:0,scroll:t};var u=r()(a,2)[1],f=n?e.left+i.indexWidth:e.left,d=e.top,m=e.height,g=e.width,v=n?u>0&&h>=u||0===u?f-t.x:f:f-t.x,p=this.freezeTotalHeight(),y=this.freezeTotalWidth(),b=e.top-t.y;return y>0&&y>f&&!n&&(v=f),p>0&&p>d&&(b=d),{l:f*o,t:d*o,left:v*o,top:b*o,height:m*o,width:g*o,scroll:t}}},{key:"getClipboardRect",value:function(){var e=this.clipboard;return e.isClear()?{left:-100,top:-100}:this.getRect(e.range)}},{key:"getRect",value:function(e){var t=this.scroll,i=this.rows,n=this.cols,a=this.exceptRowSet,o=this.displayRight2Left,s=this.freeze,l=this.zoomlevel,c=e.sri,h=e.sci,u=e.eri,f=e.eci;if(c<0&&h<0)return{left:0,l:0,top:0,t:0,scroll:t};var d=r()(s,2)[1],m=o?this.viewWidth()-n.indexWidth-n.sumWidth(0,f+1):n.sumWidth(0,h),g=i.sumHeight(0,c,a),v=i.sumHeight(c,u+1,a)*l,p=n.sumWidth(h,f+1)*l,y=o?d>0&&f>=d||0===d?m+t.x:m:m-t.x,b=this.freezeTotalHeight(),w=this.freezeTotalWidth(),x=i.sumHeight(t.riact,c,a)+b;return w>0&&w>m&&!o&&(y=m),b>0&&b>g&&(x=g),{l:m*l,t:g*l,left:y*l,top:x*l,height:v,width:p,scroll:t}}},{key:"getCellRectByXY",value:function(e,t){var i=this.scroll,n=this.merges,r=this.rows,a=this.cols,o=this.zoomlevel,s=ge.call(this,t,i.y),l=s.ri,c=s.top,h=s.height,u=ve.call(this,e,i.x),f=u.ci,d=u.left,m=u.width;if(-1===f&&(m=a.totalWidth()),-1===l&&(h=r.totalHeight()),l>=0||f>=0){var g=n.getFirstIncludes(l,f);if(g){l=g.sri,f=g.sci;var v=this.cellRectWithOutTransfer(l,f);d=v.left,c=v.top,m=v.width,h=v.height}}return{ri:l,ci:f,left:d*o,top:c*o,width:m*o,height:h*o}}},{key:"isSignleSelected",value:function(){var e=this.selector.range,t=e.sri,i=e.sci,n=e.eri,a=e.eci,o=this.getCell(t,i);if(o&&o.merge){var s=r()(o.merge,2),l=s[0],c=s[1];if(t+l===n&&i+c===a)return!0}return!this.selector.multiple()}},{key:"canUnmerge",value:function(){var e=this.selector.range,t=e.sri,i=e.sci,n=e.eri,a=e.eci,o=this.getCell(t,i);if(o&&o.merge){var s=r()(o.merge,2),l=s[0],c=s[1];if(t+l===n&&i+c===a)return!0}return!1}},{key:"merge",value:function(){var e=this.selector,t=this.rows;if(!this.isSignleSelected()){var i=e.size(),n=r()(i,2),a=n[0],o=n[1];if(a>1||o>1){var s=e.range,l=s.sri,c=s.sci,h=t.getCellOrNew(l,c);h.merge=[a-1,o-1],this.merges.add(e.range),this.rows.deleteCells(e.range),this.rows.setCell(l,c,h)}}}},{key:"unmerge",value:function(){var e=this.selector;if(this.isSignleSelected()){var t=e.range,i=t.sri,n=t.sci;this.rows.deleteCell(i,n,"merge"),this.merges.deleteWithin(e.range)}}},{key:"canAutofilter",value:function(){return!this.autoFilter.active()}},{key:"autofilter",value:function(){var e=this,t=this.autoFilter,i=this.selector,n=this.TableAutoFilters;if(!t.active())for(var r=0,a=n.length;r<a;r++){var o=n[r],s=x.valueOf(o.ref);if(!(s.eci<i.range.sci||i.range.eci<s.sci))return void le("Warning","there is already table autofilter in the selected range")}this.changeData((function(){t.active()?(t.clear(),e.exceptRowSet=new Set,e.sortedRowMap=new Map,e.unsortedRowMap=new Map):t.ref=i.range.toString()}))}},{key:"autoSort",value:function(){var e=this.autoFilter,t=this.selector;this.changeData((function(){e.filters=[],e.ref=t.range.toString()}))}},{key:"sortByRowIdArray",value:function(e,t){for(var i=this.rows,n=e.sri,r=e.eri,a=e.sci,o=e.eci,s=[],l=0,c=t.length;l<c;l++){for(var h=i._[t[l]].cells,u=[],f=a;f<=o;f++)void 0!==h[f]&&u.push({id:f,v:F.cloneDeep(h[f])});s.push(u)}for(var d=0,m=n;m<=r;m++)if(t[d++]!==m){for(var g=i._[m].cells,v=a;v<=o;v++)delete g[v];for(var p=s[d-1],y=0,b=p.length;y<b;y++){var w=p[y];g[w.id]=w.v}}}},{key:"doSort",value:function(e,t,i){var n=this.name,r=this.selector.range,a=(r.sri,r.eri,r.sci,r.eci,{name:n,src:r,ci:e,order:t,isheader:i,op:"sort"});this.updateCellServer(a)}},{key:"setAutoFilter",value:function(e,t,i,n){var r=this.currentAutoFilter;void 0===r&&(r=this.autoFilter),r.addFilter(e,i,n),r.setSort(e,t),this.resetAutoFilter()}},{key:"resetAutoFilter",value:function(){var e=this,t=this.currentAutoFilter,i=this.rows,n=t;if(void 0===n&&(n=this.autoFilter),n.active()){var r=n.sort,a=n.filteredRows((function(e,t){return i.getCell(e,t)})),o=a.rset,s=a.fset,l=Array.from(s),c=Array.from(s);r&&l.sort((function(e,t){if("desc"===r.order){var n=e;e=t,t=n}var a=i.getCell(e,r.ci),o=i.getCell(t,r.ci);if(null!=a&&""===a.text&&(a=null),null!=o&&""===o.text&&(o=null),null==a&&null==o)return e-t;if(null==a)return"asc"===r.order?1:-1;if(null==o)return"asc"===r.order?-1:1;a=a.text,o=o.text;var s=isNaN(Number(a)),l=isNaN(Number(o));return s&&l?a.localeCompare(o):s&&!l?1:!s&&l?-1:Number(a)-Number(o)})),this.exceptRowSet=o,this.sortedRowMap=new Map,this.unsortedRowMap=new Map,l.forEach((function(t,i){e.sortedRowMap.set(c[i],t),e.unsortedRowMap.set(t,c[i])}))}}},{key:"deleteExceptRowHideForAutoFilter",value:function(){var e=this.exceptRowSet,t=this.rows;e.forEach((function(e){t.get(e)&&(t.get(e).hide=void 0)}))}},{key:"updateMyConditionImages",value:function(e){var t=this.conditionimg,i=(this.rows,this.styles,this);e&&e.forEach((function(e){if(t){var n=t.find((function(t){return t.row===e.row&&t.col===e.col}));n?n.image.src="data:image/png;base64,"+e.data:i.insertConditionImage(e)}}))}},{key:"createConditionImage",value:function(e,t){var i=this.displayRight2Left,n=new Image;n.src="data:image/png;base64,"+e.data;var r=this.cols.sumWidth(0,e.col),a=this.rows.sumHeight(0,e.row);if(0===e.type){n.style.zIndex=t+1;var o=this.getCellStyle(e.row,e.col);null!=o&&"bottom"===o.valign&&(a+=this.rows.getHeight(e.row)-16)}else n.style.zIndex=t,n.style.opacity=.88;if((this.rows.isHide(e.row)||this.cols.isHide(e.col)||this.exceptRowSet.has(e.row))&&(n.style.display="none"),i){var s=this.viewWidth();n.style.left=s-r+"px"}else n.style.left=r+"px";if(n.style.top=a+"px",n.style.position="absolute",void 0===e.ol){var l=parseInt(n.style.left),c=parseInt(n.style.top);e.ol=l,e.ot=c}return n}},{key:"updateConditionImageVisible",value:function(){var e=this.exceptRowSet,t=this.rows,i=this.cols;this.conditionimg&&this.conditionimg.forEach((function(n){t.isHide(n.row)||i.isHide(n.col)||e.has(n.row)?n.image.style.display="none":n.image.style.display="block"}))}},{key:"updateConditionImageDirection",value:function(){var e=this.displayRight2Left,t=this.cols,i=this.zoomlevel,n=this.viewWidth()-t.indexWidth;this.conditionimg&&this.conditionimg.forEach((function(r){r.image&&(r.image.style.left=e?(n-r.ol-t.getWidth(r.col))*i+"px":r.ol*i+"px")}))}},{key:"updateConditionImageZoom",value:function(){this.exceptRowSet,this.rows,this.cols;var e=this.zoomlevel;this.conditionimg&&this.conditionimg.forEach((function(t){if(t.ow||(t.ow=t.image.width,t.oh=t.image.height),t.image.style.left=t.ol*e+"px",t.image.style.top=t.ot*e+"px",t.ow){t.image.height;t.image.width=t.ow*e,1===t.type&&(t.image.height=t.oh*e)}}))}},{key:"updateConditionImagePositionForCol",value:function(e,t,i){var n=this.displayRight2Left,r=this.cols,a=this.zoomlevel;if(this.conditionimg){var o=this.viewWidth()-r.indexWidth;this.conditionimg.forEach((function(s){if(s.col>e)s.ol+=t,s.image.style.left=n?(o-s.ol-r.getWidth(s.col))*a+"px":s.ol*a+"px";else if(s.col===e){if(1===s.type){var l=s.image.height;s.image.width=i*a,s.ow=i,s.image.height=l}n&&(s.image.style.left=(o-s.ol-r.getWidth(s.col))*a+"px")}}))}}},{key:"updateConditionImagePositionForRow",value:function(e,t,i){var n=this.zoomlevel;this.conditionimg&&this.conditionimg.forEach((function(r){if(r.row>e)r.ot+=t,r.image.style.top=r.ot*n+"px";else if(r.row===e&&1===r.type){var a=r.image.width;r.image.height=i*n,r.oh=i,r.image.width=a}}))}},{key:"updateConditionImageForColInsert",value:function(e,t){var i=this.conditionimg,n=this.cols,r=this.displayRight2Left,a=this.zoomlevel;if(i){var o=this.viewWidth()-n.indexWidth,s=n.sumWidth(e,t+1),l=t-e+1;i.forEach((function(t){t.col>=e&&(t.ol+=s,t.image.style.left=r?(o-t.ol-n.getWidth(t.col))*a+"px":t.ol*a+"px",l&&(t.col+=l))}))}}},{key:"updateConditionImageForRowInsert",value:function(e,t){var i=this.conditionimg,n=this.rows,r=this.zoomlevel;if(i){var a=n.sumHeight(e,t+1),o=t-e+1;i.forEach((function(t){t.row>=e&&(t.ot+=a,t.image.style.top=t.ot*r+"px",o&&(t.row+=o))}))}}},{key:"updateConditionImageForRowDelete",value:function(e,t,i){var n=this.conditionimg,r=(this.rows,this.zoomlevel);if(n)for(var a=t-e+1,o=n.length-1;o>=0;o--){var s=n[o];s.row>=e&&s.row<=t?(s.image.remove(),n.splice(o,1)):s.row>t&&(s.ot+=i,s.image.style.top=s.ot*r+"px",a&&(s.row-=a))}}},{key:"updateConditionImageForColDelete",value:function(e,t,i){var n=this.conditionimg,r=this.cols,a=this.displayRight2Left,o=this.zoomlevel;if(n)for(var s=this.viewWidth()-r.indexWidth,l=n.length-1;l>=0;l--){var c=n[l];if(c.col>=e&&c.col<=t)c.image.remove(),n.splice(l,1);else if(c.col>t){c.ol+=i,c.image.style.left=a?(s-c.ol-r.getWidth(c.col))*o+"px":c.ol*o+"px";var h=t-e+1;h&&(c.col-=h)}}}},{key:"deleteCell",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",i=this.selector,n=this.name;this.changeData((function(){e.rows.deleteCells(i.range,t),"all"!==t&&"format"!==t||e.merges.deleteWithin(i.range),e.delCellOpr(n,i.range,t)}))}},{key:"insert",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.changeData((function(){var n=t.selector.range,r=n.sri,a=n.sci,o=t.rows,s=t.merges,l=t.cols,c=t.name,h=r;if("row"===e){o.insert(r,i),t.updateConditionImageForRowInsert(r,r+i-1);var u=o.getHeight(r-1);t.insertRowOpr(c,r,i,u)}else if("column"===e){o.insertColumn(a,i),h=a,l.len+=i;for(var f=l.getWidth(a-1),d=l.len,m=0;m<i;m++)l._[d-1-m]={};for(var g=d-1;g>=a;g--)l._[g].width=g>=i?l._[g-i].width:l.width;t.insertColumnOpr(c,a,i,f),t.updateConditionImageForColInsert(a,a+i-1)}s.shift(e,h,i,(function(e,t,i,n){var r=o.getCell(e,t);r.merge[0]+=i,r.merge[1]+=n}))}),!1)}},{key:"delete",value:function(e){var t=this,i=this.selector.range,n=i.sri,r=i.sci,a=i.eri,o=i.eci;n<0&&(n=0),a<n||(r<0&&(r=0),o<r||this.changeData((function(){var i=t.rows,n=t.merges,r=t.selector,a=t.cols,o=t.name,s=r.range,l=r.range,c=l.sri,h=l.sci,u=l.eri,f=l.eci,d=c,m=0;if("row"===e){if(c<0&&(c=0),u<c)return;if(confirm("sure to delete rows from "+(c+1)+" to "+(u+1))){m=u-c+1;var g=-i.sumHeight(c,u+1);i.delete(c,u),t.deleteRowOpr(o,c,u),t.updateConditionImageForRowDelete(c,u,g)}}else if("column"===e){if(h<0&&(h=0),f<h)return;if(confirm("sure to delete columns from "+(h+1)+" to "+(f+1))){var v=-a.sumWidth(h,f+1);i.deleteColumn(h,f),d=s.sci,m=f-h+1,a.len-=m;for(var p=h;p<a.len-m;p++)a._[p].width=a._[p+m].width;for(var y=a.len;y<a.len+m;y++)delete a._[y];t.deleteColumnOpr(o,h,f),t.updateConditionImageForColDelete(h,f,v)}}n.shift(e,d,-m,(function(e,t,n,r){var a=i.getCell(e,t);a.merge[0]+=n,a.merge[1]+=r,0===a.merge[0]&&0===a.merge[1]&&delete a.merge}))}),!1))}},{key:"deletelocalonly",value:function(e,t,i){var n=this;this.changeData((function(){var r=n.rows,a=n.merges;n.cols;"row"===e?r.delete(t,t+i-1):"column"===e&&r.deleteColumn(t,t+i-1),a.shift(e,t,-i,(function(e,t,i,n){var a=r.getCell(e,t);a.merge[0]+=i,a.merge[1]+=n,0===a.merge[0]&&0===a.merge[1]&&delete a.merge}))}),!1)}},{key:"updateRevertOpr",value:function(e){"insertrow"===e.op?this.deletelocalonly("row",e.ri,e.n):"insertcol"===e.op&&this.deletelocalonly("column",e.ci,e.n)}},{key:"scrollx",value:function(e,t){var i=this.scroll,n=this.freeze,a=this.cols;this.displayRight2Left&&(e=-e);var o=r()(n,2)[1],s=F.rangeReduceIf(o,a.len,0,0,e,(function(e){return a.getWidth(e)})),l=r()(s,3),c=l[0],h=l[1],u=l[2],f=h;e>0&&(f+=u),i.x!==f&&(i.ci=e>0?c:0,i.x=f,t())}},{key:"scrolly",value:function(e,t){var i=this.scroll,n=this.freeze,a=this.rows,o=this.exceptRowSet,s=r()(n,1)[0],l=F.rangeReduceIf(s,a.len,0,0,e,(function(e){return a.getHeight(e,o)})),c=r()(l,3),h=c[0],u=c[1],f=c[2],d=u;if(e>0&&(d+=f),i.y!==d){for(i.ri=e>0?h:0,i.y=d,0===i.ri&&this.freeze[0]>0&&(i.ri=this.freeze[0],i.y=0),i.yact=i.y,i.riact=i.ri;this.isInvisibleRow(i.riact);)i.yact+=a.getHeight(i.riact,o),i.riact++;t()}}},{key:"isInvisibleRow",value:function(e){var t=this.exceptRowSet;return this.rows.isHide(e)||t.has(e)}},{key:"cellRect",value:function(e,t){var i=this.rows,n=this.cols,a=this.exceptRowSet,o=this.displayRight2Left,s=this.scroll,l=i.sumHeight(0,e,a),c=i.getCell(e,t),h=n.getWidth(t),u=i.getHeight(e);if(null!==c&&c.merge){var f=r()(c.merge,2),d=f[0],m=f[1];if(d>0)for(var g=1;g<=d;g+=1)u+=i.getHeight(e+g);if(m>0)for(var v=1;v<=m;v+=1)h+=n.getWidth(t+v)}var p=o?this.viewWidth()-n.sumWidth(0,t)-h+2*s.x:n.sumWidth(0,t);if(o){var y=r()(this.freeze,2),b=(y[0],y[1]);b>0&&t<b&&(p-=2*s.x)}return{left:p,top:l,width:h,height:u,cell:c}}},{key:"cellRectWithOutTransfer",value:function(e,t){var i=this.cellRect(e,t),n=this.displayRight2Left,a=this.cols,o=this.scroll,s=this.zoomlevel,l=a.indexWidth,c=this.settings.row.height;i.top+=c;var h=r()(this.freeze,2),u=(h[0],h[1]);return n?(i.left-=l,i.left+=i.width,t>u&&(i.left-=o.x)):(i.left+=l,t>u&&(i.left-=o.x)),e>u&&(i.top-=o.y),i.left*=s,i.top*=s,i.width*=s,i.height*=s,i}},{key:"getCell",value:function(e,t){return this.rows.getCell(e,t)}},{key:"getCellTextOrDefault",value:function(e,t){var i=this.getCell(e,t);return i&&i.text?i.text:""}},{key:"isEmpty",value:function(e,t){var i=this.getCell(e,t);return!i||!i.text||0===i.text.trim().length}},{key:"getCellStyle",value:function(e,t){var i=this.getCell(e,t);return i&&void 0!==i.style?this.styles[i.style]:null}},{key:"getCellStyleOrDefault",value:function(e,t){var i=this.styles,n=this.rows,r=this.displayRight2Left,a=n.getCell(e,t),o=a&&void 0!==a.style?i[a.style]:{},s=F.merge(this.defaultStyle(),o);if(void 0!==o.bgcolor&&(s.hasbgcolor=!0),a&&void 0!==a.merge){if(0!=a.merge[1]){var l=n.getCell(e,t+a.merge[1]),c=l&&void 0!==l.style?i[l.style]:{};c.border&&void 0!==c.border.right&&(void 0===o.border&&(o.border={}),o.border.right=c.border.right)}if(0!=a.merge[0]){var h=n.getCell(e+a.merge[0],t),u=h&&void 0!==h.style?i[h.style]:{};u.border&&void 0!==u.border.bottom&&(void 0===o.border&&(o.border={}),o.border.bottom=u.border.bottom)}}if(void 0!==s.border&&r){var f=s.border.right;s.border.right=s.border.left,s.border.left=f}return s}},{key:"getSelectedCellStyle",value:function(){var e=this.selector,t=e.ri,i=e.ci;return this.getCellStyleOrDefault(t,i)}},{key:"setCellText",value:function(e,t,i,n){var r=this.rows,a=this.history,o=this.validations,s=this.settings,l=this.name;"finished"===n?("server"!==s.updateMode&&(r.setCellText(e,t,""),a.add(this.getData()),r.setCellText(e,t,i)),"server"===s.updateMode&&this.updateCellTextOpr(l,e,t,i)):r.setCellText(e,t,i),o.validate(e,t,i)}},{key:"updateTextbox",value:function(e,t){this.settings;var i=this.name;e.ischange&&(e.ischange=!1,this.updateTextboxOpr(i,e,t))}},{key:"isNumber",value:function(e){return!isNaN(parseFloat(e))&&isFinite(e)}},{key:"isDate",value:function(e){return isNaN(e)&&!isNaN(Date.parse(e))}},{key:"setCellAutoAlignment",value:function(e,t,i){var n=this.styles,r=this.rows.getCellOrNew(e,t),a={};void 0!==r.style&&(a=F.cloneDeep(n[r.style])),(r.isautoalign||void 0===a.align)&&(a.align=i,r.style=this.addStyle(a),r.isautoalign=!0)}},{key:"cutPasteRangeOpr",value:function(e,t,i){var n={name:e,src:t,dest:i,op:"cutpaste"};this.updateCellServer(n)}},{key:"copyPasteRangeOpr",value:function(e,t,i,n){var r={name:e,src:t,dest:i,op:"copypaste",what:n};this.updateCellServer(r)}},{key:"autofillRangeOpr",value:function(e,t,i,n){var r={name:e,src:t,dest:i,op:"autofill",what:n};this.updateCellServer(r)}},{key:"updateBatchCellsOpr",value:function(e,t,i,n,r){var a={name:e,cells:t,src:i,dest:n,what:r,op:"batchupdate"};this.updateCellServer(a)}},{key:"updateCellStyleOpr",value:function(e,t,i,n){var r={name:e,ri:t,ci:i,number:n.number,custom:n.custom,op:"updatestyle"};this.updateCellServer(r)}},{key:"updateCellTextOpr",value:function(e,t,i,n){var r=n.startsWith("<font style=")||n.startsWith("<Font Style=")?"updatehtml":"update",a={name:e,ri:t,ci:i,text:n,op:r};this.updateCellServer(a)}},{key:"updateTextboxOpr",value:function(e,t,i){var n={name:e,id:t.strid,text:i,w:t.width,h:t.height,op:"updateTextBox"};this.updateCellServer(n)}},{key:"delCellOpr",value:function(e,t,i){var n={name:e,range:t,what:i,op:"delcells"};this.updateCellServer(n)}},{key:"addSheetOpr",value:function(e){var t={name:e,op:"add"};this.updateCellServer(t)}},{key:"delSheetOpr",value:function(e){var t={name:e,op:"del"};this.updateCellServer(t)}},{key:"renameSheetOpr",value:function(e,t){var i={oldname:e,name:t,op:"rename"};this.updateCellServer(i)}},{key:"insertRowOpr",value:function(e,t,i,n){var r={name:e,ri:t,n:i,h:n,op:"insertrow"};this.updateCellServer(r)}},{key:"insertColumnOpr",value:function(e,t,i,n){var r={name:e,ci:t,n:i,w:n,op:"insertcol"};this.updateCellServer(r)}},{key:"deleteRowOpr",value:function(e,t,i){var n={name:e,sri:t,eri:i,op:"delrow"};this.updateCellServer(n)}},{key:"deleteColumnOpr",value:function(e,t,i){var n={name:e,sci:t,eci:i,op:"delcol"};this.updateCellServer(n)}},{key:"setAutoAlignForCell",value:function(e){e.ufv||this.isNumber(e.text)||this.isDate(e.text)?this.setCellAutoAlignment(e.ri,e.ci,"right"):this.setCellAutoAlignment(e.ri,e.ci,"left")}},{key:"updateMyCells",value:function(e){var t=this,i=this.styles,n=this.rows,r=this.search,a=this;e.forEach((function(e,r,o){var s=n.updateOneCell(e);if(e.bgcolor){var l={};void 0!==s.style&&(l=F.cloneDeep(i[s.style])),l.bgcolor=e.bgcolor,s.style=a.addStyle(l)}t.setAutoAlignForCell(e)})),"comments"!==r.lookin&&(r.result=null)}},{key:"updateShapes",value:function(e,t){var i=this.shapes;null!=i&&null!=e&&e.forEach((function(e,n,r){for(var a=0,o=i.length;a<o;a++)if(i[a].id===e.id){var s={};s.id="s_"+e.id+"_"+i[a].tick,s.name=e.id+"."+e.tick,s.it=i[a],t.push(s),$("#"+s.id).addClass("resize-image").removeAttr("src");break}}))}},{key:"updateShapeSrcToRefresh",value:function(e,t,i,n){if(n.length>0){var r=this;$.get(t+"?uid="+e+"&id="+i,(function(e){r.fillImageOnebyOne(e,n)}))}}},{key:"validateFormula",value:function(e){for(var t=0,i=0;i<e.length;i++)"("===e[i]?t++:")"===e[i]&&t--;return 0===t}},{key:"freezeIsActive",value:function(){var e=r()(this.freeze,2),t=e[0],i=e[1];return t>0||i>0}},{key:"resetScroll",value:function(){var e=this.scroll;e.riact=0,e.ri=0,e.y=0,e.yact=0,e.x=0,e.ci=0}},{key:"setFreeze",value:function(e,t){var i=this;0===e&&this.resetScroll(),this.changeData((function(){i.freeze=[e,t]}))}},{key:"freezeTotalWidth",value:function(){return this.cols.sumWidth(0,this.freeze[1])}},{key:"freezeTotalHeight",value:function(){return this.rows.sumHeight(0,this.freeze[0],this.exceptRowSet)}},{key:"setRowHeight",value:function(e,t){var i=this;this.changeData((function(){i.rows.setHeight(e,t)}))}},{key:"setColWidth",value:function(e,t){var i=this;this.changeData((function(){i.cols.setWidth(e,t)}))}},{key:"viewHeight",value:function(){var e=this.settings,t=e.view,i=e.showToolbar,n=e.showFileName,r=t.height();return r-=26,r-=41,i&&(r-=41,this.menubarStatus()&&(r-=n?80:40)),r}},{key:"viewWidth",value:function(){return this.settings.view.width()}},{key:"freezeViewRange",value:function(){var e=r()(this.freeze,2),t=e[0],i=e[1];return new x(0,0,t-1,i-1,this.freezeTotalWidth(),this.freezeTotalHeight())}},{key:"contentRange",value:function(){var e=this.rows,t=this.cols,i=e.maxCell(),n=r()(i,2),a=n[0],o=n[1],s=e.sumHeight(0,a+1),l=t.sumWidth(0,o+1);return new x(0,0,a,o,l,s)}},{key:"exceptRowTotalHeight",value:function(e,t){var i=this.exceptRowSet,n=this.rows,r=Array.from(i),a=0;return r.forEach((function(i){if(i<e||i>t){var r=n.getHeight(i);a+=r}})),a}},{key:"viewRange",value:function(){var e=this.scroll,t=this.rows,i=this.cols,n=this.freeze,a=this.exceptRowSet,o=e.ri,s=e.ci;o<=0&&(o=r()(n,1)[0]);s<=0&&(s=r()(n,2)[1]);for(var l=[this.freezeTotalWidth(),0],c=l[0],h=l[1],u=[t.len,i.len],f=u[0],d=u[1],m=o;m<t.len&&(a.has(m)||(h+=t.getHeight(m),f=m),!(h>this.viewHeight()/this.zoomlevel));m+=1);for(var g=s;g<i.len&&(d=g,!((c+=i.getWidth(g))>this.viewWidth()/this.zoomlevel));g+=1);var v=new x(o,s,f,d,c,h);return this.viewRangeCache=v,v}},{key:"eachMergesInView",value:function(e,t){this.merges.filterIntersects(e).forEach((function(e){return t(e)}))}},{key:"hideRowsOrCols",value:function(){var e=this.rows,t=this.cols,i=this.selector,n=i.size(),a=r()(n,2),o=a[0],s=a[1],l=i.range,c=l.sri,h=l.sci,u=l.eri,f=l.eci;if(o===e.len)for(var d=h;d<=f;d+=1)t.setHide(d,!0);else if(s===t.len)for(var m=c;m<=u;m+=1)e.setHide(m,!0)}},{key:"unhideRowsOrCols",value:function(e,t){this["".concat(e,"s")].unhide(t)}},{key:"rowEach",value:function(e,t,i){for(var n=0,r=this.rows,a=this.exceptRowSet,o=(m()(a),0),s=e+o;s<=t;s+=1)if(a.has(s))o+=1;else{var l=r.getHeight(s);if(l>0){if(i(s,n,l),n+=l,this.zoomlevel<1&&n>this.viewHeight()/this.zoomlevel)break;if(this.zoomlevel>=1&&n>this.viewHeight())break}}}},{key:"colEach",value:function(e,t,i){for(var n=0,r=this.cols,a=e;a<=t;a+=1){var o=r.getWidth(a);if(o>0){if(i(a,n,o),n+=o,this.zoomlevel<1&&n>this.viewWidth()/this.zoomlevel)break;if(this.zoomlevel>=1&&n>this.viewWidth())break}}}},{key:"generatePicItems",value:function(e,t,i){var n=new Array;null!=e&&e.forEach((function(e){if(null==e.src){var t={};t.id="p_"+e.id+"_"+e.tick,void 0===e.refid?t.name=e.id+"."+e.tick:t.name=e.refid+"."+e.tick,t.it=e,n.push(t)}})),null!=t&&t.forEach((function(e){if(null==e.src){var t={};t.id="s_"+e.id+"_"+e.tick,void 0===e.refid?t.name=e.id+"."+e.tick:t.name=e.refid+"."+e.tick,t.it=e,n.push(t)}})),this.loadCount=n.length,this.fillImageOnebyOne(i,n)}},{key:"defaultStyle",value:function(){return this.settings.style}},{key:"addStyle",value:function(e){for(var t=this.styles,i=0;i<t.length;i+=1){var n=t[i];if(F.equals(n,e))return i}return t.push(e),t.length-1}},{key:"changeData",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,n=void 0!==i?i:this.selector.range;if(this.history.add(this.getRangeData(n)),e(),this.change(this.getData()),t)for(var r=n.sri,a=(n.sci,n.eri),o=(n.eci,r);o<=a;o++)this.updateRows.add(o)}},{key:"setRangeData",value:function(e){this.rows.setRangeData(e.rows,e.range),this.merges.setData(e.merges)}},{key:"setData",value:function(e){var t=this;return Object.keys(e).forEach((function(i){if("merges"===i||"rows"===i||"cols"===i||"validations"===i)t[i].setData(e[i]);else if("freeze"===i){var n=y(e[i]),a=r()(n,2),o=a[0],s=a[1];t.freeze=[s,o]}else if("autofilter"===i)t.autoFilter.setData(e[i]);else if("lautofilters"===i){var l=e[i],c=t;l.forEach((function(e){var t=new R;t.setData(e),c.TableAutoFilters.push(t)}))}else void 0!==e[i]&&(t[i]=e[i])})),this}},{key:"getData",value:function(){var e=this.name,t=this.freeze,i=this.styles,n=this.merges,r=this.rows,a=this.cols,o=this.validations,s=this.autoFilter,l=this.TableAutoFilters,c={name:e,freeze:b(t[1],t[0]),styles:i,merges:n.getData(),rows:r.getData(),cols:a.getData(),validations:o.getData(),autofilter:s.getData(),TableAutoFilters:[]};return l.forEach((function(e){c.TableAutoFilters.push(e.getData())})),c}},{key:"getRangeData",value:function(e){var t=this.merges,i=this.rows;this.styles;return{rows:i.getRangeData(e),merges:t.getData(),range:e}}},{key:"getDataForSave",value:function(){var e=this.name,t=this.freeze,i=this.styles,n=this.merges,r=this.rows,a=this.cols,o=this.validations,s=this.autoFilter,l=this.settings,c=this.updateRows,h=this.updateRowsHeight,u=this.updateCols,f=this.canselectlocked,d=this.sprotected,m=this.canselectunlocked,g=this.showGrid,v=this.comments,p=this.images,y=this.shapes;return{name:e,freeze:b(t[1],t[0]),styles:i,comments:v,canselectlocked:f,sprotected:d,canselectunlocked:m,showGrid:g,merges:n.getDataForSave(),settings:l,cols:a.getDataForSave(u),rows:r.getDataForRowsSet(c),rowh:r.getHeightForSave(h),validations:o.getData(),autofilter:s.getData(),images:null!=p?p.filter((function(e){return e.changed})).map((function(e){var t={};return t.left=e.left,t.top=e.top,t.originAngle=e.originAngle,t.angle=e.angle,t.zorder=e.zorder,t.width=e.originWidth*e.scaleX,t.height=e.originHeight*e.scaleY,t.op=e.op,t.id=e.id,e.hyperlink&&(t.hyperlink=e.hyperlink),t})):[],shapes:null!=y?y.filter((function(e){return e.changed})).map((function(e){var t={};return t.left=e.left,t.top=e.top,t.originAngle=e.originAngle,t.angle=e.angle,t.zorder=e.zorder,t.width=e.originWidth*e.scaleX,t.height=e.originHeight*e.scaleY,t.op=e.op,t.id=e.id,e.hyperlink&&(t.hyperlink=e.hyperlink),t})):[]}}}]),e}(),ye=i(12),be=i.n(ye),we=i(7),xe=i.n(we),ke=i(11),Ce=i.n(ke),Se=i(13),_e=i.n(Se);function Te(e,t,i){e.addEventListener(t,i)}function Oe(e,t,i){e.removeEventListener(t,i)}function Ee(e){e.xclickoutside&&(Oe(window.document.body,"click",e.xclickoutside),delete e.xclickoutside)}function Re(e,t){e.xclickoutside=function(i){2===i.detail||e.contains(i.target)||(t?t(e):(e.hide(),Ee(e)))},Te(window.document.body,"click",e.xclickoutside)}function Ie(e,t,i){Te(e,"mousemove",t),e.xEvtUp=function(n){Oe(e,"mousemove",t),Oe(e,"mouseup",e.xEvtUp),i(n)},Te(e,"mouseup",e.xEvtUp)}var Ae=null;function De(){clearInterval(Ae),Ae=null}function Pe(e,t){(function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];Ae||(Ae=setInterval((function(){e.apply(void 0,i)}),400))})((function(){e.selectMoveDown(),e.canvas.publishEvent("object:scroll",e.data)}))}function Fe(e,t){var i="object"===("undefined"==typeof window?"undefined":_e()(window))?window.navigator.userAgent:"";if(/Android/i.test(i)){var n=window.innerHeight;window.addEventListener("resize",(function(i){var r=window.innerHeight;n>r?"true"===document.activeElement.contentEditable&&t(i):e(i)}))}else/iPhone|iPod|iPad/i.test(i)&&(window.addEventListener("focusin",(function(e){t(e)})),window.addEventListener("focusout",(function(t){e(t)})))}var Me=function(){function e(){var t=this,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;l()(this,e),this.moving=!1,this.sheet=r,this.vertical=i,this.el=f("div","".concat(ae,"-resizer ").concat(i?"vertical":"horizontal")).children(this.unhideHoverEl=f("div","".concat(ae,"-resizer-hover")).on("dblclick.stop",(function(e){return t.mousedblclickHandler(e)})).css("position","absolute").hide(),this.hoverEl=f("div","".concat(ae,"-resizer-hover")).on("mousedown.stop",(function(e){return t.mousedownHandler(e)})),this.lineEl=f("div","".concat(ae,"-resizer-line")).hide()).hide(),this.cRect=null,this.IsRight2Left=!1,this.finishedFn=null,this.minDistance=n,this.maxRowHeight=408,this.maxColWidth=254,this.unhideFn=function(){}}return o()(e,[{key:"showUnhide",value:function(e){this.unhideIndex=e,this.unhideHoverEl.show()}},{key:"hideUnhide",value:function(){this.unhideHoverEl.hide()}},{key:"show",value:function(e,t,i){var n=this.moving,r=this.vertical,a=this.hoverEl,o=this.lineEl,s=this.el,l=this.unhideHoverEl;if(!n){this.IsRight2Left=i,this.cRect=e;var c=e.left,h=e.top,u=e.width,f=e.height,d=i?c-u:c+u-5;s.offset({left:r?d:c,top:r?h:h+f-5}).show(),a.offset({width:r?5:u,height:r?f:5}),o.offset({width:r?0:t.width,height:r?t.height:0}),l.offset({left:r?5-u:c,top:r?h:5-f,width:r?5:u,height:r?f:5})}}},{key:"hide",value:function(){this.el.offset({left:0,top:0}).hide(),this.hideUnhide()}},{key:"mousedblclickHandler",value:function(){this.unhideIndex&&this.unhideFn(this.unhideIndex)}},{key:"mousedownHandler",value:function(e){var t=this,i=e,n=this.el,r=this.lineEl,a=this.cRect,o=this.vertical,s=this.minDistance,l=this.IsRight2Left,c=this.maxRowHeight,h=this.maxColWidth,u=o?a.width:a.height;u=Math.round(u),r.show(),Ie(window,(function(e){t.moving=!0,null!==i&&1===e.buttons&&(o?(l?u-=e.movementX:u+=e.movementX,u>s&&u<h&&(l?n.css("left","".concat(a.left-u,"px")):n.css("left","".concat(a.left+u,"px")))):(u+=e.movementY)>s&&u<c&&n.css("top","".concat(a.top+u,"px")),i=e)}),(function(){i=null,r.hide(),t.moving=!1,t.hide(),t.finishedFn&&(u<s&&(u=s),o?u>h&&(u=h):u>c&&(u=c),t.finishedFn(a,u))}))}}]),e}(),Le=function(){function e(t){var i=this;l()(this,e),this.vertical=t,this.moveFn=null,this.el=f("div","".concat(ae,"-scrollbar ").concat(t?"vertical":"horizontal")).child(this.contentEl=f("div","")).on("mousemove.stop",(function(){})).on("scroll.stop",(function(e){var t=e.target,n=t.scrollTop,r=t.scrollLeft;i.moveFn&&i.moveFn(i.vertical?n:r,e)}))}return o()(e,[{key:"move",value:function(e){return this.el.scroll(e),this}},{key:"scroll",value:function(){return this.el.scroll()}},{key:"set",value:function(e,t){var i=e-1;if(t>i){var n=this.vertical?"height":"width";this.el.css(n,"".concat(i-50,"px")).show(),this.contentEl.css(this.vertical?"width":"height","1px").css(n,"".concat(t,"px"))}else this.el.hide();return this}}]),e}(),je=10,ze=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];l()(this,e),this.isreadonly=t,this.useHideInput=i,this.inputChange=function(){},this.cornerEl=f("div","".concat(ae,"-selector-corner")),this.areaEl=f("div","".concat(ae,"-selector-area")).child(this.cornerEl).hide(),window.mobileAndTabletCheck()&&this.cornerEl.child(f("div","".concat(ae,"-selector-corner-shape"))),this.clipboardEl=f("div","".concat(ae,"-selector-clipboard")).hide(),this.autofillEl=f("div","".concat(ae,"-selector-autofill")).hide(),this.el=f("div","".concat(ae,"-selector")).css("z-index","".concat(je)).children(this.areaEl,this.clipboardEl,this.autofillEl).hide(),this.isreadonly&&this.cornerEl.hide(),je+=1}return o()(e,[{key:"setOffset",value:function(e){return this.el.offset(e).show(),this}},{key:"hide",value:function(){return this.el.hide(),this}},{key:"setAreaOffset",value:function(e){var t=e.left,i=e.top,n=e.width,r=e.height,a={width:this.isreadonly?n-2:n+.8,height:this.isreadonly?r-2:r+.8,left:t-.8,top:i-.8};this.areaEl.offset(a).show()}},{key:"setClipboardOffset",value:function(e){var t=e.left,i=e.top,n=e.width,r=e.height;this.clipboardEl.offset({left:t,top:i,width:n-2.4,height:r-2.4})}},{key:"showAutofill",value:function(e){var t=e.left,i=e.top,n=e.width,r=e.height;this.autofillEl.offset({width:n-3,height:r-3,left:t,top:i}).show()}},{key:"hideAutofill",value:function(){this.autofillEl.hide()}},{key:"showClipboard",value:function(){this.clipboardEl.show()}},{key:"hideClipboard",value:function(){this.clipboardEl.hide()}}]),e}();function Be(e){var t=this.data,i=e.left,n=e.top,r=e.width,a=e.height,o=e.scroll,s=e.l,l=e.t,c=t.freezeTotalWidth(),h=t.freezeTotalHeight(),u=t.displayRight2Left?0===c?i:i-(t.viewWidth()-t.cols.indexWidth-c):i-c,f=r;void 0!==o&&(t.displayRight2Left?0===c||(u+r<0?u=19999:u<0&&(f-=o.x)):c>s&&(u-=o.x));var d=n-h;return void 0!==o&&h>l&&(d-=o.y),{left:u,top:d,width:f,height:a}}function He(e){var t=this.data,i=e.left,n=e.width,r=e.height,a=e.l,o=e.t,s=e.scroll,l=t.freezeTotalWidth(),c=t.displayRight2Left?0===l?i:i-(t.viewWidth()-t.cols.indexWidth-l):i-l,h=n;return void 0!==s&&(t.displayRight2Left?0===l||(c+n<0?c=19999:c<0&&(h-=s.x)):l>a&&(c-=s.x)),{left:c,top:o,width:h,height:r}}function Ne(e){var t=this.data,i=e.top,n=e.width,r=e.height,a=e.l,o=e.t,s=e.scroll,l=e.left,c=t.freezeTotalHeight(),h=i-c;return c>o&&(h-=s.y),t.displayRight2Left?{left:l,top:h,width:n,height:r}:{left:a,top:h,width:n,height:r}}function Ue(e){this.br.setAreaOffset(Be.call(this,e))}function Xe(e){this.tl.setAreaOffset(e)}function We(e){this.t.setAreaOffset(He.call(this,e))}function qe(e){this.l.setAreaOffset(Ne.call(this,e))}function Ye(e){this.l.setClipboardOffset(Ne.call(this,e))}function Ve(e){this.br.setClipboardOffset(Be.call(this,e))}function Ge(e){this.tl.setClipboardOffset(e)}function Ze(e){this.t.setClipboardOffset(He.call(this,e))}function Ke(e){Ue.call(this,e),Xe.call(this,e),We.call(this,e),qe.call(this,e)}function Je(e){Ve.call(this,e),Ge.call(this,e),Ze.call(this,e),Ye.call(this,e)}var $e=function(){function e(t){var i=this;l()(this,e),this.inputChange=function(){},this.data=t;var n="edit"!==t.settings.mode;this.br=new ze(n,!0),this.t=new ze(n),this.l=new ze(n),this.tl=new ze(n),this.br.inputChange=function(e){i.inputChange(e)},this.br.el.show(),this.offset=null,this.areaOffset=null,this.indexes=null,this.range=null,this.arange=null,this.el=f("div","".concat(ae,"-selectors")).children(this.tl.el,this.t.el,this.l.el,this.br.el).hide(),this.lastri=-1,this.lastci=-1,je+=1,this.mobilestartOffset=null,this.mobilestartRange=null,this.objId=null}return o()(e,[{key:"getObj",value:function(){if(null===this.objId)return null;var e=this.objId.split("_");return"s"===e[0]?this.data.shapes.filter((function(t){return Number(t.id)===Number(e[1])}))[0]:this.data.images.filter((function(t){return Number(t.id)===Number(e[1])}))[0]}},{key:"setObjId",value:function(e){this.objId=e}},{key:"setMobilestartOffsetAndRange",value:function(){this.mobilestartOffset=this.data.getSelectedRect(),this.mobilestartRange=this.range}},{key:"resetData",value:function(e){this.data=e,this.range=e.selector.range,this.resetAreaOffset()}},{key:"hide",value:function(){this.el.hide()}},{key:"resetOffset",value:function(){var e=this.data,t=this.tl,i=this.t,n=this.l,r=this.br,a=e.freezeTotalHeight(),o=e.freezeTotalWidth();if(a>0||o>0)if(this.data.displayRight2Left){var s=e.viewWidth()-e.cols.indexWidth;t.setOffset({width:s-o,height:a}),i.setOffset({left:s-o,height:a}),n.setOffset({width:s-o,top:a}),r.setOffset({left:s-o,top:a})}else t.setOffset({width:o,height:a}),i.setOffset({left:o,height:a}),n.setOffset({width:o,top:a}),r.setOffset({left:o,top:a});else t.hide(),i.hide(),n.hide(),r.setOffset({left:0,top:0})}},{key:"resetAreaOffset",value:function(){var e=this.data.getSelectedRect(),t=this.data.getClipboardRect();Ke.call(this,e),Je.call(this,t),this.resetOffset()}},{key:"resetBRTAreaOffset",value:function(){var e=this.data.getSelectedRect(),t=this.data.getClipboardRect();this.data.displayRight2Left?0===this.data.freeze[1]?Ue.call(this,e):(qe.call(this,e),Xe.call(this,e),Ye.call(this,t),Ge.call(this,t)):(Ue.call(this,e),We.call(this,e),Ve.call(this,t),Ze.call(this,t)),this.resetOffset()}},{key:"resetBRLAreaOffset",value:function(){var e=this.data.getSelectedRect(),t=this.data.getClipboardRect();Ue.call(this,e),qe.call(this,e),Ve.call(this,t),Ye.call(this,t),this.resetOffset()}},{key:"set",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.data,r=n.calSelectedRangeByStart(e,t),a=r.sri,o=r.sci;if(i){var s=e,l=t;e<0&&(s=0),t<0&&(l=0),n.selector.setIndexes(s,l),this.indexes=[s,l]}this.moveIndexes=[a,o],this.range=r,this.resetAreaOffset(),this.el.show()}},{key:"setEnd",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.data,r=this.lastri,a=this.lastci;if(i){if(e===r&&t===a)return;this.lastri=e,this.lastci=t}this.moveIndexes=[e,t],this.range=n.calSelectedRangeByEnd(e,t),Ke.call(this,this.data.getSelectedRect())}},{key:"setEndMobile",value:function(e,t){Ke.call(this,{width:this.mobilestartOffset.width+e,height:this.mobilestartOffset.height+t,left:this.mobilestartOffset.left,top:this.mobilestartOffset.top})}},{key:"getMobileMultipleSelect",value:function(e,t){var i=this.mobilestartRange,n=i.sri,r=i.sci,a=i.eri,o=i.eci,s=0,l=0,c=a,h=o;if(t>0){for(var u=a+1;u<=this.data.rows.len-1;u++)if((s+=this.data.rows.getHeight(u))>t){c=u-1;break}}else{t=-t;for(u=a;u>=n;u--)if((s+=this.data.rows.getHeight(u))>t){c=u-1;break}c===n-1&&(c=n)}if(e>0){for(var f=o+1;f<=this.data.cols.len-1;f++)if((l+=this.data.cols.getWidth(f))>e){h=f-1;break}}else{e=-e;for(f=o;f>=r;f--)if((l+=this.data.cols.getWidth(f))>e){h=f-1;break}h===r-1&&(h=r)}return[c,h]}},{key:"setMobileMultipleSelect",value:function(e,t){var i=this.getMobileMultipleSelect(e,t),n=r()(i,2),a=n[0],o=n[1];this.setEnd(a,o,!1)}},{key:"setMobile",value:function(e,t,i,n){var r=this.range,a=r.eri,o=r.eci;this.set(e,t),this.lastri=this.lastci=0,this.setEnd(a,o);var s=this.data.getSelectedRect();i=i>s.width+s.left?s.width+s.left:i,n=n>s.height+s.top?s.height+s.top:n,Ke.call(this,{width:s.width+(s.left-i),height:s.height+(s.top-n),left:i,top:n}),this.el.show()}},{key:"reset",value:function(){var e=this.data.selector.range,t=e.eri,i=e.eci;this.setEnd(t,i)}},{key:"showAutofill",value:function(e,t){if(-1!==e||-1!==t){var i=this.range,n=i.sri,r=i.sci,a=i.eri,o=i.eci,s=e,l=t,c=n-e,h=a-e,u=o-t;if(r-t>0)this.arange=new x(n,l,a,r-1);else if(c>0)this.arange=new x(s,r,n-1,o);else if(u<0)this.arange=new x(n,o+1,a,l);else{if(!(h<0))return void(this.arange=null);this.arange=new x(a+1,r,s,o)}if(null!==this.arange){var f=this.data.getRect(this.arange);f.width+=2,f.height+=2;var d=this.br,m=this.l,g=this.t,v=this.tl;d.showAutofill(Be.call(this,f)),m.showAutofill(Ne.call(this,f)),g.showAutofill(He.call(this,f)),v.showAutofill(f)}}}},{key:"hideAutofill",value:function(){var e=this;["br","l","t","tl"].forEach((function(t){e[t].hideAutofill()}))}},{key:"showClipboard",value:function(){var e=this,t=this.data.getClipboardRect();Je.call(this,t),["br","l","t","tl"].forEach((function(t){e[t].showClipboard()}))}},{key:"hideClipboard",value:function(){var e=this;["br","l","t","tl"].forEach((function(t){e[t].hideClipboard()}))}}]),e}();function Qe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var et=function(e){ee()(i,e);var t=Qe(i);function i(e){var n;return l()(this,i),(n=t.call(this,"dialog")).show(),n.setContent(e),n}return o()(i,[{key:"hide",value:function(){this.removeAttr("open")}},{key:"show",value:function(){this.attr("open","")}},{key:"setContent",value:function(e){var t=f("p");t.child(e),this.child(t)}}],[{key:"findDialog",value:function(e){for(var t=[],i=0;i<e.children().length;i++)"dialog"===e.children()[i].localName&&t.push(i);return t}}]),i}(u);function tt(e){e.preventDefault(),e.stopPropagation();var t=this.filterItems;t.length<=0||(this.itemIndex>=0&&(t[this.itemIndex].toggle(),t[this.itemIndex].el.hideHelp()),this.itemIndex-=1,this.itemIndex<0&&(this.itemIndex=t.length-1),t[this.itemIndex].toggle(),t[this.itemIndex].el.showHelp())}function it(e){e.stopPropagation();var t=this.filterItems;t.length<=0||(this.itemIndex>=0&&(t[this.itemIndex].toggle(),t[this.itemIndex].el.hideHelp()),this.itemIndex+=1,this.itemIndex>t.length-1&&(this.itemIndex=0),t[this.itemIndex].toggle(),t[this.itemIndex].el.showHelp())}function nt(e){e.preventDefault();var t=this.filterItems;t.length<=0||(e.stopPropagation(),this.itemIndex<0&&(this.itemIndex=0),t[this.itemIndex].el.click(),this.hide())}function rt(e,t){t.focusing=!0;var i=e.keyCode;switch(e.ctrlKey&&e.stopPropagation(),i){case 37:e.stopPropagation();break;case 38:tt.call(this,e);break;case 39:e.stopPropagation();break;case 40:it.call(this,e);break;case 13:case 9:nt.call(this,e);break;default:e.stopPropagation()}}var at=function(){function e(t,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"200px";l()(this,e),this.filterItems=[],this.items=t,this.el=f("div","".concat(ae,"-suggest")).css("width",n).hide(),this.itemClick=i,this.itemIndex=-1}return o()(e,[{key:"setOffset",value:function(e){this.el.cssRemoveKeys("top","bottom").offset(e)}},{key:"hide",value:function(){var e=this.el;this.filterItems=[],this.itemIndex=-1,e.hide();for(var t=et.findDialog(e.parent()),i=0;i<t.length;i++)e.parent().removeChild(e.parent().children()[t[i]]);Ee(this.el.parent())}},{key:"setItems",value:function(e){this.items=e}},{key:"search",value:function(e){var t,i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=this.items;if(/^\s*$/.test(e)||(r=r.filter((function(t){return(t.key||t).startsWith(e.toUpperCase())}))),r=r.map((function(e){var t=e.title;t?"function"==typeof t&&(t=t()):t=e;var r=f("div","".concat(ae,"-item")).child("f"===n?e.key:t).on("click.stop",(function(){i.itemClick(e),i.hide()}));return e.label&&r.child(f("div","label").html(e.label)),"f"===n&&(r.el.help=new et(e.title())),r.el.showHelp=function(){var e=i.el.el.offsetTop+i.filterItems[i.itemIndex].el.offsetTop,t=i.el.el.offsetLeft+i.filterItems[i.itemIndex].el.clientWidth+20,n={top:"".concat(e,"px"),left:"".concat(t,"px"),"line-height":"16px",padding:"5px 2px"},r=i.filterItems[i.itemIndex].el.help;r.css(n),i.el.parent().child(r),Re(r,(function(e){for(var t=et.findDialog(i.el.parent()),n=0;n<t.length;n++)i.el.parent().removeChild(i.el.parent().children()[t[n]]);Ee(e)}))},r.el.hideHelp=function(){i.el.parent().contains(i.filterItems[i.itemIndex].el.help.el)&&i.el.parent().removeChild(i.filterItems[i.itemIndex].el.help.el),Ee(i.filterItems[i.itemIndex].el.help)},r})),this.filterItems=r,!(r.length<=0)){var a=this.el;if((t=a.html("")).children.apply(t,m()(r)).show(),"f"===n){for(var o=et.findDialog(a.parent()),s=0;s<o.length;s++)a.parent().removeChild(a.parent().children()[o[s]]);this.itemIndex=0,this.filterItems[this.itemIndex].el.hideHelp(),this.filterItems[this.itemIndex].toggle(),this.filterItems[this.itemIndex].el.showHelp(),Re(a.parent(),(function(){i.hide(),i.filterItems.forEach((function(e){return e.hideHelp()}))}))}}}},{key:"bindInputEvents",value:function(e,t){var i=this;e.on("keydown",(function(e){return rt.call(i,e,t)}))}}]),e}();function ot(e,t){e.setMonth(e.getMonth()+t)}function st(e,t){var i=new Date(e);return i.setDate(t-e.getDay()+1),i}var lt=function(){function e(t){var i,n=this;l()(this,e),this.value=t,this.cvalue=new Date(t),this.headerLeftEl=f("div","calendar-header-left"),this.bodyEl=f("tbody",""),this.buildAll(),this.el=f("div","x-spreadsheet-calendar").children(f("div","calendar-header").children(this.headerLeftEl,f("div","calendar-header-right").children(f("a","calendar-prev").on("click.stop",(function(){return n.prev()})).child(new se("chevron-left")),f("a","calendar-next").on("click.stop",(function(){return n.next()})).child(new se("chevron-right")))),f("table","calendar-body").children(f("thead","").child((i=f("tr","")).children.apply(i,m()(U("calendar.weeks").map((function(e){return f("th","cell").child(e)}))))),this.bodyEl)),this.selectChange=function(){}}return o()(e,[{key:"setValue",value:function(e){this.value=e,this.cvalue=new Date(e),this.buildAll()}},{key:"prev",value:function(){ot(this.value,-1),this.buildAll()}},{key:"next",value:function(){ot(this.value,1),this.buildAll()}},{key:"buildAll",value:function(){this.buildHeaderLeft(),this.buildBody()}},{key:"buildHeaderLeft",value:function(){var e=this.value;this.headerLeftEl.html("".concat(U("calendar.months")[e.getMonth()]," ").concat(e.getFullYear()))}},{key:"buildBody",value:function(){var e,t=this,i=this.value,n=this.cvalue,r=this.bodyEl,a=function(e,t,i){for(var n=new Date(e,t,1,23,59,59),r=[[],[],[],[],[],[]],a=0;a<6;a+=1)for(var o=0;o<7;o+=1){var s=st(n,7*a+o),l=s.getMonth()!==t,c=s.getMonth()===i.getMonth()&&s.getDate()===i.getDate();r[a][o]={d:s,disabled:l,active:c}}return r}(i.getFullYear(),i.getMonth(),n).map((function(e){var i,n=e.map((function(e){var i="cell";return e.disabled&&(i+=" disabled"),e.active&&(i+=" active"),f("td","").child(f("div",i).on("click.stop",(function(){t.selectChange(e.d)})).child(e.d.getDate().toString()))}));return(i=f("tr","")).children.apply(i,m()(n))}));(e=r.html("")).children.apply(e,m()(a))}}]),e}(),ct=function(){function e(){l()(this,e),this.calendar=new lt(new Date),this.el=f("div","".concat(ae,"-datepicker")).child(this.calendar.el).hide()}return o()(e,[{key:"setValue",value:function(e){var t=this.calendar;return"string"==typeof e?/^\d{4}-\d{1,2}-\d{1,2}$/.test(e)&&t.setValue(new Date(e.replace(new RegExp("-","g"),"/"))):e instanceof Date&&t.setValue(e),this}},{key:"change",value:function(e){var t=this;this.calendar.selectChange=function(i){e(i),t.hide()}}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){this.el.hide()}}]),e}(),ht=[{key:"SUM",title:X("formula.sum"),render:function(e){return e.reduce((function(e,t){return P("+",e,t)}),0)},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"AVERAGE",title:X("formula.average"),render:function(e){return e.reduce((function(e,t){return Number(e)+Number(t)}),0)/e.length},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"MAX",title:X("formula.max"),render:function(e){return Math.max.apply(Math,m()(e.map((function(e){return Number(e)}))))},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"MIN",title:X("formula.min"),render:function(e){return Math.min.apply(Math,m()(e.map((function(e){return Number(e)}))))},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"IF",title:X("formula._if"),render:function(e){var t=r()(e,3),i=t[0],n=t[1],a=t[2];return i?n:a},tipInfo:{repeat:!1,args:[{name:"logical_test",required:!0},{name:"value_if_true",required:!1},{name:"value_if_false",required:!1}]}},{key:"AND",title:X("formula.and"),render:function(e){return e.every((function(e){return e}))},tipInfo:{repeat:!0,args:[{name:"logical",required:!1}]}},{key:"OR",title:X("formula.or"),render:function(e){return e.some((function(e){return e}))},tipInfo:{repeat:!0,args:[{name:"logical",required:!1}]}},{key:"CONCAT",title:X("formula.concat"),render:function(e){return e.join("")},tipInfo:{repeat:!0,args:[{name:"text",required:!1}]}},{key:"COUNT",title:X("formula.count"),render:function(e){return e},tipInfo:{repeat:!0,args:[{name:"value",required:!1}]}},{key:"SUMIF",title:X("formula.sumif"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"range",required:!0},{name:"criteria",required:!1},{name:"sum_range",required:!1}]}},{key:"SUMIFS",title:X("formula.sumifs"),render:function(e){return e},tipInfo:{repeat:!0,repeatstart:1,repeatcount:2,args:[{name:"sum_range",required:!0},{name:"criteria_range",required:!1},{name:"criteria",required:!1}]}},{key:"VLOOKUP",title:X("formula.vlookup"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"lookup_value",required:!0},{name:"table_array",required:!0},{name:"col_index_num",required:!0},{name:"range_lookup",required:!1}]}},{key:"HLOOKUP",title:X("formula.hlookup"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"lookup_value",required:!0},{name:"table_array",required:!0},{name:"row_index_num",required:!0},{name:"range_lookup",required:!1}]}},{key:"LOOKUP",title:X("formula.lookup"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"lookup_value",required:!0},{name:"lookup_vector|array",required:!0},{name:"result_vector",required:!1}]}},{key:"MATCH",title:X("formula.match"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"lookup_value",required:!0},{name:"lookup_array",required:!0},{name:"match_type",required:!1}]}},{key:"RANK",title:X("formula.frequency"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0},{name:"ref",required:!0},{name:"order",required:!1}]}},{key:"FREQUENCY",title:X("formula.frequency"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"data_array",required:!0},{name:"bins_array",required:!0}]}},{key:"TEXT",title:X("formula.text"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"value",required:!0},{name:"format_text",required:!0}]}},{key:"LEFT",title:X("formula.left"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0},{name:"num_chars",required:!0}]}},{key:"RIGHT",title:X("formula.right"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0},{name:"num_chars",required:!0}]}},{key:"ROUND",title:X("formula.round"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0},{name:"num_digits",required:!0}]}},{key:"INDEX",title:X("formula.index"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"array",required:!0},{name:"row_num",required:!0},{name:"col_num",required:!1}]}},{key:"COUNTIF",title:X("formula.countif"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"range",required:!0},{name:"criteria",required:!0}]}},{key:"COUNTIFS",title:X("formula.countifs"),render:function(e){return e},tipInfo:{repeat:!0,repeatstart:0,repeatcount:2,args:[{name:"criteria_range",required:!1},{name:"criteria",required:!1}]}},{key:"COUNTA",title:X("formula.counta"),render:function(e){return e},tipInfo:{repeat:!0,args:[{name:"value",required:!1}]}},{key:"AVERAGEIF",title:X("formula.averageif"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"range",required:!0},{name:"criteria",required:!0},{name:"average_range",required:!1}]}},{key:"AVERAGEIFS",title:X("formula.averageifs"),render:function(e){return e},tipInfo:{repeat:!0,repeatstart:1,repeatcount:2,args:[{name:"average_range",required:!0},{name:"criteria_range",required:!1},{name:"criteria",required:!1}]}},{key:"TRIM",title:X("formula.trim"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0}]}},{key:"SIGN",title:X("formula.sign"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0}]}},{key:"ABS",title:X("formula.abs"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0}]}},{key:"TAN",title:X("formula.tan"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0}]}},{key:"SIN",title:X("formula.sin"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0}]}},{key:"COS",title:X("formula.cos"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0}]}},{key:"YIELD",title:X("formula.yield"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"settlement",required:!0},{name:"maturity",required:!0},{name:"rate",required:!0},{name:"pr",required:!0},{name:"redemption",required:!0},{name:"frequency",required:!0},{name:"basis",required:!1}]}},{key:"MID",title:X("formula.mid"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0},{name:"start_num",required:!0},{name:"num_chars",required:!0}]}},{key:"LEN",title:X("formula.len"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0}]}},{key:"POWER",title:X("formula.power"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0},{name:"power",required:!0}]}},{key:"CEILING",title:X("formula.ceiling"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0},{name:"significance",required:!0}]}},{key:"FLOOR",title:X("formula.floor"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0},{name:"significance",required:!0}]}},{key:"SUBSTITUTE",title:X("formula.substitute"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0},{name:"old_text",required:!0},{name:"new_text",required:!0},{name:"instance_num",required:!1}]}},{key:"REPLACE",title:X("formula.replace"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"old_text",required:!0},{name:"start_num",required:!0},{name:"num_chars",required:!0},{name:"new_text",required:!0}]}},{key:"SEARCH",title:X("formula.search"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"find_text",required:!0},{name:"within_text",required:!0},{name:"start_num",required:!1}]}},{key:"FIND",title:X("formula.find"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"find_text",required:!0},{name:"within_text",required:!0},{name:"start_num",required:!1}]}},{key:"ISNUMBER",title:X("formula.isnumber"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"value",required:!0}]}},{key:"ISTEXT",title:X("formula.istext"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"value",required:!0}]}},{key:"ISBLANK",title:X("formula.isblank"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"value",required:!0}]}},{key:"UPPER",title:X("formula.upper"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0}]}},{key:"LOWER",title:X("formula.lower"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0}]}},{key:"PRODUCT",title:X("formula.product"),render:function(e){return e},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"SUMPRODUCT",title:X("formula.sumproduct"),render:function(e){return e},tipInfo:{repeat:!0,args:[{name:"array",required:!1}]}},{key:"SUBTOTAL",title:X("formula.subtotal"),render:function(e){return e},tipInfo:{repeat:!0,args:[{name:"function_num",required:!0},{name:"ref",required:!1}]}}],ut=ht,ft={};function dt(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return mt(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return mt(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function mt(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}ht.forEach((function(e){ft[e.key]=e}));var gt=function(){function e(){l()(this,e),this.el=f("div").hide(),this.el.css({position:"absolute",padding:"5px",color:"#000","border-radius":"1px","font-size":"12px","z-index":"201","line-height":"10px","min-width":"20px",background:"#fff",border:"1px solid",top:"30px",left:"0px","white-space":"nowrap"})}return o()(e,[{key:"tipContent",value:function(e,t){if(void 0===e)return"";var i=e.tipInfo.args.slice(),n=e.tipInfo.repeat,r=e.tipInfo.repeatstart,a=e.tipInfo.repeatcount,o=[];if(n){void 0===r&&(r=i.length-1,a=1);for(var s=r;s<r+a;s++)o.push(i[s].name);i.splice(r,a)}var l=[];o.length>0&&function(){for(var e=1;i.length<t+2;)o.forEach((function(t){var n=t+e;i.push({name:n,required:!1})})),e++;i.push({name:"...",required:!0})}();for(var c=0;c<i.length;c++){var h=i[c].name;c>0&&!i[c].required&&c>=r+a&&((c-r)%a==0&&(h="["+h),(c-r)%a==a-1&&(h+="]")),l.push(h)}return l[t]="<strong>".concat(l[t],"</strong>"),"".concat(e.key.toUpperCase(),"(").concat(l.join(", "),")")}},{key:"hide",value:function(){this.el.hide()}},{key:"show",value:function(e){if(-1!==e.startsWith("=")){var t,i="",n=[],r=[],a=dt(e.substring(1));try{for(a.s();!(t=a.n()).done;){var o=t.value;switch(o){case"(":n.unshift(i),r.unshift(0),i="";break;case")":n.shift(),r.shift();break;case",":r[0]++,i="";break;case"=":break;default:i+=o}}}catch(e){a.e(e)}finally{a.f()}var s=ht.find((function(e){return void 0!==n[0]&&e.key===n[0].toUpperCase()})),l=this.tipContent(s,r[0]);this.el.html(l),""!==l&&this.el.show(),""===l?this.el.hide():this.el.show(),Re(this.el)}}}]),e}(),vt=[{key:"Arial",title:"Arial"},{key:"Arial Black",title:"Arial Black"},{key:"Comic Sans",title:"Comic Sans"},{key:"Comic Sans MS",title:"Comic Sans MS"},{key:"Courier New",title:"Courier New"},{key:"Georgia",title:"Georgia"},{key:"Impact",title:"Impact"},{key:"Lucida Console",title:"Lucida Console"},{key:"Lucida Sans",title:"Lucida Sans"},{key:"Palatino",title:"Palatino"},{key:"Tahoma",title:"Tahoma"},{key:"Times New Roman",title:"Times New Roman"},{key:"Trebuchet",title:"Trebuchet"},{key:"Verdana",title:"Verdana"},{key:"Lato",title:"Lato"},{key:"Helvetica",title:"Helvetica"},{key:"Source Sans Pro",title:"Source Sans Pro"}],pt=[{pt:7.5,px:10},{pt:8,px:11},{pt:9,px:12},{pt:10,px:13},{pt:10.5,px:14},{pt:11,px:15},{pt:12,px:16},{pt:14,px:18.7},{pt:15,px:20},{pt:16,px:21.3},{pt:18,px:24},{pt:22,px:29.3},{pt:24,px:32},{pt:26,px:34.7},{pt:36,px:48},{pt:42,px:56}];function yt(e){for(var t=0;t<pt.length;t+=1){var i=pt[t];if(i.pt===e)return i.px}return e}var bt=function(e){for(var t=[],i=[],n=[],a=0,o="",s=1,l="",c=0;c<e.length;c+=1){var h=e.charAt(c);if(" "!==h){if(h>="a"&&h<="z")n.push(h.toUpperCase());else if(h>="0"&&h<="9"||h>="A"&&h<="Z"||"."===h)n.push(h);else if('"'===h){for(c+=1;'"'!==e.charAt(c);)n.push(e.charAt(c)),c+=1;i.push('"'.concat(n.join(""))),n=[]}else if("-"===h&&/[+\-*/,(]/.test(l))n.push(h);else{if("("!==h&&n.length>0&&i.push(n.join("")),")"===h){var u=t.pop();if(2===a)try{for(var f=y(i.pop()),d=r()(f,2),m=d[0],g=d[1],v=y(i.pop()),p=r()(v,2),w=p[0],x=p[1],k=0,C=w;C<=m;C+=1)for(var S=x;S<=g;S+=1)i.push(b(C,S)),k+=1;i.push([u,k])}catch(e){}else if(1===a||3===a)3===a&&i.push(o),i.push([u,s]),s=1;else for(;"("!==u&&(i.push(u),!(t.length<=0));)u=t.pop();a=0}else if("="===h||">"===h||"<"===h){var _=e.charAt(c+1);o=h,"="!==_&&"-"!==_||(o+=_,c+=1),a=3}else if(":"===h)a=2;else if(","===h)3===a&&i.push(o),a=1,s+=1;else if("("===h&&n.length>0)t.push(n.join(""));else{if(t.length>0&&("+"===h||"-"===h)){var T=t[t.length-1];if("("!==T&&i.push(t.pop()),"*"===T||"/"===T)for(;t.length>0&&"("!==(T=t[t.length-1]);)i.push(t.pop())}t.push(h)}n=[]}l=h}}for(n.length>0&&i.push(n.join(""));t.length>0;)i.push(t.pop());return i},wt=function(e,t){var i=r()(e,1)[0],n=e;if('"'===i)return e.substring(1);var a=1;if("-"===i&&(n=e.substring(1),a=-1),n[0]>="0"&&n[0]<="9")return a*Number(n);var o=y(n),s=r()(o,2);return a*t(s[0],s[1])},xt=function(e,t,i,n){for(var a=[],o=0;o<e.length;o+=1){var s=e[o],l=s[0];if("+"===s){var c=a.pop();a.push(P("+",a.pop(),c))}else if("-"===s)if(1===a.length){var h=a.pop();a.push(P("*",h,-1))}else{var u=a.pop();a.push(P("-",a.pop(),u))}else if("*"===s)a.push(P("*",a.pop(),a.pop()));else if("/"===s){var f=a.pop();a.push(P("/",a.pop(),f))}else if("="===l||">"===l||"<"===l){var d=a.pop();Number.isNaN(d)||(d=Number(d));var m=a.pop();Number.isNaN(m)||(m=Number(m));var g=!1;"="===l?g=m===d:">"===s?g=m>d:">="===s?g=m>=d:"<"===s?g=m<d:"<="===s&&(g=m<=d),a.push(g)}else if(Array.isArray(s)){for(var v=r()(s,2),p=v[0],y=v[1],b=[],w=0;w<y;w+=1)b.push(a.pop());a.push(t[p].render(b.reverse()))}else{if(n.includes(s))return 0;(l>="a"&&l<="z"||l>="A"&&l<="Z")&&n.push(s),a.push(wt(s,i)),n.pop()}}return a[0]},kt=function e(t,i,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if("="===t[0]){var a=bt(t.substring(1));return a.length<=0?t:xt(a,i,(function(t,a){return e(n(t,a),i,n,r)}),r)}return t},Ct=function(e){return e},St=function(e){if(/^(-?\d*.?\d*)$/.test(e)){var t=Number(e).toFixed(2).toString().split("\\."),i=h()(t),n=i[0],r=i.slice(1);return[n.toLocaleString()].concat(m()(r))}return e},_t=[{key:"normal",title:X("format.normal"),type:"string",render:Ct},{key:"text",title:X("format.text"),type:"string",render:Ct},{key:"number",title:X("format.number"),type:"number",label:"1,000.12",render:St},{key:"percent",title:X("format.percent"),type:"number",label:"10.12%",render:function(e){return"".concat(e,"%")}},{key:"rmb",title:X("format.rmb"),type:"number",label:"¥10.00",render:function(e){return"¥".concat(St(e))}},{key:"usd",title:X("format.usd"),type:"number",label:"$10.00",render:function(e){return"$".concat(St(e))}},{key:"eur",title:X("format.eur"),type:"number",label:"€10.00",render:function(e){return"€".concat(St(e))}},{key:"date",title:X("format.date"),type:"date",label:"26/09/2008",render:Ct},{key:"time",title:X("format.time"),type:"date",label:"15:59:00",render:Ct},{key:"datetime",title:X("format.datetime"),type:"date",label:"26/09/2008 15:59:00",render:Ct},{key:"duration",title:X("format.duration"),type:"date",label:"24:01:00",render:Ct}],Tt={};function Ot(){return window.devicePixelRatio||1}function Et(){return Ot()-.5}function Rt(e){return parseInt(e*Ot(),10)}function It(e){var t=Math.ceil(e/Ot());return Rt(t)===e?t:t-1}function At(e){var t=Rt(e);return t>0?t-.5:.5}_t.forEach((function(e){Tt[e.key]=e}));var Dt=function(){function e(t,i,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;l()(this,e),this.x=t,this.y=i,this.width=n,this.height=r,this.padding=a,this.bgcolor="#ffffff",this.borderTop=null,this.borderRight=null,this.borderBottom=null,this.borderLeft=null,this.pbgcolor=null,this.pattern=null}return o()(e,[{key:"setBorders",value:function(e){var t=e.top,i=e.bottom,n=e.left,r=e.right;t&&(this.borderTop=t),r&&(this.borderRight=r),i&&(this.borderBottom=i),n&&(this.borderLeft=n)}},{key:"setPading",value:function(e,t){this.lpading=e,this.rpading=t}},{key:"setPattern",value:function(e){e&&(this.pattern=e)}},{key:"resize",value:function(e,t){this.width=e,this.height=t}},{key:"innerWidth",value:function(){return this.lpading||this.rpading?this.width-(this.lpading+this.rpading)-2:this.width-2*this.padding-2}},{key:"innerHeight",value:function(){return this.height-2*this.padding-2}},{key:"textx",value:function(e){var t=this.width,i=this.padding,n=this.lpading,r=this.rpading,a=this.x;return"left"===e?a+=n||i:"center"===e?a+=t/2:"right"===e&&(a+=t-(r||i)),a}},{key:"texty",value:function(e,t){var i=this.height,n=this.padding,r=this.y;return"top"===e?r+=n:"middle"===e?r+=i/2-t/2:"bottom"===e&&(r+=i-n-t),r}},{key:"topxys",value:function(){var e=this.x,t=this.y;return[[e,t],[e+this.width,t]]}},{key:"rightxys",value:function(){var e=this.x,t=this.y,i=this.width;return[[e+i,t],[e+i,t+this.height]]}},{key:"bottomxys",value:function(){var e=this.x,t=this.y,i=this.width,n=this.height;return[[e,t+n],[e+i,t+n]]}},{key:"leftxys",value:function(){var e=this.x,t=this.y;return[[e,t],[e,t+this.height]]}}]),e}();function Pt(e,t,i,n,r,a,o){var s={x:0,y:0};"underline"===e?s.y="bottom"===r?0:"top"===r?-(a+2):-a/2:"strike"===e&&("bottom"===r?s.y=a/2:"top"===r&&(s.y=-(a/2+2))),"center"===n?s.x=o/2:"right"===n&&(s.x=o),this.line([t-s.x,i-s.y],[t-s.x+o,i-s.y])}function Ft(e,t,i,n,r,a){for(var o=i;o<r;o+=a)e.moveTo(t,o),e.lineTo(n,o)}function Mt(e,t,i,n,r,a){for(var o=t;o<n;o+=a)e.moveTo(o,i),e.lineTo(o,r)}function Lt(e,t,i,n,r,a){for(var o=t,s=o+a;s<=n;s+=a)e.moveTo(s,r),e.lineTo(o,i),o+=a}function jt(e,t,i,n,r,a){for(var o=t,s=o+a;s<=n;s+=a)e.moveTo(o,r),e.lineTo(s,i),o+=a}function zt(e,t,i,n,r,a){for(var o=i;o<r;o+=a)e.moveTo(t,o),e.lineTo(n,o)}var Bt=function(){function e(t,i,n){l()(this,e),this.width=i,this.height=n,this.ctx=t,this.ctx.scale(Ot(),Ot())}return o()(e,[{key:"setel",value:function(e){var t=this.width,i=this.height;this.el=e,this.ctx=e.getContext("2d"),this.resize(t,i),this.ctx.scale(Ot(),Ot())}},{key:"resize",value:function(e,t){this.width=e,this.height=t,this.el.style.width="".concat(e,"px"),this.el.style.height="".concat(t,"px"),this.el.width=Rt(e),this.el.height=Rt(t)}},{key:"clear",value:function(){var e=this.width,t=this.height;return this.ctx.clearRect(0,0,Rt(e),Rt(t)),this}},{key:"attr",value:function(e){return Object.assign(this.ctx,e),this}},{key:"save",value:function(){return this.ctx.save(),this.ctx.beginPath(),this}},{key:"restore",value:function(){return this.ctx.restore(),this}},{key:"beginPath",value:function(){return this.ctx.beginPath(),this}},{key:"translate",value:function(e,t){return this.ctx.translate(Rt(e),Rt(t)),this}},{key:"scale",value:function(e,t){return this.ctx.scale(e,t),this}},{key:"scaledpr",value:function(e){this.scale(e,e)}},{key:"clearRect",value:function(e,t,i,n){return this.ctx.clearRect(e,t,i,n),this}},{key:"fillRectWithColor",value:function(e,t,i,n,r,a,o){var s,l,c=this.ctx;this.save(),void 0!==e&&(c.fillStyle=o?(s=o,l=e.slice(1),"rgba("+[parseInt("0x"+l.slice(0,2)),parseInt("0x"+l.slice(2,4)),parseInt("0x"+l.slice(4,6)),1-s].toString()+")"):e),this.fillRect(t,i,n,r),a&&(c.globalCompositeOperation="lighter",c.fillStyle="rgba(255, 255, 255, 0.8)",this.fillRect(t,i,n,r)),this.restore()}},{key:"fillRect",value:function(e,t,i,n){return this.ctx.fillRect(Rt(e)-.5,Rt(t)-.5,Rt(i),Rt(n)),this}},{key:"fillText",value:function(e,t,i){return this.ctx.fillText(e,Rt(t),Rt(i)),this}},{key:"richtext",value:function(e,t,i,n){var r=this,a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5?arguments[5]:void 0,s=this.ctx,l=e.bigfontsize,c=e.rtxt,h=e.text,u=e.isactiveeffect,f=h.length,d=t.exttxtwidth?t.exttxtwidth+t.innerWidth():t.innerWidth();if(!(d<=0)){var m=t.textx(i);s.save(),s.beginPath();var g=this;this.attr({textAlign:"center"===i?"right":i,textBaseline:"bottom"});var v=[],p=[],y=c.length;if(a)for(var b=function(e){var t=c[e],i=[],n=0,r=0,a=0;t.forEach((function(e){g.attr({font:"".concat(e.font.italic?"italic":""," ").concat(e.font.bold?"bold":""," ").concat(Rt(e.font.size),"pt ").concat(e.font.name)});var t=s.measureText(e.txt).width;if(r=n,(n+=t)>Rt(d)){for(var o={w:r,len:0,start:0},l=0;l<e.txt.length;)if(o.w+=s.measureText(e.txt[l]).width+1,o.w>=Rt(d)){if(o.len===o.start&&0===i.length&&(o.len+=1,l++),o.len>o.start){var c={};c.font=e.font,c.txt=e.txt.substring(o.start,o.len),c.notorigindivide=!0,i.push(c),e.font.size>a&&(a=e.font.size)}v.push(i),p.push(a),o={w:0,len:l,start:l},n=0,i=[],a=0}else o.len+=1,l++;if(o.len>o.start){var h={};h.font=e.font,h.txt=e.txt.substring(o.start,o.len),i.push(h),e.font.size>a&&(a=e.font.size),n=o.w}}else i.push(e),e.font.size>a&&(a=e.font.size)})),v.push(i),p.push(a)},w=0;w<y;w++)b(w);else v=c,p=l;for(var x=p.length,k=0,C=0;C<x;C++)k+=p[C]+8;var S=[],_=[];if("center"===i||"right"===i)for(var T=0;T<x;T++){var O=v[T],E=0;O.forEach((function(e){g.attr({font:"".concat(e.font.italic?"italic":""," ").concat(e.font.bold?"bold":""," ").concat(Rt(e.font.size),"pt ").concat(e.font.name),fillStyle:e.font.color,strokeStyle:e.font.color}),E+=It(s.measureText(e.txt).width)})),_.push(E)}if(0==o.length&&o.push(null),o.forEach((function(e){for(var a=t.texty(n,k),o=0,l=!1,c=!1,d=function(t){var n=v[t],d=0,y=m,b=y,w=y,x=p[t]+8,k=_.length>0?_[t]:0;"center"===i?b=y-k/2:"right"===i&&(b=y-k);var C=b;a+=x,n.forEach((function(t){g.attr({font:"".concat(t.font.italic?"italic":""," ").concat(t.font.bold?"bold":""," ").concat(Rt(t.font.size),"pt ").concat(t.font.name),fillStyle:u?"#217346":t.font.color,strokeStyle:u?"#217346":t.font.color});var n=It(s.measureText(t.txt).width);if(w=C+n,null!==e){for(var m=e.start;"\n"===h[m++]&&m<e.end&&m<f;)e.start=m;if(o<=e.start&&e.start<o+t.txt.length){l=!0;var v=t.txt.substr(0,e.start-o),p=It(s.measureText(v).width);b=C+p}if(o<e.end&&e.end<=o+t.txt.length){var _=t.txt.substr(0,e.end-o),T=It(s.measureText(_).width);w=C+T,l=!1,S.push({x:b,y:a-x,w:w-b,h:x})}}d+=n;var O=0;"center"===i?O=k/2-d:"right"===i&&(O=k-d),c||r.fillText(t.txt,y-O,a),"center"===i&&(O+=n/2),!c&&t.font.strike&&Pt.call(r,"strike",y-O,a,i,"bottom",t.font.size,n),!c&&t.font.underline&&Pt.call(r,"underline",y-O,a,i,"bottom",t.font.size,n),"left"===i&&(y+=n),C+=n,o+=t.txt.length})),null!==e&&l&&S.push({x:b,y:a-x,w:w-b,h:x});var T=n.length;T>0&&n[T-1].notorigindivide||o++},y=0;y<x;y++)d(y);c||(c=!0)})),s.restore(),null!=o[0]){s.save(),this.attr({fillStyle:o[0].color});for(var R=0,I=S.length;R<I;R++){var A=S[R];this.fillRect(A.x,A.y,A.w,A.h)}s.restore()}return this}}},{key:"text",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4?arguments[4]:void 0,o=this.ctx,s=n.align,l=n.valign,c=n.font,h=n.color,u=n.strike,f=n.underline,d=t.textx(s);o.save(),o.beginPath(),this.attr({textAlign:s,textBaseline:l,font:"".concat(c.italic?"italic":""," ").concat(c.bold?"bold":""," ").concat(Rt(c.size),"px ").concat(c.name),fillStyle:h,strokeStyle:h});var m="".concat(e).split("\n"),g=t.exttxtwidth?t.exttxtwidth+t.innerWidth():t.innerWidth(),v=[];m.forEach((function(e){var t=o.measureText(e).width;if(r&&t>Rt(g)){for(var i={w:0,len:0,start:0},n=0;n<e.length;n+=1)i.w>=Rt(g)&&(v.push(e.substring(i.start,i.len)),i={w:0,len:0,start:n}),i.len+=1,i.w+=o.measureText(e[n]).width+1;i.len>0&&v.push(e.substring(i.start,i.len))}else v.push(e)}));var p=(v.length-1)*(c.size+2),y=!1,b=[];if(0==a.length&&a.push(null),a.forEach((function(e){var n=t.texty(l,p),r=0,a=!1;v.forEach((function(t){var h=o.measureText(t).width,m=d,g=d+It(h);if(null!==e){if(r<=e.start&&e.start<r+t.length){a=!0;var v=t.substr(0,e.start-r),p=It(o.measureText(v).width);m+=p,It(h)-p}if(r<e.end&&e.end<r+t.length){var w=t.substr(0,e.end-r),x=It(o.measureText(w).width);g=d+x}if(r>e.end&&(a=!1),a){var k={x:0,y:0};k.y="bottom"===l?c.size+2:"top"===l?2:(c.size+2)/2,"center"===s?k.x=It(h/2):"right"===s&&(k.x=It(h)),b.push({x:m-k.x,y:n-k.y,w:g-m,h:c.size+2})}}y||(i.fillText(t,d,n),u&&Pt.call(i,"strike",d,n,s,l,c.size,It(h)),f&&Pt.call(i,"underline",d,n,s,l,c.size,It(h))),n+=c.size+2,r+=t.length+1})),y||(y=!0)})),o.restore(),null!==a[0]){o.save(),this.attr({fillStyle:a[0].color});for(var w=0,x=b.length;w<x;w++){var k=b[w];this.fillRect(k.x,k.y,k.w,k.h)}o.restore()}return this}},{key:"border",value:function(e,t){var i=this.ctx;return i.lineWidth=Et,i.strokeStyle=t,"medium"===e?i.lineWidth=Rt(2)-.5:"thick"===e?i.lineWidth=Rt(3):"dashed"===e?i.setLineDash([Rt(3),Rt(2)]):"dotted"===e?i.setLineDash([Rt(1),Rt(1)]):"double"===e&&i.setLineDash([Rt(2),0]),this}},{key:"line",value:function(){var e=this.ctx;if(arguments.length>1){e.beginPath();var t=arguments.length<=0?void 0:arguments[0],i=r()(t,2),n=i[0],a=i[1];e.moveTo(At(n),At(a));for(var o=1;o<arguments.length;o+=1){var s=o<0||arguments.length<=o?void 0:arguments[o],l=r()(s,2),c=l[0],h=l[1];e.lineTo(At(c),At(h))}e.stroke()}return this}},{key:"strokeBorders",value:function(e){var t=this.ctx;t.save();var i=e.borderTop,n=e.borderRight,r=e.borderBottom,a=e.borderLeft;i&&(this.border.apply(this,m()(i)),this.line.apply(this,m()(e.topxys()))),n&&(this.border.apply(this,m()(n)),this.line.apply(this,m()(e.rightxys()))),r&&(this.border.apply(this,m()(r)),this.line.apply(this,m()(e.bottomxys()))),a&&(this.border.apply(this,m()(a)),this.line.apply(this,m()(e.leftxys()))),t.restore()}},{key:"strokePattern",value:function(e){var t=this.ctx;t.save();var i=e.x,n=e.y,r=e.width,a=e.height,o=e.pattern;if(o){t.beginPath();var s=At(i),l=s+Rt(r),c=At(n),h=c+Rt(a);switch(o){case"None":case"Solid":break;case"HorizontalStripe":t.lineWidth=2,t.setLineDash([]),Ft(t,s,c,l,h,4);break;case"ThinHorizontalStripe":t.lineWidth=1,t.setLineDash([]),Ft(t,s,c,l,h,4);break;case"Gray75":t.lineWidth=2,t.setLineDash([2]),zt(t,s,c,l,h,3);break;case"VerticalStripe":t.lineWidth=2,t.setLineDash([]),Mt(t,s,c,l,h,4);break;case"ThinVerticalStripe":t.lineWidth=1,t.setLineDash([]),Mt(t,s,c,l,h,4);break;case"Gray50":t.lineWidth=2,t.setLineDash([2]),zt(t,s,c,l,h,3.5);break;case"ReverseDiagonalStripe":t.lineWidth=2,t.setLineDash([]),Lt(t,s,c,l,h,4);break;case"ThinReverseDiagonalStripe":t.lineWidth=1,t.setLineDash([]),Lt(t,s,c,l,h,4);break;case"Gray25":t.lineWidth=2,t.setLineDash([2]),zt(t,s,c,l,h,4);break;case"DiagonalStripe":t.lineWidth=2,t.setLineDash([]),jt(t,s,c,l,h,4);break;case"ThinDiagonalStripe":t.lineWidth=1,t.setLineDash([]),jt(t,s,c,l,h,4);break;case"Gray12":t.lineWidth=2,t.setLineDash([2]),zt(t,s,c,l,h,4.5);break;case"DiagonalCrosshatch":t.lineWidth=1.5,t.setLineDash([]),Lt(t,s,c,l,h,4),jt(t,s,c,l,h,4);break;case"ThinHorizontalCrosshatch":t.lineWidth=1,t.setLineDash([]),Ft(t,s,c,l,h,4),Mt(t,s,c,l,h,4);break;case"Gray6":t.lineWidth=2,t.setLineDash([2]),zt(t,s,c,l,h,5);break;case"ThickDiagonalCrosshatch":t.lineWidth=2,t.setLineDash([]),Lt(t,s,c,l,h,4),jt(t,s,c,l,h,4);break;case"ThinDiagonalCrosshatch":t.lineWidth=1,t.setLineDash([]),Lt(t,s,c,l,h,4),jt(t,s,c,l,h,4)}t.closePath(),t.stroke()}t.restore()}},{key:"dropdown",value:function(e){var t=this.ctx,i=e.x,n=e.y,r=i+e.width-15,a=n+e.height-15;t.save(),t.beginPath(),t.moveTo(Rt(r),Rt(a)),t.lineTo(Rt(r+8),Rt(a)),t.lineTo(Rt(r+4),Rt(a+6)),t.closePath(),t.fillStyle="rgba(0, 0, 0, .45)",t.fill(),t.restore()}},{key:"error",value:function(e,t){var i=this.ctx,n=e.x,r=e.y,a=e.width,o=n+a-1;i.save(),i.beginPath(),t?(i.moveTo(Rt(o-a+8),Rt(r-1)),i.lineTo(Rt(o-a),Rt(r-1)),i.lineTo(Rt(o-a),Rt(r+8))):(i.moveTo(Rt(o-8),Rt(r-1)),i.lineTo(Rt(o),Rt(r-1)),i.lineTo(Rt(o),Rt(r+8))),i.closePath(),i.fillStyle="rgba(255, 0, 0, .65)",i.fill(),i.restore()}},{key:"frozen",value:function(e){var t=this.ctx,i=e.x,n=e.y,r=i+e.width-1;t.save(),t.beginPath(),t.moveTo(Rt(r-8),Rt(n-1)),t.lineTo(Rt(r),Rt(n-1)),t.lineTo(Rt(r),Rt(n+8)),t.closePath(),t.fillStyle="rgba(0, 255, 0, .85)",t.fill(),t.restore()}},{key:"line2",value:function(){var e=this.ctx;if(arguments.length>1){e.beginPath();var t=arguments.length<=0?void 0:arguments[0],i=r()(t,2),n=i[0],a=i[1];e.moveTo(n,a);for(var o=1;o<arguments.length;o+=1){var s=o<0||arguments.length<=o?void 0:arguments[o],l=r()(s,2),c=l[0],h=l[1];e.lineTo(c,h)}e.stroke()}return this}},{key:"rect3",value:function(e,t){var i=this.ctx,n=e.x,r=e.y,a=e.width,o=e.height,s=t.bgColor,l=t.isactiveeffect,c=t.tp;s&&this.fillRectWithColor(s,n,r,a,o,l,c),i.save(),i.beginPath(),i.rect(Rt(n)-.5,Rt(r)-.5,Rt(a),Rt(o)),i.closePath(),i.strokeStyle="black",i.stroke(),i.restore()}},{key:"rect2",value:function(e,t){var i=this.ctx,n=e.x,r=e.y,a=e.width,o=e.height,s=e.bgcolor,l=e.pbgcolor,c=e.exttxtwidthR,h=e.exttxtwidthL;if(i.save(),i.beginPath(),i.fillStyle=void 0!==s?s:void 0!==l?l:"#ffffff",i.rect(n+1,r+1,a-2,o-2),i.clip(),i.fill(),void 0!==c||void 0!==h){var u=void 0===c?0:c,f=void 0===h?0:h;i.restore(),i.save(),i.rect(n+1-f,r+1,a+u+f-2,o-2),i.clip(),t(),i.restore()}else t(),i.restore()}},{key:"rect",value:function(e,t){var i=this.ctx,n=e.x,r=e.y,a=e.width,o=e.height,s=e.bgcolor,l=e.pbgcolor,c=e.exttxtwidthR,h=e.exttxtwidthL;if(i.save(),i.beginPath(),i.fillStyle=void 0!==s?s:void 0!==l?l:"#ffffff",i.rect(At(n+1),At(r+1),Rt(a-2),Rt(o-2)),i.clip(),i.fill(),void 0!==c||void 0!==h){var u=void 0===c?0:c,f=void 0===h?0:h;i.restore(),i.save(),i.rect(At(n+1-f),At(r+1),Rt(a+u+f-2),Rt(o-2)),i.clip(),t(),i.restore()}else t(),i.restore()}}]),e}();function Ht(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return Nt(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Nt(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function Nt(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var Ut={fillStyle:"#f4f5f8"},Xt={fillStyle:"#fff",lineWidth:Et,strokeStyle:"#e6e6e6"};function Wt(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=e.cellRect(t,i),a=r.left,o=r.top,s=r.width,l=r.height;return new Dt(a,o+n,s,l,3)}function qt(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=e.cellRect(t.sri,t.sci),r=n.left,a=n.top,o=e.cols.sumWidth(t.sci,t.eci+1),s=e.rows.sumHeight(t.sri,t.eri+1);return new Dt(r,a+i,o,s,3)}function Yt(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=qt(e,t,i);return n.width+=3,n.height+=3,n}function Vt(e,t,i,n,r,a,o){var s=e.cols,l=e.viewRangeCache;if(!o.textwrap&&a.text&&a.text.length>0){var c=0,h=0;if(void 0===o.align||"center"===o.align||"left"===o.align)for(var u=r+1;u<=l.eci;u++){var f=e.getCell(i,u);if(null!==f&&void 0!==f.text&&f.text.length>0)break;c+=s.getWidth(u)}if(o.align&&("center"===o.align||"right"===o.align))for(var d=r-1;d>=l.sci;d--){var m=e.getCell(i,d);if(null!==m&&void 0!==m.text&&m.text.length>0)break;h+=s.getWidth(d)}c>0&&(t.exttxtwidthR=c),h>0&&(t.exttxtwidthL=h)}}function Gt(e){if(void 0!==e.rtxt&&void 0===e.bigfontsize){for(var t=[],i=[],n=[],r=0,a=e.rtxt.length,o=0;o<a;o++){var s=e.rtxt[o].txt.split("\n"),l=s.length,c=e.rtxt[o].font.size;if(1===l)n.push(e.rtxt[o]),c>r&&(r=c);else{if(0!==s[0].length){var h={};h.font=e.rtxt[o].font,h.txt=s[0],n.push(h),c>r&&(r=c)}i.push(r),t.push(n),n=[],r=0;for(var u=1;u<l-1;u++){var f={};f.font=e.rtxt[o].font,f.txt=s[u],n.push(f),t.push(n),i.push(c),n=[],r=0}if(0!==s[l-1].length){var d={};d.font=e.rtxt[o].font,d.txt=s[l-1],n.push(d),r=c}}}n.length>0&&(i.push(r),t.push(n)),e.rtxt=t,e.bigfontsize=i}}function Zt(e,t,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=t.sortedRowMap,s=t.rows,l=t.cols;t.viewRangeCache;if(!s.isHide(i)&&!l.isHide(n)){var c=i;o.has(i)&&(c=o.get(i));var h=t.getCell(c,n);if(null!==h&&(!h.merge||a)){Gt(h);var u=!1;"editable"in h&&!1===h.editable&&(u=!0);var f=t.getCellStyleOrDefault(c,n),d=Wt(t,i,n,r);d.bgcolor=f.bgcolor,d.pbgcolor=f.pbgcolor;var m=d,g=!1,v=!1;f.hasbgcolor&&!a&&((t.bgcolor||void 0===f.border||void 0===f.border.right)&&(m.width+=3,g=!0),(t.bgcolor||void 0===f.border||void 0===f.border.bottom)&&(m.height+=3,v=!0)),Vt(t,d,c,0,n,h,f);var p=t.getHighlightCellTxt(i,n);e.rect(m,(function(){var i="";i=t.settings.evalPaused||"server"===t.settings.updateMode?h.text||"":kt(h.text||"",ft,(function(e,i){return t.getCellTextOrDefault(i,e)})),f.format&&"server"!==t.settings.updateMode&&(i=Tt[f.format].render(i));var r=Object.assign({},f.font);r.size=yt(r.size),void 0===h.rtxt?""!==i&&e.text(i,d,{align:f.align,valign:f.valign,font:r,color:f.color,strike:f.strike,underline:f.underline},f.textwrap,p):e.richtext(h,d,f.align,f.valign,f.textwrap,p),t.validations.getError(c,n)&&e.error(d),u&&e.frozen(d),void 0!==f.pattern&&(d.setPattern(f.pattern),e.strokePattern(d))})),void 0!==f.border&&(g&&(d.width-=3),v&&(d.height-=3),d.setBorders(f.border),e.strokeBorders(d))}}}function Kt(e){var t=this.data,i=this.draw;if(e){var n=t.autoFilter,r=t.TableAutoFilters;Jt(t,e,i,n),r.forEach((function(n){Jt(t,e,i,n)}))}}function Jt(e,t,i,n){if(n.active()){var r=n.hrange();t.intersects(r)&&r.each((function(t,n){var r=Wt(e,t,n);i.dropdown(r)}))}}function $t(e,t,i,n,r){var a=this.draw,o=this.data;a.save(),o.displayRight2Left?a.translate(-t,i).translate(n,r):a.translate(t,i).translate(n,r),o.comments.forEach((function(t){if(e.sri<=t.row&&e.eri>=t.row&&e.sci<=t.col&&e.eci>=t.col){var i=Wt(o,t.row,t.col);a.error(i,o.displayRight2Left)}})),a.restore()}function Qt(e,t,i,n,r){var a=this.draw,o=this.data;a.save(),o.displayRight2Left?a.translate(-t,i).translate(n,r):a.translate(t,i).translate(n,r);var s=o.exceptRowSet;a.save(),a.translate(0,-0),e.emptyFirst((function(e,t){Zt(a,o,e,t)}),(function(e){return function(e){return!s.has(e)}(e)}),(function(e,t){return o.isEmpty(e,t)})),a.restore();var l=new Set;a.save(),a.translate(0,-0),o.eachMergesInView(e,(function(e){var t=e.sri,i=e.sci,n=e.eri;if(s.has(t)){if(!l.has(t)){l.add(t);var r=o.rows.sumHeight(t,n+1);a.translate(0,-r)}}else Zt(a,o,t,i,0,!0)})),a.restore(),Kt.call(this,e),a.restore()}function ei(e,t,i,n){var r=this.draw;r.save(),r.attr({fillStyle:"rgba(75, 137, 255, 0.08)"}).fillRect(e,t,i,n),r.restore()}function ti(e,t,i,n,r,a){var o=this,s=this.draw,l=this.data,c=t.h,h=t.w,u=a+n,f=r+i,d=l.displayRight2Left?l.viewWidth():0,m=l.displayRight2Left?d-i:0;if(s.save(),s.attr(Ut),"all"!==e&&"left"!==e||s.fillRect(m,u,i,c),"all"===e||"top"===e)if(l.displayRight2Left){var g=t.lineStartx?t.lineStartx:0;s.fillRect(g,0,h,n)}else s.fillRect(f,0,h,n);var p=l.selector.range,y=p.sri,b=p.sci,w=p.eri,x=p.eci;if(s.attr({textAlign:"center",textBaseline:"middle",font:"500 ".concat(Rt(12),"px Source Sans Pro"),fillStyle:"#585757",lineWidth:Et(),strokeStyle:"#e6e6e6"}),"all"===e||"left"===e){var k=m;l.rowEach(t.sri,t.eri,(function(e,t,n){var r=u+t,a=e;s.line([k,r],[k+i,r]),y<=a&&a<w+1&&ei.call(o,k,r,i,n),s.fillText(a+1,k+i/2,r+n/2),e>0&&l.rows.isHide(e-1)&&(s.save(),s.attr({strokeStyle:"#c6c6c6"}),s.line([k+5,r+5],[k+i-5,r+5]),s.restore())})),s.line([k,c+u],[k+i,c+u]),s.line([k+i,u],[k+i,c+u])}"all"!==e&&"top"!==e||(l.colEach(t.sci,t.eci,(function(e,t,i){var r=l.displayRight2Left?d-(f+t+i):f+t,a=e;s.line([r,0],[r,n]),b<=a&&a<x+1&&ei.call(o,r,0,i,n),s.fillText(v(a),r+i/2,n/2),e>0&&l.cols.isHide(e-1)&&(s.save(),s.attr({strokeStyle:"#c6c6c6"}),s.line([r+5,5],[r+5,n-5]),s.restore())})),s.line([h+f,0],[h+f,n]),s.line([0,n],[h+f,n])),s.restore()}function ii(e,t){var i=this.draw;i.save(),i.attr({fillStyle:"#f4f5f8"}).fillRect(0,0,e,t),i.restore()}function ni(e,t,i,n,a){var o=e.sri,s=e.sci,l=e.eri,c=e.eci,h=e.w,u=e.h,f=e.clearStartx,d=void 0===f?0:f,m=e.lineStartx,g=void 0===m?0:m,v=this.draw,p=this.data,y=(p.settings,p.displayRight2Left),b=p.scroll;if(v.save(),y?v.attr(Xt).translate(-(t+n),i+a):v.attr(Xt).translate(t+n,i+a),v.clearRect(d,0,h,u),p.bgcolor&&v.fillRectWithColor(p.bgcolor,d,0,h,u),p.showGrid&&!p.bgcolor){if(y){h+=t+n;var w=r()(p.freeze,2),x=(w[0],w[1]);x>0&&s>=x&&(h+=b.x),0===x&&0==g&&(h=p.viewWidth()),p.rowEach(o,l,(function(e,t,i){e!==o&&v.line([g,t],[g+h,t]),e===l&&v.line([g,t+i],[g+h,t+i])}))}else p.rowEach(o,l,(function(e,t,i){e!==o&&v.line([0,t],[h,t]),e===l&&v.line([0,t+i],[h,t+i])}));if(y){var k=p.viewWidth();p.colEach(s,c,(function(e,t,i){v.line([k-t-i,0],[k-t-i,u]),e===s&&v.line([k-t,0],[k-t,u])}))}else p.colEach(s,c,(function(e,t,i){e!==s&&v.line([t,0],[t,u]),e===c&&v.line([t+i,0],[t+i,u])}));v.restore()}else v.restore()}function ri(e,t,i,n){var r=this.draw,a=this.data,o=a.viewWidth(),s=(o-e)/this.zoomlevel,l=(a.viewHeight()-t)/this.zoomlevel;a.displayRight2Left?r.save().translate(-e,t).attr({strokeStyle:"rgba(75, 137, 255, .6)"}):r.save().translate(e,t).attr({strokeStyle:"rgba(75, 137, 255, .6)"}),a.displayRight2Left?(r.line([0,n],[o,n]),r.line([o-i,0],[o-i,l])):(r.line([0,n],[s,n]),r.line([i,0],[i,l])),r.restore()}var ai=function(){function e(t,i){l()(this,e),this.el=t,this.draw=new Bt(t.getContext("2d"),i.viewWidth(),i.viewHeight()),this.draw.setel(t),this.data=i,this.zoomlevel=1}return o()(e,[{key:"resetData",value:function(e){this.data=e,this.render()}},{key:"clearSelectRender",value:function(){var e=this.data,t=this.draw,i=this.zoomlevel,n=e.selector,r=n.ri,a=n.ci,o=r;e.sortedRowMap.has(r)&&(o=sortedRowMap.get(r));var s=e.getCell(o,a);if(null!==s){var l=e.getCellStyleOrDefault(o,a),c=Wt(e,r,a,0);Vt(e,c,o,0,a,s,l);var h=e.cols.indexWidth,u=e.settings.row.height,f=e.freezeTotalWidth(),d=e.scroll,m=d.x,g=d.y;t.save(),t.scaledpr(i),e.displayRight2Left?t.attr(Xt).translate(-(h+f),u+0):t.attr(Xt).translate(h+f,u+0);var v=void 0===c.exttxtwidthR?0:c.exttxtwidthR,p=void 0===c.exttxtwidthL?0:c.exttxtwidthL;t.fillRect(c.x+1-p-m,c.y+1-g,c.width+v+p-2,c.height-2),t.restore()}}},{key:"render",value:function(){var e=this.data,t=this.zoomlevel;if(!e.isupdating){var i=e.rows,n=e.cols;if(0!==Object.keys(i._).length){var a=n.indexWidth,o=e.settings.row.height;this.draw.resize(e.viewWidth(),e.viewHeight()),this.draw.scaledpr(t),this.clear();var s=e.viewRange(),l=e.freezeTotalWidth(),c=e.freezeTotalHeight(),h=e.scroll,u=h.x,f=h.y;ni.call(this,s,a,o,l,c),Qt.call(this,s,a,o,-u,-f),$t.call(this,s,a,o,-u,-f),ti.call(this,"all",s,a,o,l,c),ii.call(this,a,o);var d=r()(e.freeze,2),m=d[0],g=d[1];if(m>0||g>0){if(m>0){var v=s.clone();v.sri=0,v.eri=m-1,v.h=c,ni.call(this,v,a,o,l,0),Qt.call(this,v,a,o,-u,0),$t.call(this,v,a,o,-u,0),ti.call(this,"top",v,a,o,l,0),this.highlightRanges(v,a,o,u,0)}if(g>0){var p=s.clone();p.sci=0,p.eci=g-1,p.w=l,p.clearStartx=e.displayRight2Left?this.draw.ctx.canvas.width-l:0,p.lineStartx=e.displayRight2Left?e.viewWidth()-l:0,ni.call(this,p,a,o,0,c),ti.call(this,"left",p,a,o,0,c),Qt.call(this,p,a,o,0,-f),$t.call(this,p,a,o,0,-f),this.highlightRanges(p,a,o,0,f)}var y=e.freezeViewRange();y.clearStartx=e.displayRight2Left?this.draw.ctx.canvas.width-l:0,y.lineStartx=e.displayRight2Left?e.viewWidth()-l:0,ni.call(this,y,a,o,0,0),ti.call(this,"all",y,a,o,0,0),Qt.call(this,y,a,o,0,0),$t.call(this,y,a,o,0,0),ri.call(this,a,o,l,c),this.highlightRanges(y,a,o,0,0)}this.highlightRanges(s,a,o,u,f)}}}},{key:"highlightRanges",value:function(e,t,i,n,r){var a=this.draw,o=this.data;if(o.showhighlight){if(a.save(),o.displayRight2Left?a.translate(-t,i).translate(-n,-r):a.translate(t,i).translate(-n,-r),o.highlightall){var s=Yt(o,e);s.bgcolor=o.highlightstyle.color,a.rect(s,(function(){}))}else if(o.highlightIR){var l,c=Ht(e.difference(o.highlightIR));try{for(c.s();!(l=c.n()).done;){var h=Yt(o,l.value);h.bgcolor=o.highlightstyle.color,a.rect(h,(function(){}))}}catch(e){c.e(e)}finally{c.f()}}else{var u,f=Ht(o.highlightrg);try{for(f.s();!(u=f.n()).done;){var d=u.value;if(e.intersects(d)){var m=d.clone();m.sri<e.sri&&(m.sri=e.sri),m.eri>e.eri&&(m.eri=e.eri),m.sci<e.sci&&(m.sci=e.sci),m.eci>e.eci&&(m.eci=e.eci);var g=Yt(o,m);g.bgcolor=o.highlightstyle.color,a.rect(g,(function(){}))}}}catch(e){f.e(e)}finally{f.f()}}a.restore()}}},{key:"clear",value:function(){this.draw.clear()}}]),e}();function oi(){var e=this.inputText;if(!/^\s*$/.test(e)){var t=this.textlineEl,i=this.textEl,n=this.areaOffset,r=e.split("\n"),a=Math.max.apply(Math,m()(r.map((function(e){return e.length})))),o=t.offset().width/e.length,s=(a+1)*o+5,l=this.viewFn().width-n.left-o,c=r.length;if(s>n.width){var h=s;s>l&&(h=l,c+=parseInt(s/l,10),c+=s%l>0?1:0),i.css("width","".concat(h,"px"))}c*=this.rowHeight,(c-=7)>n.height&&i.css("height","".concat(c,"px"))}}function si(e){var t=e.target;if(window.getSelection){var i=window.getSelection(),n=i.getRangeAt(0),r=document.createElement("br");n.deleteContents(),n.insertNode(r),n.collapse(!1),i.removeAllRanges(),i.addRange(n),this.inputText=t.innerText,this.inputHtml=t.innerHTML,oi.call(this)}}function li(e){var t=e.keyCode,i=e.altKey;13!==t&&9!==t&&e.stopPropagation(),13===t&&i&&(si.call(this,e),e.stopPropagation()),13!==t||i||e.preventDefault()}function ci(e){var t=e.target.innerText,i=e.target.innerHTML,n=this.suggest,r=this.textlineEl,a=this.validator,o=this.cell;if(this.textbox)return this.textbox.ischange=!0,void(this.inputHtml=i);if(null!==o)if("editable"in o&&!0===o.editable||void 0===o.editable){if(this.inputText=t,this.inputHtml=i,a)"list"===a.type?n.search(t):n.hide();else{var s=t.lastIndexOf("=");-1!==s?(n.search(t.substring(s+1),"f"),"("===e.data&&n.hide(),this.formalaTip.show(t)):(n.hide(),this.formalaTip.hide())}r.html(i),oi.call(this),this.change("input",t)}else e.target.innerText="";else{if(this.inputText=t,this.inputHtml=i,a)"list"===a.type?n.search(t):n.hide();else{var l=t.lastIndexOf("=");-1!==l?(n.search(t.substring(l+1),"f"),"("===e.data&&n.hide(),this.formalaTip.show(t)):(n.hide(),this.formalaTip.hide())}r.html(t),oi.call(this),this.change("input",t)}}function hi(e,t){var i=this.textEl.el;setTimeout((function(){if(t){var e=window.getSelection(),n=document.createRange();e.removeAllRanges(),n.selectNodeContents(i),n.collapse(!1),e.addRange(n),i.focus()}}),1)}function ui(e,t,i,n){var r=this.textEl,a=this.textlineEl;mobileAndTabletCheck()||r.el.blur();var o=!1;e.length>0?(o=!0,r.html(e)):r.html(t,!0,!0),o?a.html(e):a.html(t,!0,!0),hi.call(this,i,n)}function fi(e,t){var i=this.inputText,n=this.validator,r=0;if(n&&"list"===n.type)this.inputText=e,r=this.inputText.length;else{var a=i.lastIndexOf("="),o=i.substring(0,a+1),s=i.substring(a+1);s=-1!==s.indexOf(")")?s.substring(s.indexOf(")")):"",this.inputText="".concat(o+e.key,"("),r=this.inputText.length,this.inputText+="".concat(s),this.formalaTip.show(this.inputText)}ui.call(this,"",this.inputText,r,t)}function di(){this.suggest.setItems(this.formulas)}var mi=function(){function e(t,i,n,r){var a=this;l()(this,e),this.viewFn=i,this.rowHeight=n,this.formulas=t,this.formalaTip=new gt,this.suggest=new at(t,(function(e){fi.call(a,e,!0)})),this.datepicker=new ct,this.datepicker.change((function(e){a.setText(function(e){var t=e.getMonth()+1,i=e.getDate();return t<10&&(t="0".concat(t)),i<10&&(i="0".concat(i)),"".concat(e.getFullYear(),"-").concat(t,"-").concat(i)}(e)),a.clear()})),this.areaEl=f("div","".concat(ae,"-editor-area")).children(this.textEl=f("div","htmlline").on("input",(function(e){return ci.call(a,e)})).on("paste.stop",(function(){})).on("keydown",(function(e){return li.call(a,e)})),this.textlineEl=f("div","textline"),this.suggest.el,this.datepicker.el,this.formalaTip.el).on("mousemove.stop",(function(){})).on("mousedown.stop",(function(){})),this.el=f("div","".concat(ae,"-editor")).child(this.areaEl).hide(),this.suggest.bindInputEvents(this.textEl,r),this.areaOffset=null,this.freeze={w:0,h:0},this.cell=null,this.inputText="",this.inputHtml="",this.ishtml=!1,this.textbox=null,this.change=function(){},this.textboxChange=function(){}}return o()(e,[{key:"setFreezeLengths",value:function(e,t){this.freeze.w=e,this.freeze.h=t}},{key:"insertTextNewLine",value:function(e){si.call(this,e)}},{key:"clear",value:function(){this.textbox?(""!==this.inputHtml&&this.textboxChange(this.textbox,this.inputHtml),this.textbox.setVisible(!0)):""!==this.inputText&&this.change("finished",this.ishtml?this.inputHtml:this.inputText),this.cell=null,this.textbox=null,this.areaOffset=null,this.inputText="",this.inputHtml="",this.ishtml=!1,this.el.hide(),this.textEl.html(""),this.textEl.cssRemoveKeys("width","height","padding-left","padding-right","text-align","border"),this.textlineEl.html(""),di.call(this),this.datepicker.hide()}},{key:"setOffset",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",i=this.textEl,n=this.areaEl,r=this.suggest,a=this.freeze,o=this.el;if(e){this.areaOffset=e;var s=e.left,l=e.top,c=e.width,h=e.height,u=e.l,f=e.t,d={left:0,top:0};a.w>u&&a.h>f||(a.w<u&&a.h<f?(d.left=a.w,d.top=a.h):a.w>u?d.top=a.h:a.h>f&&(d.left=a.w)),o.offset(d),n.offset({left:s-d.left-.8,top:l-d.top-.8}),i.offset({width:c-.2,height:h-.2});var m={left:0};m[t]=h,r.setOffset(m),r.hide()}}},{key:"setForTextBox",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.el,n=this.textEl;n.attr("contenteditable","true"),i.show(),this.textbox=e,this.textbox.setVisible(!1),this.ishtml=!0,this.inputText=e.text,this.inputHtml=e.html,ui.call(this,e.html,e.text,e.text.length,t),n.css("width","".concat(e.width-9,"px")),n.css("height","".concat(e.height,"px")),n.css("padding-left","".concat(e.lp,"pt")),n.css("padding-right","".concat(e.rp,"pt")),n.css("text-align",e.align),n.css("border","black 1px solid")}},{key:"setCell",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.el,r=this.datepicker,a=this.suggest,o=this.textEl;o.attr("contenteditable","true"),n.show(),this.cell=e;var s=e&&e.text||"",l=e&&e.html||"";if(e&&(e.f?s=e.f:e.ufv&&(s=e.ufv)),this.ishtml=e&&e.html,this.setTextAndHtml(l,s,i),this.validator=t,t){var c=t.type;"date"===c&&(r.show(),/^\s*$/.test(s)||r.setValue(s)),"list"===c&&(a.setItems(t.values()),a.search(""))}}},{key:"setTextAndHtml",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.inputText=t,this.inputHtml=e,ui.call(this,e,t,t.length,i),oi.call(this)}},{key:"setText",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.inputText=e,ui.call(this,"",e,e.length,t),oi.call(this)}}]),e}();function gi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var vi=function(e){ee()(i,e);var t=gi(i);function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return l()(this,i),(n=t.call(this,"div","".concat(ae,"-button ").concat(r))).child(U("button.".concat(e))),n}return i}(u),pi=[["A3",11.69,16.54],["A4",8.27,11.69],["A5",5.83,8.27],["B4",9.84,13.9],["B5",6.93,9.84]],yi=["landscape","portrait"];function bi(e){return parseInt(96*e,10)}function wi(e){"cancel"===e?this.el.hide():this.toPrint()}function xi(e){var t=this.paper,i=e.target.value,n=pi[i];t.w=bi(n[1]),t.h=bi(n[2]),this.preview()}function ki(e){var t=this.paper,i=e.target.value,n=yi[i];t.orientation=n,this.preview()}var Ci=function(){function e(t,i){var n,r;l()(this,e),this.paper={w:bi(pi[0][1]),h:bi(pi[0][2]),padding:50,orientation:yi[0],get width(){return"landscape"===this.orientation?this.h:this.w},get height(){return"landscape"===this.orientation?this.w:this.h}},this.data=t,this.imageCanvas=i,this.el=f("div","".concat(ae,"-print")).children(f("div","".concat(ae,"-print-bar")).children(f("div","-title").child("Print settings"),f("div","-right").children(f("div","".concat(ae,"-buttons")).children(new vi("cancel").on("click",wi.bind(this,"cancel")),new vi("next","primary").on("click",wi.bind(this,"next"))))),f("div","".concat(ae,"-print-content")).children(this.contentEl=f("div","-content"),f("div","-sider").child(f("form","").children(f("fieldset","").children(f("label","").child("".concat(U("print.size"))),(n=f("select","")).children.apply(n,m()(pi.map((function(e,t){return f("option","").attr("value",t).child("".concat(e[0]," ( ").concat(e[1],"''x").concat(e[2],"'' )"))})))).on("change",xi.bind(this))),f("fieldset","").children(f("label","").child("".concat(U("print.orientation"))),(r=f("select","")).children.apply(r,m()(yi.map((function(e,t){return f("option","").attr("value",t).child("".concat(U("print.orientations")[t]))})))).on("change",ki.bind(this))))))).hide()}return o()(e,[{key:"resetData",value:function(e){this.data=e}},{key:"preview",value:function(){var e=this,t=this.data,i=this.paper,n=i.width,r=i.height,a=i.padding,o=n-2*a,s=r-2*a,l=t.contentRange(),c=parseInt(l.h/s,10)+1,h=o/l.w,u=a,d=a;h>1&&(u+=(o-l.w)/2);var m=0,g=0;this.contentEl.html(""),this.canvases=[];for(var v={sri:0,sci:0,eri:0,eci:0},p=function(i){var a=0,o=0,c=f("div","".concat(ae,"-canvas-card")),p=f("canvas","".concat(ae,"-canvas"));e.canvases.push(p.el);var y=new Bt(p.el,n,r);for(y.save(),y.translate(u,d),h<1&&y.scale(h,h);m<=l.eri;m+=1){var b=t.rows.getHeight(m);if(!((a+=b)<s)){o=-(a-b);break}for(var w=0;w<=l.eci;w+=1)Zt(y,t,m,w,g),v.eci=w}v.eri=m,y.restore(),y.save(),y.translate(u,d),h<1&&y.scale(h,h);var x=g;t.eachMergesInView(v,(function(e){var i=e.sri,n=e.sci;Zt(y,t,i,n,x)})),y.restore(),v.sri=v.eri,v.sci=v.eci,g+=o;var k=e.imageCanvas.el.getContext("2d");k.width=n,k.height=r,k.translate(u,d),h<1&&k.scale(h,h),p.el.getContext("2d").drawImage(e.imageCanvas.el,u-e.imageCanvas.tOffset.left,e.imageCanvas.tOffset.top),e.contentEl.child(f("div","".concat(ae,"-canvas-card-wraper")).child(c.child(p)))},y=0;y<c;y+=1)p()}},{key:"toPrint",value:function(){this.el.hide();var e=this.paper,t=f("iframe","").hide().el;window.document.body.appendChild(t);var i=t.contentWindow,n=i.document,r=document.createElement("style");r.innerHTML="\n @page { size: ".concat(e.width,"px ").concat(e.height,"px; };\n canvas {\n page-break-before: auto;\n page-break-after: always;\n image-rendering: pixelated;\n };\n "),n.head.appendChild(r),this.canvases.forEach((function(e){var t=e.cloneNode(!1);t.getContext("2d").drawImage(e,0,0),n.body.appendChild(t)})),i.print()}}]),e}(),Si=[{key:"copy",title:X("contextmenu.copy"),label:"Ctrl+C"},{key:"cut",title:X("contextmenu.cut"),label:"Ctrl+X"},{key:"paste",title:X("contextmenu.paste"),label:"Ctrl+V"},{key:"paste-value",title:X("contextmenu.pasteValue"),label:"Ctrl+Shift+V"},{key:"paste-format",title:X("contextmenu.pasteFormat"),label:"Ctrl+Alt+V"},{key:"divider"},{key:"insert-row",title:X("contextmenu.insertRow")},{key:"insert-column",title:X("contextmenu.insertColumn")},{key:"divider"},{key:"delete-row",title:X("contextmenu.deleteRow")},{key:"delete-column",title:X("contextmenu.deleteColumn")},{key:"delete-cell-text",title:X("contextmenu.deleteCellText")},{key:"hide",title:X("contextmenu.hide")},{key:"divider"},{key:"link",title:X("contextmenu.link")},{key:"openLink",title:X("contextmenu.openLink")},{key:"removeLink",title:X("contextmenu.removeLink")},{key:"divider"},{key:"validation",title:X("contextmenu.validation")},{key:"cell-editable",title:X("contextmenu.celleditable")},{key:"cell-non-editable",title:X("contextmenu.cellnoneditable")}];function _i(e,t){var i=this,n=null;return(n="divider"===e.key?f("div","".concat(ae,"-item divider")):f("div","".concat(ae,"-item")).on("click",(function(){e.callback?e.callback(t,t.selector.getObj()):i.itemClick(e.key),i.hide()})).children(e.text?e.text:e.title(),f("div","label").child(e.label||"").attr("k",e.key))).key=e.key,n}function Ti(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Si,i=arguments.length>1?arguments[1]:void 0;return t.map((function(t){return _i.call(e,t,i)}))}function Oi(e,t){return e.find((function(e){return e.key===t}))}var Ei=function(){function e(t,i){var n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3?arguments[3]:void 0;if(l()(this,e),window.mobileAndTabletCheck()){var o={key:"merge",title:X("contextmenu.merge"),label:""},s={key:"unmerge",title:X("contextmenu.unmerge"),label:""},c={key:"edit",title:X("contextmenu.edit"),label:""};Si.forEach((function(e){e.label=void 0,"delete-cell-text"===e.key&&(e.title=X("contextmenu.clear"))})),Si.push(o),Si.push(s),Si.unshift(c)}this.customMenuItemsForImage=[{key:"delete-image",title:X("contextmenu.deleteImage"),label:"Del"}],this.customsetting=a&&!a.usedefault,this.customItems=this.customsetting?a.customItems:[],this.menuItems=this.customsetting?Ti.call(this,a.customItems,i):Ti.call(this),this.el=(n=f("div","".concat(ae,"-contextmenu"))).children.apply(n,m()(this.menuItems)).hide(),this.viewFn=t,this.itemClick=function(){},this.showMenuBefore=function(){},this.isHide=r,this.setMode("range"),this.sheet=i}return o()(e,[{key:"getImageContextMenuItems",value:function(){return this.customMenuItemsForImage}},{key:"addImageContextMenuItems",value:function(e){var t=this.customMenuItemsForImage;e.forEach((function(e){var i=t.findIndex((function(t){return t.key===e.key}));i>=0&&t.splice(i,1)})),t.push.apply(t,e)}},{key:"delImageContextMenuItems",value:function(e){var t=this.customMenuItemsForImage;e.forEach((function(e){var i=t.findIndex((function(t){return t.key===e}));i>=0&&t.splice(i,1)}))}},{key:"updateImageContextMenuItems",value:function(e){this.addImageContextMenuItems([e])}},{key:"getCutomContextMenuItems",value:function(){if(this.customsetting)return this.customItems}},{key:"addCutomContextMenuItems",value:function(e){var t=this.customItems,i=this.customsetting,n=this.sheet,r=this.menuItems;if(i){var a=Ti.call(this,e,n);e.forEach((function(e,i){"divider"!==e.key&&Oi(t,e.key)||(t.push(e),r.push(a[i]))})),this.rebuildMenuItems(r)}}},{key:"insertCutomContextMenuItem",value:function(e,t){var i=this.customItems,n=this.customsetting,r=this.sheet,a=this.menuItems;if(n&&("divider"===e.key||!Oi(i,e.key))){var o=_i.call(this,e,r);i.splice(t,0,e),a.splice(t,0,o),this.rebuildMenuItems(a)}}},{key:"updateCutomContextMenuItem",value:function(e,t){var i=this.customItems,n=this.customsetting,r=this.sheet,a=this.menuItems;if(n){var o=i.findIndex((function(t){return t.key==e}));if(-1!==o){t.text&&(i[o].text=t.text),t.callback&&(i[o].callback=t.callback);var s=_i.call(this,i[o],r);a[o]=s,this.rebuildMenuItems(a)}}}},{key:"rebuildMenuItems",value:function(e){var t,i=this.sheet;(i.el.removeChild(this.el.el),e.length>0)?this.el=(t=f("div","".concat(ae,"-contextmenu"))).children.apply(t,m()(e)).hide():this.el=f("div","".concat(ae,"-contextmenu")).hide();i.el.child(this.el)}},{key:"delCutomContextMenuItems",value:function(e){var t=this.customItems,i=this.menuItems,n=this.customsetting;this.sheet;n&&(e.forEach((function(e){var n=t.findIndex((function(t){return t.key===e}));n>=0&&(t.splice(n,1),i.splice(n,1))})),this.rebuildMenuItems(i))}},{key:"setMode",value:function(e){if(!this.customsetting){var t=this.menuItems[12];"row-col"===e?t.show():t.hide()}}},{key:"hide",value:function(){var e=this.el;e.hide(),Ee(e)}},{key:"setPosition",value:function(e,t){if(!this.isHide){var i=this.el,n=this.sheet;this.showImageDeleteItem(i,n),this.showMenuBefore(this.menuItems);var r=i.show().offset(),a=r.width,o=r.height,s=this.viewFn(),l=e;s.width-e<=a&&(l-=a),i.css("left","".concat(l,"px"));var c=t;o+t>s.height&&(c-=o+t-s.height),i.css("top","".concat(c,"px")).css("max-height","".concat(s.height,"px")).css("bottom","auto"),Re(i)}}},{key:"showImageDeleteItem",value:function(e,t){var i=this,n=this.customMenuItemsForImage;n.forEach((function(t){e.children().forEach((function(i){i.children[0]&&i.children[0].getAttribute("k")===t.key&&e.removeChild(i)}))})),this.el.children()[0].className.includes("divider")&&this.el.removeChild(this.el.children()[0]);var r=t.canvas.fabric.getActiveObject();null!=r&&("OleObject"===r.imgType?this.addImageContextMenuItems([{key:"ole",title:X("contextmenu.download"),callback:function(){t.getOle(r.strid)}}]):this.delImageContextMenuItems(["ole"]),Ti.call(this,n,t).forEach((function(e){return i.el.child(e,!0)})),t.selector.hide(),t.selector.setObjId(r.id))}}]),e}(),Ri=i(9),Ii=i.n(Ri);var Ai=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;l()(this,e),this.tip=U("toolbar.".concat(t.replace(/-[a-z]/g,(function(e){return e[1].toUpperCase()})))),this.activeTip=null===i?null:U("toolbar.".concat(i.replace(/-[a-z]/g,(function(e){return e[1].toUpperCase()})))),n&&(this.tip+=" (".concat(n,")")),this.tag=t,this.shortcut=n,this.value=r,this.el=this.element(),this.change=function(){}}return o()(e,[{key:"element",value:function(){var e=this.tip,t=this.activeTip;return f("div","".concat(ae,"-toolbar-btn")).on("mouseenter",(function(i){""!==e&&function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t.classList.contains("active")||null!==i){var n=t.getBoundingClientRect(),r=n.left,a=n.top,o=n.width,s=n.height,l=t.classList.contains("active")?i:e,c=f("div","".concat(ae,"-tooltip")).html(l).show();document.body.appendChild(c.el);var h=c.box();c.css("left","".concat(r+o/2-h.width/2,"px")).css("top","".concat(a+s+2,"px")),Te(t,"mouseleave",(function(){document.body.contains(c.el)&&document.body.removeChild(c.el)})),Te(t,"click",(function(){document.body.contains(c.el)&&document.body.removeChild(c.el)}))}}(e,i.target,t)})).attr("data-tooltip",e)}},{key:"setState",value:function(){}}]),e}();function Di(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Pi=function(e){ee()(i,e);var t=Di(i);function i(){return l()(this,i),t.apply(this,arguments)}return o()(i,[{key:"dropdown",value:function(){}},{key:"getValue",value:function(e){return e}},{key:"element",value:function(){var e=this,t=this.tag;return this.dd=this.dropdown(),this.dd.change=function(i){return e.change(t,e.getValue(i))},Ii()(re()(i.prototype),"element",this).call(this).child(this.dd)}},{key:"setState",value:function(e){e&&(this.value=e,this.dd.setTitle(e))}}]),i}(Ai);function Fi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Mi=function(e){ee()(i,e);var t=Fi(i);function i(e,n,r,a){var o,s;l()(this,i),(s=t.call(this,"div","".concat(ae,"-dropdown ").concat(a))).title=e,s.change=function(){},s.headerClick=function(){},"string"==typeof e?s.title=f("div","".concat(ae,"-dropdown-title")).child(e):r&&s.title.addClass("arrow-left"),s.contentEl=f("div","".concat(ae,"-dropdown-content")).css("width",n).hide();for(var c=arguments.length,h=new Array(c>4?c-4:0),u=4;u<c;u++)h[u-4]=arguments[u];return s.contentEl.tags=h.map((function(e){return e.tag})),(o=s).setContentChildren.apply(o,h),s.headerEl=f("div","".concat(ae,"-dropdown-header")),s.headerEl.on("click",(function(){if("block"!==s.contentEl.css("display")){if(s.show(),mobileAndTabletCheck()&&window.document.body.offsetWidth!==window.document.body.scrollWidth){if(s.menuDiv){for(var e=s.menuDiv.el,t=s.menuDiv.el.offsetParent;e.offsetParent&&"BODY"!==e.offsetParent.nodeName;)e=e.offsetParent;s.contentEl.el.clientWidth-e.offsetLeft>100&&(s.el.classList.replace("bottom-left","bottom-center"),s.contentEl.el.style.top+=t.offsetTop)}s.el.classList.contains("bottom-left")&&s.el.classList.replace("bottom-left","bottom-right"),s.el.classList.contains("top-left")&&s.el.classList.replace("top-left","top-right")}}else s.hide()})).children(s.title,r?f("div","".concat(ae,"-icon arrow-right")).child(f("div","".concat(ae,"-icon-img arrow-down"))):""),s.children(s.headerEl,s.contentEl),s}return o()(i,[{key:"setContentChildren",value:function(){var e;(this.contentEl.html(""),arguments.length>0)&&(e=this.contentEl).children.apply(e,arguments)}},{key:"showExplain",value:function(e){var t=this;if(this.contentEl.children().length===e.length)for(var i=function(i){Te(t.contentEl.children()[i],"mouseover",(function(){var n=new et(e[i].title()),r=et.findDialog(t.contentEl),a={top:"".concat(t.contentEl.children()[i].offsetTop,"px")};if(0!==r.length)for(var o=0;o<r.length;o++)t.contentEl.removeChild(t.contentEl.children()[r[o]]);n.css(a),t.contentEl.child(n)})),Te(t.contentEl.children()[i],"mouseout",(function(){var e=et.findDialog(t.contentEl);if(0!==e.length)for(var i=0;i<e.length;i++)t.contentEl.removeChild(t.contentEl.children()[e[i]])}))},n=0;n<e.length;n++)i(n)}},{key:"setTitle",value:function(e){this.title.html(e),this.hide()}},{key:"show",value:function(){var e=this;this.contentEl.show(),this.parent().active(),Re(this.parent(),(function(){e.hide()}))}},{key:"hide",value:function(){this.parent().active(!1),this.contentEl.hide(),Ee(this.parent())}}]),i}(u);function Li(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var ji=function(e){ee()(i,e);var t=Li(i);function i(e,n){var r;l()(this,i);var a=new se("align-".concat(n)),o=e.map((function(e){return(t="align-".concat(e),f("div","".concat(ae,"-item")).child(new se(t))).on("click",(function(){r.setTitle(e),r.change(e)}));var t}));return r=t.call.apply(t,[this,a,"auto",!0,"bottom-left"].concat(m()(o)))}return o()(i,[{key:"setTitle",value:function(e){this.title.setName("align-".concat(e)),this.hide()}}]),i}(Mi);function zi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Bi=function(e){ee()(i,e);var t=zi(i);function i(e){return l()(this,i),t.call(this,"align",null,"",e)}return o()(i,[{key:"dropdown",value:function(){var e=this.value;return new ji(["left","center","right"],e)}}]),i}(Pi);function Hi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Ni=function(e){ee()(i,e);var t=Hi(i);function i(e){return l()(this,i),t.call(this,"valign",null,"",e)}return o()(i,[{key:"dropdown",value:function(){var e=this.value;return new ji(["top","middle","bottom"],e)}}]),i}(Pi);function Ui(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Xi=function(e){ee()(i,e);var t=Ui(i);function i(){return l()(this,i),t.apply(this,arguments)}return o()(i,[{key:"element",value:function(){var e=this,t=this.tag;return Ii()(re()(i.prototype),"element",this).call(this).child(new se(t)).on("click",(function(){return e.click()}))}},{key:"click",value:function(){this.change(this.tag,this.toggle())}},{key:"setState",value:function(e){this.el.active(e)}},{key:"toggle",value:function(){return this.el.toggle()}},{key:"active",value:function(){return this.el.hasClass("active")}}]),i}(Ai);function Wi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var qi=function(e){ee()(i,e);var t=Wi(i);function i(){return l()(this,i),t.call(this,"autofilter")}return o()(i,[{key:"setState",value:function(){}}]),i}(Xi);function Yi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Vi=function(e){ee()(i,e);var t=Yi(i);function i(){return l()(this,i),t.call(this,"font-bold",null,"Ctrl+B")}return i}(Xi);function Gi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Zi=function(e){ee()(i,e);var t=Gi(i);function i(){return l()(this,i),t.call(this,"font-italic",null,"Ctrl+I")}return i}(Xi);function Ki(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Ji=function(e){ee()(i,e);var t=Ki(i);function i(){return l()(this,i),t.call(this,"strike")}return i}(Xi);function $i(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Qi=function(e){ee()(i,e);var t=$i(i);function i(){return l()(this,i),t.call(this,"underline",null,"Ctrl+U")}return i}(Xi),en=["#ffffff","#000100","#e7e5e6","#445569","#5b9cd6","#ed7d31","#a5a5a5","#ffc001","#4371c6","#71ae47"],tn=[["#f2f2f2","#7f7f7f","#d0cecf","#d5dce4","#deeaf6","#fce5d5","#ededed","#fff2cd","#d9e2f3","#e3efd9"],["#d8d8d8","#595959","#afabac","#adb8ca","#bdd7ee","#f7ccac","#dbdbdb","#ffe59a","#b3c6e7","#c5e0b3"],["#bfbfbf","#3f3f3f","#756f6f","#8596b0","#9cc2e6","#f4b184","#c9c9c9","#fed964","#8eaada","#a7d08c"],["#a5a5a5","#262626","#3a3839","#333f4f","#2e75b5","#c45a10","#7b7b7b","#bf8e01","#2f5596","#538136"],["#7f7f7f","#0c0c0c","#171516","#222a35","#1f4e7a","#843c0a","#525252","#7e6000","#203864","#365624"]],nn=["#c00000","#fe0000","#fdc101","#ffff01","#93d051","#00b04e","#01b0f1","#0170c1","#012060","#7030a0"];function rn(e){var t=this;return f("td","").child(f("div","".concat(ae,"-color-palette-cell")).on("click.stop",(function(){return t.change(e)})).css("background-color",e))}var an=function e(){var t,i,n,r=this;l()(this,e),this.el=f("div","".concat(ae,"-color-palette")),this.change=function(){};var a=f("table","").children((t=f("tbody","")).children.apply(t,[(i=f("tr","".concat(ae,"-theme-color-placeholders"))).children.apply(i,m()(en.map((function(e){return rn.call(r,e)}))))].concat(m()(tn.map((function(e){var t;return(t=f("tr","".concat(ae,"-theme-colors"))).children.apply(t,m()(e.map((function(e){return rn.call(r,e)}))))}))),[(n=f("tr","".concat(ae,"-standard-colors"))).children.apply(n,m()(nn.map((function(e){return rn.call(r,e)}))))])));this.el.child(a)};function on(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var sn=function(e){ee()(i,e);var t=on(i);function i(e,n){var r;l()(this,i);var a=new se(e).css("height","16px").css("border-bottom","3px solid ".concat(n)),o=new an;return o.change=function(e){r.setTitle(e),r.change(e)},r=t.call(this,a,"max-content",!1,"bottom-left",o.el)}return o()(i,[{key:"setTitle",value:function(e){this.title.css("border-color",e),this.hide()}}]),i}(Mi);function ln(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var cn=[["thin",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="1" style="user-select: none;"><line x1="0" y1="0.5" x2="50" y2="0.5" stroke-width="1" stroke="black" style="user-select: none;"></line></svg>'],["medium",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="2" style="user-select: none;"><line x1="0" y1="1.0" x2="50" y2="1.0" stroke-width="2" stroke="black" style="user-select: none;"></line></svg>'],["thick",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="3" style="user-select: none;"><line x1="0" y1="1.5" x2="50" y2="1.5" stroke-width="3" stroke="black" style="user-select: none;"></line></svg>'],["dashed",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="1" style="user-select: none;"><line x1="0" y1="0.5" x2="50" y2="0.5" stroke-width="1" stroke="black" stroke-dasharray="2" style="user-select: none;"></line></svg>'],["dotted",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="1" style="user-select: none;"><line x1="0" y1="0.5" x2="50" y2="0.5" stroke-width="1" stroke="black" stroke-dasharray="1" style="user-select: none;"></line></svg>']],hn=function(e){ee()(i,e);var t=ln(i);function i(e){var n;l()(this,i);var r=new se("line-type"),a=0,o=cn.map((function(t,i){return f("div","".concat(ae,"-item state ").concat(e===t[0]?"checked":"")).on("click",(function(){o[a].toggle("checked"),o[i].toggle("checked"),a=i,n.hide(),n.change(t)})).child(f("div","".concat(ae,"-line-type")).html(t[1]))}));return n=t.call.apply(t,[this,r,"max-content",!1,"bottom-left"].concat(m()(o)))}return i}(Mi);function un(){var e;return f("table","").child((e=f("tbody","")).children.apply(e,arguments))}function fn(e){var t=this;return f("td","").child(f("div","".concat(ae,"-border-palette-cell")).child(new se("border-".concat(e))).on("click",(function(){t.mode=e;var i=t.mode,n=t.style,r=t.color;t.change({mode:i,style:n,color:r})})))}var dn=function e(){var t,i,n=this;l()(this,e),this.color="#000",this.style="thin",this.mode="all",this.change=function(){},this.ddColor=new sn("line-color",this.color),this.ddColor.change=function(e){n.color=e},this.ddType=new hn(this.style),this.ddType.change=function(e){var t=r()(e,1)[0];n.style=t},this.el=f("div","".concat(ae,"-border-palette"));var a=un(f("tr","").children(f("td","".concat(ae,"-border-palette-left")).child(un((t=f("tr","")).children.apply(t,m()(["all","inside","horizontal","vertical","outside"].map((function(e){return fn.call(n,e)})))),(i=f("tr","")).children.apply(i,m()(["left","top","right","bottom","none"].map((function(e){return fn.call(n,e)})))))),f("td","".concat(ae,"-border-palette-right")).children(f("div","".concat(ae,"-toolbar-btn")).child(this.ddColor.el),f("div","".concat(ae,"-toolbar-btn")).child(this.ddType.el))));this.el.child(a)};function mn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var gn=function(e){ee()(i,e);var t=mn(i);function i(){var e;l()(this,i);var n=new se("border-all"),r=new dn;return r.change=function(t){e.change(t),e.hide()},e=t.call(this,n,"max-content",!1,"bottom-left",r.el)}return i}(Mi);function vn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var pn=function(e){ee()(i,e);var t=vn(i);function i(){return l()(this,i),t.call(this,"border")}return o()(i,[{key:"dropdown",value:function(){return new gn}}]),i}(Pi);function yn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var bn=function(e){ee()(i,e);var t=yn(i);function i(){return l()(this,i),t.apply(this,arguments)}return o()(i,[{key:"element",value:function(){var e=this;return this.icon=new se(this.tag),Ii()(re()(i.prototype),"element",this).call(this).child(this.icon).on("click",(function(){return e.change(e.tag)}))}},{key:"setState",value:function(e){this.el.disabled(e)}},{key:"setIcon",value:function(e){this.icon.setName(e)}}]),i}(Ai);function wn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var xn=function(e){ee()(i,e);var t=wn(i);function i(){return l()(this,i),t.call(this,"clearformat")}return i}(bn);function kn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Cn=function(e){ee()(i,e);var t=kn(i);function i(){return l()(this,i),t.call(this,"paintformat")}return o()(i,[{key:"setState",value:function(){}}]),i}(Xi);function Sn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var _n=function(e){ee()(i,e);var t=Sn(i);function i(e){return l()(this,i),t.call(this,"color",null,void 0,e)}return o()(i,[{key:"dropdown",value:function(){var e=this.tag,t=this.value;return new sn(e,t)}}]),i}(Pi);function Tn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var On=function(e){ee()(i,e);var t=Tn(i);function i(e){return l()(this,i),t.call(this,"bgcolor",null,void 0,e)}return o()(i,[{key:"dropdown",value:function(){var e=this.tag,t=this.value;return new sn(e,t)}}]),i}(Pi);function En(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Rn=function(e){ee()(i,e);var t=En(i);function i(){var e;l()(this,i);var n=pt.map((function(t){return f("div","".concat(ae,"-item")).on("click",(function(){e.setTitle("".concat(t.pt)),e.change(t)})).child("".concat(t.pt))}));return e=t.call.apply(t,[this,"10","60px",!0,"bottom-left"].concat(m()(n)))}return i}(Mi);function In(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var An=function(e){ee()(i,e);var t=In(i);function i(){return l()(this,i),t.call(this,"font-size")}return o()(i,[{key:"getValue",value:function(e){return e.pt}},{key:"dropdown",value:function(){return new Rn}}]),i}(Pi);function Dn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Pn=function(e){ee()(i,e);var t=Dn(i);function i(){var e;l()(this,i);var n=[{text:"50%",number:.5},{text:"75%",number:.75},{text:"100%",number:1},{text:"125%",number:1.25},{text:"150%",number:1.5},{text:"175%",number:1.75},{text:"200%",number:2}].map((function(t){return f("div","".concat(ae,"-item")).on("click",(function(){e.setTitle("".concat(t.text)),e.change(t)})).child("".concat(t.text))}));return e=t.call.apply(t,[this,"10","60px",!0,"bottom-left"].concat(m()(n)))}return i}(Mi);function Fn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Mn=function(e){ee()(i,e);var t=Fn(i);function i(){return l()(this,i),t.call(this,"zoom-size")}return o()(i,[{key:"getValue",value:function(e){return e}},{key:"setState",value:function(e){"string"!=typeof e&&(e=100*e+"%"),Ii()(re()(i.prototype),"setState",this).call(this,e)}},{key:"dropdown",value:function(){return new Pn}}]),i}(Pi);function Ln(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var jn=function(e){ee()(i,e);var t=Ln(i);function i(){var e;l()(this,i);var n=vt.map((function(t){return f("div","".concat(ae,"-item")).on("click",(function(){e.setTitle(t.title),e.change(t)})).child(t.title)}));return e=t.call.apply(t,[this,vt[0].title,"max-content",!0,"bottom-left"].concat(m()(n)))}return i}(Mi);function zn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Bn=function(e){ee()(i,e);var t=zn(i);function i(){return l()(this,i),t.call(this,"font-name")}return o()(i,[{key:"getValue",value:function(e){return e.key}},{key:"dropdown",value:function(){return new jn}}]),i}(Pi);function Hn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Nn=function(e){ee()(i,e);var t=Hn(i);function i(){var e;l()(this,i);var n=_t.slice(0);return n.splice(2,0,{key:"divider"}),n.splice(8,0,{key:"divider"}),n=n.map((function(t){var i=f("div","".concat(ae,"-item"));return"divider"===t.key?i.addClass("divider"):(i.child(t.title()).on("click",(function(){e.setTitle(t.title()),e.change(t)})),t.label&&i.child(f("div","label").html(t.label))),i})),e=t.call.apply(t,[this,"Normal","220px",!0,"bottom-left"].concat(m()(n)))}return o()(i,[{key:"setTitle",value:function(e){for(var t=0;t<_t.length;t+=1)_t[t].key===e&&this.title.html(_t[t].title());this.hide()}}]),i}(Mi);function Un(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Xn=function(e){ee()(i,e);var t=Un(i);function i(){return l()(this,i),t.call(this,"format")}return o()(i,[{key:"getValue",value:function(e){return e.key}},{key:"dropdown",value:function(){return new Nn}}]),i}(Pi),Wn=i(8),qn=i.n(Wn);function Yn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Vn=function(e){ee()(i,e);var t=Yn(i);function i(){var e,n;l()(this,i);var r=ht.map((function(e){return f("div","".concat(ae,"-item")).on("click",(function(){n.hide(),n.change(e)})).child(e.key)}));return n=t.call.apply(t,[this,new se("formula"),"max-content",!0,"bottom-left"].concat(m()(r))),Ii()((e=qn()(n),re()(i.prototype)),"showExplain",e).call(e,ht),n}return i}(Mi);function Gn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Zn=function(e){ee()(i,e);var t=Gn(i);function i(){return l()(this,i),t.call(this,"formula")}return o()(i,[{key:"getValue",value:function(e){return e.key}},{key:"dropdown",value:function(){return new Vn}}]),i}(Pi);function Kn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Jn=function(e){ee()(i,e);var t=Kn(i);function i(){return l()(this,i),t.call(this,"freeze")}return i}(Xi);function $n(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Qn=function(e){ee()(i,e);var t=$n(i);function i(){return l()(this,i),t.call(this,"merge","unmerge")}return o()(i,[{key:"setState",value:function(e,t){this.el.active(e).disabled(t)}}]),i}(Xi);function er(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var tr=function(e){ee()(i,e);var t=er(i);function i(){return l()(this,i),t.call(this,"print","Ctrl+P")}return i}(bn);function ir(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var nr=function(e){ee()(i,e);var t=ir(i);function i(){return l()(this,i),t.call(this,"textwrap")}return i}(Xi);function rr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var ar=function(e){ee()(i,e);var t=rr(i);function i(){var e;l()(this,i);var n=new se("ellipsis"),r=f("div","".concat(ae,"-toolbar-more"));return(e=t.call(this,n,"max-content",!1,"bottom-right",r)).moreBtns=r,screen.width<500?e.contentEl.css("max-width","200px"):e.contentEl.css("max-width","420px"),e}return i}(Mi),or=function(e){ee()(i,e);var t=rr(i);function i(){var e;return l()(this,i),(e=t.call(this,"more")).el.hide(),e}return o()(i,[{key:"dropdown",value:function(){return new ar}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){this.el.hide()}}]),i}(Pi);function sr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var lr=function(e){ee()(i,e);var t=sr(i);function i(){return l()(this,i),t.call(this,"sort")}return i}(bn);function cr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var hr=function(e){ee()(i,e);var t=cr(i);function i(){return l()(this,i),t.call(this,"search")}return i}(bn);function ur(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var fr=function(e){ee()(i,e);var t=ur(i);function i(){return l()(this,i),t.call(this,"commentEdit")}return i}(bn);function dr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var mr=function(e){ee()(i,e);var t=dr(i);function i(){return l()(this,i),t.call(this,"commentRemove")}return i}(bn);function gr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var vr=function(e){ee()(i,e);var t=gr(i);function i(){return l()(this,i),t.call(this,"commentPrevious")}return i}(bn);function pr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var yr=function(e){ee()(i,e);var t=pr(i);function i(){return l()(this,i),t.call(this,"commentNext")}return i}(bn);function br(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var wr=function(e){ee()(i,e);var t=br(i);function i(){var e;l()(this,i);var n=new se("".concat(ae,"-icon-img insert-image")),r=f("div","".concat(ae,"-item")),a=f("input");a.attr({type:"file",name:"photo",id:"upload-image",style:"display:none;",accept:"image/*"}),r.tag="fromLocal";var o=f("label");o.attr("for","upload-image"),o.child(new se("".concat(ae,"-icon-img insert-image-local"))),o.child(" "+U("menubar.".concat(r.tag))),r.child(a),r.child(o),r.on("click",(function(){e.change("local")}));var s,c=(s="".concat(ae,"-icon-img insert-image-url"),f("div","".concat(ae,"-item")).child(new se(s)));return c.tag="fromURL",c.child(" "+U("menubar.".concat(c.tag))),c.on("click",(function(){e.change("url")})),e=t.call.apply(t,[this,n,"auto",!0,"bottom-left"].concat([r,c]))}return i}(Mi);function xr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var kr=function(e){ee()(i,e);var t=xr(i);function i(e){return l()(this,i),t.call(this,"insert-image",null,"",e)}return o()(i,[{key:"dropdown",value:function(){return new wr}}]),i}(Pi);function Cr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Sr=function(e){ee()(i,e);var t=Cr(i);function i(){var e;return l()(this,i),(e=t.call(this,"menu-display-hide","")).state="up",e}return o()(i,[{key:"setUp",value:function(){this.setIcon("menu-display-hide"),this.state="up"}},{key:"setDown",value:function(){this.setIcon("menu-display-show"),this.state="down"}}]),i}(bn);function _r(){return f("div","".concat(ae,"-toolbar-divider"))}function Tr(){var e=this;this.btns2=[],this.items.forEach((function(t){if(Array.isArray(t))t.forEach((function(t){var i=t.el,n=i.box(),r=i.computedStyle(),a=r.marginLeft,o=r.marginRight;e.btns2.push([i,n.width+parseInt(a,10)+parseInt(o,10)])}));else{var i=t.box(),n=t.computedStyle(),r=n.marginLeft,a=n.marginRight;e.btns2.push([t,i.width+parseInt(r,10)+parseInt(a,10)])}}))}function Or(){var e,t,i=this.el,n=this.btns,a=this.moreEl,o=this.btns2,s=a.dd,l=s.moreBtns,c=s.contentEl,h=i.box(),u=100,f=12,d=[],m=[];o.forEach((function(e,t){var i=r()(e,2),n=i[0],a=i[1];u+=a,t===o.length-1||u<h.width?d.push(n):(f+=a,m.push(n))})),(e=n.html("")).children.apply(e,d),(t=l.html("")).children.apply(t,m),c.css("width","".concat(f,"px")),m.length>0?a.show():a.hide()}var Er=function(){function e(t,i,n,r){var a=this;l()(this,e),this.data=t,this.change=function(){},this.widthFn=i,this.isHide=n;var o=t.defaultStyle();this.items=[[new tr,this.paintformatEl=new Cn,this.clearformatEl=new xn],_r(),[this.formatEl=new Xn],_r(),[this.fontEl=new Bn,this.fontSizeEl=new An],_r(),[this.zoomSizeEl=new Mn,this.boldEl=new Vi,this.italicEl=new Zi,this.underlineEl=new Qi,this.strikeEl=new Ji,this.textColorEl=new _n(o.color)],_r(),[this.fillColorEl=new On(o.bgcolor),this.borderEl=new pn,this.mergeEl=new Qn],_r(),[this.alignEl=new Bi(o.align),this.valignEl=new Ni(o.valign),this.textwrapEl=new nr],_r(),[this.freezeEl=new Jn,this.autofilterEl=new qi,this.formulaEl=new Zn,this.sortEl=new lr,this.insertImageEL=new kr,this.searchEl=new hr],_r(),[this.commentEditEl=new fr,this.commentRemoveEl=new mr,this.commentPreviousEl=new vr,this.commentNextEl=new yr],_r(),[this.moreEl=new or]],screen.width<500&&this.items[0].splice(0,1),n&&r&&(this.items=[[new tr,this.moreEl=new or,this.sortEl=new lr,this.searchEl=new hr]]),this.el=f("div","".concat(ae,"-toolbar")),this.btns=f("div","".concat(ae,"-toolbar-btns")),this.items.forEach((function(e){Array.isArray(e)?e.forEach((function(e){a.btns.child(e.el),e.change=function(){a.change.apply(a,arguments)}})):a.btns.child(e.el)}));var s=this.menuDisplay=new Sr;s.change=function(){a.change.apply(a,arguments)},this.el.children(this.btns.el,s.el),n&&!r?this.el.hide():(this.reset(),setTimeout((function(){Tr.call(a),Or.call(a)}),0),Te(window,"resize",(function(){Or.call(a)})))}return o()(e,[{key:"paintformatActive",value:function(){return this.paintformatEl.active()}},{key:"paintformatToggle",value:function(){this.paintformatEl.toggle()}},{key:"trigger",value:function(e){this["".concat(e,"El")].click()}},{key:"resetData",value:function(e){this.data=e,this.reset()}},{key:"reset",value:function(){if(!this.isHide){var e=this.data,t=e.getSelectedCellStyle();this.mergeEl.setState(e.canUnmerge(),!1),this.autofilterEl.setState(!e.canAutofilter());var i=t.font,n=t.format;this.formatEl.setState(n),this.fontEl.setState(i.name),this.fontSizeEl.setState(i.size),this.zoomSizeEl.setState(e.zoomlevel),this.boldEl.setState(i.bold),this.italicEl.setState(i.italic),this.underlineEl.setState(t.underline),this.strikeEl.setState(t.strike),this.textColorEl.setState(t.color),this.fillColorEl.setState(t.bgcolor),this.alignEl.setState(t.align),this.valignEl.setState(t.valign),this.textwrapEl.setState(t.textwrap),this.freezeEl.setState(e.freezeIsActive())}}}]),e}(),Rr=function(){function e(t,i){var n,r=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"600px",o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];l()(this,e),this.moving=!1,this.drag=s,this.title=t;var c=parseInt(a);screen.width<500&&c>300&&(a="300px"),this.el=f("div","".concat(ae,"-modal")).css("width",a).css("position","absolute").children(f("div","".concat(ae,"-modal-header")).children(new se("close").on("click.stop",(function(){return r.hide()})),this.title),(n=f("div","".concat(ae,"-modal-content"))).children.apply(n,m()(i))).hide(),this.showDimmer=o,this.drag&&this.el.on("mousedown.stop",(function(e){return r.mousedownHandler(e)}))}return o()(e,[{key:"show",value:function(){var e=this;if(!this.moving){this.showDimmer&&(this.dimmer=f("div","".concat(ae,"-dimmer active")),document.body.appendChild(this.dimmer.el));var t=this.el.show().box(),i=t.width,n=t.height,r=document.documentElement,a=r.clientHeight,o=r.clientWidth;this.el.offset({left:(o-i)/2,top:(a-n)/3}),window.xkeydownEsc=function(t){27===t.keyCode&&e.hide()},Te(window,"keydown",window.xkeydownEsc)}}},{key:"hide",value:function(){this.el.hide(),this.showDimmer&&document.body.removeChild(this.dimmer.el),Oe(window,"keydown",window.xkeydownEsc),delete window.xkeydownEsc}},{key:"mousedownHandler",value:function(e){var t=this,i=e;Ie(window,(function(e){if(t.moving=!0,null!==i){var n=t.el.offset(void 0);t.el.offset({left:n.left+e.movementX,top:n.top+e.movementY}),i=e}}),(function(){i=null,t.moving=!1}))}}]),e}(),Ir=function(){function e(t,i){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200;l()(this,e),this.vchange=function(){},this.el=f("div","".concat(ae,"-form-input")),this.input=f("input","").css("width",t).on("input",(function(e){return n.vchange(e)})).attr("placeholder",i).attr("maxlength",r),this.el.child(this.input)}return o()(e,[{key:"focus",value:function(){var e=this;setTimeout((function(){e.input.el.focus()}),10)}},{key:"hint",value:function(e){this.input.attr("placeholder",e)}},{key:"setReadonly",value:function(e){e?this.input.attr("readonly",""):this.input.removeAttr("readonly")}},{key:"val",value:function(e){return this.input.val(e)}}]),e}();function Ar(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return Dr(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Dr(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function Dr(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var Pr=function(){function e(t,i,n){var r=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(e){return e},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){};l()(this,e),this.key=t,this.getTitle=a,this.change=o,this.width=n,this.vchange=function(){},this.items=[],this.itemsmap=new Map,this.el=f("div","".concat(ae,"-form-select")),this.suggest=new at(i.map((function(e){return{key:e,title:r.getTitle(e)}})),(function(e){r.itemClick(e.key),o(e.key),r.vchange(e.key)}),n,this.el),this.el.children(this.itemEl=f("div","input-text").html(this.getTitle(t)),this.suggest.el).on("click",(function(){return r.show()}))}return o()(e,[{key:"show",value:function(){this.suggest.search("")}},{key:"itemClick",value:function(e){this.key=e,this.itemsmap.size>0?this.itemEl.html(this.itemsmap.get(e)):this.itemEl.html(this.getTitle(e))}},{key:"setItemsMap",value:function(e){var t=this;this.itemsmap=e;var i,n=[],a=Ar(e);try{for(a.s();!(i=a.n()).done;){var o=r()(i.value,2),s=o[0],l=o[1];n.push({key:s,title:l})}}catch(e){a.e(e)}finally{a.f()}this.suggest=new at(n,(function(e){t.itemClick(e.key),t.change(e.key),t.vchange(e.key)}),this.width,this.el),e.size>6&&this.suggest.el.css("height","200px"),this.el.empty(),this.el.children(this.itemEl=f("div","input-text").html(n[0].title),this.suggest.el)}},{key:"val",value:function(e){return void 0!==e?(this.key=e,this.itemsmap.size>0?this.itemEl.html(this.itemsmap.get(e)):this.itemEl.html(this.getTitle(e)),this):this.key}}]),e}(),Fr={number:/(^\d+$)|(^\d+(\.\d{0,4})?$)/,date:/^\d{4}-\d{1,2}-\d{1,2}$/},Mr=function(){function e(t,i,n,r){var a=this;l()(this,e),this.label="",this.rule=i,n&&(this.label=f("label","label").css("width","".concat(r,"px")).html(n)),this.tip=f("div","tip").child("tip").hide(),this.input=t,this.input.vchange=function(){return a.validate()},this.el=f("div","".concat(ae,"-form-field")).children(this.label,t.el,this.tip)}return o()(e,[{key:"isShow",value:function(){return"none"!==this.el.css("display")}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){return this.el.hide(),this}},{key:"val",value:function(e){return this.input.val(e)}},{key:"hint",value:function(e){this.input.hint(e)}},{key:"validate",value:function(){var e=this.input,t=this.rule,i=this.tip,n=this.el,r=e.val();if(t.required&&/^\s*$/.test(r))return i.html(U("validation.required")),n.addClass("error"),!1;if((t.type||t.pattern)&&!(t.pattern||Fr[t.type]).test(r))return i.html(U("validation.notMatch")),n.addClass("error"),!1;return n.removeClass("error"),!0}},{key:"validateFail",value:function(e){var t=this.el,i=this.tip;t.addClass("error"),i.html(e),i.show()}},{key:"validateClear",value:function(){var e=this.el,t=this.tip;e.removeClass("error"),t.html(""),t.hide()}}]),e}();function Lr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var jr=function(e){ee()(i,e);var t=Lr(i);function i(){var e;l()(this,i);var n=new Mr(new Pr("cell",["cell"],"100%",(function(e){return U("dataValidation.modeType.".concat(e))})),{required:!0},"".concat(U("dataValidation.range"),":"),100),r=new Mr(new Ir("120px","E3 or E3:F12"),{required:!0,pattern:/^([A-Z]{1,2}[1-9]\d*)(:[A-Z]{1,2}[1-9]\d*)?$/}),a=new Mr(new Pr("list",["list","number","date","phone","email"],"100%",(function(e){return U("dataValidation.type.".concat(e))}),(function(t){return e.criteriaSelected(t)})),{required:!0},"".concat(U("dataValidation.criteria"),":"),100),o=new Mr(new Pr("be",["be","nbe","eq","neq","lt","lte","gt","gte"],"160px",(function(e){return U("dataValidation.operator.".concat(e))}),(function(t){return e.criteriaOperatorSelected(t)})),{required:!0}).hide(),s=new Mr(new Ir("70px","10"),{required:!0}).hide(),c=new Mr(new Ir("70px","100"),{required:!0,type:"number"}).hide(),h=new Mr(new Ir("120px","a,b,c"),{required:!0}),u=new Mr(new Ir("70px","10"),{required:!0,type:"number"}).hide();return(e=t.call(this,U("contextmenu.validation"),[f("div","".concat(ae,"-form-fields")).children(n.el,r.el),f("div","".concat(ae,"-form-fields")).children(a.el,o.el,s.el,c.el,u.el,h.el),f("div","".concat(ae,"-buttons")).children(new vi("cancel").on("click",(function(){return e.btnClick("cancel")})),new vi("remove").on("click",(function(){return e.btnClick("remove")})),new vi("save","primary").on("click",(function(){return e.btnClick("save")})))])).mf=n,e.rf=r,e.cf=a,e.of=o,e.minvf=s,e.maxvf=c,e.vf=u,e.svf=h,e.change=function(){},e}return o()(i,[{key:"showVf",value:function(e){var t="date"===e?"2018-11-12":"10",i=this.vf;i.input.hint(t),i.show()}},{key:"criteriaSelected",value:function(e){var t=this.of,i=this.minvf,n=this.maxvf,r=this.vf,a=this.svf;"date"===e||"number"===e?(t.show(),i.rule.type=e,n.rule.type=e,"date"===e?(i.hint("2018-11-12"),n.hint("2019-11-12")):(i.hint("10"),n.hint("100")),i.show(),n.show(),r.hide(),a.hide()):("list"===e?a.show():a.hide(),r.hide(),t.hide(),i.hide(),n.hide())}},{key:"criteriaOperatorSelected",value:function(e){if(e){var t=this.minvf,i=this.maxvf,n=this.vf;if("be"===e||"nbe"===e)t.show(),i.show(),n.hide();else{var r=this.cf.val();n.rule.type=r,"date"===r?n.hint("2018-11-12"):n.hint("10"),n.show(),t.hide(),i.hide()}}}},{key:"btnClick",value:function(e){if("cancel"===e)this.hide();else if("remove"===e)this.change("remove"),this.hide();else if("save"===e){for(var t=["mf","rf","cf","of","svf","vf","minvf","maxvf"],i=0;i<t.length;i+=1){var n=this[t[i]];if(n.isShow()&&!n.validate())return}var r=this.mf.val(),a=this.rf.val(),o=this.cf.val(),s="phone"===o||"email"===o?"":this.of.val(),l=this.svf.val();"number"!==o&&"date"!==o||(l="be"===s||"nbe"===s?[this.minvf.val(),this.maxvf.val()]:this.vf.val()),this.change("save",r,a,{type:o,operator:s,required:!1,value:l}),this.hide()}}},{key:"setValue",value:function(e){if(e){var t=this.mf,i=this.rf,n=this.cf,r=this.of,a=this.svf,o=this.vf,s=this.minvf,l=this.maxvf,c=e.mode,h=e.ref,u=e.validator||{type:"list"},f=u.type,d=u.operator,m=u.value;t.val(c||"cell"),i.val(h),n.val(f),r.val(d),Array.isArray(m)?(s.val(m[0]),l.val(m[1])):(a.val(m||""),o.val(m||"")),this.criteriaSelected(f),this.criteriaOperatorSelected(d)}this.show()}}]),i}(Rr),zr=function(){function e(t,i){l()(this,e),this.el=f("input","".concat(ae,"-form-checkbox")).css("width",t).attr("type","Checkbox")}return o()(e,[{key:"hint",value:function(e){this.el.attr("placeholder",e)}},{key:"val",value:function(e){if(void 0===e)return this.el.el.checked;this.el.el.checked=e}}]),e}();function Br(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Hr=function(e){ee()(i,e);var t=Br(i);function i(){var e;l()(this,i);var n=new Mr(new Ir("60px",""),{required:!0,pattern:/^([A-Z]{1,2}[1-9]\d*)(:[A-Z]{1,2}[1-9]\d*)?$/},"".concat(U("dataSort.ci"),":"),60),r=new Mr(new Pr(0,[],"180px",(function(){}),(function(){})),{required:!0},"".concat(U("dataSort.sortby"),":"),60),a=new Mr(new Pr("desc",["asc","desc"],"100%",(function(e){return U("dataSort.order.".concat(e))}),(function(){})),{required:!0},"".concat(U("dataSort.criteria"),":"),60),o=new Mr(new Pr(0,[],"180px",(function(){}),(function(){})),{required:!0},"".concat(U("dataSort.sortby"),":"),60),s=new Mr(new Pr("desc",["asc","desc"],"100%",(function(e){return U("dataSort.order.".concat(e))}),(function(){})),{required:!0},"".concat(U("dataSort.criteria"),":"),60),c=new Mr(new Pr(0,[],"180px",(function(){}),(function(){})),{required:!0},"".concat(U("dataSort.sortby"),":"),60),h=new Mr(new Pr("desc",["asc","desc"],"100%",(function(e){return U("dataSort.order.".concat(e))}),(function(){})),{required:!0},"".concat(U("dataSort.criteria"),":"),60);n.input.setReadonly(!0);var u=new zr("60px","");u.el.on("click",(function(){return e.myHeaderClick()})),u.val(!0);var d=new vi("del","formbt").on("click",(function(){return e.btnClick("del",1)})),m=f("div","".concat(ae,"-form-fields")).children(o.el,s.el,f("div","".concat(ae,"-buttons")).children(new vi("add","formbt").on("click",(function(){return e.btnClick("add",2)})),d)),g=f("div","".concat(ae,"-form-fields")).children(c.el,h.el,new vi("del","formbt").on("click",(function(){return e.btnClick("del",2)})));return(e=t.call(this,U("contextmenu.sort"),[f("div","".concat(ae,"-form-fields")).children(n.el,new Mr(u,{required:!1},"".concat(U("dataSort.header"),":"),120).el),f("div","".concat(ae,"-form-fields")).children(r.el,a.el,new vi("add","formbt").on("click",(function(){return e.btnClick("add",1)}))),m,g,f("div","".concat(ae,"-buttons")).children(new vi("ok","primary").on("click",(function(){return e.btnClick("ok")})),new vi("cancel").on("click",(function(){return e.btnClick("cancel")})))])).cf=n,e.of1=a,e.sortby1=r,e.of2=s,e.sortby2=o,e.of3=h,e.sortby3=c,e.ci1=null,e.ci2=null,e.ci3=null,e.values=[],e.mcols=null,e.mcolsheader=null,e.cicount=1,e.div2=m,e.div3=g,e.but2=d,e.sc=1,e.myheader=u,m.hide(),g.hide(),e.change=function(){},e}return o()(i,[{key:"btnClick",value:function(e,t){if("ok"===e){if(!this.cf.validate())return;var i=[],n=[];if(i.push(this.of1.val()),n.push(this.sortby1.val()),this.sc>=2&&(i.push(this.of2.val()),n.push(this.sortby2.val())),this.sc>=3&&(i.push(this.of3.val()),n.push(this.sortby3.val())),new Set(n).size<n.length)return void le("error","".concat(U("dataSort.msg")));this.change("ok",n,i,this.myheader.val()),this.hide()}else"add"===e?1===t?(this.div2.css("display",""),this.sc=2):2===t&&(this.div3.css("display",""),this.but2.hide(),this.sc=3):"del"===e?1===t?(this.div2.hide(),this.sc=1):2===t&&(this.div3.hide(),this.but2.css("display",""),this.sc=2):"cancel"===e&&this.hide()}},{key:"myHeaderClick",value:function(){var e=this.mcols,t=this.mcolsheader,i=this.myheader,n=this.sortby1,r=this.sortby2,a=this.sortby3,o=i.val()?e:t;n.input.setItemsMap(o),n.val(0),r.input.setItemsMap(o),r.val(1),a.input.setItemsMap(o),a.val(2)}},{key:"setValue",value:function(e){if(null!=e){if(e){var t=this.cf,i=this.of1,n=this.sortby1,r=this.of2,a=this.sortby2,o=this.of3,s=this.sortby3,l=e.ref,c=e.sort,h=e.ci,u=e.m,f=e.mcols,d=e.mcolsheader,m=(c[0]||{order:"asc"}).order1,g=(c[1]||{order:"asc"}).order2,v=(c[2]||{order:"asc"}).order3;t.val(l),i.val(m),r.val(g),o.val(v),this.mcols=f,this.mcolsheader=d,this.myheader.val(1);for(var p=[],y=0;y<f.length;y++)p.push(y);n.input.setItemsMap(f),n.val(0),a.input.setItemsMap(f),a.val(1),s.input.setItemsMap(f),s.val(2),this.ci=h,this.values=u}this.show()}}}]),i}(Rr);function Nr(e){return f("div","".concat(ae,"-item ").concat(e))}function Ur(e){var t=this;return Nr("state").child(U("sort.".concat(e))).on("click.stop",(function(){return t.itemClick(e)}))}function Xr(e){var t=this,i=this.filterbEl,n=this.filterValues;i.html(""),Object.keys(e).forEach((function(r,a){var o=e[r],s=n.includes(r)?"checked":"";i.child(f("div","".concat(ae,"-item state ").concat(s)).on("click.stop",(function(){return t.filterClick(a,r)})).children(""===r?U("filter.empty"):r,f("div","label").html("(".concat(o,")"))))}))}function Wr(){var e=this.filterhEl,t=this.filterValues,i=this.values;e.html("".concat(t.length," / ").concat(i.length)),e.checked(t.length===i.length)}var qr=function(){function e(){var t=this;l()(this,e),this.filterbEl=f("div","".concat(ae,"-body")),this.filterhEl=f("div","".concat(ae,"-header state")).on("click.stop",(function(){return t.filterClick(0,"all")})),this.el=f("div","".concat(ae,"-sort-filter")).children(this.sortAscEl=Ur.call(this,"asc"),this.sortDescEl=Ur.call(this,"desc"),Nr("divider"),f("div","".concat(ae,"-filter")).children(this.filterhEl,this.filterbEl),f("div","".concat(ae,"-buttons")).children(new vi("cancel").on("click",(function(){return t.btnClick("cancel")})),new vi("ok","primary").on("click",(function(){return t.btnClick("ok")})))).hide(),this.ci=null,this.sortDesc=null,this.values=null,this.filterValues=[]}return o()(e,[{key:"btnClick",value:function(e){if("ok"===e){var t=this.ci,i=this.sort,n=this.filterValues;this.ok&&this.ok(t,i,"in",n)}this.hide()}},{key:"itemClick",value:function(e){this.sort=e;var t=this.sortAscEl,i=this.sortDescEl;t.checked("asc"===e),i.checked("desc"===e)}},{key:"filterClick",value:function(e,t){var i=this.filterbEl,n=this.filterValues,r=this.values,a=i.children();"all"===t?a.length===n.length?(this.filterValues=[],a.forEach((function(e){return f(e).checked(!1)}))):(this.filterValues=Array.from(r),a.forEach((function(e){return f(e).checked(!0)}))):f(a[e]).toggle("checked")?n.push(t):n.splice(n.findIndex((function(e){return e===t})),1);Wr.call(this)}},{key:"set",value:function(e,t,i,n){this.ci=e;var r=this.sortAscEl,a=this.sortDescEl;null!==n?(this.sort=n.order,r.checked(n.asc()),a.checked(n.desc())):(this.sortDesc=null,r.checked(!1),a.checked(!1)),this.values=Object.keys(t),this.filterValues=i?Array.from(i.value):Object.keys(t),Xr.call(this,t,i),Wr.call(this)}},{key:"setOffset",value:function(e){var t=this;this.el.offset(e).show();var i=1;Re(this.el,(function(){i<=0&&(t.hide(),i=5),i-=1}))}},{key:"setOffsetAdjustView",value:function(e,t,i){var n=this;this.el.show();var r=this.el.offset(),a=r.width,o=r.height;e.top+o>i&&(e.top=i-o),e.left+a>t&&(e.left=t-a),this.el.offset(e);var s=1;Re(this.el,(function(){s<=0&&(n.hide(),s=5),s-=1}))}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){this.el.hide(),Ee(this.el)}}]),e}(),Yr=function(){function e(){l()(this,e),xe()(this,"onEdit",!1),this.el=f("div","".concat(ae,"-comment-tip")).hide()}return o()(e,[{key:"hide",value:function(){this.el.hide()}},{key:"setPosition",value:function(e,t,i){if(!0!==this.onEdit){var n=this.el,r=i?t.left-t.width-1:t.left+t.width,a=t.top-10;n.css("left","".concat(r,"px")),n.css("top","".concat(a,"px")),n.html(e).show(),i&&n.css("left","".concat(r-n.el.offsetWidth,"px"))}}}]),e}();function Vr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Gr=function(e){ee()(i,e);var t=Vr(i);function i(){var e;l()(this,i);var n=new Mr(new Ir("80px",""),{required:!0},"".concat(U("dataSearch.label"),":"),100),r=new Mr(new zr("80px",""),{required:!1},"".concat(U("dataSort.casesense"),":"),100),a=new Mr(new zr("30px",""),{required:!1},"".concat(U("dataSearch.matchwhole"),":"),150),o=new Mr(new Pr("values",["values","formulas","comments"],"120px",(function(e){return U("dataSearch.lookin.".concat(e))}),(function(){})),{required:!0},"".concat(U("dataSearch.lkinlb"),":"),100);return(e=t.call(this,U("toolbar.search"),[f("div","".concat(ae,"-form-fields")).children(r.el,a.el),f("div","".concat(ae,"-form-fields")).child(n.el),f("div","".concat(ae,"-form-fields")).child(o.el),f("div","".concat(ae,"-buttons")).children(new vi("previous").on("click",(function(){return e.btnClick("previous")})),new vi("next").on("click",(function(){return e.btnClick("next")})),new vi("close","primary").on("click",(function(){return e.btnClick("close")})))],"500px",!1,!0)).formField=n,e.casesense=r,e.lookin=o,e.matchwhole=a,e.change=function(){},e}return o()(i,[{key:"btnClick",value:function(e){if("close"!==e){if(!this.formField.validate())return;var t=this.casesense.val(),i=this.lookin.val(),n=this.matchwhole.val(),r=this.formField.val().trim();switch(e){case"previous":this.change("previous",r,t,i,n);break;case"next":this.change("next",r,t,i,n)}}else this.hide()}},{key:"show",value:function(){Ii()(re()(i.prototype),"show",this).call(this),this.formField.input.focus()}}]),i}(Rr),Zr=function(){function e(t,i){var n=this;l()(this,e),this.data=t,this.mode=i,this.ishtml=!1,this.inputChange=function(){},this.enter=function(){},this.tab=function(){},this.focuson=function(){},this.el=f("div","".concat(ae,"-formula-bar")),this.barLabel=f("div","".concat(ae,"-bar-label")),this.formulaInput=f("div","".concat(ae,"-formula-input")).on("input",(function(e){n.inputChange(n.ishtml?e.target.innerHTML:e.target.innerText)})).on("focus",(function(e){n.focuson()})).on("keydown",(function(e){var t=e.keyCode||e.which;13===t?(e.altKey||n.formulaInput.el.blur(),n.enter(e,n.ishtml)):9===t&&(n.formulaInput.el.blur(),n.tab(e))})),"read"===this.mode?this.formulaInput.attr("disabled","disabled"):this.formulaInput.attr("contenteditable","true"),this.el.children(this.barLabel,this.formulaInput),this.reset()}return o()(e,[{key:"resetData",value:function(e){this.data=e,this.reset()}},{key:"reset",value:function(){var e=this.data,t=e.selector,i=v(t.ci)+""+(t.ri+1),n=e.getSelectedCell(),r="",a=!1;n&&(n.html?(r=n.html,this.ishtml=!0):(this.ishtml=!1,n.f?r=n.f:n.ufv?r=n.ufv:n.text&&(r=n.text,a=!0))),this.barLabel.html(i),this.formulaInput.html(r,!this.ishtml,a)}}]),e}();function Kr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Jr=function(e){ee()(i,e);var t=Kr(i);function i(){var e;return l()(this,i),e=t.call(this),xe()(qn()(e),"col",void 0),xe()(qn()(e),"row",void 0),e.el.attr("contentEditable","true"),e.el.attr("placeholder","".concat(U("toolbar.commentDefault"))),e.el.attr("id","commentEdit"),e}return o()(i,[{key:"saveAndHide",value:function(e){var t=this;if(void 0!==this.col&&void 0!==this.row){if(""!==this.el.html()){for(var i=-1,n=0;n<e.data.comments.length;n++)if(e.data.comments[n].col===this.col&&e.data.comments[n].row===this.row){i=n;break}-1===i?e.data.comments.push({col:this.col,row:this.row,author:"Aspose",note:this.el.html()}):e.data.comments[i].note=this.el.html()}e.data.comments=e.data.comments.filter((function(e){return!t.checkEmptyContent(e.note)})),this.hide(),e.commentTip.onEdit=!1,this.col=void 0,this.row=void 0}}},{key:"checkEmptyContent",value:function(e){var t=document.createElement("div");return t.innerHTML=e,""===t.innerText}},{key:"setPosition",value:function(e,t,n){Ii()(re()(i.prototype),"setPosition",this).call(this,e,t,n),this.el.focus()}}]),i}(Yr),$r=i(10),Qr=function(){function e(){l()(this,e),xe()(this,"name",void 0)}return o()(e,[{key:"execute",value:function(e){}}]),e}();function ea(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}function ta(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function ia(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ta(Object(i),!0).forEach((function(t){xe()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ta(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function na(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}function ra(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function aa(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ra(Object(i),!0).forEach((function(t){xe()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ra(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function oa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var sa=[function(e){ee()(i,e);var t=ea(i);function i(){var e;l()(this,i);for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),xe()(qn()(e),"name","delete"),e}return o()(i,[{key:"execute",value:function(e){var t=e.canvas,i=e.data,n=t.fabric,r=n.getActiveObject(),a=t.findObjByData(r.id,i);if(a)if(a.op="del",i.canvasFreeze){var o=i.canvasFreeze;[o.br,o.bl,o.tr,o.tl].forEach((function(e){e.remove(t.findObjInCanvas(e,r.id)),t.saveCanvasData(i,e),e.renderAll()}))}else n.remove(r),n.renderAll(),t.saveCanvasData(i,n)}}]),i}(Qr),function(e){ee()(r,e);var t,i,n=na(r);function r(){var e;l()(this,r);for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];return e=n.call.apply(n,[this].concat(i)),xe()(qn()(e),"name","paste"),xe()(qn()(e),"canvas",void 0),xe()(qn()(e),"sheet",void 0),xe()(qn()(e),"inFreeze",void 0),e}return o()(r,[{key:"execute",value:(i=be()(Ce.a.mark((function e(t){var i,n,r,a,o;return Ce.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.canvas.clipboard,this.canvas=null!==(i=this.canvas)&&void 0!==i?i:t.canvas.fabric,this.sheet=null!==(n=this.sheet)&&void 0!==n?n:t,this.inFreeze=null!==(r=this.inFreeze)&&void 0!==r?r:t.canvas.inFreeze,o=this,a){e.next=7;break}return e.abrupt("return");case 7:return e.next=9,a.clonedObj.clone(function(){var e=be()(Ce.a.mark((function e(i){var n;return Ce.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=fabric.util.object.clone(i),o.setImagePosition(n),t.canvas.setLoading(t,{left:n.left,top:n.top}),e.next=6,o.addImageToData(n);case 6:o.setImageEventAndLayout(n),o.addImageToCanvas(n)?o.reactiveObj(n):o.rollback(o.sheet,n),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(0),console.error(e.t0),le(e.t0);case 14:return e.prev=14,t.canvas.removeLoading(t),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[0,10,14,17]])})));return function(t){return e.apply(this,arguments)}}(),["id","tick","imgType","zorder","strid"]);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"rollback",value:function(e,t){var i=e.data,n=e.canvas;n.fabric.remove(n.fabric.getObjects()[n.fabric.getObjects().findIndex((function(e){return e.id===t.id}))]),n.saveCanvasData(e.data,n.fabric),n.inFreeze&&(n.inFreeze.removeImage(t.id),n.removeImageInData(i,t.id))}},{key:"setImagePosition",value:function(e){var t=this.sheet.data,i=this.sheet.getTableOffset(),n=0,r=0;if(!e)throw"no cloneObj";if(!this.canvas)throw"no canvas";if(!this.sheet)throw"no sheet data";if(this.canvas.getActiveObject()){var a=this.canvas.getActiveObject();n=a.left+20,r=a.top+20}else{var o=t.getSelectedRect();if(!o)throw"get selected rect value is null";n=o.left+i.left,r=o.top+i.top}e.set({left:n,top:r,evented:!0}),this.sheet.canvas.edgeCollision(e)}},{key:"addImageToCanvas",value:function(e){var t=this,i=this.canvas,n=this.sheet.data;if(n.name!==this.sheet.canvas.clipboard.sheetName)return!1;if(n.canvasFreeze){var r=n.canvasFreeze;[r.br,r.bl,r.tr,r.tl].forEach((function(i){var n=fabric.util.object.clone(e),r=t.inFreeze.getOffsetWhenIndividualCanvasMovement(i.canvasName);n.set({top:n.top+r.y,left:n.left+r.x}),i.add(n),n.setCoords()}))}else e.setCoords(),i.add(e);return!0}},{key:"addImageToData",value:(t=be()(Ce.a.mark((function e(t){var i,n,r,a,o,s,l,c,h,u;return Ce.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.sheet,n=this.sheet.canvas.data,r=i.canvas.clipboard.newData,a=ia({},r),o=this.sheet.getTableOffset(),s={ri:n.selector.ri,ci:n.selector.ci,name:n.name,srcid:a.id,srcname:i.canvas.clipboard.sheetName,isshape:"Picture"!==a.type},(l=new FormData).set("p",JSON.stringify(s)),l.set("uid",i.uniqueid),e.next=11,fetch(i.imageCopyUrl,{method:"POST",body:l});case 11:if((c=e.sent).ok){e.next=14;break}throw"upload copy image fail";case 14:return e.next=16,c.json();case 16:if(h=e.sent,h=JSON.parse(h)){e.next=20;break}throw"upload copy image return null ";case 20:if(!h.Error){e.next=22;break}throw h.Error;case 22:delete h.width,delete h.height,n.images||(n.images=[]),Object.assign(a,h),a.left=t-o.left,a.top=t-o.top,n.images.push(a),u=h.type,delete h.type,Object.assign(t,h),t.id=i.canvas.picId(h.id,h.tick),t.imgType=u,t.strid=h.strid,t.zorder=i.data.topOrder++,t.changed=!0;case 37:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"setImageEventAndLayout",value:function(e){"Chart"===e.imgType&&e.setControlsVisibility({mtr:!1}),this.sheet.canvas.setSelectionLayout(e),this.sheet.canvas.eventsOn(e,this.sheet.canvas.imgEvents)}},{key:"reactiveObj",value:function(e){var t=this.canvas,i=this.sheet,n=i.data;if(n.canvasFreeze){var r=n.canvasFreeze,a=r.br,o=r.bl,s=r.tr,l=r.tl;[a,o,s,l].forEach((function(t){t.discardActiveObject(),t.setActiveObject(t.getObjects().find((function(t){return t.id===e.id}))),t.requestRenderAll(),i.canvas.saveCanvasData(n,t),i.canvas.saveOriginalAngleInfoOfImage(l)}))}else t.discardActiveObject(),t.setActiveObject(e),t.requestRenderAll(),i.canvas.saveCanvasData(n,t),i.canvas.saveOriginalAngleInfoOfImage(t)}}]),r}(Qr),function(e){ee()(i,e);var t=oa(i);function i(){var e;l()(this,i);for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),xe()(qn()(e),"name","copy"),e}return o()(i,[{key:"execute",value:function(e){var t=e.canvas.fabric;if(t.getActiveObject()){var i=t;e.data.canvasFreeze&&(i=e.data.canvasFreeze.tl),i.getActiveObject().clone((function(t){e.canvas.clipboard={clonedObj:t,newData:aa({},e.canvas.findObjByData(t.id,e.data)),sheetName:e.data.name}}),["id","tick","imgType","zorder","strid"])}}}]),i}(Qr)],la=function(){function e(t){var i=this;l()(this,e),xe()(this,"freezeXY",void 0),xe()(this,"imageCanvas",void 0),xe()(this,"freezeEvents",{"object:rotating":function(e){return function(t){i.imageCanvas.pubSub.publish("object:rotating",t,e)}},"object:moving":function(e){return function(t){i.imageCanvas.pubSub.publish("object:moving",t,e)}},"object:scaling":function(e){return function(t){i.imageCanvas.pubSub.publish("object:scaling",t,e)}},"selection:created":function(e){return function(t){i.imageCanvas.pubSub.publish("selection:created",t,e)}},"selection:cleared":function(e){return function(t){i.imageCanvas.pubSub.publish("selection:cleared",t,e)}},"selection:updated":function(e){return function(t){i.imageCanvas.pubSub.publish("selection:updated",t,e)}}}),this.imageCanvas=t;var n=t.sheet.getTableOffset(),r=t.sheet.data,a=t.sheet;if(!r.displayRight2Left){var o=r.freezeTotalWidth()+n.left/a.table.zoomlevel,s=r.freezeTotalHeight()+n.top/a.table.zoomlevel;if(this.freezeXY={},this.freezeXY.x=o,this.freezeXY.y=s,JSON.stringify(r.freeze)!==JSON.stringify([0,0])&&!r.canvasFreeze){t.pubSub=t.initPubSub();var c=t.fabric;c.off("object:moving",t.canvasEvents["object:moving"]),c.set("canvasName","br");var h=this.createCanvas(a.overlayerEl,"bl",o,c.height,JSON.stringify(c.toDatalessJSON(["id","tick","imgType","zorder","strid"]))),u=this.createCanvas(a.overlayerEl,"tr",c.width,s,JSON.stringify(c.toDatalessJSON(["id","tick","imgType","zorder","strid"]))),f=this.createCanvas(a.overlayerEl,"tl",o,s,JSON.stringify(c.toDatalessJSON(["id","tick","imgType","zorder","strid"])));this.setEventAndClipPath(c,u,h,f);for(var d=0;d<document.getElementsByClassName("canvas-container").length;d++)document.getElementsByClassName("canvas-container")[d].setAttribute("style","position:absolute");r.originFreezeSize={tl:{width:f.width,height:f.height},bl:{width:h.width,height:h.height},tr:{width:u.width,height:u.height},br:{width:c.width,height:c.height}},r.canvasFreeze={tl:f,bl:h,tr:u,br:c},this.setZoom(this.imageCanvas.sheet.table.zoomlevel)}}}return o()(e,[{key:"getFreezeCanvasClipPath",value:function(e,t,i){var n=this.freezeXY,r=this.imageCanvas.sheet,a=this.imageCanvas.tOffset;a.left/=r.data.zoomlevel,a.top/=r.data.zoomlevel;var o=new $r.fabric.Rect({width:n.x,height:t.height-n.y,top:n.y,left:a.left}),s=new $r.fabric.Rect({width:n.x,height:n.y,left:a.left,top:a.top}),l=new $r.fabric.Rect({width:e.width-n.x,height:n.y,left:n.x,top:a.top}),c=new $r.fabric.Rect({width:i.width-n.x,height:i.height-n.y,left:n.x,top:n.y});return function(e){var t;switch(e){case"tr":t=l;break;case"bl":t=o;break;case"tl":t=s;break;default:t=c}return t}}},{key:"getOffsetsBetweenCanvases",value:function(e,t){var i=this.imageCanvas.data,n=i.scroll,r=i.displayRight2Left?n.x:-n.x,a=-n.y,o={offsetX:0,offsetY:0};switch(e+t){case"tlbl":case"trbr":o={offsetX:0,offsetY:-a};break;case"bltl":case"brtr":o={offsetX:0,offsetY:a};break;case"tltr":case"blbr":o={offsetX:-r,offsetY:0};break;case"brbl":case"trtl":o={offsetX:r,offsetY:0};break;case"trbl":o={offsetX:r,offsetY:-a};break;case"tlbr":o={offsetX:-r,offsetY:-a};break;case"bltr":o={offsetX:-r,offsetY:a};break;case"brtl":o={offsetX:r,offsetY:a}}return o}},{key:"setIndividualCanvasesToMoveInSync",value:function(e,t,i,n){var r=this.imageCanvas.findObjInCanvas(e,t.target.id);if(r){var a=this.getOffsetsBetweenCanvases(n,e.canvasName);r.set({left:t.target.left-a.offsetX,top:t.target.top-a.offsetY}),r.set(i),this.imageCanvas.edgeCollision(r,e.canvasName),r.dirty=!0,e.renderAll()}}},{key:"setEventAndClipPath",value:function(e,t,i,n){var r=this;[e,t,i,n].forEach((function(e){var t=Object.keys(r.freezeEvents).map((function(t){return[t,r.freezeEvents[t](e.canvasName)]}));t=Object.fromEntries(t),r.imageCanvas.eventsOn(e,t)}));var a=this.getFreezeCanvasClipPath(t,i,e);this.freezeClipPath=a,[e,t,i,n].forEach((function(e){e.clipPath=a(e.canvasName),r.subscribeObjectEvent(e),r.subscribeSelectionEvent(e),r.subscribeCustomEvent(e,a)}))}},{key:"updateCanvasAllObjectAndRenderAll",value:function(e,t){e.getObjects().forEach(t),e.renderAll()}},{key:"subscribeObjectEvent",value:function(e){var t=this;this.imageCanvas.pubSub.subscribe("object:rotating",(function(i,n){var r={angle:i.target.angle};t.setIndividualCanvasesToMoveInSync(e,i,r,n)})),this.imageCanvas.pubSub.subscribe("object:moving",(function(i,n){var r=n===e.canvasName?{left:i.target.left,top:i.target.top}:{};t.setIndividualCanvasesToMoveInSync(e,i,r,n)})),this.imageCanvas.pubSub.subscribe("object:scaling",(function(i,n){var r={scaleX:i.target.scaleX,scaleY:i.target.scaleY};t.setIndividualCanvasesToMoveInSync(e,i,r,n)}))}},{key:"getOffsetWhenIndividualCanvasMovement",value:function(e){var t,i=this.imageCanvas.data,n=i.scroll,r=i.displayRight2Left?n.x:-n.x,a=-n.y;switch(e){case"tr":t={x:r,y:0};break;case"bl":t={x:0,y:a};break;case"br":t={x:r,y:a};break;default:t={x:0,y:0}}return t}},{key:"subscribeCustomEvent",value:function(e,t){var i=this;this.imageCanvas.pubSub.subscribe("reset",(function(){var t=i.getOffsetWhenIndividualCanvasMovement(e.canvasName);i.updateCanvasAllObjectAndRenderAll(e,(function(e){e.set({left:e.left-t.x,top:e.top-t.y}),e.setCoords(),e.dirty=!0}))})),this.imageCanvas.pubSub.subscribe("object:scroll",(function(t){var n=i.imageCanvas.data.canvasData,r=i.getOffsetWhenIndividualCanvasMovement(e.canvasName);if(n){var a=JSON.parse(n);e.getObjects().forEach((function(e){var t=a.objects.find((function(t){return t.id===e.id}));e.set({left:t.left+r.x,top:t.top+r.y}),e.setCoords()})),e.renderAll()}}))}},{key:"clearFreeze",value:function(e){if(e.canvasFreeze){this.imageCanvas.eventsOff(this.imageCanvas.fabric,this.freezeEvents);var t=e.canvasFreeze.tr,i=e.canvasFreeze.tl,n=e.canvasFreeze.bl;t.dispose(),i.dispose(),n.dispose(),document.getElementById("tr").remove(),document.getElementById("tl").remove(),document.getElementById("bl").remove();var r={width:this.imageCanvas.fabric.width,height:this.imageCanvas.fabric.height,top:this.imageCanvas.tOffset.top/this.imageCanvas.sheet.table.zoomlevel,left:this.imageCanvas.tOffset.left/this.imageCanvas.sheet.table.zoomlevel};this.imageCanvas.fabric.clipPath=new $r.fabric.Rect(r),this.imageCanvas.eventsOn(this.imageCanvas.fabric,this.imageCanvas.canvasEvents),this.imageCanvas.pubSub=this.imageCanvas.initPubSub(),this.imageCanvas.pubSub.subscribe("object:scroll",this.imageCanvas.customEvents["object:scroll"]),this.imageCanvas.fabric.renderAll(),e.canvasFreeze=void 0}}},{key:"setZoom",value:function(e){var t=this.imageCanvas,i=t.data,n=(t.fabric,t.tOffset,i.originFreezeSize);this.foreachFreezeCanvas((function(t){t.setZoom(e),t.renderAll()})),this.foreachFreezeCanvas((function(t){t.setWidth(n[t.canvasName].width*e),t.setHeight(n[t.canvasName].height*e)}),"br")}},{key:"resize",value:function(){var e=this.imageCanvas,t=e.data,i=(e.fabric,t.canvasFreeze),n=(i.tl,i.bl),r=i.tr,a=i.br,o=this.getFreezeCanvasClipPath(r,n,a);this.foreachFreezeCanvas((function(e){e.clipPath=o(e.canvasName),e.renderAll()}))}},{key:"subscribeSelectionEvent",value:function(e){var t=this;this.imageCanvas.pubSub.subscribe("selection:created",(function(i,n){if(n!==e.canvasName){t.imageCanvas.checkHyperlink(t.imageCanvas.data.canvasFreeze.br)&&!i.e.ctrlKey&&t.imageCanvas.openLink(t.imageCanvas.data);var r=t.imageCanvas.findObjInCanvas(e,i.target.id);e._setActiveObject(r),e.renderAll()}})),this.imageCanvas.pubSub.subscribe("selection:cleared",(function(t,i){i!==e.canvasName&&(e._discardActiveObject(),e.renderAll())})),this.imageCanvas.pubSub.subscribe("selection:updated",(function(i,n){var r;if(n!==e.canvasName){var a=t.imageCanvas.findObjInCanvas(e,i.target.id);(null===(r=e.getActiveObject())||void 0===r?void 0:r.id)!==a.id&&(e._setActiveObject(a),e.renderAll())}}))}},{key:"setObjectOrderAndChangedInAllCanvas",value:function(e,t){var i=this;++e.topOrder,Object.keys(e.canvasFreeze).forEach((function(n){var r=i.imageCanvas.findObjInCanvas(e.canvasFreeze[n],t.id);r&&(r.changed=!0,i.imageCanvas.sendImageToFont(e.canvasFreeze[n],r),t.zorder=r.zorder=e.topOrder,"TextBox"===t.imgType&&n!==t.canvas.canvasName&&(r.width=t.width,r.height=t.height,r.scaleX=1,r.scaleY=1),e.canvasFreeze[n].renderAll())}))}},{key:"setOrderAndSaveData",value:function(e){var t=this.imageCanvas.data;this.setObjectOrderAndChangedInAllCanvas(t,e),this.imageCanvas.saveOriginalAngleInfoOfImage(t.canvasFreeze.br),this.imageCanvas.saveCanvasData(t,t.canvasFreeze.br)}},{key:"loadFreezeImage",value:function(){var e=this.imageCanvas.data;if(e.canvasFreeze){var t=e.canvasFreeze,i=t.tl,n=t.bl,r=t.tr;this.imageCanvas.rerenderCanvasBySavedJson(n,{x:0,y:0},n.clipPath),this.imageCanvas.rerenderCanvasBySavedJson(r,{x:0,y:0},r.clipPath),this.imageCanvas.rerenderCanvasBySavedJson(i,{x:0,y:0},i.clipPath)}}},{key:"createCanvas",value:function(e,t,i,n,r){var a=document.createElement("canvas");a.width=i,a.height=n,a.setAttribute("id",t),e.children(a),window.mobileAndTabletCheck()&&($r.fabric.Object.prototype.selectable=!1);var o=new $r.fabric.Canvas(t);return o.selection=!1,o.set("canvasName",t),this.imageCanvas.eventsOn(o,this.imageCanvas.canvasEvents),o}},{key:"removeImage",value:function(e){this.foreachFreezeCanvas((function(t){t.remove(t.getObjects()[t.getObjects().findIndex((function(t){return t.id===e}))])}),"br")}},{key:"setDirty",value:function(e){this.foreachFreezeCanvas((function(t){t.getObjects().find((function(t){return t.id===e})).dirty=!0,t.requestRenderAll()}))}},{key:"setVisible",value:function(e,t){this.foreachFreezeCanvas((function(i){i.getObjects().find((function(t){return t.id===e})).visible=t}))}},{key:"setFilter",value:function(e,t){this.foreachFreezeCanvas((function(i){var n=i.getObjects().find((function(t){return t.id===e}));n.filters[0]=t,n.applyFilters()}))}},{key:"setCustomHighlight",value:function(e,t,i){this.foreachFreezeCanvas((function(n){var r=n.getObjects().find((function(t){return t.id===e}));i(t,r)}))}},{key:"setOrder",value:function(){this.foreachFreezeCanvas((function(e){null!=e&&e.getObjects().find((function(e){return!e.zorder}))||e.getObjects().sort((function(e,t){return e.zorder<t.zorder?-1:1})).forEach((function(t){e.bringToFront(t)}))}))}},{key:"saveCanvasData",value:function(){var e=this,t=this.imageCanvas.data;this.foreachFreezeCanvas((function(i){e.imageCanvas.saveCanvasData(t,i)}))}},{key:"setCursor",value:function(e){this.foreachFreezeCanvas((function(t){t.defaultCursor=e}))}},{key:"renderAll",value:function(){this.foreachFreezeCanvas((function(e){e.renderAll()}))}},{key:"foreachFreezeCanvas",value:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];var r=this.imageCanvas.data;if(r.canvasFreeze){var a=r.canvasFreeze,o=a.tl,s=a.bl,l=a.tr,c=a.br;[o,s,l,c].forEach((function(t){i.includes(t.canvasName)||e(t)}))}}}]),e}();function ca(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var ha=function(){function e(){l()(this,e),this.subscribers=[]}return o()(e,[{key:"subscribe",value:function(e,t){var i=this.subscribers[e];i?i.push(t):this.subscribers[e]=[t]}},{key:"publish",value:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];var r=this.subscribers[e]||[];r.forEach((function(e){return e.apply(void 0,i)}))}}]),e}(),ua=function(e,t){return"p_".concat(e,"_").concat(t)},fa=function(e,t){return"s_".concat(e,"_").concat(t)},da=function(e){var t;this.visible=e,this.fabobj.visible=e;var i=this.getIdtick();null===(t=this.inFreeze)||void 0===t||t.setVisible(i,e),this.setDirty()},ma=function(){var e;this.fabobj.set("dirty",!0),this.fabobj.canvas.requestRenderAll();var t=this.getIdtick();null===(e=this.inFreeze)||void 0===e||e.setDirty(t)},ga=function(e){var t;this.fabobj.filters[0]=e,this.fabobj.applyFilters();var i=this.getIdtick();null===(t=this.inFreeze)||void 0===t||t.setFilter(i,e)},va=function(e,t){var i;t(e,this.fabobj);var n=this.getIdtick();null===(i=this.inFreeze)||void 0===i||i.setCustomHighlight(n,e,t)},pa=function(){return"Picture"===this.type?ua(this.id,this.tick):fa(this.id,this.tick)},ya=function(e,t){var i=this.width,n=this.height,r=this.shape;e.save(),e.translate(-i/2,-n/2);var a=new Dt(0,0,i,n,10);a.setPading(r.lp,r.rp);var o=new Bt(e,i,n),s=1/Ot();o.scale(s,s),o.scale(s,s),o.rect3(a,r),r.ishideText||o.richtext(r,a,r.align,r.valign,r.wrap,r.getHighlight()),e.restore()},ba=function(e){var t=this.getScaledWidth(),i=this.getScaledHeight();this.scaleX=1,this.scaleY=1,this.width=t,this.height=i,this.shape.originWidth=t,this.shape.originHeight=i,this.shape.setDirty()},wa=function(e){ee()(i,e);var t=ca(i);function i(){var e;return l()(this,i),e=t.call(this,"canvas"),xe()(qn()(e),"imgEvents",{mouseup:function(t){var i=qn()(e).sheet,n=i.data,r=t.target;if(!window.mobileAndTabletCheck()){var a=r.canvas;a||(a=e.fabric),n.canvasFreeze?e.inFreeze.setOrderAndSaveData(r):(r.changed=!0,e.sendImageToFont(a,r),r.zorder=++n.topOrder,e.findObjInCanvas(a,r.id).zorder=r.zorder,e.saveOriginalAngleInfoOfImage(a),e.saveCanvasData(n,a)),i.selector.setObjId(r.id)}},mousedown:function(t){window.mobileAndTabletCheck()||(e.sheet.selector.hide(),e.sheet.editor.clear(),null==t||t.e.stopPropagation())},mousedblclick:function(t){if(!window.mobileAndTabletCheck()){var i=t.target,n=qn()(e).sheet;if("OleObject"===i.imgType)n.getOle(i.strid);else if("TextBox"===i.imgType){var r=e.findShape(i.id,n.data);n.setEditForTextBox(r),e.fabric.discardActiveObject().requestRenderAll()}}},mousemove:function(t){e.findObjByData(t.target.id,e.sheet.data).hyperlink?e.fabric.hoverCursor="pointer":e.fabric.hoverCursor="move"}}),xe()(qn()(e),"pausePanning",!1),xe()(qn()(e),"canvasEvents",{"mouse:move:before":function(){e.sheet.data.canvasFreeze&&e.sheet.data.canvasFreeze.tl.getObjects().length!==e.sheet.data.canvasFreeze.br.getObjects().length&&e.inFreeze.loadFreezeImage()},"object:moving":function(t){e.edgeCollision(t.target,"canvas")},"selection:created":function(t){e.checkHyperlink(e.fabric)&&!t.e.ctrlKey&&e.openLink(e.data)}}),xe()(qn()(e),"customEvents",{"object:scroll":function(){var t=e.data,i=t.scroll,n=t.displayRight2Left,r=t.canvasData,a=n?i.x:-i.x,o=-i.y;if(r){var s=JSON.parse(r);e.fabric.getObjects().forEach((function(e){var t=s.objects.find((function(t){return t.id===e.id}));e.set({left:t.left+a,top:t.top+o}),e.setCoords()})),e.fabric.renderAll()}}}),xe()(qn()(e),"tOffset",void 0),xe()(qn()(e),"data",void 0),xe()(qn()(e),"fabric",void 0),xe()(qn()(e),"freeze",void 0),xe()(qn()(e),"freezeXY",{x:0,y:0}),xe()(qn()(e),"pubSub",void 0),xe()(qn()(e),"sheet",void 0),xe()(qn()(e),"basicZorder",void 0),xe()(qn()(e),"canvasId","canvas_".concat((new Date).getTime())),xe()(qn()(e),"imageOperationList",{}),e.attr("id",e.canvasId),e.pubSub=e.initPubSub(),sa.forEach((function(t){var i=new t;e.imageOperationList[i.name]=i})),Te(window,"resize",(function(t){window.mobileAndTabletCheck()||e.resize(t)})),e}return o()(i,[{key:"publishEvent",value:function(e,t){this.pubSub.publish(e,t)}},{key:"initPubSub",value:function(){return new ha}},{key:"setCursor",value:function(e){this.sheet.data.canvasFreeze?this.inFreeze.setCursor(e):this.fabric.defaultCursor=e}},{key:"doNewSheetPage",value:function(e){this.fabric.clear(),this.inFreeze&&this.inFreeze.clearFreeze(e)}},{key:"doSwitchSheetPage",value:function(e){var t=this;this.sheet.selector.el.show();setTimeout((function e(){var i,n,r,a;t.sheet.canvas.fabric.getObjects().length===(null!==(i=null===(n=t.sheet.data.images)||void 0===n?void 0:n.length)&&void 0!==i?i:0)+(null!==(r=null===(a=t.sheet.data.shapes)||void 0===a?void 0:a.length)&&void 0!==r?r:0)?t.doEndSwitchSheetPage():setTimeout(e,200)}),200);this.inFreeze&&this.inFreeze.clearFreeze(e)}},{key:"doEndSwitchSheetPage",value:function(){var e;this.setOrder(this.fabric),null===(e=this.sheet.canvas.inFreeze)||void 0===e||e.setOrder()}},{key:"initFreeze",value:function(){this.inFreeze=new la(this)}},{key:"rerenderCanvasBySavedJson",value:function(e,t,i){var n=this;if(this.data.canvasData&&this.fabric){this.initFreeze();var r=JSON.parse(this.data.canvasData);delete r.clipPath,this.loadFromCanvasData(JSON.stringify(r),(function(r,a){a.set({left:r.left+t.x,top:r.top+t.y}),"Chart"===a.imgType&&a.setControlsVisibility({mtr:!1}),n.setSelectionLayout(a),n.eventsOn(a,n.imgEvents);var o,s,l=n.findObjByData(r.id,n.data);l&&(s=l,"TextBox"===(o=a).imgType&&(o.shape=s,o.drawObject=ya,o.on("modified",ba)),e.clipPath=i)}),e)}}},{key:"findObjInCanvas",value:function(e,t){return e.getObjects().find((function(e){return e.id===t}))}},{key:"recordCanvasData",value:function(e,t){var i,n,r=e.aCoords,a=this.tOffset,o=this.findObjByData(e.id,t);if(o){var s=r.tl.x+(r.tr.x-r.tl.x)/2-a.left,l=r.tl.y+(r.bl.y-r.tl.y)/2-a.top;o.centerX||(o.centerX=s),o.centerY||(o.centerY=l),o.currentCenterX=s,o.currentCenterY=l;var c=t.getCellRectByXY(r.tl.x,r.tl.y);o.width=o.originWidth*e.scaleX,o.height=o.originHeight*e.scaleY,o.scaleX=e.scaleX,o.scaleY=e.scaleY,o.top=e.top-a.top/t.zoomlevel+t.scroll.y,o.left=e.left-a.left/t.zoomlevel+t.scroll.x,o.row=null==c?void 0:c.ri,o.col=null==c?void 0:c.ci,o.changed=null!==(i=e.changed)&&void 0!==i&&i,o.zorder=null!==(n=e.zorder)&&void 0!==n?n:t.topOrder}}},{key:"edgeCollision",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"canvas",i=this.data,n=this.tOffset,r=n.top/i.zoomlevel,a=n.left/i.zoomlevel;0!==i.scroll.y&&["br","bl"].includes(t)&&(r-=i.scroll.y),0!==i.scroll.x&&["br","tr"].includes(t)&&(a-=i.scroll.x),e.setCoords();var o=e.getBoundingRect().top/i.zoomlevel,s=e.getBoundingRect().left/i.zoomlevel;(o<r||s<a)&&(e.top=Math.max(e.top,e.top-o+r),e.left=Math.max(e.left,e.left-s+a))}},{key:"init",value:function(e){var t=this;this.tOffset=e.getTableOffset();var i=this.tOffset;this.attr("width",i.width+i.left),this.attr("height",i.height+i.top),this.sheet=e,window.mobileAndTabletCheck()&&($r.fabric.Object.prototype.selectable=!1),this.fabric=new $r.fabric.Canvas(this.canvasId),this.clipPath({width:this.fabric.width,height:this.fabric.height,top:this.tOffset.top/e.data.zoomlevel,left:this.tOffset.left/e.data.zoomlevel});var n=0,r=setInterval((function(){(e.data.isImageOk||50===n)&&(t.onSheetImageLoaded(),clearInterval(r)),n++}),200);this.eventsOn(this.fabric,this.canvasEvents),this.fabric.selection=!1,window.mobileAndTabletCheck()&&this.fabric.removeListeners(),this.pubSub.subscribe("object:scroll",this.customEvents["object:scroll"])}},{key:"onSheetImageLoaded",value:function(){var e;this.setOrder(this.sheet.canvas.fabric),null===(e=this.sheet.canvas.inFreeze)||void 0===e||e.setOrder()}},{key:"resetFreeze",value:function(e){var t=r()(e.freeze,2),i=t[0],n=t[1];0===i&&0===n?this.inFreeze&&this.inFreeze.clearFreeze(e):this.initFreeze()}},{key:"reset",value:function(e){this.data=e,this.fabric.clear(),this.initFreeze(),this.freezeXY=this.inFreeze.freezeXY,this.inFreeze.loadFreezeImage(),this.fabric.renderAll()}},{key:"doResetPosition",value:function(e){0===e&&this.pubSub.publish("reset")}},{key:"saveOriginalAngleInfoOfImage",value:function(e){var t=this,i={};e.getObjects().forEach((function(e){i[e.id]=e.angle,t.rotateObject(e,0)})),e.renderAll(),e.getObjects().forEach((function(e){t.recordCanvasData(e,t.sheet.data),t.setDataAngle(e,i[e.id],t.sheet.data),t.rotateObject(e,i[e.id])})),e.renderAll()}},{key:"setDataAngle",value:function(e,t,i){var n=this.findObjByData(e.id,i);n&&(n.angle=t)}},{key:"clipPath",value:function(e){this.fabric.clipPath=new $r.fabric.Rect(e)}},{key:"eventsOn",value:function(e,t){for(var i in t)e.on(i,t[i])}},{key:"eventsOff",value:function(e,t){for(var i in t)e.off(i,t[i])}},{key:"saveCanvasData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.fabric,i=this.sheet;if(t){var n=t.toDatalessJSON(["id","tick","imgType","zorder","strid"]);n.objects.forEach((function(e){e.left+=i.data.scroll.x,e.top+=i.data.scroll.y})),e.canvasData=JSON.stringify(n)}}},{key:"loadFromCanvasData",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.fabric;e?n.loadFromJSON(e,(function(){i.setOrder(n),n.renderAll()}),t):n.clear()}},{key:"findObjByData",value:function(e,t){var i=this.findImage(e,t);return null!=i?i:this.findShape(e,t)}},{key:"setZoom",value:function(e){var t=this.sheet.data;this.tOffset=this.sheet.getTableOffset(),this.sheet.verticalScrollbar.move({top:0}),this.sheet.horizontalScrollbar.move({left:0}),t.canvasFreeze?this.inFreeze.setZoom(e):(this.fabric.clipPath=new $r.fabric.Rect({width:this.fabric.width/t.zoomlevel,height:this.fabric.height/t.zoomlevel,left:this.tOffset.left/t.zoomlevel,top:this.tOffset.top/t.zoomlevel}),this.fabric.setZoom(e),this.fabric.renderAll())}},{key:"findImage",value:function(e,t){var i;return null===(i=t.images)||void 0===i?void 0:i.find((function(t){return e===ua(t.id,t.tick)}))}},{key:"findShape",value:function(e,t){var i;return null===(i=t.shapes)||void 0===i?void 0:i.find((function(t){return e===fa(t.id,t.tick)}))}},{key:"resize",value:function(e){var t=this.sheet,i=this.fabric,n=this.tOffset;i&&(i.setWidth(e.target.outerWidth+n.left),i.setHeight(e.target.outerHeight+n.top),i.clipPath=new $r.fabric.Rect({width:i.getWidth(),height:i.getHeight(),top:this.tOffset.top/t.data.zoomlevel,left:this.tOffset.left/t.data.zoomlevel}),i.renderAll(),t.data.canvasFreeze&&this.inFreeze.resize())}},{key:"setSelectionLayout",value:function(e){e.set({borderColor:"gray",cornerColor:"gray",cornerSize:12,transparentCorners:!0})}},{key:"setTextBox",value:function(e,t,i){var n,r=e.canvas,a=new $r.fabric.Rect;i.width?i.fromOutside&&(delete i.width,delete i.height):(a.width=i.width,a.height=i.height),r.setSelectionLayout(a),r.eventsOn(a,r.imgEvents),r.eventsOn(r,this.canvasEvents),r.fabric.add(a),r.rotateObject(a,i.rotate),t.fabobj=a,a.shape=t,t.inFreeze=this.inFreeze,t.setVisible=da,t.setDirty=ma,t.setFilter=ga,t.setCustomHighlight=va,t.getIdtick=pa,i.id||(i.id=t.getIdtick()),a.set(i),e.visibleFilter&&t.setVisible(e.visibleFilter(e,t)),Gt(t),a.drawObject=ya,a.on("modified",ba),t.updateTextBox=function(e,t){this.html=e,this.rtxt=t,delete this.bigfontsize,Gt(this),this.setDirty()},t.getHighlight=function(){return this.showhighlight?m()(this.highlighttxts):[]},t.addHighlight=function(e,t){var i={start:e,end:t};this.highlighttxts.find((function(i){if(i.start===e&&i.end===t)return i}))||(i.color=this.hstyle.color,this.highlighttxts.push(i),this.setDirty())},t.removeHighlight=function(e,t){if(this.highlighttxts){var i=this.highlighttxts.findIndex((function(i){return i.start===e&&i.end===t}));-1!==i&&(this.highlighttxts.splice(i,1),this.setDirty())}},t.setHighlight=function(e,t){this.showhighlight=e,this.highlighttxts||(this.highlighttxts=[]),t&&(this.hstyle=t),this.setDirty()},t.setBackgroundColor=function(e){this.bgColor=e,this.setDirty()},t.setActiveEffect=function(e){this.isactiveeffect=e,this.setDirty()},t.hideText=function(e){this.ishideText=e,this.setDirty()},r.fabric.renderAll(),r.saveCanvasData(e.data),null===(n=this.inFreeze)||void 0===n||n.loadFreezeImage()}},{key:"setImage",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"content/img/updating.gif",r=e.canvas,a=this;$r.fabric.Image.fromURL(n,(function(n){var o;if(t&&(t.fabobj=n,t.inFreeze=a.inFreeze,t.setVisible=da,t.setDirty=ma,t.setFilter=ga,t.setCustomHighlight=va,t.getIdtick=pa),i.id||(i.id=t.getIdtick()),i.id.includes("loading"))return n.set(i),r.fabric.add(n),t&&e.visibleFilter&&t.setVisible(e.visibleFilter(e,t)),r.fabric.requestRenderAll(),void(null===(o=a.inFreeze)||void 0===o||o.loadFreezeImage());try{var s,l=r.findObjByData(i.id,e.data);if(!l)return;var c=r.findObjInCanvas(r.fabric,i.id);c&&r.fabric.remove(c),i.width?(i.fromOutside&&(delete i.width,delete i.height),n.set(i)):(n.scaleToWidth(i.scaleToWidth),n.scaleToHeight(i.scaleToHeight),n.set(i),l.fromOutside=!0,l.scaleX=n.scaleX,l.scaleY=n.scaleY),"Chart"===i.imgType&&n.setControlsVisibility({mtr:!1}),r.setSelectionLayout(n),r.eventsOn(n,r.imgEvents),r.eventsOn(r,a.canvasEvents),r.fabric.add(n),t&&e.visibleFilter&&t.setVisible(e.visibleFilter(e,t)),r.rotateObject(n,i.rotate),r.fabric.renderAll(),r.saveCanvasData(e.data),null===(s=a.inFreeze)||void 0===s||s.loadFreezeImage()}catch(e){console.error(e),le(e)}finally{r.removeLoading(e)}}))}},{key:"setLoading",value:function(e,t){var i=this.tOffset,n=e.data,r=n.displayRight2Left,a=n.cols,o=r?e.data.viewWidth()-a.indexWidth:0,s=r?o-t.left:t.left;t.top+=i.top,t.left=s+i.left,t.id="loading"+(new Date).getTime(),t.selectable=!1,this.setImage(e,null,t),this.loadingStack||(this.loadingStack=[]),this.loadingStack.push(t.id)}},{key:"removeLoading",value:function(e){var t=e.canvas;if(this.loadingStack){var i=this.loadingStack.shift();t.fabric.remove(t.fabric.getObjects()[t.fabric.getObjects().findIndex((function(e){return e.id===i}))]),t.saveCanvasData(e.data,t.fabric),t.inFreeze&&(t.inFreeze.removeImage(i),t.inFreeze.saveCanvasData(),t.inFreeze.renderAll(),t.fabric.renderAll())}}},{key:"rotateObject",value:function(e,t){e&&(e._setOriginToCenter(),e.set("angle",t).setCoords(),e._resetOrigin())}},{key:"doInsertURLImage",value:function(e,t){this.doInsertImage(e,t,!0)}},{key:"doInsertImage",value:function(e,t){var i,n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=t.data.getSelectedRect(),o=this.tOffset,s=t.data,l=s.displayRight2Left,c=s.cols,h=l?t.data.viewWidth()-c.indexWidth:0,u=l?h-a.left/t.table.zoomlevel-e.width:a.left/t.table.zoomlevel,f=e.url,d={angle:0,col:this.data.selector.ci,height:e.height,id:e.id,left:a.left/t.table.zoomlevel,originAngle:0,originHeight:e.height,originLeft:a.left,originTop:a.top,originWidth:e.width,row:this.data.selector.ri,scaleX:1,scaleY:1,src:f,strid:e.strid,tick:e.tick,top:a.top/t.table.zoomlevel,type:e.type,width:e.width,zorder:null!==(i=t.data.topOrder)&&void 0!==i?i:0};this.findObjByData(d.id,t.data)||(t.data.images||(t.data.images=[]),t.data.images.push(d)),r?this.setImage(t,d,{id:ua(d.id,d.tick),tick:d.tick,scaleToWidth:e.width,scaleToHeight:e.height,top:d.top+o.top/t.table.zoomlevel,left:u+o.left/t.table.zoomlevel,originAngle:0,rotate:0,fromOutside:!0,imgType:d.type,strid:d.strid,"z-index":this.basicZorder+d.zorder,zorder:d.zorder},d.src):this.setImage(t,d,{id:ua(d.id,d.tick),tick:d.tick,scaleToWidth:d.width,scaleToHeight:d.height,top:d.top+o.top/t.table.zoomlevel,left:u+o.left/t.table.zoomlevel,originAngle:0,rotate:0,fromOutside:!0,imgType:d.type,strid:d.strid,"z-index":this.basicZorder+d.zorder,zorder:d.zorder},d.src),this.fabric.renderAll(),this.saveCanvasData(t.data),null===(n=this.inFreeze)||void 0===n||n.loadFreezeImage()}},{key:"isImageOnSelected",value:function(){return!!this.fabric.getActiveObject()}},{key:"setHyperlink",value:function(e){var t=this.getActiveObjInData(this.data);t&&(t.hyperlink=e)}},{key:"getActiveObjInData",value:function(e){var t=this.fabric.getActiveObject();if(t)return this.findObjByData(t.id,e)}},{key:"link",value:function(e){var t,i=this.getActiveObjInData(e);i&&this.sheet.modalLink.setValue(xs.datas.map((function(e){return e.name})),null!==(t=i.hyperlink)&&void 0!==t?t:{})}},{key:"removeLink",value:function(e){var t=this.getActiveObjInData(e);t&&(t.hyperlink=null)}},{key:"openLink",value:function(e){var t=this.getActiveObjInData(e);t&&(this.fabric._discardActiveObject(),this.fabric.renderAll(),this.sheet.hyperlink.access(t.hyperlink))}},{key:"sendImageToFont",value:function(e,t){e&&t&&e.bringToFront(t)}},{key:"doOperation",value:function(e){Object.keys(this.imageOperationList).includes(e)&&!window.mobileAndTabletCheck()&&this.imageOperationList[e].execute(this.sheet)}},{key:"removeImageInData",value:function(e,t){if(!t.includes("_")&&t.split("_").length-1!=2)throw new Error("not correct id");var i=t.split("_"),n=r()(i,3),a=n[0],o=n[1],s=n[2],l="s"===a?e.shapes:e.images;null==l||l.splice(l.findIndex((function(e){return e.id===o&&e.tick===s})),1)}},{key:"checkHyperlink",value:function(e){var t=e.getActiveObject();if(t)return!!this.findObjByData(t.id,this.data).hyperlink}},{key:"validType",value:function(e,t,i){var n=e.getActiveObject();if(n)return this.findObjByData(n.id,this.data)[t]===i}},{key:"setOrder",value:function(e){null==e||e.getObjects().sort((function(e,t){return e.zorder<t.zorder?-1:1})).forEach((function(t){e.bringToFront(t)}))}}]),i}(u);function xa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var ka=function(e){ee()(i,e);var t=xa(i);function i(){var e;l()(this,i);var n=new Mr(new Ir("100%",U("contextmenu.insertURL")),{required:!0},"",100);return(e=t.call(this,">",[f("div","".concat(ae,"-form-fields")).children(n.el),f("div","".concat(ae,"-buttons")).children(new vi("ok","primary").on("click",(function(){return e.btnClick("ok")})))])).url=n,e.values=[],e.change=function(){},e}return o()(i,[{key:"btnClick",value:function(e){"ok"===e?this.url.validate()&&this.checkIsImage(this.url.val(),this.validateImage,5e3):this.hide()}},{key:"validateImage",value:function(e,t){"success"===t?(this.change("ok",e),this.hide()):this.url.validateFail(U("validation.downloadImageFail"))}},{key:"show",value:function(){Ii()(re()(i.prototype),"show",this).call(this),this.url.input.focus()}},{key:"hide",value:function(){this.url.val(""),this.url.validateClear(),Ii()(re()(i.prototype),"hide",this).call(this)}},{key:"checkIsImage",value:function(e,t,i){var n,r=!1,a=this,o=new Image;o.onerror=o.onabort=function(){r||(clearTimeout(n),t.call(a,e,"error"))},o.onload=function(){r||(clearTimeout(n),t.call(a,e,"success"))},o.src=e,n=setTimeout((function(){r=!0,o.src="//!!!!/test.jpg",t.call(a,e,"timeout")}),i)}}]),i}(Rr);function Ca(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}function Sa(e){e.dd&&(e.dd.title.removeClass("arrow-left"),2===e.dd.headerEl.children().length&&e.dd.headerEl.removeChild(e.dd.headerEl.children()[1]))}function _a(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=" "+U("menubar.".concat(e.tag.replace(/-[a-z]/g,(function(e){return e[1].toUpperCase()}))));e.dd?e.dd.headerEl.child(i,t):e.el.child(i)}function Ta(e){var t=f("div","".concat(ae,"-item")).child(e.el);return e.dd&&(e.dd.contentEl.addClass("".concat(ae,"-menubar-dropdown-content")),t=f("div","".concat(ae,"-menubar-btn")).child(e.dd.el)),t}function Oa(e,t){e.el.addEventListener("click",(function(i){t.dd?t.dd.menuDiv=e:(t.click?t.click():t.change(t.tag),i.stopPropagation())}),!0),e.el.addEventListener("mouseenter",(function(e){e.stopPropagation()}),!0)}var Ea=function(e){ee()(i,e);var t=Ca(i);function i(e,n){var r;l()(this,i);for(var a,o=[],s=["format","font-name","font-size"],c=0;c<n.length;c++){(a=n[c]).tip="",a.el.attr("style","margin:0"),a.el.attr("class",""),Sa(n[c]);var h=s.includes(n[c].tag);_a(n[c],h);var u=Ta(n[c]);Oa(u,n[c]),o.push(u)}return(r=t.call.apply(t,[this,e,"max-content",!1,"bottom-left"].concat(o))).headerEl.on("mouseenter",(function(e){if(!window.mobileAndTabletCheck()){var t=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});e.target.dispatchEvent(t)}})),r}return i}(Mi);function Ra(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Ia=function(e){ee()(i,e);var t=Ra(i);function i(e,n){return l()(this,i),t.call(this,e,null,"",n)}return o()(i,[{key:"dropdown",value:function(){return new Ea(this.tag,this.value)}}]),i}(Pi);function Aa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Da=function(e){ee()(i,e);var t=Aa(i);function i(e){var n;l()(this,i);var r="download";return null!=e&&e&&(r+="_".concat(e)),n=t.call(this,r),"GOOGLE"===e||"DROPBOX"===e?n.setIcon("savetocloud"):n.setIcon("download"),n}return i}(bn);function Pa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Fa=function(e){ee()(i,e);var t=Pa(i);function i(){return l()(this,i),t.call(this,"link")}return i}(bn);function Ma(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var La=function(e){ee()(i,e);var t=Ma(i);function i(){return l()(this,i),t.call(this,"insertColumn")}return i}(bn);function ja(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var za=function(e){ee()(i,e);var t=ja(i);function i(){return l()(this,i),t.call(this,"insertRow")}return i}(bn);function Ba(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Ha=function(e){ee()(i,e);var t=Ba(i);function i(){return l()(this,i),t.call(this,"insertSheet")}return i}(bn);var Na=function(){function e(t,i,n,r,a){var o=this;l()(this,e),this.data=t;var s=t.defaultStyle();this.change=function(){},this.widthFn=i,this.isHide=n,this.dropdowns=[];var c=U("menubar.menuEdit"),h=U("menubar.menuComment"),u=U("menubar.menuInsert"),d=U("menubar.menuText"),m=U("menubar.menuFile");this.items={},this.items[m]=[new tr,new Da("Original"),new Da("XLSX"),new Da("PDF"),new Da("HTML")],"ru"!==a&&"zh"!==a&&(this.items[m].push(new Da("GOOGLE")),this.items[m].push(new Da("DROPBOX"))),this.items[c]=[this.borderEl=new pn,this.mergeEl=new Qn,this.freezeEl=new Jn,this.autofilterEl=new qi,this.sortEl=new lr,this.searchEl=new hr,this.paintformatEl=new Cn,this.clearformatEl=new xn,this.fillColorEl=new On(s.bgcolor)],this.items[u]=[this.insertColumn=new La,this.insertRow=new za,this.insertSheet=new Ha,this.insertImageEL=new kr,this.formulaEl=new Zn,this.insertLink=new Fa,this.insetCommentEl=new fr],this.insetCommentEl.tag="insertComment",this.items[d]=[this.fontEl=new Bn,this.fontSizeEl=new An,this.boldEl=new Vi,this.italicEl=new Zi,this.underlineEl=new Qi,this.strikeEl=new Ji,this.alignEl=new Bi(s.align),this.valignEl=new Ni(s.valign),this.textwrapEl=new nr,this.textColorEl=new _n(s.color)],this.items[h]=[this.commentEditEl=new fr,this.commentRemoveEl=new mr,this.commentPreviousEl=new vr,this.commentNextEl=new yr];for(var g=0;g<this.insertImageEL.dd.contentEl.children().length;g++)this.insertImageEL.dd.contentEl.children()[g].style="width:max-content";this.el=f("div","".concat(ae,"-toolbar ").concat(ae,"-menubar")),n?this.el.hide():(this.el.css("text-transform","capitalize"),Object.keys(this.items).forEach((function(e){var t=new Ia(e,o.items[e]);o.dropdowns.push(t),o.el.child(t.el),o.items[e].map((function(e){e.change=function(){o.change.apply(o,arguments)}}))})))}return o()(e,[{key:"hideDropdown",value:function(){this.dropdowns.forEach((function(e){return e.dd.hide()}))}}]),e}(),Ua=function(){function e(){l()(this,e),xe()(this,"setActiveSheetBySheetName",(function(){})),xe()(this,"setActiveCell",(function(){})),xe()(this,"linkPositions",[])}return o()(e,[{key:"checkAndAccess",value:function(e,t,i){var n=this.find(e,t,i);return n?this.access(n):null}},{key:"loadLinkPosition",value:function(e){var t=this,i=e.data;this.linkPositions=[];e.getTableOffset();i.hyperlinks.forEach((function(e){var n={},r=k.valueOf(e.area),a=i.scroll.ci,o=i.scroll.ri;a=a>0&&r.sci<a?0:a,o=o>0&&r.sri<o?0:o,n.x=[i.cols.sumWidth(a,r.sci+1)-i.cols.getWidth(r.sci),i.cols.sumWidth(a,r.eci+1)],n.y=[i.rows.sumHeight(o,r.sri+1)-i.rows.getHeight(r.eri),i.rows.sumHeight(o,r.eri+1)],i.canvasFreeze&&(i.scroll.ri>0||i.scroll.ci>0)||t.linkPositions.push(n)}))}},{key:"find",value:function(e,t,i){var n=e.hyperlinks;if(0!==n.length)return n.find((function(e){return e.area?k.valueOf(e.area).includes(t,i):null}))}},{key:"findByArea",value:function(e,t){var i=e.hyperlinks;if(0!==i.length)return i.find((function(e){return e.area?k.valueOf(e.area).contains(k.valueOf(t)):null}))}},{key:"check",value:function(e,t,i){return!!this.find(e,t,i)}},{key:"remove",value:function(e,t){var i=t.hyperlinks.findIndex((function(t){return t.area===e.area}));t.hyperlinks.splice(i,1)}},{key:"removeByRange",value:function(e,t){var i=this.findByRange(e,t.data);this.remove(i,t.data),this.setHyperlinkStyleByArea(i.area,t,!1)}},{key:"findByRange",value:function(e,t){var i=this.getSelectArea(e);return this.findByArea(t,i)}},{key:"getSelectArea",value:function(e){var t=b(e.sci,e.sri),i=b(e.eci,e.eri);return"".concat(t,":").concat(i)}},{key:"setHyperlinkStyleByArea",value:function(e,t,i){for(var n=k.valueOf(e),r=n.sri;r<=n.eri;r++)for(var a=n.sci;a<=n.eci;a++)t.data.setHyperlinkStyle(r,a,i);t.table.render()}},{key:"accessByRange",value:function(e,t){var i=this.getSelectArea(e),n=this.findByArea(t,i);this.access(n)}},{key:"access",value:function(e){if("number"==typeof e.type&&e.address){switch(e.type){case 0:case 2:window.open(e.address,"_blank");break;case 1:break;case 3:if(!e.address.includes("!"))break;var t=e.address.split("!"),i=r()(t,2),n=i[0],a=i[1];n.startsWith("'")&&n.endsWith("'")&&(n=n.substr(1,n.length-2)),this.setActiveSheetBySheetName(n);var o=y(a),s=r()(o,2),l=s[0],c=s[1],h=this;setTimeout((function(){h.setActiveCell(c,l)}),1e3)}return null}}}]),e}();function Xa(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return Wa(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Wa(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function Wa(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var qa=function(){function e(t){l()(this,e),this.sheet=t}return o()(e,[{key:"setCustomHighlightImgFunc",value:function(e){this.highlightImgFunc=e}},{key:"showHighlights",value:function(e){var t=this.sheet.data;t.showhighlight=!0,t.highlightstyle=e,this.AutoShowOrHide()}},{key:"AutoShowOrHide",value:function(){var e=this.sheet,t=e.data,i=e.canvas;if(t.highlightall){var n=i.fabric;this.highlightAllImg(t.showhighlight,n)}else this.showHighlightImageShapesAuto(t.showhighlight)}},{key:"hideHighlights",value:function(){var e=this.sheet,t=e.data,i=e.table;t.showhighlight=!1,this.AutoShowOrHide(),i.render()}},{key:"getHighlightTexts",value:function(){return this.sheet.data.highlighttxts}},{key:"addHighlightText",value:function(e,t,i,n){var r=this.sheet.data,a={row:e,col:t,start:i,end:n};r.highlighttxts.find((function(r){if(r.row===e&&r.col===t&&r.start===i&&r.end===n)return r}))||r.highlighttxts.push(a)}},{key:"removeHighlightText",value:function(e,t,i,n){for(var r=this.sheet.data,a=0;a<r.highlighttxts.length;a++){var o=Number.isInteger(i)?i:r.highlighttxts[a].start,s=Number.isInteger(n)?n:r.highlighttxts[a].end;r.highlighttxts[a].row===e&&r.highlighttxts[a].col===t&&r.highlighttxts[a].start===o&&r.highlighttxts[a].end===s&&r.highlighttxts.splice(a,1)}}},{key:"getHighlightRanges",value:function(){return this.sheet.data.highlightrg}},{key:"addHighlightRange",value:function(e,t,i,n){for(var r=this.sheet.data,a=new k(e,t,i,n),o=0;o<r.highlightrg.length;o++)if(r.highlightrg[o].contains(a))return;r.highlightrg.push(a)}},{key:"removeHighlightRange",value:function(e,t,i,n){for(var r=this.sheet.data,a=new k(e,t,i,n),o=0;o<r.highlightrg.length;o++)r.highlightrg[o].equals(a)&&r.highlightrg.splice(o,1)}},{key:"setHighlightInverseRange",value:function(e,t,i,n){this.sheet.data.highlightIR=new k(e,t,i,n)}},{key:"getHighlightInverseRange",value:function(){return this.sheet.data.highlightIR}},{key:"removeHighlightInverseRange",value:function(){delete this.sheet.data.highlightIR}},{key:"getCanvasImgByid",value:function(e,t){return e.getObjects().find((function(e){return e.id===t}))}},{key:"highlightAllImg",value:function(e,t){var i=this.sheet,n=i.data,r=(i.canvas,n.shapes),a=n.images;if(r){var o,s=Xa(r);try{for(s.s();!(o=s.n()).done;){var l=o.value;this.highlightImg(e,l,n.highlightstyle)}}catch(e){s.e(e)}finally{s.f()}}if(a){var c,h=Xa(a);try{for(h.s();!(c=h.n()).done;){var u=c.value;this.highlightImg(e,u,n.highlightstyle)}}catch(e){h.e(e)}finally{h.f()}}t.requestRenderAll()}},{key:"showHighlightImageShapesAuto",value:function(e){var t,i=this,n=this.sheet,r=n.data,a=n.canvas.fabric,o=Xa(r.highlighshapes);try{var s=function(){var n=t.value,a=r.shapes.find((function(e){return e.id===n}));a&&i.highlightImg(e,a,r.highlightstyle)};for(o.s();!(t=o.n()).done;)s()}catch(e){o.e(e)}finally{o.f()}var l,c=Xa(r.highlighimgs);try{var h=function(){var t=l.value,n=r.images.find((function(e){return e.id===t}));n&&i.highlightImg(e,n,r.highlightstyle)};for(c.s();!(l=c.n()).done;)h()}catch(e){c.e(e)}finally{c.f()}a.requestRenderAll()}},{key:"highlightImg",value:function(e,t,i){var n=this.sheet;n.data,n.canvas;if(t)if("TextBox"!==t.type)if(this.highlightImgFunc)t.setCustomHighlight(e,this.highlightImgFunc);else{var r=!!e&&new fabric.Image.filters.Invert;t.setFilter(r)}else t.setHighlight(e,i)}},{key:"getHighlightShaps",value:function(){return this.sheet.data.highlighshapes}},{key:"addHighlightShape",value:function(e){var t=this.sheet,i=t.data,n=t.canvas;if(-1===i.highlighshapes.indexOf(e)){var r=i.shapes.find((function(t){return t.id===e}));if(r){var a=n.fabric;i.highlighshapes.push(e),this.highlightImg(i.showhighlight,r,i.highlightstyle),i.showhighlight&&a.requestRenderAll()}}}},{key:"removeHighlightShape",value:function(e){var t=this.sheet,i=t.data,n=t.canvas.fabric,r=i.highlighshapes.indexOf(e);if(r>-1){i.highlighshapes.splice(r,1);var a=i.shapes.find((function(t){return t.id===e}));a&&(this.highlightImg(!1,a),n.requestRenderAll())}}},{key:"getHighlightImages",value:function(){return this.sheet.data.highlighimgs}},{key:"addHighlightImage",value:function(e){var t=this.sheet,i=t.data,n=t.canvas;if(-1===i.highlighimgs.indexOf(e)){var r=i.images.find((function(t){return t.id===e}));if(r){var a=n.fabric;i.highlighimgs.push(e),i.showhighlight&&(this.highlightImg(!0,r),a.requestRenderAll())}}}},{key:"removeHighlightImage",value:function(e){var t=this.sheet,i=t.data,n=t.canvas.fabric,r=i.highlighimgs.indexOf(e);if(r>-1){i.highlighimgs.splice(r,1);var a=i.images.find((function(t){return t.id===e}));a&&(this.highlightImg(!1,a),n.requestRenderAll())}}},{key:"setHighlightAll",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.sheet,n=i.data,r=i.canvas,a=i.table;if(n.showhighlight){var o=r.fabric;n.highlightall=e,this.highlightAllImg(e,o),e||this.showHighlightImageShapesAuto(!0)}t&&a.render()}}]),e}();function Ya(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Va=function(e){ee()(i,e);var t=Ya(i);function i(){var e;l()(this,i);var n=new Mr(new Ir("400px",""),{required:!0},"".concat(U("download.fileName"),":"),100),r=new Mr(new Pr("Original",["Original","XLSX","PDF","HTML"],"100%",(function(e){return U("download.saveTypes.".concat(e))}),(function(t){var i=e.fileNameField.val();e.fileNameField.val(e.setSuffix(i,t)),e.fileNameField.validate()})),{required:!0},"".concat(U("download.saveType"),":"),100);return e=t.call(this,U("contextmenu.download"),[f("div","".concat(ae,"-form-fields")).children(n.el),f("div","".concat(ae,"-form-fields")).children(r.el),f("div","".concat(ae,"-buttons")).children(new vi("ok","primary").on("click",(function(){return e.btnClick("ok")})),new vi("cancel").on("click",(function(){return e.btnClick("cancel")})))]),xe()(qn()(e),"defaultSuffix","xlsx"),e.fileNameField=n,e.saveTypeField=r,e.ci=null,e.values=[],e.change=function(){},e}return o()(i,[{key:"setSuffix",value:function(e,t){var i;return"Original"===t&&(t=this.originalType),e=(e=""===(null!==(i=e)&&void 0!==i?i:"")?this.originalFileName:e).includes(".")?e:e+"."+this.defaultSuffix,"".concat(e.substr(0,e.lastIndexOf(".")),".").concat(t.toLowerCase())}},{key:"btnClick",value:function(e){if("ok"===e){if(!this.fileNameField.validate())return;var t=this.saveTypeField.val(),i=this.fileNameField.val();i=this.setSuffix(i,t),this.change("ok",i,t)}this.hide()}},{key:"setValue",value:function(e){this.originalFileName=""===(null!=e?e:"")?"worksheet.xlsx":e,this.originalType=e.split(".").length>=2?e.substr(e.lastIndexOf(".")+1):this.defaultSuffix,this.fileNameField.val(this.originalFileName),this.show()}}]),i}(Rr);function Ga(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Za=function(e){ee()(i,e);var t=Ga(i);function i(){var e;l()(this,i);var n=new Mr(new Ir("100%",""),{required:!0},"".concat(U("link.emailAddress"),":"),100),r=new Mr(new Ir("100%",""),{required:!0},"".concat(U("link.emailSubject"),":"),100),a=f("div","".concat(ae,"-form-fields")).children(f("div","".concat(ae,"-form-fields")).children(n.el),f("div","".concat(ae,"-form-fields")).children(r.el));a.hide();var o=new Mr(new Ir("100%",""),{required:!0},"".concat(U("link.sheetCell"),":"),100),s=new Mr(new Pr("",[""],"max-content",(function(e){return e}),(function(e){})),{required:!0},"".concat(U("link.sheetPage"),":"),100);s.input.el.css("width","max-content");var c=f("div","".concat(ae,"-form-fields")).children(f("div","".concat(ae,"-form-fields")).children(o.el),f("div","".concat(ae,"-form-fields")).children(s.el));c.hide();var h=new Mr(new Ir("100%",""),{required:!0},"".concat(U("link.webUrl"),":"),100),u=f("div","".concat(ae,"-form-fields")).children(h.el);u.hide();var d=new Mr(new Pr("web",["web","sheet","email"],"max-content",(function(e){return U("link.linkTypes.".concat(e))}),(function(t){switch(u.hide(),c.hide(),a.hide(),t){case"web":u.show(),e.active="web";break;case"sheet":c.show(),e.active="sheet";break;case"email":a.show(),e.active="email"}})),{required:!0},"".concat(U("link.linkType"),":"),100);return e=t.call(this,U("contextmenu.link"),[f("div","".concat(ae,"-form-fields")).children(d.el),f("div","".concat(ae,"-form-fields")).children(a.el,u.el,c.el),f("br"),f("br"),f("div","".concat(ae,"-buttons")).children(new vi("ok","primary").on("click",(function(){return e.btnClick("ok")})),new vi("cancel").on("click",(function(){return e.btnClick("cancel")})))]),xe()(qn()(e),"active",void 0),e.ci=null,e.values=[],e.sheetPageField=s,e.sheetField=c,e.webField=u,e.emailField=a,e.sheetCellField=o,e.webUrlField=h,e.emailAddressField=n,e.emailSubjectField=r,e.linkTypeField=d,e.change=function(){},e.el.on("click",(function(e){e.preventDefault()})),e}return o()(i,[{key:"btnClick",value:function(e){var t=this.link,i=this.type;if("ok"===e){switch(this.active){case"web":if(!this.webUrlField.validate())return;if(!this.isValidHttpUrl(this.webUrlField.val()))return void this.webUrlField.validateFail("Missing address network protocols such as http:// or https://");t.type=0,t.address=this.webUrlField.val();break;case"sheet":if(!this.sheetCellField.validate())return;t.type=3,t.address="".concat(this.sheetPageField.val(),"!").concat(this.sheetCellField.val());break;case"email":t.type=2,t.address="mailto:".concat(this.emailAddressField.val(),"?subject=").concat(this.emailSubjectField.val())}this.change("ok",t,i)}this.hide()}},{key:"clear",value:function(){this.sheetField.hide(),this.sheetPageField.val(this.sheets[0]),this.sheetCellField.val("A1"),this.webField.hide(),this.webUrlField.val(""),this.webUrlField.validateClear(),this.emailField.hide(),this.emailSubjectField.val(""),this.emailAddressField.val("")}},{key:"isValidHttpUrl",value:function(e){var t;try{t=new URL(e)}catch(e){return!1}return"http:"===t.protocol||"https:"===t.protocol}},{key:"setValue",value:function(e,t,i){var n;if(this.type=i,this.sheets=e,this.link=t,this.clear(),this.sheetPageField.input.suggest.setItems(e.map((function(e){return{key:e,title:e}}))),""!==(null!==(n=null==t?void 0:t.type)&&void 0!==n?n:""))switch(t.type){case 1:case 0:this.webUrlField.input.val(t.address),this.linkTypeField.val("web"),this.webField.show(),this.active="web";break;case 2:var r=/mailto:([^\?]*)\?subject\=(.*)/.exec(t.address);this.emailSubjectField.val(r[2]),this.emailAddressField.val(r[1]),this.linkTypeField.val("email"),this.emailField.show(),this.active="email";break;case 3:var a=t.address.split("!");if(2!==a.length)break;this.sheetPageField.val(a[0]),this.sheetCellField.val(a[1]),this.linkTypeField.val("sheet"),this.sheetField.show(),this.active="sheet"}else this.linkTypeField.val("web"),this.webField.show(),this.active="web";this.show()}}]),i}(Rr),Ka=function(){function e(t){l()(this,e),this.el=f("div","".concat(ae,t?"-banner-icon-s":"-banner-icon"))}return o()(e,[{key:"setHomeIcon",value:function(e,t){this.el.css({"background-image":"url(".concat(e,")"),"background-size":"contain","background-position":"center"});var i=f("a");i.attr("href",t),i.css({display:"block",height:"100%",width:"100%","text-decoration":"none"}),this.el.child(i)}}]),e}(),Ja=function(){function e(t){var i=this;l()(this,e),this.el=f("div","".concat(ae,"-banner-filename")),this.filename=f("div","".concat(ae,"-banner-filename-name")),this.filename.on("blur",(function(e){e.target.innerHTML=e.target.innerHTML.replace(/<[^>]+>/gi,"");var n=e.target.innerText;n=n.replace(/\r?\n|\r/g,""),t.filename=n+i.suffixStr,setTimeout((function(){t.selector.el.show()}),100)})),this.filename.on("focus",(function(e){window.mobileEditOnCell=!1,t.editor.el.hide()})),this.filename.on("keyup",(function(e){13===e.keyCode&&i.filename.el.blur()})),this.filename.attr("contenteditable",!0),this.filename.attr("spellcheck",!1),this.suffix=f("div"),this.el.children(this.filename,this.suffix)}return o()(e,[{key:"setValue",value:function(e){if(e.includes(".")){var t=e.substring(0,e.lastIndexOf(".")),i=this.suffixStr=e.substring(e.lastIndexOf("."));this.filename.html(t),this.suffix.html(i)}}}]),e}(),$a=function(){function e(t,i,n,r,a,o,s){var c=this;l()(this,e),this.data=t;t.defaultStyle();this.change=function(){},this.widthFn=i,this.isHide=n,this.icon=new Ka(!a),this.filenamebar=new Ja(o),this.menubar=new Na(t,i,n,r,s),this.el=f("div");var h=f("div","".concat(ae,"-banner"));n&&!r?(this.el.hide(),this.notShow=!0):(h.children(this.icon.el,f("div","".concat(ae,a?"-banner-info":"-banner-info-s")).children(this.filenamebar.el,this.menubar.el)),this.el.child(h)),a||this.filenamebar.el.hide(),this.menubar.change=function(){c.change.apply(c,arguments)}}return o()(e,[{key:"show",value:function(){this.notShow||this.el.show()}},{key:"hide",value:function(){this.el.hide()}},{key:"hideDropdown",value:function(){this.menubar.hideDropdown()}},{key:"setFileName",value:function(e){this.filenamebar.setValue(e)}}]),e}();function Qa(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function eo(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Qa(Object(i),!0).forEach((function(t){xe()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Qa(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function to(e,t){var i,n=this;return function(){for(var r=n,a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];var l=o;i||(i=setTimeout((function(){i=null,e.apply(r,l)}),t))}}function io(){var e=this.data,t=this.verticalScrollbar,i=this.horizontalScrollbar,n=e.getSelectedRect(),r=n.l,a=n.t,o=n.left,s=n.top,l=n.width,c=n.height,h=this.getTableOffset();if(Math.abs(o)+l>h.width)i.move({left:r+l-h.width});else{var u=e.freezeTotalWidth();o<u&&i.move({left:r-1-u})}if(Math.abs(s)+c>h.height)t.move({top:a+c-h.height-1});else{var f=e.freezeTotalHeight();s<f&&t.move({top:a-1-f})}}function no(){var e=this.data,t=this.verticalScrollbar,i=this.horizontalScrollbar,n=e.getSelectedRectBySearch(),r=n.l,a=n.t;i.move({left:r-1}),t.move({top:a-1})}function ro(e,t,i){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(-1!==t||-1!==i){var a=this.table,o=this.selector,s=this.toolbar,l=this.formulaBar,c=this.data,h=this.contextMenu;if(h.setMode(-1===t||-1===i?"row-col":"range"),c.canSelected(t,i)){var u=c.getCell(t,i);e?(o.setEnd(t,i,r),this.trigger("cells-selected",u,o.range)):(o.set(t,i,n),this.trigger("cell-selected",u,t,i)),this.focusing=!0,o.setObjId(null),s.reset(),l.reset(),a.render()}}}function ao(e,t){var i=this.selector,n=this.data,a=n.rows,o=n.cols,s=r()(i.indexes,2),l=s[0],c=s[1],h=i.range,u=h.eri,f=h.eci;if(e){var d=r()(i.moveIndexes,2);l=d[0],c=d[1]}"left"===t?c>0&&(c-=1):"right"===t?(f!==c&&(c=f),c<o.len-1&&(c+=1)):"up"===t?l>0&&(l-=1):"down"===t?(u!==l&&(l=u),l<a.len-1&&(l+=1)):"row-first"===t?c=0:"row-last"===t?c=o.len-1:"col-first"===t?l=0:"col-last"===t&&(l=a.len-1),e&&(i.moveIndexes=[l,c]),ro.call(this,e,l,c),io.call(this)}function oo(e){if(0===e.buttons&&e.target.className!=="".concat(ae,"-resizer-hover")){var t=e.offsetX,i=e.offsetY,n=this.rowResizer,r=this.colResizer,a=this.tableEl,o=this.data,s=o.rows,l=o.cols,c=o.displayRight2Left,h=o.settings.row.height;if(t>l.indexWidth&&i>h)return n.hide(),void r.hide();var u=a.box(),f=o.getCellRectByXY(e.offsetX/o.zoomlevel,e.offsetY/o.zoomlevel);f.ri>=0&&-1===f.ci?(f.width=l.indexWidth*o.zoomlevel,n.show(f,{width:u.width}),s.isHide(f.ri-1)?n.showUnhide(f.ri):n.hideUnhide()):n.hide(),-1===f.ri&&f.ci>=0?(f.height=h*o.zoomlevel,f.top=0,r.show(f,{height:u.height},c),l.isHide(f.ci-1)?r.showUnhide(f.ci):r.hideUnhide()):r.hide()}}function so(e){var t=this.verticalScrollbar,i=this.horizontalScrollbar,n=this.data,r=t.scroll().top,a=i.scroll().left,o=n.rows,s=n.cols,l=e.deltaY,c=e.deltaX,h=function(e,t){var i=e,n=0;do{n=t(i),i+=1}while(n<=0);return n},u=function(e){if(e>0){var i=n.scroll.ri+1;if(i<o.len){var a=h(i,(function(e){return o.getHeight(e)}));t.move({top:r+a-1})}}else{var s=n.scroll.ri-1;if(s>=0){var l=h(s,(function(e){return o.getHeight(e)}));t.move({top:0===s?0:r-l})}}},f=Math.abs(l),d=Math.abs(c),m=Math.max(f,d);/Firefox/i.test(window.navigator.userAgent)&&to(u(e.detail),50),m===d&&to(function(e){if(e>0){var t=n.scroll.ci+1;if(t<s.len){var r=h(t,(function(e){return s.getWidth(e)}));i.move({left:a+r-1})}}else{var o=n.scroll.ci-1;if(o>=0){var l=h(o,(function(e){return s.getWidth(e)}));i.move({left:0===o?0:a-l})}}}(c),50),m===f&&to(u(l),50)}function lo(){var e=this.data,t=this.verticalScrollbar,i=(1!==e.zoomlevel?this.originTableOffset:this.getTableOffset()).height,n=e.exceptRowTotalHeight(0,-1);t.set(i,(e.rows.totalHeight()-n)*e.zoomlevel)}function co(){var e=this.data,t=this.horizontalScrollbar,i=(1!==e.zoomlevel?this.originTableOffset:this.getTableOffset()).width;e&&t.set(i,e.cols.totalWidth()*e.zoomlevel),e.displayRight2Left?t.el.attr("dir","rtl"):t.el.removeAttr("dir")}function ho(){var e=this.selector,t=this.data,i=this.editor,n=this.canvas,a=r()(t.freeze,2),o=a[0],s=a[1];if(o>0||s>0){var l=t.freezeTotalWidth(),c=t.freezeTotalHeight();i.setFreezeLengths(l,c)}else i.setFreezeLengths(0,0);n.resetFreeze(t),e.resetAreaOffset()}function uo(){var e=this.tableEl,t=this.overlayerEl,i=this.overlayerCEl,n=this.table,r=this.toolbar,a=this.formulaBar,o=this.selector,s=this.hyperlink,l=this.el;this.originTableOffset||(this.originTableOffset=this.getTableOffset()),1!==this.data.zoomlevel&&(o.br.useHideInput=!1);var c=this.getTableOffset(),h=this.getRect();e.attr(h),t.offset(h);var u=this.data.zoomlevel;i.offset(eo(eo({},c),{},{width:c.width/u,height:c.height/u})),l.css("width","".concat(h.width,"px")),lo.call(this),co.call(this),ho.call(this),n.render(),r.reset(),a.reset(),o.reset(),s.loadLinkPosition(this),1!==this.data.zoomlevel&&(o.br.useHideInput=!0)}function fo(){var e=this.data,t=this.selector;e.clearClipboard(),t.hideClipboard()}function mo(){var e=this.data,t=this.selector,i=this.canvas;e.copy(),t.showClipboard(),i.clipboard=null}function go(){var e=this.data,t=this.selector;e.cut(),t.showClipboard()}function vo(e,t){var i=this.data;if("read"!==i.settings.mode&&!i.getLocked())if(i.paste(e,(function(e){return le("Tip",e)})))uo.call(this);else if(t&&null==i.clipboard.range){var n=t.clipboardData.getData("text/plain");n.length>0&&(this.data.pasteFromText(n),uo.call(this))}}function po(){this.data.hideRowsOrCols(),uo.call(this)}function yo(e,t){this.data.unhideRowsOrCols(e,t),uo.call(this)}function bo(){this.data.autofilter(),uo.call(this)}function wo(){var e=document.createElement("div");e.id="aspose_mask_bg",e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.width="100%",e.style.height="100%",e.style.backgroundColor="#777",e.style.opacity=.6,e.style.zIndex=10001,document.body.appendChild(e);var t=document.createElement("div");t.style.position="absolute",t.style.top="33%",t.style.left="40%",t.style.backgroundColor="white",t.style.border="#336699 1px solid",t.style.textAlign="center",t.style.fontSize="medium",t.style.padding="1.5em 4em 1.5em 4em",t.innerText="updating , please wait...",e.appendChild(t)}function xo(){var e=document.getElementById("aspose_mask_bg");null!=e&&e.parentNode.removeChild(e)}function ko(e,t){return Co.apply(this,arguments)}function Co(){return(Co=be()(Ce.a.mark((function e(t,i){var n,r,a,o,s,l;return Ce.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.data,r={sheetname:n.name,actrow:n.selector.ri,actcol:n.selector.ci,datas:xs.getUpdateDatas()},a={p:JSON.stringify(r),uid:this.uniqueid,file:t,outputType:i},o=this.fileDownloadUrl,s=new FormData,Object.keys(a).forEach((function(e){return s.set(e,a[e])})),wo(),e.next=9,fetch(o,{method:"POST",body:s});case 9:if((l=e.sent).ok){e.next=15;break}xo(),alert("Download failed, please try again"),e.next=22;break;case 15:return e.t0=Uo,e.next=18,l.json();case 18:e.t1=e.sent,e.t2=t,(0,e.t0)(e.t1,e.t2),xo();case 22:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function So(){var e=this.toolbar;e.paintformatActive()&&(vo.call(this,"format"),fo.call(this),e.paintformatToggle())}function _o(){var e=this.editor,t=this.contextMenu,i=this.commentTip,n=this.commentEditable;e.clear(),t.hide(),i.hide(),n.saveAndHide(this)}function To(e){var t=this,i=this.selector,n=this.data,a=this.table,o=this.sortFilter,s=this.hyperlink,l=e.offsetX,c=e.offsetY,h=e.target.className==="".concat(ae,"-selector-corner"),u=a.zoomlevel,f=n.getCellRectByXY(l/u,c/u),d=f.left,m=f.top,g=f.width,v=f.height,p=n.viewHeight(),y=n.viewWidth(),b=f.ri,w=f.ci;if(!(b<-1||w<-1)){var x=n.autoFilter,k=n.TableAutoFilters;if(x.includes(b,w)&&d+g-20*u<l&&m+v-20*u<c){var C=x.items(w,(function(e,t){return n.rows.getCell(e,t)}));return o.set(w,C,x.getFilter(w),x.getSort(w)),o.setOffsetAdjustView({left:d,top:m+v+2},y,p),void(n.currentAutoFilter=x)}for(var S=0,_=k.length;S<_;S++){var T=k[S];if(T.includes(b,w)&&d+g-20*u<l&&m+v-20*u<c){var O=T.items(w,(function(e,t){return n.rows.getCell(e,t)}));return o.set(w,O,T.getFilter(w),T.getSort(w)),o.setOffsetAdjustView({left:d,top:m+v+2},y,p),void(n.currentAutoFilter=T)}}if(!e.shiftKey){if(h){if(window.mobileAndTabletCheck())return;i.showAutofill(b,w)}else if(ro.call(this,!1,b,w),!e.ctrlKey&&2!==e.button){var E,R=null!==(E=s.checkAndAccess(n,b,w))&&void 0!==E?E:[w,b],I=r()(R,2);w=I[0],b=I[1]}window.mobileAndTabletCheck()||Ie(window,(function(e){var r=n.getCellRectByXY(e.offsetX/u,e.offsetY/u);if(b=r.ri,w=r.ci,h){if(window.mobileAndTabletCheck())return;i.showAutofill(b,w)}else 1!==e.buttons||e.shiftKey||ro.call(t,!0,b,w,!0,!0)}),(function(){n.getLocked()||(h&&i.arange&&"read"!==n.settings.mode&&n.autofill(i.arange,"all",(function(e){return le("Tip",e)}))&&a.render(),i.hideAutofill(),So.call(t))}))}h||1!==e.buttons||e.shiftKey&&ro.call(this,!0,b,w)}}function Oo(){var e=this.data.getSelectedRect();Eo.call(this,e)}function Eo(e){var t=this.editor,i=this.getTableOffset(),n="top";e.top>i.height/2&&(n="bottom"),t.setOffset(e,n)}function Ro(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.table,i=this.editor,n=this.data;"read"!==n.settings.mode&&(n.getLocked()||(Oo.call(this),t.clearSelectRender(),i.setCell(n.getSelectedCell(),n.getSelectedValidator(),e),fo.call(this)))}function Io(e){this.table;var t=this.editor,i=this.data;if("read"!==i.settings.mode&&!i.getLocked()){var n=i.getRectForTextbox(e);Eo.call(this,n),t.setForTextBox(e),fo.call(this)}}function Ao(){var e=this.formulaBar,t=this.data;e.resetData(t)}function Do(e){var t=this,i=this.data,n=this.table,r=this.selector,a=this.hyperlink;i.scrolly(e,(function(){1!==t.data.zoomlevel&&(r.br.useHideInput=!1),r.resetBRLAreaOffset(),Oo.call(t),n.render(),a.loadLinkPosition(t),i.scrollImagesShapes(),1!==t.data.zoomlevel&&(r.br.useHideInput=!0)}))}function Po(e){var t=this,i=this.data,n=this.table,r=this.selector,a=this.hyperlink;i.scrollx(e,(function(){1!==t.data.zoomlevel&&(r.br.useHideInput=!1),r.resetBRTAreaOffset(),Oo.call(t),n.render(),a.loadLinkPosition(t),i.scrollImagesShapes(),1!==t.data.zoomlevel&&(r.br.useHideInput=!0)}))}function Fo(e,t){var i=e.ri,n=this.table,r=this.selector,a=this.data,o=this.hyperlink,s=a.rows.getHeight(i);a.rows.setHeight(i,t),a.updateRowsHeight.add(i),a.updateConditionImagePositionForRow(i,t-s,t),n.render(),1!==this.data.zoomlevel&&(r.br.useHideInput=!1),r.resetAreaOffset(),o.loadLinkPosition(this),lo.call(this),Oo.call(this),1!==this.data.zoomlevel&&(r.br.useHideInput=!0)}function Mo(e,t){var i=e.ci,n=this.table,r=this.selector,a=this.data,o=this.hyperlink,s=a.cols.getWidth(i);a.cols.setWidth(i,t),a.updateCols.add(i),a.updateConditionImagePositionForCol(i,t-s,t),n.render(),1!==this.data.zoomlevel&&(r.br.useHideInput=!1),r.resetAreaOffset(),o.loadLinkPosition(this),co.call(this),Oo.call(this),1!==this.data.zoomlevel&&(r.br.useHideInput=!0)}function Lo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"finished",i=this.data,n=this.table;if("read"!==i.settings.mode&&!i.getLocked()){i.setSelectedCellText(e,t);var r=i.selector,a=r.ri,o=r.ci;if("finished"===t){if("server"===i.settings.updateMode)return;n.render()}else this.trigger("cell-edited",e,a,o)}}function jo(e){var t=this.data;"insert-row"===e?t.insert("row"):"delete-row"===e?t.delete("row"):"insert-column"===e?t.insert("column"):"delete-column"===e?t.delete("column"):"delete-cell"===e?t.deleteCell():"delete-cell-format"===e?t.deleteCell("format"):"delete-cell-text"===e?t.deleteCell("text"):"cell-printable"===e?t.setSelectedCellAttr("printable",!0):"cell-non-printable"===e?t.setSelectedCellAttr("printable",!1):"cell-editable"===e?t.setSelectedCellAttr("editable",!0):"cell-non-editable"===e&&t.setSelectedCellAttr("editable",!1),fo.call(this),uo.call(this)}function zo(e){for(var t=e,i=0,n=0;null!==t;)i+=t.offsetTop,n+=t.offsetLeft,t=t.offsetParent;return{top:i,left:n}}function Bo(e,t,i){var n=this.data,r=this.modalSort,a=this.modalDownload,o=this.modalLink,s=this.modalSearch,l=this.commentEditable,c=this.modalInsertURLImage,h=(this.overlayerCEl,this.canvas,this.filename),u=this.toolbar;function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Device",i=this.filename;"Original"!==e&&(i="".concat(i.substr(0,i.lastIndexOf(".")),".").concat(e.toLowerCase())),"function"!=typeof this.fileDownloadCallFunc?ko.call(this,i,e):this.fileDownloadCallFunc(i,e,t)}if(window.mobileAndTabletCheck()&&u.moreEl.el.hasClass("active")&&u.moreEl.dd.hide(),"undo"===e)this.undo();else if("redo"===e)this.redo();else if("print"===e)this.print.preview(),this.print.toPrint();else if("paintformat"===e)!0===t?mo.call(this):fo.call(this);else if("clearformat"===e)jo.call(this,"delete-cell-format");else if("chart"===e);else if("autofilter"===e)bo.call(this);else if("freeze"===e)if(t){var d=n.selector,m=d.ri,g=d.ci;this.freeze(m,g)}else this.freeze(0,0);else if("sort"===e)r.setValue(n.getSelectedSort());else if("download"===e)a.setValue(h);else if("download_HTML"===e)f.call(this,"HTML");else if("download_Original"===e)f.call(this,"Original");else if("download_XLSX"===e)f.call(this,"XLSX");else if("download_PDF"===e)f.call(this,"PDF");else if("download_GOOGLE"===e)f.call(this,"Original","GoogleDrive");else if("download_DROPBOX"===e)f.call(this,"Original","Dropbox");else if("search"===e)s.show();else if("menu-display-hide"===e)"up"===this.toolbar.menuDisplay.state?(this.toolbar.menuDisplay.setDown(),this.menubar.hide(),this.table.render()):(this.toolbar.menuDisplay.setUp(),this.menubar.show(),this.table.render());else if("insertComment"===e&&"commentEdit"===t||"insertComment"===e||"commentEdit"===e){var v=n.selector,p=v.ri,y=v.ci,b="";if(void 0!==n.comments)for(var w=0;w<n.comments.length;w++){var x=n.comments[w];x.row===p&&x.col===y&&(b=x.note)}var k=n.cellRectWithOutTransfer(p,y);l.col=y,l.row=p,l.setPosition(b,k,n.displayRight2Left),this.commentTip.onEdit=!0,"comments"===n.search.lookin&&(n.search.result=null)}else if("insertComment"===e&&"commentRemove"===t||"commentRemove"===e){var C=n.selector,S=C.ri,_=C.ci;if(void 0!==n.comments)for(var T=0;T<n.comments.length;T++)n.comments[T].col===_&&n.comments[T].row===S&&n.comments.splice(T,1);"comments"===n.search.lookin&&(n.search.result=null),this.table.render()}else if("insertComment"===e&&"commentPrevious"===t||"commentPrevious"===e)Ho(this,n,"previous");else if("insertComment"===e&&"commentNext"===t||"commentNext"===e)Ho(this,n,"next");else if("insert-image"===e)"url"===t&&c.show();else if("zoom-size"===e)this.setzoom(t.number);else if("insertSheet"===e)this.addSheet();else if("insertRow"===e)jo.call(this,"insert-row");else if("insertColumn"===e)jo.call(this,"insert-column");else if("link"===e){if(this.canvas.isImageOnSelected())return void this.canvas.link(this.data);var O=this.selector.range,E=this.hyperlink.getSelectArea(O),R=this.hyperlink.findByArea(this.data,E),I="edit";if(!R){(R={}).area=E;var A=this.data.getCell(O.sri,O.sci);R.text=A?A.text:"",I="add"}o.setValue(xs.datas.map((function(e){return e.name})),R,I)}else n.setSelectedCellAttr(e,t),"formula"!==e||n.selector.multiple()||Ro.call(this),uo.call(this);i&&i()}function Ho(e,t,i){var n=e.selector,r=e.commentEditable,a=t.selector,o=a.ri,s=a.ci,l=o,c=s,h="";if(void 0!==t.comments){t.comments.sort((function(e,t){return e.row>t.row||e.row===t.row&&e.col>t.col?1:-1}));for(var u=0;u<t.comments.length;u++){var f=t.comments[u];if("previous"===i)(f.row<o||f.row===o&&f.col<s)&&(l=f.row,c=f.col,h=f.note);else if("next"===i&&(f.row>o||f.row===o&&f.col>s)){l=f.row,c=f.col,h=f.note;break}}}if(n.set(l,c),""!==h){var d=t.cellRectWithOutTransfer(l,c);r.col=c,r.row=l,r.onEdit=!1,r.setPosition(h,d)}}function No(e,t,i,n){this.data.setAutoFilter(e,t,i,n),uo.call(this),this.data.updateConditionImageVisible()}function Uo(e,t){var i=new XMLHttpRequest;i.open("get",e,!0),i.responseType="blob",i.onload=function(){if(200===this.status){var e=this.response;Xo.call(this,e,t)}else alert("Download failed, please try again")},i.send()}function Xo(e,t){var i=document.createElement("a"),n=e;"string"==typeof e?i.target="_blank":n=window.URL.createObjectURL(e),i.href=n,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),"string"!=typeof e&&window.URL.revokeObjectURL(n)}function Wo(e){var t=zo(e.target);return[e.changedTouches[0].pageX-t.left,e.changedTouches[0].pageY-t.top]}function qo(){var e=this,t=this.selector,i=this.overlayerEl,n=this.rowResizer,a=this.colResizer,o=this.verticalScrollbar,s=this.horizontalScrollbar,l=this.editor,c=this.contextMenu,h=this.commentTip,u=this.commentEditable,d=this.toolbar,m=this.menubar,g=this.formulaBar,v=this.modalValidation,p=this.modalSort,y=this.modalDownload,b=this.modalLink,w=(this.hyperlink,this.modalInsertURLImage),x=this.modalSearch,C=this.sortFilter,S=this.canvas,_=this.el;function T(e,t){_o.call(e),To.call(e,t)}if(window.mobileAndTabletCheck()||i.on("mousemove",(function(t){oo.call(e,t)})).on("mousedown",(function(t){_o.call(e),2===t.buttons?(e.data.xyInSelectedRect(t.offsetX,t.offsetY)||To.call(e,t),c.setPosition(t.offsetX,t.offsetY),t.stopPropagation()):2===t.detail?Ro.call(e):To.call(e,t)})).on("mousewheel.stop",(function(t){so.call(e,t)})).on("mouseout",(function(e){var t=e.offsetX;e.offsetY<=0&&a.hide(),t<=0&&n.hide()})),u.el.on("input",(function(t){if(1===e.commentEditable.el.el.childNodes.length&&"#text"===e.commentEditable.el.el.childNodes[0].nodeName){var i=f("font");i.attr("style","FONT-FAMILY: 宋体;FONT-SIZE: 9pt;COLOR: #000000;TEXT-ALIGN: left;"),i.child(document.createTextNode(e.commentEditable.el.el.textContent)),e.commentEditable.el.el.replaceChild(i.el,e.commentEditable.el.el.firstChild),t.target.focus();var n=window.getSelection();n.selectAllChildren(t.target),n.collapseToEnd()}})),t.inputChange=function(t){Lo.call(e,t,"input"),Ro.call(e),Ao.call(e)},g.inputChange=function(t){Lo.call(e,t,"input"),Ro.call(e,!1)},g.enter=function(t,i){if(t.altKey){l.insertTextNewLine(t);var n=i?t.target.innerHTML:t.target.innerText;Lo.call(e,n,"input"),Ro.call(e,!1)}else l.clear(),ao.call(e,!1,t.shiftKey?"up":"down"),e.focusing=!0;t.preventDefault()},g.tab=function(t){l.clear(),ao.call(e,!1,t.shiftKey?"left":"right"),e.focusing=!0,t.preventDefault()},g.focuson=function(){e.focusing=!1},Te(_.el,"mousemove",(function(t){h.hide();var i=t.offsetX,n=t.offsetY,r=e.data,a=e.table,o=e.hyperlink,s=e.canvas,l=r.comments,c=a.zoomlevel,u=r.getCellRectByXY(i/c,n/c);if(0!==r.hyperlinks.length){var f=o.getSelectArea({sci:u.ci,eci:u.ci,sri:u.ri,eri:u.ri});o.findByArea(r,f)?s.setCursor("pointer"):s.setCursor("")}u.ri>=0&&u.ci>=0&&l.forEach((function(e){u.ri===e.row&&u.ci===e.col&&h.setPosition(e.note,u,r.displayRight2Left)}))})),window.mobileAndTabletCheck()){var O,E=this,R=!1,I=!1,A=function(){return R&&I},D=this.getTableOffset(),P="",F=[0,0],M=[0,0],L=[0,0],j=[0,0],z=!1;E.table.zoomlevel;new AlloyFinger(this.el.el,{tap:function(e){},touchStart:function(e){if(!(e.target.parentElement&&"true"===e.target.parentElement.contentEditable||"true"===e.target.contentEditable)){!function(e,t){e.target.className.includes("item")||t.contextMenu.hide()}(e,E);var t=function(e,t){var i,n=e.target.className.includes("".concat(ae,"-selector-corner")),r=e.target.className.includes("tl")?"tl":"br",a=[],o=[],s=!1;return n&&(i=zo(e.target.offsetParent.offsetParent),a[0]=e.changedTouches[0].pageX,a[1]=e.changedTouches[0].pageY,o[0]=t.data.scroll.x,o[1]=t.data.scroll.y,s=!0),[r,i,a,o,s]}(e,E),i=r()(t,5);P=i[0],O=i[1],F=i[2],L=i[3],(R=i[4])&&(z=!1,console.info("#####touchStart ..that.data.scroll.y...... "+E.data.scroll.y+",startscroll[0]:"+L[0]),L[0]=E.data.scroll.x,L[1]=E.data.scroll.y,E.selector.setMobilestartOffsetAndRange())}},touchEnd:function(e){if(!(e.target.parentElement&&"true"===e.target.parentElement.contentEditable||"true"===e.target.contentEditable)&&A()){var i=M[0]-F[0]+E.data.scroll.x-L[0],n=M[1]-F[1]+E.data.scroll.y-L[1];t.setMobileMultipleSelect(i,n),function(e,t,i,n){if(t&&i){var r=e.br.areaEl.el.getBoundingClientRect(),a=r.right>window.screen.width?window.screen.width:r.right,o=r.top-i.top+n.top;o=o>window.screen.height?window.screen.height:o,c.setPosition(a,o)}}(t,!0,O,D);var a=(De(),[!1,!1,!1]),o=r()(a,3);R=o[0],I=o[1],z=o[2],E.table.render()}},doubleTap:function(e){if(!(e.target.parentElement&&"true"===e.target.parentElement.contentEditable||"true"===e.target.contentEditable)&&"CANVAS"===e.target.nodeName){var t=Wo(e),i=r()(t,2);e.offsetX=i[0],e.offsetY=i[1],window.mobileEditOnCell=!0,T(E,e),Ro.call(E)}},longTap:function(e){if(!(e.target.parentElement&&"true"===e.target.parentElement.contentEditable||"true"===e.target.contentEditable)){var t=Wo(e),i=r()(t,2),n=i[0],a=i[1];c.setPosition(n,a)}},singleTap:function(e){if(!(e.target.parentElement&&"true"===e.target.parentElement.contentEditable||"true"===e.target.contentEditable||"CANVAS"!==e.target.nodeName||function(e){return e.target.className.includes("item")}(e))){var i=Wo(e),n=r()(i,2);e.offsetX=n[0],e.offsetY=n[1],window.mobileEditOnCell=!0,T(E,e),t.br.useHideInput=!1,window.keyboardShow?(t.br.useHideInput=!0,Ro.call(E)):function(e,t){var i=Wo(e),n=r()(i,2),a=n[0],o=n[1];if(e.target.className.includes("".concat(ae,"-selector-corner"))){var s=zo(e.target);a=s.left,o=s.top}var l=a<=t.left&&o>=t.top,h=a>=t.left&&o<=t.top;if(l||h){var u=l?t.left:a,f=h?t.top:o;c.setPosition(u,f)}}(e,D)}},rotate:function(e){},pinch:function(e){if(!(e.target.parentElement&&"true"===e.target.parentElement.contentEditable||"true"===e.target.contentEditable)){E.editor.el.hide();var t=e.zoom;t>2&&(t=2),t<.5&&(t=.5),E.setzoom(t)}},pressMove:function(e){if(!(e.target.parentElement&&"true"===e.target.parentElement.contentEditable||"true"===e.target.contentEditable)){var t=E.selector;E.data;if(I=!0,A()){switch(function(e,t,i,n,r){e[0]=n.changedTouches[0].pageX,e[1]=n.changedTouches[0].pageY,t[0]=i.data.scroll.x,t[1]=i.data.scroll.y}(M,j,E,e),P){case"tl":break;case"br":var i=M[0]-F[0],n=M[1]-F[1];t.setEndMobile(i,n);var a=t.getMobileMultipleSelect(i,n),o=r()(a,2),s=o[0],l=o[1];s>=E.data.viewRange().eri-4&&!z&&(z=!0,t.setEnd(s,l),function(e,t){""!==e?Pe(t):De()}("down",E))}}else Math.abs(e.deltaX)>Math.abs(e.deltaY)?Math.abs(e.deltaX)>18&&(E.scrollH(e.deltaX),E.table.render()):Math.abs(e.deltaY)>18&&(E.scrollV(e.deltaY),E.table.render())}},swipe:function(e){}})}d.change=function(t,i){return Bo.call(e,t,i)},m.change=function(t,i){return Bo.call(e,t,i,(function(){return m.hideDropdown()}))},C.ok=function(t,i,n,r){return No.call(e,t,i,n,r)},n.finishedFn=function(t,i){Fo.call(e,t,i)},a.finishedFn=function(t,i){Mo.call(e,t,i)},n.unhideFn=function(t){yo.call(e,"row",t)},a.unhideFn=function(t){yo.call(e,"col",t)},o.moveFn=function(t,i){Do.call(e,t,i)},s.moveFn=function(t,i){Po.call(e,t,i)},l.change=function(t,i){Lo.call(e,i,t),Ao.call(e)},l.textboxChange=function(t,i){var n=e.data;e.table;n.updateTextbox(t,i)},v.change=function(t){if("save"===t){for(var i,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];(i=e.data).addValidation.apply(i,r)}else e.data.removeValidation()},p.change=function(t,i,n,r){"ok"===t&&e.data.doSort(i,n,r)},y.change=function(t,i,n){"ok"===t&&ko.call(e,i,n)},b.change=function(t,i,n){"ok"===t&&(e.canvas.isImageOnSelected()?e.canvas.setHyperlink(i):"add"===n&&(e.data.hyperlinks=e.data.hyperlinks.filter((function(e){return!k.valueOf(i.area).contains(k.valueOf(e.area))})),e.data.hyperlinks.push(i),e.hyperlink.setHyperlinkStyleByArea(i.area,e,!0),e.hyperlink.loadLinkPosition(e)))},w.change=function(t,i){var n=e.canvas,r=e;if("ok"===t){var a=r.data.getSelectedRect();n.setLoading(r,{top:a.top,left:a.left});var o={ri:e.data.selector.ri,ci:e.data.selector.ci,name:e.data.name},s={p:JSON.stringify(o),uid:r.uniqueid,imageurl:i};$.ajax({url:r.imageUploadByUrlUrl,type:"post",data:s,success:function(e,t,i){(e=JSON.parse(e)).Error?le("error",e.Error):n.doInsertURLImage(e,r)}})}},$("#upload-image").on("change",(function(t){var i=e.canvas,n=e,r=new FormData;r.append("uid",n.uniqueid);var a={ri:e.data.selector.ri,ci:e.data.selector.ci,name:e.data.name};r.append("p",JSON.stringify(a)),r.append("image",t.target.files[0]);var o=n.data.getSelectedRect();i.setLoading(n,{top:o.top,left:o.left}),$.ajax({url:n.imageUploadByLocalUrl,type:"post",processData:!1,contentType:!1,data:r,success:function(e,r,a){(e=JSON.parse(e)).Error?le("error",e.Error):i.doInsertImage(e,n),t.target.value=null}})})),x.change=function(i,n,r,a,o){if("close"!==i){r||(n=n.toUpperCase());var s=e.data,l=s.search,c=s.rows,h=s.comments,f=l.keywords,d=[];if(null!=l.result&&f===n&&l.iscasesense===r&&l.lookin===a&&l.matchwhole===o)d=l.result;else{var m=c.len>0?c._:{},g=null;if("comments"===a){for(var v=document.createElement("c"),p=0,y=h.length;p<y;p++)if(v.innerHTML=h[p].note,g=r?v.innerText:v.innerText.toUpperCase(),!o&&-1!==g.indexOf(n)||o&&g===n){var b={ri:h[p].row,ci:h[p].col};b.cmt=h[p],d.push(b)}}else for(var w in m){var x=m[w].cells;for(var k in x)if("values"===a?g=r?x[k].text:x[k].text.toUpperCase():"formulas"===a&&(g=void 0!==x[k].f?r?x[k].f:x[k].f.toUpperCase():null),null!=g&&(o&&g===n||!o&&-1!==g.indexOf(n))){var C={ri:w,ci:k};d.push(C)}}l.keywords=n,l.lookin=a,l.matchwhole=o,l.iscasesense=r,l.result=d}if(0===d.length)return void alert("We couldn't find what you were looking for.");var S=-1,_=Number(t.indexes[0]),T=Number(t.indexes[1]),O=d.length-1;if(1===d.length)S=0;else if("next"===i){for(var E=0,R=d.length;E<R;E++){if(Number(d[E].ri)===_&&Number(d[E].ci)>T){S=E;break}if(Number(d[E].ri)>_){S=E;break}}-1===S&&(S=0)}else{for(var I=O;I>=0;I--){if(Number(d[I].ri)===_&&Number(d[I].ci)<T){S=I;break}if(Number(d[I].ri)<_){S=I;break}}-1===S&&(S=O)}l.current=S;var A=d[S];if(t.set(A.ri,A.ci),d[S].cmt){var D=A.cmt.note;if(""!==D){var P=s.cellRectWithOutTransfer(A.ri,A.ci);u.col=A.ci,u.row=A.ri,u.onEdit=!1,u.setPosition(D,P)}}no.call(e)}},c.showMenuBefore=function(t){var i=r()(e.selector.indexes,2),n=i[0],a=i[1],o=!1;if(t.forEach((function(e){return e.show()})),e.canvas.isImageOnSelected()){if(t.forEach((function(e){-1===["copy","cut","paste","link"].indexOf(e.key)&&e.hide()})),e.canvas.checkHyperlink(e.canvas.fabric))return;e.canvas.validType(e.canvas.fabric,"type","Chart")&&(o=!0)}if(!e.hyperlink.check(e.data,n,a)){var s=null;if(t.forEach((function(e){o&&"link"===e.key&&(s.hide(),e.hide()),"openLink"===e.key&&e.hide(),"removeLink"===e.key&&e.hide(),s=e})),window.mobileAndTabletCheck()){var l=["edit","cut","copy","paste","merge","unmerge","clear"].map((function(e){return U("contextmenu.".concat(e))}));t.forEach((function(t){l.includes(t.el.innerText)||t.hide(),t.el.className.includes("divider")&&t.hide(),e.data.merges.equals(e.selector.range)&&t.el.innerText===U("contextmenu.merge")&&t.hide(),e.data.merges.equals(e.selector.range)||t.el.innerText!==U("contextmenu.unmerge")||t.hide()}))}}},c.itemClick=function(t){if("validation"===t)v.setValue(e.data.getSelectedValidation());else if("sort"===t)p.setValue(e.data.getSelectedSort());else if("download"===t)y.setValue(e.filename);else if("link"===t){if(e.canvas.isImageOnSelected())return void e.canvas.link(e.data);var i=e.selector.range,n=e.hyperlink.getSelectArea(i),r=e.hyperlink.findByArea(e.data,n),a="edit";if(!r){(r={}).area=n;var o=e.data.getCell(i.sri,i.sci);r.text=o?o.text:"",a="add"}b.setValue(xs.datas.map((function(e){return e.name})),r,a)}else"removeLink"===t?e.canvas.isImageOnSelected()?e.canvas.removeLink(e.data):e.hyperlink.removeByRange(e.selector.range,e):"openLink"===t?e.canvas.isImageOnSelected()?e.canvas.openLink(e.data):e.hyperlink.accessByRange(e.selector.range,e.data):"copy"===t?(mo.call(e),e.canvas.doOperation("copy")):"cut"===t?(go.call(e),e.canvas.doOperation("copy"),e.canvas.doOperation("delete")):"paste"===t?S.clipboard?e.canvas.doOperation("paste"):vo.call(e,"all"):"paste-value"===t?vo.call(e,"text"):"paste-format"===t?vo.call(e,"format"):"hide"===t?po.call(e):"delete-image"===t?e.canvas.doOperation("delete"):"merge"===t?(e.data.setSelectedCellAttr(t,!0),e.table.render()):"unmerge"===t?(e.data.setSelectedCellAttr("merge",!1),e.table.render()):"edit"===t?Ro.call(e):jo.call(e,t)},Te(window,"resize",(function(){window.mobileAndTabletCheck()||e.reload()})),Te(window,"click",(function(e){})),Te(window,"paste",(function(t){e.focusing&&"commentEdit"!==t.target.parentElement.id&&(t.target.parentElement.parentElement&&"commentEdit"===t.target.parentElement.parentElement.id||(vo.call(e,"all",t),t.preventDefault()))})),Te(window,"keydown",(function(t){if(e.focusing&&"commentEdit"!==t.target.id){var i=t.keyCode||t.which,n=t.key,r=t.ctrlKey,a=t.shiftKey,o=t.metaKey;if(r||o)switch(i){case 90:e.undo(),t.preventDefault();break;case 89:e.redo(),t.preventDefault();break;case 67:mo.call(e),S.doOperation("copy"),t.preventDefault();break;case 88:go.call(e),t.preventDefault();break;case 85:d.trigger("underline"),t.preventDefault();break;case 86:S.clipboard?S.doOperation("paste"):vo.call(e,"all"),t.preventDefault();break;case 37:ao.call(e,a,"row-first"),t.preventDefault();break;case 38:ao.call(e,a,"col-first"),t.preventDefault();break;case 39:ao.call(e,a,"row-last"),t.preventDefault();break;case 40:ao.call(e,a,"col-last"),t.preventDefault();break;case 32:ro.call(e,!1,-1,e.data.selector.ci,!1),t.preventDefault();break;case 66:d.trigger("bold");break;case 73:d.trigger("italic")}else{switch(i){case 32:a&&ro.call(e,!1,e.data.selector.ri,-1,!1);break;case 27:c.hide(),h.hide(),fo.call(e);break;case 37:ao.call(e,a,"left"),t.preventDefault();break;case 38:ao.call(e,a,"up"),t.preventDefault();break;case 39:ao.call(e,a,"right"),t.preventDefault();break;case 40:ao.call(e,a,"down"),t.preventDefault();break;case 9:l.clear(),ao.call(e,!1,a?"left":"right"),t.preventDefault();break;case 13:l.clear(),ao.call(e,!1,a?"up":"down"),t.preventDefault();break;case 8:jo.call(e,"delete-cell-text"),t.preventDefault()}"Delete"===n?(jo.call(e,"delete-cell-text"),S.doOperation("delete"),t.preventDefault()):i>=65&&i<=90||i>=48&&i<=57||i>=96&&i<=105||"="===t.key?(Lo.call(e,t.key,"input"),Ro.call(e),Ao.call(e)):113===i&&Ro.call(e)}}}))}var Yo=function(){function e(t,i){var n=this;l()(this,e),this.eventMap=new Map;var r=i.settings,a=r.view,o=r.showToolbar,s=r.showFileName,c=r.showContextmenu,h=r.mode,u=r.showPartToolbar,d=r.contextMenuItems,m=r.local;this.el=f("div","".concat(ae,"-sheet")),this.menubar=new $a(i,a.width,!o,u,s,this,m),this.toolbar=new Er(i,a.width,!o,u),this.formulaBar=new Zr(i,h),this.canvas=new wa,this.print=new Ci(i,this.canvas),this.hyperlink=new Ua,t.children(this.menubar.el,this.toolbar.el,this.formulaBar.el,this.el,this.print.el),this.data=i,this.tableEl=f("canvas","".concat(ae,"-table"));var g=i.settings.row.height;this.rowResizer=new Me(!1,g,this),this.colResizer=new Me(!0,i.cols.minWidth,this),this.verticalScrollbar=new Le(!0),this.horizontalScrollbar=new Le(!1),this.editor=new mi(ut,(function(){return n.getTableOffset()}),g,this),this.modalValidation=new jr,this.modalSort=new Hr,this.modalDownload=new Va,this.modalLink=new Za,this.modalSearch=new Gr,this.modalInsertURLImage=new ka,this.contextMenu=new Ei((function(){return n.getRect()}),this,!c,d),this.commentTip=new Yr,this.commentEditable=new Jr,this.selector=new $e(i),this.highlight=new qa(this),this.overlayerCEl=f("div","".concat(ae,"-overlayer-content")).children(this.editor.el,this.selector.el),this.overlayerEl=f("div","".concat(ae,"-overlayer")).children(this.overlayerCEl,this.canvas),this.sortFilter=new qr,this.el.children(this.tableEl,this.overlayerEl.el,this.rowResizer.el,this.colResizer.el,this.verticalScrollbar.el,this.horizontalScrollbar.el,this.contextMenu.el,this.commentTip.el,this.commentEditable.el,this.modalValidation.el,this.modalSort.el,this.modalDownload.el,this.modalLink.el,this.modalSearch.el,this.modalInsertURLImage.el,this.sortFilter.el),this.table=new ai(this.tableEl.el,i),qo.call(this),uo.call(this),ro.call(this,!1,0,0),this.canvas.init(this),this.imageUploadByLocalUrl=null,this.imageUploadByUrlUrl=null,this.reloadUrl=null,this.fileDownloadUrl=null,this.oleDownloadUrl=null,this.uniqueid="",this.filename=""}var t;return o()(e,[{key:"setReloadUrl",value:function(e){this.reloadUrl=e}},{key:"getReloadUrl",value:function(){return this.reloadUrl+"?filename="+this.filename+"&uid="+this.uniqueid}},{key:"on",value:function(e,t){return this.eventMap.set(e,t),this}},{key:"preMousedown",value:function(){_o.call(this)}},{key:"trigger",value:function(e){var t=this.eventMap;if(t.has(e)){for(var i,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];(i=t.get(e)).call.apply(i,[this].concat(r))}}},{key:"resetData",value:function(e){this.editor.clear(),this.data=e,lo.call(this),co.call(this);var t=this.getTableOffset();this.overlayerCEl.offset(t),e.displayRight2Left?this.overlayerCEl.el.setAttribute("dir","rtl"):this.overlayerCEl.el.removeAttribute("dir"),this.data.topOrder=0,this.toolbar.resetData(e),this.formulaBar.resetData(e),this.print.resetData(e),this.selector.resetData(e),this.table.resetData(e),this.canvas.reset(e),this.data.updateConditionImageDirection(),this.data.reloadImagesShapes(),this.hyperlink.loadLinkPosition(this);var i=this.highlight;setTimeout((function(){i.AutoShowOrHide()}),2e3)}},{key:"loadData",value:function(e){return this.data.setData(e),uo.call(this),this}},{key:"scrollV",value:function(e){var t=this.verticalScrollbar.scroll().top;this.verticalScrollbar.move({top:t-e})}},{key:"scrollToRow",value:function(e){var t=this.verticalScrollbar.scroll().top,i=this.data.viewRange().sri,n=e>i?-this.data.rows.sumHeight(i,e):this.data.rows.sumHeight(e,i);this.verticalScrollbar.move({top:t-n})}},{key:"scrollH",value:function(e){var t=this.horizontalScrollbar.scroll().left;this.horizontalScrollbar.move({left:t-e})}},{key:"selectMoveDown",value:function(){ao.call(this,!0,"down")}},{key:"freeze",value:function(e,t){var i=this.data;return this.canvas.doResetPosition(e,t),i.setFreeze(e,t),uo.call(this),this}},{key:"setActiveCell",value:function(e,t){return ro.call(this,!1,e,t),this.focusing=!0,this}},{key:"setEditForTextBox",value:function(e){return Io.call(this,e),this}},{key:"undo",value:function(){this.data.undo(),uo.call(this)}},{key:"redo",value:function(){this.data.redo(),uo.call(this)}},{key:"reload",value:function(){return uo.call(this),this}},{key:"setzoom",value:function(e){var t=this.data,i=this.table,n=this.canvas,r=this.selector;i.zoomlevel=e,t.zoomlevel=e;this.getTableOffset();1!==this.data.zoomlevel&&(r.br.useHideInput=!1),this.data.zoomlevel<1&&!window.mobileAndTabletCheck()&&(this.overlayerCEl.el.style.width="".concat(this.overlayerCEl.el.clientWidth/e,"px"),this.overlayerCEl.el.style.height="".concat(this.overlayerCEl.el.clientHeight/e,"px")),n.setZoom(e),uo.call(this),1!==this.data.zoomlevel&&(r.br.useHideInput=!0),t.updateConditionImageZoom()}},{key:"showHighlights",value:function(e){this.highlight.showHighlights(e)}},{key:"hideHighlights",value:function(){this.highlight.hideHighlights()}},{key:"getHighlightTexts",value:function(){return this.highlight.getHighlightTexts()}},{key:"addHighlightText",value:function(e,t,i,n){this.highlight.addHighlightText(e,t,i,n)}},{key:"removeHighlightText",value:function(e,t,i,n){this.highlight.removeHighlightText(e,t,i,n)}},{key:"getHighlightRanges",value:function(){return this.highlight.getHighlightRanges()}},{key:"addHighlightRange",value:function(e,t,i,n){this.highlight.addHighlightRange(e,t,i,n)}},{key:"removeHighlightRange",value:function(e,t,i,n){this.highlight.removeHighlightRange(e,t,i,n)}},{key:"setHighlightInverseRange",value:function(e,t,i,n){this.highlight.setHighlightInverseRange(e,t,i,n)}},{key:"getHighlightInverseRange",value:function(){return this.highlight.getHighlightInverseRange()}},{key:"removeHighlightInverseRange",value:function(){this.highlight.removeHighlightInverseRange()}},{key:"getHighlightShaps",value:function(){return this.highlight.getHighlightShaps()}},{key:"addHighlightShape",value:function(e){this.highlight.addHighlightShape(e)}},{key:"removeHighlightShape",value:function(e){this.highlight.removeHighlightShape(e)}},{key:"addHighlightTextBox",value:function(e,t,i){var n=this.data,r=(this.table,this.highlight,n.shapes.find((function(t){return t.id===e})));r?"TextBox"===r.type?(this.addHighlightShape(e),r.addHighlight(t,i)):console.error("shape is not textbox"):console.error("shape does not exist")}},{key:"removeHighlightTextBox",value:function(e,t,i){var n=this.data,r=(this.table,n.shapes.find((function(t){return t.id===e})));r?"TextBox"===r.type?-1!==n.highlighshapes.indexOf(e)&&r.removeHighlight(t,i):console.error("shape is not textbox"):console.error("shape does not exist")}},{key:"getHighlightImages",value:function(){return this.highlight.getHighlightImages()}},{key:"addHighlightImage",value:function(e){this.highlight.addHighlightImage(e)}},{key:"removeHighlightImage",value:function(e){this.highlight.removeHighlightImage(e)}},{key:"setHighlightAll",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.highlight;i.setHighlightAll(e,t)}},{key:"setCustomHighlightImgFunc",value:function(e){this.highlight.setCustomHighlightImgFunc(e)}},{key:"getImageContextMenuItems",value:function(){return this.contextMenu.getImageContextMenuItems()}},{key:"addImageContextMenuItems",value:function(e){this.contextMenu.addImageContextMenuItems(e)}},{key:"delImageContextMenuItems",value:function(e){this.contextMenu.delImageContextMenuItems(e)}},{key:"getCustomContextMenuItems",value:function(){return this.contextMenu.getCutomContextMenuItems()}},{key:"addCustomContextMenuItems",value:function(e){this.contextMenu.addCutomContextMenuItems(e)}},{key:"insertCustomContextMenuItem",value:function(e,t){this.contextMenu.insertCutomContextMenuItem(e,t)}},{key:"updateCustomContextMenuItem",value:function(e,t){this.contextMenu.updateCutomContextMenuItem(e,t)}},{key:"delCustomContextMenuItems",value:function(e){this.contextMenu.delCutomContextMenuItems(e)}},{key:"getOle",value:(t=be()(Ce.a.mark((function e(t){var i;return Ce.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=this.oleDownloadUrl+"?id="+t+"&uid="+this.uniqueid+"&sheet="+this.data.name,Xo.call(this,i);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"getRect",value:function(){var e=this.data;return{width:e.viewWidth(),height:e.viewHeight()}}},{key:"getTableOffset",value:function(){var e=this.data,t=e.rows,i=e.cols,n=e.displayRight2Left,r=this.table.zoomlevel,a=this.data.settings.row.height,o=this.getRect(),s=o.width,l=o.height;return{width:(s-i.indexWidth)*r,height:(l-t.height)*r,left:n?0:i.indexWidth*r,top:a*r}}}]),e}();function Vo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Go=function(e){ee()(i,e);var t=Vo(i);function i(e){var n;l()(this,i);var r=new se("ellipsis");return(n=t.call(this,r,"auto",!1,"top-left")).contentClick=e,n}return o()(i,[{key:"reset",value:function(e){var t=this,i=e.map((function(e,i){return f("div","".concat(ae,"-item")).css("width","150px").css("font-weight","normal").on("click",(function(){t.contentClick(i),t.hide()})).child(e)}));this.setContentChildren.apply(this,m()(i))}},{key:"setTitle",value:function(){}}]),i}(Mi),Zo=function(e){ee()(i,e);var t=Vo(i);function i(e){var n;l()(this,i);var r=new se("pagination");return(n=t.call(this,r,"100px",!1,"top-left")).contentEl.css("max-height","298px"),n.contentEl.css("overflow-y","auto"),n.contentClick=e,n}return o()(i,[{key:"reset",value:function(e){var t=this,i=e.map((function(e,i){return f("div","".concat(ae,"-item")).css("width","auto").css("font-weight","normal").on("click",(function(){t.contentClick(i),t.hide()})).child(e)}));this.setContentChildren.apply(this,m()(i))}}]),i}(Mi),Ko=[{key:"delete",title:X("contextmenu.deleteSheet")}];function Jo(e){var t=this;return f("div","".concat(ae,"-item")).child(e.title()).on("click",(function(){t.itemClick(e.key),t.hide()}))}function $o(){var e=this;return Ko.map((function(t){return Jo.call(e,t)}))}var Qo=function(){function e(){var t;l()(this,e),this.el=(t=f("div","".concat(ae,"-contextmenu")).css("width","160px")).children.apply(t,m()($o.call(this))).hide(),this.itemClick=function(){}}return o()(e,[{key:"hide",value:function(){var e=this.el;e.hide(),Ee(e)}},{key:"setOffset",value:function(e){var t=this.el;t.offset(e),t.show(),Re(t)}}]),e}(),es=function(){function e(){var t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},s=arguments.length>5?arguments[5]:void 0;l()(this,e),this.settings=s,this.addFunc=i,this.swapFunc=n,this.updateFunc=a,this.scrollFunc=o,this.dataNames=[],this.activeEl=null,this.deleteEl=null,this.items=[],this.moreEl=new Go((function(e){t.clickSwap2(t.items[e])})),this.paginationEl=new Zo((function(e){t.scrollFunc(e)})),this.contextMenu=new Qo,this.contextMenu.itemClick=r,this.el=f("div","".concat(ae,"-bottombar")).children(this.contextMenu.el,this.menuEl=this.setMenuEl())}return o()(e,[{key:"setMenuEl",value:function(){var e=this;return"edit"===this.settings.mode?f("ul","".concat(ae,"-menu")).child(f("li","").children(new se("add").on("click",(function(){e.dataNames.length<10?e.addFunc():le("Warning","It is less than or equal to 10")})),f("span","").child(this.moreEl))):f("ul","".concat(ae,"-menu")).child(f("li","").children(f("span","").child(this.moreEl)))}},{key:"addItem",value:function(e,t,i,n){this.dataNames.push(e);var r=f("li",t?"active":"").child(e);void 0!==i&&(r.el.style.color=n,r.el.style.backgroundColor=i),this.setItemEvent(r),t&&this.clickSwap(r),this.items.push(r),this.menuEl.child(r),this.moreEl.reset(this.dataNames)}},{key:"addPagination",value:function(e){for(var t=[],i=1;i<=e;i++){var n=i+"";t.push(n)}this.paginationEl.reset(t)}},{key:"setItemEvent",value:function(e){var t=this;"edit"===this.settings.mode?e.on("click",(function(){t.clickSwap2(e)})).on("contextmenu",(function(i){var n=i.target,r=n.offsetLeft,a=n.offsetHeight;t.contextMenu.setOffset({left:r,bottom:a+1}),t.deleteEl=e})).on("dblclick",(function(){if(!(e.el.children.length>0)){var i=e.html(),n=new Ir("auto","",31);n.val(i),n.input.on("blur",(function(e){var r=e.target.value,a=t.dataNames.findIndex((function(e){return e===i}));t.renameItem(a,r,n)})),e.html("").child(n.el),n.focus()}})):e.on("click",(function(){t.clickSwap2(e)}))}},{key:"renameItem",value:function(e,t,i){if(this.dataNames[e]!==t&&0!==t.length)if(t.length>31)le("Error","The max length of the sheet name is 31",(function(){i.focus()}));else if(this.dataNames.indexOf(t)>=0)le("Error","Same worksheet name already exist",(function(){i.focus()}));else{for(var n=0;n<t.length;n++)switch(t[n]){case":":case"\\":case"/":case"?":case"*":case"[":case"]":return void le("Error","Worksheet name could not contain any following characters : : \\ / ? * [ or ]",(function(){i.focus()}))}this.dataNames.splice(e,1,t),this.moreEl.reset(this.dataNames),this.items[e].html("").child(t),this.updateFunc(e,t)}else this.items[e].html("").child(t)}},{key:"clear",value:function(){var e=this;this.items.forEach((function(t){e.menuEl.removeChild(t.el)})),this.items=[],this.dataNames=[],this.moreEl.reset(this.dataNames)}},{key:"hide",value:function(){var e=this.el;e.hide(),Ee(e)}},{key:"deleteItem",value:function(){var e=this.activeEl,t=this.deleteEl;if(this.items.length>1){var i=this.items.findIndex((function(e){return e===t}));if(this.items.splice(i,1),this.dataNames.splice(i,1),this.menuEl.removeChild(t.el),this.moreEl.reset(this.dataNames),e===t){var n=r()(this.items,1)[0];return this.activeEl=n,this.activeEl.toggle(),[i,0]}return[i,-1]}return[-1]}},{key:"clickSwap2",value:function(e){var t=this.items.findIndex((function(t){return t===e}));this.clickSwap(e),this.activeEl.toggle(),this.swapFunc(t)}},{key:"clickSwap",value:function(e){if(null!==this.activeEl){this.activeEl.toggle();var t=this.activeEl.el.style.backgroundColor;t&&(this.activeEl.el.style.backgroundColor=(i=t.match(/[\d.]+/g)).length>=3?"rgb("+i[0]+","+i[1]+","+i[2]+")":"")}var i;this.activeEl=e;var n=e.el.style.backgroundColor;n&&(this.activeEl.el.style.backgroundColor=function(e,t){var i=e.match(/[\d.]+/g);if(i.length>=3)return"rgba("+i[0]+","+i[1]+","+i[2]+","+t+")"}(n,.1))}},{key:"setDirection",value:function(e){e?this.el.attr("dir","rtl"):this.el.removeAttr("dir")}}]),e}();i(35),i(36);function ts(e){var t=[],i=0;this.run=function(e){var n=this;this.startHandler(e,(function(){i--,e.timestm,e.isfinish,t.length>0&&n.run(t.shift())}))},this.startHandler=function(n,r){var a=this;n.isfinish?t.length>0&&this.run(t.shift()):0!==i?setTimeout((function(){return a.startHandler(n,r)}),300):(i++,n.timestm,n.isfinish,e(n,r))},this.append=function(e){t.push(e),t.length,e.timestm,1===t.length&&this.run(e)},this.isFinish=function(){return 0===t.length&&0===i}}var is=function e(t,i,n,r){l()(this,e),this.item=t,this.url=i,this.callback=n,this.callbackerror=r,this.isfinish=!1,this.timestm="["+(new Date).getTime()+"] "};function ns(e,t){var i=$.ajax({url:e.url,type:"post",dataType:"json",data:e.item});e.timestm,e.isfinish,i.done((function(i){e.timestm,e.callback&&(e.callback(i),e.isfinish=!0),t()})),i.fail((function(i,n,r){e.timestm,e.callbackerror&&(e.callbackerror(i,n,r),e.isfinish=!0),t()}))}function rs(e){e.scaleX=1,e.scaleY=1,e.originAngle=e.angle;var t=e.originAngle;t<0&&(t+=360),t>90&&t<180?t=180-t:t>=180&&t<270?t-=180:t>=270&&(t=360-t),t>=45&&(t=90-t);Math.sin(.017453293*t),Math.cos(.017453293*t);e.originWidth=e.width,e.originHeight=e.height,e.originLeft=e.left,e.originTop=e.top}function as(e,t,i,n,r){var a,o,s;return{tick:e.tick,width:e.width,height:e.height,top:e.top+n.top/r,left:i+n.left/r,"z-index":t+e.zorder,originAngle:e.originAngle,rotate:e.angle,imgType:e.type,strid:e.strid,text:e.text,html:e.html,hyperlink:e.hyperlink,zorder:e.zorder,fromOutside:null!==(a=e.fromOutside)&&void 0!==a&&a,scaleX:null!==(o=e.scaleX)&&void 0!==o?o:1,scaleY:null!==(s=e.scaleY)&&void 0!==s?s:1}}var os=function(){function e(t){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};l()(this,e);var r=t;this.options=n,n.local&&q(n.local),this.sheetIndex=0,this.datas=[],this.uniqueid="",this.filename="",this.imageDiv=null,this.imageUrl=null,this.basicZorder=0,this.istestforimage=!1,this.buffer=new ts(ns),"string"==typeof t&&(r=document.querySelector(t)),window.mobileAndTabletCheck=function(){var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),t},window.mobileEditOnCell=!1,Fe((function(e){var t=i.sheet;t.data,t.selector,t.canvas,t.editor,t.verticalScrollbar;window.keyboardShow=!1,i.sheet.preMousedown(),i.reRender(),window.mobileEditOnCell=!1}),(function(e){window.keyboardShow=!0;var t=i.sheet,n=t.data;t.selector,t.editor,t.verticalScrollbar;window.mobileEditOnCell&&i.sheet.scrollToRow(n.selector.ri)})),this.bottombar=new es((function(){if(i.uniqueid.endsWith(".csv"))le("Warning","CSV file does not support more than one worksheet");else if(i.uniqueid.endsWith(".tsv"))le("Warning","TSV file does not support more than one worksheet");else{i.sheet.canvas.doNewSheetPage(i.sheet.data);var e=i.addSheet();e.showGrid=!0,i.sheet.resetData(e)}}),(function(e){var t=i.datas[e];t.scroll={ci:0,ri:0,riact:0,x:0,y:0,yact:0},i.sheet.canvas.doSwitchSheetPage(i.sheet.data),i.sheet.resetData(t),i.bottombar.setDirection(t.displayRight2Left),i.resetPagination(t),i.sheet.verticalScrollbar.move({top:0}),i.setZoomLevel(t.zoomlevel)}),(function(){i.deleteSheet()}),(function(e,t){i.renameSheet(e,t)}),(function(e){var t=e*i.data.settings.row.len,n=i.data.rows.sumHeight(0,t);i.sheet.verticalScrollbar.move({top:n-1})}),this.options),this.isloading=!0,this.data=this.addSheet(),this.isloading=!1,this.resetPagination(this.data);var a=f("div","".concat(ae)).on("contextmenu",(function(e){return e.preventDefault()}));r.appendChild(a.el),this.sheet=new Yo(a,this.data),this.sheet.hyperlink.setActiveSheetBySheetName=function(e){i.setActiveSheetByName(e)},this.sheet.hyperlink.setActiveCell=function(e,t){i.setActiveCell(e,t)},this.sheet.addSheet=this.bottombar.addFunc,a.child(this.bottombar.el)}return o()(e,[{key:"setUniqueId",value:function(e){this.uniqueid=e,this.sheet.uniqueid=e}},{key:"setFileDownloadInfo",value:function(e){this.sheet.fileDownloadUrl=e}},{key:"setOleDownloadInfo",value:function(e){this.sheet.oleDownloadUrl=e}},{key:"setFileName",value:function(e){this.filename=e,this.sheet.filename=e,this.sheet.menubar.setFileName(e)}},{key:"setZoomLevel",value:function(e){this.sheet.setzoom(e)}},{key:"setReloadUrl",value:function(e){this.sheet.setReloadUrl(e)}},{key:"setVisibleFilter",value:function(e){this.sheet.visibleFilter=e}},{key:"setFileDownloadCallFunction",value:function(e){this.sheet.fileDownloadCallFunc=e}},{key:"setImageInfo",value:function(e,t,i,n,r,a,o){return this.imageDiv=e,this.imageUrl=t,this.sheet.imageUploadByLocalUrl=i,this.sheet.imageUploadByUrlUrl=n,this.sheet.imageCopyUrl=r,this.basicZorder=a,this.updating=o,this}},{key:"setImageForTest",value:function(e,t,i){return this.imageDiv=e,this.imageUrl=t,this.basicZorder=i,this.istestforimage=!0,this}},{key:"setDisplayRight2Left",value:function(e){var t=this.sheet,i=this.bottombar,n=t.data;if(n.displayRight2Left!==e){n.displayRight2Left=e;var r=t.getTableOffset();t.overlayerCEl.offset(r),t.resetData(n),i.setDirection(e)}}},{key:"getUpdateDatas",value:function(){for(var e=[],t=0,i=this.datas.length;t<i;t++){var n=this.datas[t].getDataForSave();null!=n&&e.push(n)}return e}},{key:"addSheet",value:function(e){var t=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,a=e||"sheet".concat(this.sheetIndex),o=new pe(a,this.options);return o.rows.setCellText(0,0,""),o.change=function(){for(var e,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];(e=t.sheet).trigger.apply(e,["change"].concat(n))},o.updateCellsData=function(e){var i=t.sheet.data,n=i.updateCellError,r=i.updateMyCells,a=t.uniqueid,o=t.imageUrl;if(e.Error)e.cell&&(r.call(t.sheet.data,[e.cell]),t.reRender()),e.cells&&(r.call(t.sheet.data,e.cells),t.reRender()),e.p&&(t.sheet.data.updateRevertOpr(e.p),t.reRender()),n(e.Error);else if("update"===e.op)e.data.forEach((function(e,i,n){for(var r=0,s=new Array;r<t.datas.length;r++)if(t.datas[r].name===e.name){t.datas[r].updateMyCells(e.cells),t.datas[r].updateShapes(e.shapes,s),t.datas[r].updateMyConditionImages(e.conditionimg);break}t.sheet.data.updateShapeSrcToRefresh(a,o,e.pickey,s)})),t.reRender();else if("sort"===e.op)e.rowids&&e.rowids.length>0&&(t.sheet.data.sortByRowIdArray(e.r,e.rowids),t.reRender());else if("updateTextBox"===e.op){for(var s=0;s<t.sheet.data.shapes.length;s++)if(t.sheet.data.shapes[s].strid===e.id){t.sheet.data.shapes[s].updateTextBox(e.html,e.rtxt);break}t.reRender()}},o.updateServerError=function(){for(var e,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];(e=t.sheet).trigger.apply(e,["updateServerError"].concat(n))},o.updateCellError=function(){for(var e,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];(e=t.sheet).trigger.apply(e,["updateCellError"].concat(n))},o.updateCellServer=function(e){var i=t.sheet.data,n=i.settings,r=i.updateServerError,a=i.updateCellsData,o=t.uniqueid,s=t.buffer;if("server"===n.updateMode){var l={p:JSON.stringify(e),uid:o,folderName:n.folderName,fileName:n.fileName};s.append(new is(l,n.updateUrl,(function(e){a(e)}),(function(e,t,i){r(e,t,i)})))}},o.menubarStatus=function(){return!t.sheet||"up"===t.sheet.toolbar.menuDisplay.state},o.loadImages=function(){var e=t.sheet.data,i=e.images,n=e.displayRight2Left,r=e.cols,a=n?t.sheet.data.viewWidth()-r.indexWidth:0,o=(t.uniqueid,t.imageDiv,t.imageUrl,t.basicZorder),s=t.sheet,l=t.updating;s.canvas.basicZorder=null!=o?o:s.canvas.basicZorder;var c=s.getTableOffset();null!=i&&i.forEach((function(e){if("del"!==e.op){var t=n?a-e.left-e.width:e.left;s.data.topOrder=s.data.topOrder<e.zorder?e.zorder:s.data.topOrder;var i=as(e,o,t,c,s.table.zoomlevel);e.src?s.canvas.setImage(s,e,i,e.src):s.canvas.setImage(s,e,i,l)}}))},o.loadShapes=function(){var e=t.sheet.data,i=e.shapes,n=e.displayRight2Left,r=e.cols,a=n?t.sheet.data.viewWidth()-r.indexWidth:0,o=(t.uniqueid,t.imageDiv,t.imageUrl,t.basicZorder),s=t.sheet,l=t.updating;s.canvas.basicZorder=null!=o?o:s.canvas.basicZorder;var c=s.getTableOffset();null!=i&&i.forEach((function(e){if("del"!==e.op){var t=n?a-e.left-e.width:e.left;s.data.topOrder=s.data.topOrder<e.zorder?e.zorder:s.data.topOrder;var i=as(e,o,t,c,s.table.zoomlevel);"TextBox"===e.type?s.canvas.setTextBox(s,e,i):e.src?s.canvas.setImage(s,e,i,e.src):s.canvas.setImage(s,e,i,l)}}))},o.fillImageSrc=function(){var e=t.sheet.data,i=e.images,n=e.shapes,r=e.sheetid,a=e.isImageOk,o=t.uniqueid,s=(t.imageDiv,t.imageUrl);t.basicZorder;if(!a&&void 0!==r&&(null!=n&&n.length>0||null!=i&&i.length>0)){var l=t,c=t.istestforimage?s+"/"+o+"."+r+"_batch.zip":s+"?uid="+o+"&id="+r+"_batch.zip";t.istestforimage?l.sheet.data.generatePicItems(i,n,c):$.get(c,(function(e){l.sheet.data.generatePicItems(i,n,e)}))}},o.fillImageOnebyOne=function(e,i){var n=new XMLHttpRequest,r=t.sheet,a=setInterval((function(){r.data.loadCount<=0&&(r.data.isImageOk=!0,clearInterval(a))}),200);n.onreadystatechange=function(){if(4==n.readyState){var e=n.response,t=new Uint8Array(e);JSZip.loadAsync(t).then((function(e){i.forEach((function(t,i,n){e.file(t.name).async("blob").then((function(e){var i=URL.createObjectURL(e),n=r.canvas.fabric.getObjects().find((function(e){return e.id===t.id}));n&&"TextBox"!==n.imgType&&(n.setSrc(i,(function(e){var t;r.canvas.fabric.requestRenderAll(),r.canvas.saveCanvasData(r.data),null===(t=r.canvas.inFreeze)||void 0===t||t.loadFreezeImage()})),t.it.src=i),r.data.loadCount--}))}))}))}},n.open("GET",e,!0),n.responseType="arraybuffer",n.send()},o.loadConditionImage=function(){var e=t.sheet.data.conditionimg,i=t.imageDiv,n=t.basicZorder;e&&e.forEach((function(e){if(e.data){var t=o.createConditionImage(e,n);e.data=void 0,e.image=t,i.append(t)}else i.append(e.image)}))},o.insertConditionImage=function(e){var i=t.sheet.data.conditionimg,n=t.imageDiv,r=t.basicZorder;if(i)if(e.data){var a=o.createConditionImage(e,r);e.data=void 0,e.image=a,n.append(a),i.push(e)}else n.append(e.image)},o.reloadImagesShapes=function(){var e=t.imageDiv;null!=e&&(e.empty(),e.css("left",0),e.css("top",0),o.loadImages(),o.loadShapes(),o.loadConditionImage(),o.fillImageSrc())},o.scrollImagesShapes=function(){var e=t.imageDiv,i=t.sheet.canvas,n=t.sheet.data,r=n.scroll,a=n.displayRight2Left,o=n.zoomlevel;i.publishEvent("object:scroll",t.sheet.data),i.initFreeze(),null!=e&&(e.css("left",a?r.x*o:-r.x*o),e.css("top",-r.y*o))},this.datas.push(o),this.bottombar.addItem(a,i,n,r),this.sheetIndex+=1,this.isloading||this.sheet.data.addSheetOpr(a),o}},{key:"resetPagination",value:function(e){var t=e.rows.len,i=e.settings.row.len,n=t%i==0?t/i:Math.ceil(t/i);this.bottombar.addPagination(n)}},{key:"deleteSheet",value:function(){var e=this.bottombar.deleteItem(),t=r()(e,2),i=t[0],n=t[1];if(i>=0){var a=this.datas[i].name;this.sheet.data.delSheetOpr(a),this.datas.splice(i,1),n>=0&&this.sheet.resetData(this.datas[n])}}},{key:"renameSheet",value:function(e,t){var i=this.datas[e].name;this.datas[e].name=t,this.sheet.data.renameSheetOpr(i,t)}},{key:"loadData",value:function(e){this.isloading=!0;var t=Array.isArray(e)?e:[e];if(this.bottombar.clear(),this.datas=[],t.length>0)for(var i=0;i<t.length;i+=1){var n,a,o=t[i],s=this.addSheet(o.name,0===i,o.tabcolor,o.fontcolor);if(void 0!==o.merges)for(var l=0,c=o.merges.length;l<c;l++){var h=o.merges[l].split(":"),u=y(h[0]),f=r()(u,2),d=f[0],m=f[1],g=y(h[1]),v=r()(g,2),p=v[0],b=v[1];o.rows[m]&&o.rows[m].cells[d]&&(o.rows[m].cells[d].merge=[b-m,p-d])}null===(n=o.images)||void 0===n||n.forEach((function(e){rs(e)})),null===(a=o.shapes)||void 0===a||a.forEach((function(e){rs(e)})),s.setData(o)}return this.isloading=!1,this}},{key:"getData",value:function(){return this.datas.map((function(e){return e.getData()}))}},{key:"cellText",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.datas[n].setCellText(e,t,i,"finished"),this}},{key:"setActiveCell",value:function(e,t){return this.sheet.setActiveCell(e,t),this}},{key:"setActiveSheet",value:function(e){return this.bottombar.clickSwap2(this.bottombar.items[e]),this}},{key:"getActiveSheet",value:function(){return this.bottombar.dataNames.indexOf(this.sheet.data.name)}},{key:"getActiveSheetName",value:function(){return this.sheet.data.name}},{key:"setActiveSheetByName",value:function(e){for(var t=0;t<this.bottombar.dataNames.length;t++)if(this.bottombar.dataNames[t]===e){this.bottombar.clickSwap2(this.bottombar.items[t]);break}return this}},{key:"cell",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.datas[i].getCell(e,t)}},{key:"cellStyle",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.datas[i].getCellStyle(e,t)}},{key:"reRender",value:function(){return this.sheet.table.render(),this.sheet.canvas.fabric.requestRenderAll(),this}},{key:"showHighlights",value:function(e){this.sheet.showHighlights(e)}},{key:"hideHighlights",value:function(){this.sheet.hideHighlights()}},{key:"on",value:function(e,t){return this.sheet.on(e,t),this}},{key:"validate",value:function(){return this.data.validations.errors.size<=0}},{key:"change",value:function(e){return this.sheet.on("change",e),this}},{key:"updateServerError",value:function(e){return this.sheet.on("updateServerError",e),this}},{key:"updateCellError",value:function(e){return this.sheet.on("updateCellError",e),this}}],[{key:"locale",value:function(e,t){W(e,t)}}]),e}(),ss=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new os(e,t)};window&&(window.x_spreadsheet=ss,window.x_spreadsheet.locale=function(e,t){return W(e,t)});t.default=os}]);